RPC Commands

From HoboNickels Wiki
Jump to: navigation, search

How To Use RPC Commands

Wallet GUI

Open up the debug window, simply type the RPC command.

Linux

Navigate to the proper directory and type "./hobonickelsd" followed by the command.

List of RPC Commands

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

Usage is Command Parameters.

Command Parameters Description Example

addmultisigaddress

<nrequired> <'["key","key"]'> [account] Add a nrequired-to-sign multisignature address to the wallet. Each key is a HoboNickels address or hex-encoded public key. If [account] is specified, assign address to [account].

addnode

remove|onetry> Attempts add or remove <node> from the addnode list or try a connection to <node> once.

backupwallet

<destination> Safely copies wallet.dat to destination, which can be a directory or a path with filename.

checkwallet

Check wallet for integrity.

createmultisig

<nrequired> <'["key","key"]'> Creates a multi-signature address and returns a json object with keys:

address : hobonickels address redeemScript : hex-encoded redemption script

createrawtransaction

[{"txid":txid,"vout":n},...] {address:amount,...} Create a transaction spending given inputs (array of objects containing transaction id and output number), sending to given address(es).

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.

decoderawtransaction

<hex string> Return a JSON object representing the serialized, hex-encoded transaction.

dumpprivkey

<HoboNickelsaddress> Reveals the private key corresponding to <HoboNickelsaddress>.

encryptwallet

<passphrase> Encrypts your wallet so that coins can only be sent if you enter a password.

getaccount

<HoboNickelsaddress> Returns the account associated with the given address.

getaccountaddress

<account> Returns the current HoboNickels address for receiving payments to this account.

getaddednodeinfo

<dns> [node] Returns information about the given added node, or all added nodes (note that onetry addnodes are not listed here). If dns is false, only a list of added nodes will be provided, otherwise connected information will also be available.

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.

getbestblockhash

Returns the hash of the best block in the longest block chain.

getblock

<hash> [txinfo] txinfo optional to print more detailed tx info. Returns details of a block with given block-hash.

getblockbynumber

<number> [txinfo] txinfo optional to print more detailed tx info. Returns details of a block with given block-number.

getblockcount

Returns the block # that the client is synced to.

getblockhash

<index> Returns hash of block in best-block-chain at <index>.

getblocktemplate

[params] Returns data needed to construct a block to work on:

"version" : block version "previousblockhash" : hash of current highest block "transactions" : contents of non-coinbase transactions that should be included in the next block "coinbaseaux" : data that should be included in coinbase "coinbasevalue" : maximum allowable input to coinbase transaction, including the generation award and transaction fees "target" : hash target "mintime" : minimum timestamp appropriate for next block "curtime" : current timestamp "mutable" : list of ways the block template may be changed "noncerange" : range of valid nonces "sigoplimit" : limit of sigops in blocks "sizelimit" : limit of block size "bits" : compressed target of next block "height" : height of the next block See for full specification.

getcheckpoint

Returns the sync checkpoint, height (last block), and timestamp.

getconnectioncount

Returns the amount of peers that the wallet client is connected to.

getdifficulty

Returns the Proof of Work difficulty and the Proof of Stake difficulty.

getgenerate

Returns true or false.

gethashespersec

Returns a recent hashes per second performance measurement while generating. setgenerate needs to be true.

getinfo

[extended] Returns several informative variables such as software version, blocks, total money supply, connections, wallets, ip address, PoW difficulty, and more.

The [extend] parameters is available from version 1.4. Setting it to true will give extended information

getmininginfo

returns mining information such as Proof of Work difficulty, network stake weight, and a few other variables.

getnewaddress

[account] Adds a new HoboNickels address to your default wallet, labelled [account].

getnewpubkey

Returns information about peers the wallet client is connected to. IP address, connection time, and more.

getrawmempool

Returns all transaction ids in memory pool.

getrawtransaction

<txid> [verbose=0] if verbose=0, returns a string that is serialized, hex-encoded data for <txid>.

If verbose is non-zero, returns an Object with information about <txid>.

getreceivedbyaccount

<account> [minconf=1] Returns the total amount received by addresses with <account> in transactions with at least [minconf] confirmations.

getreceivedbyaddress

<HoboNickelsaddress> [minconf=1] Returns the total amount received by <HoboNickelsaddress> in transactions with at least [minconf] confirmations.

gettransaction

<txid> Returns the details about a given transaction ID. Returns confirmations, addresses, and more.

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 (DEPRECATED) "data" : block data "hash1" : formatted hash buffer for second hash (DEPRECATED) "target" : little endian hash target If [data] is specified, tries to solve the block and returns true if it was successful.

getworkex

[data, coinbase] If [data, coinbase] is not specified, returns extended work data.

help

[command] Lists available RPC commands. Or more information about a [command]

importprivkey

<HoboNickelsprivkey> [label] Adds a private key (as returned by dumpprivkey) to your wallet.

importwallet

<filename> Imports keys from a wallet dump file (see dumpwallet).

listaccounts

[minconf=1] Returns Object that has account names as keys, account balances as values.

listaddressgroupings

Lists groups of addresses which have had their common ownership made public by common use as inputs or as the resulting change in past transactions.

listlockunspent

[minconf=1] [maxconf=9999999] ["address",...] Returns list of temporarily unspendable outputs.

listreceivedbyaccount

[minconf=1] [includeempty=false] [minconf] is the minimum number of confirmations before payments are included.

[includeempty] whether to include accounts that haven't received any payments. 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] minconf] is the minimum number of confirmations before payments are included.

[includeempty] whether to include addresses that haven't received any payments. 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

listsinceblock

[blockhash] [target-confirmations] Get all transactions in blocks since block [blockhash], or all transactions if omitted

listunspent

[minconf=1] [maxconf=9999999] ["address",...] Returns array of unspent transaction outputs with between minconf and maxconf (inclusive) confirmations. Optionally filtered to only include txouts paid to specified addresses.

Results are an array of Objects, each of which has: {txid, vout, scriptPubKey, amount, confirmations}

listwallets

Lists all running wallets and tells the wallet balance, encryption, version, newly minted coins, and the stake.

loadwallet

<walletname> [rescan=false] [upgradewallet=false] [maxversion=(latest)] Loads a wallet(or creates new) from the HoboNickels directory in %appdata%. loadwallet test (this will load wallet file wallet-test.dat)

makekeypair

[prefix] Make a public/private key pair.

[prefix] is optional preferred prefix for the public key.

move

<fromaccount> <toaccount> <amount> [minconf=1] [comment]

repairwallet

Checks wallet against the transaction index, fixes spent states if necessary, and removes orphans.

resendtx

Resends a transaction in memory pool but not yet in the blockchain

reservebalance

[<reserve> [amount]] Creates a reserve balance that will not stake.

sendalert

<message> <privatekey> <minver> <maxver> <priority> <id> [cancelupto] Sends an alert to clients

sendfrom

<fromaccount> <toHoboNickelsaddress> <amount> [minconf=1] [comment] [comment-to] Sends HoboNickels from one account to another

sendmany

<fromaccount> {address:amount,...} [minconf=1] [comment] Sends HoboNickels from one account to many others

sendrawtransaction

<hex string>

sendtoaddress

<HoboNickelsaddress> <amount> [comment] [comment-to] Sends specified amount of HBN from default wallet to the HBN address entered.

setaccount

<HoboNickelsaddress> <account> Names a HoboNickels address into an account

setgenerate

<generate> [genproclimit] Turn on CPU Proof of Work mining

settxfee

<amount> Sets the min tx fee you are willing to pay. If set to low a transaction may not get into the block chain.

signmessage

<HoboNickelsaddress> <message> Creates a hash that can be used to prove ownership of an address

signrawtransaction

<hex string> [{"txid":txid,"vout":n,"scriptPubKey":hex},...] [<privatekey1>,...] [sighashtype="ALL"] Sign inputs for raw transaction (serialized, hex-encoded).

Second optional argument (may be null) is an array of previous transaction outputs that this transaction depends on but may not yet be in the blockchain. Third optional argument (may be null) is an array of base58-encoded private keys that, if given, will be the only keys used to sign the transaction. Fourth optional argument is a string that is one of six values; ALL, NONE, SINGLE or ALL|ANYONECANPAY, NONE|ANYONECANPAY, SINGLE|ANYONECANPAY. Returns json object with keys: hex : raw transaction with signature(s) (hex-encoded string) complete : 1 if transaction has a complete set of signature (0 if not)

stop

<detach> Stops and shutdown the client

submitblock

<hex data> [optional-params-obj]

unloadwallet

<walletname> Unload's specified wallet from memory unloadwallet test (removes wallet-test.dat from the client)

usewallet

<walletname> <method> [params] Allows a non default wallet to be used with a RPC command usewallet test getbalance (shows the balance of wallet-test.dat)

validateaddress

<HoboNickelsaddress> Checks whether an HBN address is valid or not.

validatepubkey

<HoboNickelspubkey> Checks whether HBN public key is valid or not.

verifymessage

<HoboNickelsaddress> <signature> <message> Used to prove another address is owned by someone

walletlock

locks the wallet and prevents PoS from going

walletpassphrase

<passphrase> <timeout> [mintonly] Unlocks the wallet for a specific time. Mintonly will block sending commands.

walletpassphrasechange

<oldpassphrase> <newpassphrase> Changes the wallet's password