Many commands can be used for multiple units (Such as NuBits or NuShares). Some commands will force you to specify the unit code (B or S), but others will not. In the cases where you aren’t required to provide the code, commands will default to NuShares. If you would like to use other units it can be done a couple different ways.
--unit=<unit>
parameterFor applications use network ports
Network ports should always be used in cases of connecting your application with Nu (such as an exchange).
The --unit=<unit>
flag is provied as a command line convenience. For example to get a new NuBits address from the daemon you would run ./nud --unit=B getnewaddress
as ./nud getnewaddress
would return a NuShares address by default.
Example of pointing Peatio exchange to use NuBits from the daemon:
rpc: http://nuEx:123exch@127.0.0.1:14002
Production Network | Test Network |
---|---|
7890 | 7895 |
Unit | Production Network | Test Network |
---|---|---|
NuShares | 14001 | 15001 |
NuBits | 14002 | 15002 |
Peercoin ports used when communicating with the Peercoin wallet for dividend distributions
Production Network | Test Network |
---|---|
9902 | 9904 |
addmultisigaddress <nrequired> <'["key","key"]'> [account]
Adds a nRequired-to-sign multi-signature address to the wallet.
backupwallet <destination>
Safely copies wallet.dat to destination, which can be a directory or a path with filename.
burn <amount> <unit> [comment]
<amount> is a real and is rounded to the nearest 0.0001 <unit> is the unit to burn (‘B’ for NuBits, ‘S’ for NuShares). requires portfolio passphrase to be set with walletpassphrase
first.
checkwallet
Check portfolio for integrity.
createmultisig nrequired ["key",...]
createrawtransaction [{"txid":txid,"vout":n},...] {address:amount,...}
Create a transaction spending given inputs.
decoderawtransaction <hex string>
Return a JSON object representing the serialized, hex-encoded transaction.
distribute <cutoff timestamp> <amount> [<proceed>]
<cutoff timestamp> is the date and time at which the share balances should be considered formatted in unix epoch time.
dumpprivkey <address>
Reveals the private key corresponding to <address>.
encryptwallet <passphrase>
Encrypts the portfolio with <passphrase>
exportpeercoinkeys
Add the Peercoin keys associated with the NuShares addresses to the Peercoin wallet. Peercoin must be running and accept RPC commands.
getaccount <address>
Returns the account associated with the given address.
getaccountaddress <account>
Returns the current Nu address for receiving payments to this account.
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.
getblock <hash> [txinfo]
txinfo optional to print more detailed tx info
getblockcount
Returns the number of blocks in the longest block chain.
getblockhash <index>
Returns hash of block in best-block-chain at <index>.
getblocktemplate [params]
Returns data needed to construct a block to work on:
getcheckpoint
Show info of synchronized checkpoint.
getconnectioncount
Returns the number of connections to other nodes.
getcustodianvotes [<block height>] [<block quantity>]
Returns an object containing the custodian vote results.
getdatafeed Return the current data feed.
getdifficulty
Returns difficulty as a multiple of the minimum difficulty.
getelectedcustodians
Returns an object containing the elected custodians.
getgenerate
Returns true
or false
.
gethashespersec
Returns a recent hashes per second performance measurement while generating.
getinfo
Returns an object containing various state info.
getliquiditydetails <currency>
Return the breakdown detail of liquidityinfo Currency is the single letter of the currency (currently only ‘B’ for “NuBits”).
getliquidityinfo <currency>
Currency is the single letter of the currency (currently only ‘B’ for “NuBits”).
getmininginfo
Returns an object containing mining-related information.
getmotions [<block height>] [<block quantity>]
Returns an object containing the motion vote results.
getnetworkghps
Returns a recent giga-hash per second (GH/s) network mining estimate.
getnewaddress [account]
Returns a new Nu address for receiving payments. If [account] is specified (recommended), it is added to the address book so payments received with the address will be credited to [account].
getparkrates [<height>] [<currency>]
Returns an object containing the park rates in the block at height <height> (default: the last block).
getparkvotes [<block height>] [<block quantity>]
Returns an object containing a summary of the park rate votes.
getpeercoinaddresses <account>
Returns the list of addresses and the associated Peercoin address for the given account.
getpeerinfo
Returns data about each connected network node.
getpremium <amount> <duration>
<amount> is a real and is rounded to the nearest 0.0001 <duration> is the number of blocks during which the amount would be parked.
getrawmempool
Returns all transaction ids in memory pool.
getrawtransaction <txid> [verbose=0]
If verbose=0
, returns serialized, hex-encoded data for transaction txid. If verbose
is non-zero, returns a JSON Object containing information about the transaction. Returns an error if <txid> is unknown.
getreceivedbyaccount <account> [minconf=1]
Returns the total amount received by addresses with <account> in transactions with at least [minconf] confirmations.
getreceivedbyaddress <address> [minconf=1]
Returns the total amount received by <address> in transactions with at least [minconf] confirmations.
gettransaction <txid>
Get detailed information about <txid>.
gettxout "txid" n ( includemempool )
getvote
Returns the vote that will be inserted in the next proof of stake block.
getwork [data]
If [data] is not specified, returns formatted hash data to work on:
help [command]
List commands, or get help for a command.
importprivkey <privkey> [label]
Adds a private key (as returned by dumpprivkey) to your wallet.
keypoolrefill
Fills the keypool, requires portfolio passphrase to be set.
liquidityinfo <currency> <buyamount> <sellamount> <grantaddress> <identifier>
Broadcast liquidity information. The identifier is used to aggregate liquidity and must be submitted in the format :
tier:pair:exchange:botsessionid
Example of a valid identifier : 2:BTCNBT:ccedk:nubotsession3
listaccounts [minconf=1]
Returns Object that has account names as keys, account balances as values.
listparked [account]
Returns the list of parked coins.
listreceivedbyaccount [minconf=1] [includeempty=false]
[minconf] is the minimum number of confirmations before payments are included.
listreceivedbyaddress [minconf=1] [includeempty=false]
[minconf] is the minimum number of confirmations before payments are included.
listsinceblock [blockhash] [target-confirmations]
Get all transactions in blocks since block [blockhash], or all transactions if omitted
listtransactions [account] [count=10] [from=0]
Returns up to [count] most recent transactions skipping the first [from] transactions for account [account].
listunspent [minconf=1] [maxconf=9999999] ["address",...]
Returns array of unspent transaction outputs
makekeypair [prefix]
Make a public/private key pair.
move <fromaccount> <toaccount> <amount> [minconf=1] [comment]
Move from one account in your portfolio to another.
park <amount> <duration> [account=""] [unparkaddress] [minconf=1]
<amount> is a real and is rounded to the nearest 0.000001
repairwallet
Repair portfolio if checkwallet
reports any problem.
reservebalance [<reserve> [amount]]
<reserve> is true or false to turn balance reserve on or off.
sendalert <message> <privatekey> <minver> <maxver> <priority> <id> [cancelupto]
<message> is the alert text message
sendfrom <fromaccount> <toaddress> <amount> [minconf=1] [comment] [comment-to]
<amount> is a real and is rounded to the nearest 0.000001
sendmany <fromaccount> {address:amount,...} [minconf=1] [comment]
<amount(s)> are double-precision floating point numbers
sendrawtransaction <hex string> [checkinputs=0]
Submits raw transaction (serialized, hex-encoded) to local node and network.
sendtoaddress <address> <amount> [comment] [comment-to]
<amount> is a real and is rounded to the nearest 0.000001
setaccount <address> <account>
Sets the account associated with the given address.
setdatafeed <url> [<signature url> <address>] [<parts>]
Change the vote data feed. Set <url> to an empty string to disable. If <signature url> and <address> are specified and not empty strings a signature will also be retrieved at <signature url> and verified. Parts is the list of the top level vote parts that will be taken from the feed, separated by a coma. The other parts will not affect the vote. Default is “custodians,parkrates,motions”.
setgenerate <generate> [genproclimit]
<generate> is true
or false
to turn generation on or off.
setmotionvote <motion hash>
<motionhash> is the hash of the motion to vote for.
setvote <vote>
<vote> is the complete vote in JSON. Example:
signmessage <address> <message>
Sign a message with the private key of an address
Sign inputs for raw transaction (serialized, hex-encoded).
stop
Stop Nu server.
submitblock <hex data> [optional-params-obj]
[optional-params-obj] parameter is currently ignored.
unpark
Unpark all transaction that have reached duration
validateaddress <address>
Return information about <address>.
verifymessage <address> <signature> <message>
Verify a signed message
walletlock
Removes the portfolio encryption key from memory, locking the portfolio.
walletpassphrase <passphrase> <timeout> [mintonly]
Stores the portfolio decryption key in memory for <timeout> seconds.
walletpassphrasechange <oldpassphrase> <newpassphrase>
Changes the portfolio passphrase from <oldpassphrase> to <newpassphrase>.