Difference between revisions of "RPC Commands"

From HoboNickels Wiki
Jump to: navigation, search
Line 37: Line 37:
 
| Safely copies wallet.dat to destination, which can be a directory or a path with filename.  
 
| Safely copies wallet.dat to destination, which can be a directory or a path with filename.  
 
|  
 
|  
|
 
 
|-
 
|-
 
|  
 
|  
Line 44: Line 43:
 
| Check wallet for integrity.  
 
| Check wallet for integrity.  
 
|  
 
|  
|
 
 
|-
 
|-
 
|  
 
|  
Line 53: Line 51:
 
redeemScript : hex-encoded redemption script  
 
redeemScript : hex-encoded redemption script  
 
|  
 
|  
|
 
 
|-
 
|-
 
|  
 
|  
Line 62: Line 59:
 
Note that the transaction's inputs are not signed, and it is not stored in the wallet or transmitted to the network.  
 
Note that the transaction's inputs are not signed, and it is not stored in the wallet or transmitted to the network.  
 
|  
 
|  
|
 
 
|-
 
|-
 
|  
 
|  
Line 69: Line 65:
 
| Return a JSON object representing the serialized, hex-encoded transaction.  
 
| Return a JSON object representing the serialized, hex-encoded transaction.  
 
|  
 
|  
|
 
 
|-
 
|-
 
|  
 
|  
Line 76: Line 71:
 
| Reveals the private key corresponding to <HoboNickelsaddress>.  
 
| Reveals the private key corresponding to <HoboNickelsaddress>.  
 
|  
 
|  
|
 
 
|-
 
|-
 
|  
 
|  
Line 83: Line 77:
 
| Encrypts your wallet so that coins can only be sent if you enter a password.  
 
| Encrypts your wallet so that coins can only be sent if you enter a password.  
 
|  
 
|  
|
 
 
|-
 
|-
 
|  
 
|  
Line 90: Line 83:
 
| Returns the account associated with the given address.  
 
| Returns the account associated with the given address.  
 
|  
 
|  
|
 
 
|-
 
|-
 
|  
 
|  
Line 97: Line 89:
 
| Returns the current HoboNickels address for receiving payments to this account.  
 
| Returns the current HoboNickels address for receiving payments to this account.  
 
|  
 
|  
|
 
 
|-
 
|-
 
|  
 
|  
Line 104: Line 95:
 
| 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.  
 
| 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.  
 
|  
 
|  
|
 
 
|-
 
|-
 
|  
 
|  
Line 111: Line 101:
 
| Returns the list of addresses for the given account.  
 
| Returns the list of addresses for the given account.  
 
|  
 
|  
|
 
 
|-
 
|-
 
|  
 
|  
Line 119: Line 108:
 
If [account] is specified, returns the balance in the account.  
 
If [account] is specified, returns the balance in the account.  
 
|  
 
|  
|
 
 
|-
 
|-
 
|  
 
|  
Line 126: Line 114:
 
| Returns the hash of the best block in the longest block chain.  
 
| Returns the hash of the best block in the longest block chain.  
 
|  
 
|  
|
 
 
|-
 
|-
 
|  
 
|  
Line 133: Line 120:
 
| txinfo optional to print more detailed tx info. Returns details of a block with given block-hash.  
 
| txinfo optional to print more detailed tx info. Returns details of a block with given block-hash.  
 
|  
 
|  
|
 
 
|-
 
|-
 
|  
 
|  
Line 140: Line 126:
 
| txinfo optional to print more detailed tx info. Returns details of a block with given block-number.  
 
| txinfo optional to print more detailed tx info. Returns details of a block with given block-number.  
 
|  
 
|  
|
 
 
|-
 
|-
 
|  
 
|  
Line 147: Line 132:
 
| Returns the block # that the client is synced to.
 
| Returns the block # that the client is synced to.
 
|  
 
|  
|
 
 
|-
 
|-
 
|
 
|
Line 153: Line 137:
 
| <index>  
 
| <index>  
 
| Returns hash of block in best-block-chain at <index>.  
 
| Returns hash of block in best-block-chain at <index>.  
|
 
 
|
 
|
 
|-
 
|-
Line 176: Line 159:
 
See [https://en.bitcoin.it/wiki/BIP_0022 for full specification].
 
See [https://en.bitcoin.it/wiki/BIP_0022 for full specification].
 
|  
 
|  
|
 
 
|-
 
|-
 
|  
 
|  
Line 183: Line 165:
 
| Returns the sync checkpoint, height (last block), and timestamp.  
 
| 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]
 +
| eturns 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]
 +
| f 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.
 +
|
 
|-
 
|-
| row 2, cell 1
 
| row 2, cell 2
 
| row 2, cell 3
 
| row 2 , cell 4
 
|
 
|
 
| row 2, cell 1
 
| row 2, cell 2
 
| row 2, cell 3
 
| row 2 , cell 4
 
|
 
|
 
| row 2, cell 1
 
| row 2, cell 2
 
| row 2, cell 3
 
| row 2 , cell 4
 
|
 
|
 
| row 2, cell 1
 
| row 2, cell 2
 
| row 2, cell 3
 
| row 2 , cell 4
 
|
 
|
 
| row 2, cell 1
 
| row 2, cell 2
 
| row 2, cell 3
 
| row 2 , cell 4
 
 
|
 
|
 +
==== 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.
 
|
 
|
| row 2, cell 1
+
|-
| row 2, cell 2
+
|  
| row 2, cell 3
+
==== importwallet ====
| row 2 , cell 4
+
| <filename>
|
+
| Imports keys from a wallet dump file (see dumpwallet).
|
+
|  
| row 2, cell 1
+
|-
| row 2, cell 2
+
|  
| row 2, cell 3
+
==== MORE ====
| row 2 , cell 4
+
| MORE
|
+
| MORE
|
+
|  
| row 2, cell 1
+
|-
| row 2, cell 2
+
| row 2, cell 3
+
| row 2 , cell 4
+
|
+
|| row 2, cell 1
+
| row 2, cell 2
+
| row 2, cell 3
+
| row 2 , cell 4
+
|
+
|
+
| row 2, cell 1
+
| row 2, cell 2
+
| row 2, cell 3
+
| row 2 , cell 4
+
|
+
|
+
| row 2, cell 1
+
| row 2, cell 2
+
| row 2, cell 3
+
| row 2 , cell 4
+
|
+
|
+
| row 2, cell 1
+
| row 2, cell 2
+
| row 2, cell 3
+
| row 2 , cell 4
+
|
+
|
+
| row 2, cell 1
+
| row 2, cell 2
+
| row 2, cell 3
+
| row 2 , cell 4
+
|
+
|
+
| row 2, cell 1
+
| row 2, cell 2
+
| row 2, cell 3
+
| row 2 , cell 4
+
|
+
|
+
| row 2, cell 1
+
| row 2, cell 2
+
| row 2, cell 3
+
| row 2 , cell 4
+
|
+
|
+
| row 2, cell 1
+
| row 2, cell 2
+
| row 2, cell 3
+
| row 2 , cell 4
+
|
+
|
+
| row 2, cell 1
+
| row 2, cell 2
+
| row 2, cell 3
+
| row 2 , cell 4
+
|
+
 
|}
 
|}

Revision as of 22:11, 7 December 2014

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] eturns 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] f 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).

MORE

MORE MORE