erigon-pulse/cmd/devnet
Mark Holt 415cf86250
refactor to allow switchable consensus and multiple communicating nodes (#7646)
This branch is intended to allow the devnet to be used for testing
multiple consents types beyond the default clique. It is initially being
used to test Bor consensus for polygon.

It also has the following refactoring:

### 1.  Network configuration

The two node arg building functions miningNodeArgs and nonMiningNodeArgs
have been replaced with a configuration struct which is used to
configure:

```go
network := &node.Network{
		DataDir: dataDir,
		Chain:   networkname.DevChainName,
		//Chain:              networkname.BorDevnetChainName,
		Logger:             logger,
		BasePrivateApiAddr: "localhost:9090",
		BaseRPCAddr:        "localhost:8545",
		Nodes: []node.NetworkNode{
			&node.Miner{},
			&node.NonMiner{},
		},
	}
```
and start multiple nodes

```go
network.Start()
```
Network start will create a network of nodes ensuring that all nodes are
configured with non clashing network ports set via command line
arguments on start-up.

### 2. Request Routing

The `RequestRouter` has been updated to take a 'target' rather than
using a static dispatcher which routes to a single node on the network.
Each node in the network has its own request generator so command and
services have more flexibility in request routing and
`ExecuteAllMethods` currently takes the `node.Network` as an argument
and can pick which node (node 0 for the moment) to send requests to.
2023-06-04 20:53:05 +01:00
..
commands refactor to allow switchable consensus and multiple communicating nodes (#7646) 2023-06-04 20:53:05 +01:00
contracts move math big constants to erigon-lib (#6719) 2023-01-27 11:39:34 +07:00
devnetutils refactor to allow switchable consensus and multiple communicating nodes (#7646) 2023-06-04 20:53:05 +01:00
models refactor to allow switchable consensus and multiple communicating nodes (#7646) 2023-06-04 20:53:05 +01:00
node refactor to allow switchable consensus and multiple communicating nodes (#7646) 2023-06-04 20:53:05 +01:00
requests refactor to allow switchable consensus and multiple communicating nodes (#7646) 2023-06-04 20:53:05 +01:00
services refactor to allow switchable consensus and multiple communicating nodes (#7646) 2023-06-04 20:53:05 +01:00
main.go refactor to allow switchable consensus and multiple communicating nodes (#7646) 2023-06-04 20:53:05 +01:00
README.md Devnet Remake (#5532) 2022-09-30 21:04:34 +01:00

Devnet

This is an automated tool run on the devnet that simulates p2p connection between nodes and ultimately tests operations on them. See DEV_CHAIN for a manual version.