From 9eaba457037d813f52c77ed1e76b217cc02dc33b Mon Sep 17 00:00:00 2001 From: Artem Tataurov Date: Mon, 15 May 2023 14:43:36 +0300 Subject: [PATCH] Fix missing bin Signed-off-by: Artem Tataurov --- .gitignore | 4 --- bin/init-aio.sh | 66 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+), 4 deletions(-) create mode 100755 bin/init-aio.sh diff --git a/.gitignore b/.gitignore index ac1556d..938c147 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,3 @@ temp tmp - -# binary -bin/ -release/ diff --git a/bin/init-aio.sh b/bin/init-aio.sh new file mode 100755 index 0000000..1d76303 --- /dev/null +++ b/bin/init-aio.sh @@ -0,0 +1,66 @@ +#!/bin/bash + +stage() { + echo "================================================================================" + echo "$@" + echo "================================================================================" +} + +die() { + echo "$@" 1>&2 + exit 1 +} + +runBlockchain() { + stage "Starting the blockchain" + + /usr/bin/privnet-entrypoint.sh node --config-path /config --privnet & + + while [[ "$(curl -s -o /dev/null -w %{http_code} localhost:30333)" != "422" ]]; + do + sleep 2; + done +} + +configure() { + stage "Configuring the blockchain" + + /usr/bin/frostfs-adm morph init --config /config/frostfs-adm.yml --contracts /config/contracts || die "Failed to initialize Alphabet wallets" + + /usr/bin/frostfs-adm morph refill-gas --config /config/frostfs-adm.yml --storage-wallet /config/wallet-sn.json --gas 10.0 || die "Failed to transfer GAS to alphabet wallets" +} + +runServices() { + stage "Running services" + + /usr/bin/frostfs-ir --config /config/config-ir.yaml & + + while [[ -z "$(/usr/bin/frostfs-cli control healthcheck --ir --endpoint localhost:16512 -c /config/cli-cfg-ir.yaml | grep 'Health status: READY')" ]]; + do + sleep 2; + done + + set -m + /usr/bin/frostfs-node --config /config/config-sn.yaml & + + while [[ -z "$(/usr/bin/frostfs-cli control healthcheck --endpoint localhost:16513 -c /config/cli-cfg-sn.yaml | grep 'Health status: READY')" ]]; + do + ./bin/tick.sh + sleep 5; + done + + /usr/bin/frostfs-s3-gw --config /config/s3-gw-config.yaml & + /usr/bin/frostfs-http-gw --config /config/http-gw-config.yaml & +} + + +if [ ! -e "/data/chain/morph.bolt" ]; +then + runBlockchain + configure +else + runBlockchain +fi +runServices +stage "aio container started" +fg