2021-05-04 11:54:19 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
# set -Eeuo pipefail
|
2021-09-30 03:00:25 +00:00
|
|
|
|
2021-10-12 11:37:40 +00:00
|
|
|
# https://notes.ethereum.org/_UH57VUPRrC-re3ubtmo2w
|
2021-05-04 11:54:19 +00:00
|
|
|
|
2021-05-20 10:44:13 +00:00
|
|
|
# To increase verbosity: debug.verbosity(4)
|
2021-06-01 12:40:13 +00:00
|
|
|
# MetaMask seed phrase for address with balance is:
|
2021-05-04 11:54:19 +00:00
|
|
|
# lecture manual soon title cloth uncle gesture cereal common fruit tooth crater
|
|
|
|
|
2021-09-30 03:00:25 +00:00
|
|
|
GENESISJSON=$(mktemp)
|
|
|
|
GETHDATADIR=$(mktemp -d)
|
|
|
|
|
|
|
|
echo \{\
|
2021-10-12 11:37:40 +00:00
|
|
|
\"config\": \{\
|
2021-09-30 03:00:25 +00:00
|
|
|
\"chainId\":1,\
|
|
|
|
\"homesteadBlock\":0,\
|
|
|
|
\"eip150Block\":0,\
|
2021-10-12 11:37:40 +00:00
|
|
|
\"eip150Hash\": \"0x0000000000000000000000000000000000000000000000000000000000000000\",\
|
2021-09-30 03:00:25 +00:00
|
|
|
\"eip155Block\":0,\
|
|
|
|
\"eip158Block\":0,\
|
|
|
|
\"byzantiumBlock\":0,\
|
|
|
|
\"constantinopleBlock\":0,\
|
|
|
|
\"petersburgBlock\":0,\
|
|
|
|
\"istanbulBlock\":0,\
|
|
|
|
\"muirGlacierBlock\":0,\
|
|
|
|
\"berlinBlock\":0,\
|
|
|
|
\"londonBlock\":0,\
|
|
|
|
\"clique\": \{\
|
|
|
|
\"period\": 5,\
|
|
|
|
\"epoch\": 30000\
|
|
|
|
\},\
|
2021-10-12 11:37:40 +00:00
|
|
|
\"terminalTotalDifficulty\":10\
|
2021-09-30 03:00:25 +00:00
|
|
|
\},\
|
|
|
|
\"nonce\":\"0x42\",\
|
|
|
|
\"timestamp\":\"0x0\",\
|
|
|
|
\"extraData\":\"0x0000000000000000000000000000000000000000000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\",\
|
2021-10-12 11:37:40 +00:00
|
|
|
\"gasLimit\":\"0x1C9C380\",\
|
|
|
|
\"difficulty\":\"0x0\",\
|
2021-09-30 03:00:25 +00:00
|
|
|
\"mixHash\":\"0x0000000000000000000000000000000000000000000000000000000000000000\",\
|
|
|
|
\"coinbase\":\"0x0000000000000000000000000000000000000000\",\
|
|
|
|
\"alloc\":\{\
|
|
|
|
\"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b\":\{\"balance\":\"0x6d6172697573766477000000\"\} \
|
|
|
|
\},\
|
|
|
|
\"number\":\"0x0\",\
|
|
|
|
\"gasUsed\":\"0x0\",\
|
|
|
|
\"parentHash\":\"0x0000000000000000000000000000000000000000000000000000000000000000\",\
|
|
|
|
\"baseFeePerGas\":\"0x7\"\
|
2021-10-12 11:37:40 +00:00
|
|
|
\} > "${GENESISJSON}"
|
2021-05-04 11:54:19 +00:00
|
|
|
|
2021-10-12 11:37:40 +00:00
|
|
|
# Initialize the genesis
|
|
|
|
~/execution_clients/go-ethereum/build/bin/geth --catalyst --http --ws -http.api "engine" --datadir "${GETHDATADIR}" init "${GENESISJSON}"
|
|
|
|
|
|
|
|
# Import the signing key (press enter twice for empty password)
|
|
|
|
~/execution_clients/go-ethereum/build/bin/geth --catalyst --http --ws -http.api "engine" --datadir "${GETHDATADIR}" account import <(echo 45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8)
|
|
|
|
|
|
|
|
# Start the node (and press enter once to unlock the account)
|
|
|
|
~/execution_clients/go-ethereum/build/bin/geth --catalyst --http --ws -ws.api "eth,net,engine" --datadir "${GETHDATADIR}" --allow-insecure-unlock --unlock "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b" --password "" --nodiscover console
|