Testing features for custom loopback isonets
Motivation
In order to test against mainnet entirely locally, outside of dev-mode this PR does the following:
- changes some assumptions for peers with loopback addresses to allow a peer bound on 127.0.0.1 to connect to a peer bound on 127.0.0.2 without sharing loopback address peers with non-local peers
- allows for specifying bootstrap peers with the
BOOTSTRAP_PEERS=127.0.0.2,127.0.0.3environment - allows for specifying custom generated genesis blocks via
snarkos start --genesis ./path/to/block.genesis
This collection of features also empowers end users to create more dynamic isonets for their own internal testing of snarkOS.
To use these changes, simply specify BOOTSTRAP_PEERS=127.0.1.2 before your start command, and specify the loopback address in --node 127.0.1.2:3030 or --bft 127.0.1.2:5000.
Testing plan
- I use these changes to setup my entirely local 4 validator, 4 bootstrap/core client, 4 fringe client network for #3366, but I use snarkops as the configuration coordinator
Related PRs
- Useful for testing https://github.com/AleoNet/snarkOS/pull/3366 and https://github.com/AleoNet/snarkOS/pull/3388 as 127.0.0.1 and 127.0.0.2 can be run on the same machine while still having distinct addresses
committee.json genesis.block.zip genesis.json client.json
Here is a genesis block generated by the aot command from the snarkops project that can be used for a simple 4 validator mainnet
(--network 0) along with the committee's keys and some generated keys for running client nodes.
My topology is as follows (ports omitted in the table)
BOOTSTRAP_PEERS=127.0.2.1:4130,127.0.2.2:4130,127.0.2.3:4130,127.0.2.4:4130
Validators are peered with bootstrap peers, fringe clients rely on bootstrap peers for peering.
| type | ip | validators | peers |
|---|---|---|---|
| validator | 127.0.1.1 | 127.0.1.2,127.0.1.3,127.0.1.4 | 127.0.2.1,127.0.2.2,127.0.2.3,127.0.2.4 |
| validator | 127.0.1.2 | 127.0.1.1,127.0.1.3,127.0.1.4 | 127.0.2.1,127.0.2.2,127.0.2.3,127.0.2.4 |
| validator | 127.0.1.3 | 127.0.1.2,127.0.1.1,127.0.1.4 | 127.0.2.1,127.0.2.2,127.0.2.3,127.0.2.4 |
| validator | 127.0.1.4 | 127.0.1.2,127.0.1.3,127.0.1.1 | 127.0.2.1,127.0.2.2,127.0.2.3,127.0.2.4 |
| core/bootstrap client | 127.0.2.1 | 127.0.1.1,127.0.1.2,127.0.1.3,127.0.1.4 | |
| core/bootstrap client | 127.0.2.2 | 127.0.1.1,127.0.1.2,127.0.1.3,127.0.1.4 | |
| core/bootstrap client | 127.0.2.3 | 127.0.1.1,127.0.1.2,127.0.1.3,127.0.1.4 | |
| core/bootstrap client | 127.0.2.4 | 127.0.1.1,127.0.1.2,127.0.1.3,127.0.1.4 | |
| fringe client | 127.0.2.5 | ||
| fringe client | 127.0.2.6 | ||
| fringe client | 127.0.2.7 | ||
| fringe client | 127.0.2.8 |