Skip to content

Commit

Permalink
cm-351/343/365 Multi Validator Node Docco update and bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rnistuk committed Mar 12, 2020
1 parent 1986dc5 commit fd24fcf
Show file tree
Hide file tree
Showing 6 changed files with 229 additions and 105 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
The Bluzelle Curium Application
===============================

**TODO: Marketing description of the product here**
The decentralized database for Web 3.0. Bluzelle uses blockchain and
EdgeComputing for greater performance and security.

Bluzelle Curium Multi-Validator Zone Installation
-------------------------------------------------

These are steps involved in setting up the OS, Dev Environment, building and deploying a multi-node Curium Zone.
These are steps involved in setting up the OS, Dev Environment, building and
deploying a multi-node Curium Zone.

1. [OS Setup for Curium](./docs/setup/os.md)
2. [Development Environment Setup](./docs/setup/devenv.md)
Expand Down
43 changes: 29 additions & 14 deletions docs/setup/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,22 @@
Build the Curium Project
========================

1. cd to the project folder
1. In a terminal, change to the curium working directory

$ cd ~/go/src/github.com/bluzelle/curium
cd ~/go/src/github.com/bluzelle/curium

2. Install blzd and blzcli
2. Use make to build and install the blzd and blzcli executables

$ make install
make install

3. Ensure blzcli and blzd work by executing the binaries, you should be able to execute the apps from your user folder:
3. Ensure Bluzelle CLI and daemon work by executing the binaries, you should
be able to execute the apps from your users directory:

cd
blzcli
The output of the Bluzelle CLI will be:

$ cd
$ blzcli
Bluzelle CRUD Client
Usage:
Expand Down Expand Up @@ -44,10 +48,13 @@ Build the Curium Project

Use "blzcli [command] --help" for more information about a command.

the daemon:
similarly for the Bluzelle daemon:

$ cd
$ blzd
cd
blzd
Which will produce the following output:

Bluzelle CRUD Daemon (server)

Usage:
Expand Down Expand Up @@ -76,18 +83,26 @@ Build the Curium Project

Use "blzd [command] --help" for more information about a command.

4. You can also verify the build versions with the following commands. They should match the git commit hash of the tip (git rev-parse HEAD) you cloned above.
4. Verify the build Bluzelle CLI build version

$ blzcli version --long
blzcli version --long
which provides the output

name: BluzelleService
server_name: blzd
client_name: blzcli
version: 0.0.0-24-g3253c8b
commit: 3253c8b6b4e40b125c0ccdfd6a81a06a02a5e018
build_tags: ledger,cosmos-sdk v0.37.4
go: go version go1.13.4 darwin/amd64

$ blzd version --long

Similarly, verify the Bluzelle daemon

blzd version --long

which has the output

name: BluzelleService
server_name: blzd
client_name: blzcli
Expand Down
102 changes: 76 additions & 26 deletions docs/setup/deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,26 @@
Deploy the Initial Node
=======================

1. Before initializing a node, remove the previous node config folders from your home folder, if they exist
1. Before initializing a node, remove the previous node config folders from
your home folder, if they exist

rm -rf .blz*

2. Initialize the daemon

blzd init [moniker] [flags]

where moniker is a human readable name for the current node, an appropriate flag would be a string for --chain-id, for example
where moniker is a human readable name for the current node, an appropriate
flag would be a string for --chain-id, for example

blzd init curium00 --chain-id bluzelle 2>&1 | jq .node_id

Use the jq command to parse the node_id from the json output. Note the “2>&1” argument, blzd init, in this case sends its output to stderr, so we need to redirect the output back to stdout.

The JSON output will contain the node_id, note that value so that it can be used to identify this node to other nodes in the zone (in their respective “persistent_peers” value in config.toml).
Use the jq command to parse the node_id from the json output. Note the
“2>&1” argument, blzd init, in this case sends its output to stderr, so we
need to redirect the output back to stdout.

The node_id is used to identify this node to other nodes in the zone (see
the “persistent_peers” value in config.toml).

3. Edit “./blzd/config/config.toml” to add

Expand All @@ -27,34 +32,49 @@ Deploy the Initial Node
after the line

##### advanced configuration options #####
this can be done from the command line with

sed -i -e '/^##### advanced configuration options #####/a \
output = "json"' ~/.blzd/config/config.toml

4. Edit “.blzd/config/genesis.json” to change bond_denom from “stake” to “bnt”. This genesis.json file will be used to initialize the blockchain for this zone. This can be done from the command line with sed
4. Edit “.blzd/config/genesis.json” to change bond_denom from “stake” to
“ubnt”. This genesis.json file will be used to initialize the blockchain
for this zone. This can be done from the command line with sed

sed -i -e 's/"bond_denom": "stake"/"bond_denom": "bnt"/g' \
~/.blzd/config/genesis.json

5. Edit .blzd/config/app.toml in a text editor and set the minimum-gas-prices to “0.01bnt”. Every node should have at least this minimum. This can also be done from the command line with sed:
5. Edit .blzd/config/app.toml in a text editor and set the minimum-gas-prices
to “10.0ubnt”. Every node should have at least this minimum. This can also
be done from the command line with sed:

sed -i -e 's/minimum-gas-prices = ""/minimum-gas-prices = "0.01bnt"/g' \
~/.blzd/config/app.toml
sed -i -e 's/minimum-gas-prices = ""/minimum-gas-prices = "0.01ubnt"/g' \
~/.blzd/config/app.toml

6. Set the client configuration settings:

blzcli config chain-id bluzelle
blzcli config output json
blzcli config indent true
blzcli config trust-node true
where “bluzelle” is the zone’s chain-id.

7. Derive a new key that will label the validator account for this node, call it “vuser”:
7. Derive a new key that will label the validator account for this node, call
it “vuser”:

blzcli keys add vuser
which will produce the output

Enter a passphrase to encrypt your key to disk:
Repeat the passphrase:

- name: vuser
type: local
address: bluzelle1akcrplttpq2qvp90g8l7ttgj25q00rvj0e9d6k
pubkey: bluzellepub1addwnpepqtzzdysc4mukmzzk7aexmfyjdq305ztgu2dkggytqazvvpxv3xma56r8c4n
address: bluzelle1<...>
pubkey: bluzellepub1<...>
mnemonic: ""
threshold: 0
pubkeys: []
Expand All @@ -63,40 +83,70 @@ Deploy the Initial Node
**Important** write this mnemonic phrase in a safe place.
It is the only way to recover your account if you ever forget your password.

amused silk skull latin symbol together resemble blind march achieve angle rib innocent reflect weapon critic quarter empty crime pride fluid hint finish switch
amused silk <...> switch

Note the address, with the “bluzelle” prefix, and the mnemonic. The mnemonic will be used by the Bluzelle javascript client to send transactions to the node.
Note the address, with the “bluzelle” prefix, and the mnemonic. The
mnemonic will be used by the Bluzelle javascript client to send
transactions to the node.

8. Add the first account to the blockchain using the vuser key as the account identifier
8. Add the first account to the blockchain using the vuser key as the account
identifier

blzd add-genesis-account $(blzcli keys show vuser -a) 10000000000bnt
blzd add-genesis-account $(blzcli keys show vuser -a) 500000000000000ubnt
this command is an alias for “tx staking create-validator”. The amount given for the bnt tokens here will be the total amount of tokens available to the zone.
this command is an alias for “tx staking create-validator”. The amount
given for the bnt tokens here will be the total amount of tokens available
to the zone.

9. As this is the first node in the zone, it needs a transaction that will be the first transaction in the blockchain.
9. As this is the first node in the zone, it needs an initial transaction for
the blockchain.

blzd gentx --name vuser --amount 100000000bnt
blzd gentx --name vuser --amount 10000000000000ubnt
which will produce the output:

Password to sign with 'vuser':
Genesis transaction written to "/home/rich/.blzd/config/gentx/gentx-6ccdb7764f4b6762bca9ce254ee9db49a687cc9c.json"
Genesis transaction written to "/home/rich/.blzd/config/gentx/gentx-<...>.json"

remember to specify the amount of coins to bond using the --amount parameter so that bnt is used as stake, if this is neglected the bonding denomination will be stake. Open the genesis transaction JSON file and note the value for the validator_address, it will have the prefix “bluzellevaloper”, this id will be used to get account info later.

remember to specify the amount of coins to bond using the --amount
parameter so that *ubnt* is used as stake, if this is neglected the bonding
denomination will be stake.

Open the genesis transaction JSON file and note the value for the
validator_address, it will have the prefix “bluzellevaloper”, this id will
be used to get account info later. Alternatively, use jq to extract the
value directly:

less ~/.blzd/config/gentx/gentx-7a3a<...>.json \
| jq .value.msg[0].value.validator_address

Which will produce the output

"bluzellevaloper10g9je9j<...>"

10. Create the genesis file from the first transaction:

blzd collect-gentxs
the output of this command will also contain the validator_address, prefixed with bluzellevaloper. If you have not done so in the previous step, note the validator_address.
the output of this command will also contain the validator_address,
prefixed with bluzellevaloper. If you have not done so in the previous
step, note the validator_address.

This command creates the signed genesis.json (.blzd/config/genesis.json) that will be copied to the rest of the nodes in the zone.
This command creates the signed genesis.json file
".blzd/config/genesis.json)" that will be copied to the rest of the nodes
in the zone.

11. The node can be started with the Bluzelle daemon:

blzd start
12. On a second terminal the http server can be started with the Bluzelle client
12. On a second terminal the http server can be started with the Bluzelle
client

blzcli rest-server

If external access to the rest server is required add the _--laddr_ argument
If external access to the rest server is required add the _--laddr_
argument

blzcli rest-server --laddr tcp://0.0.0.0:1317

Expand Down
Loading

0 comments on commit fd24fcf

Please sign in to comment.