源码方式搭建Sui全节点及交互
# fork https://github.com/MystenLabs/sui
$ git clone git@github.com:bityoume/sui.git bityoume_sui
$ cd bityoume_sui
$ git remote add upstream https://github.com/MystenLabs/sui
$ git fetch upstream
$ cargo build --release
$ cp target/release/sui-node ~/.cargo/bin/
$ mkdir -p ~/sui-devnet/config
$ cp crates/sui-config/data/fullnode-template.yaml ~/sui-devnet/config/fullnode.yaml
$ cd ~/sui
curl -fLJO https://github.com/MystenLabs/sui-genesis/raw/main/devnet/genesis.blob
fullnode.yaml
db-path: "/opt/sui/db"
......
genesis:
genesis-file-location: "/opt/sui/config/genesis.blob"
db-path: "/root/sui-devnet/db"
......
genesis:
genesis-file-location: "/root/sui-devnet/config/genesis.blob"
$ sui-node --config-path ./fullnode.yaml
curl --location --request POST 'http://127.0.0.1:9000/' --header 'Content-Type: application/json' --data-raw '{
"jsonrpc": "2.0",
"id": 1,
"method": "sui_getTotalTransactionBlocks",
"params": []
}'
{"jsonrpc":"2.0","result":"631041","id":1}
耐心等待区块同步完成。。。
$ sui client new-env --alias localnet --rpc http://127.0.0.1:9000
Added new Sui env [localnet] to config.
$ sui client switch --env localnet
Active environment switched to [localnet]
==待区块同步完成后,再进行其他交互测试==
如果觉得我的文章对您有用,请随意打赏。你的支持将鼓励我继续创作!