Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ethereum connection info for validator guide #91

Merged
merged 2 commits into from
Feb 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Home.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Join the Discord server by clicking on the badge below!
Start a full node named `my-node` and connect it to the CENNZnet MainNet:
```bash
# via docker
$ docker run cennznet/cennznet:1.5.1 \
$ docker run cennznet/cennznet:2.0.0 \
--chain=/cennznet/genesis/azalea.raw.json \
--name=my-node \
--telemetry-url 'ws://cennznet-telemetry.centrality.me:1024 0'
Expand Down Expand Up @@ -61,5 +61,5 @@ CENNZnet UI: https://cennznet.io/
Block Explorer: https://uncoverexplorer.com/

Mainnet DB snapshots:
- https://s3-ap-southeast-1.amazonaws.com/cennznet-snapshots.centralityapp.com/azalea/1.2.2/validator/index.html
- https://s3-ap-southeast-1.amazonaws.com/cennznet-snapshots.centralityapp.com/azalea/1.2.2/fullnode/index.html
- https://s3-ap-southeast-1.amazonaws.com/cennznet-snapshots.centralityapp.com/azalea/2.0.0/validator/index.html
- https://s3-ap-southeast-1.amazonaws.com/cennznet-snapshots.centralityapp.com/azalea/2.0.0/fullnode/index.html
8 changes: 4 additions & 4 deletions Network-participating/Node-operating/Running-a-Full-Node.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The `<name>.raw.json` versions should be used as they're compatible with multipl
Then run a full node that connects to the MainNet:

```bash
$ docker run cennznet/cennznet:1.5.1 \
$ docker run cennznet/cennznet:2.0.0 \
# genesis is included in the image
--chain=/cennznet/genesis/azalea.raw.json \
--name=<NODE_NAME> \
Expand Down Expand Up @@ -109,7 +109,7 @@ on the node key file.

To get detailed descriptions on the flags, run either of the following:
```bash
$ docker run cennznet/cennznet:1.5.1 --help # using docker
$ docker run cennznet/cennznet:2.0.0 --help # using docker
$ ./target/release/cennznet -- --help # using binary
```

Expand All @@ -127,7 +127,7 @@ INFO ⚙️ Syncing 21.2 bps, target=#1140132 (1 peers), best: #532405 (0xfad8
### Connecting to Rata for development
[Rata](Getting-started/CENNZnet-technical-overview?id=cennznet-networks-and-genesis-files) is a playground network for testing. The following command would run a node that connects to Rata and with full WebSocket connectivity enabled (unsafe for validators).
```bash
docker run cennznet/cennznet:1.5.1 \
docker run cennznet/cennznet:2.0.0 \
--chain=/cennznet/genesis/rata.raw.json \
--bootnodes=/dns4/bootnode-rata-0.centrality.me/tcp/30333/p2p/12D3KooWA6iSdKNJUpvNPTRzxiLfA2LzPgCTywWP2ZeRnabDaDEa \
--unsafe-ws-external \
Expand All @@ -142,7 +142,7 @@ Make sure Rust is installed on your machine (see [here](Installing-Dependencies#
Clone the repository and build the binary:

```bash
$ git clone https://github.com/cennznet/cennznet --branch release/1.5.1 && cd cennznet
$ git clone https://github.com/cennznet/cennznet --branch release/2.0.0 && cd cennznet
$ cargo build --release
```

Expand Down
28 changes: 24 additions & 4 deletions Network-participating/Node-operating/Running-a-validator.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ Ubuntu OS
### 1) Download the Latest Snapshot
This is a snapshot of the CENNZnet blockchain maintained by Centrality.
It will give the node a large head start on syncing the block data.
**NOTE!** check [MainNet DB snapshots](https://s3-ap-southeast-1.amazonaws.com/cennznet-snapshots.centralityapp.com/azalea/1.2.2/validator/index.html)
**NOTE!** check [MainNet DB snapshots](https://s3-ap-southeast-1.amazonaws.com/cennznet-snapshots.centralityapp.com/azalea/2.0.0/validator/index.html)
for the most recent snapshot file and substitute it in the command below
```bash
SNAPSHOT_DATE=2021-03-16-1035
aria2c -x 8 "https://s3-ap-southeast-1.amazonaws.com/cennznet-snapshots.centralityapp.com/azalea/1.2.2/validator/NZDT-$SNAPSHOT_DATE-chains.tar.gz"
aria2c -x 8 "https://s3-ap-southeast-1.amazonaws.com/cennznet-snapshots.centralityapp.com/azalea/2.0.0/validator/NZDT-$SNAPSHOT_DATE-chains.tar.gz"

# extract the snapshot and move the 'chains' folder into './data/chains'
tar xvf NZDT-2021-03-16-1035-chains.tar.gz && \
Expand All @@ -45,9 +45,10 @@ The command below will start a dockerized CENNZnet node.
The `data` folder will be mounted into the container at `/data`, this contains the chain snapshot downloaded earlier.

The important configurations are:
`--name` is any name you want your node to appear as when reported to the telemetry server
`--node-key` the 32-byte seed network identity we generated earlier
`--base-path` the path where the chain snapshot is mounted in the container i.e `/data`
`--name` is any name you want your node to appear as when reported to the telemetry server
`--eth-http` an http/s URL to an Ethereum full node**\*** (see [here](https://cennz.net/knowledge-hub/core-modules/emery-cennznet-ethereum-token-bridge/) for info)

```bash
# !!!Replace with your pre-generated key!!!
Expand All @@ -59,10 +60,12 @@ docker run -d \
--restart=always \
-p 9933:9933 \
-v $(pwd)/data:/data \
cennznet/cennznet:1.5.1 \
cennznet/cennznet:2.0.0 \
--validator \
--node-key=$NODE_P2P_KEY \
--name=$NODE_NAME \
# Ethereum full node http endpoint (Eth mainnet)
--eth-http='https://eth-mainnet.alchemyapi.io/v2/<API_KEY_REDACTED>' \
--unsafe-rpc-external \
--rpc-methods=Unsafe \
--chain=/cennznet/genesis/azalea.raw.json \
Expand All @@ -85,3 +88,20 @@ Save this value for use in "claiming your session keys" step in the staking guid

### Done
That's it. Check your node's sync progress on the [telemetry site](http://cennznet-telemetry.centrality.me/) and follow the staking guide to connect your node to a CENNZnet account.


## *Ethereum Connection

As of CENNZnet 2.0.0 version, validators require a connection to Ethereum mainnet in order to witness transactions for the Ethereum bridging protocol.
The simplest way is to use an Ethereum RPC provider service, a process which takes only a few minutes to setup.
It is also fine to host your own Ethereum node for this purpose.

These are some services which provide free ethereum full nodes:

- https://zmok.io
- https://infura.io
- https://www.alchemy.com/
- https://moralis.io/

Once an Ethereum full node connection is active, restart your CENNZnet validator providing the full node endpoint with the `--eth-http` flag.
This will allow the validator to connect with Ethereum and participate in the Emery bridging protocol and earn rewards from the bridging protocol.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

Fresh nodes may take days to complete synchronisation. To make the process faster, the CENNZnet team takes snapshots of the nodes.

The [Archive(Validator) Node archives can be found here](https://s3-ap-southeast-1.amazonaws.com/cennznet-snapshots.centralityapp.com/azalea/1.2.2/validator/index.html).
The [Archive(Validator) Node archives can be found here](https://s3-ap-southeast-1.amazonaws.com/cennznet-snapshots.centralityapp.com/azalea/2.0.0/validator/index.html).

The [Full Node archives can be found here](https://s3-ap-southeast-1.amazonaws.com/cennznet-snapshots.centralityapp.com/azalea/1.2.2/fullnode/index.html).
The [Full Node archives can be found here](https://s3-ap-southeast-1.amazonaws.com/cennznet-snapshots.centralityapp.com/azalea/2.0.0/fullnode/index.html).

To run a node with an archive,
* Download the latest archive
Expand Down
4 changes: 2 additions & 2 deletions Network-participating/Staking/Validator-Staking-Guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Key Links:
- [CENNZnet node telemetry](http://cennznet-telemetry.centrality.me/#/CENNZnet-Azalea)
- [CENNZnet UI](https://cennznet.io)
- [Docker Images](https://hub.docker.com/r/cennznet/cennznet/tags?page=1&ordering=last_updated)
- [MainNet DB snapshots](https://s3-ap-southeast-1.amazonaws.com/cennznet-snapshots.centralityapp.com/azalea/1.2.2/validator/index.html)
- [MainNet DB snapshots](https://s3-ap-southeast-1.amazonaws.com/cennznet-snapshots.centralityapp.com/azalea/2.0.0/validator/index.html)
- [Polkadot Validator Guide](https://wiki.polkadot.network/docs/en/maintain-guides-secure-validator)

## Staking Overview
Expand Down Expand Up @@ -178,7 +178,7 @@ Some bootnodes are included in the genesis/chain config, to supply additional bo

#### Starting a node from a snapshot

1. Download the latest archive of validator nodes from [here](https://s3-ap-southeast-1.amazonaws.com/cennznet-snapshots.centralityapp.com/azalea/1.2.2/validator/index.html)
1. Download the latest archive of validator nodes from [here](https://s3-ap-southeast-1.amazonaws.com/cennznet-snapshots.centralityapp.com/azalea/2.0.0/validator/index.html)
2. Unzip the archive
3. Customise and run the command below

Expand Down