Step-by-step guide for installing both ECDSA & Beacon Keep Network nodes on VPS with 100$ voucher.
*08/09/2020 all configurations and commands are updated for installing the latest release
This is step by step tutorial for newcomers to launch their first nodes in Keep Network with completely free VPS server and with minimal use of command line. To avoid any sort of errors, we would use the most user-friendly instruments to successfully complete this task fast and without any kind of mistakes.
First, we need Google Chrome with the MetaMask extension installed.
Step 1. Creating a server
- Register on Vultr.com with this link (please note that 100$ voucher is only available for new users of the service).
- Click “Deploy a new server”, choose any preferred server location, operation system (Ubuntu 18.04), instance (2 CPU, 4 GB RAM, 80 SSD) and type a server name.
- After deploying a server click on it and you will see it’s IP, username and password. We would need this info in the future.
Step 2. Creating a wallet
- Go to https://www.myetherwallet.com/create-wallet
- For wallet creation use “By Keystore File” and type a password.
- Download Keystore File and remember the password for later use.
Step 3. Import wallet to MetaMask
- Open MetaMask and go to import account section in the menu.
- Choose import via JSON file. Select downloaded Keystore File from the previous step.
- Rename your account if you wish. Make sure you’ve selected a Ropsten Test Network for default transactions.
Step 4. Get tokens, delegate stake and authorize all contracts
- Get KEEP test tokens:
1.1. Copy and paste this link “https://us-central1-keep-test-f3e0.cloudfunctions.net/keep-faucet-ropsten?account=” into your browser.
1.2. Open MetaMask, copy your wallet address and paste it after the link above.
1.3. Hit the result link. You will get the confirmation of token grant.
2. Get Ethereum test tokens:
2.1. Go to https://faucet.ropsten.be, paste your wallet address and click “Send me test Ether”.
2.2. Get the confirmation of transaction, wait a little bit and check in MetaMask that you’ve received 1 ETH.
2.3. If the faucet doesn’t work for some reason and you haven’t received ETH, just try another one: https://faucet.metamask.io.
3. Delegate KEEP tokens for stake and authorize contracts:
3.1. Go to https://dashboard.test.keep.network/tokens and choose to login with MetaMask.
3.2. After logging, type the delegation token amount (300 000). In Authorizer/Operator/Beneficiary Address fields type your own wallet address from MetaMask and click “Delegate Stake”. Confirm transaction in MetaMask, wait a little and check the delegation status is successful.
3.3 Go to Applications section and authorize both Random Beacon and tBTC contracts. Long page loadings are OK. Make sure you’ve authorized all the contracts and add an ETH bonding (0.5 is enough for the start, later you would need more ETH for bonding) on the tBTC page.
Step 5. Create Infura account
- Go to https://infura.io/register and create an account.
- Click “Create new project” and type the name (for example, Beacon). After project being created, move to the settings page. Change keys endpoints to Ropsten, we would use these generated links later. That’s all, we don’t want to change any other settings.
- We need to create 2 separate projects for Beacon and ECDSA nodes, so repeat above actions twice. Create second project and repeat all actions for the other node.
Step 6. Download nodes config template and prepare for installation
- We wouldn’t use command line to configure our nodes, rather we would do it with a simple text editor and then upload configurations to our server.
- Go here: https://github.com/nikgrego/keep_nodes_template_en and download configuration template (direct download link) for your nodes. Extract it to any directory on your computer.
- Prepare your favorite text editor, it’s time to edit our nodes configurations. I use Sublime, but you can do this with any editor you want. Each “ECDSA” and “Beacon” folders contain “config” subfolders. There are 4 files in them, which we want to edit (do it for both nodes):
- keep-address.txt — copy your wallet address and paste it in this file.
- keep-password.txt — paste here your wallet password.
- keep-keyfile — open Keystore file that we’ve created in step 2, copy it’s content and paste it here. Please note that it does not have an extension.
- config.toml — open this file and edit with suggestions, provided in it.
When all edits are done, we just save the files and move to the next step.
Step 7. Upload configurations to server
- Now we need to upload all files to the server. We would use SFTP for that. There are many SFTP apps, but I strongly recommend you to use FileZilla (https://filezilla-project.org), since it is well-known and has clients both for Mac and Windows. Download and install it (make sure you download CLIENT version, not the server one). You can use this app in the future to work with VPS servers.
- Open FileZilla, connect to your server with info you have provided by Vultr in step 1 (just copy IP, username and password). In “port” field type 22 and click connect.
- Once the connection is done, just copy all the files and folders (beacon and ecdsa with subfolders) from previous step to the root* folder on the server.
*Basically installing anything on VPS with root is considered less reliable, but it doesn’t really matter now. If you want to learn how to create another user for this, just Google it.
Step 8. Run nodes and have fun
- Now we need to connect to our VPS server via SSH to start up a nodes. You could use PuTTY (https://www.putty.org) on Windows for that or built-in Terminal/iTerm (https://www.iterm2.com) on Mac. I am using iTerm. All this software is completely free. You would need your server info on Vultr (IP, username and password) again. To login with SSH type “ssh root@YOUR_SERVER_IP” and hit enter. Paste your password, hit enter. Ok, now we’re in.
2. It’s time to configure firewall and install docker. Type this commands one by one and each time hit enter:
mkdir -p beacon/persistence ecdsa/persistence
sudo ufw allow 22
sudo ufw allow 3919
sudo ufw allow 3920
sudo ufw enable
sudo apt-get update
sudo apt-get remove docker docker-engine docker.io
sudo apt install docker.io curl -y
sudo systemctl start docker
sudo systemctl enable docker
sudo docker --version
If all installed ok, you will get a line with docker version.
3. Finally we are here. All preparations are done, configurations uploaded to the server. Use this commands for each node one by one:
For Beacon node:
cd
cd beacon
export KEEP_ACCOUNT_PASSWORD=$(cat ./config/keep-beacon-operator-account-password.txt)
export SERVER_IP=$(curl ifconfig.co)sudo docker run -d \
--entrypoint keep-client \
--restart always \
--volume /root/beacon/persistence:/mnt/keep-beacon-client/persistence \
--volume /root/beacon/config:/mnt/keep-beacon-client/config \
--env KEEP_ETHEREUM_PASSWORD=$KEEP_ACCOUNT_PASSWORD \
--env LOG_LEVEL=debug \
--name beacon-node \
-p 3920:3919 \
keepnetwork/keep-client:v1.3.0-rc.4 --config /mnt/keep-beacon-client/config/config.toml start
And then for ECDSA node:
cd
cd ecdsa
export KEEP_ECDSA_OPERATOR_ACCOUNT_PASSWORD=$(cat ./config/keep-ecdsa-operator-account-password.txt)sudo docker run -d \
--entrypoint keep-ecdsa \
--restart always \
--volume /root/ecdsa/persistence:/mnt/keep-ecdsa-client/persistence \
--volume /root/ecdsa/config:/mnt/keep-ecdsa-client/config \
--env KEEP_ETHEREUM_PASSWORD=$KEEP_ECDSA_OPERATOR_ACCOUNT_PASSWORD \
--env LOG_LEVEL=debug \
--name ecdsa-node \
-p 3919:3919 \
keepnetwork/keep-ecdsa-client:v1.2.0-rc.5 --config /mnt/keep-ecdsa-client/config/config.toml start
Congratulations, all is done! You can check created dockers with “sudo docker ps”.
For logs please use “sudo docker logs beacon-node -f” and “sudo docker logs ecdsa-node -f” commands as well. If you have peers connections then you’re ok. If you haven’t, re-check configurations and peer addresses, sometimes they can change.
You can re-check actual peers here:
- https://github.com/keep-network/keep-core/blob/master/docs/run-random-beacon.adoc#72-testnet
- https://github.com/keep-network/keep-ecdsa/blob/master/docs/run-keep-ecdsa.adoc#72-testnet
Additional resources: