A beginners quick start guide to staking on the Keep Network testnet using DigitalOcean.
If you are Playing for Keeps you need to run a node on testnet.
This guide makes no assumptions about your experience using dapps or MetaMask. I have taken lots of screenshots along the way to make it easy to follow.
Everything being equal this guide should take about one hour to complete.
- Create a keystore file
- Install Metamask
- Get ETH
- Get Tokens
- Delegate Tokens
- Authorize Contracts
- Bond ETH for tBTC
- Create Infura account
- Setup Node
Ok lets go.
1. Create a wallet by keystore file
We use this on the node.
- While you can create a wallet using MetaMask you cant export a keystore file from MetaMask.
- You will need the password you create for the keystore file later.
Download the keystore file, we will use it later.
2. Install MetaMask on Chrome
This is what we use to interact with the Keep Network dashboard. You can setup a new Chrome profile if you want to keep it seperate from everything else.
Currently MetaMask doesn’t have an import from keystore file when you first install it. So we create a wallet with MetaMask which then unlocks the rest of the menu options that we use to import the keystore file.
So now we have unlocked the rest of the menu options we can import the wallet we created with My Ether Wallet.
To do this click on the circle in the top right of the MetaMask to get to My Accounts. Select the Import Account option.
The keystore file is a JSON file.
Now you have the wallet you created on My Ether Wallet loaded into your MetaMask.
3. Get ETH on Ropsten from a faucet
- The transactions can take a couple of minutes to show up on the faucet.
- Something people thrash the testnet and it can become very slow.
- By default MetaMask will connect to the main network, for the testnet we are using Ropsten.
- If you get greylisted on the Ropsten faucet the MetaMask one is more forgiving.
I suggest just using the MetaMask one.
Once you hit request
You can follow the transaction to see when it gets written into a block.
Note that your public key is shown in the address under the user heading. Your public key will be used in the node configuration.
After the transaction has been confirmed you will see it in your MetaMask transaction history
You can see additional information about the transaction and view it on Etherscan.
3. Get KEEP Tokens from the Keep faucet
First you need to create the URL for the KEEP faucet using your public key.
On success this will look like.
- Until the transaction has been written into a block you wont see anything on the Keep dashboard.
- In the unlikely event that this fails check the #staking channel in discord.
Check the status of the transaction on Etherscan.
4. Delegate Tokens
Go to the testnet dashboard.
- If you refresh the page you need to reconnect to MetaMask.
- You have to wait for your transaction from the Keep faucet to be processed before you will see a grant.
- These pages can be slow to load as they are pulling information from the Ethereum blockchain.
- The time it takes for the transactions to process varies.
In practise the Authorizer, Operator and Beneficiary addresses will all be different.
For testnet these can all use the same public key for the Ethereum address we created with MetaMask.
Click Delegate Stake
Once the transaction shown in the notification is written into a block you will see the dashboard update. Be patient this can take a while based on the network traffic on Ropsten.
Once the delegation is completed you will see it when you scroll down.
5. Authorize Contracts
Next we need to Authorize the contracts. The speed at which these pages load tends to vary.
You don’t have to wait for the pending to update to move onto the next step but if it doesn’t complete you will run into other issues and need to Authorization again.
Once it has completed it will look like the screen above.
Both the BondedECDSAKeepFactory and the TBTCSystem need to be Authorized.
7. Bond ETH
The bonded testnet ETH is used as collateral for the testnet tBTC app.
The amount of KEEP staked determines how often you get selected to do work, the bonded ETH determines how much work you can do.
Make sure you select an amount less than the amount you got from the faucet. The gas fees from the smart contract execution will have reduced the amount of ETH in your wallet.
Once your ETH has been staked the dashboard will update. Note that the Bonded ETH is what is being used as collateral for your node doing work in the tBTC application, this collateral is returned when the tBTC is redeemed.
8. Create Infura account
Register an account, we will use the free tier.
Take note of the endpoints for Ropsten not Mainnet. We will use the PROJECT ID in your node configuration.
If you don’t already have one, create a SSH key.
SSH into your host from the terminal using the IP address of your newly created droplet.
$ ssh email@example.comThe authenticity of host '184.108.40.206 (220.127.116.11)' can't be established.ECDSA key fingerprint is SHA256:rHtSOMESTUFFGOESHEREDONTWORRYABOUTITTHOUGHTsvKmaHDBqGr0o1o4o.Are you sure you want to continue connecting (yes/no/[fingerprint])? yesWarning: Permanently added '18.104.22.168' (ECDSA) to the list of known hosts.Welcome to Ubuntu 18.04.3 LTS (GNU/Linux 4.15.0-66-generic x86_64)* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantageSystem information as of Thu May 28 16:38:52 UTC 2020System load: 0.41 Processes: 98
Usage of /: 1.2% of 77.36GB Users logged in: 0
Memory usage: 3% IP address for eth0: 22.214.171.124
Swap usage: 0%0 packages can be updated.
0 updates are security updates.The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright.Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law.root@keep-testnet:~#
Setup the firewall rules
sudo ufw allow 22/tcp
sudo ufw allow 3919/tcp
yes | 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
Check docker is installed.
root@keep-testnet:~# sudo docker --version
Docker version 19.03.6, build 369ce74a3c
Pull down the docker container.
docker pull keepnetwork/keep-client:latest
Create directories and export environment variables
mkdir -p $HOME/keep-client/config
mkdir -p $HOME/keep-client/keystore
mkdir -p $HOME/keep-client/persistence# Get your server's IP
export SERVER_IP=$(curl ifconfig.me)# Change with your ID from Infura.
export INFURA_PROJECT_ID="YOUR_INFURA_PROJECT_ID"# Change with your ETH Wallet.
env | sort
- To check your environment variables are set correctly.
- If you run into problems with connecting to the network check the Peers list against section 7.2.2 and the contract addresses against section 7.2.3 of the documentation.
cat <<EOF >>$HOME/keep-client/config/config.toml
# Ethereum host connection info.
URL = "wss://ropsten.infura.io/ws/v3/$INFURA_PROJECT_ID"
URLRPC = "https://ropsten.infura.io/v3/$INFURA_PROJECT_ID"# Keep operator Ethereum account.
Address = "$ETH_WALLET"
KeyFile = "/mnt/keystore/keep_wallet.json"# Keep contract addresses configuration.
KeepRandomBeaconOperator = "0x440626169759ad6598cd53558F0982b84A28Ad7a"
TokenStaking = "0xEb2bA3f065081B6459A6784ba8b34A1DfeCc183A"
KeepRandomBeaconService = "0xF9AEdd99357514d9D1AE389A65a4bd270cBCb56c"# Keep network configuration.
Peers = ["/dns4/bootstrap-1.core.keep.test.boar.network/tcp/3001/ipfs/16Uiu2HAkuTUKNh6HkfvWBEkftZbqZHPHi3Kak5ZUygAxvsdQ2UgG", "/dns4/bootstrap-2.core.keep.test.boar.network/tcp/3001/ipfs/16Uiu2HAmQirGruZBvtbLHr5SDebsYGcq6Djw7ijF3gnkqsdQs3wK", "/dns4/bootstrap-3.test.keep.network/tcp/3919/ipfs/16Uiu2HAm8KJX32kr3eYUhDuzwTucSfAfspnjnXNf9veVhB12t6Vf", "/dns4/bootstrap-2.test.keep.network/tcp/3919/ipfs/16Uiu2HAmNNuCp45z5bgB8KiTHv1vHTNAVbBgxxtTFGAndageo9Dp"]
Port = 3919
# Override the node's default addresses announced in the network
AnnouncedAddresses = ["/ip4/$SERVER_IP/tcp/3919"]# Storage is encrypted
DataDir = "/mnt/persistence"
Copy the contents of the keystore file from your computer into a new file on your server.
Make sure it’s set to inserting text mode when you paste the contents in, then save and exit the text editor.
Set the password for the keystore file
Start the docker container.
sudo docker run -dit \
--restart always \
--volume $HOME/keep-client:/mnt \
--env KEEP_ETHEREUM_PASSWORD=$KEEP_CLIENT_ETHEREUM_PASSWORD \
--env LOG_LEVEL=debug \
--name keep-client \
-p 3919:3919 \
keepnetwork/keep-client:latest --config /mnt/config/config.toml start
Check it worked by looking in the logs.
sudo docker logs keep-client -f
Scroll up and look for
Check that you are connected to at least one peer.
Congrats you now have a node running on testnet.
Read more about Keep
Secure Multi Party Computation (sMPC) explained visually
Keep Network — Technology Explainer.