TODO:
- Add config to put blockchain data on EBS
Steps to create a Bitprim cluster. The architecture will be 2 tiered: a BCH node tier and an API server tier. Both tiers are instances of a Bitprim server but with different configuration files.
For each server in the cluster create a .net environment and install Bitprim:
# Some .net libs
wget -q https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb
dpkg -i packages-microsoft-prod.deb
# Install .net and dependencies
apt-get update
apt-get install -y dotnet-sdk-2.1 unzip python3 python3-pip
# Install Conan build tool
pip3 install conan
# Download source
cd ~
wget https://github.com/bitprim/bitprim-insight/archive/v1.6.4.zip
unzip v1.6.4.zip
cd ~/bitprim-insight-1.6.4/bitprim.insight
# Build
dotnet build /p:BCH=true -c Release -v normal
Copy the relevant config to ~/bitprim-insight-1.6.4/bitprim.insight/appsettings.json.
For API config, change "ForwardUrl": "http://localhost:1549",
to point to the BCH node address or load balancer address.
Start BCH node tier instance:
dotnet bin/Release/netcoreapp2.0/bitprim.insight.dll --server.port=1549 --server.address=0.0.0.0
Start API tier instance:
dotnet bin/Release/netcoreapp2.0/bitprim.insight.dll --server.port=3000 --server.address=0.0.0.0
~> curl http://<API load balancer IP>:3000/api/block-index/0
{"blockHash":"000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f"}