2021-06-04 11:33:15 +00:00
|
|
|
# N3 main chain privnet service
|
2020-09-25 20:36:46 +00:00
|
|
|
|
2021-06-04 11:33:15 +00:00
|
|
|
A single-node N3 privnet deployment, running on
|
|
|
|
[neo-go](https://github.com/nspcc-dev/neo-go). Represents N3 MainNet.
|
2020-09-25 20:36:46 +00:00
|
|
|
|
|
|
|
Contracts deployed:
|
2021-06-04 11:33:15 +00:00
|
|
|
- NeoFS [contract](https://github.com/nspcc-dev/neofs-contract/tree/master/neofs)
|
|
|
|
- Processing [contract](https://github.com/nspcc-dev/neofs-contract/tree/master/processing)
|
|
|
|
|
|
|
|
RPC available at `http://main_chain.neofs.devenv:30333`.
|
2020-09-25 20:36:46 +00:00
|
|
|
|
|
|
|
## .env settings
|
|
|
|
|
2021-06-04 11:33:15 +00:00
|
|
|
### CHAIN_URL
|
2020-09-25 20:36:46 +00:00
|
|
|
|
|
|
|
URL to get main chain dump. Used on artifact get stage.
|
|
|
|
|
|
|
|
### CHAIN_PATH
|
|
|
|
|
|
|
|
Path to get main chain dump. If set, overrides `CHAIN_URL`.
|
|
|
|
|
2021-06-04 11:33:15 +00:00
|
|
|
### NEOGO_VERSION
|
2020-09-25 20:36:46 +00:00
|
|
|
|
2021-06-04 11:33:15 +00:00
|
|
|
Version of neo-go docker container for main chain deployment.
|
2020-09-25 20:36:46 +00:00
|
|
|
|
2021-06-04 11:33:15 +00:00
|
|
|
## Main chain wallets
|
2020-09-25 20:36:46 +00:00
|
|
|
|
2021-06-04 11:33:15 +00:00
|
|
|
There is a wallet with GAS that used for contract deployment:
|
|
|
|
`wallets/wallet.json`. This wallet has one account with **empty password**.
|
2020-09-25 20:36:46 +00:00
|
|
|
|
|
|
|
```
|
2021-06-04 11:33:15 +00:00
|
|
|
$ neo-go wallet nep17 balance \
|
2020-09-25 20:36:46 +00:00
|
|
|
-w wallets/wallet.json \
|
2021-06-04 11:33:15 +00:00
|
|
|
-r http://main_chain.neofs.devenv:30333
|
|
|
|
|
|
|
|
Account NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM
|
|
|
|
GAS: GasToken (d2a4cff31913016155e38e474a2c06d08be276cf)
|
|
|
|
Amount : 9978.0074623
|
|
|
|
Updated: 34
|
2020-09-25 20:36:46 +00:00
|
|
|
```
|
|
|
|
|
2021-06-04 11:33:15 +00:00
|
|
|
If you want to operate in main chain with your personal wallet (e.g. to make
|
|
|
|
a deposit in NeoFS contract), you can transfer GAS from there.
|
2020-09-25 20:36:46 +00:00
|
|
|
|
2021-06-04 11:33:15 +00:00
|
|
|
1. Create new wallet.
|
2020-09-25 20:36:46 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
$ neo-go wallet init -a -w wallets/neofs1.json
|
|
|
|
|
|
|
|
Enter the name of the account > neofs1
|
|
|
|
Enter passphrase >
|
|
|
|
Confirm passphrase >
|
|
|
|
|
|
|
|
{
|
|
|
|
"version": "3.0",
|
|
|
|
"accounts": [
|
|
|
|
{
|
|
|
|
"address": "NXnzw3J9VvKXjM1BPAJK4QUpTtEQu4TpU6",
|
|
|
|
...
|
|
|
|
wallet successfully created, file location is wallets/neofs1.json
|
|
|
|
```
|
|
|
|
|
2021-06-04 11:33:15 +00:00
|
|
|
2. Transfer GAS from `wallets/wallet.json`. The password is empty.
|
|
|
|
|
2020-09-25 20:36:46 +00:00
|
|
|
```
|
2021-06-04 11:33:15 +00:00
|
|
|
$ neo-go wallet nep17 transfer \
|
|
|
|
-w wallets/wallet.json \
|
|
|
|
-r http://main_chain.neofs.devenv:30333 \
|
|
|
|
--from NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM \
|
2020-09-25 20:36:46 +00:00
|
|
|
--to NXnzw3J9VvKXjM1BPAJK4QUpTtEQu4TpU6 \
|
2021-06-04 11:33:15 +00:00
|
|
|
--amount 50 \
|
|
|
|
--token GAS
|
2020-09-25 20:36:46 +00:00
|
|
|
```
|
|
|
|
|
2021-06-04 11:33:15 +00:00
|
|
|
3. Check it's there.
|
|
|
|
|
2020-09-25 20:36:46 +00:00
|
|
|
```
|
2021-06-04 11:33:15 +00:00
|
|
|
$ neo-go wallet nep17 balance \
|
2020-09-25 20:36:46 +00:00
|
|
|
-w wallets/neofs1.json \
|
2021-06-04 11:33:15 +00:00
|
|
|
-r http://main_chain.neofs.devenv:30333
|
2020-09-25 20:36:46 +00:00
|
|
|
|
2021-06-04 11:33:15 +00:00
|
|
|
Account NXnzw3J9VvKXjM1BPAJK4QUpTtEQu4TpU6
|
|
|
|
GAS: GasToken (d2a4cff31913016155e38e474a2c06d08be276cf)
|
|
|
|
Amount : 50
|
|
|
|
Updated: 14689
|
2020-09-25 20:36:46 +00:00
|
|
|
```
|
|
|
|
|
2021-06-04 11:33:15 +00:00
|
|
|
## Claim GAS from consensus node
|
2020-09-25 20:36:46 +00:00
|
|
|
|
|
|
|
If there is no enough GAS on `wallets/wallet.json` account, you can claim some
|
2021-06-04 11:33:15 +00:00
|
|
|
GAS to consensus node's wallet and then transfer it.
|
2020-09-25 20:36:46 +00:00
|
|
|
|
2021-06-04 11:33:15 +00:00
|
|
|
Consensus node is running with `services/chain/node-wallet.json` wallet. It has
|
|
|
|
multiple accounts with the password `one`.
|
2020-09-25 20:36:46 +00:00
|
|
|
|
2021-06-04 11:33:15 +00:00
|
|
|
|
|
|
|
Claim GAS to consensus node's wallet. Use account that contains NEO tokens.
|
|
|
|
```
|
|
|
|
$ neo-go wallet claim \
|
|
|
|
-w services/chain/node-wallet.json \
|
|
|
|
-r http://main_chain.neofs.devenv:30333 \
|
|
|
|
-a NfgHwwTi3wHAS8aFAN243C5vGbkYDpqLHP \
|
2020-09-25 20:36:46 +00:00
|
|
|
Password >
|
|
|
|
70e09bbd55846dcc7cee23905b737c63e5a80d32e387bce108bc6db8e641fb90
|
|
|
|
```
|
|
|
|
|
|
|
|
Then you can transfer GAS the same way as it was done in previous section.
|
|
|
|
|
|
|
|
```
|
2021-06-04 11:33:15 +00:00
|
|
|
$ neo-go wallet nep17 transfer \
|
|
|
|
-w services/chain/node-wallet.json \
|
|
|
|
-r http://main_chain.neofs.devenv:30333 \
|
|
|
|
--from NfgHwwTi3wHAS8aFAN243C5vGbkYDpqLHP \
|
2020-09-25 20:36:46 +00:00
|
|
|
--to NXnzw3J9VvKXjM1BPAJK4QUpTtEQu4TpU6 \
|
2021-06-04 11:33:15 +00:00
|
|
|
--amount 50 \
|
|
|
|
--token GAS
|
2020-09-25 20:36:46 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
## NeoFS GAS deposit
|
|
|
|
|
|
|
|
NeoFS identifies users by their Neo wallet key pair. To start using NeoFS in
|
2021-06-04 11:33:15 +00:00
|
|
|
devenv you need to transfer some GAS to NeoFS contract in main chain.
|
2020-09-25 20:36:46 +00:00
|
|
|
|
2021-06-04 11:33:15 +00:00
|
|
|
Invoke `bin/deposit.sh` script by running `make prepare.ir` command to transfer
|
|
|
|
50 GAS from account in `wallets/wallet.json` file. Script enters passwords
|
|
|
|
automatically with `expect` utility.
|
2020-09-25 20:36:46 +00:00
|
|
|
|
|
|
|
```
|
2021-06-04 11:33:15 +00:00
|
|
|
$ make prepare.ir
|
|
|
|
Password >
|
|
|
|
Can't find matching token in the wallet. Querying RPC-node for balances.
|
|
|
|
6713c776f4102300691d9c3c493bcd3402434f5e32e8147e0a5bc72209a1e410
|
2020-09-25 20:36:46 +00:00
|
|
|
```
|
|
|
|
|
2021-06-04 11:33:15 +00:00
|
|
|
Script converts addresses and executes this command:
|
2020-09-25 20:36:46 +00:00
|
|
|
```
|
2021-06-04 11:33:15 +00:00
|
|
|
$ neo-go wallet nep17 transfer \
|
|
|
|
-w wallets/wallet.json \
|
2020-09-25 20:36:46 +00:00
|
|
|
-r http://main_chain.neofs.devenv:30333 \
|
2021-06-04 11:33:15 +00:00
|
|
|
--from NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM \
|
|
|
|
--to NerhjaqJsJt4LxMqUbkkVMpsF2d9TtcpFv \
|
|
|
|
--token GAS \
|
|
|
|
--amount 50
|
|
|
|
```
|
2020-09-25 20:36:46 +00:00
|
|
|
|
2021-06-04 11:33:15 +00:00
|
|
|
You can specify any wallet address scripthash in the transfer's data argument,
|
|
|
|
and NeoFS deposit will be transferred to that address.
|
|
|
|
|
|
|
|
```
|
|
|
|
$ neo-go wallet nep17 transfer \
|
|
|
|
-w wallets/wallet.json \
|
|
|
|
-r http://main_chain.neofs.devenv:30333 \
|
|
|
|
--from NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM \
|
|
|
|
--to NerhjaqJsJt4LxMqUbkkVMpsF2d9TtcpFv \
|
|
|
|
--token GAS \
|
|
|
|
--amount 50 \
|
|
|
|
hash160:bd711de066e9c2f7b502c7f3f0e0a6f1c8341edd
|
2020-09-25 20:36:46 +00:00
|
|
|
```
|