Spring Boot application wich integrates with Giant-cli tool v1.2.2.1 and every 5 minutes reloads page and shows actual values for last block number in blockchain and its complexity
Available API:
- giant-cli getblockcount - last block number
- giant-cli getblockhash :height - block hash by number
- giant-cli getblock :hash - get block info by hash
- boost-libs v1.58
$ mkdir -p ~/tmp/boost
$ wget http://sourceforge.net/projects/boost/files/boost/1.58.0/boost_1_58_0.tar.gz -P ~/tmp/boost
$ cd ~/tmp/boost
$ tar -xf boost_1_58_0.tar.gz; cd boost_1_58_0
$ ./bootstrap.sh --with-python-version=2.7
$ sudo ./b2 install
$ rm -rf ~/tmp
$ # update shared libraries configuration
$ sudo echo "/usr/local/lib" > /etc/ld.so.conf.d/giant.conf # boost-libs
$ sudo ldconfig
- miniupnpc 1.0
$ sudo ln -s /usr/lib/libminiupnpc.so.17 /usr/lib/libminiupnpc.so.10
Other dependecies may be installed from official repo or downgraded
$ mkdir ~/.giant -p
$ echo -e "rpcuser=user\nrpcpassword=password" > ~/.giant/giant.conf
$ wget https://github.com/GiantPay/GiantCore/releases/download/1.2.2.1/giant-1.2.2.1-linux64.zip -P /tmp
$ cd /tmp; unzip giant-1.2.2.1-linux64.zip -d giant-1.2.2.1-linux64; cd giant-1.2.2.1-linux64
$ # test all dependencies provided
$ ./giantd -testnet & 2>/dev/null # daemon
$ ./giant-cli # client
$ # test all works good - retrieve last block number and complexity in blockchain
$ ./giant-cli -testnet getblock \
$(./giant-cli -testnet getblockhash \
$(./giant-cli -testnet getblockcount)) \
| jq '. | {number: .height, complexity: .difficulty}'
{
"number": 0,
"complexity": 0.00024414
}
$ git -C /tmp clone https://github.com/gzheyts/giant-cli-integration-demo
$ mvn -f /tmp/giant-cli-integration-demo/pom.xml clean test spring-boot:run
Then navigate to localhost:8080
The code is released under the MIT license