Search Knowledge Base ...

Need Support?

Can't find the answer you're looking for? Don't worry our awesome community is here to help!

CloakCoin API

CloakCoin provides a remote procedure call (RPC) interface for various administrative tasks, wallet operations, and queries about network and block chain data. If you start CloakCoin using cloakcoind, the RPC interface is enabled by default.

You can control cloakcoind by JSON-RPC commands.

The program gets is settings from CloakCoin.conf in the CloakCoin application directory:

$HOME/.bitcoin/

The interface requires the user to provide a password for authenticating RPC requests.

The password can be set in CloakCoin.conf, create the CloakCoin.conf configuration file and set an rpcuser and rpcpassword to secure the JSON-RPC API.

CloakCoin.conf example:

rpcuser=bitcoind

rpcpassword=change_this_to_a_long_random_password

By default the service is bound to port 29662 you can change it in CloakcCoin.conf with the:

rpcport=new_port_here

To start, run:

$./cloakcoind -daemon

If you are learning the API, it is a very good idea to use at first the test network.

cloakcoind -testnet

Full List

Required arguments are denoted inside < and > Optional arguments are inside [ and ].

Command Parameters Description
addmultisigaddress <nrequired> <'["key","key"]'> [account] Add a nrequired-to-sign multisignature address to the wallet. Each key is a bitcoin address or hex-encoded public key. If [account] is specified, assign address to [account]. Returns a string containing the address.
backupwallet <destination> Safely copies wallet.dat to destination, which can be a directory or a path with filename.
createrawtransaction [{"txid":txid,"vout":n},...] {address:amount,...} Creates a raw transaction spending given inputs.
decoderawtransaction <hex string> Produces a human-readable JSON object for a raw transaction.
dumpenigmap    
dumpprivkey <CloakCoinaddress> Reveals the private key corresponding to <CloakCoinaddress>
enableenigma <enable> [enigmareserve] [enableenigmaretry] [onionroute] [onionrouteall] [cloakshieldroutes] [cloakshieldnodes] [cloakshieldhops] Enables ENIGMA and CloakShield
getaccount <CloakCoinaddress> Returns the account associated with the given address.
getaccountaddress <account> Returns the current bitcoin address for receiving payments to this account. If <account> does not exist, it will be created along with an associated new address that will be returned.
getaddressesbyaccount <account> Returns the list of addresses for the given account.
getbalance [account] [minconf=1] If [account] is not specified, returns the server's total available balance.
If [account] is specified, returns the balance in the account.
getbigtx [minamount=NUM_CLOAK]  
getblock <hash> [txinfo] Returns information about the block with the given hash.
getblock <number> [txinfo] Returns the number of blocks in the longest block chain.
getblock <number> [txinfo] Returns the number of blocks in the longest block chain.
getblockcount Returns the number of blocks in the longest block chain.
getblockhash <index> Returns hash of block in best-block-chain at <index>; index 0 is the genesis block
getblocktemplate [params] Returns data needed to construct a block to work on. See BIP_0022 for more info on params.
getcheckpoint  
getcloakinginfo  
getconnectioncount Returns the number of connections to other nodes.
getdifficulty Returns the difficulty as a multiple of the minimum difficulty.
getgenerate Returns true or false whether bitcoind is currently generating hashes
gethashespersec Returns a recent hashes per second performance measurement while generating.
getinfo Returns an object containing various state info.
getmininginfo Returns an object containing mining-related information:
  • - blocks
  • - currentblocksize
  • - currentblocktx
  • - difficulty
  • - errors
  • - generate
  • - genproclimit
  • - hashespersec
  • - pooledtx
  • - testnet
getnewaddress [account] Returns a new CloakCoin address for receiving payments. If [account] is specified payments received with the address will be credited to [account].
getnewpubkey [account]  
getnewstealthaddress [label]  
getrawchangeaddress [account] Returns a new CloakCoin address, for receiving change. This is for use with raw transactions, NOT normal use.
getpeerinfo   Returns data about each connected network node.
getrawmempool Returns all transaction ids in memory pool
getrawtransaction <txid> [verbose=0] Returns raw transaction representation for given transaction id.
getreceivedbyaccount [account] [minconf=1] Returns the total amount received by addresses with [account] in transactions with at least [minconf] confirmations. If [account] not provided return will include all transactions to all accounts. (version 0.3.24)
getreceivedbyaddress <CloakCoinaddress> [minconf=1] Returns the amount received by <CloakCoinaddress> in transactions with at least [minconf] confirmations. It correctly handles the case where someone has sent to the address in multiple transactions. Keep in mind that addresses are only ever used for receiving transactions. Works only for addresses in the local wallet, external addresses will always show 0.
gettransaction <txid> Returns an object about the given transaction containing:
  • "amount" : total amount of the transaction
  • "confirmations" : number of confirmations of the transaction
  • "txid" : the transaction ID
  • "time" : time associated with the transaction.
  • "details" - An array of objects containing:
    • "account"
    • "address"
    • "category"
    • "amount"
    • "fee"
getwork [data] If [data] is not specified, returns formatted hash data to work on:
  • "midstate" : precomputed hash state after hashing the first half of the data
  • "data" : block data
  • "hash1" : formatted hash buffer for second hash
  • "target" : little endian hash target

If [data] is specified, tries to solve the block and returns true if it was successful.

getworkex [data, coinbase]

 

help [command] List commands, or get help for a command.
importprivkey <CloakCoinprivkey> [label] Adds a private key (as returned by dumpprivkey) to your wallet.
importstealthaddress <scan_secret> <spend_secret> [label]  
keypoolrefill Fills the keypool, requires wallet passphrase to be set.
listaccounts [minconf=1] Returns Object that has account names as keys, account balances as values.
listaddressgroupings Returns all addresses in the wallet and info used for coincontrol.
listcloakingactive  
listcloakinghistory  
listcloakingrequests  
listreceivedbyaccount [minconf=1] [includeempty=false] Returns an array of objects containing:
  • "account" : the account of the receiving addresses
  • "amount" : total amount received by addresses with this account
  • "confirmations" : number of confirmations of the most recent transaction included
listreceivedbyaddress [minconf=1] [includeempty=false] Returns an array of objects containing:
  • "address" : receiving address
  • "account" : the account of the receiving address
  • "amount" : total amount received by the address
  • "confirmations" : number of confirmations of the most recent transaction included

To get a list of accounts on the system, execute bitcoind listreceivedbyaddress 0 true

listsinceblock [blockhash] [target-confirmations] Get all transactions in blocks since block [blockhash], or all transactions if omitted. [target-confirmations] intentionally does not affect the list of returned transactions, but only affects the returned "lastblock" value.
liststealthaddresses [show_secrets=0]  
listtransactions [account] [count=10] [from=0] Returns up to [count] most recent transactions skipping the first [from] transactions for account [account]. If [account] not provided it'll return recent transactions from all accounts.
listunspent [minconf=1] [maxconf=999999] Returns array of unspent transaction inputs in the wallet.
listlockunspent Returns list of temporarily unspendable outputs
makekeypair [prefix] Updates list of temporarily unspendable outputs
move <fromaccount> <toaccount> <amount> [minconf=1] [comment] Move from one account in your wallet to another
repairwallet    
resendtx    
reservebalance [<reserve> [amount]]  
rpccommand <command>Run rpc command.  
scanforalltxns [fromHeight]  
scanforstealthtxns [fromHeight]  
sendalert <message> <privatekey> <minver> <maxver> <priority> <id> [cancelupto]  
sendcloakedtoaddress <CloakCoinaddress> <amount> [numCloakers] [timeoutMins] [comment] [comment-to]  
sendcloakmany <fromaccount> {address:amount,...} [minconf=1] [passphrase] [comment]  
sendenigma {stealthaddress:amount,...} [participants=5] [splits=1] [timeout=60] [passphrase]
sendfrom <fromaccount>[:enigma] <toCloakCoinaddress> <amount> [minconf=1] [comment] [comment-to] [narration]
 
sendfrom <fromaccount> <tobitcoinaddress> <amount> [minconf=1] [comment] <amount> is a real and is rounded to 6 decimal places. Will send the given amount to the given address, ensuring the account has a valid balance using [minconf] confirmations. Returns the transaction ID if successful (not in JSON object).
sendmany <fromaccount> {address:amount,...} [minconf=1] [comment] amounts are double-precision floating point numbers
sendrawtransaction <hexstring> Submits raw transaction (serialized, hex-encoded) to local node and network.
sendtoaddress <CloakCoinaddress> <amount> [comment] [comment-to] <amount> is a real and is rounded to 6 decimal places. Returns the transaction ID <txid> if successful.
sendtostealthaddress <stealth_address> <amount> [comment] [comment-to] [narration] Sets the account associated with the given address. Assigning address that is already assigned to the same account will create a new address associated with that account.
setaccount <CloakCoinaddress> <account> Sets the account associated with the given address. Assigning address that is already assigned to the same account will create a new address associated with that account.
setgenerate <generate> [genproclimit] <generate> is true or false to turn generation on or off.
Generation is limited to [genproclimit] processors, -1 is unlimited.
settxfee <amount> <amount> is a real and is rounded to the nearest 0.000001
signmessage <CloakCoinaddress> <message> Sign a message with the private key of an address.
gettransaction <txid> Adds signatures to a raw transaction and returns the resulting raw transaction.
signrawtransaction <hexstring> [{"txid":txid,"vout":n,"scriptPubKey":hex},...] [<privatekey1>,...] Adds signatures to a raw transaction and returns the resulting raw transaction.
stop <detach> Stop bitcoin server.
submitblock <hex data> [optional-params-obj] Attempts to submit new block to network.
validateaddress <CloakCoinaddress> Return information about <CloakCoinaddress>.
validateypubkey <CloakCoinpubkey> Verify a signed message.
verifymessage <CloakCoinaddress> <signature> <message> Verify a signed message.
walletlock Removes the wallet encryption key from memory, locking the wallet. After calling this method, you will need to call walletpassphrase again before being able to call any methods which require the wallet to be unlocked.
walletpassphrase <passphrase> <timeout> [mintonly] Stores the wallet decryption key in memory for <timeout> seconds.
walletpassphrasechange <oldpassphrase> <newpassphrase> Changes the wallet passphrase from <oldpassphrase> to <newpassphrase>.
Back

WAS THIS ARTICLE HELPFUL?

 2
 0