There are 3 ways to set up OneLedger Kratos Full Node:
- GCP Marketplace Image
- Docker Image
- Build the Source Code
Video Tutorial
- GCP Marketplace Image
-
- Run a node on Google Cloud Marketplace now by clicking here
* Choose the name from your OneLedger instance
* Choose a machine type with at least 7.5GB of RAM; GCP charges you only based on the number of cores you choose, we recommend using 2 vCPUs
* You can keep all other fields set to the default values
* Click Deploy
-
- Now you are up and running. Click on SSH to run your node.
- Check the Fullnode service and check the status
sudo service olfullnode start
sudo olfullnode status
- Docker Image
-
- Install docker on your machine.
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add –
sudo add-apt-repository "deb [arch=amd64]
https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install docker-ce
-
- Now pull Kratos Fullnode docker image from dockerhub.
docker pull oneledgertech/kratos - Now run the docker image to start Kratos Fullnode.
docker run -it "image-id" /bin/bash
- Now pull Kratos Fullnode docker image from dockerhub.
- Build the Source Code
-
- Install golang v0.13+ following instruction
- Install libraries
sudo apt-get install libleveldb-dev libsnappy-dev - Download the binary
wget https://github.com/Oneledger/protocol/releases/download/v0.16.3/olclient
wget https://github.com/Oneledger/protocol/releases/download/v0.16.3/olfullnode
chmod +x olclient
chmod +x olfullnode
And then put these binary to under any place of your executable $PATH (Example: /usr/local/bin) - Verify the binary’s md5:
For olfullnode:
md5sum olfullnode
should get
9618d6b48d6e34406f7532bea2c80708 olfullnode
For olclient:
md5sum olclient
should get
deeba93c41194645f387eda3576e02e5 olclient - Initialize the node
export OLDATA="any place that you want to run the node"
cd $OLDATA
wget
https://raw.githubusercontent.com/Oneledger/kratos-genesis/master/genesis.json
wget
https://raw.githubusercontent.com/Oneledger/kratos-genesis/master/config.toml
olfullnode init --genesis genesis.json --node_name "your preferred name" --root ./ - P2P Configuration
Configure your "config.toml" file to make the network more stable and protect your nodes.
# Main address for P2P connections p2p_address = "tcp://<your-internal-ip>:26605" # Address to advertise for incoming peers to connect to external_p2p_address = "tcp://<your-external-ip>:26605"
get node id with olfullnode show_node_id --ip you will get id like 3c498d34846159daa9fcf265d8a3f4dcd46641d1@127.0.0.1:26605 configure the sentry and protected node like following sentry: # List of peers to maintain a persistent connection to persistent_peers = ["<protected-node-id>@<protected-node-ip>:26605"] # List of peer IDs to keep private (will not be gossiped to other peers) private_peer_ids = ["<protected-node-id>"] protected node: # List of peers to maintain a persistent connection to persistent_peers = ["<sentry-node-id>@<sentry-node-ip>:26605"] |
-
- Run the node
olfullnode node --root ./
or
Run the node in background creating systemd service file:
cd /etc/systemd/system vim olfullnode.service (Add below content) [Unit] Description=olfullnode Wants=network-online.target After=network-online.target [Service] Type=simple #User=alertmanager #Group=alertmanager ExecStart=/usr/local/bin/olfullnode node --root /home/user/OLDATA > /home/user/OLDATA/fullnode.log & #Restart=on-failure [Install] WantedBy=multi-user.target |
Enable the service file
systemctl enable olfullnode.service
start the service file and check the status
sudo service olfullnode start
sudo olfullnode status
-
- Run the node in background creating systemd service file:
(Assuming "olfullnode" binary is located in $PATH /usr/local/bin. To append the fullnode log check the path where you run the fullnode.)
- Run the node in background creating systemd service file:
cd /etc/systemd/system vim olfullnode.service (Add below content) [Unit] Description=olfullnode Wants=network-online.target After=network-online.target [Service] Type=simple #User=alertmanager #Group=alertmanager ExecStart=/usr/local/bin/olfullnode node --root /PATH/TO/FULLNODE > /PATH/TO/FULLNODE/fullnode.log & #Restart=on-failure [Install] WantedBy=multi-user.target |
Enable the service file
sudo systemctl enable olfullnode.service |
start the service file and check the status
sudo service olfullnode start sudo service olfullnode status |