mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-26 01:44:16 +00:00
docs: cleanup (#5252)
This commit is contained in:
@@ -7,4 +7,16 @@ parent:
|
||||
|
||||
# Overview
|
||||
|
||||
See the side-bar for details on the various features of Tendermint Core.
|
||||
This section dives into the internals of Tendermint the implementation.
|
||||
|
||||
- [Using Tendermint](./using-tendermint.md)
|
||||
- [Configuration](./configuration.md)
|
||||
- [Running in Production](./running-in-production.md)
|
||||
- [Metrics](./metrics.md)
|
||||
- [Validators](./validators.md)
|
||||
- [Block Structure](./block-structure.md)
|
||||
- [RPC](./rpc.md)
|
||||
- [Fast Sync](./fast-sync.md)
|
||||
- [Mempool](./mempool.md)
|
||||
- [Light Client](./light-client.md)
|
||||
- [Secure P2P](./secure-p2p.md)
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
---
|
||||
order: 8
|
||||
order: 7
|
||||
---
|
||||
|
||||
# Block Structure
|
||||
|
||||
The tendermint consensus engine records all agreements by a
|
||||
The Tendermint consensus engine records all agreements by a
|
||||
supermajority of nodes into a blockchain, which is replicated among all
|
||||
nodes. This blockchain is accessible via various rpc endpoints, mainly
|
||||
nodes. This blockchain is accessible via various RPC endpoints, mainly
|
||||
`/block?height=` to get the full block, as well as
|
||||
`/blockchain?minHeight=_&maxHeight=_` to get a list of headers. But what
|
||||
exactly is stored in these blocks?
|
||||
|
||||
The [specification](https://github.com/tendermint/spec/blob/953523c3cb99fdb8c8f7a2d21e3a99094279e9de/spec/blockchain/blockchain.md) contains a detailed description of each component - that's the best place to get started.
|
||||
The [specification](https://github.com/tendermint/spec/blob/8dd2ed4c6fe12459edeb9b783bdaaaeb590ec15c/spec/core/data_structures.md) contains a detailed description of each component - that's the best place to get started.
|
||||
|
||||
To dig deeper, check out the [types package documentation](https://godoc.org/github.com/tendermint/tendermint/types).
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
order: 6
|
||||
order: 9
|
||||
---
|
||||
|
||||
# Fast Sync
|
||||
@@ -16,11 +16,11 @@ consensus gossip protocol.
|
||||
|
||||
## Using Fast Sync
|
||||
|
||||
To support faster syncing, tendermint offers a `fast-sync` mode, which
|
||||
To support faster syncing, Tendermint offers a `fast-sync` mode, which
|
||||
is enabled by default, and can be toggled in the `config.toml` or via
|
||||
`--fast_sync=false`.
|
||||
|
||||
In this mode, the tendermint daemon will sync hundreds of times faster
|
||||
In this mode, the Tendermint daemon will sync hundreds of times faster
|
||||
than if it used the real-time consensus process. Once caught up, the
|
||||
daemon will switch out of fast sync and into the normal consensus mode.
|
||||
After running for some time, the node is considered `caught up` if it
|
||||
|
||||
+5
-5
@@ -1,5 +1,5 @@
|
||||
---
|
||||
order: 9
|
||||
order: 11
|
||||
---
|
||||
|
||||
# Light Client
|
||||
@@ -33,7 +33,7 @@ proofs](https://github.com/tendermint/spec/blob/953523c3cb99fdb8c8f7a2d21e3a9909
|
||||
|
||||
## Where to obtain trusted height & hash
|
||||
|
||||
<https://pkg.go.dev/github.com/tendermint/tendermint/light?tab=doc#TrustOptions>
|
||||
[Trust Options](https://pkg.go.dev/github.com/tendermint/tendermint/light?tab=doc#TrustOptions)
|
||||
|
||||
One way to obtain semi-trusted hash & height is to query multiple full nodes
|
||||
and compare their hashes:
|
||||
@@ -54,12 +54,12 @@ can be tracked back to a block header by a proof will be verified before
|
||||
passing them back to the caller. Other than that, it will present the same
|
||||
interface as a full Tendermint node.
|
||||
|
||||
You can start the light client proxy server by running `tendermint light <chainID>`,
|
||||
You can start the light client proxy server by running `tendermint light <chainID>`,
|
||||
with a variety of flags to specify the primary node, the witness nodes (which cross-check
|
||||
the information provided by the primary), the hash and height of the trusted header,
|
||||
the information provided by the primary), the hash and height of the trusted header,
|
||||
and more.
|
||||
|
||||
For example:
|
||||
For example:
|
||||
|
||||
```bash
|
||||
$ tendermint light supernova -p tcp://233.123.0.140:26657 \
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
order: 11
|
||||
order: 5
|
||||
---
|
||||
|
||||
# Metrics
|
||||
@@ -18,37 +18,37 @@ Listen address can be changed in the config file (see
|
||||
|
||||
The following metrics are available:
|
||||
|
||||
| **Name** | **Type** | **Since** | **Tags** | **Description** |
|
||||
| -------------------------------------- | --------- | --------- | ------------- | ---------------------------------------------------------------------- |
|
||||
| consensus_height | Gauge | 0.21.0 | | Height of the chain |
|
||||
| consensus_validators | Gauge | 0.21.0 | | Number of validators |
|
||||
| consensus_validators_power | Gauge | 0.21.0 | | Total voting power of all validators |
|
||||
| consensus_validator_power | Gauge | 0.33.0 | | Voting power of the node if in the validator set |
|
||||
| consensus_validator_last_signed_height | Gauge | 0.33.0 | | Last height the node signed a block, if the node is a validator |
|
||||
| consensus_validator_missed_blocks | Gauge | 0.33.0 | | Total amount of blocks missed for the node, if the node is a validator |
|
||||
| consensus_missing_validators | Gauge | 0.21.0 | | Number of validators who did not sign |
|
||||
| consensus_missing_validators_power | Gauge | 0.21.0 | | Total voting power of the missing validators |
|
||||
| consensus_byzantine_validators | Gauge | 0.21.0 | | Number of validators who tried to double sign |
|
||||
| consensus_byzantine_validators_power | Gauge | 0.21.0 | | Total voting power of the byzantine validators |
|
||||
| consensus_block_interval_seconds | Histogram | 0.21.0 | | Time between this and last block (Block.Header.Time) in seconds |
|
||||
| consensus_rounds | Gauge | 0.21.0 | | Number of rounds |
|
||||
| consensus_num_txs | Gauge | 0.21.0 | | Number of transactions |
|
||||
| consensus_total_txs | Gauge | 0.21.0 | | Total number of transactions committed |
|
||||
| consensus_block_parts | counter | 0.25.0 | peer_id | number of blockparts transmitted by peer |
|
||||
| consensus_latest_block_height | gauge | 0.25.0 | | /status sync_info number |
|
||||
| consensus_fast_syncing | gauge | 0.25.0 | | either 0 (not fast syncing) or 1 (syncing) |
|
||||
| consensus_block_size_bytes | Gauge | 0.21.0 | | Block size in bytes |
|
||||
| p2p_peers | Gauge | 0.21.0 | | Number of peers node's connected to |
|
||||
| p2p_peer_receive_bytes_total | counter | 0.25.0 | peer_id, chID | number of bytes per channel received from a given peer |
|
||||
| p2p_peer_send_bytes_total | counter | 0.25.0 | peer_id, chID | number of bytes per channel sent to a given peer |
|
||||
| p2p_peer_pending_send_bytes | gauge | 0.25.0 | peer_id | number of pending bytes to be sent to a given peer |
|
||||
| p2p_num_txs | gauge | 0.25.0 | peer_id | number of transactions submitted by each peer_id |
|
||||
| p2p_pending_send_bytes | gauge | 0.25.0 | peer_id | amount of data pending to be sent to peer |
|
||||
| mempool_size | Gauge | 0.21.0 | | Number of uncommitted transactions |
|
||||
| mempool_tx_size_bytes | histogram | 0.25.0 | | transaction sizes in bytes |
|
||||
| mempool_failed_txs | counter | 0.25.0 | | number of failed transactions |
|
||||
| mempool_recheck_times | counter | 0.25.0 | | number of transactions rechecked in the mempool |
|
||||
| state_block_processing_time | histogram | 0.25.0 | | time between BeginBlock and EndBlock in ms |
|
||||
| **Name** | **Type** | **Tags** | **Description** |
|
||||
| -------------------------------------- | --------- | ------------- | ---------------------------------------------------------------------- |
|
||||
| consensus_height | Gauge | | Height of the chain |
|
||||
| consensus_validators | Gauge | | Number of validators |
|
||||
| consensus_validators_power | Gauge | | Total voting power of all validators |
|
||||
| consensus_validator_power | Gauge | | Voting power of the node if in the validator set |
|
||||
| consensus_validator_last_signed_height | Gauge | | Last height the node signed a block, if the node is a validator |
|
||||
| consensus_validator_missed_blocks | Gauge | | Total amount of blocks missed for the node, if the node is a validator |
|
||||
| consensus_missing_validators | Gauge | | Number of validators who did not sign |
|
||||
| consensus_missing_validators_power | Gauge | | Total voting power of the missing validators |
|
||||
| consensus_byzantine_validators | Gauge | | Number of validators who tried to double sign |
|
||||
| consensus_byzantine_validators_power | Gauge | | Total voting power of the byzantine validators |
|
||||
| consensus_block_interval_seconds | Histogram | | Time between this and last block (Block.Header.Time) in seconds |
|
||||
| consensus_rounds | Gauge | | Number of rounds |
|
||||
| consensus_num_txs | Gauge | | Number of transactions |
|
||||
| consensus_total_txs | Gauge | | Total number of transactions committed |
|
||||
| consensus_block_parts | counter | peer_id | number of blockparts transmitted by peer |
|
||||
| consensus_latest_block_height | gauge | | /status sync_info number |
|
||||
| consensus_fast_syncing | gauge | | either 0 (not fast syncing) or 1 (syncing) |
|
||||
| consensus_block_size_bytes | Gauge | | Block size in bytes |
|
||||
| p2p_peers | Gauge | | Number of peers node's connected to |
|
||||
| p2p_peer_receive_bytes_total | counter | peer_id, chID | number of bytes per channel received from a given peer |
|
||||
| p2p_peer_send_bytes_total | counter | peer_id, chID | number of bytes per channel sent to a given peer |
|
||||
| p2p_peer_pending_send_bytes | gauge | peer_id | number of pending bytes to be sent to a given peer |
|
||||
| p2p_num_txs | gauge | peer_id | number of transactions submitted by each peer_id |
|
||||
| p2p_pending_send_bytes | gauge | peer_id | amount of data pending to be sent to peer |
|
||||
| mempool_size | Gauge | | Number of uncommitted transactions |
|
||||
| mempool_tx_size_bytes | histogram | | transaction sizes in bytes |
|
||||
| mempool_failed_txs | counter | | number of failed transactions |
|
||||
| mempool_recheck_times | counter | | number of transactions rechecked in the mempool |
|
||||
| state_block_processing_time | histogram | | time between BeginBlock and EndBlock in ms |
|
||||
|
||||
## Useful queries
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
order: 4
|
||||
order: 8
|
||||
---
|
||||
|
||||
# RPC
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
order: 5
|
||||
order: 4
|
||||
---
|
||||
|
||||
# Running in production
|
||||
@@ -23,7 +23,7 @@ Tendermint keeps multiple distinct databases in the `$TMROOT/data`:
|
||||
used to temporarily store intermediate results during block processing.
|
||||
- `tx_index.db`: Indexes txs (and their results) by tx hash and by DeliverTx result events.
|
||||
|
||||
By default, Tendermint will only index txs by their hash, not by their DeliverTx
|
||||
By default, Tendermint will only index txs by their hash and height, not by their DeliverTx
|
||||
result events. See [indexing transactions](../app-dev/indexing-transactions.md) for
|
||||
details.
|
||||
|
||||
@@ -85,7 +85,7 @@ For the above reasons, the `mempool.wal` is disabled by default. To enable, set
|
||||
## DOS Exposure and Mitigation
|
||||
|
||||
Validators are supposed to setup [Sentry Node
|
||||
Architecture](https://blog.cosmos.network/tendermint-explained-bringing-bft-based-pos-to-the-public-blockchain-domain-f22e274a0fdb)
|
||||
Architecture](./validators.md)
|
||||
to prevent Denial-of-service attacks. You can read more about it
|
||||
[here](../interviews/tendermint-bft.md).
|
||||
|
||||
|
||||
@@ -179,7 +179,7 @@ curl http://localhost:26657/status | json_pp | grep latest_app_hash
|
||||
|
||||
<!-- markdown-link-check-disable -->
|
||||
|
||||
Visit <http://localhost:26657> in your browser to see the list of other
|
||||
Visit `http://localhost:26657` in your browser to see the list of other
|
||||
endpoints. Some take no arguments (like `/status`), while others specify
|
||||
the argument name and use `_` as a placeholder.
|
||||
|
||||
@@ -196,7 +196,7 @@ taken into account:
|
||||
|
||||
With `GET`:
|
||||
|
||||
To send a UTF8 string byte array, quote the value of the tx pramater:
|
||||
To send a UTF8 string byte array, quote the value of the tx parameter:
|
||||
|
||||
```sh
|
||||
curl 'http://localhost:26657/broadcast_tx_commit?tx="hello"'
|
||||
@@ -204,7 +204,7 @@ curl 'http://localhost:26657/broadcast_tx_commit?tx="hello"'
|
||||
|
||||
which sends a 5 byte transaction: "h e l l o" \[68 65 6c 6c 6f\].
|
||||
|
||||
Note the URL must be wrapped with single quoes, else bash will ignore
|
||||
Note the URL must be wrapped with single quotes, else bash will ignore
|
||||
the double quotes. To avoid the single quotes, escape the double quotes:
|
||||
|
||||
```sh
|
||||
@@ -267,7 +267,7 @@ Some fields from the config file can be overwritten with flags.
|
||||
|
||||
## No Empty Blocks
|
||||
|
||||
While the default behaviour of `tendermint` is still to create blocks
|
||||
While the default behavior of `tendermint` is still to create blocks
|
||||
approximately once per second, it is possible to disable empty blocks or
|
||||
set a block creation interval. In the former case, blocks will be
|
||||
created when there are new transactions or when the AppHash changes.
|
||||
@@ -437,7 +437,7 @@ another address from the address book. On restarts you will always try to
|
||||
connect to these peers regardless of the size of your address book.
|
||||
|
||||
All peers relay peers they know of by default. This is called the peer exchange
|
||||
protocol (PeX). With PeX, peers will be gossipping about known peers and forming
|
||||
protocol (PeX). With PeX, peers will be gossiping about known peers and forming
|
||||
a network, storing peer addresses in the addrbook. Because of this, you don't
|
||||
have to use a seed node if you have a live persistent peer.
|
||||
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
---
|
||||
order: 6
|
||||
---
|
||||
|
||||
# Validators
|
||||
|
||||
Validators are responsible for committing new blocks in the blockchain.
|
||||
|
||||
Reference in New Issue
Block a user