From aacbb8f82f4bafc2f7e8f3ef485a7b99eeb8e4d2 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Thu, 8 Sep 2022 18:26:04 +0300 Subject: [PATCH] [#208] Use neofs-adm to deploy sidechain environment Signed-off-by: Alex Vanin --- .env | 8 ++------ Makefile | 3 +++ services/morph_chain/artifacts.mk | 16 +--------------- services/morph_chain/docker-compose.yml | 3 --- 4 files changed, 6 insertions(+), 24 deletions(-) diff --git a/.env b/.env index fedbae3..8d116b4 100644 --- a/.env +++ b/.env @@ -8,10 +8,6 @@ CA_CERTS_TRUSTED_STORE=/etc/ssl/certs CHAIN_URL="https://github.com/nspcc-dev/neofs-contract/releases/download/v0.15.5/devenv_mainchain_notary_disabled.gz" NEOGO_VERSION=0.99.2 -# NeoGo sidechain -#MORPH_CHAIN_PATH="/path/to/morph-devenv.dump.gz" -MORPH_CHAIN_URL="https://github.com/nspcc-dev/neofs-contract/releases/download/v0.15.5/devenv_sidechain.gz" - # NeoFS InnerRing nodes IR_VERSION=0.31.0 IR_IMAGE=nspccdev/neofs-ir @@ -47,9 +43,9 @@ NEOFS_CLI_URL=https://github.com/nspcc-dev/neofs-node/releases/download/v0.31.0/ # NeoFS ADM tool binary NEOFS_ADM_VERSION=v0.31.0 NEOFS_ADM_URL=https://github.com/nspcc-dev/neofs-node/releases/download/${NEOFS_ADM_VERSION}/neofs-adm-amd64.tar.gz -#NEOFS_ADM_PATH=/path/to/neofs-adm +#NEOFS_ADM_PATH=/path/to/neofs-adm-binary # Compiled NeoFS Smart Contracts NEOFS_CONTRACTS_VERSION=v0.15.5 NEOFS_CONTRACTS_URL=https://github.com/nspcc-dev/neofs-contract/releases/download/${NEOFS_CONTRACTS_VERSION}/neofs-contract-${NEOFS_CONTRACTS_VERSION}.tar.gz -#NEOFS_CONTRACTS_PATH=/path/to/neofs-contracts +#NEOFS_CONTRACTS_PATH=/path/to/unpacked/neofs-contracts-dir diff --git a/Makefile b/Makefile index 4d234f1..fa2c687 100644 --- a/Makefile +++ b/Makefile @@ -72,6 +72,9 @@ up/basic: up/essential .PHONY: up/essential up/essential: get vendor/hosts @$(foreach SVC, $(START_ESSENTIAL), $(shell docker-compose -f services/$(SVC)/docker-compose.yml up -d)) + @./vendor/neofs-adm --config services/ir/neofs-adm.yml morph init --alphabet-wallets ./services/ir --contracts vendor/contracts || exit 1 + @for f in ./services/storage/wallet*.json; do echo "Transfer GAS to wallet $${f}" && ./vendor/neofs-adm -c services/ir/neofs-adm.yml morph refill-gas --storage-wallet $${f} --gas 10.0 --alphabet-wallets services/ir || exit 1; done + @echo "NeoFS sidechain environment is deployed" # Build up certain service .PHONY: up/% diff --git a/services/morph_chain/artifacts.mk b/services/morph_chain/artifacts.mk index 1a347d7..9c2a761 100644 --- a/services/morph_chain/artifacts.mk +++ b/services/morph_chain/artifacts.mk @@ -1,19 +1,5 @@ -# Download NeoFS sidechain dump with pre-deployed NeoFS contracts +# Download NeoFS Contracts and Adm tool to deploy environment get.morph_chain: get.contracts get.adm -get.morph_chain: MORPH_CHAIN_DUMP_NAME=neo.morph.dump. -get.morph_chain: MORPH_CHAIN_PATH?= -get.morph_chain: - @mkdir -p ./vendor - -ifeq (${MORPH_CHAIN_PATH},) - @echo "⇒ Download morph chain dump from ${MORPH_CHAIN_URL}" - @curl \ - -sSL "${MORPH_CHAIN_URL}" \ - -o ./vendor/morph_chain.gz -else - @echo "⇒ Copy local archive ${MORPH_CHAIN_PATH}" - @cp ${MORPH_CHAIN_PATH} ./vendor/morph_chain.gz -endif get.contracts: NEOFS_CONTRACTS_DEST=./vendor/contracts get.contracts: NEOFS_CONTRACTS_ARCHIVE=neofs-contracts.tar.gz diff --git a/services/morph_chain/docker-compose.yml b/services/morph_chain/docker-compose.yml index 564902c..1d75483 100644 --- a/services/morph_chain/docker-compose.yml +++ b/services/morph_chain/docker-compose.yml @@ -14,10 +14,7 @@ services: ipv4_address: ${IPV4_PREFIX}.90 stop_signal: SIGKILL env_file: [ ".int_test.env" ] - environment: - - ACC=/morph_chain.gz volumes: - - ./../../vendor/morph_chain.gz:/morph_chain.gz - ./protocol.privnet.yml:/config/protocol.privnet.yml - ./node-wallet.json:/wallets/node-wallet.json - ./../../vendor/hosts:/etc/hosts