Skip to content

Commit

Permalink
#104 Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
hleb-albau committed Dec 11, 2018
1 parent 6813f5f commit b52ce7b
Show file tree
Hide file tree
Showing 13 changed files with 152 additions and 194 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
command: |
export GO111MODULE=on
go build -o daemon ./cyberd
go build -o cli ./cyberdcli
go build -o cyberdcli ./cli
go build -o cyberdproxy ./proxy
go build -o cyberdclaim ./claim
Expand Down Expand Up @@ -117,7 +117,7 @@ jobs:
name: Github Release Cyberd Binaries
command: |
export GO111MODULE=on
go build -o cli ./cyberdcli
go build -o cyberdcli ./cli
sudo apt-get update && sudo apt-get install -y rpm
curl -sL https://git.io/goreleaser | bash
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ initial_guess_impact_results
*.so
*.o

cli
cyberdcli
6 changes: 3 additions & 3 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
builds:
-
main: ./cyberdcli
binary: cli
main: ./cli
binary: cyberdcli
env:
- CGO_ENABLED=0
- GO111MODULE=on
Expand All @@ -23,8 +23,8 @@ changelog:
exclude:
- '^docs:'
- '^test:'
- '^CI:'
- Merge pull request
- Merge branch


nfpm:
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ RUN nvcc -fmad=false -shared -o libcbdrank.so rank.cu --compiler-options '-fPIC
###############################################################################
WORKDIR /sources
RUN go build -tags cuda -o daemon ./cyberd
RUN go build -o cli ./cyberdcli
RUN go build -o daemon_proxy ./proxy
RUN go build -o cyberdcli ./cli
RUN go build -o cyberdproxy ./proxy


###############################################################################
Expand Down Expand Up @@ -65,8 +65,8 @@ RUN url="https://golang.org/dl/go${GO_VERSION}.${GO_ARCH}.tar.gz" && \
# Copy compiled kernel and binaries
###############################################################################
COPY --from=build_stage /sources/daemon /usr/bin/cyberd
COPY --from=build_stage /sources/cli /usr/bin/cyberdcli
COPY --from=build_stage /sources/daemon_proxy /usr/bin/cyberdproxy
COPY --from=build_stage /sources/cyberdcli /usr/bin/cyberdcli
COPY --from=build_stage /sources/cyberdproxy /usr/bin/cyberdproxy

COPY --from=build_stage /usr/lib/cbdrank.h /usr/lib/cbdrank.h
COPY --from=build_stage /usr/lib/libcbdrank.so /usr/lib/libcbdrank.so
Expand Down
6 changes: 0 additions & 6 deletions build_binaries.sh

This file was deleted.

2 changes: 1 addition & 1 deletion cyberdcli/commands/linktx.go → cli/commands/linktx.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
authtxb "github.com/cosmos/cosmos-sdk/x/auth/client/txbuilder"
cbd "github.com/cybercongress/cyberd/app/types"
. "github.com/cybercongress/cyberd/cyberdcli/util"
. "github.com/cybercongress/cyberd/cli/util"
"github.com/ipfs/go-cid"
"github.com/spf13/cobra"
"github.com/spf13/viper"
Expand Down
2 changes: 1 addition & 1 deletion cyberdcli/main.go → cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/version"
"github.com/cybercongress/cyberd/app"
cyberdcmd "github.com/cybercongress/cyberd/cyberdcli/commands"
cyberdcmd "github.com/cybercongress/cyberd/cli/commands"
"github.com/spf13/cobra"
"github.com/tendermint/tendermint/libs/cli"

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion docs/OLD_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ In project directory go into `/cosmos/poc/` and run:
```$bash
export GO111MODULE=on
go install ./cyberd
go install ./cyberdcli
go install -o cyberdcli ./cli
```

This will create binaries for `cyberd` and `cyberdcli`
Expand Down
98 changes: 0 additions & 98 deletions docs/join_network.md

This file was deleted.

136 changes: 136 additions & 0 deletions docs/run_validator.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
# Join Cyberd Network As Validator

## 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: 6
2. RAM: 32GB
3. Card with Nvidia CUDA support(ex 1080ti) and at least 8gb VRAM.
4. Disk: 256GB SSD


## Install Dependencies

Our main distribution unit is docker container.
All images are located in default [Dockerhub registry](https://hub.docker.com/r/cyberd/cyberd/).
Rank calculated on **GPU** using [**CUDA Toolkit**](https://docs.nvidia.com/cuda/index.html).
In order to access **GPU** from container, nvidia drivers version **410+** and
[nvidia docker runtime](https://github.com/NVIDIA/nvidia-docker) should be installed on host system.


Check both driver and docker runtime installed correctly:
```bash
docker run --runtime=nvidia --rm nvidia/cuda:10.0-base nvidia-smi

# Should be displayed something like this.
Tue Dec 11 18:02:15 2018
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 410.78 Driver Version: 410.78 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 1050 Off | 00000000:01:00.0 Off | N/A |
| N/A 52C P0 N/A / N/A | 302MiB / 4042MiB | 2% Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
+-----------------------------------------------------------------------------+
```

## Start Fullnode

First, create folder, where daemon and cli will store data. Some commands may require admin privileges.
```bash
mkdir /cyberd
```

Run daemon with mounted volumes on created during previous step folder.
```bash
docker run -d --name=cyberd --runtime=nvidia \
-p 26656:26656 -p 26657:26657 -p 26660:26660 \
-v /cyberd/daemon:/root/.cyberd \
-v /cyberd/cli:/root/.cyberdcli \
cybercongress/cyberd:latest
```

To check if your node is connected to the testnet, you can run this:
```
docker exec cyberd cyberdcli status
```
You should be seeing a returned JSON with your node status including node_info, sync_info and validator_info.

## Prepare stake address

Alright, you are now connected to the testnet.
To be a validator, you will need some **CBD**(cyberd coin) to be bounded as your stake.
Top 146 validators by bounded stake will be active validators taking part in consensus.

If you already have address with **CBD**, just restore it with your seed phrase into your local keystore.
```bash
docker exec -ti cyberd cyberdcli keys add <your_key_name> --recover
docker exec cyberd cyberdcli show <your_key_name>
```

If no, create new one using command below.
Also, you should send coins to that address to bound them later during validator submitting.
```
docker exec -ti cyberd cyberdcli add <your_key_name>
docker exec cyberd cyberdcli show <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
docker exec cyberd cyberd 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 adjusting stake amount and other fields.

```bash
docker exec cyberd cyberdcli tx stake create-validator \
--amount=100CBD \
--pubkey=<your_node_pubkey> \
--moniker=<your_node_nickname> \
--trust-node \
--from=<your_key_name> \
--commission-rate="0.10" \
--commission-max-rate="0.20" \
--commission-max-change-rate="0.01"
```
Loading

0 comments on commit b52ce7b

Please sign in to comment.