I recently deployed a Cardano node on Google Cloud Platform and used its API to create and watch addresses, and make transactions.
Helpfully, Cardano make it quite simple to get up and running if you are familiar with Docker-Compose, and know where to look, and what questions to ask.
The Cardano Wallet repo1 contains almost all you need to get started. The command to run is:
NETWORK=testnet docker-compose up -d
This does a couple of things for you:
- Creates a Cardano node and begins syncing with the network
- Creates a Cardano Wallet instance
- Creates all the required data volumes
- Maps the ports required to make API calls.
docker ps should show that two containers are running,
In order to run
cardano-wallet commands (not using the API, but directly on the node) you'll need to
docker exec into the container like this:
sudo docker exec -it cardano-wallet_cardano-wallet_1 sh
Then you can run commands like:
cardano-wallet network information
Similarly, if you want to use the
cardano-cli programme, exec into the
sudo docker exec -it cardano-wallet_cardano-node_1 sh
Perhaps you wont need to do this though because once the containers are up and running and online, you can use the REST API to monitor the node, make transactions, and watch addresses2.
For example, a good test to see if the node is ok is to run
Addresses on Cardano need to be BIP39 compliant, and before you can use the REST API to create the address you will need to have already generated the keys and the mnemonic. This can be done using various other tools (web page, python) and the results put into a JSON file according to the API spec.
Cardano requires that addresses are created sequentially and instead of allowing the user to generate them ad-hoc, the node by default will manage the creation of addresses of each wallet3.
The value of
ADDRESS_POOL_GAP sets the number of unused addresses in each wallet. By default this is 20. When an address is used, the node will automatically generate a new unused address for the wallet, so that there is always a pool of 20 unused addresses.