赞
踩
也可以参考该链接
搭建第一个区块链网络 — FISCO BCOS 2.0 v2.9.0 文档
bash build_chain.sh -l 127.0.0.1:4 -p 30300,20200,8545 -e ./fisco-bcos
bash nodes/127.0.0.1/start_all.sh
ps -ef | grep fisco
tail -f nodes/127.0.0.1/node0/log/log* | grep connected
ps -ef | grep fisco
之后按照上面的命令检查进程
bash nodes/127.0.0.1/start_all.sh
注意该路径需要按照你自己配置的环境进行,可以先去fisco-bcos/nodes中输入tree -a,查看配置文件的位置,复制到console/conf中,姑该命令在console中进行
- cd console
- cp ../nodes/127.0.0.1/sdk/* conf/
bash start.sh
- getBlockNumber
- #退出
- exit
bash nodes/127.0.0.1/stop_all.sh
关闭之后检查
需要先cd webase-deploy
- cd webase-deploy
- #启动
- python3 deploy.py startAll
注意,需要有验证码,下面是解决没有验证码问题
如果没有验证码,检查webase-node-mgr
修改conf/application.yml,添加如下信息
重新启动webase-node-mgr并检查
验证webase-front,webase.node.mgr,webase.sign,节点
- #webase-front
- ps -ef | grep webase-front
- #webase.node.mgr
- ps -ef | grep webase.node.mgr
- #webase.sign
- ps -ef | grep webase.sign
- #节点
- ps -ef | grep node
配置连接正在运行的FISCO BCOS区块链,并启动
- cd console
- cp ~/fisco-bcos/webase-deploy/nodes/127.0.0.1/sdk/* conf/
bash start.sh
newAccount
listAccount
getBlockNumber
getSealerList
getNodeIDList
getConsensusStatus
getSyncStatus
getPeers
getNodeVersion
- cd fisco-bcos
- cd console
- bash start.py
deploy HelloWorld
可以查看helloworld合约
- call HelloWorld 上面部署的helloworld的合约的地址 get
- call HelloWorld 上面部署的helloworld的合约的地址 set "你需要的内容"
.通过交易号查看指定交易
getTransactionByHash 上面那个交易的hash
- cd fisco-bcos/webase-deploy
- ps -ef | grep fisco
- cd nodes/127.0.0.1
- curl -#LO https://gitee.com/FISCO-BCOS/FISCO-BCOS/raw/master-2.0/tools/gen_node_cert.sh
bash gen_node_cert.sh -c ../cert/agencyA -o node2
cp node0/config.ini node0/start.sh node0/stop.sh node2/
vim node2/config.ini
cp node0/conf/group.1.genesis node0/conf/group.1.ini node2/conf/
- bash node2/start.sh
- tail -f node2/log/log* | grep "connected count"
如果需要改变节点类型,可以点击私钥管理,点击新增用户,点击确定,然后点击链管理,点击修改,选择节点类型即可。
使用WeBASE导出admin用户至WeBASE-Front
通过WeBASE-Front部署StringGetSet合约,点击保存,编译,部署
- pragma solidity ^0.4.24;
- contract StringGetSet {
- string myValue;
- function StringGetSet(){
- myValue = "demo";
- }
- function get()constant returns(string) {
- return myValue;
- }
- function set(string input) {
- myValue = input;
- }
- }
调用StringGetSet合约验证
刚开始点击get会返回demo
先创建用户uesr1,user2,user3
注意:此时的user1的权重有50,比较大,不需要投两次票就可以直接撤销
tar zxvf console.tar.gz
- cp -n console/conf/config-example.toml console/conf/config.toml
- cp nodes/127.0.0.1/sdk/* console/conf/
- vim console/conf/config.toml
修改config.toml中的端口, 将文件中的20200替换成节点对应的channel端口。
bash console/start.sh 2
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。