2021-05-19 11:22:55 +00:00
|
|
|
# N3 testnet RC2 storage node configuration
|
2021-01-13 13:07:01 +00:00
|
|
|
|
|
|
|
There is a prepared configuration for NeoFS storage node deployment in
|
2021-05-19 11:22:55 +00:00
|
|
|
N3 testnet RC2. The easiest way to deploy storage node is to use prepared
|
2021-01-13 13:07:01 +00:00
|
|
|
docker image of storage node and run it with docker-compose.
|
|
|
|
|
|
|
|
## Build image
|
|
|
|
|
2021-04-01 15:41:46 +00:00
|
|
|
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:
|
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
|
|
|
...
|
|
|
|
Successfully built 80ef4e3c488d
|
2021-05-19 11:22:55 +00:00
|
|
|
Successfully tagged nspccdev/neofs-storage-testnet:0.20.0-dirty
|
2021-01-13 13:07:01 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
## Deploy node
|
|
|
|
|
2021-05-19 11:22:55 +00:00
|
|
|
To run storage node in N3 testnet RC2 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
|
|
|
|
|
|
|
|
Storage node holder should deposit assets because it generates a bit of
|
2021-04-01 15:41:46 +00:00
|
|
|
side chain GAS in node's wallet. Side chain GAS used to send bootstrap tx.
|
2021-01-13 13:07:01 +00:00
|
|
|
|
2021-05-19 11:22:55 +00:00
|
|
|
First obtain GAS in N3 testnet RC2 chain. You can do that with
|
|
|
|
[faucet](https://neowish.ngd.network) service.
|
2021-04-01 15:41:46 +00:00
|
|
|
|
2021-05-19 11:22:55 +00:00
|
|
|
Then make a deposit by transferring GAS to NeoFS contract in N3 testnet RC2.
|
|
|
|
You can provide scripthash in the `data` argument of transfer tx to make a
|
|
|
|
deposit to specified account. Otherwise deposit is made to tx sender.
|
2021-04-01 15:41:46 +00:00
|
|
|
|
2021-05-19 11:22:55 +00:00
|
|
|
NeoFS contract scripthash in NEO testnet RC2 is `088c76a08c7b4546582fe95df1ba58f61f165645`,
|
|
|
|
so the address is `NSEawP75SPnnH9sRtk18xJbjYGHu2q5m1W`
|
2021-01-13 13:07:01 +00:00
|
|
|
|
2021-05-19 11:22:55 +00:00
|
|
|
See a deposit example with `neo-go`:
|
2021-01-13 13:07:01 +00:00
|
|
|
|
|
|
|
```
|
2021-05-19 11:22:55 +00:00
|
|
|
neo-go wallet nep17 transfer -w wallet.json -r https://rpc1.n3.nspcc.ru:20331 \
|
|
|
|
--from NXxRAFPqPstaPByndKMHuC8iGcaHgtRY3m \
|
|
|
|
--to NSEawP75SPnnH9sRtk18xJbjYGHu2q5m1W \
|
|
|
|
--token GAS \
|
|
|
|
--amount 1
|
2021-01-13 13:07:01 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
### Configure
|
|
|
|
|
|
|
|
Then configure docker-compose.yml file. Change endpoints values. Both of them
|
2021-05-19 11:22:55 +00:00
|
|
|
should contain your **public** IP.
|
2021-01-13 13:07:01 +00:00
|
|
|
|
|
|
|
```yaml
|
|
|
|
environment:
|
2021-05-19 11:22:55 +00:00
|
|
|
- NEOFS_NODE_ADDRESS=65.52.183.157:36512
|
|
|
|
- NEOFS_GRPC_ENDPOINT=65.52.183.157:36512
|
2021-01-13 13:07:01 +00:00
|
|
|
```
|
|
|
|
|
2021-05-19 11:22:55 +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.
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
environment:
|
2021-05-19 11:22:55 +00:00
|
|
|
- NEOFS_NODE_ADDRESS=65.52.183.157:36512
|
|
|
|
- NEOFS_GRPC_ENDPOINT=65.52.183.157:36512
|
2021-04-01 15:41:46 +00:00
|
|
|
- NEOFS_NODE_ATTRIBUTE_1=UN-LOCODE:RU LED
|
|
|
|
```
|
|
|
|
|
2021-05-19 11:22:55 +00:00
|
|
|
You can validate UN/LOCODE attribute in
|
2021-04-01 15:41:46 +00:00
|
|
|
[NeoFS LOCODE database](https://github.com/nspcc-dev/neofs-locode-db/releases/tag/v0.1.0)
|
|
|
|
with neofs-cli.
|
|
|
|
|
|
|
|
```
|
|
|
|
$ neofs-cli util locode info --db ./locode_db --locode 'RU LED'
|
|
|
|
Country: Russia
|
|
|
|
Location: Saint Petersburg (ex Leningrad)
|
|
|
|
Continent: Europe
|
|
|
|
Subdivision: [SPE] Sankt-Peterburg
|
|
|
|
Coordinates: 59.53, 30.15
|
|
|
|
```
|
|
|
|
|
2021-01-13 13:07:01 +00:00
|
|
|
It is recommended to pass node's key as a file. To do so convert your wallet
|
2021-05-19 11:22:55 +00:00
|
|
|
WIF to 32-byte hex (via `neofs-cli` for example) and save it to file.
|
2021-01-13 13:07:01 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
// Print WIF in a 32-byte hex format
|
|
|
|
$ neofs-cli util keyer Kwp4Q933QujZLUCcn39tzY94itNQJS4EjTp28oAMzuxMwabm3p1s
|
|
|
|
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
|
|
|
|
```
|
|
|
|
|
|
|
|
Then specify path to this file in docker-compose
|
|
|
|
```yaml
|
|
|
|
volumes:
|
|
|
|
- neofs_storage:/storage
|
|
|
|
- ./my_wallet.key:/node.key
|
|
|
|
```
|
|
|
|
|
2021-05-19 11:22:55 +00:00
|
|
|
Another way is to provide WIF directly with env in docker-compose.
|
|
|
|
```
|
|
|
|
NEOFS_NODE_KEY=Kwp4Q933QujZLUCcn39tzY94itNQJS4EjTp28oAMzuxMwabm3p1s
|
|
|
|
```
|
2021-01-13 13:07:01 +00:00
|
|
|
|
|
|
|
### Start
|
|
|
|
|
2021-01-27 15:01:20 +00:00
|
|
|
Run node with `docker-compose up` command and stop it with `docker-compose down`.
|
|
|
|
|
|
|
|
### Debug
|
|
|
|
|
|
|
|
To print node logs use `docker logs neofs-testnet`. To print debug messages in
|
|
|
|
log, setup log level to debug with this env:
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
environment:
|
|
|
|
- NEOFS_LOGGER_LEVEL=debug
|
|
|
|
```
|