From 8617628b9a49f3f391e394f3cfb6213a9df9fa26 Mon Sep 17 00:00:00 2001 From: Mikelle Date: Tue, 30 Jan 2024 16:33:57 +0800 Subject: [PATCH 1/5] updated entrypoint to accept password --- geth-poa/entrypoint.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/geth-poa/entrypoint.sh b/geth-poa/entrypoint.sh index f0543ef1cf1b..9a76cce80d34 100644 --- a/geth-poa/entrypoint.sh +++ b/geth-poa/entrypoint.sh @@ -7,6 +7,7 @@ VERBOSITY=${VERBOSITY:-3} GETH_DATA_DIR=${GETH_DATA_DIR:-/data} GETH_CHAINDATA_DIR="$GETH_DATA_DIR/geth/chaindata" GETH_KEYSTORE_DIR="$GETH_DATA_DIR/keystore" +GETH_PASSWORD=${GETH_PASSWORD:-"pwd"} CHAIN_ID=$(cat "$GENESIS_L1_PATH" | jq -r .config.chainId) RPC_PORT="${RPC_PORT:-8545}" WS_PORT="${WS_PORT:-8546}" @@ -15,7 +16,7 @@ WS_PORT="${WS_PORT:-8546}" if [ ! -d "$GETH_KEYSTORE_DIR" ] && [ "$GETH_NODE_TYPE" = "signer" ]; then echo "$GETH_KEYSTORE_DIR missing, running account import" - echo -n "pwd" > "$GETH_DATA_DIR"/password + echo -n "$GETH_PASSWORD" > "$GETH_DATA_DIR"/password echo -n "$BLOCK_SIGNER_PRIVATE_KEY" | sed 's/0x//' > "$GETH_DATA_DIR"/block-signer-key "$GETH_BIN_PATH" --verbosity="$VERBOSITY" \ --nousb \ From 3443d0ddb598b411fa68969d9c02b44df3850ac3 Mon Sep 17 00:00:00 2001 From: Mikelle Date: Fri, 2 Feb 2024 11:23:35 +0800 Subject: [PATCH 2/5] changed geth password naming --- geth-poa/entrypoint.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/geth-poa/entrypoint.sh b/geth-poa/entrypoint.sh index 9a76cce80d34..39a05416854f 100644 --- a/geth-poa/entrypoint.sh +++ b/geth-poa/entrypoint.sh @@ -7,7 +7,7 @@ VERBOSITY=${VERBOSITY:-3} GETH_DATA_DIR=${GETH_DATA_DIR:-/data} GETH_CHAINDATA_DIR="$GETH_DATA_DIR/geth/chaindata" GETH_KEYSTORE_DIR="$GETH_DATA_DIR/keystore" -GETH_PASSWORD=${GETH_PASSWORD:-"pwd"} +MEV_COMMIT_GETH_PASSWORD=${MEV_COMMIT_GETH_PASSWORD:-"pwd"} CHAIN_ID=$(cat "$GENESIS_L1_PATH" | jq -r .config.chainId) RPC_PORT="${RPC_PORT:-8545}" WS_PORT="${WS_PORT:-8546}" @@ -16,7 +16,7 @@ WS_PORT="${WS_PORT:-8546}" if [ ! -d "$GETH_KEYSTORE_DIR" ] && [ "$GETH_NODE_TYPE" = "signer" ]; then echo "$GETH_KEYSTORE_DIR missing, running account import" - echo -n "$GETH_PASSWORD" > "$GETH_DATA_DIR"/password + echo -n "$MEV_COMMIT_GETH_PASSWORD" > "$GETH_DATA_DIR"/password echo -n "$BLOCK_SIGNER_PRIVATE_KEY" | sed 's/0x//' > "$GETH_DATA_DIR"/block-signer-key "$GETH_BIN_PATH" --verbosity="$VERBOSITY" \ --nousb \ From 8a529991d9c73c6bf4af006f9aeba506a94dafc1 Mon Sep 17 00:00:00 2001 From: Mikelle Date: Sat, 3 Feb 2024 12:03:54 +0800 Subject: [PATCH 3/5] added keystore support --- geth-poa/.env.example | 1 + geth-poa/Makefile | 10 ++- geth-poa/Node1Dockerfile | 28 +++++++ geth-poa/Node2Dockerfile | 28 +++++++ geth-poa/README.md | 5 ++ geth-poa/docker-compose.yml | 83 +++++++++++++++++++ geth-poa/entrypoint.sh | 38 ++++++--- geth-poa/genesis-keystore.json | 76 +++++++++++++++++ ...--28fec3344edff176fe8a72d653e31b3d1347144a | 1 + ...--86965da722fc59b996660116dce470c4776b7776 | 1 + 10 files changed, 255 insertions(+), 16 deletions(-) create mode 100644 geth-poa/Node1Dockerfile create mode 100644 geth-poa/Node2Dockerfile create mode 100644 geth-poa/genesis-keystore.json create mode 100755 geth-poa/node1/keystore/UTC--2024-02-02T09-35-53.044958000Z--28fec3344edff176fe8a72d653e31b3d1347144a create mode 100644 geth-poa/node2/keystore/UTC--2024-02-03T01-06-01.019229000Z--86965da722fc59b996660116dce470c4776b7776 diff --git a/geth-poa/.env.example b/geth-poa/.env.example index 539e30981f01..c2b542d64171 100644 --- a/geth-poa/.env.example +++ b/geth-poa/.env.example @@ -4,3 +4,4 @@ NODE2_PRIVATE_KEY= RELAYER_PRIVATE_KEY= NEXT_PUBLIC_WALLET_CONNECT_ID= DD_KEY= +MEV_COMMIT_GETH_PASSWORD= \ No newline at end of file diff --git a/geth-poa/Makefile b/geth-poa/Makefile index 74dc45dd0030..c5d67c89a600 100644 --- a/geth-poa/Makefile +++ b/geth-poa/Makefile @@ -9,17 +9,21 @@ up-dev: @if [ ! -f .env ]; then echo "Error: .env file not found. Please populate the .env file before running this command."; exit 1; fi DD_KEY=nil docker compose --profile settlement up -d --build +up-dev-keystore: + @if [ ! -f .env ]; then echo "Error: .env file not found. Please populate the .env file before running this command."; exit 1; fi + DD_KEY=nil docker compose --profile settlement-keystore up -d --build + up-dev-local-l1: @if [ ! -f .env ]; then echo "Error: .env file not found. Please populate the .env file before running this command."; exit 1; fi DD_KEY=nil docker compose --profile settlement --profile local_l1 up -d down: - docker compose --profile settlement --profile prod_agents --profile local_l1 down + docker compose --profile settlement --profile settlement-keystore --profile prod_agents --profile local_l1 down clean-dbs: @read -p "WARNING: This command will wipe all persistent disk data relevant to the containers. Press enter to continue or Ctrl+C to cancel." _ - -docker compose --profile settlement --profile local_l1 down --rmi all --volumes - -docker compose --profile settlement --profile local_l1 rm -fv + -docker compose --profile settlement --profile local_l1 --profile settlement-keystore down --rmi all --volumes + -docker compose --profile settlement --profile local_l1 --profile settlement-keystore rm -fv docker image prune -f pull-image: diff --git a/geth-poa/Node1Dockerfile b/geth-poa/Node1Dockerfile new file mode 100644 index 000000000000..019bb9b15193 --- /dev/null +++ b/geth-poa/Node1Dockerfile @@ -0,0 +1,28 @@ +FROM golang:1.21-alpine AS builder + +RUN apk add --no-cache gcc musl-dev linux-headers git make + +COPY ../go.mod /go-ethereum/ +COPY ../go.sum /go-ethereum/ +RUN cd /go-ethereum && go mod download + +ADD .. /go-ethereum +RUN cd /go-ethereum && go run build/ci.go install -static ./cmd/geth + +FROM alpine:latest + +RUN apk add --no-cache jq + +COPY --from=builder /go-ethereum/build/bin/geth /usr/local/bin/ + +COPY geth-poa/genesis-keystore.json /genesis.json + +COPY geth-poa/entrypoint.sh /entrypoint.sh + +COPY geth-poa/node1/keystore /data/keystore + +RUN chmod +x /entrypoint.sh + +EXPOSE 8545 6060 60601 + +ENTRYPOINT ["/entrypoint.sh"] diff --git a/geth-poa/Node2Dockerfile b/geth-poa/Node2Dockerfile new file mode 100644 index 000000000000..9decc42690da --- /dev/null +++ b/geth-poa/Node2Dockerfile @@ -0,0 +1,28 @@ +FROM golang:1.21-alpine AS builder + +RUN apk add --no-cache gcc musl-dev linux-headers git make + +COPY ../go.mod /go-ethereum/ +COPY ../go.sum /go-ethereum/ +RUN cd /go-ethereum && go mod download + +ADD .. /go-ethereum +RUN cd /go-ethereum && go run build/ci.go install -static ./cmd/geth + +FROM alpine:latest + +RUN apk add --no-cache jq + +COPY --from=builder /go-ethereum/build/bin/geth /usr/local/bin/ + +COPY geth-poa/genesis-keystore.json /genesis.json + +COPY geth-poa/entrypoint.sh /entrypoint.sh + +COPY geth-poa/node2/keystore /data/keystore + +RUN chmod +x /entrypoint.sh + +EXPOSE 8545 6060 60601 + +ENTRYPOINT ["/entrypoint.sh"] diff --git a/geth-poa/README.md b/geth-poa/README.md index 1199636bd6ee..46a4bf2f4466 100644 --- a/geth-poa/README.md +++ b/geth-poa/README.md @@ -39,4 +39,9 @@ NODE1_PRIVATE_KEY=0xpk1 NODE2_PRIVATE_KEY=0xpk2 ``` +Or if you will use keystore to store private keys, you will need to submit password in .env file: +``` +MEV_COMMIT_GETH_PASSWORD=primev +``` + To get a standard starter .env file from primev internal development, [click here.](https://www.notion.so/Private-keys-and-env-for-settlement-layer-245a4f3f4fe040a7b72a6be91131d9c2?pvs=4), populate only the `NODE1_PRIVATE_KEY` and `NODE2_PRIVATE_KEY` fields. diff --git a/geth-poa/docker-compose.yml b/geth-poa/docker-compose.yml index 20a169ce1882..68e7448e9a0f 100644 --- a/geth-poa/docker-compose.yml +++ b/geth-poa/docker-compose.yml @@ -21,6 +21,7 @@ services: - geth-data-bootnode:/data profiles: - settlement + - settlement-keystore labels: com.datadoghq.ad.check_names: '["openmetrics"]' com.datadoghq.ad.init_configs: '[{}]' @@ -42,6 +43,47 @@ services: } ] + sl-node1-keystore: + build: + context: .. + dockerfile: geth-poa/Node1Dockerfile + environment: + - GETH_NODE_TYPE=signer + - BOOTNODE_ENDPOINT=enode://34a2a388ad31ca37f127bb9ffe93758ee711c5c2277dff6aff2e359bcf2c9509ea55034196788dbd59ed70861f523c1c03d54f1eabb2b4a5c1c129d966fe1e65@172.29.0.98:30301 + - MEV_COMMIT_GETH_PASSWORD=${MEV_COMMIT_GETH_PASSWORD} + - NET_RESTRICT=172.29.0.0/16 + networks: + primev_net: + ipv4_address: '172.29.0.99' + ports: + - 60602:60601 + volumes: + - geth-data-node1:/data + profiles: + - settlement-keystore + labels: + com.datadoghq.ad.check_names: '["openmetrics"]' + com.datadoghq.ad.init_configs: '[{}]' + com.datadoghq.ad.instances: | + [ + { + "openmetrics_endpoint": "http://%%host%%:6060/debug/metrics/prometheus", + "namespace": "geth-poa", + "metrics": [ + "txpool*", + "trie*", + "system*", + "state*", + "rpc*", + "p2p*", + "eth*", + "chain*", + "clique*" + "vm*" + ] + } + ] + sl-node1: build: context: .. @@ -84,6 +126,47 @@ services: } ] + sl-node2-keystore: + build: + context: .. + dockerfile: geth-poa/Node2Dockerfile + environment: + - GETH_NODE_TYPE=signer + - BOOTNODE_ENDPOINT=enode://34a2a388ad31ca37f127bb9ffe93758ee711c5c2277dff6aff2e359bcf2c9509ea55034196788dbd59ed70861f523c1c03d54f1eabb2b4a5c1c129d966fe1e65@172.29.0.98:30301 + - NET_RESTRICT=172.29.0.0/16 + - MEV_COMMIT_GETH_PASSWORD=${MEV_COMMIT_GETH_PASSWORD} + networks: + primev_net: + ipv4_address: '172.29.0.100' + ports: + - 60603:60601 + volumes: + - geth-data-node2:/data + profiles: + - settlement-keystore + labels: + com.datadoghq.ad.check_names: '["openmetrics"]' + com.datadoghq.ad.init_configs: '[{}]' + com.datadoghq.ad.instances: | + [ + { + "openmetrics_endpoint": "http://%%host%%:6060/debug/metrics/prometheus", + "namespace": "geth-poa", + "metrics": [ + "txpool*", + "trie*", + "system*", + "state*", + "rpc*", + "p2p*", + "eth*", + "chain*", + "clique*" + "vm*" + ] + } + ] + sl-node2: build: context: .. diff --git a/geth-poa/entrypoint.sh b/geth-poa/entrypoint.sh index 39a05416854f..249f973fa640 100644 --- a/geth-poa/entrypoint.sh +++ b/geth-poa/entrypoint.sh @@ -11,21 +11,33 @@ MEV_COMMIT_GETH_PASSWORD=${MEV_COMMIT_GETH_PASSWORD:-"pwd"} CHAIN_ID=$(cat "$GENESIS_L1_PATH" | jq -r .config.chainId) RPC_PORT="${RPC_PORT:-8545}" WS_PORT="${WS_PORT:-8546}" +BLOCK_SIGNER_PRIVATE_KEY=${BLOCK_SIGNER_PRIVATE_KEY:-""} # Generate signer key if needed -if [ ! -d "$GETH_KEYSTORE_DIR" ] && [ "$GETH_NODE_TYPE" = "signer" ]; then - - echo "$GETH_KEYSTORE_DIR missing, running account import" - echo -n "$MEV_COMMIT_GETH_PASSWORD" > "$GETH_DATA_DIR"/password - echo -n "$BLOCK_SIGNER_PRIVATE_KEY" | sed 's/0x//' > "$GETH_DATA_DIR"/block-signer-key - "$GETH_BIN_PATH" --verbosity="$VERBOSITY" \ - --nousb \ - account import \ - --datadir="$GETH_DATA_DIR" \ - --password="$GETH_DATA_DIR"/password \ - "$GETH_DATA_DIR"/block-signer-key -else - echo "$GETH_KEYSTORE_DIR exists." +if [ "$GETH_NODE_TYPE" = "signer" ]; then + if [ ! -f "$GETH_DATA_DIR/password" ]; then + echo -n "$MEV_COMMIT_GETH_PASSWORD" > "$GETH_DATA_DIR"/password + fi + if [ ! -d "$GETH_KEYSTORE_DIR" ]; then + if [ -n "$BLOCK_SIGNER_PRIVATE_KEY" ]; then + echo "$GETH_KEYSTORE_DIR missing, running account import" + echo -n "$BLOCK_SIGNER_PRIVATE_KEY" | sed 's/0x//' > "$GETH_DATA_DIR"/block-signer-key + "$GETH_BIN_PATH" --verbosity="$VERBOSITY" \ + --nousb \ + account import \ + --datadir="$GETH_DATA_DIR" \ + --password="$GETH_DATA_DIR"/password \ + "$GETH_DATA_DIR"/block-signer-key + fi + else + echo "$GETH_KEYSTORE_DIR exists." + if [ -z "$BLOCK_SIGNER_PRIVATE_KEY" ]; then + GETH_ACCOUNT_LIST=$("$GETH_BIN_PATH" --verbosity="$VERBOSITY" account list --datadir "$GETH_DATA_DIR") + BLOCK_SIGNER_ADDRESS_WITHOUT_PREFIX=$(echo "$GETH_ACCOUNT_LIST" | grep -oE '[0-9a-fA-F]{40}$') + BLOCK_SIGNER_ADDRESS="0x$BLOCK_SIGNER_ADDRESS_WITHOUT_PREFIX" + echo "Block signer address with 0x prefix: $BLOCK_SIGNER_ADDRESS" + fi + fi fi # Init geth if needed diff --git a/geth-poa/genesis-keystore.json b/geth-poa/genesis-keystore.json new file mode 100644 index 000000000000..9602983e65e1 --- /dev/null +++ b/geth-poa/genesis-keystore.json @@ -0,0 +1,76 @@ +{ + "config": { + "chainId": 17864, + "homesteadBlock": 0, + "eip150Block": 0, + "eip155Block": 0, + "eip158Block": 0, + "byzantiumBlock": 0, + "constantinopleBlock": 0, + "petersburgBlock": 0, + "istanbulBlock": 0, + "muirGlacierBlock": 0, + "berlinBlock": 0, + "londonBlock": 0, + "arrowGlacierBlock": 0, + "grayGlacierBlock": 0, + "clique": { + "period": 200, + "epoch": 30000 + } + }, + "nonce": "0x0", + "timestamp": "0x6546df6d", + "extraData": "0x000000000000000000000000000000000000000000000000000000000000000028fec3344edff176fe8a72d653e31b3d1347144a86965da722fc59b996660116dce470c4776b77760000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "gasLimit": "0x1c9c380", + "difficulty": "0x1", + "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "coinbase": "0x0000000000000000000000000000000000000000", + "alloc": { + "0xBe3dEF3973584FdcC1326634aF188f0d9772D57D": { + "balance": "10000000000000000000000000000" + }, + "d9cd8E5DE6d55f796D980B818D350C0746C25b97": { + "balance": "10000000000000000000000000000" + }, + "788EBABe5c3dD422Ef92Ca6714A69e2eabcE1Ee4": { + "balance": "10000000000000000000000000000" + }, + "0DCaa27B9E4Db92F820189345792f8eC5Ef148F6": { + "balance": "10000000000000000000000000000" + }, + "f39Fd6e51aad88F6F4ce6aB8827279cffFb92266": { + "balance": "10000000000000000000000000000" + }, + "0x3fab184622dc19b6109349b94811493bf2a45362": { + "balance": "10000000000000000000000000000" + }, + "0xBcA333b67fb805aB18B4Eb7aa5a0B09aB25E5ce2": { + "balance": "10000000000000000000000000000" + }, + "0xB9286CB4782E43A202BfD426AbB72c8cb34f886c": { + "balance": "10000000000000000000000000000" + }, + "0x04F713A0b687c84D4F66aCd1423712Af6F852B78": { + "balance": "10000000000000000000000000000" + }, + "0x82b941824b43F33e417be1E92273A3020a0D760c": { + "balance": "10000000000000000000000000000" + }, + "0x57508f0B0f3426758F1f3D63ad4935a7c9383620": { + "balance": "10000000000000000000000000000" + }, + "28fec3344edff176fe8a72d653e31b3d1347144a": { + "balance": "10000000000000000000000000000" + }, + "86965da722fc59b996660116dce470c4776b7776": { + "balance": "10000000000000000000000000000" + } + }, + "number": "0x0", + "gasUsed": "0x0", + "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "baseFeePerGas": "0x3b9aca00", + "excessBlobGas": null, + "blobGasUsed": null + } diff --git a/geth-poa/node1/keystore/UTC--2024-02-02T09-35-53.044958000Z--28fec3344edff176fe8a72d653e31b3d1347144a b/geth-poa/node1/keystore/UTC--2024-02-02T09-35-53.044958000Z--28fec3344edff176fe8a72d653e31b3d1347144a new file mode 100755 index 000000000000..c59cef979d89 --- /dev/null +++ b/geth-poa/node1/keystore/UTC--2024-02-02T09-35-53.044958000Z--28fec3344edff176fe8a72d653e31b3d1347144a @@ -0,0 +1 @@ +{"address":"28fec3344edff176fe8a72d653e31b3d1347144a","crypto":{"cipher":"aes-128-ctr","ciphertext":"cb45b3225038bf2bbfe3f35ac0108d20316aa2935d764f0f039d3dfe9ed08316","cipherparams":{"iv":"a9637518eb8f19c0e1a79e31b5cebd0d"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"58b25f5a2990a340232466c996198199be86b8ad5cc3a12ba0b4fe33465ed1e9"},"mac":"94d060673f8cd7cce15e5d170e1338fe48f965a5a0633fe0a07efb1bae1fedce"},"id":"fffe9933-517d-47c2-bff3-c02bd3862e5b","version":3} \ No newline at end of file diff --git a/geth-poa/node2/keystore/UTC--2024-02-03T01-06-01.019229000Z--86965da722fc59b996660116dce470c4776b7776 b/geth-poa/node2/keystore/UTC--2024-02-03T01-06-01.019229000Z--86965da722fc59b996660116dce470c4776b7776 new file mode 100644 index 000000000000..7c67ecd0d382 --- /dev/null +++ b/geth-poa/node2/keystore/UTC--2024-02-03T01-06-01.019229000Z--86965da722fc59b996660116dce470c4776b7776 @@ -0,0 +1 @@ +{"address":"86965da722fc59b996660116dce470c4776b7776","crypto":{"cipher":"aes-128-ctr","ciphertext":"e20ea9db481f7ebb220853f8eb2404c847220e7fcf11848bb84fbdaac43768a2","cipherparams":{"iv":"9891d3a718634ba74e13227d344ed5c5"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"7c07409646f176906588ae7d57371919e752510844680ebb5d1dc3cbed574d62"},"mac":"7189c8202b97ca1e305415d08c803bea5c4e8faeef87919503dd861f528654ca"},"id":"a8c78533-ab8e-4eb5-9dc5-575f975dce57","version":3} \ No newline at end of file From 4515b2e3967722fa277b84f0b7af2967824d12db Mon Sep 17 00:00:00 2001 From: Mikelle Date: Sat, 3 Feb 2024 12:38:19 +0800 Subject: [PATCH 4/5] changed naming node -> signer-node --- geth-poa/{Node1Dockerfile => SignerNode1Dockerfile} | 2 +- geth-poa/{Node2Dockerfile => SignerNode2Dockerfile} | 2 +- geth-poa/docker-compose.yml | 4 ++-- ...35-53.044958000Z--28fec3344edff176fe8a72d653e31b3d1347144a | 0 ...06-01.019229000Z--86965da722fc59b996660116dce470c4776b7776 | 0 5 files changed, 4 insertions(+), 4 deletions(-) rename geth-poa/{Node1Dockerfile => SignerNode1Dockerfile} (91%) rename geth-poa/{Node2Dockerfile => SignerNode2Dockerfile} (91%) rename geth-poa/{node1 => signer-node1}/keystore/UTC--2024-02-02T09-35-53.044958000Z--28fec3344edff176fe8a72d653e31b3d1347144a (100%) rename geth-poa/{node2 => signer-node2}/keystore/UTC--2024-02-03T01-06-01.019229000Z--86965da722fc59b996660116dce470c4776b7776 (100%) diff --git a/geth-poa/Node1Dockerfile b/geth-poa/SignerNode1Dockerfile similarity index 91% rename from geth-poa/Node1Dockerfile rename to geth-poa/SignerNode1Dockerfile index 019bb9b15193..1a7d5c92d8a7 100644 --- a/geth-poa/Node1Dockerfile +++ b/geth-poa/SignerNode1Dockerfile @@ -19,7 +19,7 @@ COPY geth-poa/genesis-keystore.json /genesis.json COPY geth-poa/entrypoint.sh /entrypoint.sh -COPY geth-poa/node1/keystore /data/keystore +COPY geth-poa/signer-node1/keystore /data/keystore RUN chmod +x /entrypoint.sh diff --git a/geth-poa/Node2Dockerfile b/geth-poa/SignerNode2Dockerfile similarity index 91% rename from geth-poa/Node2Dockerfile rename to geth-poa/SignerNode2Dockerfile index 9decc42690da..43a07980e932 100644 --- a/geth-poa/Node2Dockerfile +++ b/geth-poa/SignerNode2Dockerfile @@ -19,7 +19,7 @@ COPY geth-poa/genesis-keystore.json /genesis.json COPY geth-poa/entrypoint.sh /entrypoint.sh -COPY geth-poa/node2/keystore /data/keystore +COPY geth-poa/signer-node2/keystore /data/keystore RUN chmod +x /entrypoint.sh diff --git a/geth-poa/docker-compose.yml b/geth-poa/docker-compose.yml index 68e7448e9a0f..530e4d9c7596 100644 --- a/geth-poa/docker-compose.yml +++ b/geth-poa/docker-compose.yml @@ -46,7 +46,7 @@ services: sl-node1-keystore: build: context: .. - dockerfile: geth-poa/Node1Dockerfile + dockerfile: geth-poa/SignerNode1Dockerfile environment: - GETH_NODE_TYPE=signer - BOOTNODE_ENDPOINT=enode://34a2a388ad31ca37f127bb9ffe93758ee711c5c2277dff6aff2e359bcf2c9509ea55034196788dbd59ed70861f523c1c03d54f1eabb2b4a5c1c129d966fe1e65@172.29.0.98:30301 @@ -129,7 +129,7 @@ services: sl-node2-keystore: build: context: .. - dockerfile: geth-poa/Node2Dockerfile + dockerfile: geth-poa/SignerNode2Dockerfile environment: - GETH_NODE_TYPE=signer - BOOTNODE_ENDPOINT=enode://34a2a388ad31ca37f127bb9ffe93758ee711c5c2277dff6aff2e359bcf2c9509ea55034196788dbd59ed70861f523c1c03d54f1eabb2b4a5c1c129d966fe1e65@172.29.0.98:30301 diff --git a/geth-poa/node1/keystore/UTC--2024-02-02T09-35-53.044958000Z--28fec3344edff176fe8a72d653e31b3d1347144a b/geth-poa/signer-node1/keystore/UTC--2024-02-02T09-35-53.044958000Z--28fec3344edff176fe8a72d653e31b3d1347144a similarity index 100% rename from geth-poa/node1/keystore/UTC--2024-02-02T09-35-53.044958000Z--28fec3344edff176fe8a72d653e31b3d1347144a rename to geth-poa/signer-node1/keystore/UTC--2024-02-02T09-35-53.044958000Z--28fec3344edff176fe8a72d653e31b3d1347144a diff --git a/geth-poa/node2/keystore/UTC--2024-02-03T01-06-01.019229000Z--86965da722fc59b996660116dce470c4776b7776 b/geth-poa/signer-node2/keystore/UTC--2024-02-03T01-06-01.019229000Z--86965da722fc59b996660116dce470c4776b7776 similarity index 100% rename from geth-poa/node2/keystore/UTC--2024-02-03T01-06-01.019229000Z--86965da722fc59b996660116dce470c4776b7776 rename to geth-poa/signer-node2/keystore/UTC--2024-02-03T01-06-01.019229000Z--86965da722fc59b996660116dce470c4776b7776 From 1d40b9ffbb218bd2c051dc54ac915f0e3bfbae72 Mon Sep 17 00:00:00 2001 From: Mikelle Date: Sat, 3 Feb 2024 15:25:25 +0800 Subject: [PATCH 5/5] get rid of redundant genesis-keystore --- geth-poa/SignerNode1Dockerfile | 2 +- geth-poa/SignerNode2Dockerfile | 2 +- geth-poa/genesis-keystore.json | 76 ------------------- ...--28fec3344edff176fe8a72d653e31b3d1347144a | 1 - ...--d9cd8e5de6d55f796d980b818d350c0746c25b97 | 1 + ...--86965da722fc59b996660116dce470c4776b7776 | 1 - ...--788ebabe5c3dd422ef92ca6714a69e2eabce1ee4 | 1 + 7 files changed, 4 insertions(+), 80 deletions(-) delete mode 100644 geth-poa/genesis-keystore.json delete mode 100755 geth-poa/signer-node1/keystore/UTC--2024-02-02T09-35-53.044958000Z--28fec3344edff176fe8a72d653e31b3d1347144a create mode 100644 geth-poa/signer-node1/keystore/UTC--2024-02-03T07-18-17.146938000Z--d9cd8e5de6d55f796d980b818d350c0746c25b97 delete mode 100644 geth-poa/signer-node2/keystore/UTC--2024-02-03T01-06-01.019229000Z--86965da722fc59b996660116dce470c4776b7776 create mode 100644 geth-poa/signer-node2/keystore/UTC--2024-02-03T07-19-47.890792000Z--788ebabe5c3dd422ef92ca6714a69e2eabce1ee4 diff --git a/geth-poa/SignerNode1Dockerfile b/geth-poa/SignerNode1Dockerfile index 1a7d5c92d8a7..16890976edc4 100644 --- a/geth-poa/SignerNode1Dockerfile +++ b/geth-poa/SignerNode1Dockerfile @@ -15,7 +15,7 @@ RUN apk add --no-cache jq COPY --from=builder /go-ethereum/build/bin/geth /usr/local/bin/ -COPY geth-poa/genesis-keystore.json /genesis.json +COPY geth-poa/genesis.json /genesis.json COPY geth-poa/entrypoint.sh /entrypoint.sh diff --git a/geth-poa/SignerNode2Dockerfile b/geth-poa/SignerNode2Dockerfile index 43a07980e932..c6099b745ff4 100644 --- a/geth-poa/SignerNode2Dockerfile +++ b/geth-poa/SignerNode2Dockerfile @@ -15,7 +15,7 @@ RUN apk add --no-cache jq COPY --from=builder /go-ethereum/build/bin/geth /usr/local/bin/ -COPY geth-poa/genesis-keystore.json /genesis.json +COPY geth-poa/genesis.json /genesis.json COPY geth-poa/entrypoint.sh /entrypoint.sh diff --git a/geth-poa/genesis-keystore.json b/geth-poa/genesis-keystore.json deleted file mode 100644 index 9602983e65e1..000000000000 --- a/geth-poa/genesis-keystore.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "config": { - "chainId": 17864, - "homesteadBlock": 0, - "eip150Block": 0, - "eip155Block": 0, - "eip158Block": 0, - "byzantiumBlock": 0, - "constantinopleBlock": 0, - "petersburgBlock": 0, - "istanbulBlock": 0, - "muirGlacierBlock": 0, - "berlinBlock": 0, - "londonBlock": 0, - "arrowGlacierBlock": 0, - "grayGlacierBlock": 0, - "clique": { - "period": 200, - "epoch": 30000 - } - }, - "nonce": "0x0", - "timestamp": "0x6546df6d", - "extraData": "0x000000000000000000000000000000000000000000000000000000000000000028fec3344edff176fe8a72d653e31b3d1347144a86965da722fc59b996660116dce470c4776b77760000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "gasLimit": "0x1c9c380", - "difficulty": "0x1", - "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "coinbase": "0x0000000000000000000000000000000000000000", - "alloc": { - "0xBe3dEF3973584FdcC1326634aF188f0d9772D57D": { - "balance": "10000000000000000000000000000" - }, - "d9cd8E5DE6d55f796D980B818D350C0746C25b97": { - "balance": "10000000000000000000000000000" - }, - "788EBABe5c3dD422Ef92Ca6714A69e2eabcE1Ee4": { - "balance": "10000000000000000000000000000" - }, - "0DCaa27B9E4Db92F820189345792f8eC5Ef148F6": { - "balance": "10000000000000000000000000000" - }, - "f39Fd6e51aad88F6F4ce6aB8827279cffFb92266": { - "balance": "10000000000000000000000000000" - }, - "0x3fab184622dc19b6109349b94811493bf2a45362": { - "balance": "10000000000000000000000000000" - }, - "0xBcA333b67fb805aB18B4Eb7aa5a0B09aB25E5ce2": { - "balance": "10000000000000000000000000000" - }, - "0xB9286CB4782E43A202BfD426AbB72c8cb34f886c": { - "balance": "10000000000000000000000000000" - }, - "0x04F713A0b687c84D4F66aCd1423712Af6F852B78": { - "balance": "10000000000000000000000000000" - }, - "0x82b941824b43F33e417be1E92273A3020a0D760c": { - "balance": "10000000000000000000000000000" - }, - "0x57508f0B0f3426758F1f3D63ad4935a7c9383620": { - "balance": "10000000000000000000000000000" - }, - "28fec3344edff176fe8a72d653e31b3d1347144a": { - "balance": "10000000000000000000000000000" - }, - "86965da722fc59b996660116dce470c4776b7776": { - "balance": "10000000000000000000000000000" - } - }, - "number": "0x0", - "gasUsed": "0x0", - "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "baseFeePerGas": "0x3b9aca00", - "excessBlobGas": null, - "blobGasUsed": null - } diff --git a/geth-poa/signer-node1/keystore/UTC--2024-02-02T09-35-53.044958000Z--28fec3344edff176fe8a72d653e31b3d1347144a b/geth-poa/signer-node1/keystore/UTC--2024-02-02T09-35-53.044958000Z--28fec3344edff176fe8a72d653e31b3d1347144a deleted file mode 100755 index c59cef979d89..000000000000 --- a/geth-poa/signer-node1/keystore/UTC--2024-02-02T09-35-53.044958000Z--28fec3344edff176fe8a72d653e31b3d1347144a +++ /dev/null @@ -1 +0,0 @@ -{"address":"28fec3344edff176fe8a72d653e31b3d1347144a","crypto":{"cipher":"aes-128-ctr","ciphertext":"cb45b3225038bf2bbfe3f35ac0108d20316aa2935d764f0f039d3dfe9ed08316","cipherparams":{"iv":"a9637518eb8f19c0e1a79e31b5cebd0d"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"58b25f5a2990a340232466c996198199be86b8ad5cc3a12ba0b4fe33465ed1e9"},"mac":"94d060673f8cd7cce15e5d170e1338fe48f965a5a0633fe0a07efb1bae1fedce"},"id":"fffe9933-517d-47c2-bff3-c02bd3862e5b","version":3} \ No newline at end of file diff --git a/geth-poa/signer-node1/keystore/UTC--2024-02-03T07-18-17.146938000Z--d9cd8e5de6d55f796d980b818d350c0746c25b97 b/geth-poa/signer-node1/keystore/UTC--2024-02-03T07-18-17.146938000Z--d9cd8e5de6d55f796d980b818d350c0746c25b97 new file mode 100644 index 000000000000..4ca7d55a20c6 --- /dev/null +++ b/geth-poa/signer-node1/keystore/UTC--2024-02-03T07-18-17.146938000Z--d9cd8e5de6d55f796d980b818d350c0746c25b97 @@ -0,0 +1 @@ +{"address":"d9cd8e5de6d55f796d980b818d350c0746c25b97","crypto":{"cipher":"aes-128-ctr","ciphertext":"f8f88d0de59efea1eec9acaacf98d4211a499fe6aac0eb61a3e45b7fcd4e751b","cipherparams":{"iv":"0c4e70f29fafde6e8607e9265518b416"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"142f4d4c26efb1804723958ebc10cb10fb183070dc344f69bf604fca524bd853"},"mac":"2434542be8af5d2abac8265f16b4b52fb1d7a2d97e6e956a43b8f899ac752b48"},"id":"67714586-3ee9-461f-82ba-bb58387b7901","version":3} \ No newline at end of file diff --git a/geth-poa/signer-node2/keystore/UTC--2024-02-03T01-06-01.019229000Z--86965da722fc59b996660116dce470c4776b7776 b/geth-poa/signer-node2/keystore/UTC--2024-02-03T01-06-01.019229000Z--86965da722fc59b996660116dce470c4776b7776 deleted file mode 100644 index 7c67ecd0d382..000000000000 --- a/geth-poa/signer-node2/keystore/UTC--2024-02-03T01-06-01.019229000Z--86965da722fc59b996660116dce470c4776b7776 +++ /dev/null @@ -1 +0,0 @@ -{"address":"86965da722fc59b996660116dce470c4776b7776","crypto":{"cipher":"aes-128-ctr","ciphertext":"e20ea9db481f7ebb220853f8eb2404c847220e7fcf11848bb84fbdaac43768a2","cipherparams":{"iv":"9891d3a718634ba74e13227d344ed5c5"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"7c07409646f176906588ae7d57371919e752510844680ebb5d1dc3cbed574d62"},"mac":"7189c8202b97ca1e305415d08c803bea5c4e8faeef87919503dd861f528654ca"},"id":"a8c78533-ab8e-4eb5-9dc5-575f975dce57","version":3} \ No newline at end of file diff --git a/geth-poa/signer-node2/keystore/UTC--2024-02-03T07-19-47.890792000Z--788ebabe5c3dd422ef92ca6714a69e2eabce1ee4 b/geth-poa/signer-node2/keystore/UTC--2024-02-03T07-19-47.890792000Z--788ebabe5c3dd422ef92ca6714a69e2eabce1ee4 new file mode 100644 index 000000000000..9196da74623f --- /dev/null +++ b/geth-poa/signer-node2/keystore/UTC--2024-02-03T07-19-47.890792000Z--788ebabe5c3dd422ef92ca6714a69e2eabce1ee4 @@ -0,0 +1 @@ +{"address":"788ebabe5c3dd422ef92ca6714a69e2eabce1ee4","crypto":{"cipher":"aes-128-ctr","ciphertext":"58e511febc3a44bc200c62e85284cb2a8476e031ab972f4bff117cde250a30c9","cipherparams":{"iv":"138d64720343ab84b7c92bb961c6e262"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"fb3f34a5f9decf423103a6797d560c6c83da12d850892a6230331eafac02be00"},"mac":"5a09c59119f266db94a47221b21651b8445698a8a0b93cdcaaf00b0ad0d6e513"},"id":"2cc4da0a-dcbc-4ea9-9131-de8a680f0cf1","version":3} \ No newline at end of file