1.docker安装
2.g++、gcc安装
3.新版golang安装
1.git clone https://github.com/xuperchain/xuperunion.git
Cloning into 'xuperunion'...
remote: Enumerating objects: 82, done.
remote: Counting objects: 100% (82/82), done.
remote: Compressing objects: 100% (70/70), done.
remote: Total 8190 (delta 29), reused 28 (delta 9), pack-reused 8108
Receiving objects: 100% (8190/8190), 12.12 MiB | 1.29 MiB/s, done.
Resolving deltas: 100% (3597/3597), done.
2.cd xuperunion
3.git checkout v3.1
Branch 'v3.1' set up to track remote branch 'v3.1' from 'origin'.
Switched to a new branch 'v3.1'
4.git log
commit 391f49418d5a313a0c301ebb496dd52ee03d4336 (HEAD -> v3.1, origin/v3.1)
Author: Yucao Wang
Date: Tue Jun 4 04:56:46 2019 -0500
Update issue/PR template and contributing.md (#54)
* update CONTRIBUTING.md
Add more strict issue/PR requirements
* Update xuperchain-issue-template.md
* Update and rename xuperchain-issue-template.md to xuperchain-bug-template.md
* Create xuperchain-feature-request-template
* Create pull_request_template.md
commit 91caec11057be0dd535c4ae9359657b693f84361
Author: xuperadmin <[email protected]>
Date: Fri May 31 20:17:04 2019 +0800
fix typo (#48)
* 增加wasm虚拟机初始化失败的判断
* fix misspell
5.make
1.mkdir pn1 pn2 pn3
输入 ll
确定新建的三个目录属于当前用户而非root
2.cp -r output/* pn1 pn2 pn3
3.配置 pn1/data/config/xuper.json 里的address为pn1/data/config/address里的内容,修改 矿工数量 和 矿工地址列表 后 复制该文件替换pn2/data/config/ 和 pn3/data/config/ 下的 xuper.json
4.未完待续。。。
1.mkdir pn1 pn2 pn3
输入 ll
确定新建的三个目录属于当前用户而非root
2.cp -r output/* pn1 pn2 pn3
3.如下配置 pn1/data/config/xuper.json 后 复制该文件替换pn2/data/config/ 和 pn3/data/config/ 下的 xuper.json
{
"version" : "1",
# 预分配
"predistribution":[
{
"address" : "Y4TmpfV4pvhYT5W17J7TqHSLo6cqq23x3", #这里填指令 more pn1/data/keys/address 返回的地址
"quota" : "1000000000000000"
}
],
"maxblocksize" : "128",
"award" : "1000000",
"decimals" : "8",
"award_decay": {
"height_gap": 31536000,
"ratio": 0.5
},
"genesis_consensus":{
"name": "pow",
"config": {
# 默认难度值
"defaultTarget": "19",
# 每隔10个区块做一次难度调整
"adjustHeightGap": "10",
"expectedPeriod": "15",
"maxTarget": "22"
}
}
}
./xchain-cli account newkeys -f
./xchain-cli netURL gen
此时在pn2和pn3 /data 目录下生成新的 keys 和 netkeys 文件夹 通过 more data/keys/address
分别得到pn2和pn3的address
5.cd ~/xuperunion/pn1
执行下面的指令
./xchain-cli createChain
nohup ./xchain &
./xchain-cli netURL get #得到pn1.url 复制 放入pn2和pn3 data/conf/xchain.yaml文件中的bootNodes
修改pn2和pn3 data/conf/xchain.yaml文件中的 tcpServer下port和metricPort,p2pV2下的port (+1) 使多节点该值不同
6.在 pn2 和 pn3 目录下执行第五步的创链及节点启动命令 通过./xchain-cli netURL gen -H 127.0.0.1:3710x
命令查看多节点的状态
注意节点一的peers应为其他几点的地址:端口号 其他节点的peers为节点一的地址:端口号
7.编写脚本一次性获取所有节点的高度 vim get_trunkHeight
#!/bin/bash
for((i=1;i<=3;i++));
do
echo -n "node$i:";
./xchain-cli status -H 127.0.1.1:3710$i | grep trunkHeight;
done
执行脚本:bash get_trunkHeight
即可得到所有节点的高度
8.未完待续。。。。。