This project provides Android bindings for go-perun called prnm.
Right now, it supports two-party single-asset ledger payment channels.
The authors take no responsibility for any loss of digital assets or other damage caused by the use of this software.
Do not use this software with real funds.
# Install gomobile, see https://godoc.org/golang.org/x/mobile/cmd/gomobile
go get golang.org/x/mobile/cmd/gomobile
gomobile init
# Get perun-eth-mobile
git clone https://github.com/perun-network/perun-eth-mobile
# Generate the bindings
cd perun-eth-mobile
gomobile bind -o android/app/prnm.aar -target=android
👉 More in-depth instructions can be found in DEVELOPING.md.
The android/
folder is an Android Studio Project, the only two important files are:
android/app/src/main/java/network/perun/app/MainActivity.java
contains the Apps logic, exemplifying the use ofgo-perun
.
TheMainActivity
uses aNode
to propose and accept payment channels. TheNode
is started with aprnm.Config
which contains all needed configuration for the underlyingprnm.Client
. Its contructor creates aProposalHandler
that accepts all incomming channel proposals and forwards the new channels toNode.accept
.Node.accept
then starts two threads; one with anUpdateHandler
that accepts all updates and one as on-chain watcher that reacts to disputes and settling. To propose a channel,Node.propose
can be used.android/app/src/main/AndroidManifest.xml
lists the needed App permissions;INTERNET
,ACCESS_NETWORK_STATE
,WRITE_EXTERNAL_STORAGE
,READ_EXTERNAL_STORAGE
After importing the android/
folder in Android Studio, run it in the Emulator or on a real phone.
The opposite party can be either also an App, or a perun-eth-demo-node.
Copyright © 2020 Chair of Applied Cryptography, Technische Universität Darmstadt, Germany. All rights reserved. Use of the source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
Contact us at [email protected].