This repository contains a collection of Android apps built on top of IPv8 (our P2P networking stack) and TrustChain (a scalable, distributed, pair-wise ledger). All applications are built into a single APK, following the concept of super apps – an emerging trend that allows to provide an ecosystem for multiple services within a single all-in-one app experience.
TrustChain Explorer allows to browse the TrustChain blocks stored locally on the device and crawl chains of other connected peers. It also demonstrates how to interact with TrustChainCommunity
. It defines its own DemoCommunity
to ensure that all users using the app are able to discover each other easily. The content of the app is split into several tabs:
- Peers: A list of discovered peers in
DemoCommunity
. For each peer, there is a time since the last sent and received message, and an average ping latency. After clicking on the peer item, a list of mutual blocks in TrustChain is shown. It is possible to create and send a new proposal block by clicking on the plus icon. A crawl request send be sent by clicking on the refresh button. - Chains: A list of discovered chains in
TrustChainComunity
, ordered by their length. After clicking on the item, the list of stored blocks is shown. - All Blocks: A stream of all received blocks, updated in real-time as new blocks are received from the network.
- My Chain: A list of blocks in which the current user is participating either as a sender or a receiver. It is possible to create a new self-signed block by clicking on the plus icon. It is posible to sign received blocks if they are not defined to be signed automatically.
Debug shows various information related to connectivity, including:
- The list of bootstrap servers and their health. The server is considered to be alive if we received a response from it within the last 120 seconds.
- The number of connected peers in the loaded overlays.
- The LAN address estimated from the network interface and the WAN address estimated from the packets received from peers outside of our LAN.
- The public key and member ID (SHA-1 hash of the public key)
- TrustChain statistics (the number of stored blocks and the length of our own chain)
If you want to build an APK, run the following command:
./gradlew :app:buildDebug
The resulting APK will be stored in app/build/outputs/apk/debug/app-debug.apk
.
You can also build and automatically install the app on all connected Android devices with a single command:
./gradlew :app:installDebug
Note: It is required to have an Android device connected with USB debugging enabled before running this command.
Run unit tests:
./gradlew test
Run instrumented tests:
./gradlew connectedAndroidTest
Ktlint is used to enforce a consistent code style across the whole project.
Check code style:
./gradlew ktlintCheck
Run code formatter:
./gradlew ktlintFormat