HIVEMINING : RPC CALLS

Welcome

We've added everything you need to deeply integrate hivemining into your hive pool / bee hosting service / block explorer. If you need any help or advice regarding your integration, or would like us to sanity-check your workflows, please feel free to get in touch.

Hivemining RPC Calls

Last update: 26 November 2019 (v0.16.1.2)

createbees

(Updated in 0.16.0.5 with new change_address optional parameter)
		createbees bee_count ( community_contrib, "honey_address", "change_address" )

		Create one or more bees in a single transaction, sign it, and broadcast it to the network.

		Arguments:
		1. bee_count              (numeric, required) The number of bees to create.
		2. community_contrib      (boolean, optional, default=true) If true, a small percentage of bee creation cost will be paid to a community fund.
		3. "honey_address"        (string, optional) The LCC address to receive rewards for blocks mined by bee(s) created in this transaction.
		4. "change_address"       (string, optional, default pool address) The LCC address to receive the change.

		Result:
		"txid"                    (string) The transaction id.

		Examples:
		> litecoincash-cli createbees 1
		> litecoincash-cli createbees 5 true "Cfkv9pniUJ2UoWvaukgD5Ksqx5EsVLzsCk"
		> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "createbees", "params": [12] }' -H 'content-type: text/plain;' http://127.0.0.1:62457/
		> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "createbees", "params": [34 false "Cfkv9pniUJ2UoWvaukgD5Ksqx5EsVLzsCk"] }' -H 'content-type: text/plain;' http://127.0.0.1:62457/
		

createrawbct

(New in 0.16.0.6)
		createrawbct [{"txid":"id","vout":n},...] {"address":amount,"data":"hex",...} ( locktime ) ( replaceable )

		Create a raw bee creation transaction spending the given inputs and creating the given number of bees.
		Does not add change address for unspent inputs, so be sure to add one as the final output using fundrawtransaction.
		Returns hex-encoded raw transaction.
		Note that the transaction's inputs are not signed, and it is not stored in the wallet or transmitted to the network.

		Arguments:
		1. "inputs"               (array, required) A json array of json objects
		     [
		       {
			 "txid":"id",     (string, required) The transaction id
			 "vout":n,        (numeric, required) The output number
			 "sequence":n     (numeric, optional) The sequence number
		       } 
		       ,...
		     ]
		2. bee_count              (numeric, required) The number of bees to create.
		3. "honey_address"        (string, required) The LCC address to receive rewards for blocks mined by bee(s) created in this transaction.
		4. community_contrib      (boolean, optional, default=true) If true, a small percentage of bee creation cost will be paid to a community fund.
		5. locktime               (numeric, optional, default=0) Raw locktime. Non-0 value also locktime-activates inputs

		Result:
		"transaction"             (string) hex string of the transaction

		Examples:
		> litecoincash-cli createrawbct "[{\"txid\":\"myid\",\"vout\":0}]" 1 "Cfkv9pniUJ2UoWvaukgD5Ksqx5EsVLzsCk"
		> litecoincash-cli createrawbct "[{\"txid\":\"myid\",\"vout\":0}]" 5 "Cfkv9pniUJ2UoWvaukgD5Ksqx5EsVLzsCk" false
		> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "createrawbct", "params": ["[{\"txid\":\"myid\",\"vout\":0}]", 12 "Cfkv9pniUJ2UoWvaukgD5Ksqx5EsVLzsCk"] }' -H 'content-type: text/plain;' http://127.0.0.1:62457/
		> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "createrawbct", "params": ["[{\"txid\":\"myid\",\"vout\":0}]", 34 "Cfkv9pniUJ2UoWvaukgD5Ksqx5EsVLzsCk" false] }' -H 'content-type: text/plain;' http://127.0.0.1:62457/
		

getbctinfo

		getbctinfo ( "bct_txid", min_honey_confirms )

		Lists the status of a single bee creation transaction from your current hive.

		Arguments:
		1. bct_txid               (string) Transaction ID of a bee creation transaction made by this wallet
		2. min_honey_confirms     (numeric, optional, default=1) Only include honey rewards with at least this many confirmations

		Result:
		{
		    "txid",               (string) Transaction ID of the bee creation transaction
		    time,                 (numeric) Timestamp of block containing the bee creation transaction (only present once tx is in a block)
		    bee_count,            (numeric) The number of bees created
		    community_contrib,    (boolean) If true, indicates that a portion of the bee creation fee was paid to the community fund
		    "bee_status",         (string) immature | mature | dead. Only mature bees are capable of mining
		    "honey_address",      (string) The address which will receive block rewards for blocks minted by the bees
		    bee_fee_paid,         (numeric) Total bee creation fee (in LCC)
		    rewards_paid,         (numeric) The amount of block rewards earned by the bees (in LCC)
		    profit,               (numeric) The profit earned by the bees (in LCC)
		    blocks_found,         (numeric) The number of blocks minted by the bees
		    blocks_left           (numeric) The number of blocks of bee lifespan remaining
		}

		Examples:
		> litecoincash-cli getbctinfo 1f14fc54cfce1ec53f5a8d36d8aef7ae8485e4cd693b6f404c5d2504017ecd59
		> litecoincash-cli getbctinfo 1f14fc54cfce1ec53f5a8d36d8aef7ae8485e4cd693b6f404c5d2504017ecd59, 10
		

getbeecost

		getbeecost ( height )

		Returns the cost to create a single bee at given block height.

		Arguments:
		1. height                 (numeric, optional) The block height. Defaults to current tip height.

		Result:
		amount                    (numeric) The amount in LCC

		Examples:
		> litecoincash-cli getbeecost 
		> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getbeecost", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:62457/
		

getbeecreationtxid

		getbeecreationtxid "honey_txid"

		Gives the BCT transaction id for a given honey transaction received by this wallet.

		Arguments:
		1. honey_txid          (string) Transaction ID of a honey transaction received by this wallet

		Result:
		"hex"                  (string) Transaction ID of the BCT responsible for this honey

		Examples:
		> litecoincash-cli getbeecreationtxid bd76be6d12dfd072a605fd85a2aa956f6f5e0dee5dbbb0b4b5da5e72966b9dfd
		

gethivedifficulty

		gethivedifficulty

		Returns the Hive difficulty as a multiple of the minimum difficulty.

		Result:
		n.nnn       (numeric) the Hive difficulty as a multiple of the minimum difficulty.

		Examples:
		> litecoincash-cli gethivedifficulty 
		> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "gethivedifficulty", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:62457/
		

gethiveinfo

		gethiveinfo ( include_dead, min_honey_confirms )

		Lists the status of your current hive, broken down by bee creation transaction.

		Arguments:
		1. include_dead           (boolean, optional, default=false) Include bees whose lifespans have expired
		2. min_honey_confirms     (numeric, optional, default=1) Only include honey rewards with at least this many confirmations

		Result:
		{
		    summary: {
			bee_count,                (numeric) Total bee count in hive
			mature_bees,              (numeric) Total mature bees
			immature_bees,            (numeric) Total immature bees
			blocks_found,             (numeric) Total blocks found
			bee_fee_paid,             (numeric) Total bee creation fees (in LCC)
			rewards_paid,             (numeric) Total rewards paid (in LCC)
			profit,                   (numeric) Total rewards paid (in LCC)
			"warnings"                (string) Warnings; empty if no warnings
		    },
		    bees: [
			{
			    "txid",               (string) Transaction ID of the bee creation transaction
			    time,                 (numeric) Timestamp of block containing the bee creation transaction (only present once tx is in a block)
			    bee_count,            (numeric) The number of bees created
			    community_contrib,    (boolean) If true, indicates that a portion of the bee creation fee was paid to the community fund
			    "bee_status",         (string) immature | mature | dead. Only mature bees are capable of mining
			    "honey_address",      (string) The address which will receive block rewards for blocks minted by the bees
			    bee_fee_paid,         (numeric) Total bee creation fee (in LCC)
			    rewards_paid,         (numeric) The amount of block rewards earned by the bees (in LCC)
			    profit,               (numeric) The profit earned by the bees (in LCC)
			    blocks_found,         (numeric) The number of blocks minted by the bees
			    blocks_left           (numeric) The number of blocks of bee lifespan remaining
			},...
		    ]
		}

		Examples:
		> litecoincash-cli gethiveinfo 
		> litecoincash-cli gethiveinfo true
		> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "gethiveinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:62457/
		

gethiveparams

(New in 0.16.1.2)
		gethiveparams

		Get hivemining optimisation parameters.

		Result:
		{
		  "hivecheckdelay" : n,             (numeric) Time between Hive checks in ms. This should be left at default unless performance degradation is observed.
		  "hivecheckthreads" : n,           (numeric) Number of threads to use when checking bees, -1 for all available cores, or -2 for one less than all available cores.
		  "hiveearlyout" : true|false,      (boolean) Abort Hive checking as quickly as possible when a new block comes in. This should be left enabled unless performance degradation is observed.
		}

		Examples:
		> litecoincash-cli gethiveparams 
		> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "gethiveparams", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:62457/
		

getnetworkhiveinfo

		getnetworkhiveinfo ( include_graph )

		Lists the mature and immature bee populations across the entire network. Optionally returns values to plot the future bee population.

		Arguments:
		1. include_graph                  (boolean, optional, default=false) Include bee population graph

		Result:
		{
		  immature_bee_count,             (numeric) The number of immature bees
		  immature_bct_count,             (numeric) The number of immature Bee Creation Transactions
		  mature_bee_count,               (numeric) The number of mature bees
		  mature_bct_count,               (numeric) The number of mature Bee Creation Transactions
		  honey_pot,                      (numeric) Total potential network rewards available during bee lifespan (in LCC)
		  mature_bee_pop_graph: [ ... ],  (numeric array) Graph points for mature bee population over upcoming bee gestation span + bee lifespan blocks  
		  immature_bee_pop_graph: [ ... ] (numeric array) Graph points for immature bee population over upcoming bee gestation span
		}

		Examples:
		> litecoincash-cli getnetworkhiveinfo 
		> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getnetworkhiveinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:62457/
		

listtransactions

Note the new flag, ishoney, in results from this call.
		listtransactions ( "account" count skip include_watchonly )

		Returns up to 'count' most recent transactions skipping the first 'from' transactions for account 'account'.

		Arguments:
		1. "account"      (string, optional) DEPRECATED. The account name. Should be "*".
		2. count          (numeric, optional, default=10) The number of transactions to return
		3. skip           (numeric, optional, default=0) The number of transactions to skip
		4. include_watchonly (bool, optional, default=false) Include transactions to watch-only addresses (see 'importaddress')

		Result:
		[
		  {
		    "account":"accountname",       (string) DEPRECATED. The account name associated with the transaction. 
							      It will be "" for the default account.
		    "address":"address",           (string) The litecoincash address of the transaction. Not present for 
							      move transactions (category = move).
		    "ishoney": xxx,                (bool) Whether this transaction is honey (hive block coinbase transaction)
		    "category":"send|receive|move",(string) The transaction category. 'move' is a local (off blockchain)
							      transaction between accounts, and not associated with an address,
							      transaction id or block. 'send' and 'receive' transactions are 
							      associated with an address, transaction id and block details
		    "amount": x.xxx,               (numeric) The amount in LCC. This is negative for the 'send' category, and for the
							      'move' category for moves outbound. It is positive for the 'receive' category,
							      and for the 'move' category for inbound funds.
		    "label": "label",              (string) A comment for the address/transaction, if any
		    "vout": n,                     (numeric) the vout value
		    "fee": x.xxx,                  (numeric) The amount of the fee in LCC. This is negative and only available for the 
							      'send' category of transactions.
		    "confirmations": n,            (numeric) The number of confirmations for the transaction. Available for 'send' and 
							      'receive' category of transactions. Negative confirmations indicate the
							      transaction conflicts with the block chain
		    "trusted": xxx,                (bool) Whether we consider the outputs of this unconfirmed transaction safe to spend.
		    "blockhash": "hashvalue",      (string) The block hash containing the transaction. Available for 'send' and 'receive'
							       category of transactions.
		    "blockindex": n,               (numeric) The index of the transaction in the block that includes it. Available for 'send' and 'receive'
							       category of transactions.
		    "blocktime": xxx,              (numeric) The block time in seconds since epoch (1 Jan 1970 GMT).
		    "txid": "transactionid",       (string) The transaction id. Available for 'send' and 'receive' category of transactions.
		    "time": xxx,                   (numeric) The transaction time in seconds since epoch (midnight Jan 1 1970 GMT).
		    "timereceived": xxx,           (numeric) The time received in seconds since epoch (midnight Jan 1 1970 GMT). Available 
							       for 'send' and 'receive' category of transactions.
		    "comment": "...",              (string) If a comment is associated with the transaction.
		    "otheraccount": "accountname", (string) DEPRECATED. For the 'move' category of transactions, the account the funds came 
							       from (for receiving funds, positive amounts), or went to (for sending funds,
							       negative amounts).
		    "bip125-replaceable": "yes|no|unknown",  (string) Whether this transaction could be replaced due to BIP125 (replace-by-fee);
							       may be unknown for unconfirmed transactions not in the mempool
		    "abandoned": xxx               (bool) 'true' if the transaction has been abandoned (inputs are respendable). Only available for the 
							       'send' category of transactions.
		  }
		]

		Examples:

		List the most recent 10 transactions in the systems
		> litecoincash-cli listtransactions 

		List transactions 100 to 120
		> litecoincash-cli listtransactions "*" 20 100

		As a json rpc call
		> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "listtransactions", "params": ["*", 20, 100] }' -H 'content-type: text/plain;' http://127.0.0.1:62457/		
		

sethiveparams

(New in 0.16.1.2)
		sethiveparams ( hivecheckdelay, hivecheckthreads, hiveearlyout )

		Set hivemining optimisation parameters.

		Arguments:
		1. hivecheckdelay     (numeric, required, default=1) Time between Hive checks in ms. This should be left at default unless performance degradation is observed.
		2. hivecheckthreads   (numeric, required, default=-2) Number of threads to use when checking bees, -1 for all available cores, or -2 for one less than all available cores.
		3. hiveearlyout       (boolean, required, default=true) Abort Hive checking as quickly as possible when a new block comes in. This should be left enabled unless performance degradation is observed.

		Examples:
		> litecoincash-cli sethiveparams 500 -1 false
		> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "sethiveparams", "params": [2000 8 true] }' -H 'content-type: text/plain;' http://127.0.0.1:62457/
		

walletpassphrasehiveonly

		walletpassphrasehiveonly "passphrase"

		Stores the wallet decryption key in memory indefinitely for hive mining use only.
		This is needed to enable the hive mining thread to run. Performing other transactions related to
		private keys such as sending litecoincash, is not enabled and will require you to run
		walletpassphrase separately.

		Arguments:
		1. "passphrase"       (string, required) The wallet passphrase

		Examples:

		Unlock the wallet for hive mining only
		> litecoincash-cli walletpassphrasehiveonly "my pass phrase"

		As json rpc call
		> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "walletpassphrasehiveonly", "params": ["my pass phrase"] }' -H 'content-type: text/plain;' http://127.0.0.1:62457/
		


For more detailed information, please read our whitepaper: The Hive: Agent-Based Mining in Litecoin Cash