-
Notifications
You must be signed in to change notification settings - Fork 1k
Bookkeeping Node Deployment
###Antshares Blockchain Bookkeeping Node Deployment on Windows Server
- System
- CPU: Dual-Core+
- RAM: 4G+
- Bandwidth: 5M+
- OS:
AntSharesUI | AntSharesDaemon | Miner | |
---|---|---|---|
Windows 7 SP1 x64 | ✅ | ✅ | ✅ |
Windows Server 2008 R2 | ✅ | ✅ |
- Environment
- Installation
- Compile [Miner], or download it from our official website.
- Copy [Miner] to the target server
- Enable Firewall Port: 10332,10333,20332,20333
- Run Miner.exe to initiate
Miner.exe
activates one bookkeeping nodeMiner.exe /rpc
activates one bookkeeping node with RPC server
###Antshares Blockchain Bookkeeping Node Deployment in Linux
- System
- CPU: Dual-Core+
- RAM: 4G+
- Bandwidth: 5M+
- OS:
AntSharesUI | AntSharesDaemon | Miner | |
---|---|---|---|
Ubuntu 14.04 | ✅ | ✅ | |
Ubuntu 16.04 | ✅ | ✅ | |
CentOS 7.1 | ✅ | ✅ | |
Red Hat 7.1 | ✅ | ✅ | |
Amazon Linux 2017.03.1 | ✅ | ✅ |
- Linux Deployment Explained
The bookkeeping program is currently written in C#, thus an appropriate running environment is required to successfully run in Linux. The deployment comprises 2 steps.
- Complete .Net Core running environment
- Bookkeeping Node Deployment
- For .Net Core environment, check: .Net Core
- Ubuntu 14.04
sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ trusty main" > /etc/apt/sources.list.d/dotnetdev.list'
sudo apt-key adv --keyserver apt-mo.trafficmanager.net --recv-keys 417A0893
sudo apt-get update
sudo apt-get install dotnet-dev-1.0.4
- Ubuntu 16.04
sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ trusty main" > /etc/apt/sources.list.d/dotnetdev.list'
sudo apt-key adv --keyserver apt-mo.trafficmanager.net --recv-keys 417A0893
sudo apt-get update
sudo apt-get install dotnet-dev-1.0.4
- Note: on some distributions, above command will fail because libicu52_52 is not part of the official repositories yet. You can download it manually here: https://packages.ubuntu.com/en/trusty/libicu52
- CentOS 7.1
sudo yum install libunwind libicu
curl -sSL -o dotnet.tar.gz https://go.microsoft.com/fwlink/?LinkID=827529
sudo mkdir -p /opt/dotnet && sudo tar zxf dotnet.tar.gz -C /opt/dotnet
sudo ln -s /opt/dotnet/dotnet /usr/local/bin
- RedHat Enterprise Linux 7 Server
subscription-manager repos --enable=rhel-7-server-dotnet-rpms
yum install scl-utils
yum install rh-dotnetcore10
scl enable rh-dotnetcore10 bash
- Amazon Linux 2017.03.01 (almost same as centos except for dotnet link)
sudo yum install libunwind libicu
curl -sSL -o dotnet.tar.gz https://go.microsoft.com/fwlink/?LinkID=843449
sudo mkdir -p /opt/dotnet && sudo tar zxf dotnet.tar.gz -C /opt/dotnet
sudo ln -s /opt/dotnet/dotnet /usr/local/bin
If the installation is successful, check if the dotnet core environment is successfully installed with the following command:
+ mkdir hwapp
+ cd hwapp
+ dotnet new
+ dotnet restore
+ dotnet run
- Bookkeeping Node Deployment
- Compile [Miner], or download it from our official website.
- Copy [Miner] to the target server
- Enable Firewall Port: 10332,10333,20332,20333
- Run AntSharesDaemon.dll to initiate
dotnet AntSharesDaemon.dll
activates one bookkeeping node
dotnet AntSharesDaemon.dll /rpc
activates one bookkeeping node with rpc server
###Antshares Bookkeeping Node Deployment in Docker
- docker installation see:
https://www.docker.com/products/overview
- download docker installation pack
curl -fsSLO https://get.daocloud.io/docker/builds/Linux/x86_64/docker-1.12.1.tgz
- install docker
sudo tar --strip-components=1 -xvzf docker-1.12.1.tgz -C /usr/local/bin
- run docker in daemon mode
/usr/local/bin/dockerd
if you see "Your kernel does not support cgroup memory limit", the reason could be cgroup not be mounted on the host, edit /etc/fstab, and add "none /sys/fs/cgroup cgroup defaults 0 0"
- load antsharesdaemon img with dotnet environment(download from our cloud drive: https://pan.baidu.com/s/1jI0TIJW#list/path=%2FDocker)
sudo docker load < docker_image_antsharesdaemon.tar
- run antshares/antsharesdaemon img
sudo docker run -it -p 10332:10332 -p 10333:10333 antshares/antsharesdaemon
-p is the port mapping instruction, 10333 is the port for the bookkeeping node, 10332 is the RPC service port, you can change the port in the config.json and protocol.json files of the image. You can use instruction "sudo docker port $CONTAINERID" to check the mapping of the ports.
-
enter /home/antshares/AntSharesDaemon
-
edit config.json, note that DataDirectoryPath stands for blockchain data directory, NodePort is the port number of the client.
-
edit protocol.json, Magic stands for protocol identifier, CoinVersion to control first letter of an address, StandbyMiners stands for default bookkeeper public key list and SeedList for seed nodes list.
-
Initiate Bookkeeping node by dotnet and enable rpc service
dotnet AntSharesDaemon.dll /rpc
(if you see KeyNotFoundException, probably Miner node had run once before config change. You can delete directory /Chain under /Miner and run again to solve this.)