erigon-pulse/turbo
Mark Holt f110102023
Devnet scenarios (#7723)
This is an update to the devnet code which introduces the concept of
configurable scenarios. This replaces the previous hard coded execution
function.

The intention is that now both the network and the operations to run on
the network can be described in a data structure which is configurable
and composable.

The operating model is to create a network and then ask it to run
scenarios:

```go
network.Run(
		runCtx,
		scenarios.Scenario{
			Name: "all",
			Steps: []*scenarios.Step{
				&scenarios.Step{Text: "InitSubscriptions", Args: []any{[]requests.SubMethod{requests.Methods.ETHNewHeads}}},
				&scenarios.Step{Text: "PingErigonRpc"},
				&scenarios.Step{Text: "CheckTxPoolContent", Args: []any{0, 0, 0}},
				&scenarios.Step{Text: "SendTxWithDynamicFee", Args: []any{recipientAddress, services.DevAddress, sendValue}},
				&scenarios.Step{Text: "AwaitBlocks", Args: []any{2 * time.Second}},
			},
		})
```
The steps here refer to step handlers which can be defined as follows:

```go
func init() {
	scenarios.MustRegisterStepHandlers(
		scenarios.StepHandler(GetBalance),
	)
}

func GetBalance(ctx context.Context, addr string, blockNum requests.BlockNumber, checkBal uint64) {
...
```
This commit is an initial implementation of the scenario running - which
is working, but will need to be enhanced to make it more usable &
developable.

The current version of the code is working and has been tested with the
dev network, and bor withoutheimdall. There is a multi miner bor
heimdall configuration but this is yet to be tested.

Note that by default the scenario runner picks nodes at random on the
network to send transactions to. this causes the dev network to run very
slowly as it seems to take a long time to include transactions where the
nonce is incremented across nodes. It seems to take a long time for the
nonce to catch up in the transaction pool processing. This is yet to be
investigated.
2023-06-14 12:35:22 +01:00
..
adapter eip-4844: desszing blobtx: initial commit (#7715) 2023-06-14 11:01:03 +02:00
app remove txsV3 cli flag (#7644) 2023-06-03 15:54:27 +07:00
backup new command "erigon alpha_backup" - an alpha version of command to all Erigon's databases (#7415) 2023-05-01 08:27:34 +07:00
builder blockValue should use gasUsed rather than gasLimit (#6875) 2023-02-14 15:05:27 +00:00
cli remove txsV3 cli flag (#7644) 2023-06-03 15:54:27 +07:00
cmdtest move all packages from "internal" folder - to simplify users live (#5857) 2022-10-25 09:58:25 +07:00
debug Header downloader monitor for diagnostics system (#7590) 2023-05-29 14:18:31 +07:00
engineapi use BlockReader.CanonicalHash method instead of rawdb (#7604) 2023-05-31 13:41:10 +07:00
logging added --log.dir.prefix flag (#7714) 2023-06-12 15:30:05 +01:00
mock reference hash, address, and chain config from lib (#6536) 2023-01-13 18:12:18 +00:00
node Devnet scenarios (#7723) 2023-06-14 12:35:22 +01:00
rlphacks Use go:build lines and remove obsolete +build lines (#4175) 2022-05-17 14:46:53 +07:00
rpchelper ws unfreeze (#7724) 2023-06-14 16:25:05 +07:00
services Store Canonical/NonCanonical/Bad blocks/senders/txs in same tables. Make re-org cheaper (#7648) 2023-06-05 12:36:24 +07:00
shards [interfaces] lower_snake_case field names (#7293) 2023-04-12 10:35:54 +00:00
snapshotsync e3: use deserializeV3 for history (#7691) 2023-06-09 10:53:04 +07:00
stages Move ChainID from CommonTx to DynamicFeeTransaction (#7732) 2023-06-14 11:44:05 +02:00
testlog Introduce logger into etl (#7537) 2023-05-18 21:20:07 +01:00
transactions EIP-4844: add data_gas_used (#7639) 2023-06-02 21:26:19 +01:00
trie [devnet tool] Side-quest logging - replace quiet parameter (#7464) 2023-05-08 17:52:31 +01:00
README.md Rename to Erigon (#2018) 2021-05-26 11:35:39 +01:00

Erigon-API

Erigon-API is a set of tools for building applications containing Erigon node.

Our own binary erigon is built using it.

Modules

  • cli - erigon-cli, methods & helpers to run a CLI app with Erigon node.

  • node - represents an Ethereum node, running devp2p and sync and writing state to the database.

  • stagedsync - staged sync algorithm.

Examples

  • erigon - our binary is using erigon-api with all defaults

  • erigoncustom - a very simple example of adding a custom stage, a custom bucket and a custom command-line parameter

  • erigon-examples - a series of examples for Erigon api