# Merge Devnet With Prysm and Geth with HTTP Auth ## Setups **Geth** https://github.com/MariusVanDerWijden/go-ethereum/tree/merge-kiln-jwt `815a414312db9a922c5a34ac034fb7aa8861f2e7` **Prysm** auth-kiln branch https://github.com/prysmaticlabs/prysm/commit/77de59bf62838796a0f9cb31dd1f5f1ef11c3ed2 Building geth: ``` make geth ``` Building Prysm ``` go build -o /tmp/beacon ./cmd/beacon-chain go build -o /tmp/validator ./cmd/validator go build -o /tmp/gen ./tools/genesis-state-gen ``` ## Required Files **genesis.json** ``` { "config": { "chainId": 1, "homesteadBlock": 0, "eip150Block": 0, "eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000", "eip155Block": 0, "eip158Block": 0, "byzantiumBlock": 0, "constantinopleBlock": 0, "petersburgBlock": 0, "istanbulBlock": 0, "muirGlacierBlock": 0, "berlinBlock": 0, "londonBlock": 0, "clique": { "period": 5, "epoch": 30000 }, "terminalTotalDifficulty": 10 }, "nonce": "0x42", "timestamp": "0x0", "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x1C9C380", "difficulty": "0x0", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "coinbase": "0x0000000000000000000000000000000000000000", "alloc": { "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b": { "balance": "0x6d6172697573766477000000" } }, "number": "0x0", "gasUsed": "0x0", "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "baseFeePerGas": "0x7" } ``` Save it to /tmp/genesis.json **sk.json** ``` 45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8 ``` Save it to /tmp/sk.json **save the auth JWT key** ``` 0x98ea6e4f216f2fb4b69fff9b3a44842c38686ca685f3f55dc48c5d3fb1107be4 ``` Write it as /tmp/jwt **To start Geth:** ``` ./build/bin/geth --http --ws -http.api "engine" --datadir "~/ethereum/taunus" init /tmp/genesis.json ./build/bin/geth --http --ws -http.api "engine" --datadir "~/ethereum/taunus" account import /tmp/sk.json ./build/bin/geth --http --ws -http.api "engine,eth,net" --datadir "~/ethereum/taunus" --allow-insecure-unlock --unlock "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b" --password "" --nodiscover console --override.terminaltotaldifficulty 9 --jwt-secret=0x98ea6e4f216f2fb4b69fff9b3a44842c38686ca685f3f55dc48c5d3fb1107be4 ``` **merge.yml** ``` CONFIG_NAME: "local" ALTAIR_FORK_EPOCH: 1 BELLATRIX_FORK_EPOCH: 2 DEPOSIT_CHAIN_ID: 1 SECONDS_PER_SLOT: 6 SLOTS_PER_EPOCH: 6 TERMINAL_TOTAL_DIFFICULTY: 9 ``` Save it to /tmp/merge.yml **To start Prysm:** Generate a genesis state ``` /tmp/gen --num-validators=256 --output-ssz=/tmp/genesis.ssz --mainnet-config ``` Start beacon node Notes: - `http-web3provider` and `execution-provider` flags should point to geth - `chain-config-file` flag should point to `merge.yml` ``` /tmp/beacon --datadir /tmp/chaindata --force-clear-db --interop-genesis-state /tmp/genesis.ssz --interop-eth1data-votes --min-sync-peers=0 --http-web3provider=http://localhost:8545 --deposit-contract 0x8A04d14125D0FDCDc742F4A05C051De07232EDa4 --bootstrap-node= --chain-config-file=/tmp/merge.yml --execution-provider=http://localhost:8551 --jwt-secret=/tmp/jwt ``` Start validator node ``` /tmp/validator --beacon-rpc-provider localhost:4000 --interop-num-validators=256 --interop-start-index=0 --force-clear-db --chain-config-file=/tmp/merge.yml ``` ## Runtime Once you see the following log on the beacon node (~after 12 slots): ``` [2022-02-15 09:53:39] INFO rpc/validator: Received payload hash=0x0000000000000000000000000000000000000000000000000000000000000000 number=0 parentHash=0x0000000000000000000000000000000000000000000000000000000000000000 txCount=0 ``` Enter `miner.start()` in geth console Once `ttd` is reached, we should see the following logs on the beacon node: ``` [2022-02-15 15:54:39] INFO rpc/validator: Retrieved terminal block hash hash=0x4e7893c0b1b2aadec73e19855a399ce9102b97ce92c9c37d5ec9b3678294aaea number=[5] parentTd=[8] td=[10] ttd=+9 [2022-02-15 15:54:39] INFO rpc/validator: Successfully called forkchoiceUpdated with attribute hash:=0x4e7893c0b1b2aadec73e19855a399ce9102b97ce92c9c37d5ec9b3678294aaea status:=VALID [2022-02-15 15:54:39] INFO rpc/validator: Received payload ID hash=0x4e7893c0b1b2aadec73e19855a399ce9102b97ce92c9c37d5ec9b3678294aaea id=0xc0052e2a68 slot=17 [2022-02-15 15:54:39] INFO rpc/validator: Received payload hash=0xad6cd74803d6b5996f06ae57849aefbedfcb4acdbecfbd940a4cb60f1ef9ceca number=6 parentHash=0x4e7893c0b1b2aadec73e19855a399ce9102b97ce92c9c37d5ec9b3678294aaea txCount=0 [2022-02-15 15:54:39] INFO blockchain: Successfully called newPayload hash:=0xad6cd74803d6b5996f06ae57849aefbedfcb4acdbecfbd940a4cb60f1ef9ceca parentHash=0x4e7893c0b1b2aadec73e19855a399ce9102b97ce92c9c37d5ec9b36 ```