Skip to content

Commit

Permalink
Additional accounts and nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
vsuharnikov committed Dec 13, 2024
1 parent aa46802 commit e51a34e
Show file tree
Hide file tree
Showing 5 changed files with 137 additions and 15 deletions.
31 changes: 22 additions & 9 deletions local-network/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,25 @@

You have to build consensus client. Run [./consensus_client-image-build.sh](./consensus_client-image-build.sh)

## How to add additional nodes

1. Uncomment in [./docker-compose.yml](./docker-compose.yml)
2. Optionally: Enable EL mining for these nodes in [./deploy/local/network.py](./deploy/local/network.py) (see the CL
section).

## How to start

- Run `./all-images-build.sh` after pulling the repository, so docker compose will pull new external images and rebuild
the `deploy` image.
- Available docker compose contexts:
- BlockScout services: `bs`
- Tests in the end `tests`
- Run [./restart.sh](./restart.sh)
- With selected contexts, for example, `COMPOSE_PROFILES=bs,tests ./restart.sh`
- Or without any context: `./restart.sh`
- BlockScout services: `bs`
- Tests in the end `tests`
- Run [./restart.sh](./restart.sh)
- With selected contexts, for example, `COMPOSE_PROFILES=bs,tests ./restart.sh`
- Or without any context: `./restart.sh`

To retry failed:

To retry failed:
- deploy - run `./deploy-run.sh`.
- tests - run `./tests-run.sh`.

Expand All @@ -39,12 +46,18 @@ See [./deploy](./deploy/).
* Node HTTP API Key: `testapi`
* CL accounts: see [genesis-template.conf](configs/wavesnode/genesis-template.conf)
* EL mining reward accounts:
* Reward account for **Miner 1** (`wavesnode-1`, `besu-1`):
* Reward account for **Miner 1** (`wavesnode-1`, `ec-1`):
* Address: `0x7dBcf9c6C3583b76669100f9BE3CaF6d722bc9f9`
* Private key: `16962bb06858ec2e4f252b01391196a5e3699329ff0ce1cc185c213a3844b1cf`
* Reward account for **Miner 2** (`wavesnode-2`, `besu-2`):
* Reward account for **Miner 2** (`wavesnode-2`, `ec-2`):
* Address: `0xcF0b9E13FDd593f4Ca26D36aFCaA44dd3FDCCbeD`
* Private key: `ab49fee4fc326ecbc7abc7f2e5870bf1f86076eb0979c524e20c843f2a73f647`
* Reward account for **Miner 3** (`wavesnode-3`, `ec-3`):
* Address: `0xf1FE6d7bfebead68A8C06cCcee97B61d7DAA0338`
* Private key: `40151189dda26e893252542f1e628f469871f8770bc9cbe3d095419541a01bd0`
* Reward account for **Miner 4** (`wavesnode-4`, `ec-4`):
* Address: `0x10eDdE5dc07eF63E6bb7018758e6fcB5320d8cAa`
* Private key: `716aacab2cb83b57ce399f0d4e625e7a7ab242d3ee1b29858b0866e146be6086`
* To see all information, run `npx tsx common-settings-show.ts` from [./deploy](./deploy/) directory.
* Ethereum addresses and private keys for `besu` nodes in [config](configs/ec-common/genesis.json):
* `fe3b557e8fb62b89f4916b721be55ceb828dbd73`: `8f2a55949038a9610f50fb23b5883af3b4ecb3c3bb792cbcefbd1542c692be63`
Expand Down Expand Up @@ -96,7 +109,7 @@ For example, we will deploy a `HelloWorld`:
3. Press "Clear activity tab data" button.
2. If you want to deploy a contract via Explorer ("Contracts" tab), make sure you've chosen not a nightly version and it
matches [bridge.sol](./deploy/setup/el/bridge.sol).

# Useful links

## Besu configuration
Expand Down
1 change: 0 additions & 1 deletion local-network/configs/ec-common/p2p-key-bootnode.hex

This file was deleted.

18 changes: 18 additions & 0 deletions local-network/configs/wavesnode/genesis-template.conf
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,24 @@ genesis-generator {
# Address: 3FSrRN8X7cDsLyYTScS8Yf8KSwZgJBwf1jU
{ seed-text = "devnet-2", nonce = 0, amount = 800900102030000 }

# Miner on wavesnode-3
# Seed text: devnet-3
# Nonce: 0
# Seed: HnyGuCEnV1C
# Private key: 6xx38JtyDrCBUox2HZ1F6qPZYcFHnfkYQzHRvs3wyRfH
# Public key: 4rfG6p3Ep2dUr4QqWtJwDvy3ySumMejgTE5sdJLzB756
# Address: 3Fkh3dNmLS6NQtVbHcrADegwLo9DviBL5Ro
{ seed-text = "devnet-3", nonce = 0, amount = 700050007000500 }

# Miner on wavesnode-4
# Seed text: devnet-4
# Nonce: 0
# Seed: HnyGuCEnV1D
# Private key: 26mAQWx1hKjDgiJHLpgGJnp8GWp23ueHjqy3vDJtCtTz
# Public key: CxeyqUAbsfCWHhQfrTq7g7t7PengjQpDejG5cd7i4Pqa
# Address: 3FXMRA1tPsn8LApkqVEQJgzsVdMBrnnd8vp
{ seed-text = "devnet-4", nonce = 0, amount = 600100102030000 }

# Additional addresses

# Seed text: devnet rich
Expand Down
18 changes: 18 additions & 0 deletions local-network/deploy/local/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,24 @@ def cl_miners(self) -> List[Miner]:
"0xcf0b9e13fdd593f4ca26d36afcaa44dd3fdccbed"
),
),
# Miner(
# account=pw.Address(
# seed="devnet-3",
# nonce=0,
# ),
# el_reward_address_hex=HexStr(
# "0xf1FE6d7bfebead68A8C06cCcee97B61d7DAA0338"
# ),
# ),
# Miner(
# account=pw.Address(
# seed="devnet-4",
# nonce=0,
# ),
# el_reward_address_hex=HexStr(
# "0x10eDdE5dc07eF63E6bb7018758e6fcB5320d8cAa"
# ),
# ),
]

@cached_property
Expand Down
84 changes: 79 additions & 5 deletions local-network/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,47 @@ services:
container_name: ec-2
hostname: ec-2
extends:
file: ./configs/geth/geth.yml
service: geth
file: ./configs/besu/besu.yml
service: besu
ports:
- "127.0.0.1:28551:8551" # Engine port
- "127.0.0.1:28545:8545" # RPC port
- "127.0.0.1:28551:8551"
- "127.0.0.1:28545:8545"
- "127.0.0.1:28546:8546"
environment:
NODE_NUMBER: 2
volumes:
- ./logs/ec-2:/root/logs
- ./logs/ec-2:/opt/besu/logs

# Make sure, you have enough RAM to run additional nodes
# ec-3:
# container_name: ec-3
# hostname: ec-3
# extends:
# file: ./configs/besu/besu.yml
# service: besu
# environment:
# NODE_NUMBER: 3
# ports:
# - "127.0.0.1:38551:8551"
# - "127.0.0.1:38545:8545"
# - "127.0.0.1:38546:8546"
# volumes:
# - ./logs/ec-3:/opt/besu/logs

# Geth is not recommended for now, because of rollback issue
# ec-4:
# container_name: ec-4
# hostname: ec-4
# extends:
# file: ./configs/geth/geth.yml
# service: geth
# environment:
# NODE_NUMBER: 4
# ports:
# - "127.0.0.1:48551:8551"
# - "127.0.0.1:48545:8545"
# volumes:
# - ./logs/ec-4:/root/logs

wavesnode-1:
container_name: wavesnode-1
Expand Down Expand Up @@ -71,6 +103,48 @@ services:
update-genesis:
condition: service_completed_successfully

# wavesnode-3:
# container_name: wavesnode-3
# hostname: wavesnode-3
# extends:
# file: ./configs/wavesnode/wavesnode.yml
# service: wavesnode
# image: ${WAVES_NODE_IMAGE_3:-${WAVES_NODE_IMAGE:-consensus-client:local}}
# ports:
# - "127.0.0.1:36869:6869"
# environment:
# NODE_NUMBER: 3
# WAVES_WALLET_SEED: HnyGuCEnV1C # devnet-3, addr: 3Fkh3dNmLS6NQtVbHcrADegwLo9DviBL5Ro
# JAVA_OPTS: -Dwaves.miner.enable=no
# volumes:
# - ./logs/wavesnode-3:/var/log/waves
# depends_on:
# ec-3:
# condition: service_healthy
# update-genesis:
# condition: service_completed_successfully

# wavesnode-4:
# container_name: wavesnode-4
# hostname: wavesnode-4
# extends:
# file: ./configs/wavesnode/wavesnode.yml
# service: wavesnode
# image: ${WAVES_NODE_IMAGE_4:-${WAVES_NODE_IMAGE:-consensus-client:local}}
# ports:
# - "127.0.0.1:46869:6869"
# environment:
# NODE_NUMBER: 4
# WAVES_WALLET_SEED: HnyGuCEnV1D # devnet-4, addr: 3FXMRA1tPsn8LApkqVEQJgzsVdMBrnnd8vp
# JAVA_OPTS: -Dwaves.miner.enable=no
# volumes:
# - ./logs/wavesnode-4:/var/log/waves
# depends_on:
# ec-3:
# condition: service_healthy
# update-genesis:
# condition: service_completed_successfully

update-genesis:
container_name: update-genesis
image: ${WAVES_NODE_IMAGE:-ghcr.io/wavesplatform/waves:test-gengen}
Expand Down

0 comments on commit e51a34e

Please sign in to comment.