diff --git a/config/testnet/README.md b/config/testnet/README.md index 4981ff15c..16892cdc9 100644 --- a/config/testnet/README.md +++ b/config/testnet/README.md @@ -6,7 +6,7 @@ docker image and run it with docker-compose. ## Build image -Prepared neofs-storage-testnet image is available at Docker Hub. +Prepared **neofs-storage-testnet** image is available at Docker Hub. However, if you need to rebuild it for some reason, run `make image-storage-testnet` command. @@ -49,23 +49,21 @@ neo-go wallet nep17 transfer -w wallet.json -r https://rpc1.n3.nspcc.ru:20331 \ ### Configure -Then configure docker-compose.yml file. Change endpoints values. Both +Then configure `node_config.env` file. Change endpoints values. Both should contain your **public** IP. -```yaml - environment: - - NEOFS_NODE_ADDRESS=65.52.183.157:36512 - - NEOFS_GRPC_ENDPOINT=65.52.183.157:36512 +``` +NEOFS_NODE_ADDRESS=65.52.183.157:36512 +NEOFS_GRPC_ENDPOINT=65.52.183.157:36512 ``` Set up your [UN/LOCODE](https://unece.org/trade/cefact/unlocode-code-list-country-and-territory) attribute. -```yaml - environment: - - NEOFS_NODE_ADDRESS=65.52.183.157:36512 - - NEOFS_GRPC_ENDPOINT=65.52.183.157:36512 - - NEOFS_NODE_ATTRIBUTE_1=UN-LOCODE:RU LED +``` +NEOFS_NODE_ADDRESS=65.52.183.157:36512 +NEOFS_GRPC_ENDPOINT=65.52.183.157:36512 +NEOFS_NODE_ATTRIBUTE_1=UN-LOCODE:RU LED ``` You can validate UN/LOCODE attribute in @@ -98,7 +96,7 @@ ScriptHash3.0BE dc4b0b44d01c16667880062e2fd4508f9939fedf $ echo '11ab917cd99170cb8d0d48e78fca317564e6b3aaff7f7058952d6175cdca0f56' | xxd -r -p > my_wallet.key ``` -Then specify path to this file in docker-compose +Then specify path to this file in `docker-compose.yml` ```yaml volumes: - neofs_storage:/storage @@ -128,4 +126,4 @@ log, setup log level to debug with this env: ```yaml environment: - NEOFS_LOGGER_LEVEL=debug -``` \ No newline at end of file +``` diff --git a/config/testnet/docker-compose.yml b/config/testnet/docker-compose.yml index eb247c506..b3af5f6f1 100644 --- a/config/testnet/docker-compose.yml +++ b/config/testnet/docker-compose.yml @@ -5,26 +5,23 @@ services: storage01: image: nspccdev/neofs-storage-testnet:0.21.1 container_name: neofs-testnet + env_file: node_config.env network_mode: host restart: always volumes: - neofs_storage:/storage - :/node.key stop_signal: SIGINT - environment: - - NEOFS_NODE_ADDRESS= - - NEOFS_GRPC_ENDPOINT= - - =UN-LOCODE: - - NEOFS_NODE_ATTRIBUTE_2=Price:100000 vmagent: image: victoriametrics/vmagent:v1.61.0 container_name: vmagent depends_on: - storage01 + env_file: node_config.env command: - - '--promscrape.config=/configs/prometheus.yml' - - '--remoteWrite.url=https://collector.fs.neo.org:8429/api/v1/write' + - '-promscrape.config=/configs/prometheus.yml' + - '-remoteWrite.url=https://collector.fs.neo.org:8429/api/v1/write' network_mode: host restart: always volumes: diff --git a/config/testnet/node_config.env b/config/testnet/node_config.env new file mode 100644 index 000000000..904a8d730 --- /dev/null +++ b/config/testnet/node_config.env @@ -0,0 +1,28 @@ +# + +# Specify your public IP address or domain name with the open port +# in NODE_ADDRESS and BIND_ADDRESS +# By default keep these addresses the same. + +# This is used for the public announcement in the network map +# +#NEOFS_NODE_ADDRESS= +#NEOFS_NODE_ADDRESS=1.1.1.1:36512 +NEOFS_NODE_ADDRESS= + +# This is used to open the connection listening socket on your machine +# +#NEOFS_GRPC_ENDPOINT= +#NEOFS_GRPC_ENDPOINT=1.1.1.1:36512 +NEOFS_GRPC_ENDPOINT= + + +#https://unece.org/trade/cefact/unlocode-code-list-country-and-territory +# Find suitable LOCODE (from the link above) for your storage node. +# +#NEOFS_NODE_ATTRIBUTE_1=UN-LOCODE: +#NEOFS_NODE_ATTRIBUTE_1=UN-LOCODE:RU LED +NEOFS_NODE_ATTRIBUTE_1= + + +NEOFS_NODE_ATTRIBUTE_2=Price:100000 diff --git a/config/testnet/prometheus.yml b/config/testnet/prometheus.yml index a3855ba41..ced799bd6 100644 --- a/config/testnet/prometheus.yml +++ b/config/testnet/prometheus.yml @@ -8,3 +8,6 @@ scrape_configs: scrape_interval: 5s static_configs: - targets: ['127.0.0.1:9090'] + relabel_configs: + - target_label: 'instance' + replacement: "%{NEOFS_NODE_ADDRESS}"