diff --git a/docs/getting-started.rst b/docs/getting-started.rst index fe49e27b5..9c722f0f1 100644 --- a/docs/getting-started.rst +++ b/docs/getting-started.rst @@ -81,9 +81,8 @@ Tendermint node as follows: curl -s localhost:46657/status -The ``-s`` just silences ``curl``. For nicer output, pipe the result -into a tool like `jq `__ or -`jsonpp `__. +The ``-s`` just silences ``curl``. For nicer output, pipe the result into a +tool like `jq `__ or ``json_pp``. Now let's send some transactions to the kvstore. @@ -104,17 +103,23 @@ like: "id": "", "result": { "check_tx": { - "code": 0, - "data": "", - "log": "" + "fee": {} }, "deliver_tx": { - "code": 0, - "data": "", - "log": "" + "tags": [ + { + "key": "YXBwLmNyZWF0b3I=", + "value": "amFl" + }, + { + "key": "YXBwLmtleQ==", + "value": "YWJjZA==" + } + ], + "fee": {} }, - "hash": "2B8EC32BA2579B3B8606E42C06DE2F7AFA2556EF", - "height": 154 + "hash": "9DF66553F98DE3C26E3C3317A3E4CED54F714E39", + "height": 14 } } @@ -134,20 +139,17 @@ The result should look like: "id": "", "result": { "response": { - "code": 0, - "index": 0, - "key": "", - "value": "61626364", - "proof": "", - "height": 0, - "log": "exists" + "log": "exists", + "index": "-1", + "key": "YWJjZA==", + "value": "YWJjZA==" } } } -Note the ``value`` in the result (``61626364``); this is the -hex-encoding of the ASCII of ``abcd``. You can verify this in -a python 2 shell by running ``"61626364".decode('hex')`` or in python 3 shell by running ``import codecs; codecs.decode("61626364", 'hex').decode('ascii')``. Stay +Note the ``value`` in the result (``YWJjZA==``); this is the +base64-encoding of the ASCII of ``abcd``. You can verify this in +a python 2 shell by running ``"61626364".decode('base64')`` or in python 3 shell by running ``import codecs; codecs.decode("61626364", 'base64').decode('ascii')``. Stay tuned for a future release that `makes this output more human-readable `__. Now let's try setting a different key and value: @@ -157,7 +159,7 @@ Now let's try setting a different key and value: curl -s 'localhost:46657/broadcast_tx_commit?tx="name=satoshi"' Now if we query for ``name``, we should get ``satoshi``, or -``7361746F736869`` in hex: +``c2F0b3NoaQ==`` in base64: :: @@ -226,17 +228,15 @@ the number ``1``. If instead, we try to send a ``5``, we get an error: "id": "", "result": { "check_tx": { - "code": 0, - "data": "", - "log": "" + "fee": {} }, "deliver_tx": { - "code": 3, - "data": "", - "log": "Invalid nonce. Expected 1, got 5" + "code": 2, + "log": "Invalid nonce. Expected 1, got 5", + "fee": {} }, "hash": "33B93DFF98749B0D6996A70F64071347060DC19C", - "height": 38 + "height": 34 } } @@ -250,17 +250,13 @@ But if we send a ``1``, it works again: "id": "", "result": { "check_tx": { - "code": 0, - "data": "", - "log": "" + "fee": {} }, "deliver_tx": { - "code": 0, - "data": "", - "log": "" + "fee": {} }, "hash": "F17854A977F6FA7EEA1BD758E296710B86F72F3D", - "height": 87 + "height": 60 } } diff --git a/docs/install.rst b/docs/install.rst index 4ee572604..b2aae6766 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -4,7 +4,7 @@ Install Tendermint From Binary ----------- -To download pre-built binaries, see the `Download page `__. +To download pre-built binaries, see the `Download page `__. From Source ----------- @@ -37,13 +37,13 @@ First, install ``dep``: :: + cd $GOPATH/src/github.com/tendermint/tendermint make get_tools Now we can fetch the correct versions of each dependency by running: :: - cd $GOPATH/src/github.com/tendermint/tendermint make get_vendor_deps make install @@ -96,6 +96,7 @@ If ``go get`` failing bothers you, fetch the code using ``git``: mkdir -p $GOPATH/src/github.com/tendermint git clone https://github.com/tendermint/tendermint $GOPATH/src/github.com/tendermint/tendermint cd $GOPATH/src/github.com/tendermint/tendermint + make get_tools make get_vendor_deps make install diff --git a/docs/using-tendermint.rst b/docs/using-tendermint.rst index 1d8e1aaaa..bc5d73859 100644 --- a/docs/using-tendermint.rst +++ b/docs/using-tendermint.rst @@ -74,20 +74,17 @@ RPC server, for example: curl http://localhost:46657/broadcast_tx_commit?tx=\"abcd\" -For handling responses, we recommend you `install the jsonpp -tool `__ to pretty print the JSON. - We can see the chain's status at the ``/status`` end-point: :: - curl http://localhost:46657/status | jsonpp + curl http://localhost:46657/status | json_pp -and the ``sync_info.latest_app_hash`` in particular: +and the ``latest_app_hash`` in particular: :: - curl http://localhost:46657/status | jsonpp | grep sync_info.latest_app_hash + curl http://localhost:46657/status | json_pp | grep latest_app_hash Visit http://localhost:46657 in your browser to see the list of other endpoints. Some take no arguments (like ``/status``), while others @@ -260,19 +257,19 @@ When ``tendermint init`` is run, both a ``genesis.json`` and :: { - "app_hash": "", - "chain_id": "test-chain-HZw6TB", - "genesis_time": "0001-01-01T00:00:00.000Z", - "validators": [ - { - "power": 10, - "name": "", - "pub_key": [ - 1, - "5770B4DD55B3E08B7F5711C48B516347D8C33F47C30C226315D21AA64E0DFF2E" - ] - } - ] + "validators" : [ + { + "pub_key" : { + "value" : "h3hk+QE8c6QLTySp8TcfzclJw/BG79ziGB/pIA+DfPE=", + "type" : "AC26791624DE60" + }, + "power" : 10, + "name" : "" + } + ], + "app_hash" : "", + "chain_id" : "test-chain-rDlYSN", + "genesis_time" : "0001-01-01T00:00:00Z" } And the ``priv_validator.json``: @@ -280,20 +277,18 @@ And the ``priv_validator.json``: :: { - "address": "4F4D895F882A18E1D1FC608D102601DA8D3570E5", - "last_height": 0, - "last_round": 0, - "last_signature": null, - "last_signbytes": "", - "last_step": 0, - "priv_key": [ - 1, - "F9FA3CD435BDAE54D0BCA8F1BC289D718C23D855C6DB21E8543F5E4F457E62805770B4DD55B3E08B7F5711C48B516347D8C33F47C30C226315D21AA64E0DFF2E" - ], - "pub_key": [ - 1, - "5770B4DD55B3E08B7F5711C48B516347D8C33F47C30C226315D21AA64E0DFF2E" - ] + "last_step" : 0, + "last_round" : 0, + "address" : "B788DEDE4F50AD8BC9462DE76741CCAFF87D51E2", + "pub_key" : { + "value" : "h3hk+QE8c6QLTySp8TcfzclJw/BG79ziGB/pIA+DfPE=", + "type" : "AC26791624DE60" + }, + "last_height" : 0, + "priv_key" : { + "value" : "JPivl82x+LfVkp8i3ztoTjY6c6GJ4pBxQexErOCyhwqHeGT5ATxzpAtPJKnxNx/NyUnD8Ebv3OIYH+kgD4N88Q==", + "type" : "954568A3288910" + } } The ``priv_validator.json`` actually contains a private key, and should @@ -387,20 +382,18 @@ Now we can update our genesis file. For instance, if the new :: { - "address": "AC379688105901436A34A65F185C115B8BB277A1", - "last_height": 0, - "last_round": 0, - "last_signature": null, - "last_signbytes": "", - "last_step": 0, - "priv_key": [ - 1, - "0D2ED337D748ADF79BE28559B9E59EBE1ABBA0BAFE6D65FCB9797985329B950C8F2B5AACAACC9FCE41881349743B0CFDE190DF0177744568D4E82A18F0B7DF94" - ], - "pub_key": [ - 1, - "8F2B5AACAACC9FCE41881349743B0CFDE190DF0177744568D4E82A18F0B7DF94" - ] + "address" : "5AF49D2A2D4F5AD4C7C8C4CC2FB020131E9C4902", + "pub_key" : { + "value" : "l9X9+fjkeBzDfPGbUM7AMIRE6uJN78zN5+lk5OYotek=", + "type" : "AC26791624DE60" + }, + "priv_key" : { + "value" : "EDJY9W6zlAw+su6ITgTKg2nTZcHAH1NMTW5iwlgmNDuX1f35+OR4HMN88ZtQzsAwhETq4k3vzM3n6WTk5ii16Q==", + "type" : "954568A3288910" + }, + "last_step" : 0, + "last_round" : 0, + "last_height" : 0 } then the new ``genesis.json`` will be: @@ -408,27 +401,27 @@ then the new ``genesis.json`` will be: :: { - "app_hash": "", - "chain_id": "test-chain-HZw6TB", - "genesis_time": "0001-01-01T00:00:00.000Z", - "validators": [ - { - "power": 10, - "name": "", - "pub_key": [ - 1, - "5770B4DD55B3E08B7F5711C48B516347D8C33F47C30C226315D21AA64E0DFF2E" - ] - }, - { - "power": 10, - "name": "", - "pub_key": [ - 1, - "8F2B5AACAACC9FCE41881349743B0CFDE190DF0177744568D4E82A18F0B7DF94" - ] - } - ] + "validators" : [ + { + "pub_key" : { + "value" : "h3hk+QE8c6QLTySp8TcfzclJw/BG79ziGB/pIA+DfPE=", + "type" : "AC26791624DE60" + }, + "power" : 10, + "name" : "" + }, + { + "pub_key" : { + "value" : "l9X9+fjkeBzDfPGbUM7AMIRE6uJN78zN5+lk5OYotek=", + "type" : "AC26791624DE60" + }, + "power" : 10, + "name" : "" + } + ], + "app_hash" : "", + "chain_id" : "test-chain-rDlYSN", + "genesis_time" : "0001-01-01T00:00:00Z" } Update the ``genesis.json`` in ``~/.tendermint/config``. Copy the genesis file