2021-08-06 09:29:23 +00:00
|
|
|
# N3 Testnet Storage node configuration
|
2021-01-13 13:07:01 +00:00
|
|
|
|
2021-06-11 08:51:02 +00:00
|
|
|
There is a prepared configuration for NeoFS Storage Node deployment in
|
2022-04-21 11:28:05 +00:00
|
|
|
N3 Testnet. The easiest way to deploy a Storage Node is to use the prepared
|
2021-06-11 08:51:02 +00:00
|
|
|
docker image and run it with docker-compose.
|
2021-01-13 13:07:01 +00:00
|
|
|
|
|
|
|
## Build image
|
|
|
|
|
2023-03-02 10:56:11 +00:00
|
|
|
Prepared **frostfs-storage-testnet** image is available at Docker Hub.
|
|
|
|
However, if you need to rebuild it for some reason, run
|
2021-06-11 08:51:02 +00:00
|
|
|
`make image-storage-testnet` command.
|
2021-01-13 13:07:01 +00:00
|
|
|
|
|
|
|
```
|
2021-04-01 15:41:46 +00:00
|
|
|
$ make image-storage-testnet
|
2021-01-13 13:07:01 +00:00
|
|
|
...
|
2021-06-11 08:51:02 +00:00
|
|
|
Successfully built ab0557117b02
|
2021-10-13 09:58:25 +00:00
|
|
|
Successfully tagged nspccdev/neofs-storage-testnet:0.25.1
|
2021-01-13 13:07:01 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
## Deploy node
|
|
|
|
|
2023-03-02 10:56:11 +00:00
|
|
|
To run a storage node in N3 Testnet environment, you should deposit GAS assets,
|
2021-04-01 15:41:46 +00:00
|
|
|
update docker-compose file and start the node.
|
2021-01-13 13:07:01 +00:00
|
|
|
|
|
|
|
### Deposit
|
|
|
|
|
2023-03-02 10:56:11 +00:00
|
|
|
The Storage Node owner should deposit GAS to NeoFS smart contract. It generates a
|
|
|
|
bit of sidechain GAS in the node's wallet. Sidechain GAS is used to send bootstrap tx.
|
2021-01-13 13:07:01 +00:00
|
|
|
|
2022-04-21 11:28:05 +00:00
|
|
|
First, obtain GAS in N3 Testnet chain. You can do that with
|
2021-05-19 11:22:55 +00:00
|
|
|
[faucet](https://neowish.ngd.network) service.
|
2021-04-01 15:41:46 +00:00
|
|
|
|
2022-04-21 11:28:05 +00:00
|
|
|
Then, make a deposit by transferring GAS to NeoFS contract in N3 Testnet.
|
2021-05-19 11:22:55 +00:00
|
|
|
You can provide scripthash in the `data` argument of transfer tx to make a
|
2022-04-21 11:28:05 +00:00
|
|
|
deposit to a specified account. Otherwise, deposit is made to the tx sender.
|
2021-04-01 15:41:46 +00:00
|
|
|
|
2023-03-02 10:56:11 +00:00
|
|
|
NeoFS contract scripthash in N3 Testnet is `b65d8243ac63983206d17e5221af0653a7266fa1`,
|
2021-10-13 09:58:25 +00:00
|
|
|
so the address is `NadZ8YfvkddivcFFkztZgfwxZyKf1acpRF`.
|
2021-01-13 13:07:01 +00:00
|
|
|
|
2021-06-11 08:51:02 +00:00
|
|
|
See a deposit example with `neo-go`.
|
2021-01-13 13:07:01 +00:00
|
|
|
|
|
|
|
```
|
2021-10-13 09:58:25 +00:00
|
|
|
neo-go wallet nep17 transfer -w wallet.json -r https://rpc01.testnet.n3.nspcc.ru:21331 \
|
2021-05-19 11:22:55 +00:00
|
|
|
--from NXxRAFPqPstaPByndKMHuC8iGcaHgtRY3m \
|
2021-10-13 09:58:25 +00:00
|
|
|
--to NadZ8YfvkddivcFFkztZgfwxZyKf1acpRF \
|
2021-05-19 11:22:55 +00:00
|
|
|
--token GAS \
|
|
|
|
--amount 1
|
2021-01-13 13:07:01 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
### Configure
|
|
|
|
|
2022-04-21 11:28:05 +00:00
|
|
|
Next, configure `node_config.env` file. Change endpoints values. Both
|
2021-05-19 11:22:55 +00:00
|
|
|
should contain your **public** IP.
|
2021-01-13 13:07:01 +00:00
|
|
|
|
2021-06-16 18:37:07 +00:00
|
|
|
```
|
2021-08-31 10:55:05 +00:00
|
|
|
NEOFS_GRPC_0_ENDPOINT=65.52.183.157:36512
|
|
|
|
NEOFS_NODE_ADDRESSES=65.52.183.157:36512
|
2021-01-13 13:07:01 +00:00
|
|
|
```
|
|
|
|
|
2023-03-02 10:56:11 +00:00
|
|
|
Set up your [UN/LOCODE](https://unece.org/trade/cefact/unlocode-code-list-country-and-territory)
|
2021-04-01 15:41:46 +00:00
|
|
|
attribute.
|
|
|
|
|
2021-06-16 18:37:07 +00:00
|
|
|
```
|
2021-08-31 10:55:05 +00:00
|
|
|
NEOFS_GRPC_0_ENDPOINT=65.52.183.157:36512
|
|
|
|
NEOFS_NODE_ADDRESSES=65.52.183.157:36512
|
|
|
|
NEOFS_NODE_ATTRIBUTE_2=UN-LOCODE:RU LED
|
2021-04-01 15:41:46 +00:00
|
|
|
```
|
|
|
|
|
2023-03-02 10:56:11 +00:00
|
|
|
You can validate UN/LOCODE attribute in
|
2024-09-11 09:40:04 +00:00
|
|
|
[NeoFS LOCODE database](https://git.frostfs.info/TrueCloudLab/frostfs-locode-db/releases/tag/v0.4.0)
|
2022-12-23 17:35:35 +00:00
|
|
|
with frostfs-cli.
|
2021-04-01 15:41:46 +00:00
|
|
|
|
|
|
|
```
|
2022-12-23 17:35:35 +00:00
|
|
|
$ frostfs-cli util locode info --db ./locode_db --locode 'RU LED'
|
2021-04-01 15:41:46 +00:00
|
|
|
Country: Russia
|
|
|
|
Location: Saint Petersburg (ex Leningrad)
|
|
|
|
Continent: Europe
|
|
|
|
Subdivision: [SPE] Sankt-Peterburg
|
|
|
|
Coordinates: 59.53, 30.15
|
|
|
|
```
|
|
|
|
|
2023-03-02 10:56:11 +00:00
|
|
|
It is recommended to pass the node's key as a file. To do so, convert your wallet
|
2022-12-23 17:35:35 +00:00
|
|
|
WIF to 32-byte hex (via `frostfs-cli` for example) and save it to a file.
|
2021-01-13 13:07:01 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
// Print WIF in a 32-byte hex format
|
2022-12-23 17:35:35 +00:00
|
|
|
$ frostfs-cli util keyer Kwp4Q933QujZLUCcn39tzY94itNQJS4EjTp28oAMzuxMwabm3p1s
|
2021-01-13 13:07:01 +00:00
|
|
|
PrivateKey 11ab917cd99170cb8d0d48e78fca317564e6b3aaff7f7058952d6175cdca0f56
|
|
|
|
PublicKey 02be8b2e837cab232168f5c3303f1b985818b7583682fb49026b8d2f43df7c1059
|
|
|
|
WIF Kwp4Q933QujZLUCcn39tzY94itNQJS4EjTp28oAMzuxMwabm3p1s
|
2021-05-19 11:22:55 +00:00
|
|
|
Wallet3.0 Nfzmk7FAZmEHDhLePdgysQL2FgkJbaEMpQ
|
|
|
|
ScriptHash3.0 dffe39998f50d42f2e06807866161cd0440b4bdc
|
|
|
|
ScriptHash3.0BE dc4b0b44d01c16667880062e2fd4508f9939fedf
|
2021-01-13 13:07:01 +00:00
|
|
|
|
|
|
|
// Save 32-byte hex into a file
|
|
|
|
$ echo '11ab917cd99170cb8d0d48e78fca317564e6b3aaff7f7058952d6175cdca0f56' | xxd -r -p > my_wallet.key
|
|
|
|
```
|
|
|
|
|
2022-04-21 11:28:05 +00:00
|
|
|
Then, specify the path to this file in `docker-compose.yml`
|
2021-01-13 13:07:01 +00:00
|
|
|
```yaml
|
|
|
|
volumes:
|
2022-12-23 17:35:35 +00:00
|
|
|
- frostfs_storage:/storage
|
2021-01-13 13:07:01 +00:00
|
|
|
- ./my_wallet.key:/node.key
|
|
|
|
```
|
|
|
|
|
2021-06-11 08:51:02 +00:00
|
|
|
|
2023-03-02 10:56:11 +00:00
|
|
|
NeoFS objects will be stored on your machine. By default, docker-compose
|
|
|
|
is configured to store objects in named docker volume `frostfs_storage`. You can
|
2022-04-21 11:28:05 +00:00
|
|
|
specify a directory on the filesystem to store objects there.
|
2021-06-11 08:51:02 +00:00
|
|
|
|
|
|
|
```yaml
|
|
|
|
volumes:
|
2022-12-23 17:35:35 +00:00
|
|
|
- /home/username/frostfs/rc3/storage:/storage
|
2021-06-11 08:51:02 +00:00
|
|
|
- ./my_wallet.key:/node.key
|
2021-05-19 11:22:55 +00:00
|
|
|
```
|
2021-01-13 13:07:01 +00:00
|
|
|
|
|
|
|
### Start
|
|
|
|
|
2022-04-21 11:28:05 +00:00
|
|
|
Run the node with `docker-compose up` command and stop it with `docker-compose down`.
|
2021-01-27 15:01:20 +00:00
|
|
|
|
|
|
|
### Debug
|
|
|
|
|
2023-03-02 10:56:11 +00:00
|
|
|
To print node logs, use `docker logs frostfs-testnet`. To print debug messages in
|
2022-04-21 11:28:05 +00:00
|
|
|
log, set up log level to debug with this env:
|
2021-01-27 15:01:20 +00:00
|
|
|
|
|
|
|
```yaml
|
|
|
|
environment:
|
|
|
|
- NEOFS_LOGGER_LEVEL=debug
|
2021-06-16 18:37:07 +00:00
|
|
|
```
|