This is an example Android application that demonstrates how to use the Tapyrus Wallet library to interact with the Tapyrus blockchain.
This example application showcases the functionality of the Tapyrus Wallet Android library, which is a wallet library for the Tapyrus blockchain. The application is configured to connect to the Tapyrus blockchain testnet network.
Key features of the example app:
- Generate and manage wallet addresses
- View wallet balance
- Sync wallet with the blockchain
- Send TPC (Tapyrus coins) to other addresses
This example is configured to connect to the Tapyrus testnet network. You can explore the testnet using the explorer at: https://testnet-explorer.tapyrus.dev.chaintope.com
- Docker and Docker Compose
- Android Studio
- Android device or emulator
- Sufficient disk space for blockchain data
The example includes a docker-compose.yml file that sets up both the Tapyrus node (tapyrusd) and the Electrum server (electrs/esplora-tapyrus).
-
Navigate to the example directory:
cd example -
Start the Docker containers:
docker compose up -d -
Wait for the Tapyrus node to synchronize with the testnet network. You can check the synchronization status by viewing the logs:
docker compose logs -f tapyrusdThe synchronization process may take some time depending on your internet connection and system performance.
This project uses a library from GitHub Packages, which requires authentication even for public packages. Follow these steps to set up authentication:
- Create a GitHub Personal Access Token (PAT) with the
read:packagesscope - Add your GitHub username and token to your Gradle properties file:
- Option 1: Project-level gradle.properties (not recommended for sensitive information)
# In project's gradle.properties gpr.user=YOUR_GITHUB_USERNAME gpr.key=YOUR_GITHUB_TOKEN - Option 2: Global gradle.properties (recommended)
# In ~/.gradle/gradle.properties gpr.user=YOUR_GITHUB_USERNAME gpr.key=YOUR_GITHUB_TOKEN
- Option 1: Project-level gradle.properties (not recommended for sensitive information)
Once you've set up the GitHub authentication and started the Docker services, you can build and run the app:
-
Open the project in Android Studio:
# Open Android Studio and select "Open an existing Android Studio project" # Navigate to the TapyrusWalletAndroid/example directory -
Build the project:
./gradlew assembleDebug -
Install and run the app on your device or emulator:
./gradlew installDebugOr simply run the app directly from Android Studio by clicking the "Run" button.
- Generate Address: Tap the "Generate & Copy Address" button to create a new Tapyrus address and copy it to the clipboard.
- Sync Wallet: Tap the "Sync Wallet" button to synchronize your wallet with the blockchain and update your balance.
- Send TPC: Use the transfer dialog to send TPC to another address by entering the recipient's address and the amount to send.
When you're done using the example, you can stop the Docker containers:
docker-compose down
The blockchain data and wallet database are stored in the following locations:
- Blockchain data:
./datadirectory - Electrs data:
./electrsdirectory - Wallet database: In the app's internal storage on the Android device or emulator
This example is for demonstration purposes and connects to the testnet. For production applications, you would need to configure the wallet to connect to the Tapyrus mainnet and implement additional security measures.