From ef6b218f3aae5838d9df1700cef1b2960286728b Mon Sep 17 00:00:00 2001 From: Kiryl Laptanovich <38989909+mrlp4@users.noreply.github.com> Date: Mon, 25 Nov 2019 17:01:23 +0300 Subject: [PATCH 01/11] created run_validator for euler-dev testnet --- docs/run_validator.md | 428 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 428 insertions(+) create mode 100644 docs/run_validator.md diff --git a/docs/run_validator.md b/docs/run_validator.md new file mode 100644 index 00000000..4722eef2 --- /dev/null +++ b/docs/run_validator.md @@ -0,0 +1,428 @@ +# Join Cyberd Devnet As Validator + +**Note**. Currently active dev testnet is `euler-dev` (substitute with that value). + +## 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. + +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. + +Rank calculation on a cyberd is benefit GPU computation. They easy to parallelize that why is the best way is to use GPU. + +Minimal requirements for the next two weeks (until the middle of February): + +Recommended requirements: + +```js +CPU: 6 cores +RAM: 64 GB +SSD: 512 GB +Connection: 100Mb, Fiber, Stable and low-latency connection +GPU: GeForce 1070-1080, CUDA +Software: Docker, Ubuntu 16.04/18.04 LTS +``` + +But, of cource, hardware is your onw choise and tecnically it migth be possible to run chain on "even - 1 CUDA core gpu", but you should be aware of stabilty and calculation speed drop. + +## Validator setup + +### Third-party software + +Cyberd main distribution unit is a [docker](https://www.docker.com/) container. All images are located in default [Dockerhub registry](https://hub.docker.com/r/cyberd/cyberd/). In order to access GPU from the container, Nvidia drivers version **410+** and [Nvidia docker runtime](https://github.com/NVIDIA/nvidia-docker) should be installed on the host system. For great user experience, we propose you to use [portainer](https://portainer.io) - docker containers manager. You can skip any subsection of this if you already had and configured necessary software. + +#### Docker installation + +1. Update the apt package index: + +```bash +sudo apt-get update +``` + +2. Install packages to allow apt to use a repository over HTTPS: + +```bash +sudo apt-get install \ + apt-transport-https \ + ca-certificates \ + curl \ + gnupg-agent \ + software-properties-common +``` + +> May require `curl` installation `apt-get install curl` + +3. Add Docker’s official GPG key: + +```bash +curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - +``` + +```bash +sudo add-apt-repository \ + "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ + $(lsb_release -cs) \ + stable" +``` + +4. Update the apt package index. + +```bash +sudo apt-get update +``` + +5. Install the latest version of Docker CE and containerd, or go to the next step to install a specific version (at the date of Nov 2019 version 19.03 is required): + +```bash +sudo apt-get install docker-ce docker-ce-cli containerd.io +``` + +If you don’t want to preface the docker command with sudo, create a Unix group called docker and add users to it. When the Docker daemon starts, it creates a Unix socket accessible by members of the docker group. + +6. Create the docker group. + +```bash +sudo groupadd docker +``` + +7. Add your user to the docker group. + +```bash +sudo usermod -aG docker $USER +``` + +8. Reboot the system for the changes to take effect. + +#### Portainer installation (optional) + +1. Before installing Portainer, download the Portainer image from the DockerHub using the docker pull command below. + +```bash +docker pull portainer/portainer +``` + +2. Now run Portainer using the simple docker command below. + +```bash +docker run -d --restart always -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock portainer/portainer +``` + +3. Open your browser and go to: + +```bash +localhost:9000 +``` + +![](https://ipfs.io/ipfs/QmS42MJxjUB7Cu1GoJeE6eBmWkjHTZdgiAUcX4Qqy9NR3M) + +4. Set password, chose `local` tab and click `connect`. All containers will be available at `containers` tab. + +#### Nvidia drivers installation + +1. To proceed first add the `ppa:graphics-drivers/ppa` repository into your system: + +```bash +sudo add-apt-repository ppa:graphics-drivers/ppa +``` + +```bash +sudo apt update +``` + +2. Install Ubuntu-drivers +```bash +sudo apt install -y ubuntu-drivers-common +``` + +3. Next, identify your graphic card model and recommended driver: + +```bash +ubuntu-drivers devices +``` +You should see something like this: + +```bash +== /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 == +modalias : pci:v000010DEd00001BA1sv00001462sd000011E4bc03sc00i00 +vendor : NVIDIA Corporation +model : GP104M [GeForce GTX 1070 Mobile] +driver : nvidia-driver-418 - third-party free +driver : nvidia-driver-410 - third-party free +driver : nvidia-driver-430 - third-party free +driver : nvidia-driver-440 - third-party free recommended +driver : xserver-xorg-video-nouveau - distro free builtin +``` + +4. We need +**410+** +drivers release. As we see v440 is recommended. The command below will install the recommended version of drivers. + +```bash +sudo ubuntu-drivers autoinstall +``` + +Drivers will install due approximately 10 minutes. + +```bash +DKMS: install completed. +Setting up libxdamage1:i386 (1:1.1.4-3) ... +Setting up libxext6:i386 (2:1.3.3-1) ... +Setting up libxfixes3:i386 (1:5.0.3-1) ... +Setting up libnvidia-decode-415:i386 (415.27-0ubuntu0~gpu18.04.1) ... +Setting up build-essential (12.4ubuntu1) ... +Setting up libnvidia-gl-415:i386 (415.27-0ubuntu0~gpu18.04.1) ... +Setting up libnvidia-encode-415:i386 (415.27-0ubuntu0~gpu18.04.1) ... +Setting up nvidia-driver-415 (415.27-0ubuntu0~gpu18.04.1) ... +Setting up libxxf86vm1:i386 (1:1.1.4-1) ... +Setting up libglx-mesa0:i386 (18.0.5-0ubuntu0~18.04.1) ... +Setting up libglx0:i386 (1.0.0-2ubuntu2.2) ... +Setting up libgl1:i386 (1.0.0-2ubuntu2.2) ... +Setting up libnvidia-ifr1-415:i386 (415.27-0ubuntu0~gpu18.04.1) ... +Setting up libnvidia-fbc1-415:i386 (415.27-0ubuntu0~gpu18.04.1) ... +Processing triggers for libc-bin (2.27-3ubuntu1) ... +Processing triggers for initramfs-tools (0.130ubuntu3.1) ... +update-initramfs: Generating /boot/initrd.img-4.15.0-45-generic +``` + +5. Reboot the system for the changes to take effect. + +6. Check installed drivers + +```bash +nvidia-smi +``` +You should see this: + +``` ++-----------------------------------------------------------------------------+ +| NVIDIA-SMI 440.26 Driver Version: 430.14 CUDA Version: 10.2 | +|-------------------------------+----------------------+----------------------+ +| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | +| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | +|===============================+======================+======================| +| 0 GeForce GTX 1070 Off | 00000000:01:00.0 Off | N/A | +| 26% 36C P5 26W / 180W | 0MiB / 8119MiB | 2% Default | ++-------------------------------+----------------------+----------------------+ + ++-----------------------------------------------------------------------------+ +| Processes: GPU Memory | +| GPU PID Type Process name Usage | +|=============================================================================| +| No running processes found | ++-----------------------------------------------------------------------------+ +``` + +### Install Nvidia container runtime for docker + +1. Add the package repositories + +```bash +distribution=$(. /etc/os-release;echo $ID$VERSION_ID) +``` + +```bash +curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add - +``` + +```bash +curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list +``` + +You should see this: + +```bash +deb https://nvidia.github.io/libnvidia-container/ubuntu18.04/$(ARCH) / +deb https://nvidia.github.io/nvidia-container-runtime/ubuntu18.04/$(ARCH) / +deb https://nvidia.github.io/nvidia-docker/ubuntu18.04/$(ARCH) / +``` + +3. Install nvidia-docker2 and reload the Docker daemon configuration + +```bash +sudo apt-get update && sudo apt-get install -y nvidia-container-toolkit +``` + +```bash +sudo systemctl restart docker +``` + +4. Test nvidia-smi with the latest official CUDA image + +```bash +docker run --runtime=nvidia --rm nvidia/cuda:10.0-base nvidia-smi +``` + +Output logs must should coincide as earlier: + +``` +Unable to find image 'nvidia/cuda:10.0-base' locally +10.0-base: Pulling from nvidia/cuda +38e2e6cd5626: Pull complete +705054bc3f5b: Pull complete +c7051e069564: Pull complete +7308e914506c: Pull complete +5260e5fce42c: Pull complete +8e2b19e62adb: Pull complete +Digest: sha256:625491db7e15efcc78a529d3a2e41b77ffb5b002015983fdf90bf28955277d68 +Status: Downloaded newer image for nvidia/cuda:10.0-base +Fri Feb 1 05:41:12 2019 ++-----------------------------------------------------------------------------+ +| NVIDIA-SMI 440.26 Driver Version: 440.26 CUDA Version: 10.0 | +|-------------------------------+----------------------+----------------------+ +| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | +| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | +|===============================+======================+======================| +| 0 GeForce GTX 1070 Off | 00000000:01:00.0 On | N/A | +| N/A 55C P0 31W / N/A | 445MiB / 8117MiB | 38% Default | ++-------------------------------+----------------------+----------------------+ + ++-----------------------------------------------------------------------------+ +| Processes: GPU Memory | +| GPU PID Type Process name Usage | +|=============================================================================| ++-----------------------------------------------------------------------------+ +``` + +Your machine is ready to launch fullnode. + +## Cyberd fullnode launching + +1. Create folders for keys and data storing where you want, for example: + +``` bash +mkdir /cyberd-dev/cyberd +mkdir /cyberd-dev/cyberdcli +``` + +2. Run fullnode + +```bash +docker run -d --name=euler-dev --restart always --runtime=nvidia -p 26656:26656 -p 26657:26657 -p 1317:1317 -e ALLOW_SEARCH=true -v /cyberd-dev/cyberd:/root/.cyberd -v /cyberd-dev/cyberdcli:/root/.cyberdcli cyberd/cyberd:euler-dev +``` + +3. After successful container pulling and launch run to check if your node is connected to the testnet: + +```bash +docker exec euler-dev cyberdcli status +``` + +The possible output looks like this: + +```bash +{"node_info":{"protocol_version":{"p2p":"6","block":"9","app":"0"},"id":"93b776d3eb3f3ce9d9bda7164bc8af3acacff7b6","listen_addr":"tcp://0.0.0.0:26656","network":"euler-dev","version":"0.32.7","channels":"4020212223303800","moniker":"anon","other":{"tx_index":"on","rpc_address":"tcp://0.0.0.0:26657"}},"sync_info":{"latest_block_hash":"686B4E65415D4E56D3B406153C965C0897D0CE27004E9CABF65064B6A0ED4240","latest_app_hash":"0A1F6D260945FD6E926785F07D41049B8060C60A132F5BA49DD54F7B1C5B2522","latest_block_height":"4553","latest_block_time":"2019-11-24T09:49:19.771375108Z","catching_up":false},"validator_info":{"address":"66098853CF3B61C4313DD487BA21EDF8DECACDF0","pub_key":{"type":"tendermint/PubKeyEd25519","value":"uZrCCdZTJoHE1/v+EvhtZufJgA3zAm1bN4uZA3RyvoY="},"voting_power":"0"}} +``` + +Your node has started to sync. If that didn't happen, check your config.toml file located at //cyberd/config/config.toml and add at least couple addresses to and , some of those you can fing at our [forum](https://ai.cybercongress.ai/t/euler-dev-testnet/32). + +The syncing process you can see in the terminal. Open a new tab and run following command: + +```bash +docker logs euler-dev --follow +``` + +Additional information available by API endpoint at `localhost:26657` + +f.e. the number of active validators available here `localhost:26657/validators` + +## Validator start +After your node successful synced you can run validator. + +#### Prepare stake address + +We included 1 million Ethereum addresses, over 8000 cosmos addresses and all of `euler-4` validators addresses into genesis, so there's a huge chance that you alredy have some EUL tokens. Here's 3 ways to check this out: + +If you already have cyberd address with EUL and know seed phrase or private key just restore it into your local keystore. +```bash +docker exec -ti euler-dev cyberdcli keys add --recover +docker exec euler-dev cyberdcli keys show +``` + +If you have Ethereum address that kept 0.97Eth or more at block 8080808 of EHT network you can import ethereum private key + +> Please, do not import high value Ethereum accounts. This can not be safe! cyberd software is a new software and is not battle tested yet. + +```bash +docker exec -ti euler-dev cyberdcli keys add import_private +docker exec euler-dev cyberdcli keys show +``` + +If you want to create new acccount use the command below. +Also, you should send coins to that address to bound them later during validator submitting. + +```bash +docker exec -ti euler-dev cyberdcli keys add +docker exec euler-dev cyberdcli keys show +``` + +Also you could use ledger device with cosmos app on it to sign and store cyber addresses, just use --ledger flag with your commands: + +```bash +docker exec -ti euler-dev cyberdcli keys add --ledger +``` + +**** is any name you pick to represent this key pair. +You have to refer to this 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 ****. +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 +docker exec euler-dev cyberd tendermint show-validator +``` + +It will return a bech32 public key. Let’s call it ****. +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 adjusting stake amount and other fields. + +```bash +docker exec -ti euler-dev cyberdcli tx staking create-validator \ + --amount=10000000eul \ + --min-self-delegation "1000000" \ + --pubkey= \ + --moniker= \ + --trust-node \ + --from= \ + --commission-rate="0.10" \ + --commission-max-rate="0.20" \ + --commission-max-change-rate="0.01" \ + --chain-id=euler-dev +``` + +#### Verify that you validating + +```bash +docker exec -ti euler-dev cyberdcli query staking validators --trust-node=true +``` + +If you see your `` with status `Bonded` and Jailed `false` everything must be good. You are validating the network. + +## Maintenance of validator + +#### jailing + +If your validator go under slashing conditions it first go to jail. After this event operator must unjail it manually. + +```bash +docker exec -ti euler-dev cyberdcli tx slashing unjail --from= --chain-id euler-dev +``` From 927a3a9da265b2f184cc24fc83835756d879c6f2 Mon Sep 17 00:00:00 2001 From: Kiryl Laptanovich <38989909+mrlp4@users.noreply.github.com> Date: Mon, 25 Nov 2019 17:46:45 +0300 Subject: [PATCH 02/11] Cyberd Ledger guide --- docs/cyberd_Ledger_guide.md | 69 +++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 docs/cyberd_Ledger_guide.md diff --git a/docs/cyberd_Ledger_guide.md b/docs/cyberd_Ledger_guide.md new file mode 100644 index 00000000..903c6262 --- /dev/null +++ b/docs/cyberd_Ledger_guide.md @@ -0,0 +1,69 @@ +# Ledger nano Support + +It is possible to use Ledger nano devices with cyberd to store keys and sign transacions. + +## Cyberd CLI & Ledger Nano + +How to get started. First of all you'll need couple things to be done: + ++ Working and synced cyberd node with (how to: [here](https://github.com/cybercongress/cyberd/blob/0.1.5/docs/run_validator.md) and [here](https://github.com/cybercongress/cyberd/blob/master/docs/ultimate-commands-guide_v2.md)) + ++ [Setup](https://support.ledger.com/hc/en-us/articles/360000613793-Set-up-as-new-device) your Ledger device and [install Cosmos app onto it](https://github.com/cosmos/ledger-cosmos/blob/master/README.md#installing) (latest firmware for Ledger and Cosmos app v1.5.3 required) + +It is necessary to verify that cyberd is build with netgo and ledger tags. To check that we can run `cyberdcli version --long` (*But that command is currently not working well*). + +## Add your Ledger key + +If you setup Ledger on the different machine that the one with cyberd it is necessary to make sure that Ledger device is generelly working on it. Great way to do so is installing [Ledger Live](https://shop.ledger.com/pages/ledger-live) to that particular machine and trying to connect Ledger device to it, it wil show some possible issues and error codes to work with ([Fix connection issues](https://support.ledger.com/hc/en-us/articles/115005165269-Fix-connection-issues) guide from Ledger) +When you make sure that your Ledger device is successfully interacting with your machine do following: + ++ Connect and unlock your Ledger device ++ Open the Cosmos app on your Ledger ++ Create an account in cyberdcli from your ledger key + +For actual account creation run: + +``` js +docker exec -ti cyberd cyberdcli keys add --ledger +``` + +After submitting this command Ledger device should show generated address and will wait for confirmation. Hit confirm button and in the console you'll see following output: + +``` js +- name: + type: ledger + address: cyber1gw5kdey7fs9wdh05w66s0h4s24tjdvtcp5fhky + pubkey: cyberpub1addwnpepq0lfpdumac47nysl06u95czd4026ahzmjr9stsx4h65kw3dhh60py0m7k6e + mnemonic: "" + threshold: 0 + pubkeys: [] + ``` + +By default, using `...keys add` command account 0 and index 0 of [bip44](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki) derivation path is used, so in order to add more than one key account and/or index must be specified separately in the following way: + +``` js +docker exec -ti cyberd cyberdcli keys add --ledger --account 1 --index 1 +``` + +You don't need to remember which numbers for account and index you used, it will be matched to automatically. + +## Confirm your address + +To make sure you have everything added correctly just run: + +``` js +docker exec cyberd cyberdcli keys show -d +``` + +Now it's necessary to confirm that key on Ledger matches one shown in console. + +## Signing transactions + +You now ready to sign and send transaktions. That could be done using `tx send` command. Ledger device should be connected and unlocked at this step. Run the following to send some cyb's to someone: + +``` js +docker exec -ti cyberd cyberdcli tx send cyb --chain-id +``` + +`` is your ledger key name, `` is address of recipient in format `cyber1wq7p5qfygxr37vqqufhj5fzwlg55zmm4w0p8sw`. +When prompted with `confirm transaction before signing`, answer Y, and next your Ledger will show and ask to approve transaction. Make sure you'll inspect transaction JSON before signing. When transaction is signed on the Ledger, usuall output will show up in console. From 76e09dcac1843eb815395d8453c0daf59f845372 Mon Sep 17 00:00:00 2001 From: Kiryl Laptanovich <38989909+mrlp4@users.noreply.github.com> Date: Mon, 25 Nov 2019 17:54:05 +0300 Subject: [PATCH 03/11] Delete cyberd_Ledger_guide.md --- docs/cyberd_Ledger_guide.md | 69 ------------------------------------- 1 file changed, 69 deletions(-) delete mode 100644 docs/cyberd_Ledger_guide.md diff --git a/docs/cyberd_Ledger_guide.md b/docs/cyberd_Ledger_guide.md deleted file mode 100644 index 903c6262..00000000 --- a/docs/cyberd_Ledger_guide.md +++ /dev/null @@ -1,69 +0,0 @@ -# Ledger nano Support - -It is possible to use Ledger nano devices with cyberd to store keys and sign transacions. - -## Cyberd CLI & Ledger Nano - -How to get started. First of all you'll need couple things to be done: - -+ Working and synced cyberd node with (how to: [here](https://github.com/cybercongress/cyberd/blob/0.1.5/docs/run_validator.md) and [here](https://github.com/cybercongress/cyberd/blob/master/docs/ultimate-commands-guide_v2.md)) - -+ [Setup](https://support.ledger.com/hc/en-us/articles/360000613793-Set-up-as-new-device) your Ledger device and [install Cosmos app onto it](https://github.com/cosmos/ledger-cosmos/blob/master/README.md#installing) (latest firmware for Ledger and Cosmos app v1.5.3 required) - -It is necessary to verify that cyberd is build with netgo and ledger tags. To check that we can run `cyberdcli version --long` (*But that command is currently not working well*). - -## Add your Ledger key - -If you setup Ledger on the different machine that the one with cyberd it is necessary to make sure that Ledger device is generelly working on it. Great way to do so is installing [Ledger Live](https://shop.ledger.com/pages/ledger-live) to that particular machine and trying to connect Ledger device to it, it wil show some possible issues and error codes to work with ([Fix connection issues](https://support.ledger.com/hc/en-us/articles/115005165269-Fix-connection-issues) guide from Ledger) -When you make sure that your Ledger device is successfully interacting with your machine do following: - -+ Connect and unlock your Ledger device -+ Open the Cosmos app on your Ledger -+ Create an account in cyberdcli from your ledger key - -For actual account creation run: - -``` js -docker exec -ti cyberd cyberdcli keys add --ledger -``` - -After submitting this command Ledger device should show generated address and will wait for confirmation. Hit confirm button and in the console you'll see following output: - -``` js -- name: - type: ledger - address: cyber1gw5kdey7fs9wdh05w66s0h4s24tjdvtcp5fhky - pubkey: cyberpub1addwnpepq0lfpdumac47nysl06u95czd4026ahzmjr9stsx4h65kw3dhh60py0m7k6e - mnemonic: "" - threshold: 0 - pubkeys: [] - ``` - -By default, using `...keys add` command account 0 and index 0 of [bip44](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki) derivation path is used, so in order to add more than one key account and/or index must be specified separately in the following way: - -``` js -docker exec -ti cyberd cyberdcli keys add --ledger --account 1 --index 1 -``` - -You don't need to remember which numbers for account and index you used, it will be matched to automatically. - -## Confirm your address - -To make sure you have everything added correctly just run: - -``` js -docker exec cyberd cyberdcli keys show -d -``` - -Now it's necessary to confirm that key on Ledger matches one shown in console. - -## Signing transactions - -You now ready to sign and send transaktions. That could be done using `tx send` command. Ledger device should be connected and unlocked at this step. Run the following to send some cyb's to someone: - -``` js -docker exec -ti cyberd cyberdcli tx send cyb --chain-id -``` - -`` is your ledger key name, `` is address of recipient in format `cyber1wq7p5qfygxr37vqqufhj5fzwlg55zmm4w0p8sw`. -When prompted with `confirm transaction before signing`, answer Y, and next your Ledger will show and ask to approve transaction. Make sure you'll inspect transaction JSON before signing. When transaction is signed on the Ledger, usuall output will show up in console. From 29edaf6fb622fb72852968725c314bae7eb9ac4d Mon Sep 17 00:00:00 2001 From: Kiryl Laptanovich <38989909+mrlp4@users.noreply.github.com> Date: Mon, 25 Nov 2019 18:48:10 +0300 Subject: [PATCH 04/11] updatedes recomended req. Eth drop parameters and link to gift tool removed "--runtime nvidia" --- docs/run_validator.md | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/docs/run_validator.md b/docs/run_validator.md index 4722eef2..0700e211 100644 --- a/docs/run_validator.md +++ b/docs/run_validator.md @@ -6,7 +6,7 @@ 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. +Also, you may consider to use any cloud service with dedicated GPU, like Hetzner. Cyberd is based on Cosmos SDK written in Go. It should work on any platform which can compile and run programs in Go. @@ -14,16 +14,14 @@ However, I strongly recommend running the validator node on a Linux server. Rank calculation on a cyberd is benefit GPU computation. They easy to parallelize that why is the best way is to use GPU. -Minimal requirements for the next two weeks (until the middle of February): - Recommended requirements: ```js CPU: 6 cores -RAM: 64 GB -SSD: 512 GB +RAM: 32 GB +SSD: 256 GB Connection: 100Mb, Fiber, Stable and low-latency connection -GPU: GeForce 1070-1080, CUDA +GPU: GTX or similar CUDA compatibale card, 6gb of Software: Docker, Ubuntu 16.04/18.04 LTS ``` @@ -301,7 +299,7 @@ mkdir /cyberd-dev/cyberdcli 2. Run fullnode ```bash -docker run -d --name=euler-dev --restart always --runtime=nvidia -p 26656:26656 -p 26657:26657 -p 1317:1317 -e ALLOW_SEARCH=true -v /cyberd-dev/cyberd:/root/.cyberd -v /cyberd-dev/cyberdcli:/root/.cyberdcli cyberd/cyberd:euler-dev +docker run -d --name=euler-dev --restart always -p 26656:26656 -p 26657:26657 -p 1317:1317 -e ALLOW_SEARCH=true -v /cyberd-dev/cyberd:/root/.cyberd -v /cyberd-dev/cyberdcli:/root/.cyberdcli cyberd/cyberd:euler-dev ``` 3. After successful container pulling and launch run to check if your node is connected to the testnet: @@ -341,7 +339,7 @@ docker exec -ti euler-dev cyberdcli keys add --recover docker exec euler-dev cyberdcli keys show ``` -If you have Ethereum address that kept 0.97Eth or more at block 8080808 of EHT network you can import ethereum private key +If you have Ethereum address that kept ~0.2Eth or more at block 8080808 of EHT network you can import ethereum private key, check out our Ethereum [gift tool](qhttps://github.com/cybercongress/launch-kit/tree/0.1.0/ethereum_gift_tool) > Please, do not import high value Ethereum accounts. This can not be safe! cyberd software is a new software and is not battle tested yet. From fab4adaa668e436da5642b260a50639328897950 Mon Sep 17 00:00:00 2001 From: Kiryl Laptanovich <38989909+mrlp4@users.noreply.github.com> Date: Mon, 25 Nov 2019 18:49:58 +0300 Subject: [PATCH 05/11] Update run_validator.md --- docs/run_validator.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/run_validator.md b/docs/run_validator.md index 0700e211..1688ee1b 100644 --- a/docs/run_validator.md +++ b/docs/run_validator.md @@ -21,7 +21,7 @@ CPU: 6 cores RAM: 32 GB SSD: 256 GB Connection: 100Mb, Fiber, Stable and low-latency connection -GPU: GTX or similar CUDA compatibale card, 6gb of +GPU: nvidia GeForce CUDA compatibale card with 6gb of memory Software: Docker, Ubuntu 16.04/18.04 LTS ``` From 491384e7dd58fce6131d17680c5b6540fc47adee Mon Sep 17 00:00:00 2001 From: serejandmyself Date: Mon, 25 Nov 2019 21:35:50 +0300 Subject: [PATCH 06/11] Update run_validator.md Work in progress - please do not merge! --- docs/run_validator.md | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/docs/run_validator.md b/docs/run_validator.md index 1688ee1b..ed1b9359 100644 --- a/docs/run_validator.md +++ b/docs/run_validator.md @@ -1,18 +1,19 @@ -# Join Cyberd Devnet As Validator +# Join Cyberd devnet as a Validator -**Note**. Currently active dev testnet is `euler-dev` (substitute with that value). +**Note** The current active dev testnet is `euler-dev` (substitute with that value, do not forget to remove the `<` and the `>` symbols). ## 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 service with dedicated GPU, like Hetzner. +You should to run your validator node all time. This means that you will need a reliable server to keep it running. +Also, you may consider to use any cloud service with dedicated GPU, like Hetzner (or a local machine). -Cyberd is based on Cosmos SDK written in Go. +Cyberd is based on Cosmos SDK and 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. +However, we strongly recommend running the validator node on a Linux server. -Rank calculation on a cyberd is benefit GPU computation. They easy to parallelize that why is the best way is to use GPU. +Rank calculation in cyberd is benefit to GPU computation. +They are easy to parallelize. This is why it is best to use GPU. Recommended requirements: @@ -25,15 +26,16 @@ GPU: nvidia GeForce CUDA compatibale card with 6gb of memory Software: Docker, Ubuntu 16.04/18.04 LTS ``` -But, of cource, hardware is your onw choise and tecnically it migth be possible to run chain on "even - 1 CUDA core gpu", but you should be aware of stabilty and calculation speed drop. +But, of cource, hardware is your onw choise and tecnically it migth be possible to run the chain on "even - 1 CUDA core gpu", but, you should be aware of stabilty and a decline in calculation speed. ## Validator setup ### Third-party software -Cyberd main distribution unit is a [docker](https://www.docker.com/) container. All images are located in default [Dockerhub registry](https://hub.docker.com/r/cyberd/cyberd/). In order to access GPU from the container, Nvidia drivers version **410+** and [Nvidia docker runtime](https://github.com/NVIDIA/nvidia-docker) should be installed on the host system. For great user experience, we propose you to use [portainer](https://portainer.io) - docker containers manager. You can skip any subsection of this if you already had and configured necessary software. +The main distribution unit for Cyberd is a [docker](https://www.docker.com/) container. All images are located in the default [Dockerhub registry](https://hub.docker.com/r/cyberd/cyberd/). In order to access the GPU from the container, Nvidia drivers version **410+** and [Nvidia docker runtime](https://github.com/NVIDIA/nvidia-docker) should be installed on the host system. For better user experience, we propose you use [portainer](https://portainer.io) - a docker containers manager. You can skip any subsection of this guide if you already have any of the necessary software configured. #### Docker installation +Simply, copy the commands below into your CLI. 1. Update the apt package index: @@ -52,7 +54,7 @@ sudo apt-get install \ software-properties-common ``` -> May require `curl` installation `apt-get install curl` +> You may require installing `curl` - `apt-get install curl` 3. Add Docker’s official GPG key: @@ -73,13 +75,13 @@ sudo add-apt-repository \ sudo apt-get update ``` -5. Install the latest version of Docker CE and containerd, or go to the next step to install a specific version (at the date of Nov 2019 version 19.03 is required): +5. Install the latest version of Docker CE and containerd or skip to the next step to install a specific version (as of Nov 2019 version 19.03 is required): ```bash sudo apt-get install docker-ce docker-ce-cli containerd.io ``` -If you don’t want to preface the docker command with sudo, create a Unix group called docker and add users to it. When the Docker daemon starts, it creates a Unix socket accessible by members of the docker group. +If you don’t want to preface docker commands with sudo create a Unix group called docker and add users to that group. When the Docker daemon starts it creates a Unix socket accessible by members of the docker group. 6. Create the docker group. @@ -90,7 +92,7 @@ sudo groupadd docker 7. Add your user to the docker group. ```bash -sudo usermod -aG docker $USER +sudo usermod -aG docker $YOUR-USER-NAME ``` 8. Reboot the system for the changes to take effect. From 9802ce561f9afac60a265a3c58501d1fd8bd83b5 Mon Sep 17 00:00:00 2001 From: serejandmyself Date: Mon, 25 Nov 2019 22:14:57 +0300 Subject: [PATCH 07/11] Update run_validator.md --- docs/run_validator.md | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/docs/run_validator.md b/docs/run_validator.md index ed1b9359..06fea3b2 100644 --- a/docs/run_validator.md +++ b/docs/run_validator.md @@ -69,7 +69,7 @@ sudo add-apt-repository \ stable" ``` -4. Update the apt package index. +4. Update the apt package index: ```bash sudo apt-get update @@ -83,13 +83,13 @@ sudo apt-get install docker-ce docker-ce-cli containerd.io If you don’t want to preface docker commands with sudo create a Unix group called docker and add users to that group. When the Docker daemon starts it creates a Unix socket accessible by members of the docker group. -6. Create the docker group. +6. Create the docker group: ```bash sudo groupadd docker ``` -7. Add your user to the docker group. +7. Add your user to the docker group: ```bash sudo usermod -aG docker $YOUR-USER-NAME @@ -99,13 +99,13 @@ sudo usermod -aG docker $YOUR-USER-NAME #### Portainer installation (optional) -1. Before installing Portainer, download the Portainer image from the DockerHub using the docker pull command below. +1. Before installing Portainer, download the Portainer image from the DockerHub using the docker pull command below: ```bash docker pull portainer/portainer ``` -2. Now run Portainer using the simple docker command below. +2. Now, run Portainer by using the simple docker command from below: ```bash docker run -d --restart always -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock portainer/portainer @@ -119,11 +119,12 @@ localhost:9000 ![](https://ipfs.io/ipfs/QmS42MJxjUB7Cu1GoJeE6eBmWkjHTZdgiAUcX4Qqy9NR3M) -4. Set password, chose `local` tab and click `connect`. All containers will be available at `containers` tab. +4. Create a username and set a password. Chose the `local` tab and click `connect`. +All the containers will be available in the `containers` tab on your dashboard. #### Nvidia drivers installation -1. To proceed first add the `ppa:graphics-drivers/ppa` repository into your system: +1. To proceed, first add the `ppa:graphics-drivers/ppa` repository into your system (you might see some warnings - press `enter`): ```bash sudo add-apt-repository ppa:graphics-drivers/ppa @@ -133,17 +134,17 @@ sudo add-apt-repository ppa:graphics-drivers/ppa sudo apt update ``` -2. Install Ubuntu-drivers +2. Install Ubuntu-drivers: ```bash sudo apt install -y ubuntu-drivers-common ``` -3. Next, identify your graphic card model and recommended driver: +3. Next, identify your graphic card model and the recommended drivers: ```bash ubuntu-drivers devices ``` -You should see something like this: +You should see something similar to this this: ```bash == /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 == @@ -157,15 +158,15 @@ driver : nvidia-driver-440 - third-party free recommended driver : xserver-xorg-video-nouveau - distro free builtin ``` -4. We need +4. We need the **410+** -drivers release. As we see v440 is recommended. The command below will install the recommended version of drivers. +drivers release. As you can see v440 is recommended. The command below will install the recommended version of drivers: ```bash sudo ubuntu-drivers autoinstall ``` -Drivers will install due approximately 10 minutes. +Drivers will install for approximately 10 minutes. ```bash DKMS: install completed. @@ -190,7 +191,7 @@ update-initramfs: Generating /boot/initrd.img-4.15.0-45-generic 5. Reboot the system for the changes to take effect. -6. Check installed drivers +6. Check the installed drivers ```bash nvidia-smi From 460123aa4be822e2c5ec99e9879097fc2fc12b38 Mon Sep 17 00:00:00 2001 From: serejandmyself Date: Mon, 25 Nov 2019 22:54:28 +0300 Subject: [PATCH 08/11] Update run_validator.md --- docs/run_validator.md | 85 +++++++++++++++++++++++-------------------- 1 file changed, 45 insertions(+), 40 deletions(-) diff --git a/docs/run_validator.md b/docs/run_validator.md index 06fea3b2..2d7b8649 100644 --- a/docs/run_validator.md +++ b/docs/run_validator.md @@ -191,12 +191,13 @@ update-initramfs: Generating /boot/initrd.img-4.15.0-45-generic 5. Reboot the system for the changes to take effect. -6. Check the installed drivers +6. Check the installed drivers: ```bash nvidia-smi ``` You should see this: +(Some version/driver numbers migth differ. You also might have some processes already running) ``` +-----------------------------------------------------------------------------+ @@ -217,9 +218,9 @@ You should see this: +-----------------------------------------------------------------------------+ ``` -### Install Nvidia container runtime for docker +#### Install Nvidia container runtime for docker -1. Add the package repositories +1. Add package repositories: ```bash distribution=$(. /etc/os-release;echo $ID$VERSION_ID) @@ -257,7 +258,7 @@ sudo systemctl restart docker docker run --runtime=nvidia --rm nvidia/cuda:10.0-base nvidia-smi ``` -Output logs must should coincide as earlier: +Output logs should coincide as earlier: ``` Unable to find image 'nvidia/cuda:10.0-base' locally @@ -288,9 +289,9 @@ Fri Feb 1 05:41:12 2019 +-----------------------------------------------------------------------------+ ``` -Your machine is ready to launch fullnode. +Your machine is ready to launch the fullnode. -## Cyberd fullnode launching +### Cyberd fullnode launching 1. Create folders for keys and data storing where you want, for example: @@ -299,102 +300,104 @@ mkdir /cyberd-dev/cyberd mkdir /cyberd-dev/cyberdcli ``` -2. Run fullnode +2. Run the fullnode: +(This will pull and extract the image from cyberd/cyberd) ```bash docker run -d --name=euler-dev --restart always -p 26656:26656 -p 26657:26657 -p 1317:1317 -e ALLOW_SEARCH=true -v /cyberd-dev/cyberd:/root/.cyberd -v /cyberd-dev/cyberdcli:/root/.cyberdcli cyberd/cyberd:euler-dev ``` -3. After successful container pulling and launch run to check if your node is connected to the testnet: +3. After successful pulling of the container and launching, run to check if your node is connected to the testnet: ```bash docker exec euler-dev cyberdcli status ``` -The possible output looks like this: +A possible output looks like this: ```bash {"node_info":{"protocol_version":{"p2p":"6","block":"9","app":"0"},"id":"93b776d3eb3f3ce9d9bda7164bc8af3acacff7b6","listen_addr":"tcp://0.0.0.0:26656","network":"euler-dev","version":"0.32.7","channels":"4020212223303800","moniker":"anon","other":{"tx_index":"on","rpc_address":"tcp://0.0.0.0:26657"}},"sync_info":{"latest_block_hash":"686B4E65415D4E56D3B406153C965C0897D0CE27004E9CABF65064B6A0ED4240","latest_app_hash":"0A1F6D260945FD6E926785F07D41049B8060C60A132F5BA49DD54F7B1C5B2522","latest_block_height":"4553","latest_block_time":"2019-11-24T09:49:19.771375108Z","catching_up":false},"validator_info":{"address":"66098853CF3B61C4313DD487BA21EDF8DECACDF0","pub_key":{"type":"tendermint/PubKeyEd25519","value":"uZrCCdZTJoHE1/v+EvhtZufJgA3zAm1bN4uZA3RyvoY="},"voting_power":"0"}} ``` -Your node has started to sync. If that didn't happen, check your config.toml file located at //cyberd/config/config.toml and add at least couple addresses to and , some of those you can fing at our [forum](https://ai.cybercongress.ai/t/euler-dev-testnet/32). +Your node has started to sync. If that didn't happen, check your config.toml file located at //cyberd/config/config.toml and add at least a couple of addresses to and , some of those you can fing on our [forum](https://ai.cybercongress.ai/t/euler-dev-testnet/32). -The syncing process you can see in the terminal. Open a new tab and run following command: +You can follow the syncing process in the terminal. Open a new tab and run the following command: ```bash docker logs euler-dev --follow ``` -Additional information available by API endpoint at `localhost:26657` +Additional information about the chain is available via an API endpoint at: `localhost:26657` (access via your browser) -f.e. the number of active validators available here `localhost:26657/validators` +e.i. the number of active validators is available at: `localhost:26657/validators` ## Validator start -After your node successful synced you can run validator. +After your node has successfully synced, you can run a validator. -#### Prepare stake address +#### Prepare the staking address -We included 1 million Ethereum addresses, over 8000 cosmos addresses and all of `euler-4` validators addresses into genesis, so there's a huge chance that you alredy have some EUL tokens. Here's 3 ways to check this out: +We included 1 million Ethereum addresses, over 8000 Cosmos addresses and all of `euler-4` validators addresses into genesis, so there's a huge chance that you alredy have some EUL tokens. Here are 3 ways to check this: -If you already have cyberd address with EUL and know seed phrase or private key just restore it into your local keystore. +If you already have a cyberd address with EUL and know the seed phrase or your private key, just restore it into your local keystore: ```bash docker exec -ti euler-dev cyberdcli keys add --recover docker exec euler-dev cyberdcli keys show ``` -If you have Ethereum address that kept ~0.2Eth or more at block 8080808 of EHT network you can import ethereum private key, check out our Ethereum [gift tool](qhttps://github.com/cybercongress/launch-kit/tree/0.1.0/ethereum_gift_tool) +If you have an Ethereum address that had ~0.2Eth or more at block 8080808 (on the ETH network), you can import your Ethereum private key. To do this, please check out our Ethereum [gift tool](qhttps://github.com/cybercongress/launch-kit/tree/0.1.0/ethereum_gift_tool) -> Please, do not import high value Ethereum accounts. This can not be safe! cyberd software is a new software and is not battle tested yet. +> Please do not import high value Ethereum accounts. This is not safe! cyberd software is a new and has not been battle tested yet. ```bash docker exec -ti euler-dev cyberdcli keys add import_private docker exec euler-dev cyberdcli keys show ``` -If you want to create new acccount use the command below. -Also, you should send coins to that address to bound them later during validator submitting. +If you want to create a new acccount, use the command below: +(You should send coins to that address to bound them later during the submitting of the validator) ```bash docker exec -ti euler-dev cyberdcli keys add docker exec euler-dev cyberdcli keys show ``` -Also you could use ledger device with cosmos app on it to sign and store cyber addresses, just use --ledger flag with your commands: +You could use your ledger device with a Cosmos app installed on it to sign and store cyber addresses. +Just use the --ledger flag, with your commands: ```bash docker exec -ti euler-dev cyberdcli keys add --ledger ``` **** is any name you pick to represent this key pair. -You have to refer to this later when you use the keys to sign transactions. +You have to refer to this parameter 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. +You will 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 +The command returns the address, a public key and a seed phrase, which you can use 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. +Keep the seed phrase at a safe place (preferably, not hot storage) in case you have to use it. -The address showing here is your account address. Let’s call this ****. +The address shown here is your account address. Let’s call this ****. It stores your assets. -#### Send create validator transaction +#### Send the 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, +Validators are actors on the network committing to new blocks by submitting their votes. +This refers to the node itself, not a single person or a single account. +Therefore, the public key here is referring to the nodes public key, not the public key of the address you have just created. -To get the node public key, run the following command: +To get the nodes public key, run the following command: ```bash docker exec euler-dev cyberd tendermint show-validator ``` It will return a bech32 public key. Let’s call it ****. -The next step you have to declare a validator candidate. -The validator candidate is the account which stake the coins. +The next step is to to declare a validator candidate. +The validator candidate is the account which stakes the coins. So the validator candidate is an account this time. -To declare a validator candidate, run the following command adjusting stake amount and other fields. +To declare a validator candidate, run the following command adjusting the stake amount and the other fields: ```bash docker exec -ti euler-dev cyberdcli tx staking create-validator \ @@ -410,19 +413,21 @@ docker exec -ti euler-dev cyberdcli tx staking create-validator \ --chain-id=euler-dev ``` -#### Verify that you validating +#### Verify that you are validating ```bash docker exec -ti euler-dev cyberdcli query staking validators --trust-node=true ``` -If you see your `` with status `Bonded` and Jailed `false` everything must be good. You are validating the network. +If you see your `` with status `Bonded` and Jailed `false` everything is good. +You are validating the network. -## Maintenance of validator +## Maintenance of the validator -#### jailing +#### Jailing -If your validator go under slashing conditions it first go to jail. After this event operator must unjail it manually. +If your validator got under slashing conditions, it will be jailed. +After such event, an operator must unjail the validator manually: ```bash docker exec -ti euler-dev cyberdcli tx slashing unjail --from= --chain-id euler-dev From d0c364e58ae7460f8067c6916e2b6f4335012bd0 Mon Sep 17 00:00:00 2001 From: Kiryl Laptanovich <38989909+mrlp4@users.noreply.github.com> Date: Tue, 26 Nov 2019 18:26:04 +0300 Subject: [PATCH 09/11] updated info about cards --- docs/run_validator.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/run_validator.md b/docs/run_validator.md index 2d7b8649..a172492e 100644 --- a/docs/run_validator.md +++ b/docs/run_validator.md @@ -22,9 +22,10 @@ CPU: 6 cores RAM: 32 GB SSD: 256 GB Connection: 100Mb, Fiber, Stable and low-latency connection -GPU: nvidia GeForce CUDA compatibale card with 6gb of memory +GPU: nvidia GeForce(or Tesla/Titan/Quadro) with CUDA-cores; at least 6gb of memory* Software: Docker, Ubuntu 16.04/18.04 LTS ``` +*Cyberd runs well on comsumer grade cards like Geforce GTX 1070, but expecting load growth we advise to use Error Correction compatible cards from Tesla or Quadro families. But, of cource, hardware is your onw choise and tecnically it migth be possible to run the chain on "even - 1 CUDA core gpu", but, you should be aware of stabilty and a decline in calculation speed. From 63159aa99f0b2af74b41440012f6ed59808c08e4 Mon Sep 17 00:00:00 2001 From: Kiryl Laptanovich <38989909+mrlp4@users.noreply.github.com> Date: Tue, 26 Nov 2019 18:30:59 +0300 Subject: [PATCH 10/11] add ledger_cli guide --- docs/run_validator.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/run_validator.md b/docs/run_validator.md index a172492e..4660b3d1 100644 --- a/docs/run_validator.md +++ b/docs/run_validator.md @@ -362,8 +362,8 @@ docker exec -ti euler-dev cyberdcli keys add docker exec euler-dev cyberdcli keys show ``` -You could use your ledger device with a Cosmos app installed on it to sign and store cyber addresses. -Just use the --ledger flag, with your commands: +You could use your ledger device with a Cosmos app installed on it to sign and store cyber addresses: [guide here](https://github.com/cybercongress/cyberd/blob/0.1.5/docs/cyberd_Ledger_guide.md). +In common case use the --ledger flag, with your commands: ```bash docker exec -ti euler-dev cyberdcli keys add --ledger From 5f70455b11c169d8e1c1c2111b5e23609a672164 Mon Sep 17 00:00:00 2001 From: serejandmyself Date: Wed, 27 Nov 2019 14:20:46 +0300 Subject: [PATCH 11/11] Update run_validator.md --- docs/run_validator.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/run_validator.md b/docs/run_validator.md index 4660b3d1..bbbba5ee 100644 --- a/docs/run_validator.md +++ b/docs/run_validator.md @@ -362,7 +362,7 @@ docker exec -ti euler-dev cyberdcli keys add docker exec euler-dev cyberdcli keys show ``` -You could use your ledger device with a Cosmos app installed on it to sign and store cyber addresses: [guide here](https://github.com/cybercongress/cyberd/blob/0.1.5/docs/cyberd_Ledger_guide.md). +You could use your ledger device with the Cosmos app installed on it to sign and store cyber addresses: [guide here](https://github.com/cybercongress/cyberd/blob/0.1.5/docs/cyberd_Ledger_guide.md). In common case use the --ledger flag, with your commands: ```bash