1
+
2
+ name : Run a checkpoint sync test
3
+ description : Runs a consensus client and checkpoint syncs from the running checkpointz instance.
4
+
5
+ inputs :
6
+ consensus :
7
+ description : " The name of the consensus client to use (one of lighthouse, teku, prysm, nimbus, lodestar)."
8
+ required : true
9
+ network :
10
+ description : " The name of the network to run the test against (one of ropsten, sepolia, prater/goerli)."
11
+ required : true
12
+
13
+
14
+ runs :
15
+ using : composite
16
+ steps :
17
+ - uses : actions/checkout@v1
18
+ - name : Prepare environment
19
+ shell : bash
20
+ run : |
21
+ mkdir $HOME/bin;
22
+ export PATH=$HOME/bin:$PATH;
23
+ echo "Running against ${{ inputs.network }} with ${{ inputs.consensus }}.";
24
+ - name : Build checkpointz
25
+ shell : bash
26
+ run : |
27
+ docker build . -t samcm/checkpointz:local;
28
+ - name : Configure checkpointz
29
+ shell : bash
30
+ run : |
31
+ cat <<EOF > checkpointz.yaml
32
+ global:
33
+ listenAddr: ":5555"
34
+ logging: "debug" # panic,fatal,warm,info,debug,trace
35
+
36
+ beacon:
37
+ upstreams:
38
+ - name: state-provider
39
+ address: https://${{ inputs.network }}-debug.checkpoint-sync.ethdevops.io
40
+ timeoutSeconds: 30
41
+ dataProvider: true
42
+ checkpointz:
43
+ mode: full
44
+ caches:
45
+ blocks:
46
+ max_items: 500
47
+ states:
48
+ max_items: 5
49
+ historical_epoch_count: 5
50
+ EOF
51
+ - name : Create log directories
52
+ shell : bash
53
+ run : |
54
+ mkdir -p logs;
55
+ - name : Create docker network
56
+ shell : bash
57
+ run : |
58
+ docker network create eth
59
+ - name : Run checkpointz
60
+ shell : bash
61
+ run : |
62
+ echo "Starting checkpointz...";
63
+ docker run -d --network eth -p 5555:5555 -v $(pwd):/data --name checkpointz samcm/checkpointz:local --config /data/checkpointz.yaml;
64
+ docker logs checkpointz -f &> logs/checkpointz.log &
65
+ docker logs checkpointz -f &
66
+ echo "Checkpointz is running.";
67
+ - name : Wait for checkpointz to have a finalized checkpoint
68
+ shell : bash
69
+ run : |
70
+ echo "Waiting for checkpointz to have a finalized checkpoint...";
71
+ bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:5555/eth/v1/beacon/states/finalized/finality_checkpoints)" != "200" ]]; do sleep 1; done';
72
+ echo "Checkpointz has a finalized checkpoint.";
73
+ - name : Wait for checkpointz to have the genesis block
74
+ shell : bash
75
+ run : |
76
+ echo "Waiting for checkpointz to have the genesis block...";
77
+ bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:5555/eth/v2/beacon/blocks/0)" != "200" ]]; do sleep 1; done';
78
+ echo "Checkpointz has the genesis block.";
79
+ - name : Run teku client
80
+ shell : bash
81
+ if : ${{ inputs.consensus == 'teku' }}
82
+ run : |
83
+ echo "Starting Teku...";
84
+ docker run -p 5052:5052 -d --name beacon --network eth -e TEKU_REST_API_ENABLED=true -e TEKU_P2P_PORT=9000 consensys/teku:latest --rest-api-port=5052 --network=${{ inputs.network }} --log-destination=CONSOLE --initial-state=http://checkpointz:5555/eth/v2/debug/beacon/states/finalized --ee-endpoint=http://102.10.10.1:8545
85
+ echo "Teku is running.";
86
+ - name : Run lighthouse client
87
+ shell : bash
88
+ if : ${{ inputs.consensus == 'lighthouse' }}
89
+ run : |
90
+ echo "Starting Lighthouse...";
91
+ docker run -p 5052:5052 --network eth -d --name beacon sigp/lighthouse:latest lighthouse bn --network=${{ inputs.network }} --datadir=/data --checkpoint-sync-url=http://checkpointz:5555 --http --http-address=0.0.0.0
92
+ echo "Lighthouse is running.";
93
+ - name : Run prysm
94
+ shell : bash
95
+ if : ${{ inputs.consensus == 'prysm' }}
96
+ run : |
97
+ echo "Starting prysm...";
98
+ docker run -d --name beacon --network eth -p 5052:5052 gcr.io/prysmaticlabs/prysm/beacon-chain:latest --datadir=/data --accept-terms-of-use --${{ inputs.network }} --clear-db --grpc-gateway-port=5052 --grpc-gateway-host=0.0.0.0 --http-web3provider=http://localhost:8545 --force-clear-db --checkpoint-sync-url=http://checkpointz:5555 --genesis-beacon-api-url=http://checkpointz:5555 --grpc-gateway-port=5052
99
+ echo "Prysm is running.";
100
+ - name : Run nimbus
101
+ shell : bash
102
+ if : ${{ inputs.consensus == 'nimbus' }}
103
+ run : |
104
+ echo "Starting nimbus...";
105
+ docker run --name beacon --network eth statusim/nimbus-eth2:amd64-latest trustedNodeSync --network=${{ inputs.network }} --trusted-node-url=http://checkpointz:5555 --backfill=false
106
+ echo "Nimbus is running.";
107
+ - name : Run lodestar
108
+ shell : bash
109
+ if : ${{ inputs.consensus == 'lodestar' }}
110
+ run : |
111
+ echo "Starting lodestar...";
112
+ docker run --name beacon -d --network eth -p 5052:5052 chainsafe/lodestar beacon --dataDir /data --network ${{ inputs.network }} --checkpointSyncUrl=http://checkpointz:5555 --rest --rest.address 0.0.0.0 --rest.port=5052
113
+ echo "Lodestar is running.";
114
+ - name : Wait for consensus client to have checkpoint synced
115
+ shell : bash
116
+ if : ${{ inputs.consensus != 'nimbus' }}
117
+ run : |
118
+ docker logs beacon -f &> logs/consensus.log &
119
+ docker logs beacon -f &
120
+ while true; do
121
+ if [[ $(curl -s localhost:5052/eth/v1/node/syncing | jq '.data.head_slot|tonumber') -gt 1000 ]]; then
122
+ break;
123
+ fi
124
+ sleep 1;
125
+ done;
126
+ - uses : actions/upload-artifact@v3
127
+ if : ${{ always() }}
128
+ with :
129
+ name : ${{ inputs.network }}-${{ inputs.consensus }}-checkpointz.log
130
+ path : logs/checkpointz.log
131
+ - uses : actions/upload-artifact@v3
132
+ if : ${{ always() }}
133
+ with :
134
+ name : ${{ inputs.network }}-${{ inputs.consensus }}-consensus.log
135
+ path : logs/consensus.log
0 commit comments