diff --git a/.basic_services b/.basic_services index 201ea70..6d97490 100644 --- a/.basic_services +++ b/.basic_services @@ -1,5 +1,4 @@ # Services start/stop order # Will start from top to bottom and stop in reverse nats -ir storage diff --git a/.bootstrap_services b/.bootstrap_services index 3d2562c..85be5d8 100644 --- a/.bootstrap_services +++ b/.bootstrap_services @@ -2,4 +2,4 @@ # Will start from top to bottom and stop in reverse basenet chain -morph_chain +ir diff --git a/.env b/.env index 6af05e8..48faaa0 100644 --- a/.env +++ b/.env @@ -14,11 +14,11 @@ NEO_GO_PLATFORM=linux-amd64 NEO_GO_URL=https://github.com/nspcc-dev/neo-go/releases/download/v${NEOGO_VERSION}/neo-go-${NEO_GO_PLATFORM} # NeoFS InnerRing nodes -IR_VERSION=0.38.1 +IR_VERSION=0.39.1 IR_IMAGE=nspccdev/neofs-ir # NeoFS Storage nodes -NODE_VERSION=0.38.1 +NODE_VERSION=0.39.1 NODE_IMAGE=nspccdev/neofs-storage # NATS Server @@ -44,21 +44,17 @@ S3_GW_IMAGE=nspccdev/neofs-s3-gw COREDNS_VERSION=v016 COREDNS_IMAGE=nspccdev/coredns -# NeoFS LOCODE database -LOCODE_DB_URL=https://github.com/nspcc-dev/neofs-locode-db/releases/download/v0.3.0/locode_db.gz -#LOCODE_DB_PATH=/path/to/locode_db - # NeoFS CLI binary -NEOFS_CLI_URL=https://github.com/nspcc-dev/neofs-node/releases/download/v0.38.1/neofs-cli-amd64.tar.gz +NEOFS_CLI_URL=https://github.com/nspcc-dev/neofs-node/releases/download/v0.39.1/neofs-cli-amd64.tar.gz #NEOFS_CLI_PATH=/path/to/neofs-cli-binary # NeoFS ADM tool binary -NEOFS_ADM_VERSION=v0.38.1 +NEOFS_ADM_VERSION=v0.39.1 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-binary # Compiled NeoFS Smart Contracts -NEOFS_CONTRACTS_VERSION=v0.17.0 +NEOFS_CONTRACTS_VERSION=v0.19.1 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/unpacked/neofs-contracts-dir diff --git a/Makefile b/Makefile index 4a81653..e918e75 100644 --- a/Makefile +++ b/Makefile @@ -42,7 +42,7 @@ PULL_SVCS = $(shell find ${ENABLED_SVCS_DIRS} -type f -name 'docker-compose.yml' HOSTS_LINES = $(shell grep -Rl IPV4_PREFIX ./services/* | grep .hosts) # Paths to protocol.privnet.yml -MORPH_CHAIN_PROTOCOL = './services/morph_chain/protocol.privnet.yml' +NEOFS_CHAIN_PROTOCOL = './services/ir/cfg/config.yml' CHAIN_PROTOCOL = './services/chain/protocol.privnet.yml' # List of grepped environment variables from *.env @@ -125,10 +125,9 @@ up/bootstrap: get vendor/hosts @./vendor/neo-go contract deploy --wallet-config wallets/config.yml --in vendor/contracts/neofs/neofs_contract.nef --manifest vendor/contracts/neofs/config.json --force -r http://main-chain.neofs.devenv:30333 [ true ffffffffffffffffffffffffffffffffffffffff [ 02b3622bf4017bdfe317c58aed5f4c753f206b7db896046fa7d774bbc4bf7f8dc2 ] [ InnerRingCandidateFee 10000000000 WithdrawFee 100000000 ] ] @echo "Waiting for deployment to happen" && sleep 2 @NEOGO=vendor/neo-go WALLET=wallets/wallet.json CONFIG=wallets/config.yml ./bin/deposit.sh - @./vendor/neofs-adm --config neofs-adm.yml morph init --alphabet-wallets ./services/ir --contracts vendor/contracts || die "Failed to initialize Alphabet wallets" @for f in ./services/storage/wallet*.json; do echo "Transfer GAS to wallet $${f}" && ./vendor/neofs-adm -c neofs-adm.yml morph refill-gas --storage-wallet $${f} --gas 10.0 --alphabet-wallets services/ir || die "Failed to transfer GAS to alphabet wallets"; done $(call error_handler,$@); - @echo "NeoFS sidechain environment is deployed" + @echo "NeoFS chain environment is deployed" .PHONY: up/testing up/testing: @@ -232,9 +231,9 @@ clean: .PHONY: env env: @$(foreach envvar,$(GREP_DOTENV),echo $(envvar);) - @echo MORPH_BLOCK_TIME=$(shell grep 'TimePerBlock' $(MORPH_CHAIN_PROTOCOL) | awk '{print $$2}') + @echo NEOFS_CHAIN_BLOCK_TIME=$(shell grep 'time_per_block' $(NEOFS_CHAIN_PROTOCOL) | awk '{print $$2}') @echo MAINNET_BLOCK_TIME=$(shell grep 'TimePerBlock' $(CHAIN_PROTOCOL) | awk '{print $$2}') - @echo MORPH_MAGIC=$(shell grep 'Magic' $(MORPH_CHAIN_PROTOCOL) | awk '{print $$2}') + @echo NEOFS_CHAIN_MAGIC=$(shell grep 'magic' $(NEOFS_CHAIN_PROTOCOL) | awk '{print $$2}') # Restart storage nodes with clean volumes .PHONY: restart.storage-clean diff --git a/README.md b/README.md index dc33cfc..de8e214 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,7 @@ password of inner ring wallet is `one`. See examples in `make help`. ``` $ make update.epoch_duration val=30 -Changing EpochDuration configration value to 30 +Changing EpochDuration configuration value to 30 Enter account NNudMSGzEoktFzdYGYoNb3bzHzbmM1genF password > Sent invocation transaction dbb8c1145b6d10f150135630e13bb0dc282023163f5956c6945a60db0cb45cb0 Updating NeoFS epoch to 2 @@ -102,7 +102,6 @@ guide](docs/macOS.md) in `docs` directory. │   ├── basenet │   ├── chain │   ├── ir -│   ├── morph_chain │   └── storage ├── vendor # Temporary files and artifacts └── wallets # Wallet files to manage GAS assets @@ -150,7 +149,9 @@ Display addresses and host names for each running service, if available. ### clean -Clean up `vendor` directory. +Clean up `vendor` directory. Remove services' Docker volumes incl: +- stored NeoFS objects +- NeoFS chain state ## How to prepare environment to run neofs-testcases @@ -167,7 +168,7 @@ From the root of the project, run: sudo ./bin/update_hosts.sh ``` This script will change the subnet address in the services/coredns/Corefile and -in the services/morph_chain/protocol.privnet.yml configuration files. +in the services/ir/cfg/config.yml configuration files. And it will add or change ip addresses in the /etc/hosts file. After running the script, make sure that the contents of these files are correct. diff --git a/bin/config.sh b/bin/config.sh index f63a49c..6ca57f8 100755 --- a/bin/config.sh +++ b/bin/config.sh @@ -34,13 +34,13 @@ else fi # Change config value in side chain -echo "Changing ${KEY} configration value to ${VALUE}" +echo "Changing ${KEY} configuration value to ${VALUE}" # shellcheck disable=SC2086 ${NEOGO} contract invokefunction \ --wallet-config ${CONFIG_IMG} \ -a ${ADDR} --force \ - -r http://morph-chain.${LOCAL_DOMAIN}:30333 \ + -r http://ir01.${LOCAL_DOMAIN}:30333 \ ${NETMAP_ADDR} \ setConfig bytes:beefcafe \ string:${KEY} \ diff --git a/bin/resolve.sh b/bin/resolve.sh index 9aba65b..74e4f8d 100755 --- a/bin/resolve.sh +++ b/bin/resolve.sh @@ -5,17 +5,17 @@ source bin/helper.sh # NeoGo binary path. -NEOGO="${NEOGO:-docker exec morph_chain neo-go}" +NEOGO="${NEOGO:-docker exec main_chain neo-go}" # NNS contract script hash output=$(curl -s --data '{ "id": 1, "jsonrpc": "2.0", "method": "getcontractstate", "params": [1] }' \ - "http://morph-chain.${LOCAL_DOMAIN}:30333/") \ + "http://ir01.${LOCAL_DOMAIN}:30333/") \ || die "Cannot fetch NNS contract state" NNS_ADDR=$(jq -r '.result.hash' <<< "$output") \ || die "Cannot parse NNS contract hash: $NNS_ADDR" ${NEOGO} contract testinvokefunction \ - -r "http://morph-chain.${LOCAL_DOMAIN}:30333" \ + -r "http://ir01.${LOCAL_DOMAIN}:30333" \ "${NNS_ADDR}" resolve string:"${1}" int:16 \ | jq -r '.stack[0].value | if type=="array" then .[0].value else . end' \ | base64 -d \ diff --git a/bin/tests/update_hosts_test.sh b/bin/tests/update_hosts_test.sh index 4480a83..c81ec22 100755 --- a/bin/tests/update_hosts_test.sh +++ b/bin/tests/update_hosts_test.sh @@ -4,22 +4,22 @@ set -e : "${TEST_HOSTS_FILE:=$(mktemp)}" : "${TEST_COREFILE:=$(mktemp)}" -: "${TEST_MORPH_CHAIN_CONFIG:=$(mktemp)}" +: "${TEST_NEOFS_CHAIN_CONFIG:=$(mktemp)}" : "${TEMP_ENV_FILE:=$(mktemp)}" : "${BASE_HOSTS_FILE:=/etc/hosts}" : "${BASE_COREFILE:=services/coredns/Corefile}" -: "${BASE_MORPH_CHAIN_CONFIG:=services/morph_chain/protocol.privnet.yml}" +: "${BASE_NEOFS_CHAIN_CONFIG:=services/ir/cfg/config.yml}" : "${BASE_ENV_FILE:=.env}" cleanup() { - rm -f "$TEST_HOSTS_FILE" "$TEST_COREFILE" "$TEST_MORPH_CHAIN_CONFIG" + rm -f "$TEST_HOSTS_FILE" "$TEST_COREFILE" "$TEST_NEOFS_CHAIN_CONFIG" cp "$TEMP_ENV_FILE" "$BASE_ENV_FILE" } run_update_hosts() { - HOSTS_FILE="$TEST_HOSTS_FILE" COREFILE="$TEST_COREFILE" MORPH_CHAIN_CONFIG="$TEST_MORPH_CHAIN_CONFIG" ./bin/update_hosts.sh > /dev/null + HOSTS_FILE="$TEST_HOSTS_FILE" COREFILE="$TEST_COREFILE" NEOFS_CHAIN_CONFIG="$TEST_NEOFS_CHAIN_CONFIG" ./bin/update_hosts.sh > /dev/null } check_test() { @@ -44,7 +44,7 @@ prepare_environment() { cleanup :>"$TEST_HOSTS_FILE" :>"$TEST_COREFILE" - :>"$TEST_MORPH_CHAIN_CONFIG" + :>"$TEST_NEOFS_CHAIN_CONFIG" sed -i 's/^IPV4_PREFIX=192\.168\.130/IPV4_PREFIX=192\.168\.100/' "$BASE_ENV_FILE" } @@ -65,7 +65,7 @@ empty_file_test() { out="" check_test "$out" "$empty_output" "$test_name corefile" - empty_output=$(cat "$TEST_MORPH_CHAIN_CONFIG") + empty_output=$(cat "$TEST_NEOFS_CHAIN_CONFIG") out="" check_test "$out" "$empty_output" "$test_name config" } @@ -91,16 +91,16 @@ update_entries_in_hosts_test() { echo "Running update entries in $BASE_HOSTS_FILE tests..." prepare_environment - echo "192.168.130.90 morph-chain.neofs.devenv + echo "192.168.100.61 ir01.neofs.devenv 127.0.0.1 localhost" > "$TEST_HOSTS_FILE" run_update_hosts - expected_output="192.168.100.90 morph-chain.neofs.devenv + expected_output="192.168.100.61 ir01.neofs.devenv 127.0.0.1 localhost 192.168.100.10 bastion.neofs.devenv 192.168.100.50 main-chain.neofs.devenv 192.168.100.53 coredns.neofs.devenv 192.168.100.81 http.neofs.devenv -192.168.100.61 ir01.neofs.devenv +192.168.100.102 k6_node.neofs.devenv 192.168.100.101 nats.neofs.devenv 192.168.100.83 rest.neofs.devenv 192.168.100.82 s3.neofs.devenv @@ -119,7 +119,6 @@ echo "127.0.0.1 localhost 192.168.130.53 coredns.neofs.devenv 192.168.130.81 http.neofs.devenv 192.168.130.61 ir01.neofs.devenv -192.168.130.90 morph-chain.neofs.devenv 192.168.130.101 nats.neofs.devenv 192.168.130.83 rest.neofs.devenv 192.168.130.82 s3.neofs.devenv @@ -135,7 +134,6 @@ echo "127.0.0.1 localhost 192.168.100.53 coredns.neofs.devenv 192.168.100.81 http.neofs.devenv 192.168.100.61 ir01.neofs.devenv -192.168.100.90 morph-chain.neofs.devenv 192.168.100.101 nats.neofs.devenv 192.168.100.83 rest.neofs.devenv 192.168.100.82 s3.neofs.devenv @@ -143,7 +141,8 @@ echo "127.0.0.1 localhost 192.168.100.71 s01.neofs.devenv 192.168.100.72 s02.neofs.devenv 192.168.100.73 s03.neofs.devenv -192.168.100.74 s04.neofs.devenv" +192.168.100.74 s04.neofs.devenv +192.168.100.102 k6_node.neofs.devenv" update_hosts_output=$(cat "$TEST_HOSTS_FILE") check_test "$expected_output" "$update_hosts_output" "update all entries in $BASE_HOSTS_FILE" @@ -155,7 +154,7 @@ update_corefile_test() { echo "Running update $BASE_COREFILE file test..." prepare_environment echo ". { - nns http://192.168.130.90:30333 + nns http://192.168.130.61:30333 transfer { to * } @@ -164,7 +163,7 @@ update_corefile_test() { }" > "$TEST_COREFILE" run_update_hosts expected_output=". { - nns http://192.168.100.90:30333 + nns http://192.168.100.61:30333 transfer { to * } @@ -178,7 +177,7 @@ update_corefile_test() { update_configfile_test() { local expected_output local update_output - echo "Running update $BASE_MORPH_CHAIN_CONFIG file test..." + echo "Running update $BASE_NEOFS_CHAIN_CONFIG file test..." prepare_environment echo "P2P: Addresses: @@ -186,7 +185,7 @@ update_configfile_test() { RPC: Addresses: - - \"192.168.130.90:30333\" + - \"192.168.130.61:30333\" Prometheus: Addresses: @@ -194,7 +193,7 @@ update_configfile_test() { Pprof: Addresses: - - \":20011\"" > "$TEST_MORPH_CHAIN_CONFIG" + - \":20011\"" > "$TEST_NEOFS_CHAIN_CONFIG" run_update_hosts expected_output="P2P: Addresses: @@ -202,7 +201,7 @@ update_configfile_test() { RPC: Addresses: - - \"192.168.100.90:30333\" + - \"192.168.130.61:30333\" Prometheus: Addresses: @@ -211,8 +210,8 @@ update_configfile_test() { Pprof: Addresses: - \":20011\"" - update_output=$(cat "$TEST_MORPH_CHAIN_CONFIG") - check_test "$expected_output" "$update_output" "update $BASE_MORPH_CHAIN_CONFIG file" + update_output=$(cat "$TEST_NEOFS_CHAIN_CONFIG") + check_test "$expected_output" "$update_output" "update $BASE_NEOFS_CHAIN_CONFIG file" } cp "$BASE_ENV_FILE" "$TEMP_ENV_FILE" diff --git a/bin/tick.sh b/bin/tick.sh index 2ec509e..7599f1b 100755 --- a/bin/tick.sh +++ b/bin/tick.sh @@ -21,15 +21,15 @@ else ADDR=$(jq -r .accounts[0].address < "${WALLET}" || die "Cannot get address from ${WALLET}") fi -# Grep Morph block time -SIDECHAIN_PROTO="${SIDECHAIN_PROTO:-services/morph_chain/protocol.privnet.yml}" -BLOCK_DURATION=$(grep TimePerBlock < "$SIDECHAIN_PROTO" | awk '{print $2}') \ +# Grep NeoFS chain block time +NEOFS_CHAIN_PROTO="${NEOFS_CHAIN_PROTO:-services/ir/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" # Fetch current epoch value EPOCH=$(${NEOGO} contract testinvokefunction \ - -r "http://morph-chain.${LOCAL_DOMAIN}:30333" "${NETMAP_ADDR}" epoch \ + -r "http://ir01.${LOCAL_DOMAIN}:30333" "${NETMAP_ADDR}" epoch \ | grep 'value' | awk -F'"' '{ print $4 }') \ || die "Cannot fetch epoch from netmap contract" @@ -39,11 +39,11 @@ echo "Updating NeoFS epoch to $((EPOCH+1))" ${NEOGO} contract invokefunction \ --wallet-config ${CONFIG_IMG} \ -a ${ADDR} --force \ - -r http://morph-chain.${LOCAL_DOMAIN}:30333 \ + -r http://ir01.${LOCAL_DOMAIN}:30333 \ ${NETMAP_ADDR} \ newEpoch int:$((EPOCH+1)) -- ${ADDR}:Global \ || die "Cannot increment an epoch" -# Wait one Morph block to ensure the transaction broadcasted +# Wait one NeoFS chain block to ensure the transaction broadcasted # shellcheck disable=SC2086 sleep $BLOCK_DURATION diff --git a/bin/update_hosts.sh b/bin/update_hosts.sh index 4909b4e..7ace0c7 100755 --- a/bin/update_hosts.sh +++ b/bin/update_hosts.sh @@ -3,28 +3,29 @@ set -e : "${HOSTS_FILE:=/etc/hosts}" : "${COREFILE:=services/coredns/Corefile}" -: "${MORPH_CHAIN_CONFIG:=services/morph_chain/protocol.privnet.yml}" +: "${NEOFS_CHAIN_CONFIG:=services/ir/cfg/config.yml}" temp_file=$(mktemp) # Get default hosts make hosts > "$temp_file" -# Get the morph-chain IP address from the $COREFILE file -morph_chain_ip=$(grep "morph-chain.neofs.devenv" "$temp_file" | awk '{print $1}') +# Get the NeoFS chain IP address from the $COREFILE file +neofs_chain_ip=$(grep "ir01.neofs.devenv" "$temp_file" | awk '{print $1}') # Replace the IP address in the $COREFILE file -sed -i -E "s/(nns[[:space:]]*http\:\/\/)([0-9]{1,3}[.]){3}[0-9]{1,3}(:30333)/\1$morph_chain_ip\3/" "$COREFILE" +sed -i -E "s/(nns[[:space:]]*http\:\/\/)([0-9]{1,3}[.]){3}[0-9]{1,3}(:30333)/\1$neofs_chain_ip\3/" "$COREFILE" # Get the line numbers of "Addresses:" -addresses_lines=$(grep -n "Addresses:" "$MORPH_CHAIN_CONFIG" | cut -d ':' -f 1) +# FIXME(#302): grep by 'listen:' is unstable, jump to exact YAML fields +addresses_lines=$(grep -n "listen:" "$NEOFS_CHAIN_CONFIG" | cut -d ':' -f 1) # Loop through each line number with "Addresses:" for addresses_line in $addresses_lines; do # Increment the line number to find the line with the IP and port target_line=$((addresses_line + 1)) - # Replace the IP address in the target line in the MORPH_CHAIN_CONFIG file - sed -i "${target_line}s/\([0-9]\{1,3\}\.\)\{3\}[0-9]\{1,3\}/$morph_chain_ip/" "$MORPH_CHAIN_CONFIG" + # Replace the IP address in the target line in the NEOFS_CHAIN_CONFIG file + sed -i "${target_line}s/\([0-9]\{1,3\}\.\)\{3\}[0-9]\{1,3\}/$neofs_chain_ip/" "$NEOFS_CHAIN_CONFIG" done while IFS=" " read -r ip domain; do diff --git a/docs/ir.md b/docs/ir.md index 28313f0..798e0b2 100644 --- a/docs/ir.md +++ b/docs/ir.md @@ -2,8 +2,14 @@ NeoFS Inner Ring (Alphabet) node. According to governance scheme, Inner Ring should contain Alphabet nodes that share key with one of side chain consensus -nodes. In basic setup there is a single consensus node and single Inner Ring -(Alphabet) node. +nodes. In basic setup there is a single Inner Ring (Alphabet) node running +consensus node internally. + +Deployed contracts: +- [executables](https://github.com/nspcc-dev/neofs-node/tree/v0.39.1/contracts). +- [source code](https://github.com/nspcc-dev/neofs-contract/tree/v0.19.1) + +N3 RPC service is served on `http://ir01.neofs.devenv:30333`. ## .env settings @@ -17,3 +23,38 @@ pulling from DockerHub, the local image will be used. ### IR_IMAGE=nspccdev/neofs-ir Image label prefix to use for Inner Ring docker containers. + +## NeoFS global config + +NeoFS uses global configuration to store epoch duration, maximum object size, +container fee and other network parameters. Global configuration is recorded in +NeoFS chain and managed by Inner Ring (Alphabet) nodes. + +To change these parameters use `make update.*` commands. Command down below +changes epoch duration from 300 blocks (about 300 seconds with 1bps) to 30. +Script enters passwords automatically with `expect` utility. + +``` +$ make update.epoch_duration val=30 +Changing EpochDuration configuration value to 30 +Enter account NfgHwwTi3wHAS8aFAN243C5vGbkYDpqLHP password > +Sent invocation transaction bdc0fa88cd6719ef6df2b9c82de423ddec6141ca24255c2d0072688083b1de9d +Updating NeoFS epoch to 20 +Enter account NfgHwwTi3wHAS8aFAN243C5vGbkYDpqLHP password > +Sent invocation transaction 12296e1ce24dd6c04edb9c56d0a1d0e26d3226adefb0333c74a28788f44a8d0f +``` + +Read more about available configuration in Makefile help. + +``` +$ make help +... +Targets: +... +update.audit_fee Update audit fee per result in fixed 12 (make update.audit_fee val=100) +update.basic_income_rate Update basic income rate in fixed 12 (make update.basic_income_rate val=1000) +update.container_fee Update container fee per alphabet node in fixed 12 (make update.container_fee val=500) +update.eigen_trust_iterations Update amount of EigenTrust iterations (make update.eigen_trust_iterations val=2) +update.epoch_duration Update epoch duration in side chain blocks (make update.epoch_duration val=30) +update.max_object_size Update max object size in bytes (make update.max_object_size val=1000) +``` diff --git a/docs/morph.md b/docs/morph.md deleted file mode 100644 index b2a0a11..0000000 --- a/docs/morph.md +++ /dev/null @@ -1,77 +0,0 @@ -# N3 NeoFS side chain privnet service -A single-node N3 privnet deployment, running on -[neo-go](https://github.com/nspcc-dev/neo-go). Represents N3 NeoFS SideChain. - -Contracts deployed: -- Alphabet (AZ) [contract](https://github.com/nspcc-dev/neofs-contract/tree/master/alphabet) -- Audit [contract](https://github.com/nspcc-dev/neofs-contract/tree/master/audit) -- Balance [contract](https://github.com/nspcc-dev/neofs-contract/tree/master/balance) -- Container [contract](https://github.com/nspcc-dev/neofs-contract/tree/master/container) -- Netmap [contract](https://github.com/nspcc-dev/neofs-contract/tree/master/netmap) -- NeoFSID [contract](https://github.com/nspcc-dev/neofs-contract/tree/master/neofsid) -- Proxy [contract](https://github.com/nspcc-dev/neofs-contract/tree/master/proxy) -- Reputation [contract](https://github.com/nspcc-dev/neofs-contract/tree/master/reputation) - -RPC available at `http://morph-chain.neofs.devenv:30333`. - -## .env settings - -### NEOGO_VERSION - -Version of neo-go docker container for side chain deployment. - -## Side chain wallets - -There is a wallet with GAS that used for contract deployment: -`wallets/wallet.json`. This wallet has one account with **empty password**. - -``` -$ neo-go wallet nep17 balance \ - -w wallets/wallet.json \ - -r http://morph-chain.neofs.devenv:30333 - -Account NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM -GAS: GasToken (d2a4cff31913016155e38e474a2c06d08be276cf) - Amount : 189826.0515316 - Updated: 3909 -NEOFS: NeoFS Balance (69550190e740b93f92dbd5dea52246f550391057) - Amount : 50 - Updated: 3909 -``` - -This way you can also monitor NeoFS internal balance of your account. - -## NeoFS global config - -NeoFS uses global configuration to store epoch duration, maximum object size, -container fee and other network parameters. Global configuration is stored in -netmap contract and managed by Inner Ring (Alphabet) nodes. - -To change these parameters use `make update.*` commands. Command down below -changes epoch duration from 300 blocks (about 300 seconds with 1bps) to 30. -Script enters passwords automatically with `expect` utility. - -``` -$ make update.epoch_duration val=30 -Changing EpochDuration configration value to 30 -Enter account NfgHwwTi3wHAS8aFAN243C5vGbkYDpqLHP password > -Sent invocation transaction bdc0fa88cd6719ef6df2b9c82de423ddec6141ca24255c2d0072688083b1de9d -Updating NeoFS epoch to 20 -Enter account NfgHwwTi3wHAS8aFAN243C5vGbkYDpqLHP password > -Sent invocation transaction 12296e1ce24dd6c04edb9c56d0a1d0e26d3226adefb0333c74a28788f44a8d0f -``` - -Read more about available configuration in Makefile help. - -``` -$ make help - ... - Targets: - ... - update.audit_fee Update audit fee per result in fixed 12 (make update.audit_fee val=100) - update.basic_income_rate Update basic income rate in fixed 12 (make update.basic_income_rate val=1000) - update.container_fee Update container fee per alphabet node in fixed 12 (make update.container_fee val=500) - update.eigen_trust_iterations Update amount of EigenTrust iterations (make update.eigen_trust_iterations val=2) - update.epoch_duration Update epoch duration in side chain blocks (make update.epoch_duration val=30) - update.max_object_size Update max object size in bytes (make update.max_object_size val=1000) -``` diff --git a/neofs-adm.yml b/neofs-adm.yml index dc10a6e..117e228 100644 --- a/neofs-adm.yml +++ b/neofs-adm.yml @@ -1,15 +1,4 @@ -rpc-endpoint: http://morph-chain.neofs.devenv:30333 -network: - max_object_size: 67108864 - epoch_duration: 240 - basic_income_rate: 100000000 - homomorphic_hash_disabled: false - fee: - audit: 10000 - candidate: 10000000000 - container: 1000 - container_alias: 500 - withdraw: 100000000 +rpc-endpoint: http://ir01.neofs.devenv:30333 credentials: az: "one" contract: "one" diff --git a/services/chain/docker-compose.yml b/services/chain/docker-compose.yml index 3fe1698..bf3a145 100644 --- a/services/chain/docker-compose.yml +++ b/services/chain/docker-compose.yml @@ -6,6 +6,12 @@ services: image: ${NEOGO_IMAGE}:${NEOGO_VERSION} container_name: main_chain command: ["node", "--config-path", "/config", "--privnet", "--debug"] + healthcheck: + test: [ "CMD", "/neo-go", "query", "height", "-r", "http://localhost:30333" ] + interval: 5s + timeout: 1s + retries: 5 + start_period: 5s domainname: ${LOCAL_DOMAIN} hostname: main-chain networks: @@ -23,6 +29,14 @@ services: - ./config.yml:/wallets/config.yml - ./../../vendor/hosts:/etc/hosts - ./../../wallets/wallet.json:/wallets/wallet.json + - ./../../vendor/neo-go:/neo-go + + main-chain-healthcheck: + container_name: main-chain-healthcheck + image: debian:10 + depends_on: + neofs_main_chain: + condition: service_healthy networks: chain_int: diff --git a/services/ir/artifacts.mk b/services/ir/artifacts.mk index e555f20..5404338 100644 --- a/services/ir/artifacts.mk +++ b/services/ir/artifacts.mk @@ -1,26 +1,6 @@ -# Get NeoFS IR artifacts (LOCODE database and NeoFS CLI) +# Get NeoFS IR artifacts (NeoFS contracts, ADM and CLI) -LOCODE_DB_ARCHIVE_PATH=./vendor -LOCODE_DB_ARCHIVE_FILE=locode_db.gz - -get.ir: get.locode get.cli get.storage prepare.storage - -# Get NeoFS LOCODE database -get.locode: LOCODE_DB_PATH?= -get.locode: - @mkdir -p ${LOCODE_DB_ARCHIVE_PATH} - -ifeq (${LOCODE_DB_PATH},) - @echo "⇒ Download NeoFS LOCODE database from ${LOCODE_DB_URL}" - @curl \ - -sSL "${LOCODE_DB_URL}" \ - -o ${LOCODE_DB_ARCHIVE_PATH}/${LOCODE_DB_ARCHIVE_FILE} -else - @echo "⇒ Copy local archive of NeoFS LOCODE database from ${LOCODE_DB_PATH}" - @cp ${LOCODE_DB_PATH} ${LOCODE_DB_ARCHIVE_PATH}/${LOCODE_DB_ARCHIVE_FILE} -endif - - gzip -dfk ${LOCODE_DB_ARCHIVE_PATH}/${LOCODE_DB_ARCHIVE_FILE} +get.ir: get.cli get.contracts get.adm get.storage prepare.storage # Download NeoFS CLI .ONESHELL: @@ -43,3 +23,36 @@ else @echo "⇒ Copy local binary from ${NEOFS_CLI_PATH}" @cp ${NEOFS_CLI_PATH} ${NEOFS_CLI_FILE} endif + +# Download NeoFS Contracts +get.contracts: NEOFS_CONTRACTS_DEST=./vendor/contracts +get.contracts: NEOFS_CONTRACTS_ARCHIVE=neofs-contracts.tar.gz +get.contracts: + @mkdir -p ${NEOFS_CONTRACTS_DEST} + +# TODO(#303): pull only NeoFS contract, others are not needed +ifeq (${NEOFS_CONTRACTS_PATH},) + @echo "⇒ Download compiled NeoFS contracts from ${NEOFS_CONTRACTS_URL}" + @curl -sSL ${NEOFS_CONTRACTS_URL} -o ${NEOFS_CONTRACTS_ARCHIVE} + @tar -xf ${NEOFS_CONTRACTS_ARCHIVE} -C ${NEOFS_CONTRACTS_DEST} --strip-components 1 + @rm ${NEOFS_CONTRACTS_ARCHIVE} +else + @echo "⇒ Copy compiled contracts from ${NEOFS_CONTRACTS_PATH}" + @cp -r ${NEOFS_CONTRACTS_PATH}/* ${NEOFS_CONTRACTS_DEST} +endif + +# Download NeoFS ADM tool +get.adm: NEOFS_ADM_DEST=./vendor/neofs-adm +get.adm: NEOFS_ADM_ARCHIVE=neofs-adm.tar.gz +get.adm: + +ifeq (${NEOFS_ADM_PATH},) + @echo "⇒ Download NeoFS ADM binary from ${NEOFS_ADM_URL}" + @curl -sSL ${NEOFS_ADM_URL} -o ${NEOFS_ADM_ARCHIVE} + @tar -xvf ${NEOFS_ADM_ARCHIVE} -C ./vendor | xargs -I {} \ + mv ./vendor/{} ${NEOFS_ADM_DEST} + @rm ${NEOFS_ADM_ARCHIVE} +else + @echo "⇒ Copy neofs-adm binary from ${NEOFS_ADM_PATH}" + @cp ${NEOFS_ADM_PATH} ${NEOFS_ADM_DEST} +endif diff --git a/services/ir/az.json b/services/ir/az.json deleted file mode 120000 index 94cd553..0000000 --- a/services/ir/az.json +++ /dev/null @@ -1 +0,0 @@ -../morph_chain/node-wallet.json \ No newline at end of file diff --git a/services/ir/az.json b/services/ir/az.json new file mode 100644 index 0000000..025a2ea --- /dev/null +++ b/services/ir/az.json @@ -0,0 +1,68 @@ +{ + "version": "3.0", + "name": null, + "accounts": [ + { + "address": "Nhfg3TbpwogLvDGVvAvqyThbsHgoSUKwtn", + "key": "6PYM8VdX2BSm7BSXKzV4Fz6S3R9cDLLWNrD9nMjxW352jEv3fsC8N3wNLY", + "label": "single", + "contract": { + "script": "DCECs2Ir9AF73+MXxYrtX0x1PyBrfbiWBG+n13S7xL9/jcJBVuezJw==", + "parameters": [ + { + "name": "parameter0", + "type": "Signature" + } + ], + "deployed": false + }, + "lock": false, + "extra": null, + "isDefault": false + }, + { + "address": "NfgHwwTi3wHAS8aFAN243C5vGbkYDpqLHP", + "key": "6PYM8VdX2BSm7BSXKzV4Fz6S3R9cDLLWNrD9nMjxW352jEv3fsC8N3wNLY", + "label": "consensus", + "contract": { + "script": "EQwhArNiK/QBe9/jF8WK7V9MdT8ga324lgRvp9d0u8S/f43CEUGe0Nw6", + "parameters": [ + { + "name": "parameter0", + "type": "Signature" + } + ], + "deployed": false + }, + "lock": false, + "extra": null, + "isDefault": false + }, + { + "address": "NfgHwwTi3wHAS8aFAN243C5vGbkYDpqLHP", + "key": "6PYM8VdX2BSm7BSXKzV4Fz6S3R9cDLLWNrD9nMjxW352jEv3fsC8N3wNLY", + "label": "committee", + "contract": { + "script": "EQwhArNiK/QBe9/jF8WK7V9MdT8ga324lgRvp9d0u8S/f43CEUGe0Nw6", + "parameters": [ + { + "name": "parameter0", + "type": "Signature" + } + ], + "deployed": false + }, + "lock": false, + "extra": null, + "isDefault": true + } + ], + "scrypt": { + "n": 16384, + "r": 8, + "p": 8 + }, + "extra": { + "Tokens": null + } +} diff --git a/services/ir/cfg/config.yml b/services/ir/cfg/config.yml index 8bbc520..bf602ad 100644 --- a/services/ir/cfg/config.yml +++ b/services/ir/cfg/config.yml @@ -28,12 +28,39 @@ mainnet: endpoints: # List of websocket RPC endpoints in mainchain; ignore if mainchain is disabled - ws://main-chain:30333/ws -# Neo side chain RPC settings +# NeoFS chain RPC settings morph: - endpoints: # List of websocket RPC endpoints in sidechain - - ws://morph-chain:30333/ws validators: # List of hex-encoded 33-byte public keys of sidechain validators to vote for at application startup - 02b3622bf4017bdfe317c58aed5f4c753f206b7db896046fa7d774bbc4bf7f8dc2 + consensus: + magic: 15405 + committee: + - 02b3622bf4017bdfe317c58aed5f4c753f206b7db896046fa7d774bbc4bf7f8dc2 + storage: + type: boltdb + path: /neofs_chain/db.bolt + time_per_block: 1s + max_traceable_blocks: 200000 + seed_nodes: + - :20333 + rpc: + listen: + - ":30333" + p2p: + dial_timeout: 3s + proto_tick_interval: + listen: + - ":20333" + peers: + min: 0 + max: 10 + attempts: 5 + ping: + interval: 30s + timeout: 90s + set_roles_in_genesis: true + +fschain_autodeploy: true # Network time settings timers: @@ -67,8 +94,3 @@ audit: settlement: basic_income_rate: 100000000 # Optional: override basic income rate value from network config; applied only in debug mode audit_fee: 100000 # Optional: override audit fee value from network config; applied only in debug mode - -# LOCODE database -locode: - db: - path: /locode/db # Path to UN/LOCODE database file diff --git a/services/ir/docker-compose.yml b/services/ir/docker-compose.yml index a48bb19..62b9fbc 100644 --- a/services/ir/docker-compose.yml +++ b/services/ir/docker-compose.yml @@ -15,9 +15,9 @@ services: ipv4_address: ${IPV4_PREFIX}.61 stop_signal: SIGKILL volumes: + - neofs_chain_ir01:/neofs_chain/ - ./az.json:/wallet.json - ./../../vendor/hosts:/etc/hosts - - ./../../vendor/locode_db:/locode/db - ./../../vendor/neofs-cli:/neofs-cli - ./cli-cfg.yml:/cli-cfg.yml - ./cfg:/etc/neofs/ir @@ -26,10 +26,10 @@ services: 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"] - interval: 2s + interval: 20s timeout: 1s retries: 5 - start_period: 20s + start_period: 5s ir-healthcheck: container_name: ir-healthcheck @@ -43,3 +43,6 @@ networks: internet: external: true name: basenet_internet + +volumes: + neofs_chain_ir01: diff --git a/services/k6_node/Dockerfile b/services/k6_node/Dockerfile index 876caa3..ef6709f 100644 --- a/services/k6_node/Dockerfile +++ b/services/k6_node/Dockerfile @@ -15,5 +15,5 @@ RUN git clone https://github.com/nspcc-dev/xk6-neofs.git RUN cd xk6-neofs && xk6 build --with github.com/nspcc-dev/xk6-neofs=. # Download neofs-cli -RUN wget https://github.com/nspcc-dev/neofs-node/releases/download/v0.38.0/neofs-cli-amd64 -O /usr/local/bin/neofs-cli +RUN wget https://github.com/nspcc-dev/neofs-node/releases/download/v0.39.1/neofs-cli-amd64 -O /usr/local/bin/neofs-cli RUN chmod +x /usr/local/bin/neofs-cli diff --git a/services/morph_chain/.env b/services/morph_chain/.env deleted file mode 120000 index c7360fb..0000000 --- a/services/morph_chain/.env +++ /dev/null @@ -1 +0,0 @@ -../../.env \ No newline at end of file diff --git a/services/morph_chain/.hosts b/services/morph_chain/.hosts deleted file mode 100644 index b2ffc31..0000000 --- a/services/morph_chain/.hosts +++ /dev/null @@ -1 +0,0 @@ -IPV4_PREFIX.90 morph-chain.LOCAL_DOMAIN diff --git a/services/morph_chain/.int_test.env b/services/morph_chain/.int_test.env deleted file mode 120000 index 582b6a2..0000000 --- a/services/morph_chain/.int_test.env +++ /dev/null @@ -1 +0,0 @@ -../../.int_test.env \ No newline at end of file diff --git a/services/morph_chain/artifacts.mk b/services/morph_chain/artifacts.mk deleted file mode 100644 index be6febf..0000000 --- a/services/morph_chain/artifacts.mk +++ /dev/null @@ -1,35 +0,0 @@ -# Download NeoFS Contracts and Adm tool to deploy environment - -get.morph_chain: get.contracts get.adm - -# Download NeoFS Contracts -get.contracts: NEOFS_CONTRACTS_DEST=./vendor/contracts -get.contracts: NEOFS_CONTRACTS_ARCHIVE=neofs-contracts.tar.gz -get.contracts: - @mkdir -p ${NEOFS_CONTRACTS_DEST} - -ifeq (${NEOFS_CONTRACTS_PATH},) - @echo "⇒ Download compiled NeoFS contracts from ${NEOFS_CONTRACTS_URL}" - @curl -sSL ${NEOFS_CONTRACTS_URL} -o ${NEOFS_CONTRACTS_ARCHIVE} - @tar -xf ${NEOFS_CONTRACTS_ARCHIVE} -C ${NEOFS_CONTRACTS_DEST} --strip-components 1 - @rm ${NEOFS_CONTRACTS_ARCHIVE} -else - @echo "⇒ Copy compiled contracts from ${NEOFS_CONTRACTS_PATH}" - @cp -r ${NEOFS_CONTRACTS_PATH}/* ${NEOFS_CONTRACTS_DEST} -endif - -# Download NeoFS ADM tool -get.adm: NEOFS_ADM_DEST=./vendor/neofs-adm -get.adm: NEOFS_ADM_ARCHIVE=neofs-adm.tar.gz -get.adm: - -ifeq (${NEOFS_ADM_PATH},) - @echo "⇒ Download NeoFS ADM binary from ${NEOFS_ADM_URL}" - @curl -sSL ${NEOFS_ADM_URL} -o ${NEOFS_ADM_ARCHIVE} - @tar -xvf ${NEOFS_ADM_ARCHIVE} -C ./vendor | xargs -I {} \ - mv ./vendor/{} ${NEOFS_ADM_DEST} - @rm ${NEOFS_ADM_ARCHIVE} -else - @echo "⇒ Copy neofs-adm binary from ${NEOFS_ADM_PATH}" - @cp ${NEOFS_ADM_PATH} ${NEOFS_ADM_DEST} -endif diff --git a/services/morph_chain/docker-compose.yml b/services/morph_chain/docker-compose.yml deleted file mode 100644 index a4cebf4..0000000 --- a/services/morph_chain/docker-compose.yml +++ /dev/null @@ -1,27 +0,0 @@ ---- - -version: "2.4" -services: - neofs_morph_chain: - image: ${NEOGO_IMAGE}:${NEOGO_VERSION} - container_name: morph_chain - command: ["node", "--config-path", "/config", "--privnet", "--debug"] - domainname: ${LOCAL_DOMAIN} - hostname: morph-chain - networks: - chain_int: - internet: - ipv4_address: ${IPV4_PREFIX}.90 - stop_signal: SIGKILL - env_file: [ ".int_test.env" ] - volumes: - - ./protocol.privnet.yml:/config/protocol.privnet.yml - - ./node-wallet.json:/wallets/node-wallet.json - - ./../../vendor/hosts:/etc/hosts - - ./../../wallets/wallet.json:/wallets/wallet.json - -networks: - chain_int: - internet: - external: true - name: basenet_internet diff --git a/services/morph_chain/node-wallet.json b/services/morph_chain/node-wallet.json deleted file mode 100644 index 8e88b43..0000000 --- a/services/morph_chain/node-wallet.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "version": "3.0", - "name":null, - "accounts": [ - { - "address": "Nhfg3TbpwogLvDGVvAvqyThbsHgoSUKwtn", - "key": "6PYM8VdX2BSm7BSXKzV4Fz6S3R9cDLLWNrD9nMjxW352jEv3fsC8N3wNLY", - "label": "single", - "contract": { - "script": "DCECs2Ir9AF73+MXxYrtX0x1PyBrfbiWBG+n13S7xL9/jcJBVuezJw==", - "parameters": [ - { - "name": "parameter0", - "type": "Signature" - } - ], - "deployed": false - }, - "lock": false, - "extra":null, - "isDefault": false - }, - { - "address": "NfgHwwTi3wHAS8aFAN243C5vGbkYDpqLHP", - "key": "6PYM8VdX2BSm7BSXKzV4Fz6S3R9cDLLWNrD9nMjxW352jEv3fsC8N3wNLY", - "label": "consensus", - "contract": { - "script": "EQwhArNiK/QBe9/jF8WK7V9MdT8ga324lgRvp9d0u8S/f43CEUGe0Nw6", - "parameters": [ - { - "name": "parameter0", - "type": "Signature" - } - ], - "deployed": false - }, - "lock": false, - "extra":null, - "isDefault": false - }, - { - "address": "NfgHwwTi3wHAS8aFAN243C5vGbkYDpqLHP", - "key": "6PYM8VdX2BSm7BSXKzV4Fz6S3R9cDLLWNrD9nMjxW352jEv3fsC8N3wNLY", - "label": "committee", - "contract": { - "script": "EQwhArNiK/QBe9/jF8WK7V9MdT8ga324lgRvp9d0u8S/f43CEUGe0Nw6", - "parameters": [ - { - "name": "parameter0", - "type": "Signature" - } - ], - "deployed": false - }, - "lock": false, - "extra":null, - "isDefault": true - } - ], - "scrypt": { - "n": 16384, - "r": 8, - "p": 8 - }, - "extra": { - "Tokens": null - } -} diff --git a/services/morph_chain/protocol.privnet.yml b/services/morph_chain/protocol.privnet.yml deleted file mode 100644 index 2273f54..0000000 --- a/services/morph_chain/protocol.privnet.yml +++ /dev/null @@ -1,56 +0,0 @@ -ProtocolConfiguration: - Magic: 15405 - MaxTraceableBlocks: 200000 - TimePerBlock: 1s - MemPoolSize: 50000 - StandbyCommittee: - - 02b3622bf4017bdfe317c58aed5f4c753f206b7db896046fa7d774bbc4bf7f8dc2 - ValidatorsCount: 1 - SeedList: - - 172.200.0.1:20333 - VerifyTransactions: true - StateRootInHeader: true - P2PSigExtensions: true - -ApplicationConfiguration: - SkipBlockVerification: false - DBConfiguration: - Type: "boltdb" - BoltDBOptions: - FilePath: "./db/morph.bolt" - P2P: - Addresses: - - ":20333" - DialTimeout: 3s - ProtoTickInterval: 2s - PingInterval: 30s - PingTimeout: 90s - MaxPeers: 10 - AttemptConnPeers: 5 - MinPeers: 0 - Relay: true - RPC: - Addresses: - - "192.168.130.90:30333" - Enabled: true - SessionEnabled: true - EnableCORSWorkaround: false - MaxGasInvoke: 100 - P2PNotary: - Enabled: true - UnlockWallet: - Path: "./wallets/node-wallet.json" - Password: "one" - Prometheus: - Addresses: - - ":20001" - Enabled: true - Pprof: - Addresses: - - ":20011" - Enabled: true - Consensus: - Enabled: true - UnlockWallet: - Path: "./wallets/node-wallet.json" - Password: "one" diff --git a/services/s3_gate/cfg/config.yml b/services/s3_gate/cfg/config.yml index ddf90d2..fe2b78e 100644 --- a/services/s3_gate/cfg/config.yml +++ b/services/s3_gate/cfg/config.yml @@ -29,4 +29,4 @@ wallet: passphrase: "s3" # Passphrase to decrypt wallet # RPC endpoint -rpc_endpoint: http://morph-chain.neofs.devenv:30333 +rpc_endpoint: http://ir01.neofs.devenv:30333 diff --git a/services/storage/cfg/config.yml b/services/storage/cfg/config.yml index dbef6d0..73436b8 100644 --- a/services/storage/cfg/config.yml +++ b/services/storage/cfg/config.yml @@ -14,11 +14,11 @@ prometheus: address: :9090 # Server address shutdown_timeout: 15s # Timeout for metrics HTTP server graceful shutdown -# Morph section +# NeoFS chain section morph: dial_timeout: 30s # Timeout for side chain NEO RPC client connection endpoints: # Side chain NEO RPC endpoints - - ws://morph-chain:30333/ws + - ws://ir01.neofs.devenv:30333/ws # Common storage node settings node: