BLOCd

HTTP RPC API

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.

  • Enter the requested input for each function
  • Send command direcly to a remote BLOCd node using the RPC port

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.


Example: http://0.0.0.0:2086/



{API}
BLOC-DAEMON

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.



{API}
BLOC - DAEMON

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.

 



Implementation Notes

height() return the height of the daemon and the network


There are no inputs for this Function


Output Parameters 3 outputs
Only display the first 3 outputs. Click for more outputs.

Argument Description Format
height Current daemon height integer
network_height Current Network height integer
status Status of request string

TRY IT OUT



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)

Expected Output

{
    "height": 104378,
    "network_height": 104378,
    "status":"OK"
}

Implementation Notes

info () returns information related to the network and daemon connection


There are no inputs for this Function


Output Parameters 21 outputs
Only display the first 3 outputs. Click for more outputs.

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

TRY IT OUT



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)

Expected Output

{ 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 }

Implementation Notes

gettransactions () returns list of missed transactions


There are no inputs for this Function


Output Parameters 3 outputs
Only display the first 3 outputs. Click for more outputs.

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

TRY IT OUT



curl http://machine.domain:port/gettransactions

<?php
$response = $blocd->getTransactions();
echo $response;

daemon.getTransactions({
  hashes: [
    '40e830f0e97d93a33d3c1c5505fdb7baa7526f3e1122d7aadfc9f2124b637445',
    '8cdabcfdf89e67b2d7eaa861f5674db5f1f2ded1abc179dde568e7ab3d1dded1'
  ]
}).then((result) => {
  // do something
})

Not Implemented

Expected Output

{ missed_tx: [],
  status: 'OK',
  txs_as_hex:
   [ '010003025a01d89f0c...fdc006',
     '...9166561652b9e02' ] }

Implementation Notes

peers () returns the list of peers connected to the daemon


There are no inputs for this Function


Output Parameters 2 outputs
Only display the first 3 outputs. Click for more outputs.

Argument Description Format
peers array of peers (peer_ip:peer_port) array
status Status of request string

TRY IT OUT



curl http://machine.domain:port/peers

<?php
$response = $blocd->getPeers();
echo $response;

response = blocd.get_peers()
print(response)

response := daemon.Peers()
fmt.Println(response)

Expected Output

{ 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' }

Implementation Notes

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


There are no inputs for this Function


Output Parameters 3 outputs
Only display the first 3 outputs. Click for more outputs.

Argument Description Format
address address to which the fee is paid string
amount fee amount integer
status Status of fees for the node string

TRY IT OUT



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)

Expected Output

{ address:'abLoc8oL14r8DUdzXBPwN8LPMSBJfS3BaFG96gQPhFWRNBw2g6AHpFoJyuYP7h83cPEcLYxKAgMs9L27S3tBNEHaMkR6JhDsLt5',
  amount: 5,
  status: 'OK' }

Implementation Notes

gettotalcoins () returns the total number of BLOC coins currently in circulation


There are no inputs for this Function


Output Parameters 2 outputs
Only display the first 3 outputs. Click for more outputs.

Argument Description Format
alreadyGeneratedCoins BLOC coins current supply integer
status status string

TRY IT OUT



curl http://machine.domain:port/gettotalcoins

not implemented

not implemented

not implemented

Expected Output

{"alreadyGeneratedCoins":"53152191205","status":"OK"}