接下来会详细讲解如何部署AntShares和搭建私有链,本文使用virtualbox + ubuntu16.04 + AntSharesCore v1.4.,参考了官方文档。
第一步,安装.net core,如果提示安装失败,则多刷“sudo apt-get update”几次,详见官方安装指导:sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ xenial main" > /etc/apt/sources.list.d/dotnetdev.list'
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 417A0893
sudo apt-get update
sudo apt-get install dotnet-dev-1.0.4
验证.net core是否安装成功,跑一下helloworld:
dotnet new console -o hwapp
cd hwapp
dotnet restore
dotnet run
第二步,节点部署
先下载并解压缩AntSharesCore(区块链客户端同时也是服务器端)
wget https://github.com/AntShares/AntSharesCore/releases/download/v1.4.5/AntSharesCore-CLI-v1.4.5.zip
unzip AntSharesCore-CLI-v1.4.5.zip
运行AntSharesDaemon.dll 去初始化。
dotnet AntSharesDaemon.dll activates one bookkeeping node
dotnet AntSharesDaemon.dll /rpc activates one bookkeeping node with rpc server
4个虚拟机运行后IP地址
1.db3所在服务器的IP:10.0.2.4{
"ProtocolConfiguration": {
"Magic": 7630404,
"CoinVersion": 23,
"StandbyMiners": [
"03f1d8df48cac340eaaf9ad5dfadac75fb45e2a48ba3c6c63721b340826f3daa18",
"0313f7d3d34b95d3dcf016d23ad4e22f2b6253dfafc54971cd55f678170f40a735",
"03cb28efdb867960536aec1d9ba395bbf639888062d6186863756425c741741608",
"03a26ef67f370d618c76859723f0c987133bc4d2236c7824e0938a52b6e7d6a6e5"
],
"SeedList": [
"10.0.2.4:10333",
"10.0.2.5:10333",
"10.0.2.6:10333",
"10.0.2.7:10333"
],
"SystemFee": {
"EnrollmentTransaction": 1000,
"IssueTransaction": 500,
"PublishTransaction": 500,
"RegisterTransaction": 10000
}
}
}
cd hwapp
cd AntSharesCore
dotnet AntSharesDaemon.dll /rpc
open wallet /home/hellogv/hwapp/wallets/1.db3
start consensus
open wallet /home/hellogv/hwapp/wallets/2.db3
start consensus
open wallet /home/hellogv/hwapp/wallets/3.db3
start consensus
open wallet /home/hellogv/hwapp/wallets/4.db3
start consensus