Overview
Testing Guide
Learn how to test your token issuance and operations on Spark
Setting Up Your Test Environment
Prerequisites
- Node.js 16+ or Rust installed
- Spark CLI tool
Using our Spark CLI tool
We have a CLI tool that allows you to test your wallet operations on Spark. No coding is required!
To install the CLI tool, you can run:
Go to the examples folder:
Install dependencies:
Start the CLI tool: Pick network as mainnet or regtest
This will start the CLI tool and you will be able to interact with the wallet. Run help
to see the available commands.
Command Reference
Command | How to Run |
---|---|
initwallet | initwallet <mnemonic/seed> - Creates a new wallet instance. If no mnemonic provided, generates one |
getbalance | getbalance - Gets the current wallet balance as well the token balance |
getdepositaddress | getdepositaddress - Generates a Bitcoin deposit address |
getsparkaddress | getsparkaddress - Gets a new Spark address for receiving transfers |
sendtransfer | sendtransfer <amount> <receiverSparkAddress> - Sends a Spark transfer |
createinvoice | createinvoice <amount> <memo> - Creates a new Lightning invoice |
payinvoice | payinvoice <invoice> - Pays a Lightning invoice |
tokentransfer | tokentransfer <tokenPubKey> <amount> <receiverSparkAddress> - Sends a token transfer to given receiver spark address |
withdraw | withdraw <onchainAddress> <amount> - Withdraws funds to a Bitcoin address |
help | help - Shows the help menu |
exit | exit or quit - Exits the CLI tool |
Demp application
The Demo Application presented at the Hackation is available Here