Run a fullnode+drone automatically when the container starts up

This commit is contained in:
Michael Vines
2018-10-02 17:34:47 -07:00
parent 3fa46dd66d
commit beb4536841
4 changed files with 48 additions and 4 deletions

23
ci/docker-solana/entrypoint.sh Executable file
View File

@@ -0,0 +1,23 @@
#!/bin/bash -ex
export RUST_LOG=solana=info
export RUST_BACKTRACE=1
solana-keygen -o /config/leader-keypair.json
solana-keygen -o /config/drone-keypair.json
solana-genesis --tokens=1000000000 --ledger /ledger < /config/drone-keypair.json
solana-fullnode-config --keypair=/config/leader-keypair.json -l > /config/leader-config.json
solana-drone --keypair /config/drone-keypair.json --network 127.0.0.1:8001 &
drone=$!
solana-fullnode --identity /config/leader-config.json --ledger /ledger/ &
fullnode=$!
abort() {
kill "$drone" "$fullnode"
}
trap abort SIGINT SIGTERM
wait "$fullnode"
kill "$drone" "$fullnode"