Skip to content

Commit

Permalink
docs: rst => md
Browse files Browse the repository at this point in the history
  • Loading branch information
zramsay authored and rigelrozanski committed Jun 5, 2018
1 parent e78a232 commit d87dfce
Show file tree
Hide file tree
Showing 7 changed files with 167 additions and 73 deletions.
14 changes: 10 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,15 @@

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'

from recommonmark.parser import CommonMarkParser

source_parsers = {
'.md': CommonMarkParser,
}

source_suffix = ['.rst', '.md']
#source_suffix = '.rst'

# The master toctree document.
master_doc = 'index'
Expand Down Expand Up @@ -69,7 +75,7 @@
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', 'old']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', '_attic', 'spec']

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
Expand Down
42 changes: 42 additions & 0 deletions docs/guides/sdk/install.md
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).
48 changes: 0 additions & 48 deletions docs/guides/sdk/install.rst

This file was deleted.

17 changes: 17 additions & 0 deletions docs/guides/sdk/key-management.md
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)
```
18 changes: 0 additions & 18 deletions docs/guides/sdk/key-management.rst

This file was deleted.

94 changes: 94 additions & 0 deletions docs/guides/staking/testnet.md
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
7 changes: 4 additions & 3 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ SDK
.. toctree::
:maxdepth: 1

guides/sdk/install.rst
guides/sdk/key-management.rst
guides/sdk/install.md
guides/sdk/key-management.md

.. sdk/overview.rst # needs to be updated
.. old/glossary.rst # not completely up to date but has good content
Expand Down Expand Up @@ -47,7 +48,7 @@ Staking
.. toctree::
:maxdepth: 1

guides/staking/testnet.rst
guides/staking/testnet.md
.. staking/intro.rst
.. staking/key-management.rst
.. staking/local-testnet.rst
Expand Down

0 comments on commit d87dfce

Please sign in to comment.