ligo/scripts/docker/entrypoint.sh

66 lines
1.3 KiB
Bash
Raw Normal View History

2018-01-29 21:26:27 +04:00
#!/bin/sh
set -e
bin_dir="$(cd "$(dirname "$0")" && echo "$(pwd -P)/")"
: ${DATA_DIR:="/var/run/tezos"}
: ${NODE_HOST:="node"}
: ${NODE_RPC_PORT:="8732"}
2018-01-29 21:26:27 +04:00
2018-07-18 22:27:06 +04:00
: ${PROTOCOL:="unspecified-PROTOCOL-variable"}
2018-01-29 21:26:27 +04:00
node="/usr/local/bin/tezos-node"
client="/usr/local/bin/tezos-client"
admin_client="/usr/local/bin/tezos-admin-client"
2018-07-18 22:27:06 +04:00
baker="/usr/local/bin/tezos-$PROTOCOL-baker"
endorser="/usr/local/bin/tezos-$PROTOCOL-endorser"
accuser="/usr/local/bin/tezos-$PROTOCOL-accuser"
2018-07-07 06:16:07 +04:00
signer="/usr/local/bin/tezos-signer"
2018-01-29 21:26:27 +04:00
client_dir="$DATA_DIR/client"
node_dir="$DATA_DIR/node"
node_data_dir="$node_dir/data"
2018-01-29 21:26:27 +04:00
. "$bin_dir/entrypoint.inc.sh"
command=${1:-tezos-node}
shift 1
case $command in
tezos-node)
launch_node "$@"
;;
tezos-baker)
launch_baker "$@"
;;
tezos-endorser)
launch_endorser "$@"
;;
2018-06-25 19:39:36 +04:00
tezos-accuser)
launch_accuser "$@"
;;
2018-01-29 21:26:27 +04:00
tezos-client)
configure_client
exec "$client" "$@"
;;
tezos-admin-client)
configure_client
exec "$admin_client" "$@"
;;
2018-07-07 06:16:07 +04:00
tezos-signer)
exec "$signer" "$@"
;;
2018-01-29 21:26:27 +04:00
*)
cat <<EOF
Available commands:
- tezos-node [args]
- tezos-client [args]
- tezos-baker [keys]
- tezos-endorser [keys]
2018-07-07 06:16:07 +04:00
- tezos-signer [args]
2018-01-29 21:26:27 +04:00
EOF
;;
esac