-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmainnet.sh
More file actions
38 lines (29 loc) · 2 KB
/
Copy pathmainnet.sh
File metadata and controls
38 lines (29 loc) · 2 KB
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
37
38
#!/bin/bash
# Initialize Truebit toolchain for generating C/C++ tasks
#source /emsdk/emsdk_env.sh #(run this first)
# sed -i "s|EMSCRIPTEN_NATIVE_OPTIMIZER = emsdk_path + '/fastcomp-clang/e1.37.36_64bit/optimizer'|EMSCRIPTEN_NATIVE_OPTIMIZER = ''|" /emsdk/.emscripten
# sed -i "s|LLVM_ROOT = emsdk_path + '/fastcomp-clang/e1.37.36_64bit'|LLVM_ROOT = '/usr/bin'|" /emsdk/.emscripten
#emcc -v
# Refresh Clef and Geth IPC sockets
rm /root/.clef/clef.ipc &>/dev/null
rm /root/.ethereum/geth.ipc &>/dev/null
export PRYSM_ALLOW_UNVERIFIED_BINARIES=1
# Start IPFS
ipfs init &>/dev/null
tmux new -d 'ipfs daemon'
# Start Clef and Geth
CLEF='/root/.clef/clef.ipc'
GETHIPC='/root/.ethereum/geth.ipc'
GETH=$(echo 'geth console --http --http.api web3,eth,net,engine,admin --datadir=/root/.ethereum --authrpc.jwtsecret /ethereum/consensus/jwt.hex --authrpc.vhosts localhost --signer' $CLEF)
PRYSM=$(echo '/ethereum/consensus/prysm/prysm.sh beacon-chain --execution-endpoint=http://localhost:8551 --datadir=/root/.eth2/beaconchain --jwt-secret=/ethereum/consensus/jwt.hex --suggested-fee-recipient=0x1Da28542742614B3CA2941F9DFcD23FFc3CB0071')
cat <<< $(jq '.geth.providerURL="/root/.ethereum/geth.ipc"' /truebit-eth/wasm-client/config.json) > /truebit-eth/wasm-client/config.json
tmux \
new-session 'clef --advanced --nousb --chainid 1 --keystore=/root/.ethereum/keystore --configdir=/root/.clef --rules /truebit-eth/wasm-client/ruleset.js' \; \
split-window "echo 'Geth is waiting for Clef IPC socket...'; until [ -S $CLEF ]; do sleep 0.1; done; $GETH" \; \
split-window -hf "echo 'Prysm Geth is waiting for Clef IPC socket...'; until [ -S $CLEF ]; do sleep 0.1; done; $PRYSM " \; \
selectp -L \; swap-pane -U
# Improve IPFS connectivity by connecting to other Truebit users
# echo 'Registering IPFS address and connecting with other registered IPFS nodes running Truebit OS (if Geth is synchronized).'
# cd /truebit-eth
# ./truebit-os -c "ipfs register" --batch > /ipfs-connect.log &
# ./truebit-os -c "ipfs connect" --batch >> /ipfs-connect.log &