Skip to content

Commit 2b24359

Browse files
committed
ir: add configuration for 4 ir nodes
Signed-off-by: Andrey Butusov <andrey@nspcc.io>
1 parent e3253df commit 2b24359

26 files changed

+620
-16
lines changed

.env

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ NEO_GO_URL=https://github.com/nspcc-dev/neo-go/releases/download/v${NEOGO_VERSIO
1616
# NeoFS InnerRing nodes
1717
IR_VERSION=0.44.0
1818
IR_IMAGE=nspccdev/neofs-ir
19+
IR_NUMBER_OF_NODES=4
1920

2021
# NeoFS Storage nodes
2122
NODE_VERSION=0.44.0
@@ -47,7 +48,11 @@ NEOFS_CONTRACTS_URL=https://github.com/nspcc-dev/neofs-contract/releases/downloa
4748
#NEOFS_CONTRACTS_PATH=/path/to/unpacked/neofs-contracts-dir
4849

4950
# Control service addresses used for healthchecks
50-
NEOFS_IR_CONTROL_GRPC_ENDPOINT=127.0.0.1:16512
51+
#NEOFS_IR_CONTROL_GRPC_ENDPOINT=127.0.0.1:16512
52+
NEOFS_IR_CONTROL_GRPC_ENDPOINT_1=ir01.${LOCAL_DOMAIN}:16512
53+
NEOFS_IR_CONTROL_GRPC_ENDPOINT_2=ir02.${LOCAL_DOMAIN}:16512
54+
NEOFS_IR_CONTROL_GRPC_ENDPOINT_3=ir03.${LOCAL_DOMAIN}:16512
55+
NEOFS_IR_CONTROL_GRPC_ENDPOINT_4=ir04.${LOCAL_DOMAIN}:16512
5156
NEOFS_STORAGE_CONTROL_GRPC_ENDPOINT_1=s01.${LOCAL_DOMAIN}:8081
5257
NEOFS_STORAGE_CONTROL_GRPC_ENDPOINT_2=s02.${LOCAL_DOMAIN}:8081
5358
NEOFS_STORAGE_CONTROL_GRPC_ENDPOINT_3=s03.${LOCAL_DOMAIN}:8081

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ services/storage/*tls.crt
1818
services/storage/*tls.key
1919

2020
# IR NeoFS contract configuration
21-
services/ir/.ir.env
21+
services/ir1/.ir.env

Makefile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ include services/*/prepare.mk
2222
# List of services to run
2323
START_SVCS = $(shell cat .services | grep -v '\#')
2424
START_BASIC = $(shell cat .basic_services | grep -ve '\#')
25-
START_BOOTSTRAP = $(shell cat .bootstrap_services | grep -v '\#')
25+
START_BOOTSTRAP = $(shell cat .bootstrap_services | grep -v '\#' | sed 's/^ir$$/&$(IR_NUMBER_OF_NODES)/')
2626
STOP_SVCS = $(shell tac .services | grep -v '\#')
2727
STOP_BASIC = $(shell tac .basic_services | grep -v '\#')
28-
STOP_BOOTSTRAP = $(shell tac .bootstrap_services | grep -v '\#')
28+
STOP_BOOTSTRAP = $(shell tac .bootstrap_services | grep -v '\#' | sed 's/^ir$$/&$(IR_NUMBER_OF_NODES)/')
2929

3030
# Enabled services dirs
3131
ENABLED_SVCS_DIRS = $(shell echo "${START_BOOTSTRAP} ${START_BASIC} ${START_SVCS}" | sed 's|[^ ]* *|./services/&|g')
@@ -112,16 +112,19 @@ up/basic: up/bootstrap
112112
# Start bootstrap services
113113
.PHONY: up/bootstrap
114114
up/bootstrap: get vendor/hosts
115-
@echo "NEOFS_IR_CONTRACTS_NEOFS="`./vendor/neo-go contract calc-hash -s NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM --in vendor/contracts/neofs/contract.nef -m vendor/contracts/neofs/manifest.json | grep -Eo '[a-fA-F0-9]{40}'` > services/ir/.ir.env
115+
@echo "NEOFS_IR_CONTRACTS_NEOFS="`./vendor/neo-go contract calc-hash -s NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM --in vendor/contracts/neofs/contract.nef -m vendor/contracts/neofs/manifest.json | grep -Eo '[a-fA-F0-9]{40}'` > services/ir1/.ir.env
116116
@for svc in $(START_BOOTSTRAP); do \
117117
echo "$@ for service: $${svc}"; \
118118
docker-compose -f services/$${svc}/docker-compose.yml up -d 2>&1 | tee -a docker-compose.err; \
119119
done
120120
@source ./bin/helper.sh
121-
@docker exec main_chain neo-go wallet nep17 transfer --force --await --wallet-config /wallets/config.yml -r http://main-chain.neofs.devenv:30333 --from NfgHwwTi3wHAS8aFAN243C5vGbkYDpqLHP --to NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM --token GAS --amount 1000
121+
@docker exec main_chain neo-go wallet nep17 transfer --force --await --wallet-config /wallets/config.yml -r http://main-chain.neofs.devenv:30333 --from NfgHwwTi3wHAS8aFAN243C5vGbkYDpqLHP --to NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM --token GAS --amount 1000
122122
@./vendor/neo-go contract deploy --wallet-config wallets/config.yml --in vendor/contracts/neofs/contract.nef --manifest vendor/contracts/neofs/manifest.json --force --await -r http://main-chain.neofs.devenv:30333 [ true ffffffffffffffffffffffffffffffffffffffff [ 02b3622bf4017bdfe317c58aed5f4c753f206b7db896046fa7d774bbc4bf7f8dc2 ] [ InnerRingCandidateFee 10000000000 WithdrawFee 100000000 ] ]
123123
@NEOGO=vendor/neo-go WALLET=wallets/wallet.json CONFIG=wallets/config.yml ./bin/deposit.sh
124-
@for f in ./services/storage/wallet*.json; do echo "Transfer GAS to wallet $${f}" && ./vendor/neofs-adm -c neofs-adm.yml fschain refill-gas --storage-wallet $${f} --gas 10.0 --alphabet-wallets services/ir || die "Failed to transfer GAS to alphabet wallets"; done
124+
@for f in ./services/storage/wallet*.json; do \
125+
echo "Transfer GAS to wallet $${f}" && \
126+
./vendor/neofs-adm -c neofs-adm.yml fschain refill-gas --storage-wallet $${f} --gas 10.0 --alphabet-wallets services/ir${IR_NUMBER_OF_NODES}/alphabet || die "Failed to transfer GAS to alphabet wallets"; \
127+
done
125128
$(call error_handler,$@);
126129
@echo "NeoFS chain environment is deployed"
127130

bin/config.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ echo "Running bin/config.sh"
44

55
# Source env settings
66
. .env
7-
. services/ir/.ir.env
7+
. services/ir1/.ir.env
88
source bin/helper.sh
99

1010
# NeoGo binary path.

bin/deposit.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ echo "Running bin/deposit.sh"
44

55
# Source env settings
66
. .env
7-
. services/ir/.ir.env
7+
. services/ir1/.ir.env
88
source bin/helper.sh
99

1010
# NeoGo binary path.

bin/tick.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ echo "Running bin/tick.sh"
44

55
# Source env settings
66
. .env
7-
. services/ir/.ir.env
7+
. services/ir1/.ir.env
88
source bin/helper.sh
99

1010
# NeoGo binary path.
@@ -22,7 +22,7 @@ else
2222
fi
2323

2424
# Grep NeoFS chain block time
25-
NEOFS_CHAIN_PROTO="${NEOFS_CHAIN_PROTO:-services/ir/cfg/config.yml}"
25+
NEOFS_CHAIN_PROTO="${NEOFS_CHAIN_PROTO:-services/ir${IR_NUMBER_OF_NODES}/cfg/config.yml}"
2626
BLOCK_DURATION=$(grep time_per_block < "$NEOFS_CHAIN_PROTO" | awk '{print $2}') \
2727
|| die "Cannot fetch block duration"
2828
NETMAP_ADDR=$(bin/resolve.sh netmap.neofs) || die "Cannot resolve netmap.neofs"

neofs-adm.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
rpc-endpoint: http://ir01.neofs.devenv:30333
22
credentials:
33
az: "one"
4+
buky: "one"
5+
glagoli: "one"
6+
vedi: "one"
7+
dobro: "one"
8+
yest: "one"
9+
zhivete: "one"
410
contract: "one"

services/ir/.hosts

Lines changed: 0 additions & 1 deletion
This file was deleted.
File renamed without changes.

services/ir1/.hosts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
IPV4_PREFIX.61 ir01.LOCAL_DOMAIN
2+
IPV4_PREFIX.62 ir02.LOCAL_DOMAIN
3+
IPV4_PREFIX.63 ir03.LOCAL_DOMAIN
4+
IPV4_PREFIX.64 ir04.LOCAL_DOMAIN
5+
IPV4_PREFIX.65 ir05.LOCAL_DOMAIN
6+
IPV4_PREFIX.66 ir06.LOCAL_DOMAIN
7+
IPV4_PREFIX.67 ir07.LOCAL_DOMAIN

0 commit comments

Comments
 (0)