Skip to content

Instantly share code, notes, and snippets.

@rauljordan
Last active April 24, 2020 08:15
Show Gist options
  • Save rauljordan/d3d200197a3ce7370f060e111079ad64 to your computer and use it in GitHub Desktop.
Save rauljordan/d3d200197a3ce7370f060e111079ad64 to your computer and use it in GitHub Desktop.
Prysm Interop Node Setup
http-web3provider: "http://localhost:7777"
web3provider: "ws://localhost:7778"
datadir: /tmp/prysm/chaindata
force-clear-db: true
interop-genesis-state: /tmp/genesis.ssz
interop-eth1data-votes: true
min-sync-peers: 0
http-web3provider: "http://localhost:7777"
web3provider: "ws://localhost:7778"
no-custom-config: true
datadir: /tmp/prysm/chaindata2
force-clear-db: true
interop-genesis-state: /tmp/genesis.ssz
interop-eth1data-votes: true
min-sync-peers: 0
p2p-udp-port: 14232
p2p-tcp-port: 14231
monitoring-port: 8081
rpc-port: 4001
no-custom-config: true
keymanager: interop
keymanageropts: '{"keys":64,"offset":0}'
disable-protect-attester: true
disable-protect-proposer: true
datadir: /tmp/prysm/validator

Prysm Interop Setup

This git outlines how to setup a Prysm chain for local development and testing multiclient interop.

Requirements:

  1. A modern Unix operating system
  2. The latest release (2.1.1 onwards) of Bazel installed
  3. The cmake package installed
  4. The git package installed

Build

git clone git@github.com:prysmaticlabs/prysm.git && cd prysm && git checkout v0.12
bazel build //beacon-chain:beacon-chain
bazel build //validator:validator

Generate a Genesis State

bazel run //tools/genesis-state-gen --define=ssz=mainnet -- \
  --num-validators=64 \
  --output-ssz=/tmp/genesis.ssz \
  --mainnet-config

This defaults to a genesis time of the current unix timestamp. You can pass in a custom unix timestamp using the --genesis-time flag.

Start the Beacon Node

We start a beacon node in interop mode by telling it to load a genesis state from disk, mock eth1 data votes, and provide an empty value for the eth1 provider flags.

bazel run //beacon-chain --define ssz=mainnet -- \
  --config-file=/path/to/node1.config.yaml \
  --bootstrap-node=""

Run a Validator Client

We run a validator in interop mode by specifying --keymanager=interop and 64 keys.

bazel run //validator --define=ssz=mainnet -- \
  --config-file=/path/to/validator.config.yaml

Peering a Second Beacon Node

We would recommend waiting until at least epoch 1 to try this. First navigate to http://localhost:8080/p2p and copy the node's ENR and add it to your env vars:

export NODE_ENR=enr:-LK4QNNTee6XKFrTDjE1ZpXK0-1_E5h4a0t-Bn0IWhd9RAawNqYlGu2sI0kquI4-dmC7_9IOhYFso_zvX8...

Next up, launch a second node with the first being its bootstrap:

bazel run //beacon-chain --define ssz=mainnet -- \
  --config-file=/path/to/node2.config.yaml \
  --bootstrap-node=${NODE_ENR}
@q9f
Copy link

q9f commented Apr 24, 2020

It works when you set min-sync-peers: 1 to 1 instead of 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment