From 9f2a340dd51337a01d040404912db3fba8d714b3 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Fri, 4 Jun 2021 14:33:15 +0300 Subject: [PATCH] Update docs for v0.21.0 release Signed-off-by: Alex Vanin --- README.md | 2 +- docs/chain.md | 150 +++++++++++++++++++++++++++--------------------- docs/faq.md | 10 ++-- docs/ir.md | 11 ++-- docs/morph.md | 83 ++++++++++++++++++++++++--- docs/storage.md | 9 +-- 6 files changed, 178 insertions(+), 87 deletions(-) diff --git a/README.md b/README.md index 187b586..89df404 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ --- ## Overview -Tools to set up local NeoFS network and Neo 3 privnet. Devenv, for short. +Tools to set up local NeoFS network and N3 privnets. Devenv, for short. ## Quick Start diff --git a/docs/chain.md b/docs/chain.md index a4c82f5..8dfbb5e 100644 --- a/docs/chain.md +++ b/docs/chain.md @@ -1,14 +1,17 @@ -# Neo 3 privnet service +# N3 main chain privnet service -A single-node Neo3 privnet deployment running on -[neo-go](https://github.com/nspcc-dev/neo-go). +A single-node N3 privnet deployment, running on +[neo-go](https://github.com/nspcc-dev/neo-go). Represents N3 MainNet. Contracts deployed: -- NeoFS [mainnet contract](https://github.com/nspcc-dev/neofs-contract) +- 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`. ## .env settings -### CHAIN_URL="https://fs.neo.org/dist/chain.gz" +### CHAIN_URL URL to get main chain dump. Used on artifact get stage. @@ -16,31 +19,30 @@ URL to get main chain dump. Used on artifact get stage. Path to get main chain dump. If set, overrides `CHAIN_URL`. -### NEOGO_VERSION=0.91.1-pre-389-g71216865 +### NEOGO_VERSION -Version on NeoGo container to use in both main privnet and sidechain. +Version of neo-go docker container for main chain deployment. -## Main Privnet GAS +## Main chain wallets -There is a wallet with GAS for both main privnet and side chain in -`wallets/wallet.json`. +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 nep5 balance --token GAS \ +$ neo-go wallet nep17 balance \ -w wallets/wallet.json \ - --addr NTrezR3C4X8aMLVg7vozt5wguyNfFhwuFx \ - -r http://main_chain.neofs.devenv:30333 - -TokenHash: 668e0c1f9d7b70a99dd9e06eadd4c784d641afbc - Amount : 9987.92281340 - Updated: 13908 + -r http://main_chain.neofs.devenv:30333 + +Account NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM +GAS: GasToken (d2a4cff31913016155e38e474a2c06d08be276cf) + Amount : 9978.0074623 + Updated: 34 ``` -If you need GAS to deploy contracts on main privnet or create NeoFS account by -making deposits on NeoFS mainnet contract, you can transfer GAS from that -wallet. +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. -Create new wallet +1. Create new wallet. ``` $ neo-go wallet init -a -w wallets/neofs1.json @@ -58,39 +60,46 @@ Confirm passphrase > wallet successfully created, file location is wallets/neofs1.json ``` -Transfer some GAS there +2. Transfer GAS from `wallets/wallet.json`. The password is empty. + ``` -$ neo-go wallet nep5 transfer --privnet -w wallets/wallet.json \ - --from NTrezR3C4X8aMLVg7vozt5wguyNfFhwuFx \ +$ neo-go wallet nep17 transfer \ + -w wallets/wallet.json \ + -r http://main_chain.neofs.devenv:30333 \ + --from NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM \ --to NXnzw3J9VvKXjM1BPAJK4QUpTtEQu4TpU6 \ - --amount 50 --token GAS \ - --rpc-endpoint http://main_chain.neofs.devenv:30333 + --amount 50 \ + --token GAS ``` -Check it's there +3. Check it's there. + ``` -$ neo-go wallet nep5 balance --token GAS \ +$ neo-go wallet nep17 balance \ -w wallets/neofs1.json \ - --addr NXnzw3J9VvKXjM1BPAJK4QUpTtEQu4TpU6 \ - -r http://main_chain.neofs.devenv:30333 + -r http://main_chain.neofs.devenv:30333 -TokenHash: 668e0c1f9d7b70a99dd9e06eadd4c784d641afbc - Amount : 50 - Updated: 14689 +Account NXnzw3J9VvKXjM1BPAJK4QUpTtEQu4TpU6 +GAS: GasToken (d2a4cff31913016155e38e474a2c06d08be276cf) + Amount : 50 + Updated: 14689 ``` -## Claim GAS from NEO on CN +## Claim GAS from consensus node If there is no enough GAS on `wallets/wallet.json` account, you can claim some -GAS from CN node's wallet from `services/chain/node-wallet.json` and then -transfer it. Wallet password can be found in -`services/chain/protocol.privnet.yml` file. +GAS to consensus node's wallet and then transfer it. +Consensus node is running with `services/chain/node-wallet.json` wallet. It has +multiple accounts with the password `one`. + + +Claim GAS to consensus node's wallet. Use account that contains NEO tokens. ``` -$ neo-go wallet claim -w services/chain/node-wallet.json \ - -a NVNvVRW5Q5naSx2k2iZm7xRgtRNGuZppAK \ - -r http://main_chain.neofs.devenv:30333 - +$ neo-go wallet claim \ + -w services/chain/node-wallet.json \ + -r http://main_chain.neofs.devenv:30333 \ + -a NfgHwwTi3wHAS8aFAN243C5vGbkYDpqLHP \ Password > 70e09bbd55846dcc7cee23905b737c63e5a80d32e387bce108bc6db8e641fb90 ``` @@ -98,41 +107,52 @@ Password > Then you can transfer GAS the same way as it was done in previous section. ``` -neo-go wallet nep5 transfer --privnet -w services/chain/node-wallet.json \ - --from NVNvVRW5Q5naSx2k2iZm7xRgtRNGuZppAK \ +$ neo-go wallet nep17 transfer \ + -w services/chain/node-wallet.json \ + -r http://main_chain.neofs.devenv:30333 \ + --from NfgHwwTi3wHAS8aFAN243C5vGbkYDpqLHP \ --to NXnzw3J9VvKXjM1BPAJK4QUpTtEQu4TpU6 \ - --amount 500 --token GAS \ - --rpc-endpoint http://main_chain.neofs.devenv:30333 + --amount 50 \ + --token GAS ``` ## NeoFS GAS deposit NeoFS identifies users by their Neo wallet key pair. To start using NeoFS in -devenv you need to transfer some GAS from Main privnet account to NeoFS main -contract's account by calling the `deposit` method. +devenv you need to transfer some GAS to NeoFS contract in main chain. -First you need to get your account's LE encoded ScriptHash +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. ``` -$ neo-go util convert NXnzw3J9VvKXjM1BPAJK4QUpTtEQu4TpU6 - -Address to BE ScriptHash 82500e2e7de441e1b7378146ad91474f30fa1a0b -Address to LE ScriptHash 0b1afa304f4791ad468137b7e141e47d2e0e5082 -Address to Base64 (BE) glAOLn3kQeG3N4FGrZFHTzD6Ggs= -Address to Base64 (LE) Cxr6ME9Hka1GgTe34UHkfS4OUII= -String to Hex 4e586e7a77334a3956764b586a4d314250414a4b3451557054744551753454705536 -String to Base64 TlhuenczSjlWdktYak0xQlBBSks0UVVwVHRFUXU0VHBVNg== +$ make prepare.ir +Password > +Can't find matching token in the wallet. Querying RPC-node for balances. +6713c776f4102300691d9c3c493bcd3402434f5e32e8147e0a5bc72209a1e410 ``` -And call the `deposit` method: +Script converts addresses and executes this command: ``` -$ neo-go contract invokefunction -w wallets/neofs1.json \ - -a NXnzw3J9VvKXjM1BPAJK4QUpTtEQu4TpU6 \ +$ neo-go wallet nep17 transfer \ + -w wallets/wallet.json \ -r http://main_chain.neofs.devenv:30333 \ - 5f490fbd8010fd716754073ee960067d28549b7d \ - deposit 0b1afa304f4791ad468137b7e141e47d2e0e5082 \ - int:50 bytes: -- 0b1afa304f4791ad468137b7e141e47d2e0e5082 - -Enter account NXnzw3J9VvKXjM1BPAJK4QUpTtEQu4TpU6 password > -Sent invocation transaction 50e25f8e85c3b52dbd99381104cbe8056dad1a6e8809e8bf0e5d0a2527f55932 + --from NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM \ + --to NerhjaqJsJt4LxMqUbkkVMpsF2d9TtcpFv \ + --token GAS \ + --amount 50 +``` + +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 ``` diff --git a/docs/faq.md b/docs/faq.md index 63e30a4..14f0c4f 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -9,7 +9,7 @@ simple steps. 1. Get the key in WIF format ``` -$ docker exec -it main_chain neo-go wallet export -w wallets/wallet.json -d NTrezR3C4X8aMLVg7vozt5wguyNfFhwuFx +$ docker exec -it main_chain neo-go wallet export -w wallets/wallet.json -d NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM Enter password > KxDgvEKzgSBPPfuVfw67oPQBSjidEiqTHURKSDL1R7yGaGYAeYnr ``` @@ -21,9 +21,9 @@ $ neofs-cli util keyer KxDgvEKzgSBPPfuVfw67oPQBSjidEiqTHURKSDL1R7yGaGYAeYnr PrivateKey 1dd37fba80fec4e6a6f13fd708d8dcb3b29def768017052f6c930fa1c5d90bbb PublicKey 031a6c6fbbdf02ca351745fa86b9ba5a9452d785ac4f7fc2b7548ca2a46c4fcf4a WIF KxDgvEKzgSBPPfuVfw67oPQBSjidEiqTHURKSDL1R7yGaGYAeYnr -Wallet3.0 NTrezR3C4X8aMLVg7vozt5wguyNfFhwuFx -ScriptHash3.0 12b97a2206ae4b10c7e0194b7b655c32cc912057 -ScriptHash3.0BE 572091cc325c657b4b19e0c7104bae06227ab912 +Wallet3.0 NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM +ScriptHash3.0 5ea4d57ff4b09098a37db8138686ae2ef6a5b9aa +ScriptHash3.0BE aab9a5f62eae868613b87da39890b0f47fd5a45e ``` 3. Dump into file in binary format @@ -35,7 +35,7 @@ $ xxd wallets/wallet.key 00000010: b29d ef76 8017 052f 6c93 0fa1 c5d9 0bbb ...v.../l....... ``` -Later this functionality will be included in `neofs-cli` directly. +Later you will be able to provide wallet file in neofs-node config. ### How to create Neo wallet JSON file using a NeoFS key file? diff --git a/docs/ir.md b/docs/ir.md index dfd1063..28313f0 100644 --- a/docs/ir.md +++ b/docs/ir.md @@ -1,16 +1,19 @@ # NeoFS Inner Ring -Minimal set of seven NeoFS InnerRing as required by Governance scheme. +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. ## .env settings -### IR_VERSION=0.12.0 +### IR_VERSION -Image version label to use for InnerRing containers. +Image version label to use for Inner Ring docker containers. If you want to use locally built image, just set it's label here. Instead of pulling from DockerHub, the local image will be used. ### IR_IMAGE=nspccdev/neofs-ir -Image label prefix to use for InnerRing containers. +Image label prefix to use for Inner Ring docker containers. diff --git a/docs/morph.md b/docs/morph.md index 8157f75..21a359c 100644 --- a/docs/morph.md +++ b/docs/morph.md @@ -1,18 +1,85 @@ -# NeoFS sidechain service +# 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. -It's a single-node Neo3-based NeoFS sidechain deployment running on -[neo-go](https://github.com/nspcc-dev/neo-go). +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 -### MORPH_CHAIN_URL="https://fs.neo.org/dist/morph.chain.gz" +### MORPH_CHAIN_URL -URL to get NeoFS sidechain dump. Used on artifact get stage. +URL to get side chain dump. Used on artifact get stage. ### MORPH_CHAIN_PATH -Path to get NeoFS sidechain chain dump. If set, overrides `MORPH_CHAIN_URL`. +Path to get side chain dump. If set, overrides `CHAIN_URL`. -### NEOGO_VERSION=0.91.1-pre-389-g71216865 +### NEOGO_VERSION -Version on NeoGo container to use in both main privnet and sidechain. +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/docs/storage.md b/docs/storage.md index d2a4bac..d46db7e 100644 --- a/docs/storage.md +++ b/docs/storage.md @@ -1,13 +1,14 @@ -# Storage nodes service +# Storage service ## .env settings -### NODE_VERSION=0.12.0 +### NODE_VERSION -Image version label to use for Storage Node containers. +Image version label to use for Storage docker containers. If you want to use locally built image, just set it's label here. Instead of pulling from DockerHub, the local image will be used. ### NODE_IMAGE=nspccdev/neofs-ir -Image label prefix to use for Storage containers. + +Image label prefix to use for Storage docker containers.