forked from cosmos/cosmos-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e78a232
commit d87dfce
Showing
7 changed files
with
167 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Install | ||
|
||
Cosmos SDK can be installed to | ||
`$GOPATH/src/github.com/cosmos/cosmos-sdk` like a normal Go program: | ||
|
||
``` | ||
go get github.com/cosmos/cosmos-sdk | ||
``` | ||
|
||
If the dependencies have been updated with breaking changes, or if | ||
another branch is required, `dep` is used for dependency management. | ||
Thus, assuming you've already run `go get` or otherwise cloned the repo, | ||
the correct way to install is: | ||
|
||
``` | ||
cd $GOPATH/src/github.com/cosmos/cosmos-sdk | ||
make get_vendor_deps | ||
make install | ||
make install_examples | ||
``` | ||
|
||
This will install `gaiad` and `gaiacli` and four example binaries: | ||
`basecoind`, `basecli`, `democoind`, and `democli`. | ||
|
||
Verify that everything is OK by running: | ||
|
||
``` | ||
gaiad version | ||
``` | ||
|
||
you should see: | ||
|
||
``` | ||
0.17.3-a5a78eb | ||
``` | ||
|
||
then with: | ||
|
||
``` | ||
gaiacli version | ||
``` | ||
you should see the same version (or a later one for both). |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Key Management | ||
|
||
Here we cover many aspects of handling keys within the Cosmos SDK | ||
framework. | ||
|
||
## Pseudo Code | ||
|
||
Generating an address for an ed25519 public key (in pseudo code): | ||
|
||
``` | ||
const TypeDistinguisher = HexToBytes("1624de6220") | ||
// prepend the TypeDistinguisher as Bytes | ||
SerializedBytes = TypeDistinguisher ++ PubKey.asBytes() | ||
Address = ripemd160(SerializedBytes) | ||
``` |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
# Testnet Setup | ||
|
||
**Note:** This document is incomplete and may not be up-to-date with the | ||
state of the code. | ||
|
||
See the [installation guide](../sdk/install.html) for details on | ||
installation. | ||
|
||
Here is a quick example to get you off your feet: | ||
|
||
First, generate a couple of genesis transactions to be incorporated into | ||
the genesis file, this will create two keys with the password | ||
`1234567890`: | ||
|
||
``` | ||
gaiad init gen-tx --name=foo --home=$HOME/.gaiad1 | ||
gaiad init gen-tx --name=bar --home=$HOME/.gaiad2 | ||
gaiacli keys list | ||
``` | ||
|
||
**Note:** If you've already run these tests you may need to overwrite | ||
keys using the `--owk` flag When you list the keys you should see two | ||
addresses, we'll need these later so take note. Now let's actually | ||
create the genesis files for both nodes: | ||
|
||
``` | ||
cp -a ~/.gaiad2/config/gentx/. ~/.gaiad1/config/gentx/ | ||
cp -a ~/.gaiad1/config/gentx/. ~/.gaiad2/config/gentx/ | ||
gaiad init --gen-txs --home=$HOME/.gaiad1 --chain-id=test-chain | ||
gaiad init --gen-txs --home=$HOME/.gaiad2 --chain-id=test-chain | ||
``` | ||
|
||
**Note:** If you've already run these tests you may need to overwrite | ||
genesis using the `-o` flag. What we just did is copy the genesis | ||
transactions between each of the nodes so there is a common genesis | ||
transaction set; then we created both genesis files independently from | ||
each home directory. Importantly both nodes have independently created | ||
their `genesis.json` and `config.toml` files, which should be identical | ||
between nodes. | ||
|
||
Great, now that we've initialized the chains, we can start both nodes in | ||
the background: | ||
|
||
``` | ||
gaiad start --home=$HOME/.gaiad1 &> gaia1.log & | ||
NODE1_PID=$! | ||
gaia start --home=$HOME/.gaiad2 &> gaia2.log & | ||
NODE2_PID=$! | ||
``` | ||
|
||
Note that we save the PID so we can later kill the processes. You can | ||
peak at your logs with `tail gaia1.log`, or follow them for a bit with | ||
`tail -f gaia1.log`. | ||
|
||
Nice. We can also lookup the validator set: | ||
|
||
``` | ||
gaiacli validatorset | ||
``` | ||
|
||
Then, we try to transfer some `steak` to another account: | ||
|
||
``` | ||
gaiacli account <FOO-ADDR> | ||
gaiacli account <BAR-ADDR> | ||
gaiacli send --amount=10steak --to=<BAR-ADDR> --name=foo --chain-id=test-chain | ||
``` | ||
|
||
**Note:** We need to be careful with the `chain-id` and `sequence` | ||
|
||
Check the balance & sequence with: | ||
|
||
``` | ||
gaiacli account <BAR-ADDR> | ||
``` | ||
|
||
To confirm for certain the new validator is active, check tendermint: | ||
|
||
``` | ||
curl localhost:46657/validators | ||
``` | ||
|
||
Finally, to relinquish all your power, unbond some coins. You should see | ||
your VotingPower reduce and your account balance increase. | ||
|
||
``` | ||
gaiacli unbond --chain-id=<chain-id> --name=test | ||
``` | ||
|
||
That's it! | ||
|
||
**Note:** TODO demonstrate edit-candidacy **Note:** TODO demonstrate | ||
delegation **Note:** TODO demonstrate unbond of delegation **Note:** | ||
TODO demonstrate unbond candidate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters