Skip to content

Commit

Permalink
ir: add configuration for 4 ir nodes
Browse files Browse the repository at this point in the history
Signed-off-by: Andrey Butusov <[email protected]>
  • Loading branch information
End-rey committed Dec 10, 2024
1 parent e3253df commit 2b24359
Show file tree
Hide file tree
Showing 26 changed files with 620 additions and 16 deletions.
7 changes: 6 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ NEO_GO_URL=https://github.com/nspcc-dev/neo-go/releases/download/v${NEOGO_VERSIO
# NeoFS InnerRing nodes
IR_VERSION=0.44.0
IR_IMAGE=nspccdev/neofs-ir
IR_NUMBER_OF_NODES=4

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

# Control service addresses used for healthchecks
NEOFS_IR_CONTROL_GRPC_ENDPOINT=127.0.0.1:16512
#NEOFS_IR_CONTROL_GRPC_ENDPOINT=127.0.0.1:16512
NEOFS_IR_CONTROL_GRPC_ENDPOINT_1=ir01.${LOCAL_DOMAIN}:16512
NEOFS_IR_CONTROL_GRPC_ENDPOINT_2=ir02.${LOCAL_DOMAIN}:16512
NEOFS_IR_CONTROL_GRPC_ENDPOINT_3=ir03.${LOCAL_DOMAIN}:16512
NEOFS_IR_CONTROL_GRPC_ENDPOINT_4=ir04.${LOCAL_DOMAIN}:16512
NEOFS_STORAGE_CONTROL_GRPC_ENDPOINT_1=s01.${LOCAL_DOMAIN}:8081
NEOFS_STORAGE_CONTROL_GRPC_ENDPOINT_2=s02.${LOCAL_DOMAIN}:8081
NEOFS_STORAGE_CONTROL_GRPC_ENDPOINT_3=s03.${LOCAL_DOMAIN}:8081
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ services/storage/*tls.crt
services/storage/*tls.key

# IR NeoFS contract configuration
services/ir/.ir.env
services/ir1/.ir.env
13 changes: 8 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ include services/*/prepare.mk
# List of services to run
START_SVCS = $(shell cat .services | grep -v '\#')
START_BASIC = $(shell cat .basic_services | grep -ve '\#')
START_BOOTSTRAP = $(shell cat .bootstrap_services | grep -v '\#')
START_BOOTSTRAP = $(shell cat .bootstrap_services | grep -v '\#' | sed 's/^ir$$/&$(IR_NUMBER_OF_NODES)/')
STOP_SVCS = $(shell tac .services | grep -v '\#')
STOP_BASIC = $(shell tac .basic_services | grep -v '\#')
STOP_BOOTSTRAP = $(shell tac .bootstrap_services | grep -v '\#')
STOP_BOOTSTRAP = $(shell tac .bootstrap_services | grep -v '\#' | sed 's/^ir$$/&$(IR_NUMBER_OF_NODES)/')

# Enabled services dirs
ENABLED_SVCS_DIRS = $(shell echo "${START_BOOTSTRAP} ${START_BASIC} ${START_SVCS}" | sed 's|[^ ]* *|./services/&|g')
Expand Down Expand Up @@ -112,16 +112,19 @@ up/basic: up/bootstrap
# Start bootstrap services
.PHONY: up/bootstrap
up/bootstrap: get vendor/hosts
@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
@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
@for svc in $(START_BOOTSTRAP); do \
echo "$@ for service: $${svc}"; \
docker-compose -f services/$${svc}/docker-compose.yml up -d 2>&1 | tee -a docker-compose.err; \
done
@source ./bin/helper.sh
@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
@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
@./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 ] ]
@NEOGO=vendor/neo-go WALLET=wallets/wallet.json CONFIG=wallets/config.yml ./bin/deposit.sh
@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
@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${IR_NUMBER_OF_NODES}/alphabet || die "Failed to transfer GAS to alphabet wallets"; \
done
$(call error_handler,$@);
@echo "NeoFS chain environment is deployed"

Expand Down
2 changes: 1 addition & 1 deletion bin/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ echo "Running bin/config.sh"

# Source env settings
. .env
. services/ir/.ir.env
. services/ir1/.ir.env
source bin/helper.sh

# NeoGo binary path.
Expand Down
2 changes: 1 addition & 1 deletion bin/deposit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ echo "Running bin/deposit.sh"

# Source env settings
. .env
. services/ir/.ir.env
. services/ir1/.ir.env
source bin/helper.sh

# NeoGo binary path.
Expand Down
4 changes: 2 additions & 2 deletions bin/tick.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ echo "Running bin/tick.sh"

# Source env settings
. .env
. services/ir/.ir.env
. services/ir1/.ir.env
source bin/helper.sh

# NeoGo binary path.
Expand All @@ -22,7 +22,7 @@ else
fi

# Grep NeoFS chain block time
NEOFS_CHAIN_PROTO="${NEOFS_CHAIN_PROTO:-services/ir/cfg/config.yml}"
NEOFS_CHAIN_PROTO="${NEOFS_CHAIN_PROTO:-services/ir${IR_NUMBER_OF_NODES}/cfg/config.yml}"
BLOCK_DURATION=$(grep time_per_block < "$NEOFS_CHAIN_PROTO" | awk '{print $2}') \
|| die "Cannot fetch block duration"
NETMAP_ADDR=$(bin/resolve.sh netmap.neofs) || die "Cannot resolve netmap.neofs"
Expand Down
6 changes: 6 additions & 0 deletions neofs-adm.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
rpc-endpoint: http://ir01.neofs.devenv:30333
credentials:
az: "one"
buky: "one"
glagoli: "one"
vedi: "one"
dobro: "one"
yest: "one"
zhivete: "one"
contract: "one"
1 change: 0 additions & 1 deletion services/ir/.hosts

This file was deleted.

File renamed without changes.
7 changes: 7 additions & 0 deletions services/ir1/.hosts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
IPV4_PREFIX.61 ir01.LOCAL_DOMAIN
IPV4_PREFIX.62 ir02.LOCAL_DOMAIN
IPV4_PREFIX.63 ir03.LOCAL_DOMAIN
IPV4_PREFIX.64 ir04.LOCAL_DOMAIN
IPV4_PREFIX.65 ir05.LOCAL_DOMAIN
IPV4_PREFIX.66 ir06.LOCAL_DOMAIN
IPV4_PREFIX.67 ir07.LOCAL_DOMAIN
File renamed without changes.
4 changes: 2 additions & 2 deletions services/ir/artifacts.mk → services/ir1/artifacts.mk
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Get NeoFS IR artifacts (NeoFS contracts, ADM and CLI)

get.ir: get.cli get.contracts get.adm get.storage prepare.storage
get.ir1: get.cli get.contracts get.adm get.storage prepare.storage

# Download NeoFS CLI
.ONESHELL:
get.cli: NEOFS_CLI_FILE=./vendor/neofs-cli
get.cli: NEOFS_CLI_PATH?=
get.cli:
@touch services/ir/.ir.env # https://github.com/docker/compose/issues/3560
@touch services/ir1/.ir.env # https://github.com/docker/compose/issues/3560
@mkdir -p ./vendor

ifeq (${NEOFS_CLI_PATH},)
Expand Down
6 changes: 6 additions & 0 deletions services/ir/cfg/config.yml → services/ir1/cfg/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ prometheus:
enabled: true
address: :9090 # Endpoint for application prometheus metrics; disabled by default
shutdown_timeout: 30s # Timeout for metrics HTTP server graceful shutdown

control:
authorized_keys: # List of hex-encoded 33-byte public keys that have rights to use the control service
- 02b3622bf4017bdfe317c58aed5f4c753f206b7db896046fa7d774bbc4bf7f8dc2
grpc:
endpoint: localhost:16512 # Endpoint that is listened by the control service; disabled by default

# Toggling the sidechain-only mode
without_mainnet: false
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ services:
internet:
ipv4_address: ${IPV4_PREFIX}.61
stop_signal: SIGKILL
environment:
- NEOFS_IR_CONTROL_GRPC_ENDPOINT=${NEOFS_IR_CONTROL_GRPC_ENDPOINT_1}
volumes:
- neofs_chain_ir01:/neofs_chain/
- ./az.json:/wallet.json
- ./alphabet/az.json:/wallet.json
- ./../../vendor/hosts:/etc/hosts
- ./../../vendor/neofs-cli:/neofs-cli
- ./cli-cfg.yml:/cli-cfg.yml
Expand All @@ -24,7 +26,7 @@ services:
env_file: [ ".env", ".ir.env" ]
command: [ "neofs-ir", "--config", "/etc/neofs/ir/config.yml" ]
healthcheck:
test: ["CMD", "/neofs-cli", "control", "healthcheck", "-c", "/cli-cfg.yml", "--endpoint", "${NEOFS_IR_CONTROL_GRPC_ENDPOINT}", "--ir"]
test: ["CMD", "/neofs-cli", "control", "healthcheck", "-c", "/cli-cfg.yml", "--endpoint", "${NEOFS_IR_CONTROL_GRPC_ENDPOINT_1}", "--ir"]
interval: 1s
timeout: 1s
retries: 300
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions services/ir4/.env
1 change: 1 addition & 0 deletions services/ir4/.ir.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
EOFS_IR_CONTRACTS_NEOFS=6a715fe77786ad16a5f543e45c7ba242f196d01b
80 changes: 80 additions & 0 deletions services/ir4/alphabet/az.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{
"version": "1.0",
"accounts": [
{
"address": "NVvgwaqoKJKWe9JYZbUH2pDNSuHdMvCayr",
"key": "6PYRvQ8JfJrAgviGtGLXXDVcBFWksLHo8DUT3a2vBSe6EvBmpUyQ21XSPU",
"label": "single",
"contract": {
"script": "DCEDRe78UFReg9/H7Jq2SCEN3b6zmWkSqP9kFuLT7FGo4yRBVuezJw==",
"parameters": [
{
"name": "parameter0",
"type": "Signature"
}
],
"deployed": false
},
"lock": false,
"isDefault": false
},
{
"address": "NWXweiZSaJ31iCDD8VpuxoWfoMwUkJnaXC",
"key": "6PYRvQ8JfJrAgviGtGLXXDVcBFWksLHo8DUT3a2vBSe6EvBmpUyQ21XSPU",
"label": "committee",
"contract": {
"script": "EwwhA0Xu/FBUXoPfx+yatkghDd2+s5lpEqj/ZBbi0+xRqOMkDCEDmhwz7Ri7V/bms+cStUuSTSuRN8SQbPQz7oaTo4EOOA4MIQLTCIkxwDSjkMW+oW0Z7y3r6XAgGScMlJE1KKisMOFzcwwhAvt1MWYUASItzycRu9eFl+gVK6iGYS5E6lMKCLvk66gQFEGe0Nw6",
"parameters": [
{
"name": "parameter0",
"type": "Signature"
},
{
"name": "parameter1",
"type": "Signature"
},
{
"name": "parameter2",
"type": "Signature"
}
],
"deployed": false
},
"lock": false,
"isDefault": false
},
{
"address": "NWXweiZSaJ31iCDD8VpuxoWfoMwUkJnaXC",
"key": "6PYRvQ8JfJrAgviGtGLXXDVcBFWksLHo8DUT3a2vBSe6EvBmpUyQ21XSPU",
"label": "consensus",
"contract": {
"script": "EwwhA0Xu/FBUXoPfx+yatkghDd2+s5lpEqj/ZBbi0+xRqOMkDCEDmhwz7Ri7V/bms+cStUuSTSuRN8SQbPQz7oaTo4EOOA4MIQLTCIkxwDSjkMW+oW0Z7y3r6XAgGScMlJE1KKisMOFzcwwhAvt1MWYUASItzycRu9eFl+gVK6iGYS5E6lMKCLvk66gQFEGe0Nw6",
"parameters": [
{
"name": "parameter0",
"type": "Signature"
},
{
"name": "parameter1",
"type": "Signature"
},
{
"name": "parameter2",
"type": "Signature"
}
],
"deployed": false
},
"lock": false,
"isDefault": false
}
],
"scrypt": {
"n": 16384,
"r": 8,
"p": 8
},
"extra": {
"Tokens": null
}
}
80 changes: 80 additions & 0 deletions services/ir4/alphabet/buky.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{
"version": "1.0",
"accounts": [
{
"address": "NYsJkMH9nPd6K345PNxLtWRdzNwKYy4KY7",
"key": "6PYT2HbyT9cUBeV1jpoWXLhfSkVCHGnqig2qhmAY1ipKMtCFj7YfaDHWVu",
"label": "single",
"contract": {
"script": "DCEDmhwz7Ri7V/bms+cStUuSTSuRN8SQbPQz7oaTo4EOOA5BVuezJw==",
"parameters": [
{
"name": "parameter0",
"type": "Signature"
}
],
"deployed": false
},
"lock": false,
"isDefault": false
},
{
"address": "NWXweiZSaJ31iCDD8VpuxoWfoMwUkJnaXC",
"key": "6PYT2HbyT9cUBeV1jpoWXLhfSkVCHGnqig2qhmAY1ipKMtCFj7YfaDHWVu",
"label": "committee",
"contract": {
"script": "EwwhA0Xu/FBUXoPfx+yatkghDd2+s5lpEqj/ZBbi0+xRqOMkDCEDmhwz7Ri7V/bms+cStUuSTSuRN8SQbPQz7oaTo4EOOA4MIQLTCIkxwDSjkMW+oW0Z7y3r6XAgGScMlJE1KKisMOFzcwwhAvt1MWYUASItzycRu9eFl+gVK6iGYS5E6lMKCLvk66gQFEGe0Nw6",
"parameters": [
{
"name": "parameter0",
"type": "Signature"
},
{
"name": "parameter1",
"type": "Signature"
},
{
"name": "parameter2",
"type": "Signature"
}
],
"deployed": false
},
"lock": false,
"isDefault": false
},
{
"address": "NWXweiZSaJ31iCDD8VpuxoWfoMwUkJnaXC",
"key": "6PYT2HbyT9cUBeV1jpoWXLhfSkVCHGnqig2qhmAY1ipKMtCFj7YfaDHWVu",
"label": "consensus",
"contract": {
"script": "EwwhA0Xu/FBUXoPfx+yatkghDd2+s5lpEqj/ZBbi0+xRqOMkDCEDmhwz7Ri7V/bms+cStUuSTSuRN8SQbPQz7oaTo4EOOA4MIQLTCIkxwDSjkMW+oW0Z7y3r6XAgGScMlJE1KKisMOFzcwwhAvt1MWYUASItzycRu9eFl+gVK6iGYS5E6lMKCLvk66gQFEGe0Nw6",
"parameters": [
{
"name": "parameter0",
"type": "Signature"
},
{
"name": "parameter1",
"type": "Signature"
},
{
"name": "parameter2",
"type": "Signature"
}
],
"deployed": false
},
"lock": false,
"isDefault": false
}
],
"scrypt": {
"n": 16384,
"r": 8,
"p": 8
},
"extra": {
"Tokens": null
}
}
Loading

0 comments on commit 2b24359

Please sign in to comment.