快速入门教程
- 安装node
# 建立软连接
ln -s /usr/local/node-v14.16.0-linux-x64/bin/npm /usr/local/bin/
ln -s /usr/local/node-v14.16.0-linux-x64/bin/node /usr/local/bin/
ln -s /usr/local/node-v14.16.0-linux-x64/bin/npx /usr/local/bin/
- 生成脚本以及文件
npx quorum-dev-quickstart
- 启动网络
cd quorum-test-network
./run.sh
示例:
[root@localhost quorum-test-network]# ./run.sh
*************************************
Quorum Dev Quickstart
*************************************
Start network
--------------------
Starting network...
validator1 uses an image, skipping
validator2 uses an image, skipping
validator3 uses an image, skipping
validator4 uses an image, skipping
rpcnode uses an image, skipping
ethsignerProxy uses an image, skipping
member1orion uses an image, skipping
member1besu uses an image, skipping
member2orion uses an image, skipping
member2besu uses an image, skipping
member3orion uses an image, skipping
member3besu uses an image, skipping
prometheus uses an image, skipping
grafana uses an image, skipping
Building explorer
Step 1/4 : FROM nginx:alpine
alpine: Pulling from library/nginx
Digest: sha256:c2ce58e024275728b00a554ac25628af25c54782865b3487b11c21cafb7fabda
Status: Image is up to date for nginx:alpine
---> 629df02b47c8
Step 2/4 : COPY dist /usr/share/nginx/html
---> Using cache
---> 5aea2c10d9fa
Step 3/4 : RUN sed -i 's@NODE_ENV:"production",BASE_URL:"/"@NODE_URL:"/rpcnode/jsonrpc",CONNECTION_TYPE:"json_rpc"@g' /usr/share/nginx/html/js/*.js
---> Using cache
---> 0cc7995b7dba
Step 4/4 : COPY default.nginx /etc/nginx/conf.d/default.conf
---> Using cache
---> a41614bba121
Successfully built a41614bba121
Successfully tagged quorum-dev-quickstart/block-explorer-light:develop
Creating network "quorum-test-network_quorum-dev-quickstart" with driver "bridge"
Creating volume "quorum-test-network_public-keys" with default driver
Creating volume "quorum-test-network_prometheus" with default driver
Creating volume "quorum-test-network_grafana" with default driver
Creating volume "quorum-test-network_cakeshop" with default driver
Creating quorum-test-network_grafana_1 ... done
Creating quorum-test-network_prometheus_1 ... done
Creating quorum-test-network_member2orion_1 ... done
Creating quorum-test-network_member1orion_1 ... done
Creating quorum-test-network_member3orion_1 ... done
Creating quorum-test-network_validator1_1 ... done
Creating quorum-test-network_validator2_1 ... done
Creating quorum-test-network_validator3_1 ... done
Creating quorum-test-network_rpcnode_1 ... done
Creating quorum-test-network_validator4_1 ... done
Creating quorum-test-network_member1besu_1 ... done
Creating quorum-test-network_member2besu_1 ... done
Creating quorum-test-network_member3besu_1 ... done
Creating quorum-test-network_explorer_1 ... done
Creating quorum-test-network_ethsignerProxy_1 ... done
*************************************
Quorum Dev Quickstart
*************************************
----------------------------------
List endpoints and services
----------------------------------
JSON-RPC HTTP service endpoint : http://localhost:8545
JSON-RPC WebSocket service endpoint : ws://localhost:8546
Web block explorer address : http://localhost:25000/
Prometheus address : http://localhost:9090/graph
Grafana address : http://localhost:3000/d/XE4V0WGZz/besu-overview?orgId=1&refresh=10s&from=now-30m&to=now&var-system=All
For more information on the endpoints and services, refer to README.md in the installation directory.
****************************************************************
- 部署合约
cd smart_contracts
npm install
node scripts/deploy.js
示例:
[root@localhost smart_contracts]# node scripts/deploy.js
web3-shh package will be deprecated in version 1.3.5 and will no longer be supported.
web3-bzz package will be deprecated in version 1.3.5 and will no longer be supported.
Creating contract...
Getting contractAddress from txHash: 0x302727ed122069f39b8950a0063b3d59253c58c489b4e96f6efff42a7a05f66b
Waiting for transaction to be mined ...
Private Transaction Receipt: [object Object]
Contract deployed at address: 0xdb6172b4ed41f7039cac4d0be4dbb9992c755809
Transaction hash: 0x80eb29406546ecc15f2fe3a59b94d47a9de9cb5ced126983c7062cf69d23c41a
Waiting for transaction to be mined ...
web3-shh package will be deprecated in version 1.3.5 and will no longer be supported.
web3-bzz package will be deprecated in version 1.3.5 and will no longer be supported.
web3-shh package will be deprecated in version 1.3.5 and will no longer be supported.
web3-bzz package will be deprecated in version 1.3.5 and will no longer be supported.
web3-shh package will be deprecated in version 1.3.5 and will no longer be supported.
web3-bzz package will be deprecated in version 1.3.5 and will no longer be supported.
Transaction hash: 0x158bf1122016336e338580b3bd67b0cc8cae0f2ea234a73d1d90d9b8d6edb888
Waiting for transaction to be mined ...
Transaction hash: 0x2afc245ce46434ed6cad062943586269cd9f919f242d3dfed09e2a6fbc4caf4d
Waiting for transaction to be mined ...
Transaction hash: 0x20449d9f99a1b06b16178cdee6c242d3870a6279973eda32d94085f5025b51ce
Waiting for transaction to be mined ...
Member1 value from deployed contract is: 0x000000000000000000000000000000000000000000000000000000000000002f
Member3 value from deployed contract is: 0x000000000000000000000000000000000000000000000000000000000000002f
Member2 value from deployed contract is: 0x
[root@localhost smart_contracts]#
- 移除网络
./remove.sh
网友评论