mirror of
https://github.com/fluencelabs/tendermint
synced 2025-04-29 08:42:14 +00:00
update docs for latest develop (#1448)
* update docs for latest develop * latest_app_hash, not app_hash
This commit is contained in:
parent
ab00bf7c8b
commit
379f9f875b
@ -81,9 +81,8 @@ Tendermint node as follows:
|
|||||||
|
|
||||||
curl -s localhost:46657/status
|
curl -s localhost:46657/status
|
||||||
|
|
||||||
The ``-s`` just silences ``curl``. For nicer output, pipe the result
|
The ``-s`` just silences ``curl``. For nicer output, pipe the result into a
|
||||||
into a tool like `jq <https://stedolan.github.io/jq/>`__ or
|
tool like `jq <https://stedolan.github.io/jq/>`__ or ``json_pp``.
|
||||||
`jsonpp <https://github.com/jmhodges/jsonpp>`__.
|
|
||||||
|
|
||||||
Now let's send some transactions to the kvstore.
|
Now let's send some transactions to the kvstore.
|
||||||
|
|
||||||
@ -104,17 +103,23 @@ like:
|
|||||||
"id": "",
|
"id": "",
|
||||||
"result": {
|
"result": {
|
||||||
"check_tx": {
|
"check_tx": {
|
||||||
"code": 0,
|
"fee": {}
|
||||||
"data": "",
|
|
||||||
"log": ""
|
|
||||||
},
|
},
|
||||||
"deliver_tx": {
|
"deliver_tx": {
|
||||||
"code": 0,
|
"tags": [
|
||||||
"data": "",
|
{
|
||||||
"log": ""
|
"key": "YXBwLmNyZWF0b3I=",
|
||||||
|
"value": "amFl"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "YXBwLmtleQ==",
|
||||||
|
"value": "YWJjZA=="
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"fee": {}
|
||||||
},
|
},
|
||||||
"hash": "2B8EC32BA2579B3B8606E42C06DE2F7AFA2556EF",
|
"hash": "9DF66553F98DE3C26E3C3317A3E4CED54F714E39",
|
||||||
"height": 154
|
"height": 14
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -134,20 +139,17 @@ The result should look like:
|
|||||||
"id": "",
|
"id": "",
|
||||||
"result": {
|
"result": {
|
||||||
"response": {
|
"response": {
|
||||||
"code": 0,
|
"log": "exists",
|
||||||
"index": 0,
|
"index": "-1",
|
||||||
"key": "",
|
"key": "YWJjZA==",
|
||||||
"value": "61626364",
|
"value": "YWJjZA=="
|
||||||
"proof": "",
|
|
||||||
"height": 0,
|
|
||||||
"log": "exists"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Note the ``value`` in the result (``61626364``); this is the
|
Note the ``value`` in the result (``YWJjZA==``); this is the
|
||||||
hex-encoding of the ASCII of ``abcd``. You can verify this in
|
base64-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
|
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 <https://github.com/tendermint/abci/issues/32>`__.
|
tuned for a future release that `makes this output more human-readable <https://github.com/tendermint/abci/issues/32>`__.
|
||||||
|
|
||||||
Now let's try setting a different key and value:
|
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"'
|
curl -s 'localhost:46657/broadcast_tx_commit?tx="name=satoshi"'
|
||||||
|
|
||||||
Now if we query for ``name``, we should get ``satoshi``, or
|
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": "",
|
"id": "",
|
||||||
"result": {
|
"result": {
|
||||||
"check_tx": {
|
"check_tx": {
|
||||||
"code": 0,
|
"fee": {}
|
||||||
"data": "",
|
|
||||||
"log": ""
|
|
||||||
},
|
},
|
||||||
"deliver_tx": {
|
"deliver_tx": {
|
||||||
"code": 3,
|
"code": 2,
|
||||||
"data": "",
|
"log": "Invalid nonce. Expected 1, got 5",
|
||||||
"log": "Invalid nonce. Expected 1, got 5"
|
"fee": {}
|
||||||
},
|
},
|
||||||
"hash": "33B93DFF98749B0D6996A70F64071347060DC19C",
|
"hash": "33B93DFF98749B0D6996A70F64071347060DC19C",
|
||||||
"height": 38
|
"height": 34
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -250,17 +250,13 @@ But if we send a ``1``, it works again:
|
|||||||
"id": "",
|
"id": "",
|
||||||
"result": {
|
"result": {
|
||||||
"check_tx": {
|
"check_tx": {
|
||||||
"code": 0,
|
"fee": {}
|
||||||
"data": "",
|
|
||||||
"log": ""
|
|
||||||
},
|
},
|
||||||
"deliver_tx": {
|
"deliver_tx": {
|
||||||
"code": 0,
|
"fee": {}
|
||||||
"data": "",
|
|
||||||
"log": ""
|
|
||||||
},
|
},
|
||||||
"hash": "F17854A977F6FA7EEA1BD758E296710B86F72F3D",
|
"hash": "F17854A977F6FA7EEA1BD758E296710B86F72F3D",
|
||||||
"height": 87
|
"height": 60
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ Install Tendermint
|
|||||||
From Binary
|
From Binary
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
To download pre-built binaries, see the `Download page <https://tendermint.com/download>`__.
|
To download pre-built binaries, see the `Download page <https://tendermint.com/downloads>`__.
|
||||||
|
|
||||||
From Source
|
From Source
|
||||||
-----------
|
-----------
|
||||||
@ -37,13 +37,13 @@ First, install ``dep``:
|
|||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
|
cd $GOPATH/src/github.com/tendermint/tendermint
|
||||||
make get_tools
|
make get_tools
|
||||||
|
|
||||||
Now we can fetch the correct versions of each dependency by running:
|
Now we can fetch the correct versions of each dependency by running:
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
cd $GOPATH/src/github.com/tendermint/tendermint
|
|
||||||
make get_vendor_deps
|
make get_vendor_deps
|
||||||
make install
|
make install
|
||||||
|
|
||||||
@ -96,6 +96,7 @@ If ``go get`` failing bothers you, fetch the code using ``git``:
|
|||||||
mkdir -p $GOPATH/src/github.com/tendermint
|
mkdir -p $GOPATH/src/github.com/tendermint
|
||||||
git clone https://github.com/tendermint/tendermint $GOPATH/src/github.com/tendermint/tendermint
|
git clone https://github.com/tendermint/tendermint $GOPATH/src/github.com/tendermint/tendermint
|
||||||
cd $GOPATH/src/github.com/tendermint/tendermint
|
cd $GOPATH/src/github.com/tendermint/tendermint
|
||||||
|
make get_tools
|
||||||
make get_vendor_deps
|
make get_vendor_deps
|
||||||
make install
|
make install
|
||||||
|
|
||||||
|
@ -74,20 +74,17 @@ RPC server, for example:
|
|||||||
|
|
||||||
curl http://localhost:46657/broadcast_tx_commit?tx=\"abcd\"
|
curl http://localhost:46657/broadcast_tx_commit?tx=\"abcd\"
|
||||||
|
|
||||||
For handling responses, we recommend you `install the jsonpp
|
|
||||||
tool <http://jmhodges.github.io/jsonpp/>`__ to pretty print the JSON.
|
|
||||||
|
|
||||||
We can see the chain's status at the ``/status`` end-point:
|
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
|
Visit http://localhost:46657 in your browser to see the list of other
|
||||||
endpoints. Some take no arguments (like ``/status``), while others
|
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": "",
|
"validators" : [
|
||||||
"chain_id": "test-chain-HZw6TB",
|
{
|
||||||
"genesis_time": "0001-01-01T00:00:00.000Z",
|
"pub_key" : {
|
||||||
"validators": [
|
"value" : "h3hk+QE8c6QLTySp8TcfzclJw/BG79ziGB/pIA+DfPE=",
|
||||||
{
|
"type" : "AC26791624DE60"
|
||||||
"power": 10,
|
},
|
||||||
"name": "",
|
"power" : 10,
|
||||||
"pub_key": [
|
"name" : ""
|
||||||
1,
|
}
|
||||||
"5770B4DD55B3E08B7F5711C48B516347D8C33F47C30C226315D21AA64E0DFF2E"
|
],
|
||||||
]
|
"app_hash" : "",
|
||||||
}
|
"chain_id" : "test-chain-rDlYSN",
|
||||||
]
|
"genesis_time" : "0001-01-01T00:00:00Z"
|
||||||
}
|
}
|
||||||
|
|
||||||
And the ``priv_validator.json``:
|
And the ``priv_validator.json``:
|
||||||
@ -280,20 +277,18 @@ And the ``priv_validator.json``:
|
|||||||
::
|
::
|
||||||
|
|
||||||
{
|
{
|
||||||
"address": "4F4D895F882A18E1D1FC608D102601DA8D3570E5",
|
"last_step" : 0,
|
||||||
"last_height": 0,
|
"last_round" : 0,
|
||||||
"last_round": 0,
|
"address" : "B788DEDE4F50AD8BC9462DE76741CCAFF87D51E2",
|
||||||
"last_signature": null,
|
"pub_key" : {
|
||||||
"last_signbytes": "",
|
"value" : "h3hk+QE8c6QLTySp8TcfzclJw/BG79ziGB/pIA+DfPE=",
|
||||||
"last_step": 0,
|
"type" : "AC26791624DE60"
|
||||||
"priv_key": [
|
},
|
||||||
1,
|
"last_height" : 0,
|
||||||
"F9FA3CD435BDAE54D0BCA8F1BC289D718C23D855C6DB21E8543F5E4F457E62805770B4DD55B3E08B7F5711C48B516347D8C33F47C30C226315D21AA64E0DFF2E"
|
"priv_key" : {
|
||||||
],
|
"value" : "JPivl82x+LfVkp8i3ztoTjY6c6GJ4pBxQexErOCyhwqHeGT5ATxzpAtPJKnxNx/NyUnD8Ebv3OIYH+kgD4N88Q==",
|
||||||
"pub_key": [
|
"type" : "954568A3288910"
|
||||||
1,
|
}
|
||||||
"5770B4DD55B3E08B7F5711C48B516347D8C33F47C30C226315D21AA64E0DFF2E"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
The ``priv_validator.json`` actually contains a private key, and should
|
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",
|
"address" : "5AF49D2A2D4F5AD4C7C8C4CC2FB020131E9C4902",
|
||||||
"last_height": 0,
|
"pub_key" : {
|
||||||
"last_round": 0,
|
"value" : "l9X9+fjkeBzDfPGbUM7AMIRE6uJN78zN5+lk5OYotek=",
|
||||||
"last_signature": null,
|
"type" : "AC26791624DE60"
|
||||||
"last_signbytes": "",
|
},
|
||||||
"last_step": 0,
|
"priv_key" : {
|
||||||
"priv_key": [
|
"value" : "EDJY9W6zlAw+su6ITgTKg2nTZcHAH1NMTW5iwlgmNDuX1f35+OR4HMN88ZtQzsAwhETq4k3vzM3n6WTk5ii16Q==",
|
||||||
1,
|
"type" : "954568A3288910"
|
||||||
"0D2ED337D748ADF79BE28559B9E59EBE1ABBA0BAFE6D65FCB9797985329B950C8F2B5AACAACC9FCE41881349743B0CFDE190DF0177744568D4E82A18F0B7DF94"
|
},
|
||||||
],
|
"last_step" : 0,
|
||||||
"pub_key": [
|
"last_round" : 0,
|
||||||
1,
|
"last_height" : 0
|
||||||
"8F2B5AACAACC9FCE41881349743B0CFDE190DF0177744568D4E82A18F0B7DF94"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
then the new ``genesis.json`` will be:
|
then the new ``genesis.json`` will be:
|
||||||
@ -408,27 +401,27 @@ then the new ``genesis.json`` will be:
|
|||||||
::
|
::
|
||||||
|
|
||||||
{
|
{
|
||||||
"app_hash": "",
|
"validators" : [
|
||||||
"chain_id": "test-chain-HZw6TB",
|
{
|
||||||
"genesis_time": "0001-01-01T00:00:00.000Z",
|
"pub_key" : {
|
||||||
"validators": [
|
"value" : "h3hk+QE8c6QLTySp8TcfzclJw/BG79ziGB/pIA+DfPE=",
|
||||||
{
|
"type" : "AC26791624DE60"
|
||||||
"power": 10,
|
},
|
||||||
"name": "",
|
"power" : 10,
|
||||||
"pub_key": [
|
"name" : ""
|
||||||
1,
|
},
|
||||||
"5770B4DD55B3E08B7F5711C48B516347D8C33F47C30C226315D21AA64E0DFF2E"
|
{
|
||||||
]
|
"pub_key" : {
|
||||||
},
|
"value" : "l9X9+fjkeBzDfPGbUM7AMIRE6uJN78zN5+lk5OYotek=",
|
||||||
{
|
"type" : "AC26791624DE60"
|
||||||
"power": 10,
|
},
|
||||||
"name": "",
|
"power" : 10,
|
||||||
"pub_key": [
|
"name" : ""
|
||||||
1,
|
}
|
||||||
"8F2B5AACAACC9FCE41881349743B0CFDE190DF0177744568D4E82A18F0B7DF94"
|
],
|
||||||
]
|
"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
|
Update the ``genesis.json`` in ``~/.tendermint/config``. Copy the genesis file
|
||||||
|
Loading…
x
Reference in New Issue
Block a user