Running your node
For most end users the Radix Desktop Wallet is the best and easiest choice for sending, receiving and staking their XRD tokens on the network. However when you run a node you can also use this node as a wallet. By doing this your node communicates directly to the Radix network without the need of an archive node as an API.
This might be valuable if you want to run a totally trustless wallet and/or maximize the usage and automation of the wallet. This manual describes how you can make a start with this.
This is for advanced users and requires some basic Linux skills. You need to be confident with using the command line. There will be no graphical user interface ;)
danger
Please be aware of the big risks that you take using a node as a wallet. This is only for advanced users who know what they are doing. For securing your tokens we advice to use a cold wallet. Please think about security, your node can be abused or your wallet file can be stolen!
#
Getting StartedFirst you need get your own node running. For this some Linux knowledge is required. The most easy way is to use an Ubuntu installation for this since Radix supports this. You can use a Virtual Machine on your own computer. But you can also use a seperate machine. You can use any another Linux distribution but you might have some issues setting up the node.
After your Linux installation is ready, go to https://docs.radixdlt.com and follow the instructions to get the node running. There are three methods:
- CLI Method (recommended for easy setup with Ubuntu)
- Docker Method
- Systemd Method or Standalone Method (recommended for advanced Linux users)
#
Write down your public keyIn one of the steps you need to create keys for your validator. You do this by running the keygen tool. Make sure to write down your public key since you might need this later for some requests.
In the above example we created a key with public key 0392f29097f581ba20b1edf75eb2b2655021b026a9b4c22c39647fc4c25b53ef38
#
JSON requests using curlAfter your node is running. You can easilly send JSON requests to your own node. Let's start by asking some basic information about your node:
curl -s http://localhost:3334/account -H 'Content-Type: application/json' --data ' { "jsonrpc": "2.0", "method": "account.get_info", "id": 1}'
This command will directly connect to the node's API port 3334 using http. You might need to use another port than 3334 depending on which port your node is listening. This method does not require authorization.
curl -s -k --request POST -u superadmin:password https://localhost/account -H 'Content-Type: application/json' --data '{"jsonrpc": "2.0","method": "account.get_info","id": 1}'
This command will connect to the node via nginx using https. This method does require authorization.
If you run this you should receive an output like below with your wallet address.
Please note that the actual JSON request you are sending is:
{ "jsonrpc": "2.0", "method": "account.get_info", "id": 1}
You can change these yourself and are now ready to send more JSON requests! The next parts of this manual will help you.
#
JSON markup using curlThe output you receive from your node is in JSON format. As you can see above it is pretty hard to read for a human. You can add | python3 -m json.tool
to your query commands to make the output better readable. This requires python3 installed.
curl -s -k --request POST -u superadmin:password https://localhost/account -H 'Content-Type: application/json' --data '{"jsonrpc": "2.0","method": "account.get_info","id": 1}' | python3 -m json.tool
#
JSON requests using PostmanAnother great tool to progress JSON requests is to use the Postman tool (https://www.postman.com/downloads/). With this tool you can easilly send JSON requests over the network to your node.
After installation just start by clicking at create request. We start with the Authorization options:
- Method should be POST
- URL to your node address. In this case ending at /account
- Authorization tab
- Choose Basic Auth
- Enter credentials of the superadmin
Than we go to the Body of your JSON request:
- Go to the Body tab
- Your JSON input:
{ "jsonrpc": "2.0", "method": "account.get_info", "id": 1}
- Send your request
- Check your JSON output
You should be confident now sending JSON requests to a node. In the following parts of this manual we will specify the JSON requests. You can use the curl or Postman method to send these to your node.