#!/bin/bash
chmod +x /interface_setup
/interface_setup
ip rou del default 2> /dev/null
ip route add default via 10.154.0.254 dev net0
[ ! -e "/root/.ethereum/geth/nodekey" ] && geth --datadir /root/.ethereum init /tmp/eth-genesis.json
cp /tmp/keystore/UTC--2023-11-22T19-31-41.049097000Z--0x72943017A1fa5f255fC0f06625Aec22319FCd5b3 /root/.ethereum/keystore/
chmod +x /tmp/eth-bootstrapper
/tmp/eth-bootstrapper
geth --datadir /root/.ethereum --identity="NODE_5" --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 "0x72943017A1fa5f255fC0f06625Aec22319FCd5b3" --password "/tmp/eth-password"                             --miner.etherbase "0x72943017A1fa5f255fC0f06625Aec22319FCd5b3" --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

