forked from 0glabs/beacon-kit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
executable file
·36 lines (30 loc) · 1.26 KB
/
run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
set -x
# Function to forward the SIGINT signal to all child processes
forward_signal() {
echo "Caught Ctrl+C, forwarding SIGINT to all child processes..."
kill -INT $(jobs -p) 2>/dev/null
}
# Trap Ctrl+C (SIGINT) and call forward_signal function
trap forward_signal SIGINT
sudo rm -rf .tmp
make start &
sleep 10
make start-reth &
git clone -b v1.0.0-rc1 https://github.com/cometbft/cometbft.git
cd cometbft
COMETBFT_BUILD_OPTIONS=bls12381 make build
mkdir -p $HOME/.cometbft/config/
cp ../.tmp/beacond/config/node_key.json $HOME/.cometbft/config/
cp ../.tmp/beacond/config/priv_validator_key.json $HOME/.cometbft/config/
rm $HOME/.cometbft/config/genesis.json
./build/cometbft init
./build/cometbft unsafe-reset-all
COMET_JSON=$HOME/.cometbft/config/genesis.json
jq '.chain_id = "beacond-2061"' $COMET_JSON > tmp.json && mv tmp.json $COMET_JSON
jq '.app_state' ../.tmp/beacond/config/genesis.json > app_state.json
jq --slurpfile app_state app_state.json '.app_state = $app_state[0]' $COMET_JSON > tmp.json && mv tmp.json $COMET_JSON
jq '.consensus_params.validator.pub_key_types = ["bls12_381"]' $COMET_JSON > tmp.json && mv tmp.json $COMET_JSON
jq '.validators[0].power = "32000000000"' $COMET_JSON > tmp.json && mv tmp.json $COMET_JSON
./build/cometbft node
wait