BLOCd daemon provides a HTTP RPC API, used to receive informations from the blockchain allowing it to be controlled locally or remotely which makes it useful for integration with other software or in larger payment systems. Various commands are made available by the API described on this page.
BLOCd HTTP RPC API
Used to receive informations from the blockchain
Start BLOCd with arguments and use this page to connect to your BLOCd node or enter the details to connect to a BLOCd public remote node. Make sure you enter the address exactly like on the exemple. Once connected, you will be able to use all the functions described below.
A simple way to test your application or/and connect to a BLOCd public remote node and send commands.
Note: We are not saving any logs/requests on this website. Only you see the outputs.
BLOC integration
Make sure you follow this instructions before getting started with BLOC
BLOC integration process may differes from other cryptocurrencies. Firstly, the coin has three separate binaries:
We also support the following official client bindings:
Please click on each of the service you would like to use to see how does it work and how to implement BLOC into your application and/or website.
Getting started
Use the form below to test the integration of the BLOCd HTTP RPC API into your application. Make sure you have filled the connexion details at the top of this page.
This section describes BLOCd daemon integration process into your service with BLOCd HTTP RPC API. We also have available the BLOCd JSON RPC API if you need.
Make sure you have started BLOCd with the correct arguments before using the following functions. You can also check out the list of the BLOCd inline commands available.
To start the Daemon HTTP RPC API server at http://localhost:2086, run:
./BLOCd --rpc-bind-port=2086
To make the server accessible from another computer, use the --rpc-bind-ip 0.0.0.0switch.
./BLOCd --rpc-bind-ip=0.0.0.0 --rpc-bind-port=2086
To enable block explorer API access (like for getblocks, gettransactionpool, etc.), use the --enable_blockexplorer switch.
./BLOCd --enable-blockexplorer
The above given switches can be combined to achieve remote access with block explorer methods as shown below.
./BLOCd --enable-blockexplorer --rpc-bind-ip=0.0.0.0 --rpc-bind-port=2086
To make a HTTP RPC request to your BLOCd node you should use a GET
request that looks like this:
http://<service address>:<service port>/
Where:
<service address>
is an IP of BLOCd node, if BLOCd is located on local machine it is either 127.0.0.1 or localhost,<service port>
is BLOCd RPC port, by default it is binded to 2086 port, but it can be manually binded to any port you want, read more about this here.
Make sure you have filled the connexion details at the top of this page. Once you are ready, scroll down until your favorite function, fill the details and click TRY IT OUT
button to send the request and get the the response.
height()
return the height of the daemon and the network
Argument | Description | Format |
---|---|---|
height | Current daemon height | integer |
network_height | Current Network height | integer |
status | Status of request | string |
curl http://machine.domain:port/height
<?php $response = $blocd->getHeight(); echo $response;
daemon.getHeight().then((result) => { // do something }).catch((error) => { // do something })
response := daemon.Height() fmt.Println(response)
{ "height": 104378, "network_height": 104378, "status":"OK" }
info ()
returns information related to the network and daemon connection
Argument | Description | Format |
---|---|---|
alt_blocks_count | Alternative block counts | integer |
difficulty | difficulty of the top block | integer |
gray_peerlist_size | Gray peers are offline and not reachable | integer |
hashrate | hashrate of the network | integer |
height | height of the daemon | integer |
incoming_connections_count | number of incoming connections to the daemon | integer |
last_known_block_index | last known block from the blockchain | integer |
major_version | Major version | integer |
minor_version | Minor version | integer |
network_height | height of the network | integer |
outgoing_connections_count | number of outgoing connections from the daemon | integer |
start_time | Start time | integer |
status | Status of request | string |
supported_height | supported fork height | integer |
synced | sync status | bool |
testnet | whether the daemon is on testnet or not | bool |
tx_count | transaction count in the network | integer |
tx_pool_size | Number of transactions in the pool | integer |
upgrade_heights | pre-determined fork heights | array |
version | version of the daemon | string |
white_peerlist_size | White peers are online and reachable | integer |
curl http://machine.domain:port/info
<?php $response = $blocd->getInfo(); echo $response;
daemon.getInfo().then((result) => { // do something }).catch((error) => { // do something })
response := daemon.Info() fmt.Println(response)
{ alt_blocks_count: 0, difficulty: 49448303, grey_peerlist_size: 432, hashrate: 412069, height: 104378, incoming_connections_count: 0, last_known_block_index: 104376, major_version: 4, minor_version: 0, network_height: 104378, outgoing_connections_count: 8, start_time: 1540806518, status: 'OK', supported_height: 40500, synced: true, testnet: false, tx_count: 235763, tx_pool_size: 33, upgrade_heights: [ 1, 50, 100, 40500 ], version: '3.0.0', white_peerlist_size: 45 }
gettransactions ()
returns list of missed transactions
Argument | Description | Format |
---|---|---|
missed_tx | array of missed transactions | array |
status | Status of request | string |
txs_as_hex | array of hex values of missed transactions | array |
curl http://machine.domain:port/gettransactions
<?php $response = $blocd->getTransactions(); echo $response;
daemon.getTransactions({ hashes: [ '40e830f0e97d93a33d3c1c5505fdb7baa7526f3e1122d7aadfc9f2124b637445', '8cdabcfdf89e67b2d7eaa861f5674db5f1f2ded1abc179dde568e7ab3d1dded1' ] }).then((result) => { // do something })
Not Implemented
{ missed_tx: [], status: 'OK', txs_as_hex: [ '010003025a01d89f0c...fdc006', '...9166561652b9e02' ] }
peers ()
returns the list of peers connected to the daemon
Argument | Description | Format |
---|---|---|
peers | array of peers (peer_ip:peer_port) | array |
status | Status of request | string |
curl http://machine.domain:port/peers
<?php $response = $blocd->getPeers(); echo $response;
response = blocd.get_peers() print(response)
response := daemon.Peers() fmt.Println(response)
{ peers: [ '116.72.193.145:2082', '197.88.72.131:2082', '173.254.207.154:2082', '85.222.5.143:2082', '178.128.20.108:2082', '139.59.73.98:2082', '193.33.100.27:2082' ], status: 'OK' }
fee ()
returns information about the fee set for the remote node
Note: Amounts use atomic units, 1 BLOC = 10000 units, so 0.0001 BLOC = 1 unit
Argument | Description | Format |
---|---|---|
address | address to which the fee is paid | string |
amount | fee amount | integer |
status | Status of fees for the node | string |
curl http://machine.domain:port/fee
<?php $response = $blocd->getFeeInfo(); echo $response;
daemon.feeInfo().then((result) => { // do something }).catch((error) => { // do something })
response := daemon.Fee() fmt.Println(response)
{ address:'abLoc8oL14r8DUdzXBPwN8LPMSBJfS3BaFG96gQPhFWRNBw2g6AHpFoJyuYP7h83cPEcLYxKAgMs9L27S3tBNEHaMkR6JhDsLt5', amount: 5, status: 'OK' }
gettotalcoins ()
returns the total number of BLOC coins currently in circulation
Argument | Description | Format |
---|---|---|
alreadyGeneratedCoins | BLOC coins current supply | integer |
status | status | string |
curl http://machine.domain:port/gettotalcoins
not implemented
not implemented
not implemented
{"alreadyGeneratedCoins":"53152191205","status":"OK"}