Skip to content

Commit

Permalink
Add Plugins section to node operator journey (#197)
Browse files Browse the repository at this point in the history
* convert plugins file to its own directory index file

* add plugins overview and plugins list

* remove sidebar_class_name metadata for plugins

* add http_plugin description and examples

* add chain and chain_api plugin description and examples

* add db_size_api_plugin description and examples

* add net and net_api plugin description and examples

* add producer and producer_api plugin description and examples

* add resource_monitor_plugin description and examples

* add state_history plugin description and examples

* add test_control and test_control_api plugin description and examples

* minor edits to producer plugin overview and options

* add trace_api plugin description and examples

* add title metadata to all leap plugins

* add plugins index file

* add prometheus plugin description and examples

* add signature_provider plugin description and examples

* add main plugins index file listing all plugin links

* convert plugin options to markdown tables

* remove section dependencies from plugins index

* fix for broken table width
  • Loading branch information
lparisc authored Jul 31, 2023
1 parent 0646f92 commit dfd4d7c
Show file tree
Hide file tree
Showing 18 changed files with 984 additions and 4 deletions.
4 changes: 0 additions & 4 deletions native/07_node-operation/10_getting-started/30_plugins.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
title: chain_api_plugin
---

See [Chain API Reference](https://docs.eosnetwork.com/apis/leap/latest/chain.api/).

## Overview

The `chain_api_plugin` exposes functionality from the [`chain_plugin`](../chain_plugin/index.md) to the RPC API interface managed by the [`http_plugin`](../http_plugin/index.md).

## Usage

```console
# config.ini
plugin = eosio::chain_api_plugin
```
```sh
# command-line
nodeos ... --plugin eosio::chain_api_plugin
```

## Options

None

## Dependencies

* [`chain_plugin`](../chain_plugin/index.md)
* [`http_plugin`](../http_plugin/index.md)

### Load Dependency Examples

```console
# config.ini
plugin = eosio::chain_plugin
[options]
plugin = eosio::http_plugin
[options]
```
```sh
# command-line
nodeos ... --plugin eosio::chain_plugin [operations] [options] \
--plugin eosio::http_plugin [options]
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
---
title: chain_plugin
---

## Overview

The `chain_plugin` is an essential plugin that is necessary for the processing and consolidation of chain data on an EOS node. It implements the core functionality provided by the [Chain API plugin](../chain_api_plugin/index.md).

## Usage

```console
# config.ini
plugin = eosio::chain_plugin
[options]
```
```sh
# command-line
nodeos ... --plugin eosio::chain_plugin [operations] [options]
```

## Operations

These can only be specified from the `nodeos` command-line:

### Command Line Options for `chain_plugin`

Option (=default) | Description
-|-
`--genesis-json arg` | File to read Genesis State from
`--genesis-timestamp arg` | override the initial timestamp in the Genesis State file
`--print-genesis-json` | extract genesis_state from blocks.log as JSON, print to console, and exit
`--extract-genesis-json arg` | extract genesis_state from blocks.log as JSON, write into specified file, and exit
`--print-build-info` | print build environment information to console as JSON and exit
`--extract-build-info arg` | extract build environment information as JSON, write into specified file, and exit
`--force-all-checks` | do not skip any validation checks while replaying blocks (useful for replaying blocks from untrusted source)
`--disable-replay-opts` | disable optimizations that specifically target replay
`--replay-blockchain` | clear chain state database and replay all blocks
`--hard-replay-blockchain` | clear chain state database, recover as many blocks as possible from the block log, and then replay those blocks
`--delete-all-blocks` | clear chain state database and block log
`--truncate-at-block arg (=0)` | stop hard replay / block log recovery at this block number (if set to non-zero number)
`--terminate-at-block arg (=0)` | terminate after reaching this block number (if set to a non-zero number)
`--snapshot arg` | File to read Snapshot State from

## Options

These can be specified from either the `nodeos` command-line or the `config.ini` file:

### Config Options for `chain_plugin`

Option (=default) | Description
-|-
`--blocks-dir arg (="blocks")` | the location of the blocks directory (absolute path or relative to application data dir)
`--blocks-log-stride arg` | split the block log file when the head block number is the multiple of the stride When the stride is reached, the current block log and index will be renamed '^blocks-retained-dir^/blocks-^start num^-^end num^.log/index' and a new current block log and index will be created with the most recent block. All files following this format will be used to construct an extended block log.
`--max-retained-block-files arg` | the maximum number of blocks files to retain so that the blocks in those files can be queried. When the number is reached, the oldest block file would be moved to archive dir or deleted if the archive dir is empty. The retained block log files should not be manipulated by users.
`--blocks-retained-dir arg` | the location of the blocks retained directory (absolute path or relative to blocks dir). If the value is empty, it is set to the value of blocks dir.
`--blocks-archive-dir arg` | the location of the blocks archive directory (absolute path or relative to blocks dir). If the value is empty, blocks files beyond the retained limit will be deleted. All files in the archive directory are completely under user's control, i.e. they won't be accessed by nodeos anymore.
`--state-dir arg (="state")` | the location of the state directory (absolute path or relative to application data dir)
`--protocol-features-dir arg (="protocol_features")` | the location of the protocol_features directory (absolute path or relative to application config dir)
`--checkpoint arg` | Pairs of [BLOCK_NUM,BLOCK_ID] that should be enforced as checkpoints.
`--wasm-runtime runtime (=eos-vm-jit)` | Override default WASM runtime ( "eos-vm-jit", "eos-vm") "eos-vm-jit" : A WebAssembly runtime that compiles WebAssembly code to native x86 code prior to execution. "eos-vm" : A WebAssembly interpreter.
`--profile-account arg` | The name of an account whose code will be profiled
`--abi-serializer-max-time-ms arg (=15)` | Override default maximum ABI serialization time allowed in ms
`--chain-state-db-size-mb arg (=1024)` | Maximum size (in MiB) of the chain state database
`--chain-state-db-guard-size-mb arg (=128)` | Safely shut down node when free space remaining in the chain state database drops below this size (in MiB).
`--signature-cpu-billable-pct arg (=50)` | Percentage of actual signature recovery cpu to bill. Whole number percentages, e.g. 50 for 50%
`--chain-threads arg (=2)` | Number of worker threads in controller thread pool
`--contracts-console` | print contract's output to console
`--deep-mind` | print deeper information about chain operations
`--actor-whitelist arg` | Account added to actor whitelist (may specify multiple times)
`--actor-blacklist arg` | Account added to actor blacklist (may specify multiple times)
`--contract-whitelist arg` | Contract account added to contract whitelist (may specify multiple times)
`--contract-blacklist arg` | Contract account added to contract blacklist (may specify multiple times)
`--action-blacklist arg` | Action (in the form code::action) added to action blacklist (may specify multiple times)
`--key-blacklist arg` | Public key added to blacklist of keys that should not be included in authorities (may specify multiple times)
`--sender-bypass-whiteblacklist arg` | Deferred transactions sent by accounts in this list do not have any of the subjective whitelist/blacklist checks applied to them (may specify multiple times)
`--read-mode arg (=head)` | Database read mode ("head", "irreversible", "speculative"). In "head" mode: database contains state changes up to the head block; transactions received by the node are relayed if valid. In "irreversible" mode: database contains state changes up to the last irreversible block; transactions received via the P2P network are not relayed and transactions cannot be pushed via the chain API. In "speculative" mode: (DEPRECATED: head mode recommended) database contains state changes by transactions in the blockchain up to the head block as well as some transactions not yet included in the blockchain; transactions received by the node are relayed if valid.
`--api-accept-transactions arg (=1)` | Allow API transactions to be evaluated and relayed if valid.
`--validation-mode arg (=full)` | Chain validation mode ("full" or "light"). In "full" mode all incoming blocks will be fully validated. In "light" mode all incoming blocks headers will be fully validated; transactions in those validated blocks will be trusted
`--disable-ram-billing-notify-checks` | Disable the check which subjectively fails a transaction if a contract bills more RAM to another account within the context of a notification handler (i.e. when the receiver is not the code of the action).
`--maximum-variable-signature-length arg (=16384)` | Subjectively limit the maximum length of variable components in a variable legnth signature to this size in bytes
`--trusted-producer arg` | Indicate a producer whose blocks headers signed by it will be fully validated, but transactions in those validated blocks will be trusted.
`--database-map-mode arg (=mapped)` | Database map mode ("mapped", "heap", or "locked"). In "mapped" mode database is memory mapped as a file. In "heap" mode database is preloaded in to swappable memory and will use huge pages if available. In "locked" mode database is preloaded, locked in to memory, and will use huge pages if available.
`--eos-vm-oc-cache-size-mb arg (=1024)` | Maximum size (in MiB) of the EOS VM OC code cache
`--eos-vm-oc-compile-threads arg (=1)` | Number of threads to use for EOS VM OC tier-up
`--eos-vm-oc-enable` | Enable EOS VM OC tier-up runtime
`--enable-account-queries arg (=0)` | enable queries to find accounts by various metadata.
`--max-nonprivileged-inline-action-size arg (=4096)` | maximum allowed size (in bytes) of an inline action for a nonprivileged account
`--transaction-retry-max-storage-size-gb arg` | Maximum size (in GiB) allowed to be allocated for the Transaction Retry feature. Setting above 0 enables this feature.
`--transaction-retry-interval-sec arg (=20)` | How often, in seconds, to resend an incoming transaction to network if not seen in a block.
`--transaction-retry-max-expiration-sec arg (=120)` | Maximum allowed transaction expiration for retry transactions, will retry transactions up to this value.
`--transaction-finality-status-max-storage-size-gb arg` | Maximum size (in GiB) allowed to be allocated for the Transaction Finality Status feature. Setting above 0 enables this feature.
`--transaction-finality-status-success-duration-sec arg (=180)` | Duration (in seconds) a successful transaction's Finality Status will remain available from being first identified.
`--transaction-finality-status-failure-duration-sec arg (=180)` | Duration (in seconds) a failed transaction's Finality Status will remain available from being first identified.
`--integrity-hash-on-start` | Log the state integrity hash on startup
`--integrity-hash-on-stop` | Log the state integrity hash on shutdown
`--block-log-retain-blocks arg` | If set to greater than 0, periodically prune the block log to store only configured number of most recent blocks. If set to 0, no blocks are be written to the block log; block log file is removed after startup.

## Dependencies

None
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
title: db_size_api_plugin
---

See [DB Size API Reference](https://docs.eosnetwork.com/apis/leap/latest/db_size.api/).

## Overview

The `db_size_api_plugin` obtains analytics related to the blockchain. It retrieves at the least the following information:
* free_bytes
* used_bytes
* size
* indices

## Usage

```console
# config.ini
plugin = eosio::db_size_api_plugin
```
```sh
# command-line
nodeos ... --plugin eosio::db_size_api_plugin
```

## Options

None

## Dependencies

* [`chain_plugin`](../chain_plugin/index.md)
* [`http_plugin`](../http_plugin/index.md)

### Load Dependency Examples

```console
# config.ini
plugin = eosio::chain_plugin
[options]
plugin = eosio::http_plugin
[options]
```
```sh
# command-line
nodeos ... --plugin eosio::chain_plugin [operations] [options] \
--plugin eosio::http_plugin [options]
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
title: http_plugin
---

## Overview

The `http_plugin` is essential for enabling the RPC API functionality provided by either a `nodeos` or `keosd` instance. Both `nodeos` and `keosd` support the `http_plugin` as a core plugin.

## Usage

```console
# config.ini
plugin = eosio::http_plugin
[options]
```
```sh
# command-line
nodeos ... --plugin eosio::http_plugin [options]
(or)
keosd ... --plugin eosio::http_plugin [options]
```

## Options

These can be specified from either the command-line or the `config.ini` file:

### Config Options for `http_plugin`

Option (=default) | Description
-|-
`--unix-socket-path arg` | The filename (relative to data-dir) to create a unix socket for HTTP RPC; set blank to disable.
`--http-server-address arg (=127.0.0.1:8888)` | The local IP and port to listen for incoming http connections; set blank to disable.
`--access-control-allow-origin arg` | Specify the Access-Control-Allow-Origin to be returned on each request
`--access-control-allow-headers arg` | Specify the Access-Control-Allow-Headers to be returned on each request
`--access-control-max-age arg` | Specify the Access-Control-Max-Age to be returned on each request.
`--access-control-allow-credentials` | Specify if Access-Control-Allow-Credentials: true should be returned on each request.
`--max-body-size arg (=2097152)` | The maximum body size in bytes allowed for incoming RPC requests
`--http-max-bytes-in-flight-mb arg (=500)` | Maximum size in megabytes http_plugin should use for processing http requests. -1 for unlimited. 429 error response when exceeded.
`--http-max-in-flight-requests arg (=-1)` | Maximum number of requests http_plugin should use for processing http requests. 429 error response when exceeded.
`--http-max-response-time-ms arg (=30)` | Maximum time for processing a request, -1 for unlimited
`--verbose-http-errors` | Append the error log to HTTP responses
`--http-validate-host arg (=1)` | If set to false, then any incoming "Host" header is considered valid
`--http-alias arg` | Additionaly acceptable values for the "Host" header of incoming HTTP requests, can be specified multiple times. Includes http/s_server_address by default.
`--http-threads arg (=2)` | Number of worker threads in http thread pool
`--http-keep-alive arg (=1)` | If set to false, do not keep HTTP connections alive, even if client requests.

## Dependencies

None
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: Plugins
---

`nodeos` uses plugins to add incremental functionality to a node. While certain plugins such as `chain_plugin`, `net_plugin`, and `producer_plugin` are essential to the modular operation of `nodeos`, other optional plugins offer additional features that extend the core capabilities of a node.

To learn more about a specific plugin, select it from the left navigation menu.

> ℹ️ `nodeos` plugins provide incremental functionality to the EOS core blockchain. In contrast to runtime plugins, `nodeos` plugins are built and baked into the `nodeos` binary during the compilation process.
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
title: net_api_plugin
---

See [Net API Reference](https://docs.eosnetwork.com/apis/leap/latest/net.api/).

## Overview

The `net_api_plugin` exposes functionality from the [`net_plugin`](../net_plugin/index.md) to the RPC API interface managed by the [`http_plugin`](../http_plugin/index.md). The `net_api_plugin` allows node operators to manage the peer-to-peer (p2p) connections of an active node.

The `net_api_plugin` provides four RPC API endpoints:
* connect
* disconnect
* connections
* status

> ⚠️ This plugin exposes endpoints that allow management of p2p connections. Running this plugin on a publicly accessible node is not recommended as it can be exploited.
## Usage

```console
# config.ini
plugin = eosio::net_api_plugin
```
```sh
# command-line
nodeos ... --plugin eosio::net_api_plugin
```

## Options

None

## Dependencies

* [`net_plugin`](../net_plugin/index.md)
* [`http_plugin`](../http_plugin/index.md)

### Load Dependency Examples

```console
# config.ini
plugin = eosio::net_plugin
[options]
plugin = eosio::http_plugin
[options]
```
```sh
# command-line
nodeos ... --plugin eosio::net_plugin [options] \
--plugin eosio::http_plugin [options]
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
title: net_plugin
---

## Overview

The `net_plugin` offers an authenticated peer-to-peer (p2p) protocol for continuous synchronization of nodes. It also implements the core functionality provided by the [Net API plugin](../net_api_plugin/index.md).

## Usage

```console
# config.ini
plugin = eosio::net_plugin
[options]
```
```sh
# command-line
nodeos ... --plugin eosio::net_plugin [options]
```

## Options

These can be specified from either the command-line or the `config.ini` file:

### Config Options for `net_plugin`

Option (=default) | Description
-|-
`--p2p-listen-endpoint arg (=0.0.0.0:9876)` | The actual host:port used to listen for incoming p2p connections.
`--p2p-server-address arg` | An externally accessible host:port for identifying this node. Defaults to p2p-listen-endpoint.
`--p2p-peer-address arg` | The public endpoint of a peer node to connect to. Use multiple p2p-peer-address options as needed to compose a network. Syntax: host:port[:^trx^\|^blk^] The optional 'trx' and 'blk' indicates to node that only transactions 'trx' or blocks 'blk' should be sent. Examples: p2p.eos.io:9876 p2p.trx.eos.io:9876:trx p2p.blk.eos.io:9876:blk
`--p2p-max-nodes-per-host arg (=1)` | Maximum number of client nodes from any single IP address
`--p2p-accept-transactions arg (=1)` | Allow transactions received over p2p network to be evaluated and relayed if valid.
`--p2p-auto-bp-peer arg` | The account and public p2p endpoint of a block producer node to automatically connect to when the it is in producer schedule proximity . Syntax: account,host:port Example, eosproducer1,p2p.eos.io:9876 eosproducer2,p2p.trx.eos.io:9876:t rx eosproducer3,p2p.blk.eos.io:9876:b lk
`--agent-name arg (=EOS Test Agent)` | The name supplied to identify this node amongst the peers.
`--allowed-connection arg (=any)` | Can be 'any' or 'producers' or 'specified' or 'none'. If 'specified', peer-key must be specified at least once. If only 'producers', peer-key is not required. 'producers' and 'specified' may be combined.
`--peer-key arg` | Optional public key of peer allowed to connect. May be used multiple times.
`--peer-private-key arg` | Tuple of [PublicKey, WIF private key] (may specify multiple times)
`--max-clients arg (=25)` | Maximum number of clients from which connections are accepted, use 0 for no limit
`--connection-cleanup-period arg (=30)` | number of seconds to wait before cleaning up dead connections
`--max-cleanup-time-msec arg (=10)` | max connection cleanup time per cleanup call in milliseconds
`--p2p-dedup-cache-expire-time-sec arg (=10)` | Maximum time to track transaction for duplicate optimization
`--net-threads arg (=4)` | Number of worker threads in net_plugin thread pool
`--sync-fetch-span arg (=100)` | number of blocks to retrieve in a chunk from any individual peer during synchronization
`--use-socket-read-watermark arg (=0)` | Enable experimental socket read watermark optimization
`--peer-log-format arg (=["${_name}" - ${_cid} ${_ip}:${_port}] )` | The string used to format peers when logging messages about them. Variables are escaped with ${^variable name^}. Available Variables: _name self-reported name _cid assigned connection id _id self-reported ID (64 hex characters) _sid first 8 characters of _peer.id _ip remote IP address of peer _port remote port number of peer _lip local IP address connected to peer _lport local port number connected to peer
`--p2p-keepalive-interval-ms arg (=10000)` | peer heartbeat keepalive message interval in milliseconds

## Dependencies

None
Loading

0 comments on commit dfd4d7c

Please sign in to comment.