-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* #78 Add guide `How to join network as validator` * Update docs/run_testnet.md Co-Authored-By: hleb-albau <hleb.albau@gmail.com>
- Loading branch information
1 parent
17c0d77
commit e0f7116
Showing
8 changed files
with
233 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
# Run full node | ||
//todo intro | ||
|
||
|
||
## Prepare your server | ||
|
||
First, you have to setup a server. You are supposed to run your validator node all time, so you will need a | ||
reliable server to keep it running. Also, you may consider to use any cloud services like AWS or DigitalOcean. | ||
|
||
Cyberd is based on Cosmos SDK written in Go. It should work on any platform which can compile and run programs in Go. | ||
However, I strongly recommend running the validator node on a Linux server. | ||
Here is the current required server specification to run validator node. | ||
|
||
1. No. of CPUs: 8 | ||
2. RAM: 64GB | ||
3. Card with Nvidia CUDA support(ex 1080ti) and at least 8gb VRAM. | ||
4. Disk: 256GB SSD | ||
|
||
## Install Dependencies | ||
|
||
Cyberd requires **Go 1.11+**. | ||
[Here](https://golang.org/doc/install) you can find default installation instructions for Go for various platforms. | ||
|
||
Check Go version: | ||
```bash | ||
go version | ||
// go version go1.11 linux/amd64 | ||
``` | ||
|
||
For installing **CUDA Toolkit**, please, visit [official Nvidia site](https://docs.nvidia.com/cuda/index.html). | ||
|
||
Check toolkit version: | ||
```bash | ||
nvidia-smi | ||
nvcc --version | ||
// .... | ||
// Cuda compilation tools, release 9.1, V9.1.85 | ||
``` | ||
|
||
### Compile binaries | ||
|
||
Firstly, clone cyberd with required version. | ||
```bash | ||
git clone -b v0.1.0 --depth 1 https://github.com/cybercongress/cyberd.git | ||
cd cyberd/ | ||
``` | ||
|
||
Than, build GPU Kernel (part of cyberd, that computes rank). | ||
```bash | ||
cd app/rank/cuda | ||
nvcc -fmad=false -shared -o libcbdrank.so rank.cu --compiler-options '-fPIC -frounding-math -fsignaling-nans' | ||
sudo cp libcbdrank.so /usr/lib/ | ||
sudo cp cbdrank.h /usr/lib/ | ||
cd ../../../ | ||
``` | ||
|
||
Compile binaries, copy configs and run daemon. | ||
```bash | ||
|
||
go build -tags cuda -o daemon ./cyberd | ||
go build -o cli ./cyberdcli | ||
``` | ||
|
||
### Running daemon | ||
|
||
Create a configuration directory(by default $HOME/.cyberd) in your home and generate some some required files. | ||
|
||
```bash | ||
./daemon init | ||
``` | ||
|
||
We need the genesis and config files in order to connect to the testnet. | ||
The files are already included in the cyberd repo. Copy them by. | ||
```bash | ||
cp testnet/genesis.json .cyberd/config/genesis.json | ||
cp testnet/config.toml .cyberd/config/config.toml | ||
``` | ||
|
||
You can run the node in background logging all output to a log file. | ||
|
||
``` | ||
./daemon start &> cyberd.log & | ||
``` | ||
|
||
All output will be logged in the gaia.log file. You can keep checking the output using tail -f. | ||
|
||
``` | ||
tail -f cyberd.log | ||
``` | ||
|
||
To check if your node is connected to the testnet, you can run this. | ||
|
||
``` | ||
./cli status | ||
``` | ||
|
||
You should be seeing a returned JSON with your node status including node_info, sync_info and validator_info. | ||
If you see this, then you are connected. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Running two validators testnet | ||
|
||
## First machine - First validator | ||
|
||
Build cyberd daemon and cli with default instructions. Let's suppose binaries named `daemon` and `cli`. | ||
|
||
Create new account and copy seed phrase. | ||
``` | ||
./cli keys add testnet_v2 | ||
``` | ||
|
||
Create network files for one validator: | ||
``` | ||
./daemon testnet --v 1 | ||
``` | ||
|
||
Add generated previously account to genesis. | ||
```bash | ||
./daemon add-genesis-account cbd1pnuzd4tvqvrawjtk6q8wwvg9cmw4mnnmy9skdy 500CBD --home=./mytestnet/node0/cyberd | ||
cp testnet/config.toml ./mytestnet/node0/cyberd/config/config.toml | ||
``` | ||
|
||
Run daemon | ||
```bash | ||
./daemon start --home=./mytestnet/node0/cyberd | ||
``` | ||
|
||
## Second machine - Second validator | ||
|
||
Build cyberd daemon and cli with default instructions. Let's suppose binaries named `daemon` and `cli`. | ||
|
||
|
||
Init daemon. | ||
```asciidoc | ||
./daemon init --home=./mytestnet/ | ||
``` | ||
|
||
Copy genesis and config | ||
```bash | ||
scp -P 33324 earth@earth.cybernode.ai:/home/earth/cyberd/mytestnet/node0/cyberd/config/genesis.json ./mytestnet/cyberd/config | ||
scp -P 33324 earth@earth.cybernode.ai:/home/earth/cyberd/mytestnet/node0/cyberd/config/config.toml ./mytestnet/cyberd/config | ||
``` | ||
|
||
|
||
```bash | ||
./daemon tendermint show-validator --home=./mytestnet/ | ||
|
||
./cli tx stake create-validator \ | ||
--amount=100CBD \ | ||
--pubkey=cbdvalconspub1zcjduepq2pr9cqd9apves6av0xafzgzvvl0ky8904wlkecwu4vghxteutrsq8pcfa7 \ | ||
--moniker="hlb" \ | ||
--chain-id=chain-hFpwd3 \ | ||
--from=testnet_hlb \ | ||
--commission-rate="0.10" \ | ||
--commission-max-rate="0.20" \ | ||
--commission-max-change-rate="0.01" | ||
``` | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# Run validator node | ||
|
||
Firstly, run full node using "[Run full node](run_testnet.md)" guide. | ||
|
||
Alright, you are now connected to the testnet. | ||
To be a validator, you will need some **CBD**(testnet coin). | ||
|
||
## Prepare stake address | ||
If you already have address with **CBD**, just restore it into your local keyspace. | ||
|
||
```bash | ||
./cli keys add <your_key_name> --recover | ||
./cli show <your_key_name> | ||
``` | ||
|
||
If no, create new one and send coins to it. | ||
You first need to create a pair of private and public keys for sending and | ||
receiving coins, and bonding stake. | ||
|
||
``` | ||
./cli keys add <your_key_name> | ||
``` | ||
|
||
<your_key_name> is any name you pick to represent this key pair. | ||
You have to refer to this <your_key_name> later when you use the keys to sign transactions. | ||
It will ask you to enter your password twice to encrypt the key. | ||
You also need to enter your password when you use your key to sign any transaction. | ||
|
||
The command returns the address, public key and a seed phrase which you can use it to | ||
recover your account if you forget your password later. | ||
Keep the seed phrase in a safe place in case you have to use them. | ||
|
||
The address showing here is your account address. Let’s call this <your_account_address>. | ||
It stores your assets. | ||
|
||
## Send create validator transaction | ||
|
||
Validators are actors on the network committing new blocks by submitting their votes. | ||
It refers to the node itself, not a single person or a single account. | ||
Therefore, the public key here is referring to the node public key, | ||
not the public key of the address you have just created. | ||
|
||
To get the node public key, run the following command. | ||
|
||
```bash | ||
./daemon tendermint show_validator | ||
``` | ||
|
||
It will return a bech32 public key. Let’s call it <your_node_pubkey>. | ||
The next step you have to declare a validator candidate. | ||
The validator candidate is the account which stake the coins. | ||
So the validator candidate is an account this time. | ||
To declare a validator candidate, run the following command. | ||
|
||
```bash | ||
./cli tx stake create-validator \ | ||
--amount=100CBD \ | ||
--pubkey=<your_node_pubkey> \ | ||
--moniker="hlb" \ | ||
--trust-node \ | ||
--from=<your_key_name> \ | ||
--commission-rate="0.10" \ | ||
--commission-max-rate="0.20" \ | ||
--commission-max-change-rate="0.01" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters