Using Docker
This is a step-by-step guide to install an Jin node using Docker. Follow these steps to configure a validator node and a validator fullnode on separate machines. Use the fullnode.yaml to run a validator fullnode. See Step 11.
Before you proceed
Make sure the following are installed on your local computer:
- Jin CLI: https://aptos.dev/cli-tools/aptos-cli-tool/install-aptos-cli
- Docker and Docker-compose: https://docs.docker.com/engine/install/
Docker method has only been tested on Linux, Windows, and Intel macOS. If you are on M1 macOS, use the Aptos-core source approach.
Create a directory for your Jin node composition, and pick a username for your node. e.g.
export WORKSPACE=mainnet
export USERNAME=alice
mkdir ~/$WORKSPACE
cd ~/$WORKSPACEDownload the following files by following the download commands on the Node Files page:
validator.yamldocker-compose.yamldocker-compose-fullnode.yamlhaproxy.cfghaproxy-fullnode.cfgblocked.ips
Generate the key pairs (node owner, voter, operator key, consensus key and networking key) in your working directory.
Jin genesis generate-keys --output-dir ~/$WORKSPACE/keysThis will create 4 key files under
~/$WORKSPACE/keysdirectory:public-keys.yamlprivate-keys.yamlvalidator-identity.yaml, andvalidator-full-node-identity.yaml.IMPORTANTBackup your
private-keys.yamlsomewhere safe. These keys are important for you to establish ownership of your node. Never share private keys with anyone.
Configure validator information. You need to setup a static IP / DNS address (DNS is much preferred) which can be used by the node, and make sure the network / firewalls are properly configured to accept external connections. See Network Identity For Fullnode for how to do this.
cd ~/$WORKSPACE
Jin genesis set-validator-configuration \
--local-repository-dir ~/$WORKSPACE \
--username $USERNAME \
--owner-public-identity-file ~/$WORKSPACE/keys/public-keys.yaml \
--validator-host <validator node IP / DNS address>:<Port> \
--full-node-host <Full Node IP / DNS address>:<Port> \
--stake-amount 100000000000000
# for example, with IP:
Jin genesis set-validator-configuration \
--local-repository-dir ~/$WORKSPACE \
--username $USERNAME \
--owner-public-identity-file ~/$WORKSPACE/keys/public-keys.yaml \
--validator-host 35.232.235.205:6180 \
--full-node-host 34.135.169.144:6182 \
--stake-amount 100000000000000
# For example, with DNS:
Jin genesis set-validator-configuration \
--local-repository-dir ~/$WORKSPACE \
--username $USERNAME \
--owner-public-identity-file ~/$WORKSPACE/keys/public-keys.yaml \
--validator-host bot.aptosdev.com:6180 \
--full-node-host fn.bot.aptosdev.com:6182 \
--stake-amount 100000000000000This will create two YAML files in the
~/$WORKSPACE/$USERNAMEdirectory:owner.yamlandoperator.yaml.Download the following files by following the download commands on the Node Files page:
genesis.blobwaypoint.txt
- To recap, in your working directory, you should have a list of files:
docker-compose.yamldocker compose file to run validator and fullnodekeysfolder containing:public-keys.yaml: Public keys for the owner account, consensus, networking (from step 4).private-keys.yaml: Private keys for the owner account, consensus, networking (from step 4).validator-identity.yaml: Private keys for setting the Validator identity (from step 4).validator-full-node-identity.yaml: Private keys for setting validator full node identity (from step 4).
usernamefolder containing:owner.yaml: define owner, operator, and voter mapping. They are all the same account in test mode (from step 5).operator.yaml: Node information that will be used for both the Validator and the fullnode (from step 5).
waypoint.txt: The waypoint for the genesis transaction (from step 6).genesis.blobThe genesis binary that contains all the information about the framework, validatorSet and more (from step 6).
Run docker-compose:
docker-compose up. (ordocker compose updepends on your version)
Now you have completed setting up your validator node. Next, setup a validator fullnode following the instructions below.
- Set up a validator fullnode on a different machine. Download the `fullnode.yaml` and `docker-compose-fullnode.yaml` configuration files into the working directory of fullnode machine. See [Node Files](/nodes/node-files-all-networks/node-files) for a full list of files you should download and the download commands.
Edit
fullnode.yamlfile to update the IP address for validator node.Copy the
validator-full-node-identity.yaml, downloadgenesis.blobandwaypoint.txtfiles into the same working directory on fullnode machine.Run docker-compose:
docker-compose -f docker-compose-fullnode.yaml up.
Now you have successfully completed setting up your node.