Skip to content

Commit

Permalink
docs: gaia pr comments
Browse files Browse the repository at this point in the history
  • Loading branch information
zramsay committed Dec 11, 2017
1 parent 8915629 commit 2d5ea64
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 34 deletions.
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Staking Module

staking/intro.rst
staking/local-testnet.rst
staking/atlas-testnet.rst
staking/public-testnet.rst

Extras
------
Expand Down
4 changes: 3 additions & 1 deletion docs/sdk/key-management.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ Key Management
==============

Here we explain a bit how to work with your keys, using the
``basecli keys`` subcommand.
``basecli keys`` subcommand. Note that because ``basecli`` is
an implementation of the Cosmmos SDK, other implementations, such
as ``gaia`` will have a compatible set of tooling.

**Note:** This keys tooling is not considered production ready and is
for dev only.
Expand Down
60 changes: 47 additions & 13 deletions docs/staking/intro.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
Using Gaia
==========

The purpose of the ``gaia`` staking module is to provide users with the ability to 1) declare candidacy as a validator, 2) bond/unbond to a candidate.
This project is a demonstration of the Cosmos Hub with staking functionality; it is
designed to get validator acquianted with staking concepts and procedure.

For the time being, the ``gaia`` tooling is installed seperately from the Cosmos-SDK:
Potential validators will be declaring their candidacy, after which users can
delegate and, if they so wish, unbond. This can be practiced using a local or
public testnet.

Setup Testnet
-------------

The first thing you'll want to do is either `create a local testnet <./local-testnet.html>`__ or
join a `public testnet <./public-testnet.html>`__. Either step is required before proceeding
(although you should browse below and make some keys first).

Install
-------

The ``gaia`` tooling is an extension of the Cosmos-SDK; to install:

::

Expand All @@ -12,7 +27,7 @@ For the time being, the ``gaia`` tooling is installed seperately from the Cosmos
make get_vendor_deps
make install

The ``gaia`` tool has three primary commands:
It has three primary commands:

::

Expand All @@ -37,13 +52,6 @@ for sending various transactions and other types of interaction with a running c
The rest of this tutorial will cover several commands from ``gaia client`` and assume
that you've setup or joined a testnet.

Setup Testnet
-------------

The first thing you'll want to do is either `create a local testnet <./local-testnet.html>`__ or
join the `atlas testnet <./atlas-testnet.html>`__. Either step is required before proceeding
(although you should browse below and make some keys first).

Generating Keys
---------------

Expand Down Expand Up @@ -103,7 +111,7 @@ We'll have ``alice`` who is currently quite rich, send some ``fermions`` to ``bo

::

gaia client tx send --amount=992fermion --sequence=1 --name=alice --to=5A35E4CC7B7DC0A5CB49CEA91763213A9AE92AD6
gaia client tx send --amount=1000fermion --sequence=1 --name=alice --to=5A35E4CC7B7DC0A5CB49CEA91763213A9AE92AD6

where the ``--sequence`` flag is to be incremented for each transaction, the ``--name`` flag names the sender, and the ``--to`` flag takes ``bob``'s address. You'll see something like:

Expand Down Expand Up @@ -206,7 +214,7 @@ First let's have ``alice`` send some coins to ``charlie``:

::

gaia client tx send --amount=999fermion --sequence=2 --name=alice --to=48F74F48281C89E5E4BE9092F735EA519768E8EF
gaia client tx send --amount=1000fermion --sequence=2 --name=alice --to=48F74F48281C89E5E4BE9092F735EA519768E8EF

Then ``charlie`` will delegate some fermions to ``bob``:

Expand Down Expand Up @@ -263,16 +271,42 @@ and you'll see output similar to:
}
}

It's also possible the query the delegator's bond like so:

::

gaia client query delegator-bond --delegator-address 48F74F48281C89E5E4BE9092F735EA519768E8EF --pubkey 52D6FCD8C92A97F7CCB01205ADF310A18411EA8FDCC10E65BF2FCDB05AD1689B

with an output similar to:

::

{
"height": 325782,
"data": {
"PubKey": {
"type": "ed25519",
"data": "52D6FCD8C92A97F7CCB01205ADF310A18411EA8FDCC10E65BF2FCDB05AD1689B"
},
"Shares": 20
}
}

where the ``--delegator-address`` is ``charlie``'s address and the ``-pubkey`` is the same as we've been using.


Unbonding
---------

Finally, to relinquish all your power, unbond some coins. You should see
Finally, to relinquish your voting power, unbond some coins. You should see
your VotingPower reduce and your account balance increase.

::

gaia client tx unbond --amount=5fermion --name=charlie --pubkey=<pub_key data>
gaia client query account 48F74F48281C89E5E4BE9092F735EA519768E8EF

See the bond decrease with ``gaia client query delegator-bond`` like above.

That concludes an overview of the ``gaia`` tooling for local testing.
35 changes: 16 additions & 19 deletions docs/staking/public-testnet.rst
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@
Atlas Testnet
=============
Public Testnets
===============

Atlas is a community testnet which can be used to test setting up a
cosmos validator node. In addition to this tutorial you can also
follow `this video <https://www.youtube.com/watch?v=B-shjoqvnnY>`__.
Here we'll cover the basics of joining a public testnet. These testnets
come and go with various names are we release new versions of tendermint
core. This tutorial covers joining the ``gaia-1`` testnet. To join
other testnets, choose different initialization files, described below.

Get Tokens
----------

To work on the Atlas you'll need some tokens to get started. To do
this first generate a new key:

::

gaia client keys new bob
gaia client keys list

This will output a bunch of information. Read it carefully, then enter
your key into `this utility <http://www.cosmosvalidators.com/>`__ with
your key address and it will send you some ``fermion`` testnet tokens.
If you haven't already `created a key <../sdk/key-management.html>`__,
do so now. Copy your key's address and enter it into
`this utility <http://www.cosmosvalidators.com/>`__ which will send you
some ``fermion`` testnet tokens.

Get Files
---------
Expand All @@ -32,12 +26,15 @@ testnet repo:
git clone https://github.com/tendermint/testnets ~/testnets
cd ~/testnets/gaia-1/gaia

NOTE: to join a different testnet, change the ``gaia-1/gaia`` filepath
to another directory with testnet inititalization files *and* an
active testnet.

Start Node
----------

Now we can start a new node in the background; note that it may
take awhile to sync with the existing testnet.
Now we can start a new node:it may take awhile to sync with the
existing testnet.

::

Expand All @@ -52,7 +49,7 @@ Finally, let's initialize the gaia client to interact with the testnet:

::

gaia client init --chain-id=atlas --node=tcp://localhost:46657
gaia client init --chain-id=gaia-1 --node=tcp://localhost:46657

and check our balance:

Expand Down

0 comments on commit 2d5ea64

Please sign in to comment.