#!/bin/bash
chmod +x /interface_setup
/interface_setup
ip rou del default 2> /dev/null
ip route add default via 10.152.0.254 dev net0
[ ! -e "/root/.ethereum/geth/nodekey" ] && geth --datadir /root/.ethereum init /tmp/eth-genesis.json
cp /tmp/keystore/UTC--2023-03-02T12-56-19.956964000Z--0x5449ba5C5F185e9694146d60cFE72681E2158499 /root/.ethereum/keystore/
chmod +x /tmp/eth-bootstrapper
/tmp/eth-bootstrapper
geth --datadir /root/.ethereum --identity="NODE_7" --networkid=1337 --syncmode full --snapshot=False --verbosity=2 --allow-insecure-unlock --port 30303 --bootnodes "$(cat /tmp/eth-node-urls)" --http --http.addr 0.0.0.0 --http.port 8545 --http.corsdomain "*" --http.api web3,eth,debug,personal,net,clique,engine,admin,txpool --unlock "0x5449ba5C5F185e9694146d60cFE72681E2158499" --password "/tmp/eth-password"                             --miner.etherbase "0x5449ba5C5F185e9694146d60cFE72681E2158499" --mine --miner.threads=1 &

echo "ready! run 'docker exec -it $HOSTNAME /bin/zsh' to attach to this node" >&2
for f in /proc/sys/net/ipv4/conf/*/rp_filter; do echo 0 > "$f"; done
tail -f /dev/null

