From 211363d39b88d4946b69121aaf128ab721dec941 Mon Sep 17 00:00:00 2001 From: Yu Leng Date: Wed, 7 Jul 2021 16:54:15 +0800 Subject: [PATCH] update zh deploy mining pool doc --- docs/.vuepress/config.js | 11 +- docs/advanced/README.md | 365 +------------- docs/advanced/Tips-Running-In-China.md | 19 - docs/advanced/venus-cli.md | 368 ++++++++++++++ docs/guide/How-To-Deploy-MingPool.md | 28 +- docs/guide/Using-venus-Shared-Modules.md | 10 +- docs/modules/How-To-Use-Messager.md | 56 +-- docs/zh/advanced/README.md | 373 +------------- docs/zh/advanced/Tips-Running-In-China.md | 19 - docs/zh/advanced/venus-cli.md | 368 ++++++++++++++ docs/zh/guide/How-To-Deploy-MingPool.md | 529 +++++++++----------- docs/zh/guide/Using-venus-Shared-Modules.md | 10 +- docs/zh/modules/How-To-Use-Messager.md | 58 ++- 13 files changed, 1062 insertions(+), 1152 deletions(-) delete mode 100644 docs/advanced/Tips-Running-In-China.md create mode 100644 docs/advanced/venus-cli.md delete mode 100644 docs/zh/advanced/Tips-Running-In-China.md create mode 100644 docs/zh/advanced/venus-cli.md diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index 99c725513..34a984ae1 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -110,8 +110,8 @@ module.exports = { title: 'Advanced', collapsable: false, children: [ - ['', 'Venus CLI commands'], - ['Tips-Running-In-China.md', 'Tips running in China'], + ['', 'Tips running in China'], + ['venus-cli.md', 'Venus CLI commands'], ['Multisig-wallet.md', 'Multisig wallet'], ['venus_load_balancing.md', 'Venus load balancing'], ['Payment-Channel.md', 'Payment channel'], @@ -162,7 +162,7 @@ module.exports = { collapsable: false, children: [ ['', 'Venus daemon'], - ['How to use venus messager.md', 'Venus messager'], + ['How-To-Use-Messager.md', 'Venus messager'], ['How-To-Use-Wallet-In-Venus.md', 'Venus wallet'], // ['Venus-wallet.md', 'Venus wallet'], ['Venus-Worker.md', 'Venus worker'], @@ -174,8 +174,9 @@ module.exports = { title: '进阶', collapsable: false, children: [ - ['', 'CLI命令'], - ['Tips-Running-In-China.md', '中国部署提示'], + ['', '中国部署提示'], + ['Venus-Project-Dependency-Upgrade.md', '依赖与升级'], + ['venus-cli.md', 'CLI命令'], ['Multisig-Wallet.md', '多签钱包'], ['venus_load_balancing.md', '负载均衡'], ['Payment-Channel.md', '支付通道'], diff --git a/docs/advanced/README.md b/docs/advanced/README.md index 33b07698c..b896b3af8 100644 --- a/docs/advanced/README.md +++ b/docs/advanced/README.md @@ -1,368 +1,19 @@ -# CLI Commands +# Venus: tips when running in China -For a complete list of available commands, simply run `venus --help` in your terminal. +This guide provides a few tips for users in China to get around some of the bandwidth issues or slowness they can suffer when building and running Venus. -``` - START RUNNING FILECOIN - venus config [] - Get and set filecoin config values - venus daemon - Start a long-running daemon process - venus wallet - Manage your filecoin wallets - - VIEW DATA STRUCTURES - venus chain - Inspect the filecoin blockchain - venus sync - Inspect the filecoin Sync - venus dag - Interact with IPLD DAG objects - venus show - Get human-readable representations of filecoin objects - - NETWORK COMMANDS - venus swarm - Interact with the swarm - venus drand - retrieve drand randomness - - MESSAGE COMMANDS - venus send - Send message - venus mpool - Manage the message pool - - State COMMANDS - venus state wait-msg - Wait for a message to appear on chain - venus state search-msg - Search to see whether a message has appeared on chain - venus state power - Query network or miner power - venus state sectors - Query the sector set of a miner - venus state active-sectors - Query the active sector set of a miner - venus state sector - Get miner sector info - venus state get-actor - Print actor information - venus state lookup - Find corresponding ID address - venus state sector-size - Look up miners sector size - venus state get-deal - View on-chain deal info - venus state miner-info - Retrieve miner information - venus state network-version - MReturns the network version - venus state list-actor - list all actors - - TOOL COMMANDS - venus inspect - Show info about the venus node - venus leb128 - Leb128 cli encode/decode - venus log - Interact with the daemon event log output - venus protocol - Show protocol parameter details - venus version - Show venus version information - venus seed - Seal sectors for genesis miner -``` - - -# Common commands - -# Start a mainnet node - -```shell script -./venus daemon -``` - -## Query chain status - -1. get current head tipset - -```shell script -./venus chain head - -{ - "Height": 449124, - "ParentWeight": "9725370313", - "Cids": [ - { - "/": "bafy2bzacectt2udhaow37r53dfpnq6o3edvf5iswbpk77bcfiuce4xn5zkc3g" - }, - { - "/": "bafy2bzacebjintkddt24xdqvma3xwqurp6bahdhqxvwc54kqvuxbi3tiy2rig" - }, - { - "/": "bafy2bzaceczumkmzgjfasc4cpb2cqkhhv5eqgf2ikzgwgmw5554bgguivykf6" - }, - { - "/": "bafy2bzacebd5jt744qsoi5pieisxme2xtmdgmlylma2wgbbu2vmrp3bjlflq2" - }, - { - "/": "bafy2bzacedl3fvcvybsukh4odytkz2fxemrr2rln7t75oqj2wkj7yg2vohl3g" - } - ], - "Timestamp": "2021-01-28 04:42:00" -} -``` - -2. list recent tipset -```shell script -./venus chain ls -[ -....... - { - "Height": 449115, - "Timestamp": "2021-01-28 04:37:30", - "Blocks": [ - { - "Cid": { - "/": "bafy2bzaceb2xn4hnnovksfeqjrig44bgxow5ixuymlo75nnftjad2mufzzjjw" - }, - "Miner": "t0112667" - }, - { - "Cid": { - "/": "bafy2bzacecoswf32ayvdhotbp3pcgabq6q34c5czqscugb5lfcig26igbkem2" - }, - "Miner": "t030347" - }, - { - "Cid": { - "/": "bafy2bzacedo3xucwhpz3ndralqbrgzmbzxvkj23btp46tppby2vadyovvtux6" - }, - "Miner": "t03176" - }, - { - "Cid": { - "/": "bafy2bzacecrnceor3dj3zixrizqkgcivxrevy7jkzh5wolgp7kok7cimcsoyu" - }, - "Miner": "t089228" - }, - { - "Cid": { - "/": "bafy2bzaceas2qb642iagyc2konpf3bdykw7kryv245dvsmuboikanj35ymes4" - }, - "Miner": "t023152" - } - ] - } -] -``` - -3. set tipset head - -```shell script - ./venus chain set-head bafy2bzaceckeg7onfhua5jf4xrnrzt2erix5pibjov2r4vvdhcih6oql7vm24 bafy2bzacedt74pgv2rk7iddptz2nz4kfcsoccqnrb4q7mbluof6puw5iccqms -``` - -## Wallet command - -1. create address - -```shell script -./venus wallet new -``` - -2. list address - -```shell script -./venus wallet ls - -Address Balance Nonce Default -f1nixbb3trp2mujzf5z7mguidthwo4levnldy4s4a 0 FIL 0 -f1ytd5blzi3y2nsupqzye6ogpaphow3lljii3zkdi 0 FIL 0 -f3qmxlwlzmvvn6vwo73jhuzjufmo65lrdwecxcmd7poyv5yex5hqngvo26sqjzzdge4vj3yxmwn5x24igremna 0 FIL 0 X -f3rjuxqnsjk7wuuzf3rqwsfxpbmqp23dn6ik5vyow2ntw5sgdxyijh7cfbujbmwtzdpii6ikunumez55jcxbbq 0 FIL 0 -``` - -3. set default address - -```shell script -./venus wallet set-default f3qmxlwlzmvvn6vwo73jhuzjufmo65lrdwecxcmd7poyv5yex5hqngvo26sqjzzdge4vj3yxmwn5x24igremna -``` - -4. get default address - -```shell script -./venus wallet default -``` - -5. export/import address,compatible with the lotus private key format - -```shell script -./venus wallet import -./venus wallet export -``` - -6. query balance of address - -```shell script -./venus wallet balance f3rjuxqnsjk7wuuzf3rqwsfxpbmqp23dn6ik5vyow2ntw5sgdxyijh7cfbujbmwtzdpii6ikunumez55jcxbbq -0 FIL -``` - -7. set wallet password - -```shell script -./venus wallet set-password -``` - -8. lock and unlock wallet - -```shell script -./venus wallet lock -./venus wallet unlock -``` - -## Sync commnad - -1. query sync status - -```shell script -./venus sync status - -Syncing: -SyncTarget: 1 - Base: 450231 { bafy2bzaceby6aq4obp5pjgjsxtyneqgsrcou4tgx2rsgqptoxgb4pyxh4asae bafy2bzacebancasvojeszwqnfvexlmn52vgcq7ns45nnwzixr67dzsel2kolu bafy2bzaced37mxrstmq2ij4x3szso446fodutq4jaarns6n2vdijeem2k44be bafy2bzacebtxektwn3mndyhpwnj6rkhnf6mfnfa2fyds4jv2xxb3nukuy26d6 bafy2bzacedmjrn42yzfl4yzuzn66ir33exrjxotahtets7btjfm4x36rdcsgu } - Target: 450239 { bafy2bzaceb6ulfdjeak6uaxrsd62jobtuilee4wkk3bj5ta4qfi7ll52tbyrm bafy2bzacebkbsyo2hp4qgrsfgzjz5qvyrgfz6n6nsq6kfxvw7s4s66yfynpwi } - Current: 450232 { bafy2bzacedwjdxb5jx5wo4zwg7emwfhbw34bvs3hvo362r3um25nisdakrl7g bafy2bzaced4jq6hx56o4symynuwqhlhf4kzo3qdqofeilizzflejvgjjr2bmq } - Status: syncing - Err: - -SyncTarget: 2 - Base: 450231 { bafy2bzaceby6aq4obp5pjgjsxtyneqgsrcou4tgx2rsgqptoxgb4pyxh4asae bafy2bzacebancasvojeszwqnfvexlmn52vgcq7ns45nnwzixr67dzsel2kolu bafy2bzaced37mxrstmq2ij4x3szso446fodutq4jaarns6n2vdijeem2k44be bafy2bzacebtxektwn3mndyhpwnj6rkhnf6mfnfa2fyds4jv2xxb3nukuy26d6 bafy2bzacedmjrn42yzfl4yzuzn66ir33exrjxotahtets7btjfm4x36rdcsgu } - Target: 450238 { bafy2bzacebtf2l5y34acbfnie6ilvvhxj5gyrnknnygintqzqkoxcsnmmuado bafy2bzacedswqjogt57cf7q22ebbrnbw3qygxd6q3z6vhm74b6tyzqjlrvox4 bafy2bzacecrv2kxpvuocgrtfjlot3da57655zbvrcu2reuospak3vdxa3u7v2 bafy2bzacecahv6twxmeihivncobqadfm7xyh3gvnrpjhs47i7537er7uyeote } - Current: 450233 { bafy2bzaceb4ybtg3p63fd7hvrajj5cw7oi52ie3zj2r3apxvod4u4e3y3svac bafy2bzacecmasydskhxrcrdih6na4qxpcdpavj6d5wydgft7ba574mx57ij76 bafy2bzacedrxgj2cjq537zoe24qhzizkx5ix4g7rpzbjl73qfm4ldom2kt7pq bafy2bzaceat2eg6ujh2qmlwwvna5qmntbayquvesvik55jfbrfkcgugcl6dmq bafy2bzaceawwc3hp3b5bl2a3gjmvehxytqvxtabtwosj77lnbcmu5ln4gh77u bafy2bzaceabwkrifkce2rraystlg2ouxudklyd2b3pmck2ineguidz4r3x35o bafy2bzacebfxvqczftyzoxosdrlxylhupurmovpqhympe6anukleg2z7emmbo bafy2bzaceb2bbk4ykijqz7em4zgag5eikvqzierp6mevw2bytnj4xrbb2dthc } - Status: syncing - Err: - -SyncTarget: 3 - Base: 450231 { bafy2bzaceby6aq4obp5pjgjsxtyneqgsrcou4tgx2rsgqptoxgb4pyxh4asae bafy2bzacebancasvojeszwqnfvexlmn52vgcq7ns45nnwzixr67dzsel2kolu bafy2bzaced37mxrstmq2ij4x3szso446fodutq4jaarns6n2vdijeem2k44be bafy2bzacebtxektwn3mndyhpwnj6rkhnf6mfnfa2fyds4jv2xxb3nukuy26d6 bafy2bzacedmjrn42yzfl4yzuzn66ir33exrjxotahtets7btjfm4x36rdcsgu } - Target: 450237 { bafy2bzaceavndy2pgdjpacapy4gs6pszbvxssvwrnw4uydnne4boowvyjlzjm bafy2bzacedutkurnrzna3hctqwxkrghhy6ufkanonfbq54cjcaoquoss4galy bafy2bzaced477xs5udb2r2xkomt6webzmjcwvy257bhpvgxrq6v573o66ywsy bafy2bzaceddjcr45kqhrwikemn7lfuhe5k3cqhhebrrzucsemv4bbxh755hx4 } - Current: 450233 { bafy2bzaceb4ybtg3p63fd7hvrajj5cw7oi52ie3zj2r3apxvod4u4e3y3svac bafy2bzacecmasydskhxrcrdih6na4qxpcdpavj6d5wydgft7ba574mx57ij76 bafy2bzacedrxgj2cjq537zoe24qhzizkx5ix4g7rpzbjl73qfm4ldom2kt7pq bafy2bzaceat2eg6ujh2qmlwwvna5qmntbayquvesvik55jfbrfkcgugcl6dmq bafy2bzaceawwc3hp3b5bl2a3gjmvehxytqvxtabtwosj77lnbcmu5ln4gh77u bafy2bzaceabwkrifkce2rraystlg2ouxudklyd2b3pmck2ineguidz4r3x35o bafy2bzacebfxvqczftyzoxosdrlxylhupurmovpqhympe6anukleg2z7emmbo bafy2bzaceb2bbk4ykijqz7em4zgag5eikvqzierp6mevw2bytnj4xrbb2dthc } - Status: syncing - Err: - -Waiting: -SyncTarget: 4 - Base: 450231 { bafy2bzaceby6aq4obp5pjgjsxtyneqgsrcou4tgx2rsgqptoxgb4pyxh4asae bafy2bzacebancasvojeszwqnfvexlmn52vgcq7ns45nnwzixr67dzsel2kolu bafy2bzaced37mxrstmq2ij4x3szso446fodutq4jaarns6n2vdijeem2k44be bafy2bzacebtxektwn3mndyhpwnj6rkhnf6mfnfa2fyds4jv2xxb3nukuy26d6 bafy2bzacedmjrn42yzfl4yzuzn66ir33exrjxotahtets7btjfm4x36rdcsgu } - Target: 450239 { bafy2bzaceb6ulfdjeak6uaxrsd62jobtuilee4wkk3bj5ta4qfi7ll52tbyrm bafy2bzacebkbsyo2hp4qgrsfgzjz5qvyrgfz6n6nsq6kfxvw7s4s66yfynpwi bafy2bzacebca26ouxt6tv32ul46457zftb5ozy6lmeejtrw2w5srb4zgnflou } - Current: - Status: wait - Err: - -History: -``` - -2. set the number of synchronizations - -```shell script -./venus sync set-concurrent 1 -``` - -## Network command - -1. print local node information - -```shell script -./venus swarm id - -{ - "Addresses": [ - "/ip4/192.168.1.151/tcp/6000/p2p/QmTBY16KjbJifqrepWriHNaSVxBJRKg63G8hJrAZAstCQt", - "/ip4/127.0.0.1/tcp/6000/p2p/QmTBY16KjbJifqrepWriHNaSVxBJRKg63G8hJrAZAstCQt" - ], - "ID": "QmTBY16KjbJifqrepWriHNaSVxBJRKg63G8hJrAZAstCQt" -} -``` - -2. query the peers that the node is connected to -```shell script -./venus swarm peers - -{ - "Peers": [ - { - "Addr": "/ip4/101.206.156.202/tcp/23151", - "Peer": "12D3KooWNhc5Rzgc1c8p9kvBVhrLUB4ZZniwnpi4yQd1WVf952tp", - "Latency": "", - "Muxer": "", - "Streams": null - }, - { - "Addr": "/ip4/103.40.249.175/tcp/12350", - "Peer": "12D3KooWNfUzbXzVXqLV9pEubVenJoQHkWtkrR3aSvwyoXc7Kpys", - "Latency": "", - "Muxer": "", - "Streams": null - } -} -``` +## Speed up proof parameter download for first boot -3. connect to other node +Running Venus requires the download of chain's proof parameters which are large files which by default are hosted outside of China and very slow to download there. To get around that, users should set the following environment variable when running Venus: ```shell script -./venus swarm connect /ip4/192.168.1.151/tcp/6000/p2p/QmTBY16KjbJifqrepWriHNaSVxBJRKg63G8hJrAZAstCQt +export IPFS_GATEWAY=https://proof-parameters.s3.cn-south-1.jdcloud-oss.com/ipfs/ ``` -## Query state of actor +## Speed up Go module download during builds -1. get actor infomation +Building Venus requires downloading a few Go modules. These are usually hosted on Github, which has very low bandwidth from China. To fix this use a local proxy by setting the following variable before running Venus: ```shell script -./venus get-actor f02438 - -{ - "Address": "f02438", - "Balance": "659448.801619331229682404 FIL", - "Nonce": 0, - "Code": "bafkqaetgnfwc6mrpon2g64tbm5sw22lomvza (fil/2/storageminer)", - "Head": "bafy2bzacedexilt4kyzffmagjwpyenct5eddn7cazfjquz4v7b3b4czitn3au" -} -``` - -2. query information of miner - -```shell script -./venus state miner-info f02438 - -Available Balance: 8867.856318782083445622 FIL -Owner: f077316 -Worker: f0117055 -Control 0: f0117046 -Control 1: f0117042 -Control 2: f0117040 -PeerID: 12D3KooWMrDPhKaMeJFenXRFd4Rb9Zt111CBY7uY6AoZ93MTbLHw -Multiaddrs: /ip4/47.115.10.99/tcp/14567 -Consensus Fault End: -1 -SectorSize: 32 GiB (34359738368) -Byte Power: 35.78 PiB / 2.143 EiB (1.6305%) -Actual Power: 35.8 Pi / 2.14 Ei (1.6302%) - -Proving Period Start: 447666 (21 hours 36 minutes ago) -``` - -3. get sector infomation of miner - -```shell script -./venus state sector f02438 100001 - -SectorNumber: 100001 -SealProof: 3 -SealedCID: bagboea4b5abcaps45jsrklqqa3dw26jd7rybpzwsneapwvx6s4pqludkhie3hflh -DealIDs: [] - -Activation: 898 (22 weeks 2 days ago) -Expiration: 1553585 (in 1 year 2 weeks) - -DealWeight: 0 -VerifiedDealWeight: 0 -InitialPledge: 0.99999998430674944 FIL -ExpectedDayReward: 0.503660272286038996 FIL -ExpectedStoragePledge: 1.42807706338520528 FIL - -Deadline: 0 -Partition: 0 -``` - -4. search msg by id - -```shell script -./venus state search-msg bafy2bzaceckluouswlxpaujhihar4yngk3dx6daqbjfoyolbfvlelwgapmzxg - -message was executed in tipset: [bafy2bzacebek5gtutmhdvt5rpt6s2k7exk2ve2tj3f2h36nswnw7ehbbmirec bafy2bzaceaem7ljdwxl3eqncy7r7cc3225sx24g6oyzbsf4p7pavcxasuzcs2 bafy2bzacecty4e55ryfjmdjc24jwp2iwobk6pqk4mrsmsjdjtpchsizyervqe bafy2bzacecbldsf73ekzxqsgxawupwhx4cm5xvy6qp43ne5qkss42xvnfjcic bafy2bzaceajgyz6y26fbhsirnrizdt4yt55374abobm5lzugl3eik3yd23afk] -Exit Code: 0 -Gas Used: 13133828 -``` - -5. wait for msg result of msgid - -```shell script -./venus state wait-msg bafy2bzaceanbalwsqc5fetxcdfamfovlpkdjd2s5eje4bwsaxnrrbyswjv5g4 - -message was executed in tipset: [bafy2bzacebek5gtutmhdvt5rpt6s2k7exk2ve2tj3f2h36nswnw7ehbbmirec bafy2bzaceaem7ljdwxl3eqncy7r7cc3225sx24g6oyzbsf4p7pavcxasuzcs2 bafy2bzacecty4e55ryfjmdjc24jwp2iwobk6pqk4mrsmsjdjtpchsizyervqe bafy2bzacecbldsf73ekzxqsgxawupwhx4cm5xvy6qp43ne5qkss42xvnfjcic bafy2bzaceajgyz6y26fbhsirnrizdt4yt55374abobm5lzugl3eik3yd23afk] -Exit Code: 0 -Gas Used: 44152257 -Return: +export GOPROXY=https://goproxy.cn ``` diff --git a/docs/advanced/Tips-Running-In-China.md b/docs/advanced/Tips-Running-In-China.md deleted file mode 100644 index b896b3af8..000000000 --- a/docs/advanced/Tips-Running-In-China.md +++ /dev/null @@ -1,19 +0,0 @@ -# Venus: tips when running in China - -This guide provides a few tips for users in China to get around some of the bandwidth issues or slowness they can suffer when building and running Venus. - -## Speed up proof parameter download for first boot - -Running Venus requires the download of chain's proof parameters which are large files which by default are hosted outside of China and very slow to download there. To get around that, users should set the following environment variable when running Venus: - -```shell script -export IPFS_GATEWAY=https://proof-parameters.s3.cn-south-1.jdcloud-oss.com/ipfs/ -``` - -## Speed up Go module download during builds - -Building Venus requires downloading a few Go modules. These are usually hosted on Github, which has very low bandwidth from China. To fix this use a local proxy by setting the following variable before running Venus: - -```shell script -export GOPROXY=https://goproxy.cn -``` diff --git a/docs/advanced/venus-cli.md b/docs/advanced/venus-cli.md new file mode 100644 index 000000000..33b07698c --- /dev/null +++ b/docs/advanced/venus-cli.md @@ -0,0 +1,368 @@ +# CLI Commands + +For a complete list of available commands, simply run `venus --help` in your terminal. + +``` + START RUNNING FILECOIN + venus config [] - Get and set filecoin config values + venus daemon - Start a long-running daemon process + venus wallet - Manage your filecoin wallets + + VIEW DATA STRUCTURES + venus chain - Inspect the filecoin blockchain + venus sync - Inspect the filecoin Sync + venus dag - Interact with IPLD DAG objects + venus show - Get human-readable representations of filecoin objects + + NETWORK COMMANDS + venus swarm - Interact with the swarm + venus drand - retrieve drand randomness + + MESSAGE COMMANDS + venus send - Send message + venus mpool - Manage the message pool + + State COMMANDS + venus state wait-msg - Wait for a message to appear on chain + venus state search-msg - Search to see whether a message has appeared on chain + venus state power - Query network or miner power + venus state sectors - Query the sector set of a miner + venus state active-sectors - Query the active sector set of a miner + venus state sector - Get miner sector info + venus state get-actor - Print actor information + venus state lookup - Find corresponding ID address + venus state sector-size - Look up miners sector size + venus state get-deal - View on-chain deal info + venus state miner-info - Retrieve miner information + venus state network-version - MReturns the network version + venus state list-actor - list all actors + + TOOL COMMANDS + venus inspect - Show info about the venus node + venus leb128 - Leb128 cli encode/decode + venus log - Interact with the daemon event log output + venus protocol - Show protocol parameter details + venus version - Show venus version information + venus seed - Seal sectors for genesis miner +``` + + +# Common commands + +# Start a mainnet node + +```shell script +./venus daemon +``` + +## Query chain status + +1. get current head tipset + +```shell script +./venus chain head + +{ + "Height": 449124, + "ParentWeight": "9725370313", + "Cids": [ + { + "/": "bafy2bzacectt2udhaow37r53dfpnq6o3edvf5iswbpk77bcfiuce4xn5zkc3g" + }, + { + "/": "bafy2bzacebjintkddt24xdqvma3xwqurp6bahdhqxvwc54kqvuxbi3tiy2rig" + }, + { + "/": "bafy2bzaceczumkmzgjfasc4cpb2cqkhhv5eqgf2ikzgwgmw5554bgguivykf6" + }, + { + "/": "bafy2bzacebd5jt744qsoi5pieisxme2xtmdgmlylma2wgbbu2vmrp3bjlflq2" + }, + { + "/": "bafy2bzacedl3fvcvybsukh4odytkz2fxemrr2rln7t75oqj2wkj7yg2vohl3g" + } + ], + "Timestamp": "2021-01-28 04:42:00" +} +``` + +2. list recent tipset +```shell script +./venus chain ls +[ +....... + { + "Height": 449115, + "Timestamp": "2021-01-28 04:37:30", + "Blocks": [ + { + "Cid": { + "/": "bafy2bzaceb2xn4hnnovksfeqjrig44bgxow5ixuymlo75nnftjad2mufzzjjw" + }, + "Miner": "t0112667" + }, + { + "Cid": { + "/": "bafy2bzacecoswf32ayvdhotbp3pcgabq6q34c5czqscugb5lfcig26igbkem2" + }, + "Miner": "t030347" + }, + { + "Cid": { + "/": "bafy2bzacedo3xucwhpz3ndralqbrgzmbzxvkj23btp46tppby2vadyovvtux6" + }, + "Miner": "t03176" + }, + { + "Cid": { + "/": "bafy2bzacecrnceor3dj3zixrizqkgcivxrevy7jkzh5wolgp7kok7cimcsoyu" + }, + "Miner": "t089228" + }, + { + "Cid": { + "/": "bafy2bzaceas2qb642iagyc2konpf3bdykw7kryv245dvsmuboikanj35ymes4" + }, + "Miner": "t023152" + } + ] + } +] +``` + +3. set tipset head + +```shell script + ./venus chain set-head bafy2bzaceckeg7onfhua5jf4xrnrzt2erix5pibjov2r4vvdhcih6oql7vm24 bafy2bzacedt74pgv2rk7iddptz2nz4kfcsoccqnrb4q7mbluof6puw5iccqms +``` + +## Wallet command + +1. create address + +```shell script +./venus wallet new +``` + +2. list address + +```shell script +./venus wallet ls + +Address Balance Nonce Default +f1nixbb3trp2mujzf5z7mguidthwo4levnldy4s4a 0 FIL 0 +f1ytd5blzi3y2nsupqzye6ogpaphow3lljii3zkdi 0 FIL 0 +f3qmxlwlzmvvn6vwo73jhuzjufmo65lrdwecxcmd7poyv5yex5hqngvo26sqjzzdge4vj3yxmwn5x24igremna 0 FIL 0 X +f3rjuxqnsjk7wuuzf3rqwsfxpbmqp23dn6ik5vyow2ntw5sgdxyijh7cfbujbmwtzdpii6ikunumez55jcxbbq 0 FIL 0 +``` + +3. set default address + +```shell script +./venus wallet set-default f3qmxlwlzmvvn6vwo73jhuzjufmo65lrdwecxcmd7poyv5yex5hqngvo26sqjzzdge4vj3yxmwn5x24igremna +``` + +4. get default address + +```shell script +./venus wallet default +``` + +5. export/import address,compatible with the lotus private key format + +```shell script +./venus wallet import +./venus wallet export +``` + +6. query balance of address + +```shell script +./venus wallet balance f3rjuxqnsjk7wuuzf3rqwsfxpbmqp23dn6ik5vyow2ntw5sgdxyijh7cfbujbmwtzdpii6ikunumez55jcxbbq +0 FIL +``` + +7. set wallet password + +```shell script +./venus wallet set-password +``` + +8. lock and unlock wallet + +```shell script +./venus wallet lock +./venus wallet unlock +``` + +## Sync commnad + +1. query sync status + +```shell script +./venus sync status + +Syncing: +SyncTarget: 1 + Base: 450231 { bafy2bzaceby6aq4obp5pjgjsxtyneqgsrcou4tgx2rsgqptoxgb4pyxh4asae bafy2bzacebancasvojeszwqnfvexlmn52vgcq7ns45nnwzixr67dzsel2kolu bafy2bzaced37mxrstmq2ij4x3szso446fodutq4jaarns6n2vdijeem2k44be bafy2bzacebtxektwn3mndyhpwnj6rkhnf6mfnfa2fyds4jv2xxb3nukuy26d6 bafy2bzacedmjrn42yzfl4yzuzn66ir33exrjxotahtets7btjfm4x36rdcsgu } + Target: 450239 { bafy2bzaceb6ulfdjeak6uaxrsd62jobtuilee4wkk3bj5ta4qfi7ll52tbyrm bafy2bzacebkbsyo2hp4qgrsfgzjz5qvyrgfz6n6nsq6kfxvw7s4s66yfynpwi } + Current: 450232 { bafy2bzacedwjdxb5jx5wo4zwg7emwfhbw34bvs3hvo362r3um25nisdakrl7g bafy2bzaced4jq6hx56o4symynuwqhlhf4kzo3qdqofeilizzflejvgjjr2bmq } + Status: syncing + Err: + +SyncTarget: 2 + Base: 450231 { bafy2bzaceby6aq4obp5pjgjsxtyneqgsrcou4tgx2rsgqptoxgb4pyxh4asae bafy2bzacebancasvojeszwqnfvexlmn52vgcq7ns45nnwzixr67dzsel2kolu bafy2bzaced37mxrstmq2ij4x3szso446fodutq4jaarns6n2vdijeem2k44be bafy2bzacebtxektwn3mndyhpwnj6rkhnf6mfnfa2fyds4jv2xxb3nukuy26d6 bafy2bzacedmjrn42yzfl4yzuzn66ir33exrjxotahtets7btjfm4x36rdcsgu } + Target: 450238 { bafy2bzacebtf2l5y34acbfnie6ilvvhxj5gyrnknnygintqzqkoxcsnmmuado bafy2bzacedswqjogt57cf7q22ebbrnbw3qygxd6q3z6vhm74b6tyzqjlrvox4 bafy2bzacecrv2kxpvuocgrtfjlot3da57655zbvrcu2reuospak3vdxa3u7v2 bafy2bzacecahv6twxmeihivncobqadfm7xyh3gvnrpjhs47i7537er7uyeote } + Current: 450233 { bafy2bzaceb4ybtg3p63fd7hvrajj5cw7oi52ie3zj2r3apxvod4u4e3y3svac bafy2bzacecmasydskhxrcrdih6na4qxpcdpavj6d5wydgft7ba574mx57ij76 bafy2bzacedrxgj2cjq537zoe24qhzizkx5ix4g7rpzbjl73qfm4ldom2kt7pq bafy2bzaceat2eg6ujh2qmlwwvna5qmntbayquvesvik55jfbrfkcgugcl6dmq bafy2bzaceawwc3hp3b5bl2a3gjmvehxytqvxtabtwosj77lnbcmu5ln4gh77u bafy2bzaceabwkrifkce2rraystlg2ouxudklyd2b3pmck2ineguidz4r3x35o bafy2bzacebfxvqczftyzoxosdrlxylhupurmovpqhympe6anukleg2z7emmbo bafy2bzaceb2bbk4ykijqz7em4zgag5eikvqzierp6mevw2bytnj4xrbb2dthc } + Status: syncing + Err: + +SyncTarget: 3 + Base: 450231 { bafy2bzaceby6aq4obp5pjgjsxtyneqgsrcou4tgx2rsgqptoxgb4pyxh4asae bafy2bzacebancasvojeszwqnfvexlmn52vgcq7ns45nnwzixr67dzsel2kolu bafy2bzaced37mxrstmq2ij4x3szso446fodutq4jaarns6n2vdijeem2k44be bafy2bzacebtxektwn3mndyhpwnj6rkhnf6mfnfa2fyds4jv2xxb3nukuy26d6 bafy2bzacedmjrn42yzfl4yzuzn66ir33exrjxotahtets7btjfm4x36rdcsgu } + Target: 450237 { bafy2bzaceavndy2pgdjpacapy4gs6pszbvxssvwrnw4uydnne4boowvyjlzjm bafy2bzacedutkurnrzna3hctqwxkrghhy6ufkanonfbq54cjcaoquoss4galy bafy2bzaced477xs5udb2r2xkomt6webzmjcwvy257bhpvgxrq6v573o66ywsy bafy2bzaceddjcr45kqhrwikemn7lfuhe5k3cqhhebrrzucsemv4bbxh755hx4 } + Current: 450233 { bafy2bzaceb4ybtg3p63fd7hvrajj5cw7oi52ie3zj2r3apxvod4u4e3y3svac bafy2bzacecmasydskhxrcrdih6na4qxpcdpavj6d5wydgft7ba574mx57ij76 bafy2bzacedrxgj2cjq537zoe24qhzizkx5ix4g7rpzbjl73qfm4ldom2kt7pq bafy2bzaceat2eg6ujh2qmlwwvna5qmntbayquvesvik55jfbrfkcgugcl6dmq bafy2bzaceawwc3hp3b5bl2a3gjmvehxytqvxtabtwosj77lnbcmu5ln4gh77u bafy2bzaceabwkrifkce2rraystlg2ouxudklyd2b3pmck2ineguidz4r3x35o bafy2bzacebfxvqczftyzoxosdrlxylhupurmovpqhympe6anukleg2z7emmbo bafy2bzaceb2bbk4ykijqz7em4zgag5eikvqzierp6mevw2bytnj4xrbb2dthc } + Status: syncing + Err: + +Waiting: +SyncTarget: 4 + Base: 450231 { bafy2bzaceby6aq4obp5pjgjsxtyneqgsrcou4tgx2rsgqptoxgb4pyxh4asae bafy2bzacebancasvojeszwqnfvexlmn52vgcq7ns45nnwzixr67dzsel2kolu bafy2bzaced37mxrstmq2ij4x3szso446fodutq4jaarns6n2vdijeem2k44be bafy2bzacebtxektwn3mndyhpwnj6rkhnf6mfnfa2fyds4jv2xxb3nukuy26d6 bafy2bzacedmjrn42yzfl4yzuzn66ir33exrjxotahtets7btjfm4x36rdcsgu } + Target: 450239 { bafy2bzaceb6ulfdjeak6uaxrsd62jobtuilee4wkk3bj5ta4qfi7ll52tbyrm bafy2bzacebkbsyo2hp4qgrsfgzjz5qvyrgfz6n6nsq6kfxvw7s4s66yfynpwi bafy2bzacebca26ouxt6tv32ul46457zftb5ozy6lmeejtrw2w5srb4zgnflou } + Current: + Status: wait + Err: + +History: +``` + +2. set the number of synchronizations + +```shell script +./venus sync set-concurrent 1 +``` + +## Network command + +1. print local node information + +```shell script +./venus swarm id + +{ + "Addresses": [ + "/ip4/192.168.1.151/tcp/6000/p2p/QmTBY16KjbJifqrepWriHNaSVxBJRKg63G8hJrAZAstCQt", + "/ip4/127.0.0.1/tcp/6000/p2p/QmTBY16KjbJifqrepWriHNaSVxBJRKg63G8hJrAZAstCQt" + ], + "ID": "QmTBY16KjbJifqrepWriHNaSVxBJRKg63G8hJrAZAstCQt" +} +``` + +2. query the peers that the node is connected to +```shell script +./venus swarm peers + +{ + "Peers": [ + { + "Addr": "/ip4/101.206.156.202/tcp/23151", + "Peer": "12D3KooWNhc5Rzgc1c8p9kvBVhrLUB4ZZniwnpi4yQd1WVf952tp", + "Latency": "", + "Muxer": "", + "Streams": null + }, + { + "Addr": "/ip4/103.40.249.175/tcp/12350", + "Peer": "12D3KooWNfUzbXzVXqLV9pEubVenJoQHkWtkrR3aSvwyoXc7Kpys", + "Latency": "", + "Muxer": "", + "Streams": null + } +} +``` + +3. connect to other node + +```shell script +./venus swarm connect /ip4/192.168.1.151/tcp/6000/p2p/QmTBY16KjbJifqrepWriHNaSVxBJRKg63G8hJrAZAstCQt +``` + +## Query state of actor + +1. get actor infomation + +```shell script +./venus get-actor f02438 + +{ + "Address": "f02438", + "Balance": "659448.801619331229682404 FIL", + "Nonce": 0, + "Code": "bafkqaetgnfwc6mrpon2g64tbm5sw22lomvza (fil/2/storageminer)", + "Head": "bafy2bzacedexilt4kyzffmagjwpyenct5eddn7cazfjquz4v7b3b4czitn3au" +} +``` + +2. query information of miner + +```shell script +./venus state miner-info f02438 + +Available Balance: 8867.856318782083445622 FIL +Owner: f077316 +Worker: f0117055 +Control 0: f0117046 +Control 1: f0117042 +Control 2: f0117040 +PeerID: 12D3KooWMrDPhKaMeJFenXRFd4Rb9Zt111CBY7uY6AoZ93MTbLHw +Multiaddrs: /ip4/47.115.10.99/tcp/14567 +Consensus Fault End: -1 +SectorSize: 32 GiB (34359738368) +Byte Power: 35.78 PiB / 2.143 EiB (1.6305%) +Actual Power: 35.8 Pi / 2.14 Ei (1.6302%) + +Proving Period Start: 447666 (21 hours 36 minutes ago) +``` + +3. get sector infomation of miner + +```shell script +./venus state sector f02438 100001 + +SectorNumber: 100001 +SealProof: 3 +SealedCID: bagboea4b5abcaps45jsrklqqa3dw26jd7rybpzwsneapwvx6s4pqludkhie3hflh +DealIDs: [] + +Activation: 898 (22 weeks 2 days ago) +Expiration: 1553585 (in 1 year 2 weeks) + +DealWeight: 0 +VerifiedDealWeight: 0 +InitialPledge: 0.99999998430674944 FIL +ExpectedDayReward: 0.503660272286038996 FIL +ExpectedStoragePledge: 1.42807706338520528 FIL + +Deadline: 0 +Partition: 0 +``` + +4. search msg by id + +```shell script +./venus state search-msg bafy2bzaceckluouswlxpaujhihar4yngk3dx6daqbjfoyolbfvlelwgapmzxg + +message was executed in tipset: [bafy2bzacebek5gtutmhdvt5rpt6s2k7exk2ve2tj3f2h36nswnw7ehbbmirec bafy2bzaceaem7ljdwxl3eqncy7r7cc3225sx24g6oyzbsf4p7pavcxasuzcs2 bafy2bzacecty4e55ryfjmdjc24jwp2iwobk6pqk4mrsmsjdjtpchsizyervqe bafy2bzacecbldsf73ekzxqsgxawupwhx4cm5xvy6qp43ne5qkss42xvnfjcic bafy2bzaceajgyz6y26fbhsirnrizdt4yt55374abobm5lzugl3eik3yd23afk] +Exit Code: 0 +Gas Used: 13133828 +``` + +5. wait for msg result of msgid + +```shell script +./venus state wait-msg bafy2bzaceanbalwsqc5fetxcdfamfovlpkdjd2s5eje4bwsaxnrrbyswjv5g4 + +message was executed in tipset: [bafy2bzacebek5gtutmhdvt5rpt6s2k7exk2ve2tj3f2h36nswnw7ehbbmirec bafy2bzaceaem7ljdwxl3eqncy7r7cc3225sx24g6oyzbsf4p7pavcxasuzcs2 bafy2bzacecty4e55ryfjmdjc24jwp2iwobk6pqk4mrsmsjdjtpchsizyervqe bafy2bzacecbldsf73ekzxqsgxawupwhx4cm5xvy6qp43ne5qkss42xvnfjcic bafy2bzaceajgyz6y26fbhsirnrizdt4yt55374abobm5lzugl3eik3yd23afk] +Exit Code: 0 +Gas Used: 44152257 +Return: +``` diff --git a/docs/guide/How-To-Deploy-MingPool.md b/docs/guide/How-To-Deploy-MingPool.md index afa33190d..1d5c9be2b 100644 --- a/docs/guide/How-To-Deploy-MingPool.md +++ b/docs/guide/How-To-Deploy-MingPool.md @@ -200,7 +200,7 @@ Start venus daemon for chain synchronization. Use `--network` to specify the net ```bash $ nohup ./venus daemon --network nerpa \ ---authURL \ +--authURL \ > venus.log 2>&1 & ``` @@ -222,22 +222,8 @@ Change `apiAddress` from `/ip4/127.0.0.1/tcp/3453` to `/ip4/0.0.0.0/tcp/3453`. S ```json { - "api": { - "venusAuthURL": "http://192.168.5.62:8989", - "apiAddress": "/ip4/0.0.0.0/tcp/3453", - "accessControlAllowOrigin": [ - "http://localhost:8080", - "https://localhost:8080", - "http://127.0.0.1:8080", - "https://127.0.0.1:8080" - ], - "accessControlAllowCredentials": false, - "accessControlAllowMethods": [ - "GET", - "POST", - "PUT" - ] - }, + "api": {"apiAddress": "/ip4/0.0.0.0/tcp/3453"} +} ``` Restart venus daemon for the config to take into effects. @@ -246,7 +232,7 @@ Restart venus daemon for the config to take into effects. $ ps -ef | grep venus $ kill $ nohup ./venus daemon --network nerpa \ ---authURL \ +--authURL \ > venus.log 2>&1 ``` @@ -265,7 +251,7 @@ Start venus-messager. Note that `--auth-url`, `--node-url` and `--auth-token` ar ```bash $ nohup ./venus-messager run \ ---auth-url= \ +--auth-url= \ --node-url /ip4//tcp/3453 \ --gateway-url=/ip4//tcp/45132 \ --auth-token \ @@ -297,7 +283,7 @@ Initialize venus-miner. $ ./venus-miner init # For nettype, choose from mainnet, nerpanet, debug, 2k, calibnet --nettype nerpanet ---auth-api \ +--auth-api \ --token \ --gateway-api /ip4//tcp/45132 --api /ip4//tcp/3453 \ @@ -311,7 +297,7 @@ $ nohup ./venus-miner run >>miner.log 2>& 1 & ### Miner management -Once a miner, venus-sealer with proper miner id, connected to your shared modules. You can query the status of said miner id by the following. +Once a user, venus-sealer with proper miner id, connected to your shared modules. You can query the status of said miner id by the following. ```bash $ ./venus-miner address state diff --git a/docs/guide/Using-venus-Shared-Modules.md b/docs/guide/Using-venus-Shared-Modules.md index 65770e00b..97fd79715 100644 --- a/docs/guide/Using-venus-Shared-Modules.md +++ b/docs/guide/Using-venus-Shared-Modules.md @@ -176,7 +176,7 @@ Change `[APIRegisterHub]` section of `~/.venus_wallet/config.toml` using the cr ```toml [APIRegisterHub] -RegisterAPI = ["/ip4//tcp/45132"] +RegisterAPI = ["/ip4//tcp/45132"] Token = "" SupportAccounts = [""] ``` @@ -225,8 +225,8 @@ $ nohup ./venus-sealer init \ --network nerpa \ # Config for different shared venus modules --node-url /ip4//tcp/3453 \ ---messager-url /ip4//tcp/3453 \ ---gateway-url /ip4//tcp/3453 \ +--messager-url /ip4//tcp/ \ +--gateway-url /ip4//tcp/ \ --auth-token \ # Flags sealer to not storing any sealed sectors on the machine it runs on # You can leave out this flag if you are on testnet @@ -258,8 +258,8 @@ $ ./venus-sealer init \ --network nerpa \ # Config for different shared venus modules --node-url /ip4//tcp/3453 \ ---messager-url /ip4//tcp/3453 \ ---gateway-url /ip4//tcp/3453 \ +--messager-url /ip4//tcp/ \ +--gateway-url /ip4//tcp/ \ --auth-token \ # Flags sealer to not store any sealed sectors on the machine it runs on --no-local-storage \ diff --git a/docs/modules/How-To-Use-Messager.md b/docs/modules/How-To-Use-Messager.md index b19b6cee7..843921548 100644 --- a/docs/modules/How-To-Use-Messager.md +++ b/docs/modules/How-To-Use-Messager.md @@ -6,13 +6,13 @@ messager is a component used to manage local messages, with the purpose of savin ### Clone this git repository to your machine -``` +```bash git clone https://github.com/filecoin-project/venus-messager.git ``` ### Install Dependencies and Build -``` +```bash make deps make ``` @@ -25,7 +25,7 @@ make * If the specified configuration file does not exist at startup, a configuration file with the corresponding name will be generated and the value of the set parameter will be written to the configuration file * When the specified configuration file exists at startup, the values of the set parameters will be used, but will not be written to the configuration file. If the parameters are not set, the values of the parameters in the configuration file will be used -``` +```bash # --config | -c specify config file (default: "./messager.toml") # --auth-url url for auth server (default: "http://127.0.0.1:8989") # --node-url url for connection lotus/venus @@ -41,13 +41,13 @@ make 1. search message -``` +```bash ./venus-messager msg search --id= ``` 2. list message -``` +```bash ./venus-messager msg list # list messages with the same address ./venus-messager msg list --from
@@ -55,31 +55,31 @@ make 3. update one filled message state -``` +```bash ./venus-messager msg update_filled_msg --id= ``` 4. update all filled message state -``` +```bash ./venus-messager msg update_all_filled_msg ``` 5. wait a message result by id -``` +```bash ./venus-messager msg wait ``` 6. republish a message by id -``` +```bash ./venus-messager msg republish ``` 7. replace a message -``` +```bash ./venus-messager msg replace --gas-feecap=[gas-feecap] --gas-premium=[gas-premium] --gas-limit=[gas-limit] --auto=[auto] --max-fee=[max-fee] # or ./venus-messager msg replace --gas-feecap=[gas-feecap] --gas-premium=[gas-premium] --gas-limit=[gas-limit] --auto=[auto] --max-fee=[max-fee] @@ -87,19 +87,19 @@ make 8. list failed messages, maybe signed message failed or gas estimate failed -``` +```bash ./venus-messager msg list-fail ``` 9. lists message that have not been chained for a period of time -``` +```bash ./venus-messager msg list-blocked ``` 10. manual mark error messages -``` +```bash ./venus-messager msg mark-bad ``` @@ -107,13 +107,13 @@ make 1. search address -``` +```bash ./venus-messager address search
``` 2. list address -``` +```bash ./venus-messager address list ``` @@ -121,25 +121,25 @@ make > The nonce of the address is set to nonce on the chain, and all unchain messages are marked as failed messages -``` +```bash ./venus-messager reset
``` 4. forbidden address -``` +```bash ./venus-messager address forbidden
``` 5. activate a frozen address -``` +```bash ./venus-messager address active
``` 6. set the number of address selection messages -``` +```bash ./venus-messager address set-sel-msg-num --num=5
``` @@ -147,7 +147,7 @@ make > venus message address set-fee-params [options] address -``` +```bash # options # --gas-overestimation value Estimate the coefficient of gas (default: 0) # --max-feecap value Max feecap for a message (burn and pay to miner, attoFIL/GasUnit) @@ -160,13 +160,13 @@ make 1. get shared params -``` +```bash ./venus-messager share-params get ``` 2. set shared params -``` +```bash # expireEpoch is the expiration height of the message, 0 means it will not expire # selMsgNum is the maximum number of messages pushed to mpool by a single address at a time # scanInterval is the interval to scan the remote wallet @@ -177,7 +177,7 @@ make 3. manual refresh shared params from DB -``` +```bash ./venus-messager share-params refresh ``` @@ -185,25 +185,25 @@ make 1. search node info by name -``` +```bashbash ./venus-messager node search ``` 2. add node info -``` +```bash ./venus-messager node add --name= --url= --token= ``` 3. list node info -``` +```bash ./venus-messager node list ``` 4. del node info by name -``` +```bash ./venus-messager node del ``` @@ -211,7 +211,7 @@ make 1. set log level -``` +```bash # eg. trace,debug,info,warn|warning,error,fatal,panic ./venus-messager log set-level ``` \ No newline at end of file diff --git a/docs/zh/advanced/README.md b/docs/zh/advanced/README.md index 55ef8de2c..31d57167c 100644 --- a/docs/zh/advanced/README.md +++ b/docs/zh/advanced/README.md @@ -1,368 +1,19 @@ -# CLI命令行 +# Venus: 在中国部署运行的小贴士 -可以在你的终端运行 `venus --help` ,以获得完整的可用命令列表。 +本贴士为中国用户提供了一些技巧,以解决在构建和运行Venus时可能遇到的一些带宽问题或速度缓慢。 -``` - START RUNNING FILECOIN - venus config [] - Get and set filecoin config values - venus daemon - Start a long-running daemon process - venus wallet - Manage your filecoin wallets - - VIEW DATA STRUCTURES - venus chain - Inspect the filecoin blockchain - venus sync - Inspect the filecoin Sync - venus dag - Interact with IPLD DAG objects - venus show - Get human-readable representations of filecoin objects - - NETWORK COMMANDS - venus swarm - Interact with the swarm - venus drand - retrieve drand randomness - - MESSAGE COMMANDS - venus send - Send message - venus mpool - Manage the message pool - - State COMMANDS - venus state wait-msg - Wait for a message to appear on chain - venus state search-msg - Search to see whether a message has appeared on chain - venus state power - Query network or miner power - venus state sectors - Query the sector set of a miner - venus state active-sectors - Query the active sector set of a miner - venus state sector - Get miner sector info - venus state get-actor - Print actor information - venus state lookup - Find corresponding ID address - venus state sector-size - Look up miners sector size - venus state get-deal - View on-chain deal info - venus state miner-info - Retrieve miner information - venus state network-version - MReturns the network version - venus state list-actor - list all actors - - TOOL COMMANDS - venus inspect - Show info about the venus node - venus leb128 - Leb128 cli encode/decode - venus log - Interact with the daemon event log output - venus protocol - Show protocol parameter details - venus version - Show venus version information - venus seed - Seal sectors for genesis miner -``` - - -# 常用命令 - -# 启动主网节点 - - ```sh - ./venus daemon - ``` - -## 查询链状态 - -1. 获取当前tipset的head信息 - - ```sh - ./venus chain head - - { - "Height": 449124, - "ParentWeight": "9725370313", - "Cids": [ - { - "/": "bafy2bzacectt2udhaow37r53dfpnq6o3edvf5iswbpk77bcfiuce4xn5zkc3g" - }, - { - "/": "bafy2bzacebjintkddt24xdqvma3xwqurp6bahdhqxvwc54kqvuxbi3tiy2rig" - }, - { - "/": "bafy2bzaceczumkmzgjfasc4cpb2cqkhhv5eqgf2ikzgwgmw5554bgguivykf6" - }, - { - "/": "bafy2bzacebd5jt744qsoi5pieisxme2xtmdgmlylma2wgbbu2vmrp3bjlflq2" - }, - { - "/": "bafy2bzacedl3fvcvybsukh4odytkz2fxemrr2rln7t75oqj2wkj7yg2vohl3g" - } - ], - "Timestamp": "2021-01-28 04:42:00" - } - ``` - -2. 最近的tipset的信息列表 - ```sh - ./venus chain ls - [ - ....... - { - "Height": 449115, - "Timestamp": "2021-01-28 04:37:30", - "Blocks": [ - { - "Cid": { - "/": "bafy2bzaceb2xn4hnnovksfeqjrig44bgxow5ixuymlo75nnftjad2mufzzjjw" - }, - "Miner": "t0112667" - }, - { - "Cid": { - "/": "bafy2bzacecoswf32ayvdhotbp3pcgabq6q34c5czqscugb5lfcig26igbkem2" - }, - "Miner": "t030347" - }, - { - "Cid": { - "/": "bafy2bzacedo3xucwhpz3ndralqbrgzmbzxvkj23btp46tppby2vadyovvtux6" - }, - "Miner": "t03176" - }, - { - "Cid": { - "/": "bafy2bzacecrnceor3dj3zixrizqkgcivxrevy7jkzh5wolgp7kok7cimcsoyu" - }, - "Miner": "t089228" - }, - { - "Cid": { - "/": "bafy2bzaceas2qb642iagyc2konpf3bdykw7kryv245dvsmuboikanj35ymes4" - }, - "Miner": "t023152" - } - ] - } - ] - ``` - -3. 设置tipset的head - - ```sh - ./venus chain set-head bafy2bzaceckeg7onfhua5jf4xrnrzt2erix5pibjov2r4vvdhcih6oql7vm24 bafy2bzacedt74pgv2rk7iddptz2nz4kfcsoccqnrb4q7mbluof6puw5iccqms - ``` - -## 钱包命令 - -1. 创建地址 - - ```sh - ./venus wallet new - ``` - -2. 地址列表 - - ```sh - ./venus wallet ls - - Address Balance Nonce Default - f1nixbb3trp2mujzf5z7mguidthwo4levnldy4s4a 0 FIL 0 - f1ytd5blzi3y2nsupqzye6ogpaphow3lljii3zkdi 0 FIL 0 - f3qmxlwlzmvvn6vwo73jhuzjufmo65lrdwecxcmd7poyv5yex5hqngvo26sqjzzdge4vj3yxmwn5x24igremna 0 FIL 0 X - f3rjuxqnsjk7wuuzf3rqwsfxpbmqp23dn6ik5vyow2ntw5sgdxyijh7cfbujbmwtzdpii6ikunumez55jcxbbq 0 FIL 0 - ``` - -3. 设置默认地址 - - ```sh - ./venus wallet set-default f3qmxlwlzmvvn6vwo73jhuzjufmo65lrdwecxcmd7poyv5yex5hqngvo26sqjzzdge4vj3yxmwn5x24igremna - ``` - -4. 获取默认地址 - - ```sh - ./venus wallet default - ``` - -5. 导出/导入地址,兼容lotus私钥格式 - - ```sh - ./venus wallet import - ./venus wallet export - ``` - -6. 查询地址余额 - - ```sh - ./venus wallet balance f3rjuxqnsjk7wuuzf3rqwsfxpbmqp23dn6ik5vyow2ntw5sgdxyijh7cfbujbmwtzdpii6ikunumez55jcxbbq - 0 FIL - ``` - -7. 设置钱包密码 - - ```sh - ./venus wallet set-password - ``` - -8. 锁定与解锁钱包 - - ```sh - ./venus wallet lock - ./venus wallet unlock - ``` - -## 同步命令 - -1. 查询同步状态 - - ```sh - ./venus sync status +## 加快首次启动时的证明参数下载 - Syncing: - SyncTarget: 1 - Base: 450231 { bafy2bzaceby6aq4obp5pjgjsxtyneqgsrcou4tgx2rsgqptoxgb4pyxh4asae bafy2bzacebancasvojeszwqnfvexlmn52vgcq7ns45nnwzixr67dzsel2kolu bafy2bzaced37mxrstmq2ij4x3szso446fodutq4jaarns6n2vdijeem2k44be bafy2bzacebtxektwn3mndyhpwnj6rkhnf6mfnfa2fyds4jv2xxb3nukuy26d6 bafy2bzacedmjrn42yzfl4yzuzn66ir33exrjxotahtets7btjfm4x36rdcsgu } - Target: 450239 { bafy2bzaceb6ulfdjeak6uaxrsd62jobtuilee4wkk3bj5ta4qfi7ll52tbyrm bafy2bzacebkbsyo2hp4qgrsfgzjz5qvyrgfz6n6nsq6kfxvw7s4s66yfynpwi } - Current: 450232 { bafy2bzacedwjdxb5jx5wo4zwg7emwfhbw34bvs3hvo362r3um25nisdakrl7g bafy2bzaced4jq6hx56o4symynuwqhlhf4kzo3qdqofeilizzflejvgjjr2bmq } - Status: syncing - Err: +运行Venus需要下载链的证明参数,这些参数是大文件,默认情况下托管在国外,在国内下载速度缓慢。为了解决这个问题,用户应该在运行Venus时设置以下环境变量: - SyncTarget: 2 - Base: 450231 { bafy2bzaceby6aq4obp5pjgjsxtyneqgsrcou4tgx2rsgqptoxgb4pyxh4asae bafy2bzacebancasvojeszwqnfvexlmn52vgcq7ns45nnwzixr67dzsel2kolu bafy2bzaced37mxrstmq2ij4x3szso446fodutq4jaarns6n2vdijeem2k44be bafy2bzacebtxektwn3mndyhpwnj6rkhnf6mfnfa2fyds4jv2xxb3nukuy26d6 bafy2bzacedmjrn42yzfl4yzuzn66ir33exrjxotahtets7btjfm4x36rdcsgu } - Target: 450238 { bafy2bzacebtf2l5y34acbfnie6ilvvhxj5gyrnknnygintqzqkoxcsnmmuado bafy2bzacedswqjogt57cf7q22ebbrnbw3qygxd6q3z6vhm74b6tyzqjlrvox4 bafy2bzacecrv2kxpvuocgrtfjlot3da57655zbvrcu2reuospak3vdxa3u7v2 bafy2bzacecahv6twxmeihivncobqadfm7xyh3gvnrpjhs47i7537er7uyeote } - Current: 450233 { bafy2bzaceb4ybtg3p63fd7hvrajj5cw7oi52ie3zj2r3apxvod4u4e3y3svac bafy2bzacecmasydskhxrcrdih6na4qxpcdpavj6d5wydgft7ba574mx57ij76 bafy2bzacedrxgj2cjq537zoe24qhzizkx5ix4g7rpzbjl73qfm4ldom2kt7pq bafy2bzaceat2eg6ujh2qmlwwvna5qmntbayquvesvik55jfbrfkcgugcl6dmq bafy2bzaceawwc3hp3b5bl2a3gjmvehxytqvxtabtwosj77lnbcmu5ln4gh77u bafy2bzaceabwkrifkce2rraystlg2ouxudklyd2b3pmck2ineguidz4r3x35o bafy2bzacebfxvqczftyzoxosdrlxylhupurmovpqhympe6anukleg2z7emmbo bafy2bzaceb2bbk4ykijqz7em4zgag5eikvqzierp6mevw2bytnj4xrbb2dthc } - Status: syncing - Err: - - SyncTarget: 3 - Base: 450231 { bafy2bzaceby6aq4obp5pjgjsxtyneqgsrcou4tgx2rsgqptoxgb4pyxh4asae bafy2bzacebancasvojeszwqnfvexlmn52vgcq7ns45nnwzixr67dzsel2kolu bafy2bzaced37mxrstmq2ij4x3szso446fodutq4jaarns6n2vdijeem2k44be bafy2bzacebtxektwn3mndyhpwnj6rkhnf6mfnfa2fyds4jv2xxb3nukuy26d6 bafy2bzacedmjrn42yzfl4yzuzn66ir33exrjxotahtets7btjfm4x36rdcsgu } - Target: 450237 { bafy2bzaceavndy2pgdjpacapy4gs6pszbvxssvwrnw4uydnne4boowvyjlzjm bafy2bzacedutkurnrzna3hctqwxkrghhy6ufkanonfbq54cjcaoquoss4galy bafy2bzaced477xs5udb2r2xkomt6webzmjcwvy257bhpvgxrq6v573o66ywsy bafy2bzaceddjcr45kqhrwikemn7lfuhe5k3cqhhebrrzucsemv4bbxh755hx4 } - Current: 450233 { bafy2bzaceb4ybtg3p63fd7hvrajj5cw7oi52ie3zj2r3apxvod4u4e3y3svac bafy2bzacecmasydskhxrcrdih6na4qxpcdpavj6d5wydgft7ba574mx57ij76 bafy2bzacedrxgj2cjq537zoe24qhzizkx5ix4g7rpzbjl73qfm4ldom2kt7pq bafy2bzaceat2eg6ujh2qmlwwvna5qmntbayquvesvik55jfbrfkcgugcl6dmq bafy2bzaceawwc3hp3b5bl2a3gjmvehxytqvxtabtwosj77lnbcmu5ln4gh77u bafy2bzaceabwkrifkce2rraystlg2ouxudklyd2b3pmck2ineguidz4r3x35o bafy2bzacebfxvqczftyzoxosdrlxylhupurmovpqhympe6anukleg2z7emmbo bafy2bzaceb2bbk4ykijqz7em4zgag5eikvqzierp6mevw2bytnj4xrbb2dthc } - Status: syncing - Err: - - Waiting: - SyncTarget: 4 - Base: 450231 { bafy2bzaceby6aq4obp5pjgjsxtyneqgsrcou4tgx2rsgqptoxgb4pyxh4asae bafy2bzacebancasvojeszwqnfvexlmn52vgcq7ns45nnwzixr67dzsel2kolu bafy2bzaced37mxrstmq2ij4x3szso446fodutq4jaarns6n2vdijeem2k44be bafy2bzacebtxektwn3mndyhpwnj6rkhnf6mfnfa2fyds4jv2xxb3nukuy26d6 bafy2bzacedmjrn42yzfl4yzuzn66ir33exrjxotahtets7btjfm4x36rdcsgu } - Target: 450239 { bafy2bzaceb6ulfdjeak6uaxrsd62jobtuilee4wkk3bj5ta4qfi7ll52tbyrm bafy2bzacebkbsyo2hp4qgrsfgzjz5qvyrgfz6n6nsq6kfxvw7s4s66yfynpwi bafy2bzacebca26ouxt6tv32ul46457zftb5ozy6lmeejtrw2w5srb4zgnflou } - Current: - Status: wait - Err: - - History: - ``` - -2. 设置同步次数 - - ```sh - ./venus sync set-concurrent 1 - ``` - -## 网络命令 - -1. 打印本地节点信息 - - ```sh - ./venus swarm id - - { - "Addresses": [ - "/ip4/192.168.1.151/tcp/6000/p2p/QmTBY16KjbJifqrepWriHNaSVxBJRKg63G8hJrAZAstCQt", - "/ip4/127.0.0.1/tcp/6000/p2p/QmTBY16KjbJifqrepWriHNaSVxBJRKg63G8hJrAZAstCQt" - ], - "ID": "QmTBY16KjbJifqrepWriHNaSVxBJRKg63G8hJrAZAstCQt" - } - ``` - -2. 查询已连接的对方节点 - ```sh - ./venus swarm peers - - { - "Peers": [ - { - "Addr": "/ip4/101.206.156.202/tcp/23151", - "Peer": "12D3KooWNhc5Rzgc1c8p9kvBVhrLUB4ZZniwnpi4yQd1WVf952tp", - "Latency": "", - "Muxer": "", - "Streams": null - }, - { - "Addr": "/ip4/103.40.249.175/tcp/12350", - "Peer": "12D3KooWNfUzbXzVXqLV9pEubVenJoQHkWtkrR3aSvwyoXc7Kpys", - "Latency": "", - "Muxer": "", - "Streams": null - } - } - ``` - -3. 连接到其他节点 - - ``` - ./venus swarm connect /ip4/192.168.1.151/tcp/6000/p2p/QmTBY16KjbJifqrepWriHNaSVxBJRKg63G8hJrAZAstCQt - ``` - -## 查询actor状态 - -1. 获取actor信息 - - ```sh - ./venus get-actor f02438 - - { - "Address": "f02438", - "Balance": "659448.801619331229682404 FIL", - "Nonce": 0, - "Code": "bafkqaetgnfwc6mrpon2g64tbm5sw22lomvza (fil/2/storageminer)", - "Head": "bafy2bzacedexilt4kyzffmagjwpyenct5eddn7cazfjquz4v7b3b4czitn3au" - } - ``` - -2. 查询矿工信息 - - ```sh - ./venus state miner-info f02438 - - Available Balance: 8867.856318782083445622 FIL - Owner: f077316 - Worker: f0117055 - Control 0: f0117046 - Control 1: f0117042 - Control 2: f0117040 - PeerID: 12D3KooWMrDPhKaMeJFenXRFd4Rb9Zt111CBY7uY6AoZ93MTbLHw - Multiaddrs: /ip4/47.115.10.99/tcp/14567 - Consensus Fault End: -1 - SectorSize: 32 GiB (34359738368) - Byte Power: 35.78 PiB / 2.143 EiB (1.6305%) - Actual Power: 35.8 Pi / 2.14 Ei (1.6302%) - - Proving Period Start: 447666 (21 hours 36 minutes ago) - ``` - -3. 获取矿工的扇区信息 - - ```sh - ./venus state sector f02438 100001 - - SectorNumber: 100001 - SealProof: 3 - SealedCID: bagboea4b5abcaps45jsrklqqa3dw26jd7rybpzwsneapwvx6s4pqludkhie3hflh - DealIDs: [] - - Activation: 898 (22 weeks 2 days ago) - Expiration: 1553585 (in 1 year 2 weeks) - - DealWeight: 0 - VerifiedDealWeight: 0 - InitialPledge: 0.99999998430674944 FIL - ExpectedDayReward: 0.503660272286038996 FIL - ExpectedStoragePledge: 1.42807706338520528 FIL - - Deadline: 0 - Partition: 0 - ``` - -4. 通过id搜索消息 - - ```sh - ./venus state search-msg bafy2bzaceckluouswlxpaujhihar4yngk3dx6daqbjfoyolbfvlelwgapmzxg - - message was executed in tipset: [bafy2bzacebek5gtutmhdvt5rpt6s2k7exk2ve2tj3f2h36nswnw7ehbbmirec bafy2bzaceaem7ljdwxl3eqncy7r7cc3225sx24g6oyzbsf4p7pavcxasuzcs2 bafy2bzacecty4e55ryfjmdjc24jwp2iwobk6pqk4mrsmsjdjtpchsizyervqe bafy2bzacecbldsf73ekzxqsgxawupwhx4cm5xvy6qp43ne5qkss42xvnfjcic bafy2bzaceajgyz6y26fbhsirnrizdt4yt55374abobm5lzugl3eik3yd23afk] - Exit Code: 0 - Gas Used: 13133828 - ``` +```bash +export IPFS_GATEWAY=https://proof-parameters.s3.cn-south-1.jdcloud-oss.com/ipfs/ +``` -5. 等待消息id的结果 +## 在构建过程中加快Go模块的下载 - ```sh - ./venus state wait-msg bafy2bzaceanbalwsqc5fetxcdfamfovlpkdjd2s5eje4bwsaxnrrbyswjv5g4 +构建Venus需要下载一些Go模块。这些通常托管在Github上,而Github来自中国的带宽较低。要解决此问题,请在运行Venus之前通过设置以下变量来使用本地代理: - message was executed in tipset: [bafy2bzacebek5gtutmhdvt5rpt6s2k7exk2ve2tj3f2h36nswnw7ehbbmirec bafy2bzaceaem7ljdwxl3eqncy7r7cc3225sx24g6oyzbsf4p7pavcxasuzcs2 bafy2bzacecty4e55ryfjmdjc24jwp2iwobk6pqk4mrsmsjdjtpchsizyervqe bafy2bzacecbldsf73ekzxqsgxawupwhx4cm5xvy6qp43ne5qkss42xvnfjcic bafy2bzaceajgyz6y26fbhsirnrizdt4yt55374abobm5lzugl3eik3yd23afk] - Exit Code: 0 - Gas Used: 44152257 - Return: - ``` +```bash +export GOPROXY=https://goproxy.cn +``` diff --git a/docs/zh/advanced/Tips-Running-In-China.md b/docs/zh/advanced/Tips-Running-In-China.md deleted file mode 100644 index 3a78ce93f..000000000 --- a/docs/zh/advanced/Tips-Running-In-China.md +++ /dev/null @@ -1,19 +0,0 @@ -# Venus: 在中国部署运行的小贴士 - -本贴士为中国用户提供了一些技巧,以解决在构建和运行Venus时可能遇到的一些带宽问题或速度缓慢。 - -## 加快首次启动时的证明参数下载 - -运行Venus需要下载链的证明参数,这些参数是大文件,默认情况下托管在国外,在国内下载速度缓慢。为了解决这个问题,用户应该在运行Venus时设置以下环境变量: - -``` -export IPFS_GATEWAY=https://proof-parameters.s3.cn-south-1.jdcloud-oss.com/ipfs/ -``` - -## 在构建过程中加快Go模块的下载 - -构建Venus需要下载一些Go模块。这些通常托管在Github上,而Github来自中国的带宽较低。要解决此问题,请在运行Venus之前通过设置以下变量来使用本地代理: - -``` -export GOPROXY=https://goproxy.cn -``` diff --git a/docs/zh/advanced/venus-cli.md b/docs/zh/advanced/venus-cli.md new file mode 100644 index 000000000..55ef8de2c --- /dev/null +++ b/docs/zh/advanced/venus-cli.md @@ -0,0 +1,368 @@ +# CLI命令行 + +可以在你的终端运行 `venus --help` ,以获得完整的可用命令列表。 + +``` + START RUNNING FILECOIN + venus config [] - Get and set filecoin config values + venus daemon - Start a long-running daemon process + venus wallet - Manage your filecoin wallets + + VIEW DATA STRUCTURES + venus chain - Inspect the filecoin blockchain + venus sync - Inspect the filecoin Sync + venus dag - Interact with IPLD DAG objects + venus show - Get human-readable representations of filecoin objects + + NETWORK COMMANDS + venus swarm - Interact with the swarm + venus drand - retrieve drand randomness + + MESSAGE COMMANDS + venus send - Send message + venus mpool - Manage the message pool + + State COMMANDS + venus state wait-msg - Wait for a message to appear on chain + venus state search-msg - Search to see whether a message has appeared on chain + venus state power - Query network or miner power + venus state sectors - Query the sector set of a miner + venus state active-sectors - Query the active sector set of a miner + venus state sector - Get miner sector info + venus state get-actor - Print actor information + venus state lookup - Find corresponding ID address + venus state sector-size - Look up miners sector size + venus state get-deal - View on-chain deal info + venus state miner-info - Retrieve miner information + venus state network-version - MReturns the network version + venus state list-actor - list all actors + + TOOL COMMANDS + venus inspect - Show info about the venus node + venus leb128 - Leb128 cli encode/decode + venus log - Interact with the daemon event log output + venus protocol - Show protocol parameter details + venus version - Show venus version information + venus seed - Seal sectors for genesis miner +``` + + +# 常用命令 + +# 启动主网节点 + + ```sh + ./venus daemon + ``` + +## 查询链状态 + +1. 获取当前tipset的head信息 + + ```sh + ./venus chain head + + { + "Height": 449124, + "ParentWeight": "9725370313", + "Cids": [ + { + "/": "bafy2bzacectt2udhaow37r53dfpnq6o3edvf5iswbpk77bcfiuce4xn5zkc3g" + }, + { + "/": "bafy2bzacebjintkddt24xdqvma3xwqurp6bahdhqxvwc54kqvuxbi3tiy2rig" + }, + { + "/": "bafy2bzaceczumkmzgjfasc4cpb2cqkhhv5eqgf2ikzgwgmw5554bgguivykf6" + }, + { + "/": "bafy2bzacebd5jt744qsoi5pieisxme2xtmdgmlylma2wgbbu2vmrp3bjlflq2" + }, + { + "/": "bafy2bzacedl3fvcvybsukh4odytkz2fxemrr2rln7t75oqj2wkj7yg2vohl3g" + } + ], + "Timestamp": "2021-01-28 04:42:00" + } + ``` + +2. 最近的tipset的信息列表 + ```sh + ./venus chain ls + [ + ....... + { + "Height": 449115, + "Timestamp": "2021-01-28 04:37:30", + "Blocks": [ + { + "Cid": { + "/": "bafy2bzaceb2xn4hnnovksfeqjrig44bgxow5ixuymlo75nnftjad2mufzzjjw" + }, + "Miner": "t0112667" + }, + { + "Cid": { + "/": "bafy2bzacecoswf32ayvdhotbp3pcgabq6q34c5czqscugb5lfcig26igbkem2" + }, + "Miner": "t030347" + }, + { + "Cid": { + "/": "bafy2bzacedo3xucwhpz3ndralqbrgzmbzxvkj23btp46tppby2vadyovvtux6" + }, + "Miner": "t03176" + }, + { + "Cid": { + "/": "bafy2bzacecrnceor3dj3zixrizqkgcivxrevy7jkzh5wolgp7kok7cimcsoyu" + }, + "Miner": "t089228" + }, + { + "Cid": { + "/": "bafy2bzaceas2qb642iagyc2konpf3bdykw7kryv245dvsmuboikanj35ymes4" + }, + "Miner": "t023152" + } + ] + } + ] + ``` + +3. 设置tipset的head + + ```sh + ./venus chain set-head bafy2bzaceckeg7onfhua5jf4xrnrzt2erix5pibjov2r4vvdhcih6oql7vm24 bafy2bzacedt74pgv2rk7iddptz2nz4kfcsoccqnrb4q7mbluof6puw5iccqms + ``` + +## 钱包命令 + +1. 创建地址 + + ```sh + ./venus wallet new + ``` + +2. 地址列表 + + ```sh + ./venus wallet ls + + Address Balance Nonce Default + f1nixbb3trp2mujzf5z7mguidthwo4levnldy4s4a 0 FIL 0 + f1ytd5blzi3y2nsupqzye6ogpaphow3lljii3zkdi 0 FIL 0 + f3qmxlwlzmvvn6vwo73jhuzjufmo65lrdwecxcmd7poyv5yex5hqngvo26sqjzzdge4vj3yxmwn5x24igremna 0 FIL 0 X + f3rjuxqnsjk7wuuzf3rqwsfxpbmqp23dn6ik5vyow2ntw5sgdxyijh7cfbujbmwtzdpii6ikunumez55jcxbbq 0 FIL 0 + ``` + +3. 设置默认地址 + + ```sh + ./venus wallet set-default f3qmxlwlzmvvn6vwo73jhuzjufmo65lrdwecxcmd7poyv5yex5hqngvo26sqjzzdge4vj3yxmwn5x24igremna + ``` + +4. 获取默认地址 + + ```sh + ./venus wallet default + ``` + +5. 导出/导入地址,兼容lotus私钥格式 + + ```sh + ./venus wallet import + ./venus wallet export + ``` + +6. 查询地址余额 + + ```sh + ./venus wallet balance f3rjuxqnsjk7wuuzf3rqwsfxpbmqp23dn6ik5vyow2ntw5sgdxyijh7cfbujbmwtzdpii6ikunumez55jcxbbq + 0 FIL + ``` + +7. 设置钱包密码 + + ```sh + ./venus wallet set-password + ``` + +8. 锁定与解锁钱包 + + ```sh + ./venus wallet lock + ./venus wallet unlock + ``` + +## 同步命令 + +1. 查询同步状态 + + ```sh + ./venus sync status + + Syncing: + SyncTarget: 1 + Base: 450231 { bafy2bzaceby6aq4obp5pjgjsxtyneqgsrcou4tgx2rsgqptoxgb4pyxh4asae bafy2bzacebancasvojeszwqnfvexlmn52vgcq7ns45nnwzixr67dzsel2kolu bafy2bzaced37mxrstmq2ij4x3szso446fodutq4jaarns6n2vdijeem2k44be bafy2bzacebtxektwn3mndyhpwnj6rkhnf6mfnfa2fyds4jv2xxb3nukuy26d6 bafy2bzacedmjrn42yzfl4yzuzn66ir33exrjxotahtets7btjfm4x36rdcsgu } + Target: 450239 { bafy2bzaceb6ulfdjeak6uaxrsd62jobtuilee4wkk3bj5ta4qfi7ll52tbyrm bafy2bzacebkbsyo2hp4qgrsfgzjz5qvyrgfz6n6nsq6kfxvw7s4s66yfynpwi } + Current: 450232 { bafy2bzacedwjdxb5jx5wo4zwg7emwfhbw34bvs3hvo362r3um25nisdakrl7g bafy2bzaced4jq6hx56o4symynuwqhlhf4kzo3qdqofeilizzflejvgjjr2bmq } + Status: syncing + Err: + + SyncTarget: 2 + Base: 450231 { bafy2bzaceby6aq4obp5pjgjsxtyneqgsrcou4tgx2rsgqptoxgb4pyxh4asae bafy2bzacebancasvojeszwqnfvexlmn52vgcq7ns45nnwzixr67dzsel2kolu bafy2bzaced37mxrstmq2ij4x3szso446fodutq4jaarns6n2vdijeem2k44be bafy2bzacebtxektwn3mndyhpwnj6rkhnf6mfnfa2fyds4jv2xxb3nukuy26d6 bafy2bzacedmjrn42yzfl4yzuzn66ir33exrjxotahtets7btjfm4x36rdcsgu } + Target: 450238 { bafy2bzacebtf2l5y34acbfnie6ilvvhxj5gyrnknnygintqzqkoxcsnmmuado bafy2bzacedswqjogt57cf7q22ebbrnbw3qygxd6q3z6vhm74b6tyzqjlrvox4 bafy2bzacecrv2kxpvuocgrtfjlot3da57655zbvrcu2reuospak3vdxa3u7v2 bafy2bzacecahv6twxmeihivncobqadfm7xyh3gvnrpjhs47i7537er7uyeote } + Current: 450233 { bafy2bzaceb4ybtg3p63fd7hvrajj5cw7oi52ie3zj2r3apxvod4u4e3y3svac bafy2bzacecmasydskhxrcrdih6na4qxpcdpavj6d5wydgft7ba574mx57ij76 bafy2bzacedrxgj2cjq537zoe24qhzizkx5ix4g7rpzbjl73qfm4ldom2kt7pq bafy2bzaceat2eg6ujh2qmlwwvna5qmntbayquvesvik55jfbrfkcgugcl6dmq bafy2bzaceawwc3hp3b5bl2a3gjmvehxytqvxtabtwosj77lnbcmu5ln4gh77u bafy2bzaceabwkrifkce2rraystlg2ouxudklyd2b3pmck2ineguidz4r3x35o bafy2bzacebfxvqczftyzoxosdrlxylhupurmovpqhympe6anukleg2z7emmbo bafy2bzaceb2bbk4ykijqz7em4zgag5eikvqzierp6mevw2bytnj4xrbb2dthc } + Status: syncing + Err: + + SyncTarget: 3 + Base: 450231 { bafy2bzaceby6aq4obp5pjgjsxtyneqgsrcou4tgx2rsgqptoxgb4pyxh4asae bafy2bzacebancasvojeszwqnfvexlmn52vgcq7ns45nnwzixr67dzsel2kolu bafy2bzaced37mxrstmq2ij4x3szso446fodutq4jaarns6n2vdijeem2k44be bafy2bzacebtxektwn3mndyhpwnj6rkhnf6mfnfa2fyds4jv2xxb3nukuy26d6 bafy2bzacedmjrn42yzfl4yzuzn66ir33exrjxotahtets7btjfm4x36rdcsgu } + Target: 450237 { bafy2bzaceavndy2pgdjpacapy4gs6pszbvxssvwrnw4uydnne4boowvyjlzjm bafy2bzacedutkurnrzna3hctqwxkrghhy6ufkanonfbq54cjcaoquoss4galy bafy2bzaced477xs5udb2r2xkomt6webzmjcwvy257bhpvgxrq6v573o66ywsy bafy2bzaceddjcr45kqhrwikemn7lfuhe5k3cqhhebrrzucsemv4bbxh755hx4 } + Current: 450233 { bafy2bzaceb4ybtg3p63fd7hvrajj5cw7oi52ie3zj2r3apxvod4u4e3y3svac bafy2bzacecmasydskhxrcrdih6na4qxpcdpavj6d5wydgft7ba574mx57ij76 bafy2bzacedrxgj2cjq537zoe24qhzizkx5ix4g7rpzbjl73qfm4ldom2kt7pq bafy2bzaceat2eg6ujh2qmlwwvna5qmntbayquvesvik55jfbrfkcgugcl6dmq bafy2bzaceawwc3hp3b5bl2a3gjmvehxytqvxtabtwosj77lnbcmu5ln4gh77u bafy2bzaceabwkrifkce2rraystlg2ouxudklyd2b3pmck2ineguidz4r3x35o bafy2bzacebfxvqczftyzoxosdrlxylhupurmovpqhympe6anukleg2z7emmbo bafy2bzaceb2bbk4ykijqz7em4zgag5eikvqzierp6mevw2bytnj4xrbb2dthc } + Status: syncing + Err: + + Waiting: + SyncTarget: 4 + Base: 450231 { bafy2bzaceby6aq4obp5pjgjsxtyneqgsrcou4tgx2rsgqptoxgb4pyxh4asae bafy2bzacebancasvojeszwqnfvexlmn52vgcq7ns45nnwzixr67dzsel2kolu bafy2bzaced37mxrstmq2ij4x3szso446fodutq4jaarns6n2vdijeem2k44be bafy2bzacebtxektwn3mndyhpwnj6rkhnf6mfnfa2fyds4jv2xxb3nukuy26d6 bafy2bzacedmjrn42yzfl4yzuzn66ir33exrjxotahtets7btjfm4x36rdcsgu } + Target: 450239 { bafy2bzaceb6ulfdjeak6uaxrsd62jobtuilee4wkk3bj5ta4qfi7ll52tbyrm bafy2bzacebkbsyo2hp4qgrsfgzjz5qvyrgfz6n6nsq6kfxvw7s4s66yfynpwi bafy2bzacebca26ouxt6tv32ul46457zftb5ozy6lmeejtrw2w5srb4zgnflou } + Current: + Status: wait + Err: + + History: + ``` + +2. 设置同步次数 + + ```sh + ./venus sync set-concurrent 1 + ``` + +## 网络命令 + +1. 打印本地节点信息 + + ```sh + ./venus swarm id + + { + "Addresses": [ + "/ip4/192.168.1.151/tcp/6000/p2p/QmTBY16KjbJifqrepWriHNaSVxBJRKg63G8hJrAZAstCQt", + "/ip4/127.0.0.1/tcp/6000/p2p/QmTBY16KjbJifqrepWriHNaSVxBJRKg63G8hJrAZAstCQt" + ], + "ID": "QmTBY16KjbJifqrepWriHNaSVxBJRKg63G8hJrAZAstCQt" + } + ``` + +2. 查询已连接的对方节点 + ```sh + ./venus swarm peers + + { + "Peers": [ + { + "Addr": "/ip4/101.206.156.202/tcp/23151", + "Peer": "12D3KooWNhc5Rzgc1c8p9kvBVhrLUB4ZZniwnpi4yQd1WVf952tp", + "Latency": "", + "Muxer": "", + "Streams": null + }, + { + "Addr": "/ip4/103.40.249.175/tcp/12350", + "Peer": "12D3KooWNfUzbXzVXqLV9pEubVenJoQHkWtkrR3aSvwyoXc7Kpys", + "Latency": "", + "Muxer": "", + "Streams": null + } + } + ``` + +3. 连接到其他节点 + + ``` + ./venus swarm connect /ip4/192.168.1.151/tcp/6000/p2p/QmTBY16KjbJifqrepWriHNaSVxBJRKg63G8hJrAZAstCQt + ``` + +## 查询actor状态 + +1. 获取actor信息 + + ```sh + ./venus get-actor f02438 + + { + "Address": "f02438", + "Balance": "659448.801619331229682404 FIL", + "Nonce": 0, + "Code": "bafkqaetgnfwc6mrpon2g64tbm5sw22lomvza (fil/2/storageminer)", + "Head": "bafy2bzacedexilt4kyzffmagjwpyenct5eddn7cazfjquz4v7b3b4czitn3au" + } + ``` + +2. 查询矿工信息 + + ```sh + ./venus state miner-info f02438 + + Available Balance: 8867.856318782083445622 FIL + Owner: f077316 + Worker: f0117055 + Control 0: f0117046 + Control 1: f0117042 + Control 2: f0117040 + PeerID: 12D3KooWMrDPhKaMeJFenXRFd4Rb9Zt111CBY7uY6AoZ93MTbLHw + Multiaddrs: /ip4/47.115.10.99/tcp/14567 + Consensus Fault End: -1 + SectorSize: 32 GiB (34359738368) + Byte Power: 35.78 PiB / 2.143 EiB (1.6305%) + Actual Power: 35.8 Pi / 2.14 Ei (1.6302%) + + Proving Period Start: 447666 (21 hours 36 minutes ago) + ``` + +3. 获取矿工的扇区信息 + + ```sh + ./venus state sector f02438 100001 + + SectorNumber: 100001 + SealProof: 3 + SealedCID: bagboea4b5abcaps45jsrklqqa3dw26jd7rybpzwsneapwvx6s4pqludkhie3hflh + DealIDs: [] + + Activation: 898 (22 weeks 2 days ago) + Expiration: 1553585 (in 1 year 2 weeks) + + DealWeight: 0 + VerifiedDealWeight: 0 + InitialPledge: 0.99999998430674944 FIL + ExpectedDayReward: 0.503660272286038996 FIL + ExpectedStoragePledge: 1.42807706338520528 FIL + + Deadline: 0 + Partition: 0 + ``` + +4. 通过id搜索消息 + + ```sh + ./venus state search-msg bafy2bzaceckluouswlxpaujhihar4yngk3dx6daqbjfoyolbfvlelwgapmzxg + + message was executed in tipset: [bafy2bzacebek5gtutmhdvt5rpt6s2k7exk2ve2tj3f2h36nswnw7ehbbmirec bafy2bzaceaem7ljdwxl3eqncy7r7cc3225sx24g6oyzbsf4p7pavcxasuzcs2 bafy2bzacecty4e55ryfjmdjc24jwp2iwobk6pqk4mrsmsjdjtpchsizyervqe bafy2bzacecbldsf73ekzxqsgxawupwhx4cm5xvy6qp43ne5qkss42xvnfjcic bafy2bzaceajgyz6y26fbhsirnrizdt4yt55374abobm5lzugl3eik3yd23afk] + Exit Code: 0 + Gas Used: 13133828 + ``` + +5. 等待消息id的结果 + + ```sh + ./venus state wait-msg bafy2bzaceanbalwsqc5fetxcdfamfovlpkdjd2s5eje4bwsaxnrrbyswjv5g4 + + message was executed in tipset: [bafy2bzacebek5gtutmhdvt5rpt6s2k7exk2ve2tj3f2h36nswnw7ehbbmirec bafy2bzaceaem7ljdwxl3eqncy7r7cc3225sx24g6oyzbsf4p7pavcxasuzcs2 bafy2bzacecty4e55ryfjmdjc24jwp2iwobk6pqk4mrsmsjdjtpchsizyervqe bafy2bzacecbldsf73ekzxqsgxawupwhx4cm5xvy6qp43ne5qkss42xvnfjcic bafy2bzaceajgyz6y26fbhsirnrizdt4yt55374abobm5lzugl3eik3yd23afk] + Exit Code: 0 + Gas Used: 44152257 + Return: + ``` diff --git a/docs/zh/guide/How-To-Deploy-MingPool.md b/docs/zh/guide/How-To-Deploy-MingPool.md index 3ef9c59e7..31e47511a 100644 --- a/docs/zh/guide/How-To-Deploy-MingPool.md +++ b/docs/zh/guide/How-To-Deploy-MingPool.md @@ -1,406 +1,331 @@ -# Venus集群组件介绍 -Venus是Filecoin分布式矿池的实现方案之一,系统集群组件包括:Venus,Venus-auth,Venus-miner,Venus-wallet,Venus-messager,Venus-sealer。从概念上理解其中Venus、Venus-auth、Venus-miner、Venus-wallet、Venus-messager具备可共用性(即程序可被多个矿工身份使用,在保证效率的情况下使硬件,软件资源得到充分利用),而Venus-sealer、Venus-worker、Venus-wallet主要用于积累算力。Venus-wallet属于可选组件,基于部署情况的安全性考量,Venus-wallet可以共享使用,也可以本地部署。本篇文档为nerpda测试网络下的集群部署。 +## 背景 +考虑到庞大的初始硬件和Filecoin质押[投资](https://filscan.io/calculator)以及相关的运营成本,开始Filecoin挖掘是一项艰巨的任务。 囊括了安全性、易用性和分布式存储池的想法,Venus将帮助存储提供者,正如社区所说,把[全职工作](https://filecoinproject.slack.com/archives/CEGN061C5/p1610810730117900?thread_ts=1610809298.116800&cid=CEGN061C5)变成为一个严肃的爱好。 希望本教程能让您立即开始挖矿! + +## 如何提供存储服务 + +有两种方法可以开始使用Venus来提供存储服务。 + +1. 部署最少的硬件并获得对第三方托管的共享venus模块的使用帐号。(请参阅[这个](Using-venus-Shared-Modules.md)教程以了解更多信息) +2. 自行部署所有需要的硬件和venus模块。(本教程的其余部分将引导您完成这种部署Venus服务的方式) + +在遵循其余的教程和成功部署后,您可以开始封装扇区,增加算力并通过您对网络存储容量的贡献最终获得区块奖励! + +## venus模块介绍 + +根据其在挖矿集群中的作用,模块可以大致分为两类:共享和独立。 共享模块可以被认为是开始封装扇区所需的基础。 大多数与区块链的交互,如链同步、发送消息、赢得赢票等,都是由共享模块处理的。 这个想法是许多矿工都可以共用一组共享模块,从而减少维护成本。 独立模块处理封装和证明您的扇区。如果您选择使用第三方托管的共享Venus模块,您将花费大部分时间在独立模块上。 另请注意,`venus-wallet`模块可以作为共享或独立部署。 + +| name | role | shared/independent | +| ------------------------------------------------------------ | ----------------------------------------------------- | ------------------ | +| [venus](https://github.com/filecoin-project/venus) | daemon for chain interactions | shared | +| [venus-miner](https://github.com/filecoin-project/venus-miner) | block winning and proving | shared | +| [venus-messager](https://github.com/filecoin-project/venus-messager) | chain message management | shared | +| [venus-auth](https://github.com/filecoin-project/venus-auth) | utility for authorized use of shared modules | shared | +| [venus-gateway](https://github.com/ipfs-force-community/venus-gateway) | utility for controlled access point of shared modules | shared | +| [venus-wallet](https://github.com/filecoin-project/venus-wallet) | addresses/keys management | shared/independent | +| [venus-sealer](https://github.com/filecoin-project/venus-sealer), [venus-worker](https://github.com/filecoin-project/venus-sealer) | job scheduling, sealing and proving | independent | + +## 服务架构 + +下图展示了venus模块如何相互交互。 ![venus-cluster](/venus-cluster.png) -# Venus集群部署(基于nerpa测试网) +## 硬件要求 +在[此处](https://github.com/filecoin-project/community-china/discussions/18)了解有关硬件要求的更多信息。 -| 程序 | 服务器 | 类型 | 作用 | -| -------------- | ------- | ------ | -------------------------------------------------------------------------------------------- | -| Venus-auth | \ | 共享 | Venus-auth 用于统一授权,当矿工组件访问共享组件的时候需要使用此服务注册生成的token | -| Venus-gateway | \ | 共享 | 桥接部分接口调用 | -| Venus | \ | 共享 | Filecoin节点数据同步 | -| Venus-messager | \ | 共享 | 管理集群中的消息,保证消息上链,控制消息流量,重试等。可对接多个钱包,针对这些钱包做消息管理 | -| Venus-miner | \ | 共享 | 打包出块消息,可配置多个矿工,会自行计算矿工出块情况,并通过远程访问Venus-sealer获取数据证明 | -| Venus-wallet | \ | 共享 | 钱包管理,数据签名 | -| Venus-sealer | \ | 非共享 | 数据封装 | +## 前期准备 +在深入部署您的挖矿操作之前,请确保您已完成以下步骤。 -Tips: - - 以下所有`<>`都是需替换参数,根据自己的实际情况替换 - - 具体版本请自行使用git checkout选择 - - 环境依赖: - - golang ^1.15 - - go env -w GOPROXY=https://goproxy.io,direct - - go env -w GO111MODULE=on - - git +:::warning +建议您在部署到主网上之前在`nerpa` 或`calibration`网络中测试您的配置。 -# 云上组件搭建 -## Venus-auth Install -### 编译并启动 +::: + +### 永久存储 + +选择您熟悉的网络文件系统(例如 NFS)并部署您的存储集群。 + +### 软件依赖 + +在运行 venus 之前,您需要安装以下软件。 + +#### 构建工具 + +Ubuntu/Debian: + +```shell +sudo apt install mesa-opencl-icd ocl-icd-opencl-dev gcc git bzr jq pkg-config curl clang build-essential hwloc libhwloc-dev wget -y && sudo apt upgrade -y +``` + +CentOS: + +```bash +sudo yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm; sudo yum install -y git gcc bzr jq pkgconfig clang llvm mesa-libGL-devel opencl-headers ocl-icd ocl-icd-devel hwloc-devel +``` + +#### Go + +构建venus,您需要安装[Go 1.16 或更高版本](https://golang.org/dl/)。 + +```bash +wget -c https://golang.org/dl/go1.16.2.linux-amd64.tar.gz -O - | sudo tar -xz -C /usr/local +``` + +将 `/usr/local/go/bin` 添加到您的路径并设置`go env`。对于大多数Linux系统,您可以运行以下内容: + +```bash +echo "export PATH=$PATH:/usr/local/go/bin" >> ~/.bashrc && source ~/.bashrc +# setup go env +go env -w GOPROXY=https://goproxy.io,direct +go env -w GO111MODULE=on +``` + +如果卡住,请参阅[官方Golang安装说明](https://golang.org/doc/install)。 + +## 安装venus-auth +下载并编译`venus-auth`的源代码。 ```shell script $ git clone https://github.com/filecoin-project/venus-auth.git - $ cd venus-auth - +$ git checkout $ make - $ nohup ./venus-auth > auth.log 2>&1 & - ``` -- Venus-auth服务默认配置文件目录为 ~/.venus-auth/config.toml -- 存储方案默认为badger内嵌kv数据库,也支持MYSQL存储,需要自行修改配置文件后启动。 -- log存储默为控制台打印,同时支持influxDB存储 +:::tip + +`venus-auth` 的默认配置文件位于`~/venus-auth/config.toml`。 + +::: + +:::tip Logs + +日志默认打印到控制台。 通过配置可以支持InfluxDB。 -#### MYSQL存储启动(可选) -Tips: MYSQL支持5.7以上官方版本(如云平台MYSQL默认设置各有不同,请自己结合云平台修改配置,否则可能会出现 “ Specified key was too long; max key length is 767 bytes ”) +::: + +### 使用MySQL (可选) + +支持MySQL 5.7及以上版本,可替代默认的`Badger`键值数据库。要使用 MySQL 数据库,请修改配置中的 `db`部分。 -##### 修改Venus-auth config中的db设置 ```shell script $ vim ~/.venus-auth/config.toml -# 数据源配置项 +# Data source configuration item [db] # support: badger (default), mysql # the mysql DDL is in the script package type = "mysql" # The following parameters apply to MySQL -DSN = "root:111111@(127.0.0.1:3306)/venus_auth?parseTime=true&loc=Local&charset=utf8mb4&collation=utf8mb4_unicode_ci&readTimeout=10s&writeTimeout=10s" +DSN = ":@(127.0.0.1:3306)/venus_auth?parseTime=true&loc=Local&charset=utf8mb4&collation=utf8mb4_unicode_ci&readTimeout=10s&writeTimeout=10s" # conns 1500 concurrent maxOpenConns = 64 maxIdleConns = 128 maxLifeTime = "120s" maxIdleTime = "30s" - ``` -- 启动 +重启`venus-auth`使配置生效。 + ```shell script +$ ps -ef | grep auth +$ kill $ nohup ./venus-auth > auth.log 2>&1 & ``` -### 注册生成云上组件互相访问需要的token +### 生成token -```shell script -$ ./venus-auth genToken --perm admin admin - +`venus-auth`管理着其他venus模块使用的[jwt](https://jwt.io/)令牌,以便它们在网络上安全地相互通信。 + +为共享模块生成token。 + +```bash +# --perm specifies admin, sign, wirte or read permission of the token generated +$ ./venus-auth genToken --perm admin + ``` -- `` 格式统一为 JWT token -- 这些token之后会被各个程序使用,用以对集群接入组件做验证 -- `--perm`为RPC2.0接口访问权限限制 -- miner,messager,sealer,推荐标记为程序名,若存在多个相同程序要加入集群,可以使用“程序名+标记符”。 -## Venus-gateway Install +为独立模块生成令牌。 token可以通过`` 逻辑分组,作为加入矿池的单个矿工。 ```shell script +$ ./venus-auth addUser --name +$ ./venus-auth genToken --perm write + +$ ./venus-auth genToken --perm read + +``` +:::tip + +使用`./venus-auth addUser ` 对不同的token进行逻辑分组。 + +::: + +## 安装venus-gateway + +下载并编译`venus-gateway`的源代码。 + +```bash $ git clone https://github.com/ipfs-force-community/venus-gateway.git $ cd venus-gateway +$ git checkout +$ go mod tidy $ make - -$ nohup ./venus-gateway --listen /ip4/0.0.0.0/tcp/45132 run --auth-url http://:8989 > gateway.log 2>&1 & ``` -## Venus install -### 安装编译环境 -```shell script -sudo yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm; sudo yum install -y git gcc bzr jq pkgconfig clang llvm mesa-libGL-devel opencl-headers ocl-icd ocl-icd-devel hwloc-devel +启动`venus-gateway`。 + +```bash +$ ./venus-gateway \ +--listen /ip4/0.0.0.0/tcp/45132 \ +run \ +# Use either a http or https url +--auth-url \ +> venus-gateway.log 2>&1 & ``` -### 编译并启动 + +## 安装venus daemon + +下载并编译`venus-daemon`的源代码。 + ```shell script $ git clone https://github.com/filecoin-project/venus.git - $ cd venus - +$ git checkout $ make deps - $ make +``` +启动`venus`进程进行链同步。 使用 `--network` 来指定`venus`连接的网络。 -# 启动venus daemon 设置网络与Venus-auth的地址 -# 启动成功后tail -f venus.log 可以看到数据同步的log -# 这里需要等待一段时间 +```bash $ nohup ./venus daemon --network nerpa \ ---authURL http://:8989 \ +--authURL \ > venus.log 2>&1 & ``` -- `--authURL` 为设置Venus-auth监听http地址 -### 修改IPV4监听地址 -目前程序启动后默认监听地址为`127.0.0.1:3453`,对于跨服务器集群,需要修改监听策略,可以通过`lsof -i:3453` 查询到进程后,Kill掉进程,修改IPV4策略后重启 +:::tip + +使用`tail -f venus.log`检查同步过程中是否有任何错误。 + +::: + +### 允许访问venus daemon + +默认情况下,`venus`进程只响应本地访问。更改以下配置以允许从其他地址访问。 ```shell script vim ~/.venus/config.json +``` + +将`apiAddress`从` /ip4/127.0.0.1/tcp/3453`更改为`/ip4/0.0.0.0/tcp/3453`。保存并关闭配置文件。 -# 做如下操作,修改为监听所有本机IPV4地址: -# replace api.apiAddress from -# "/ip4/127.0.0.1/tcp/3453" to "/ip4/0.0.0.0/tcp/3453" +```json +{ + "api": {"apiAddress": "/ip4/0.0.0.0/tcp/3453"} +} +``` -# 修改完毕后重启服务: +重启`venus`进程使配置生效。 + +```bash +$ ps -ef | grep venus +$ kill $ nohup ./venus daemon --network nerpa \ ---authURL http://:8989 \ -> venus.log 2>&1 & +--authURL \ +> venus.log 2>&1 ``` -## Venus-messager install -### 编译并启动 +## 安装venus-messager + +下载并编译`venus-messager`的源代码。 + ```shell script $ git clone https://github.com/filecoin-project/venus-messager.git - $ cd venus-messager - +$ git checkout $ make deps - $ make +``` +启动`venus-messager`。请注意,`--auth-url`、`--node-url` 和`--auth-token` 是为了让 venus-messager 了解其他`venus`模块的存在并进行自身的身份验证。 -# 启动venus-message 进程 +```bash $ nohup ./venus-messager run \ ---auth-url=http://:8989 \ ---node-url /ip4//tcp/3453 \ ---gateway-url /ip4//tcp/3453 \ ---auth-token \ +--auth-url= \ +--node-url /ip4//tcp/3453 \ +--gateway-url=/ip4//tcp/45132 \ +--auth-token \ --db-type mysql \ ---mysql-dsn "root:111111@tcp(127.0.0.1:3306)/cali_venus?parseTime=true&loc=Local&readTimeout=10s&writeTimeout=10s" \ +--mysql-dsn ":@(127.0.0.1:3306)/venus_messager?parseTime=true&loc=Local&readTimeout=10s&writeTimeout=10s" \ > msg.log 2>&1 & - ``` -- `--auth-url` 为设置Venus-auth监听地址 -- `--node-url` 为Venus监听地址 -- `--gateway-url` 为gateway监听地址 -- `--auth-token` 为在venus-auth中生成的管理员token,用于和Venus通信时的身份验证 -## Venus-miner install +:::tip -### 编译并启动 +如果没有指定与数据库相关的参数,`venus-messager`将默认使用 sqlite。 -```shell script -$ git clone https://github.com/filecoin-project/venus-miner.git +::: -$ cd venus-miner -$ make nerpanet +## 安装venus-miner -# 初始化环境配置 -$ ./venus-miner init --api /ip4//tcp/3453 --token +下载并编译`venus-miner`的源代码。 -# 启动miner -$ nohup ./venus-miner run >>miner.log 2>& 1 & +```shell script +$ git clone https://github.com/filecoin-project/venus-miner.git +$ cd venus-miner +$ git checkout +$ make +``` +初始化`venus-miner`。 + +```bash +$ ./venus-miner init +# For nettype, choose from mainnet, nerpanet, debug, 2k, calibnet +--nettype nerpanet +--auth-api \ +--token \ +--gateway-api /ip4//tcp/45132 +--api /ip4//tcp/3453 \ +``` +启动`venus-miner`。 -$ ./venus-miner address add \ ---addr \ ---sealer-listen-api /ip4//tcp/2345/http \ ---sealer-token \ ---wallet-listen-api /ip4//tcp/5678/http \ ---wallet-token +```bash +$ nohup ./venus-miner run >>miner.log 2>& 1 & +``` -# print -add miner: { {...}} +### 矿工管理 +一旦有用户(有`miner id`的`venus-sealer`) 连接到您的共享模块。 您可以通过以下方式查询该`miner id`的状态。 -# 查询miner状态 +```bash $ ./venus-miner address state -# print [ { - "Addr": "", + "Addr": "", "IsMining": true, - "Err": "" + "Err": null } ] - -# 如果IsMining为false -# 需要执行 -$ ./venus-miner address start - -# 因为miner支持多矿工 -# 可以通过以下指令查看所有关联矿工 -# 对于矿工的启停可以自行安排 -$ ./venus-miner address list -``` -- ``在Venus-sealer install部分查看 -- ``为Venus-sealer节点JWT token,切换到对应服务器后`cat ~/.venussealer/token`可获得 -- `` 为设置Venus-wallet中获得的接口授权JWT token,查看Venus-wallet install中``处可查看token如何获得 - - - - - -# 本地组件搭建 - -## 准备工作 -云上组件需要增加接入的矿工sealer和钱包生成token. 矿工只有凭借这个token才能访问云上的服务。 收钱矿工需要为自己起一个别名, 这里以jimmy为例子。在venus-auth中加入这个矿工,并为矿工生成token - -```shell script -$ venus-auth addUser --name jimmy --miner f0<> -$ venus-auth genToken --perm write jimmy - ``` -## Venus-wallet install -### 编译并启动 -```shell script -$ git clone https://github.com/filecoin-project/venus-wallet.git +如果你的矿工的`IsMining`为`false`,你可以运行以下命令来启动这个`miner id`。 -$ cd venus-wallet - -# 编译 -$ make - -# 启动 -$ nohup ./venus-wallet run > wallet.log 2>&1 & +```bash +$ ./venus-miner address start ``` -### 设置密码并创建钱包 -> 此处创建了2个BLS钱包,用于之后的Venus-sealer初始化 -```shell script -# 设置加解锁密码 -$ ./venus-wallet setpwd -Password:****** -Enter Password again:****** - -# 生成BLS地址 -$ ./venus-wallet new bls - -$ ./venus-wallet new bls - -``` -- `` 为86位长度地址 -#### 注意 -新生成的`` ``需要到https://faucet.nerpa.interplanetary.dev/funds.html中预充balance后才能在链上生成actor。 - -### 修改配置文件并重启 - -```toml -# Default config: -[API] - ListenAddress = "/ip4/0.0.0.0/tcp/5678/http" - -[DB] - Conn = "/root/.venus_wallet/keystore.sqlit" - Type = "sqlite" - DebugMode = true - -[JWT] - Token = "65794a68624763694f694a49557a49314e694973496e523563434936496b705856434a392e65794a42624778766479493657794a795a57466b4969776964334a70644755694c434a7a615764754969776959575274615734695858302e7a534c6755446565514e6473716f666179415235445a6f4b4f48787742566855364c635636716154586663" - Secret = "96d3bbf96ee0151a0495146bccd4825e81e12c24ed8307456a286066a610d52d" - -[Factor] - ScryptN = 262144 - ScryptP = 1 - -[Strategy] - Level = 0 - NodeURL = "" - -[APIRegisterHub] //修改此处 上面勿动 -RegisterAPI = ["/ip4//tcp/45132"] -Token = "" -SupportAccounts = ["jimmy"] -``` +列出所有已连接到`venus-miner`的`miner id`。 -## Venus-sealer install - -### 编译并启动(sealer单程序只能绑定一个矿工) -```shell script -$ git clone https://github.com/filecoin-project/venus-sealer.git - -$ cd venus-sealer - -$ make deps - -$ make -``` -#### 初始化新矿工(2选1) -```shell script -$ nohup ./venus-sealer init \ ---worker \ ---owner \ ---sector-size 512M \ ---network nerpa \ ---node-url /ip4//tcp/3453 \ ---messager-url /ip4//tcp/3453 \ ---gateway-url /ip4//tcp/3453 \ ---auth-token \ ---no-local-storage \ ---wallet-name testminer \ -> sealer.log 2>&1 & - -``` - -#### 初始化已存在矿工(2选1) -> 不需要指定`--sector-size` -```shell script -$ ./venus-sealer init \ ---actor \ ---network nerpa \ ---node-url /ip4//tcp/3453 \ ---messager-url /ip4//tcp/3453 \ ---gateway-url /ip4//tcp/3453 \ ---auth-token \ ---no-local-storage \ ---wallet-name testminer - -# 查看日志等待消息上链注册actor地址 -2021-04-25T18:41:31.925+0800 INFO main venus-sealer/init.go:182 Checking if repo exists -2021-04-25T18:41:31.926+0800 INFO main venus-sealer/init.go:217 Checking full node version -2021-04-25T18:41:31.927+0800 INFO main venus-sealer/init.go:233 Initializing repo -2021-04-25T18:41:31.928+0800 INFO main venus-sealer/init.go:309 Initializing libp2p identity -2021-04-25T18:41:32.082+0800 INFO main venus-sealer/init.go:485 Pushed CreateMiner message: aaf489f9-af4b-4e4b-9084-018d43f05b7e -2021-04-25T18:41:32.082+0800 INFO main venus-sealer/init.go:486 Waiting for confirmation -2021-04-25T18:46:32.088+0800 INFO main venus-sealer/init.go:502 New miners address is: t01640 (t2cxzf7xvrqo3froqn2xgdqjdbydhkcrgakj7j3ma) -2021-04-25T18:46:32.088+0800 INFO main venus-sealer/init.go:381 Created new miner: t01640 -2021-04-25T18:46:32.089+0800 INFO main venus-sealer/init.go:302 Sealer successfully created, you can now start it with 'venus-sealer run' - -``` - -- `` `` 为Venus-wallet中创建的BLS钱包地址,注意这2个钱包地址都需要有balance -- ``为Venus-auth中注册的sealer -- ``为绝对路径 - -#### 启动sealer并执行sector封装 - -```shell script -$ nohup ./venus-sealer run >> sealer.log 2>&1 & - -# 指定存储目录(可选) -# 因为指定了--no-local-storage -# 所以需要指定sealer存储目录 -$ ./venus-sealer storage attach --init --store --seal - -# 执行sector封装,这个命令只支持单次 -# 可以通过crontab 做定时任务,也可以自行编写策略脚本执行 -$ ./venus-sealer sectors pledge - -# 查看sector列表 -$ ./venus-sealer sectors list - -# 查看actor地址 -# 这里为 -$ ./venus-sealer info - -Chain: [sync ok] [basefee 100 aFIL] -Sealer: (512 MiB sectors) -Power: 0 / 15 Ti (0.0000%) - Raw: 0 B / 1.5 TiB (0.0000%) - Committed: 3 GiB - Proving: 0 B -Below minimum power threshold, no blocks will be won -Sealer Balance: 383.869 FIL - PreCommit: 0 - Pledge: 93.75 mFIL - Vesting: 0 - Available: 383.775 FIL -Market Balance: 0 - Locked: 0 - Available: 0 -Worker Balance: 1000 FIL -Total Spendable: 1383.775 FIL +```bash +$ ./venus-miner address list ``` +## 下一步 -## 问题相关 +接下来请按照这个[文档](Using-venus-Shared-Modules.md)加入到你刚刚部署的存储池! -1. go mod 出先如下问题 +## 问题? -```shell script -SECURITY ERROR -This download does NOT match an earlier download recorded in go.sum. -The bits may have been replaced on the origin server, or an attacker may -have intercepted the download attempt. - - -# 解决方案 -go clean -modcache -go mod tidy -``` +来[Slack](https://filecoinproject.slack.com/archives/CEHHJNJS3)上找我们吧! diff --git a/docs/zh/guide/Using-venus-Shared-Modules.md b/docs/zh/guide/Using-venus-Shared-Modules.md index ee497bcab..c7c79b51a 100644 --- a/docs/zh/guide/Using-venus-Shared-Modules.md +++ b/docs/zh/guide/Using-venus-Shared-Modules.md @@ -170,7 +170,7 @@ $ ./venus-wallet new bls ```toml [APIRegisterHub] -RegisterAPI = ["/ip4//tcp/45132"] +RegisterAPI = ["/ip4//tcp/45132"] Token = "" SupportAccounts = [""] ``` @@ -219,8 +219,8 @@ $ nohup ./venus-sealer init \ --network nerpa \ # Config for different shared venus modules --node-url /ip4//tcp/3453 \ ---messager-url /ip4//tcp/3453 \ ---gateway-url /ip4//tcp/3453 \ +--messager-url /ip4//tcp/ \ +--gateway-url /ip4//tcp/ \ --auth-token \ # Flags sealer to not storing any sealed sectors on the machine it runs on # You can leave out this flag if you are on testnet @@ -252,8 +252,8 @@ $ ./venus-sealer init \ --network nerpa \ # Config for different shared venus modules --node-url /ip4//tcp/3453 \ ---messager-url /ip4//tcp/3453 \ ---gateway-url /ip4//tcp/3453 \ +--messager-url /ip4//tcp/ \ +--gateway-url /ip4//tcp/ \ --auth-token \ # Flags sealer to not store any sealed sectors on the machine it runs on --no-local-storage \ diff --git a/docs/zh/modules/How-To-Use-Messager.md b/docs/zh/modules/How-To-Use-Messager.md index 7fcb50c16..14ea66f13 100644 --- a/docs/zh/modules/How-To-Use-Messager.md +++ b/docs/zh/modules/How-To-Use-Messager.md @@ -2,19 +2,17 @@ messager 是用于管理本地消息的组件,目的是保存地址消息,管理消息状态以及控制推送消息的频率。 -[Toc] - ## 开始 ### 克隆代码到你的机器 -``` +```bash git clone https://github.com/filecoin-project/venus-messager.git ``` ### 安装依赖及构建 -``` +```bash make deps make ``` @@ -27,7 +25,7 @@ make * 启动时指定的配置文件不存在,则会生成对应名称的配置文件,并把设置的参数的值写到配置文件 * 启动时指定的配置文件存在,设置的参数的值会被使用,但不会写到配置文件,未设置的参数则使用配置文件中参数的值 -``` +```bash options: --auth-url auth服务的URL,默认: http://127.0.0.1:8989 --auth-token auth服务的token @@ -46,13 +44,13 @@ options: 1. 查询消息 -``` +```bash ./venus-messager msg search --id= or --cid= ``` 2. 列出消息 -``` +```bash ./venus-messager msg list # 列出相同地址的消息 ./venus-messager msg list --from
@@ -60,31 +58,31 @@ options: 3. 更新一个已上链消息(但数据库的状态未更新)的状态 -``` +```bash ./venus-messager msg update_filled_msg --id= ``` 4. 更新所有已上链消息(但数据库的状态未更新)的状态 -``` +```bash ./venus-messager msg update_all_filled_msg ``` 5. 等待消息的结果 -``` +```bash ./venus-messager msg wait ``` 6. 通过ID重新发布消息 -``` +```bash ./venus-messager msg republish ``` 7. 替换消息 -``` +```bash ./venus-messager msg replace --gas-feecap=[gas-feecap] --gas-premium=[gas-premium] --gas-limit=[gas-limit] --auto=[auto] --max-fee=[max-fee] # or ./venus-messager msg replace --gas-feecap=[gas-feecap] --gas-premium=[gas-premium] --gas-limit=[gas-limit] --auto=[auto] --max-fee=[max-fee] @@ -92,19 +90,19 @@ options: 8. 列出失败的消息,可能是消息签名失败或gas估算失败 -``` +```bash ./venus-messager msg list-fail ``` 9. 列出一段时间未链接的消息 -``` +```bash ./venus-messager msg list-blocked ``` 10. 手动标记异常的消息 -``` +```bash ./venus-messager msg mark-bad ``` @@ -112,13 +110,13 @@ options: 1. 查询地址 -``` +```bash ./venus-messager address search
``` 2. 列出地址 -``` +```bash ./venus-messager address list ``` @@ -126,25 +124,25 @@ options: > 把地址的nonce设置为链上的nonce,并且全部未上链消息都被标记为`错误消息` -``` +```bash ./venus-messager reset
``` 4. 冻结地址,不再接收推送的消息 -``` +```bash ./venus-messager address forbidden
``` 5. 激活冻结的地址 -``` +```bash ./venus-messager address active
``` 6. 设置地址一轮推送选择消息的最大数量 -``` +```bash ./venus-messager address set-sel-msg-num --num=5
``` @@ -152,7 +150,7 @@ options: > venus message address set-fee-params [options] address -``` +```bash # options # --gas-overestimation 估算gas的系数 (default: 0) # --max-feecap 单个消息愿意付出的最多 feecap (包括燃烧和支付给矿工, attoFIL/GasUnit) @@ -165,13 +163,13 @@ options: 1. 获取共享的参数 -``` +```bash ./venus-messager share-params get ``` 2. 设置共享的参数 -``` +```bash # expireEpoch is the expiration height of the message, 0 means it will not expire # selMsgNum is the maximum number of messages pushed to mpool by a single address at a time # scanInterval is the interval to scan the remote wallet @@ -182,7 +180,7 @@ options: 3. 从数据库手动刷新共享参数 -``` +```bash ./venus-messager share-params refresh ``` @@ -190,25 +188,25 @@ options: 1. 按名称搜索节点信息 -``` +```bashbash ./venus-messager node search ``` 2. 添加节点信息 -``` +```bash ./venus-messager node add --name= --url= --token= ``` 3. 节点信息列表 -``` +```bash ./venus-messager node list ``` 4. 根据名称删除节点信息 -``` +```bash ./venus-messager node del ``` @@ -216,7 +214,7 @@ options: 1. 设置日志级别 -``` +```bash # 支持的级别:trace,debug,info,warn|warning,error,fatal,panic ./venus-messager log set-level ```