0g-chain/README.md

130 lines
4.2 KiB
Markdown
Raw Normal View History

2018-08-20 20:36:35 +00:00
<h1>
<img alt="Kava Blockchain" src="./kava-logo.svg" width="200">
</h1>
2018-05-25 13:46:33 +00:00
2018-08-17 15:32:38 +00:00
A decentralized fast-finality blockchain for interoperable payment channel networks.
Building on the work of Tendermint and Interledger.
2018-05-25 13:46:33 +00:00
2018-08-17 15:32:38 +00:00
Project status: We're currently in a very early public testnet. With future features being implemented.
2018-08-20 21:41:30 +00:00
Try it out - run a full node to sync to the testnet, or set up as a validator.
2018-08-17 15:32:38 +00:00
## Install
2018-08-21 00:19:20 +00:00
<!--### Source-->
2018-08-17 15:32:38 +00:00
2018-08-21 00:19:20 +00:00
Requirements: go installed and set up (version 1.10+).
2018-08-17 15:32:38 +00:00
2018-08-21 20:39:57 +00:00
0. If installing from a new Ubuntu server (16.04 or 18.04), here's how to setup go:
2018-08-21 21:44:51 +00:00
2018-08-21 20:39:57 +00:00
sudo apt update
sudo apt upgrade -y
sudo apt install git gcc make wget -y
wget https://dl.google.com/go/go1.10.3.linux-amd64.tar.gz
sudo tar -xvf go1.10.3.linux-amd64.tar.gz
sudo mv go /usr/local
cat >> ~/.profile <<EOF
export GOROOT=/usr/local/go
export GOPATH=\$HOME/go
export PATH=\$GOPATH/bin:\$GOROOT/bin:\$PATH
EOF
soruce ~/.profile
2018-08-20 21:41:30 +00:00
1. Get the code.
mkdir -p $GOPATH/src/github.com/kava-labs
cd $GOPATH/src/github.com/kava-labs
git clone https://github.com/kava-labs/kava
cd kava
2. Install the dependencies.
mkdir $GOPATH/bin
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
dep ensure
2018-08-17 15:32:38 +00:00
2018-08-20 21:41:30 +00:00
3. Install the code
go install ./cmd/kvd
go install ./cmd/kvcli
2018-08-17 15:32:38 +00:00
2018-08-21 00:19:20 +00:00
<!--### Docker
2018-08-17 15:32:38 +00:00
2018-08-21 00:19:20 +00:00
Requirements: docker installed.
2018-08-17 15:32:38 +00:00
No installation necessary, just prepend commands with `docker run kava/kava`. TODO name necessary to avoid new contianer being created each time?
This will use our docker container `kava/kava` and store all blockchain data and keys within the container. -->
<!-- To store this data outisde the conatiner, attach volumes to the container:
docker run --rm -v $HOME/.kvd:/root/.kvd -v $HOME/.kvcli:/root/.kvcli kava/kava <further commands>
Now blockchain data will be stored in `$HOME/.kvd` and keys in `$HOME/.kvcli`. Also the `--rm` flag removes the contianer after each run.
-->
<!-- ## Send Transactions
You can send transactions on the testnet using our node without yncing a local node.
Requirements
TODO users need to set up keys first?
kvcli <args> --node validator.connector.kava.io:26657 --chain-id kava-test-<current version>
-->
## Run a Full Node
2018-08-20 21:41:30 +00:00
kvd init --name <your-name> --chain-id kava-test-1
2018-08-17 15:32:38 +00:00
2018-08-21 00:19:20 +00:00
This will generate config and keys in `$HOME/.kvd` and `$HOME/.kvcli`. The default password is 'password'.
2018-08-17 15:32:38 +00:00
2018-08-21 00:19:20 +00:00
> Note: Make sure `GOBIN` is set and added to your path if you want to be able to run installed go programs from any folder.
2018-08-20 21:41:30 +00:00
2018-08-17 21:20:41 +00:00
Copy the testnet genesis file (from https://raw.githubusercontent.com/Kava-Labs/kava/master/testnets/kava-test-1/genesis.json) into `$HOME/.kvd/config/`, replacing the existing one.
2018-08-17 15:32:38 +00:00
2018-08-20 21:41:30 +00:00
Add the kava node address, `0dfd43e440e34fc193ddee4ae99547184f3cb5d1@validator.connector.kava.io:26656`, to `seeds` in `$HOME/.kvd/config/config.toml`
2018-08-17 15:32:38 +00:00
Start your full node
kvd start
2018-08-21 00:19:20 +00:00
> Note: It might take a while to fully sync. Check the latest block height [here](http://validator.connector.kava.io:26657/abci_info).
2018-08-17 15:32:38 +00:00
## Run a Validator
2018-08-17 21:40:38 +00:00
Join the [validator chat](https://riot.im/app/#/room/#kava-validators:matrix.org). Follow setup for a full node above.
2018-08-20 21:41:30 +00:00
Get you address with `kvcli keys list`. Should look something like `cosmosaccaddr10jpp289accvkhsvrpz4tlj9zhqdaey2tl9m4rg`.
2018-08-17 15:32:38 +00:00
Ask @rhuairahrighairidh in the chat to give you some coins.
Get your validator pubkey with `kvd tendermint show_validator`
2018-08-21 00:19:20 +00:00
Then, your full running in the background or separate window, run:
2018-08-20 21:41:30 +00:00
2018-08-17 15:32:38 +00:00
kvcli stake create-validator \
2018-08-20 21:41:30 +00:00
--amount 900KVA \
2018-08-17 15:32:38 +00:00
--pubkey <you validator pubkey from above> \
--address-validator <your address from above> \
--moniker "<your name>" \
2018-08-20 21:41:30 +00:00
--chain-id kava-test-1 \
2018-08-17 15:32:38 +00:00
--from <your name>
2018-08-21 00:19:20 +00:00
> Note You'll need to type in the default password "password"
2018-08-17 15:32:38 +00:00
2018-08-21 00:19:20 +00:00
Now your full node should be participating in consensus and validating blocks!
2018-08-17 15:32:38 +00:00
2018-08-20 21:41:30 +00:00
Running a validator requires that you keep validating blocks. If you stop, your stake will be slashed.
2018-08-17 15:32:38 +00:00
In order to stop validating, first remove yourself as validator, then you can stop your node.
kvcli stake unbond begin \
--address-delegator <your address> \
--address-validator <your address> \
2018-08-20 21:41:30 +00:00
--chain-id kava-test-1 \
2018-08-17 15:32:38 +00:00
--shares-percent 1 \
--from <your name>