Developer Resources
API Resources
Creating a Node Walkthrough
2min
This document will walk you through everything you need to know to create a node on Voltage via the API. First we'll describe the process then show a complete code example.
Here's the general process of creating a node via our API:
- Call the /node endpoint every 5 or 10 seconds to check on the status of the node. It's first status is provisioning.
- After it's provisioned it will switch to status waiting_init. This means the node is waiting to be initialized. Now you should call /v1/genseed on the node to generate a seed for yourself.
- Once you have a seed, you can initialize the wallet. Call the /v1/initwallet endpoint on the node. Pass in it the seed created in step #3 and a password. YOU MUST ALSO SET stateless_init: true! If you don't then you won't be able to access the node. This will return a macaroon in the API response.
- After your node is initialized, you can encrypt the seed and macaroon to your password used for the node.
- Use the /node/upload_seed and /node/macaroon endpoints to backup your encrypted seed and macaroon. (Give the macaroon a name of admin)
- That's it! Your node's status should now be running and you can use your macaroon to connect. We use TLS Certificates that are signed by a trusted Certificate Authority so it's not required to supply it when connecting. However, there are some applications that require it nonetheless. If you encounter one, you can get your node's certificate with the /node/cert endpoint.
Here is an example script written in Node.js. This script would create a node, initialize it, and upload the encrypted backups.
Updated 04 May 2024
Did this page help you?