Returns the balance for an address(es) (requires addressindex to be enabled).
{
"addresses"
[
"address" (string) The base58check encoded address
,...
]
}
{
"balance" (string) The current balance in atoms
"received" (string) The total number of atoms received (including change)
}
> energi-cli getaddressbalance '{"addresses": ["XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg"]}'
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaddressbalance", "params": [{"addresses": ["XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg"]}] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Returns all changes for an address (requires addressindex to be enabled).
{
"addresses"
[
"address" (string) The base58check encoded address
,...
]
"start" (number) The start block height
"end" (number) The end block height
}
[
{
"satoshis" (number) The difference of atoms
"txid" (string) The related txid
"index" (number) The related input or output index
"blockindex" (number) The related block index
"height" (number) The block height
"address" (string) The base58check encoded address
}
]
> energi-cli getaddressdeltas '{"addresses": ["XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg"]}'
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaddressdeltas", "params": [{"addresses": ["XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg"]}] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Returns all mempool deltas for an address (requires addressindex to be enabled).
{
"addresses"
[
"address" (string) The base58check encoded address
,...
]
}
[
{
"address" (string) The base58check encoded address
"txid" (string) The related txid
"index" (number) The related input or output index
"satoshis" (number) The difference of atoms
"timestamp" (number) The time the transaction entered the mempool (seconds)
"prevtxid" (string) The previous txid (if spending)
"prevout" (string) The previous transaction output index (if spending)
}
]
> energi-cli getaddressmempool '{"addresses": ["XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg"]}'
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaddressmempool", "params": [{"addresses": ["XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg"]}] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Returns the txids for an address(es) (requires addressindex to be enabled).
{
"addresses"
[
"address" (string) The base58check encoded address
,...
]
"start" (number) The start block height
"end" (number) The end block height
}
[
"transactionid" (string) The transaction id
,...
]
> energi-cli getaddresstxids '{"addresses": ["XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg"]}'
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaddresstxids", "params": [{"addresses": ["XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg"]}] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Returns all unspent outputs for an address (requires addressindex to be enabled).
{
"addresses"
[
"address" (string) The base58check encoded address
,...
]
}
[
{
"address" (string) The address base58check encoded
"txid" (string) The output txid
"outputIndex" (number) The output index
"script" (string) The script hex encoded
"satoshis" (number) The number of atoms of the output
"height" (number) The block height
}
]
> energi-cli getaddressutxos '{"addresses": ["XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg"]}'
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaddressutxos", "params": [{"addresses": ["XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg"]}] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Returns the hash of the best (tip) block in the longest block chain.
"hex" (string) the block hash hex encoded
> energi-cli getbestblockhash
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getbestblockhash", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
If verbose is false, returns a string that is serialized, hex-encoded data for block 'hash'. If verbose is true, returns an Object with information about block .
1. "hash" (string, required) The block hash
2. verbose (boolean, optional, default=true) true for a json object, false for the hex encoded data
{
"hash" : "hash", (string) the block hash (same as provided)
"confirmations" : n, (numeric) The number of confirmations, or -1 if the block is not on the main chain
"size" : n, (numeric) The block size
"height" : n, (numeric) The block height or index
"version" : n, (numeric) The block version
"merkleroot" : "xxxx", (string) The merkle root
"tx" : [ (array of string) The transaction ids
"transactionid" (string) The transaction id
,...
],
"time" : ttt, (numeric) The block time in seconds since epoch (Jan 1 1970 GMT)
"mediantime" : ttt, (numeric) The median block time in seconds since epoch (Jan 1 1970 GMT)
"nonce" : n, (numeric) The nonce
"bits" : "1d00ffff", (string) The bits
"difficulty" : x.xxx, (numeric) The difficulty
"chainwork" : "xxxx", (string) Expected number of hashes required to produce the chain up to this block (in hex)
"hashmix " : "hash", (string) The hashmix of the block
"previousblockhash" : "hash", (string) The hash of the previous block
"nextblockhash" : "hash" (string) The hash of the next block
}
"data" (string) A string that is serialized, hex-encoded data for block 'hash'.
> energi-cli getblock "00000000000fd08c2fb661d2fcb0d49abb3a91e5f27082ce64feed3b4dede2e2"
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblock", "params": ["00000000000fd08c2fb661d2fcb0d49abb3a91e5f27082ce64feed3b4dede2e2"] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Returns an object containing various state info regarding block chain processing.
{
"chain": "xxxx", (string) current network name as defined in BIP70 (main, test, regtest)
"blocks": xxxxxx, (numeric) the current number of blocks processed in the server
"headers": xxxxxx, (numeric) the current number of headers we have validated
"bestblockhash": "...", (string) the hash of the currently best block
"difficulty": xxxxxx, (numeric) the current difficulty
"mediantime": xxxxxx, (numeric) median time for the current best block
"verificationprogress": xxxx, (numeric) estimate of verification progress [0..1]
"chainwork": "xxxx" (string) total amount of work in active chain, in hexadecimal
"pruned": xx, (boolean) if the blocks are subject to pruning
"pruneheight": xxxxxx, (numeric) heighest block available
"softforks": [ (array) status of softforks in progress
{
"id": "xxxx", (string) name of softfork
"version": xx, (numeric) block version
"enforce": { (object) progress toward enforcing the softfork rules for new-version blocks
"status": xx, (boolean) true if threshold reached
"found": xx, (numeric) number of blocks with the new version found
"required": xx, (numeric) number of blocks required to trigger
"window": xx, (numeric) maximum size of examined window of recent blocks
},
"reject": { ... } (object) progress toward rejecting pre-softfork blocks (same fields as "enforce")
}, ...
],
"bip9_softforks": [ (array) status of BIP9 softforks in progress
{
"id": "xxxx", (string) name of the softfork
"status": "xxxx", (string) one of "defined", "started", "lockedin", "active", "failed"
}
]
}
> energi-cli getblockchaininfo
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblockchaininfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Returns the number of blocks in the longest block chain.
n (numeric) The current block count
> energi-cli getblockcount
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblockcount", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Returns hash of block in best-block-chain at index provided.
1. index (numeric, required) The block index
"hash" (string) The block hash
> energi-cli getblockhash 1000
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblockhash", "params": [1000] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Returns array of hashes of blocks within the timestamp range provided.
1. high (numeric, required) The newer block timestamp
2. low (numeric, required) The older block timestamp
[
"hash" (string) The block hash
]
> energi-cli getblockhashes 1231614698 1231024505
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblockhashes", "params": [1231614698, 1231024505] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
If verbose is false, returns a string that is serialized, hex-encoded data for blockheader 'hash'. If verbose is true, returns an Object with information about blockheader .
1. "hash" (string, required) The block hash
2. verbose (boolean, optional, default=true) true for a json object, false for the hex encoded data
{
"hash" : "hash", (string) the block hash (same as provided)
"confirmations" : n, (numeric) The number of confirmations, or -1 if the block is not on the main chain
"height" : n, (numeric) The block height or index
"version" : n, (numeric) The block version
"merkleroot" : "xxxx", (string) The merkle root
"time" : ttt, (numeric) The block time in seconds since epoch (Jan 1 1970 GMT)
"mediantime" : ttt, (numeric) The median block time in seconds since epoch (Jan 1 1970 GMT)
"nonce" : n, (numeric) The nonce
"bits" : "1d00ffff", (string) The bits
"difficulty" : x.xxx, (numeric) The difficulty
"hashmix " : "hash", (string) The hashmix of the block
"previousblockhash" : "hash", (string) The hash of the previous block
"nextblockhash" : "hash", (string) The hash of the next block
"chainwork" : "0000...1f3" (string) Expected number of hashes required to produce the current chain (in hex)
}
"data" (string) A string that is serialized, hex-encoded data for block 'hash'.
> energi-cli getblockheader "00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09"
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblockheader", "params": ["00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09"] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Returns an array of items with information about blockheaders starting from .
If verbose is false, each item is a string that is serialized, hex-encoded data for a single blockheader. If verbose is true, each item is an Object with information about a single blockheader.
1. "hash" (string, required) The block hash
2. count (numeric, optional, default/max=2000)
3. verbose (boolean, optional, default=true) true for a json object, false for the hex encoded data
[ {
"hash" : "hash", (string) The block hash
"confirmations" : n, (numeric) The number of confirmations, or -1 if the block is not on the main chain
"height" : n, (numeric) The block height or index
"version" : n, (numeric) The block version
"merkleroot" : "xxxx", (string) The merkle root
"time" : ttt, (numeric) The block time in seconds since epoch (Jan 1 1970 GMT)
"mediantime" : ttt, (numeric) The median block time in seconds since epoch (Jan 1 1970 GMT)
"nonce" : n, (numeric) The nonce
"bits" : "1d00ffff", (string) The bits
"difficulty" : x.xxx, (numeric) The difficulty
"hashmix " : "hash", (string) The hashmix of the block
"previousblockhash" : "hash", (string) The hash of the previous block
"nextblockhash" : "hash", (string) The hash of the next block
"chainwork" : "0000...1f3" (string) Expected number of hashes required to produce the current chain (in hex)
}, {
...
},
...
]
[
"data", (string) A string that is serialized, hex-encoded data for block header.
...
]
> energi-cli getblockheaders "00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09" 2000
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblockheaders", "params": ["00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09" 2000] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Return information about all known tips in the block tree, including the main chain as well as orphaned branches.
1. count (numeric, optional) only show this much of latest tips
2. branchlen (numeric, optional) only show tips that have equal or greater length of branch
[
{
"height": xxxx, (numeric) height of the chain tip
"hash": "xxxx", (string) block hash of the tip
"difficulty" : x.xxx, (numeric) The difficulty
"chainwork" : "0000...1f3" (string) Expected number of hashes required to produce the current chain (in hex)
"branchlen": 0 (numeric) zero for main chain
"status": "active" (string) "active" for the main chain
},
{
"height": xxxx,
"hash": "xxxx",
"difficulty" : x.xxx,
"chainwork" : "0000...1f3"
"branchlen": 1 (numeric) length of branch connecting the tip to the main chain
"status": "xxxx" (string) status of the chain (active, valid-fork, valid-headers, headers-only, invalid)
}
]
Possible values for status:
- "invalid" This branch contains at least one invalid block
- "headers-only" Not all blocks for this branch are available, but the headers are valid
- "valid-headers" All blocks are available for this branch, but they were never fully validated
- "valid-fork" This branch is not part of the active chain, but is fully validated
- "active" This is the tip of the active main chain, which is certainly valid
> energi-cli getchaintips
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getchaintips", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Returns the proof-of-work difficulty as a multiple of the minimum difficulty.
n.nnn (numeric) the proof-of-work difficulty as a multiple of the minimum difficulty.
> energi-cli getdifficulty
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getdifficulty", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Returns details on the active state of the TX memory pool.
{
"size": xxxxx, (numeric) Current tx count
"bytes": xxxxx, (numeric) Sum of all tx sizes
"usage": xxxxx, (numeric) Total memory usage for the mempool
"maxmempool": xxxxx, (numeric) Maximum memory usage for the mempool
"mempoolminfee": xxxxx (numeric) Minimum fee for tx to be accepted
}
> energi-cli getmempoolinfo
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getmempoolinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Returns all transaction ids in memory pool as a json array of string transaction ids.
1. verbose (boolean, optional, default=false) true for a json object, false for array of transaction ids
[ (json array of string)
"transactionid" (string) The transaction id
,...
]
{ (json object)
"transactionid" : { (json object)
"size" : n, (numeric) transaction size in bytes
"fee" : n, (numeric) transaction fee in NRG
"modifiedfee" : n, (numeric) transaction fee with fee deltas used for mining priority
"time" : n, (numeric) local time transaction entered pool in seconds since 1 Jan 1970 GMT
"height" : n, (numeric) block height when transaction entered pool
"startingpriority" : n, (numeric) priority when transaction entered pool
"currentpriority" : n, (numeric) transaction priority now
"descendantcount" : n, (numeric) number of in-mempool descendant transactions (including this one)
"descendantsize" : n, (numeric) size of in-mempool descendants (including this one)
"descendantfees" : n, (numeric) modified fees (see above) of in-mempool descendants (including this one)
"depends" : [ (array) unconfirmed transactions used as inputs for this transaction
"transactionid", (string) parent transaction id
... ]
}, ...
}
> energi-cli getrawmempool true
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getrawmempool", "params": [true] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Returns the txid and index where an output is spent.
{
"txid" (string) The hex string of the txid
"index" (number) The start block height
}
{
"txid" (string) The transaction id
"index" (number) The spending input index
,...
}
> energi-cli getspentinfo '{"txid": "0437cd7f8525ceed2324359c2d0ba26006d92d856a9c20fa0241106ee5a597c9", "index": 0}'
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getspentinfo", "params": [{"txid": "0437cd7f8525ceed2324359c2d0ba26006d92d856a9c20fa0241106ee5a597c9", "index": 0}] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Returns details about an unspent transaction output.
1. "txid" (string, required) The transaction id
2. n (numeric, required) vout value
3. includemempool (boolean, optional) Whether to included the mem pool
{
"bestblock" : "hash", (string) the block hash
"confirmations" : n, (numeric) The number of confirmations
"value" : x.xxx, (numeric) The transaction value in NRG
"scriptPubKey" : { (json object)
"asm" : "code", (string)
"hex" : "hex", (string)
"reqSigs" : n, (numeric) Number of required signatures
"type" : "pubkeyhash", (string) The type, eg pubkeyhash
"addresses" : [ (array of string) array of energi addresses
"energiaddress" (string) energi address
,...
]
},
"version" : n, (numeric) The version
"coinbase" : true|false (boolean) Coinbase or not
}
Get unspent transactions
> energi-cli listunspent
View the details
> energi-cli gettxout "txid" 1
As a json rpc call
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "gettxout", "params": ["txid", 1] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Returns a hex-encoded proof that "txid" was included in a block.
NOTE: By default this function only works sometimes. This is when there is an unspent output in the utxo for this transaction. To make it always work, you need to maintain a transaction index, using the -txindex command line option or specify the block in which the transaction is included in manually (by blockhash).
Return the raw transaction data.
1. "txids" (string) A json array of txids to filter
[
"txid" (string) A transaction hash
,...
]
2. "block hash" (string, optional) If specified, looks for txid in the block with this hash
"data" (string) A string that is a serialized, hex-encoded data for the proof.
> energi-cli gettxoutproof '["mytxid",...]'
> energi-cli gettxoutproof '["mytxid",...]' "blockhash"
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "gettxoutproof", "params": [["mytxid",...], "blockhash"] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Returns statistics about the unspent transaction output set. Note this call may take some time.
{
"height":n, (numeric) The current block height (index)
"bestblock": "hex", (string) the best block hash hex
"transactions": n, (numeric) The number of transactions
"txouts": n, (numeric) The number of output transactions
"bytes_serialized": n, (numeric) The serialized size
"hash_serialized": "hash", (string) The serialized hash
"total_amount": x.xxx (numeric) The total amount
}
> energi-cli gettxoutsetinfo
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "gettxoutsetinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Verifies blockchain database.
1. checklevel (numeric, optional, 0-4, default=3) How thorough the block verification is.
2. numblocks (numeric, optional, default=288, 0=all) The number of blocks to check.
true|false (boolean) Verified or not
> energi-cli verifychain
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "verifychain", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Verifies that a proof points to a transaction in a block, returning the transaction it commits to and throwing an RPC error if the block is not in our best chain
1. "proof" (string, required) The hex-encoded proof generated by gettxoutproof
["txid"] (array, strings) The txid(s) which the proof commits to, or empty array if the proof is invalid
> energi-cli verifytxoutproof "proof"
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "gettxoutproof", "params": ["proof"] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
debug ( 0|1|addrman|alert|bench|coindb|db|reindex|estimatefee|lock|rand|rpc|selectcoins|mempool|mempoolrej|net|proxy|prune|http|libevent|tor|zmq|energi|nrghash|privatesend|instantsend|masternode|spork|keepass|mnpayments|mnsync|gobject )
Change debug category on the fly. Specify single category or use comma to specify many.
> energi-cli debug energi
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "debug", "params": [energi,net] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Returns an object containing various state info.
{
"version": xxxxx, (numeric) the server version
"protocolversion": xxxxx, (numeric) the protocol version
"walletversion": xxxxx, (numeric) the wallet version
"balance": xxxxxxx, (numeric) the total energi balance of the wallet
"privatesend_balance": xxxxxx, (numeric) the anonymized energi balance of the wallet
"blocks": xxxxxx, (numeric) the current number of blocks processed in the server
"timeoffset": xxxxx, (numeric) the time offset
"connections": xxxxx, (numeric) the number of connections
"proxy": "host:port", (string, optional) the proxy used by the server
"difficulty": xxxxxx, (numeric) the current difficulty
"testnet": true|false, (boolean) if the server is using testnet or not
"keypoololdest": xxxxxx, (numeric) the timestamp (seconds since GMT epoch) of the oldest pre-generated key in the key pool
"keypoolsize": xxxx, (numeric) how many new keys are pre-generated
"unlocked_until": ttt, (numeric) the timestamp in seconds since epoch (midnight Jan 1 1970 GMT) that the wallet is unlocked for transfers, or 0 if the wallet is locked
"paytxfee": x.xxxx, (numeric) the transaction fee set in NRG/kB
"relayfee": x.xxxx, (numeric) minimum relay fee for non-free transactions in NRG/kB
"errors": "..." (string) any error messages
}
> energi-cli getinfo
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
List all commands, or get help for a specified command.
1. "command" (string, optional) The command to get help on
"text" (string) The help text
Stop Energi Core server.
Returns a JSON list specifying loaded DAG
"epoch" Returns a JSON object specifying DAG cache information for the specified epoch n or the current epoch if n is not specified Arguments "epoch" the epoch number
"epoch" Returns a JSON object specifying DAG information for the specified epoch n or the current epoch if n is not specified Arguments "epoch" the epoch number
"epoch" Returns the size of the DAG chache in bytes for the specified epoch n or the current epoch if n is not specified Arguments "epoch" the epoch number
"epoch" Returns the size of the DAG in bytes for the specified epoch n or the current epoch if n is not specified Arguments "epoch" the epoch number
Returns current epoch number
"epoch" Returns the hex encoded seedhash for specified epoch n or current epoch if n is not specified Arguments "epoch" the epoch number
Returns an object containing governance parameters.
{
"governanceminquorum": xxxxx, (numeric) the absolute minimum number of votes needed to trigger a governance action
"masternodewatchdogmaxseconds": xxxxx, (numeric) sentinel watchdog expiration time in seconds
"proposalfee": xxx.xx, (numeric) the collateral transaction fee which must be paid to create a proposal in NRG
"superblockcycle": xxxxx, (numeric) the number of blocks between superblocks
"lastsuperblock": xxxxx, (numeric) the block number of the last superblock
"nextsuperblock": xxxxx, (numeric) the block number of the next superblock
}
> energi-cli getgovernanceinfo
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getgovernanceinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Returns an object containing mixing pool related information.
Returns the absolute maximum sum of superblock payments allowed.
1. index (numeric, required) The block index
n (numeric) The absolute maximum sum of superblock payments allowed, in NRG
> energi-cli getsuperblockbudget 1000
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getsuperblockbudget", "params": [1000] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Manage governance objects
Available commands: check - Validate governance object data (proposal only) prepare - Prepare governance object by signing and creating tx submit - Submit governance object to network deserialize - Deserialize governance object from hex string to JSON count - Count governance objects and votes get - Get governance object by hash getvotes - Get all votes for a governance object hash (including old votes) getcurrentvotes - Get only current (tallying) votes for a governance object hash (does not include old votes) list - List governance objects (can be filtered by signal and/or object type) diff - List differences since last diff vote-alias - Vote on a governance object by masternode alias (using masternode.conf setup) vote-conf - Vote on a governance object by masternode configured in energi.conf vote-many - Vote on a governance object by all masternodes (using masternode.conf setup)
Set of commands to execute masternode related actions
1. "command" (string or set of strings, required) The command to execute
Available commands:
count - Print number of all known masternodes (optional: 'ps', 'enabled', 'all', 'qualify')
current - Print info on current masternode winner to be paid the next block (calculated locally)
debug - Print masternode status
genkey - Generate new masternodeprivkey
outputs - Print masternode compatible outputs
start - Start local Hot masternode configured in energi.conf
start-alias - Start single remote masternode by assigned alias configured in masternode.conf
start-<mode> - Start remote masternodes configured in masternode.conf (<mode>: 'all', 'missing', 'disabled')
status - Print masternode status information
list - Print list of all known masternodes (see masternodelist for more info)
list-conf - Print masternode.conf in JSON format
winner - Print info on next masternode winner to vote for
winners - Print list of masternode winners
Set of commands to create and relay masternode broadcast messages
1. "command" (string or set of strings, required) The command to execute
Available commands:
create-alias - Create single remote masternode broadcast message by assigned alias configured in masternode.conf
create-all - Create remote masternode broadcast messages for all masternodes configured in masternode.conf
decode - Decode masternode broadcast message
relay - Relay masternode broadcast message to the network
Get a list of masternodes in different modes
1. "mode" (string, optional/required to use filter, defaults = status) The mode to run list in
2. "filter" (string, optional) Filter results. Partial match by outpoint by default in all modes,
additional matches in some modes are also available
Available modes:
activeseconds - Print number of seconds masternode recognized by the network as enabled
(since latest issued "masternode start/start-many/start-alias")
addr - Print ip address associated with a masternode (can be additionally filtered, partial match)
full - Print info in format 'status protocol payee lastseen activeseconds lastpaidtime lastpaidblock IP'
(can be additionally filtered, partial match)
info - Print info in format 'status protocol payee lastseen activeseconds sentinelversion sentinelstate IP'
(can be additionally filtered, partial match)
lastpaidblock - Print the last block height a node was paid on the network
lastpaidtime - Print the last time a node was paid on the network
lastseen - Print timestamp of when a masternode was last seen on the network
payee - Print Energi address associated with a masternode (can be additionally filtered,
partial match)
protocol - Print protocol of a masternode (can be additionally filtered, exact match))
pubkey - Print the masternode (not collateral) public key
rank - Print rank of a masternode based on current block
status - Print masternode status: PRE_ENABLED / ENABLED / EXPIRED / WATCHDOG_EXPIRED / NEW_START_REQUIRED /
UPDATE_REQUIRED / POSE_BAN / OUTPOINT_SPENT (can be additionally filtered, partial match)
Returns the sync status, updates to the next step or resets it entirely.
1. "command" (string or set of strings, required) The command to execute
Available commands:
start - Start mixing
stop - Stop mixing
reset - Reset mixing
Sentinel ping.
state (boolean) Ping result
> energi-cli sentinelping 1.0.2
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "sentinelping", "params": [1.0.2] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
is the corresponding spork name, or 'show' to show all current spork settings, active to show which sporks are active is a epoch datetime to enable or disable spork
Compile and relay a governance vote with provided external signature instead of signing vote internally
Mine blocks immediately (before the RPC call returns)
Note: this function can only be used on the regtest network
1. numblocks (numeric, required) How many blocks are generated immediately.
[ blockhashes ] (array) hashes of blocks generated
Generate 11 blocks
> energi-cli generate 11
Return if the server is set to generate coins or not. The default is false. It is set with the command line argument -gen (or energi.conf setting gen) It can also be set with the setgenerate call.
true|false (boolean) If the server is set to generate coins or not
> energi-cli getgenerate
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getgenerate", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Set 'generate' true or false to turn generation on or off. Generation is limited to 'genproclimit' processors, -1 is unlimited. See the getgenerate call for the current setting.
1. generate (boolean, required) Set to true to turn on generation, false to turn off.
2. genproclimit (numeric, optional) Set the processor limit for when generation is on. Can be -1 for unlimited.
Set the generation on with a limit of one processor
> energi-cli setgenerate true 1
Check the setting
> energi-cli getgenerate
Turn off generation
> energi-cli setgenerate false
Using json rpc
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "setgenerate", "params": [true, 1] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
If the request parameters include a 'mode' key, that is used to explicitly select between the default 'template' request or a 'proposal'. It returns data needed to construct a block to work on. For full specification, see BIPs 22 and 9: https://github.com/bitcoin/bips/blob/master/bip-0022.mediawiki https://github.com/bitcoin/bips/blob/master/bip-0009.mediawiki#getblocktemplate_changes
1. "jsonrequestobject" (string, optional) A json object in the following spec
{
"mode":"template" (string, optional) This must be set to "template" or omitted
"capabilities":[ (array, optional) A list of strings
"support" (string) client side supported feature, 'longpoll', 'coinbasetxn', 'coinbasevalue', 'proposal', 'serverlist', 'workid'
,...
]
}
{
"version" : n, (numeric) The block version
"rules" : [ "rulename", ... ], (array of strings) specific block rules that are to be enforced
"vbavailable" : { (json object) set of pending, supported versionbit (BIP 9) softfork deployments
"rulename" : bitnumber (numeric) identifies the bit number as indicating acceptance and readiness for the named softfork rule
,...
},
"vbrequired" : n, (numeric) bit mask of versionbits the server requires set in submissions
"previousblockhash" : "xxxx", (string) The hash of current highest block
"transactions" : [ (array) contents of non-coinbase transactions that should be included in the next block
{
"data" : "xxxx", (string) transaction data encoded in hexadecimal (byte-for-byte)
"hash" : "xxxx", (string) hash/id encoded in little-endian hexadecimal
"depends" : [ (array) array of numbers
n (numeric) transactions before this one (by 1-based index in 'transactions' list) that must be present in the final block if this one is
,...
],
"fee": n, (numeric) difference in value between transaction inputs and outputs (in atoms); for coinbase transactions, this is a negative Number of the total collected block fees (ie, not including the block subsidy); if key is not present, fee is unknown and clients MUST NOT assume there isn't one
"sigops" : n, (numeric) total number of SigOps, as counted for purposes of block limits; if key is not present, sigop count is unknown and clients MUST NOT assume there aren't any
"required" : true|false (boolean) if provided and true, this transaction must be in the final block
}
,...
],
"coinbaseaux" : { (json object) data that should be included in the coinbase's scriptSig content
"flags" : "flags" (string)
},
"coinbasevalue" : n, (numeric) maximum allowable input to coinbase transaction, including the generation award and transaction fees (in atoms)
"coinbasetxn" : { ... }, (json object) information for coinbase transaction
"target" : "xxxx", (string) The hash target
"mintime" : xxx, (numeric) The minimum timestamp appropriate for next block time in seconds since epoch (Jan 1 1970 GMT)
"mutable" : [ (array of string) list of ways the block template may be changed
"value" (string) A way the block template may be changed, e.g. 'time', 'transactions', 'prevblock'
,...
],
"noncerange" : "00000000ffffffff", (string) A range of valid nonces
"sigoplimit" : n, (numeric) limit of sigops in blocks
"sizelimit" : n, (numeric) limit of block size
"curtime" : ttt, (numeric) current timestamp in seconds since epoch (Jan 1 1970 GMT)
"bits" : "xxx", (string) compressed target of next block
"height" : n (numeric) The height of the next block
"backbone" : { (json object) required Energi Backbone payee that must be included in the next block
"payee" : "xxxx", (string) payee address
"script" : "xxxx", (string) payee scriptPubKey
"amount": n (numeric) required amount to pay
},
"masternode" : { (json object) required masternode payee that must be included in the next block
"payee" : "xxxx", (string) payee address
"script" : "xxxx", (string) payee scriptPubKey
"amount": n (numeric) required amount to pay
},
"masternode_payments_started" : true|false, (boolean) true, if masternode payments started
"masternode_payments_enforced" : true|false, (boolean) true, if masternode payments are enforced
"superblock" : [ (array) required superblock payees that must be included in the next block
{
"payee" : "xxxx", (string) payee address
"script" : "xxxx", (string) payee scriptPubKey
"amount": n (numeric) required amount to pay
}
,...
],
"superblocks_started" : true|false, (boolean) true, if superblock payments started
"superblocks_enabled" : true|false (boolean) true, if superblock payments are enabled
}
> energi-cli getblocktemplate
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblocktemplate", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Returns a json object containing mining-related information.
{
"blocks": nnn, (numeric) The current block
"currentblocksize": nnn, (numeric) The last block size
"currentblocktx": nnn, (numeric) The last block transaction
"difficulty": xxx.xxxxx (numeric) The current difficulty
"errors": "..." (string) Current errors
"generate": true|false (boolean) If the generation is on or off (see getgenerate or setgenerate calls)
"genproclimit": n (numeric) The processor limit for generation. -1 if no generation. (see getgenerate or setgenerate calls)
"pooledtx": n (numeric) The size of the mem pool
"testnet": true|false (boolean) If using testnet or not
"chain": "xxxx", (string) current network name as defined in BIP70 (main, test, regtest)
}
> energi-cli getmininginfo
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getmininginfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Returns the estimated network hashes per second based on the last n blocks. Pass in [blocks] to override ## of blocks, -1 specifies since last difficulty change. Pass in [height] to estimate the network speed at the time when a certain block was found.
1. blocks (numeric, optional, default=120) The number of blocks, or -1 for blocks since last difficulty change.
2. height (numeric, optional, default=-1) To estimate at the time of the given height.
x (numeric) Hashes per second estimated
> energi-cli getnetworkhashps
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getnetworkhashps", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Accepts the transaction into mined blocks at a higher (or lower) priority
1. "txid" (string, required) The transaction id.
2. priority delta (numeric, required) The priority to add or subtract.
The transaction selection algorithm considers the tx as it would have a higher priority.
(priority of a transaction is calculated: coinage * value_in_atoms / txsize)
3. fee delta (numeric, required) The fee value (in atoms) to add (or subtract, if negative).
The fee is not actually paid, only the algorithm for selecting transactions into a block
considers the transaction as it would have paid a higher (or lower) fee.
Result
true (boolean) Returns true
> energi-cli prioritisetransaction "txid" 0.0 10000
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "prioritisetransaction", "params": ["txid", 0.0, 10000] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Attempts to submit new block to network. The 'jsonparametersobject' parameter is currently ignored. See https://en.bitcoin.it/wiki/BIP_0022 for full specification.
1. "hexdata" (string, required) the hex-encoded block data to submit
2. "jsonparametersobject" (string, optional) object of optional parameters
{
"workid" : "id" (string, optional) if the server provided a workid, it MUST be included with submissions
}
> energi-cli submitblock "mydata"
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "submitblock", "params": ["mydata"] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Attempts add or remove a node from the addnode list. Or try a connection to a node once.
1. "node" (string, required) The node (see getpeerinfo for nodes)
2. "command" (string, required) 'add' to add a node to the list, 'remove' to remove a node from the list, 'onetry' to try a connection to the node once
> energi-cli addnode "192.168.0.6:9797" "onetry"
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "addnode", "params": ["192.168.0.6:9797", "onetry"] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Clear all banned IPs.
> energi-cli clearbanned
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "clearbanned", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Immediately disconnects from the specified node.
1. "node" (string, required) The node (see getpeerinfo for nodes)
> energi-cli disconnectnode "192.168.0.6:8333"
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "disconnectnode", "params": ["192.168.0.6:8333"] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Returns information about the given added node, or all added nodes (note that onetry addnodes are not listed here)
1. dummy (boolean, required) Kept for historical purposes but ignored
2. "node" (string, optional) If provided, return information about this specific node, otherwise all nodes are returned.
[
{
"addednode" : "192.168.0.201", (string) The node ip address or name (as provided to addnode)
"connected" : true|false, (boolean) If connected
"addresses" : [ (list of objects) Only when connected = true
{
"address" : "192.168.0.201:9797", (string) The Energi server IP and port we're connected to
"connected" : "outbound" (string) connection, inbound or outbound
}
]
}
,...
]
> energi-cli getaddednodeinfo true
> energi-cli getaddednodeinfo true "192.168.0.201"
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaddednodeinfo", "params": [true, "192.168.0.201"] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Returns the number of connections to other nodes.
n (numeric) The connection count
> energi-cli getconnectioncount
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getconnectioncount", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Returns information about network traffic, including bytes in, bytes out, and current time.
{
"totalbytesrecv": n, (numeric) Total bytes received
"totalbytessent": n, (numeric) Total bytes sent
"timemillis": t, (numeric) Total cpu time
"uploadtarget":
{
"timeframe": n, (numeric) Length of the measuring timeframe in seconds
"target": n, (numeric) Target in bytes
"target_reached": true|false, (boolean) True if target is reached
"serve_historical_blocks": true|false, (boolean) True if serving historical blocks
"bytes_left_in_cycle": t, (numeric) Bytes left in current time cycle
"time_left_in_cycle": t (numeric) Seconds left in current time cycle
}
}
> energi-cli getnettotals
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getnettotals", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Returns an object containing various state info regarding P2P networking.
{
"version": xxxxx, (numeric) the server version
"subversion": "/Energi Core:x.x.x/", (string) the server subversion string
"protocolversion": xxxxx, (numeric) the protocol version
"localservices": "xxxxxxxxxxxxxxxx", (string) the services we offer to the network
"localrelay": true|false, (bool) true if transaction relay is requested from peers
"timeoffset": xxxxx, (numeric) the time offset
"connections": xxxxx, (numeric) the number of connections
"networkactive": true|false, (bool) whether p2p networking is enabled
"networks": [ (array) information per network
{
"name": "xxx", (string) network (ipv4, ipv6 or onion)
"limited": true|false, (boolean) is the network limited using -onlynet?
"reachable": true|false, (boolean) is the network reachable?
"proxy": "host:port" (string) the proxy that is used for this network, or empty if none
}
,...
],
"relayfee": x.xxxxxxxx, (numeric) minimum relay fee for non-free transactions in NRG/kB
"localaddresses": [ (array) list of local addresses
{
"address": "xxxx", (string) network address
"port": xxx, (numeric) network port
"score": xxx (numeric) relative score
}
,...
]
"warnings": "..." (string) any network warnings (such as alert messages)
}
> energi-cli getnetworkinfo
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getnetworkinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Returns data about each connected network node as a json array of objects.
[
{
"id": n, (numeric) Peer index
"addr":"host:port", (string) The ip address and port of the peer
"addrlocal":"ip:port", (string) local address
"services":"xxxxxxxxxxxxxxxx", (string) The services offered
"relaytxes":true|false, (boolean) Whether peer has asked us to relay transactions to it
"lastsend": ttt, (numeric) The time in seconds since epoch (Jan 1 1970 GMT) of the last send
"lastrecv": ttt, (numeric) The time in seconds since epoch (Jan 1 1970 GMT) of the last receive
"bytessent": n, (numeric) The total bytes sent
"bytesrecv": n, (numeric) The total bytes received
"conntime": ttt, (numeric) The connection time in seconds since epoch (Jan 1 1970 GMT)
"timeoffset": ttt, (numeric) The time offset in seconds
"pingtime": n, (numeric) ping time (if available)
"minping": n, (numeric) minimum observed ping time (if any at all)
"pingwait": n, (numeric) ping wait (if non-zero)
"version": v, (numeric) The peer version, such as 7001
"subver": "/Energi Core:x.x.x/", (string) The string version
"inbound": true|false, (boolean) Inbound (true) or Outbound (false)
"startingheight": n, (numeric) The starting height (block) of the peer
"banscore": n, (numeric) The ban score
"synced_headers": n, (numeric) The last header we have in common with this peer
"synced_blocks": n, (numeric) The last block we have in common with this peer
"inflight": [
n, (numeric) The heights of blocks we're currently asking from this peer
...
]
"bytessent_per_msg": {
"addr": n, (numeric) The total bytes sent aggregated by message type
...
}
"bytesrecv_per_msg": {
"addr": n, (numeric) The total bytes received aggregated by message type
...
}
}
,...
]
> energi-cli getpeerinfo
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getpeerinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
List all banned IPs/Subnets.
> energi-cli listbanned
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "listbanned", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Requests that a ping be sent to all other nodes, to measure ping time. Results provided in getpeerinfo, pingtime and pingwait fields are decimal seconds. Ping command is handled in queue with all other commands, so it measures processing backlog, not just network ping.
> energi-cli ping
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "ping", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Attempts add or remove a IP/Subnet from the banned list.
1. "ip(/netmask)" (string, required) The IP/Subnet (see getpeerinfo for nodes ip) with a optional netmask (default is /32 = single ip)
2. "command" (string, required) 'add' to add a IP/Subnet to the list, 'remove' to remove a IP/Subnet from the list
3. "bantime" (numeric, optional) time in seconds how long (or until when if [absolute] is set) the ip is banned (0 or empty means using the default time of 24h which can also be overwritten by the -bantime startup argument)
4. "absolute" (boolean, optional) If set, the bantime must be a absolute timestamp in seconds since epoch (Jan 1 1970 GMT)
> energi-cli setban "192.168.0.6" "add" 86400
> energi-cli setban "192.168.0.0/24" "add"
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "setban", "params": ["192.168.0.6", "add" 86400] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Disable/enable all p2p network activity.
Create a transaction spending the given inputs and creating new outputs. Outputs can be addresses or data. 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.
1. "transactions" (string, required) A json array of json objects
[
{
"txid":"id", (string, required) The transaction id
"vout":n (numeric, required) The output number
}
,...
]
2. "outputs" (string, required) a json object with outputs
{
"address": x.xxx (numeric or string, required) The key is the energi address, the numeric value (can be string) is the NRG amount
"data": "hex", (string, required) The key is "data", the value is hex encoded data
...
}
3. locktime (numeric, optional, default=0) Raw locktime. Non-0 value also locktime-activates inputs
"transaction" (string) hex string of the transaction
Examples
> energi-cli createrawtransaction "[{\"txid\":\"myid\",\"vout\":0}]" "{\"address\":0.01}"
> energi-cli createrawtransaction "[{\"txid\":\"myid\",\"vout\":0}]" "{\"data\":\"00010203\"}"
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "createrawtransaction", "params": ["[{\"txid\":\"myid\",\"vout\":0}]", "{\"address\":0.01}"] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "createrawtransaction", "params": ["[{\"txid\":\"myid\",\"vout\":0}]", "{\"data\":\"00010203\"}"] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Return a JSON object representing the serialized, hex-encoded transaction.
1. "hex" (string, required) The transaction hex string
{
"txid" : "id", (string) The transaction id
"size" : n, (numeric) The transaction size
"version" : n, (numeric) The version
"locktime" : ttt, (numeric) The lock time
"vin" : [ (array of json objects)
{
"txid": "id", (string) The transaction id
"vout": n, (numeric) The output number
"scriptSig": { (json object) The script
"asm": "asm", (string) asm
"hex": "hex" (string) hex
},
"sequence": n (numeric) The script sequence number
}
,...
],
"vout" : [ (array of json objects)
{
"value" : x.xxx, (numeric) The value in NRG
"n" : n, (numeric) index
"scriptPubKey" : { (json object)
"asm" : "asm", (string) the asm
"hex" : "hex", (string) the hex
"reqSigs" : n, (numeric) The required sigs
"type" : "pubkeyhash", (string) The type, eg 'pubkeyhash'
"addresses" : [ (json array of string)
"XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg" (string) Energi address
,...
]
}
}
,...
],
}
> energi-cli decoderawtransaction "hexstring"
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "decoderawtransaction", "params": ["hexstring"] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Decode a hex-encoded script.
1. "hex" (string) the hex encoded script
{
"asm":"asm", (string) Script public key
"hex":"hex", (string) hex encoded public key
"type":"type", (string) The output type
"reqSigs": n, (numeric) The required signatures
"addresses": [ (json array of string)
"address" (string) energi address
,...
],
"p2sh","address" (string) address of P2SH script wrapping this redeem script (not returned if the script is already a P2SH).
}
> energi-cli decodescript "hexstring"
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "decodescript", "params": ["hexstring"] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Add inputs to a transaction until it has enough in value to meet its out value. This will not modify existing inputs, and will add one change output to the outputs. Note that inputs which were signed may need to be resigned after completion since in/outputs have been added. The inputs added will not be signed, use signrawtransaction for that. Note that all existing inputs must have their previous output transaction be in the wallet. Note that all inputs selected must be of standard form and P2SH scripts must bein the wallet using importaddress or addmultisigaddress (to calculate fees). You can see whether this is the case by checking the "solvable" field in the listunspent output. Only pay-to-pubkey, multisig, and P2SH versions thereof are currently supported for watch-only
1. "hexstring" (string, required) The hex string of the raw transaction
2. includeWatching (boolean, optional, default false) Also select inputs which are watch only
{
"hex": "value", (string) The resulting raw transaction (hex-encoded string)
"fee": n, (numeric) Fee the resulting transaction pays
"changepos": n (numeric) The position of the added change output, or -1
}
"hex"
Create a transaction with no inputs
> energi-cli createrawtransaction "[]" "{\"myaddress\":0.01}"
Add sufficient unsigned inputs to meet the output value
> energi-cli fundrawtransaction "rawtransactionhex"
Sign the transaction
> energi-cli signrawtransaction "fundedtransactionhex"
Send the transaction
> energi-cli sendrawtransaction "signedtransactionhex"
NOTE: By default this function only works sometimes. This is when the tx is in the mempool or there is an unspent output in the utxo for this transaction. To make it always work, you need to maintain a transaction index, using the -txindex command line option.
Return the raw transaction data.
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'.
1. "txid" (string, required) The transaction id
2. verbose (numeric, optional, default=0) If 0, return a string, other return a json object
Result (if verbose is not set or set to 0):
"data" (string) The serialized, hex-encoded data for 'txid'
Result (if verbose > 0):
{
"hex" : "data", (string) The serialized, hex-encoded data for 'txid'
"txid" : "id", (string) The transaction id (same as provided)
"size" : n, (numeric) The transaction size
"version" : n, (numeric) The version
"locktime" : ttt, (numeric) The lock time
"vin" : [ (array of json objects)
{
"txid": "id", (string) The transaction id
"vout": n, (numeric)
"scriptSig": { (json object) The script
"asm": "asm", (string) asm
"hex": "hex" (string) hex
},
"sequence": n (numeric) The script sequence number
}
,...
],
"vout" : [ (array of json objects)
{
"value" : x.xxx, (numeric) The value in NRG
"n" : n, (numeric) index
"scriptPubKey" : { (json object)
"asm" : "asm", (string) the asm
"hex" : "hex", (string) the hex
"reqSigs" : n, (numeric) The required sigs
"type" : "pubkeyhash", (string) The type, eg 'pubkeyhash'
"addresses" : [ (json array of string)
"energiaddress" (string) energi address
,...
]
}
}
,...
],
"blockhash" : "hash", (string) the block hash
"confirmations" : n, (numeric) The confirmations
"time" : ttt, (numeric) The transaction time in seconds since epoch (Jan 1 1970 GMT)
"blocktime" : ttt (numeric) The block time in seconds since epoch (Jan 1 1970 GMT)
}
> energi-cli getrawtransaction "mytxid"
> energi-cli getrawtransaction "mytxid" 1
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getrawtransaction", "params": ["mytxid", 1] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Submits raw transaction (serialized, hex-encoded) to local node and network.
Also see createrawtransaction and signrawtransaction calls.
1. "hexstring" (string, required) The hex string of the raw transaction)
2. allowhighfees (boolean, optional, default=false) Allow high fees
3. instantsend (boolean, optional, default=false) Use InstantSend to send this transaction
"hex" (string) The transaction hash in hex
Create a transaction
> energi-cli createrawtransaction "[{\"txid\" : \"mytxid\",\"vout\":0}]" "{\"myaddress\":0.01}"
Sign the transaction, and get back the hex
> energi-cli signrawtransaction "myhex"
Send the transaction (signed hex)
> energi-cli sendrawtransaction "signedhex"
As a json rpc call
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "sendrawtransaction", "params": ["signedhex"] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
signrawtransaction "hexstring" ( [{"txid":"id","vout":n,"scriptPubKey":"hex","redeemScript":"hex"},...] ["privatekey1",...] sighashtype )
Sign inputs for raw transaction (serialized, hex-encoded). The 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 block chain. The 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.
1. "hexstring" (string, required) The transaction hex string
2. "prevtxs" (string, optional) An json array of previous dependent transaction outputs
[ (json array of json objects, or 'null' if none provided)
{
"txid":"id", (string, required) The transaction id
"vout":n, (numeric, required) The output number
"scriptPubKey": "hex", (string, required) script key
"redeemScript": "hex" (string, required for P2SH) redeem script
}
,...
]
3. "privatekeys" (string, optional) A json array of base58-encoded private keys for signing
[ (json array of strings, or 'null' if none provided)
"privatekey" (string) private key in base58-encoding
,...
]
4. "sighashtype" (string, optional, default=ALL) The signature hash type. Must be one of
"ALL"
"NONE"
"SINGLE"
"ALL|ANYONECANPAY"
"NONE|ANYONECANPAY"
"SINGLE|ANYONECANPAY"
{
"hex" : "value", (string) The hex-encoded raw transaction with signature(s)
"complete" : true|false, (boolean) If the transaction has a complete set of signatures
"errors" : [ (json array of objects) Script verification errors (if there are any)
{
"txid" : "hash", (string) The hash of the referenced, previous transaction
"vout" : n, (numeric) The index of the output to spent and used as input
"scriptSig" : "hex", (string) The hex-encoded signature script
"sequence" : n, (numeric) Script sequence number
"error" : "text" (string) Verification or signing error related to the input
}
,...
]
}
> energi-cli signrawtransaction "myhex"
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "signrawtransaction", "params": ["myhex"] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Creates a multi-signature address with n signature of m keys required. It returns a json object with the address and redeemScript.
1. nrequired (numeric, required) The number of required signatures out of the n keys or addresses.
2. "keys" (string, required) A json array of keys which are energi addresses or hex-encoded public keys
[
"key" (string) energi address or hex-encoded public key
,...
]
{
"address":"multisigaddress", (string) The value of the new multisig address.
"redeemScript":"script" (string) The string value of the hex-encoded redemption script.
}
Create a multisig address from 2 addresses
> energi-cli createmultisig 2 "[\"Xt4qk9uKvQYAonVGSZNXqxeDmtjaEWgfrs\",\"XoSoWQkpgLpppPoyyzbUFh1fq2RBvW6UK1\"]"
As a json rpc call
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "createmultisig", "params": [2, "[\"Xt4qk9uKvQYAonVGSZNXqxeDmtjaEWgfrs\",\"XoSoWQkpgLpppPoyyzbUFh1fq2RBvW6UK1\"]"] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Estimates the approximate fee per kilobyte needed for a transaction to begin confirmation within nblocks blocks.
1. nblocks (numeric)
n (numeric) estimated fee-per-kilobyte
A negative value is returned if not enough transactions and blocks
have been observed to make an estimate.
> energi-cli estimatefee 6
Estimates the approximate priority a zero-fee transaction needs to begin confirmation within nblocks blocks.
1. nblocks (numeric)
n (numeric) estimated priority
A negative value is returned if not enough transactions and blocks
have been observed to make an estimate.
> energi-cli estimatepriority 6
WARNING: This interface is unstable and may disappear or change!
Estimates the approximate fee per kilobyte needed for a transaction to begin confirmation within nblocks blocks if possible and return the number of blocks for which the estimate is valid.
1. nblocks (numeric)
{
"feerate" : x.x, (numeric) estimate fee-per-kilobyte (in BTC)
"blocks" : n (numeric) block number where estimate was found
}
A negative value is returned if not enough transactions and blocks have been observed to make an estimate for any number of blocks. However it will not return a value below the mempool reject fee.
> energi-cli estimatesmartfee 6
WARNING: This interface is unstable and may disappear or change!
Estimates the approximate priority a zero-fee transaction needs to begin confirmation within nblocks blocks if possible and return the number of blocks for which the estimate is valid.
1. nblocks (numeric)
{
"priority" : x.x, (numeric) estimated priority
"blocks" : n (numeric) block number where estimate was found
}
A negative value is returned if not enough transactions and blocks have been observed to make an estimate for any number of blocks. However if the mempool reject fee is set it will return 1e9 * MAX_MONEY.
> energi-cli estimatesmartpriority 6
Return information about the given energi address.
1. "energiaddress" (string, required) The energi address to validate
{
"isvalid" : true|false, (boolean) If the address is valid or not. If not, this is the only property returned.
"address" : "energiaddress", (string) The energi address validated
"scriptPubKey" : "hex", (string) The hex encoded scriptPubKey generated by the address
"ismine" : true|false, (boolean) If the address is yours or not
"iswatchonly" : true|false, (boolean) If the address is watchonly
"isscript" : true|false, (boolean) If the key is a script
"pubkey" : "publickeyhex", (string) The hex value of the raw public key
"iscompressed" : true|false, (boolean) If the address is compressed
"account" : "account" (string) DEPRECATED. The account associated with the address, "" is the default account
"hdkeypath" : "keypath" (string, optional) The HD keypath if the key is HD and available
"hdchainid" : "<hash>" (string, optional) The ID of the HD chain
}
> energi-cli validateaddress "XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg"
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "validateaddress", "params": ["XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg"] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Verify a signed message
1. "energiaddress" (string, required) The energi address to use for the signature.
2. "signature" (string, required) The signature provided by the signer in base 64 encoding (see signmessage).
3. "message" (string, required) The message that was signed.
true|false (boolean) If the signature is verified or not.
Unlock the wallet for 30 seconds
> energi-cli walletpassphrase "mypassphrase" 30
Create the signature
> energi-cli signmessage "XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg" "my message"
Verify the signature
> energi-cli verifymessage "XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg" "signature" "my message"
As json rpc
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "verifymessage", "params": ["XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg", "signature", "my message"] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Mark in-wallet transaction as abandoned This will mark this transaction and all its in-wallet descendants as abandoned which will allow for their inputs to be respent. It can be used to replace "stuck" or evicted transactions. It only works on transactions which are not included in a block and are not currently in the mempool. It has no effect on transactions which are already conflicted or abandoned.
1. "txid" (string, required) The transaction id
> energi-cli abandontransaction "1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d"
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "abandontransaction", "params": ["1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d"] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Add a nrequired-to-sign multisignature address to the wallet. Each key is an Energi address or hex-encoded public key. If 'account' is specified (DEPRECATED), assign address to that account.
1. nrequired (numeric, required) The number of required signatures out of the n keys or addresses.
2. "keysobject" (string, required) A json array of energi addresses or hex-encoded public keys
[
"address" (string) energi address or hex-encoded public key
...,
]
3. "account" (string, optional) DEPRECATED. An account to assign the addresses to.
"energiaddress" (string) A energi address associated with the keys.
Add a multisig address from 2 addresses
> energi-cli addmultisigaddress 2 "[\"Xt4qk9uKvQYAonVGSZNXqxeDmtjaEWgfrs\",\"XoSoWQkpgLpppPoyyzbUFh1fq2RBvW6UK1\"]"
As json rpc call
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "addmultisigaddress", "params": [2, "[\"Xt4qk9uKvQYAonVGSZNXqxeDmtjaEWgfrs\",\"XoSoWQkpgLpppPoyyzbUFh1fq2RBvW6UK1\"]"] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Safely copies wallet.dat to destination, which can be a directory or a path with filename.
1. "destination" (string) The destination directory or file
> energi-cli backupwallet "backup.dat"
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "backupwallet", "params": ["backup.dat"] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Returns an object containing sensitive private info about this HD wallet.
{
"hdseed": "seed", (string) The HD seed (bip32, in hex)
"mnemonic": "words", (string) The mnemonic for this HD wallet (bip39, english words)
"mnemonicpassphrase": "passphrase", (string) The mnemonic passphrase for this HD wallet (bip39)
}
> energi-cli dumphdinfo
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "dumphdinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Reveals the private key corresponding to 'energiaddress'. Then the importprivkey can be used with this output
1. "energiaddress" (string, required) The energi address for the private key
"key" (string) The private key
> energi-cli dumpprivkey "myaddress"
> energi-cli importprivkey "mykey"
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "dumpprivkey", "params": ["myaddress"] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Dumps all wallet keys in a human-readable format.
1. "filename" (string, required) The filename
> energi-cli dumpwallet "test"
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "dumpwallet", "params": ["test"] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Encrypts the wallet with 'passphrase'. This is for first time encryption. After this, any calls that interact with private keys such as sending or signing will require the passphrase to be set prior the making these calls. Use the walletpassphrase call for this, and then walletlock call. If the wallet is already encrypted, use the walletpassphrasechange call. Note that this will shutdown the server.
1. "passphrase" (string) The pass phrase to encrypt the wallet with. It must be at least 1 character, but should be long.
Encrypt you wallet
> energi-cli encryptwallet "my pass phrase"
Now set the passphrase to use the wallet, such as for signing or sending energi
> energi-cli walletpassphrase "my pass phrase"
Now we can so something like sign
> energi-cli signmessage "energiaddress" "test message"
Now lock the wallet again by removing the passphrase
> energi-cli walletlock
As a json rpc call
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "encryptwallet", "params": ["my pass phrase"] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
DEPRECATED. Returns the account associated with the given address.
1. "energiaddress" (string, required) The energi address for account lookup.
"accountname" (string) the account address
> energi-cli getaccount "XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg"
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaccount", "params": ["XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg"] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
DEPRECATED. Returns the current Energi address for receiving payments to this account.
1. "account" (string, required) The account name for the address. It can also be set to the empty string "" to represent the default account. The account does not need to exist, it will be created and a new address created if there is no account by the given name.
"energiaddress" (string) The account energi address
> energi-cli getaccountaddress
> energi-cli getaccountaddress ""
> energi-cli getaccountaddress "myaccount"
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaccountaddress", "params": ["myaccount"] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
DEPRECATED. Returns the list of addresses for the given account.
1. "account" (string, required) The account name.
[ (json array of string)
"energiaddress" (string) a energi address associated with the given account
,...
]
> energi-cli getaddressesbyaccount "tabby"
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaddressesbyaccount", "params": ["tabby"] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
If account is not specified, returns the server's total available balance. If account is specified (DEPRECATED), returns the balance in the account. Note that the account "" is not the same as leaving the parameter out. The server total may be different to the balance in the default "" account.
1. "account" (string, optional) DEPRECATED. The selected account, or "*" for entire wallet. It may be the default account using "".
2. minconf (numeric, optional, default=1) Only include transactions confirmed at least this many times.
3. addlockconf (bool, optional, default=false) Whether to add 5 confirmations to transactions locked via InstantSend.
4. includeWatchonly (bool, optional, default=false) Also include balance in watchonly addresses (see 'importaddress')
amount (numeric) The total amount in NRG received for this account.
The total amount in the wallet
> energi-cli getbalance
The total amount in the wallet at least 5 blocks confirmed
> energi-cli getbalance "*" 6
As a json rpc call
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getbalance", "params": ["*", 6] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Returns a new Energi address for receiving payments. If 'account' is specified (DEPRECATED), it is added to the address book so payments received with the address will be credited to 'account'.
1. "account" (string, optional) DEPRECATED. The account name for the address to be linked to. If not provided, the default account "" is used. It can also be set to the empty string "" to represent the default account. The account does not need to exist, it will be created if there is no account by the given name.
"energiaddress" (string) The new energi address
> energi-cli getnewaddress
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getnewaddress", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Returns a new Energi address, for receiving change. This is for use with raw transactions, NOT normal use.
"address" (string) The address
> energi-cli getrawchangeaddress
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getrawchangeaddress", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
DEPRECATED. Returns the total amount received by addresses with in transactions with specified minimum number of confirmations.
1. "account" (string, required) The selected account, may be the default account using "".
2. minconf (numeric, optional, default=1) Only include transactions confirmed at least this many times.
3. addlockconf (bool, optional, default=false) Whether to add 5 confirmations to transactions locked via InstantSend.
amount (numeric) The total amount in NRG received for this account.
Amount received by the default account with at least 1 confirmation
> energi-cli getreceivedbyaccount ""
Amount received at the tabby account including unconfirmed amounts with zero confirmations
> energi-cli getreceivedbyaccount "tabby" 0
The amount with at least 6 confirmation, very safe
> energi-cli getreceivedbyaccount "tabby" 6
As a json rpc call
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getreceivedbyaccount", "params": ["tabby", 6] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Returns the total amount received by the given dashaddress in transactions with specified minimum number of confirmations.
1. "energiaddress" (string, required) The energi address for transactions.
2. minconf (numeric, optional, default=1) Only include transactions confirmed at least this many times.
3. addlockconf (bool, optional, default=false) Whether to add 5 confirmations to transactions locked via InstantSend.
amount (numeric) The total amount in NRG received at this address.
The amount from transactions with at least 1 confirmation
> energi-cli getreceivedbyaddress "XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg"
The amount including unconfirmed transactions, zero confirmations
> energi-cli getreceivedbyaddress "XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg" 0
The amount with at least 6 confirmation, very safe
> energi-cli getreceivedbyaddress "XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg" 6
As a json rpc call
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getreceivedbyaddress", "params": ["XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg", 6] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Get detailed information about in-wallet transaction
1. "txid" (string, required) The transaction id
2. "includeWatchonly" (bool, optional, default=false) Whether to include watchonly addresses in balance calculation and details[]
{
"amount" : x.xxx, (numeric) The transaction amount in NRG
"instantlock" : true|false, (bool) Current transaction lock state
"confirmations" : n, (numeric) The number of blockchain confirmations
"blockhash" : "hash", (string) The block hash
"blockindex" : xx, (numeric) The index of the transaction in the block that includes it
"blocktime" : ttt, (numeric) The time in seconds since epoch (1 Jan 1970 GMT)
"txid" : "transactionid", (string) The transaction id.
"time" : ttt, (numeric) The transaction time in seconds since epoch (1 Jan 1970 GMT)
"timereceived" : ttt, (numeric) The time received in seconds since epoch (1 Jan 1970 GMT)
"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
"details" : [
{
"account" : "accountname", (string) DEPRECATED. The account name involved in the transaction, can be "" for the default account.
"address" : "energiaddress", (string) The energi address involved in the transaction
"category" : "send|receive", (string) The category, either 'send' or 'receive'
"amount" : x.xxx, (numeric) The amount in NRG
"label" : "label", (string) A comment for the address/transaction, if any
"vout" : n, (numeric) the vout value
}
,...
],
"hex" : "data" (string) Raw data for transaction
}
> energi-cli gettransaction "1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d"
> energi-cli gettransaction "1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d" true
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "gettransaction", "params": ["1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d"] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Returns the server's total unconfirmed balance
Returns an object containing various wallet state info.
{
"walletversion": xxxxx, (numeric) the wallet version
"balance": xxxxxxx, (numeric) the total confirmed balance of the wallet in NRG
"unconfirmed_balance": xxx, (numeric) the total unconfirmed balance of the wallet in NRG
"immature_balance": xxxxxx, (numeric) the total immature balance of the wallet in NRG
"txcount": xxxxxxx, (numeric) the total number of transactions in the wallet
"keypoololdest": xxxxxx, (numeric) the timestamp (seconds since GMT epoch) of the oldest pre-generated key in the key pool
"keypoolsize": xxxx, (numeric) how many new keys are pre-generated (only counts external keys)
"keypoolsize_hd_internal": xxxx, (numeric) how many new keys are pre-generated for internal use (used for change outputs, only appears if the wallet is using this feature, otherwise external keys are used)
"keys_left": xxxx, (numeric) how many new keys are left since last automatic backup
"unlocked_until": ttt, (numeric) the timestamp in seconds since epoch (midnight Jan 1 1970 GMT) that the wallet is unlocked for transfers, or 0 if the wallet is locked
"paytxfee": x.xxxx, (numeric) the transaction fee configuration, set in NRG/kB
"hdchainid": "<hash>", (string) the ID of the HD chain
"hdaccountcount": xxx, (numeric) how many accounts of the HD chain are in this wallet
[
{
"hdaccountindex": xxx, (numeric) the index of the account
"hdexternalkeyindex": xxxx, (numeric) current external childkey index
"hdinternalkeyindex": xxxx, (numeric) current internal childkey index
}
,...
]
}
> energi-cli getwalletinfo
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getwalletinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Adds a script (in hex) or address that can be watched as if it were in your wallet but cannot be used to spend.
1. "script" (string, required) The hex-encoded script (or address)
2. "label" (string, optional, default="") An optional label
3. rescan (boolean, optional, default=true) Rescan the wallet for transactions
4. p2sh (boolean, optional, default=false) Add the P2SH version of the script as well
Note: This call can take minutes to complete if rescan is true.
If you have the full public key, you should call importpublickey instead of this.
Import a script with rescan
> energi-cli importaddress "myscript"
Import using a label without rescan
> energi-cli importaddress "myscript" "testing" false
As a JSON-RPC call
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "importaddress", "params": ["myscript", "testing", false] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Imports keys from an Electrum wallet export file (.csv or .json)
1. "filename" (string, required) The Electrum wallet export file, should be in csv or json format
2. index (numeric, optional, default=0) Rescan the wallet for transactions starting from this block index
Import the wallet
> energi-cli importelectrumwallet "test.csv"
> energi-cli importelectrumwallet "test.json"
Import using the json rpc call
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "importelectrumwallet", "params": ["test.csv"] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "importelectrumwallet", "params": ["test.json"] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Adds a private key (as returned by dumpprivkey) to your wallet.
1. "energiprivkey" (string, required) The private key (see dumpprivkey)
2. "label" (string, optional, default="") An optional label
3. rescan (boolean, optional, default=true) Rescan the wallet for transactions
Note: This call can take minutes to complete if rescan is true.
Dump a private key
> energi-cli dumpprivkey "myaddress"
Import the private key with rescan
> energi-cli importprivkey "mykey"
Import using a label and without rescan
> energi-cli importprivkey "mykey" "testing" false
As a JSON-RPC call
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "importprivkey", "params": ["mykey", "testing", false] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Adds a public key (in hex) that can be watched as if it were in your wallet but cannot be used to spend.
1. "pubkey" (string, required) The hex-encoded public key
2. "label" (string, optional, default="") An optional label
3. rescan (boolean, optional, default=true) Rescan the wallet for transactions
Note: This call can take minutes to complete if rescan is true.
Import a public key with rescan
> energi-cli importpubkey "mypubkey"
Import using a label without rescan
> energi-cli importpubkey "mypubkey" "testing" false
As a JSON-RPC call
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "importpubkey", "params": ["mypubkey", "testing", false] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Imports keys from a wallet dump file (see dumpwallet).
1. "filename" (string, required) The wallet file
Dump the wallet
> energi-cli dumpwallet "test"
Import the wallet
> energi-cli importwallet "test"
Import using the json rpc call
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "importwallet", "params": ["test"] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Send an amount to a given address. The amount is a real and is rounded to the nearest 0.00000001
1. "energiaddress" (string, required) The energi address to send to.
2. "amount" (numeric, required) The amount in btc to send. eg 0.1
3. "comment" (string, optional) A comment used to store what the transaction is for.
This is not part of the transaction, just kept in your wallet.
4. "comment-to" (string, optional) A comment to store the name of the person or organization
to which you're sending the transaction. This is not part of the
transaction, just kept in your wallet.
5. subtractfeefromamount (boolean, optional, default=false) The fee will be deducted from the amount being sent.
The recipient will receive less amount of Energi than you enter in the amount field.
"transactionid" (string) The transaction id.
> energi-cli instantsendtoaddress "XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg" 0.1
> energi-cli instantsendtoaddress "XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg" 0.1 "donation" "seans outpost"
> energi-cli instantsendtoaddress "XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg" 0.1 "" "" true
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "instantsendtoaddress", "params": ["XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg", 0.1, "donation", "seans outpost"] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Fills the keypool.
1. newsize (numeric, optional, default=1000) The new keypool size
> energi-cli keypoolrefill
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "keypoolrefill", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
DEPRECATED. Returns Object that has account names as keys, account balances as values.
1. minconf (numeric, optional, default=1) Only include transactions with at least this many confirmations
2. addlockconf (bool, optional, default=false) Whether to add 5 confirmations to transactions locked via InstantSend.
3. includeWatchonly (bool, optional, default=false) Include balances in watchonly addresses (see 'importaddress')
{ (json object where keys are account names, and values are numeric balances
"account": x.xxx, (numeric) The property name is the account name, and the value is the total balance for the account.
...
}
List account balances where there at least 1 confirmation
> energi-cli listaccounts
List account balances including zero confirmation transactions
> energi-cli listaccounts 0
List account balances for 6 or more confirmations
> energi-cli listaccounts 6
As json rpc call
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "listaccounts", "params": [6] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
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
[
[
[
"energiaddress", (string) The energi address
amount, (numeric) The amount in NRG
"account" (string, optional) The account (DEPRECATED)
]
,...
]
,...
]
> energi-cli listaddressgroupings
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "listaddressgroupings", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Returns list of temporarily unspendable outputs. See the lockunspent call to lock and unlock transactions for spending.
[
{
"txid" : "transactionid", (string) The transaction id locked
"vout" : n (numeric) The vout value
}
,...
]
List the unspent transactions
> energi-cli listunspent
Lock an unspent transaction
> energi-cli lockunspent false "[{\"txid\":\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\",\"vout\":1}]"
List the locked transactions
> energi-cli listlockunspent
Unlock the transaction again
> energi-cli lockunspent true "[{\"txid\":\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\",\"vout\":1}]"
As a json rpc call
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "listlockunspent", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
DEPRECATED. List balances by account.
1. minconf (numeric, optional, default=1) The minimum number of confirmations before payments are included.
2. addlockconf (bool, optional, default=false) Whether to add 5 confirmations to transactions locked via InstantSend.
3. includeempty (bool, optional, default=false) Whether to include accounts that haven't received any payments.
4. includeWatchonly (bool, optional, default=false) Whether to include watchonly addresses (see 'importaddress').
[
{
"involvesWatchonly" : true, (bool) Only returned if imported addresses were involved in transaction
"account" : "accountname", (string) The account name of the receiving account
"amount" : x.xxx, (numeric) The total amount received by addresses with this account
"confirmations" : n (numeric) The number of blockchain confirmations of the most recent transaction included
"label" : "label" (string) A comment for the address/transaction, if any
}
,...
]
> energi-cli listreceivedbyaccount
> energi-cli listreceivedbyaccount 6 false true
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "listreceivedbyaccount", "params": [6, false, true, true] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
List balances by receiving address.
1. minconf (numeric, optional, default=1) The minimum number of confirmations before payments are included.
2. addlockconf (bool, optional, default=false) Whether to add 5 confirmations to transactions locked via InstantSend.
3. includeempty (bool, optional, default=false) Whether to include addresses that haven't received any payments.
4. includeWatchonly (bool, optional, default=false) Whether to include watchonly addresses (see 'importaddress').
[
{
"involvesWatchonly" : true, (bool) Only returned if imported addresses were involved in transaction
"address" : "receivingaddress", (string) The receiving address
"account" : "accountname", (string) DEPRECATED. The account of the receiving address. The default account is "".
"amount" : x.xxx, (numeric) The total amount in NRG received by the address
"confirmations" : n (numeric) The number of confirmations of the most recent transaction included.
If 'addlockconf' is true, the minimum number of confirmations is calculated
including additional 5 confirmations for transactions locked via InstantSend
"label" : "label" (string) A comment for the address/transaction, if any
}
,...
]
> energi-cli listreceivedbyaddress
> energi-cli listreceivedbyaddress 6 false true
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "listreceivedbyaddress", "params": [6, false, true, true] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Get all transactions in blocks since block [blockhash], or all transactions if omitted
1. "blockhash" (string, optional) The block hash to list transactions since
2. target-confirmations: (numeric, optional) The confirmations required, must be 1 or more
3. includeWatchonly: (bool, optional, default=false) Include transactions to watchonly addresses (see 'importaddress')
{
"transactions": [
"account":"accountname", (string) DEPRECATED. The account name associated with the transaction. Will be "" for the default account.
"address":"energiaddress", (string) The energi address of the transaction. Not present for move transactions (category = move).
"category":"send|receive", (string) The transaction category. 'send' has negative amounts, 'receive' has positive amounts.
"amount": x.xxx, (numeric) The amount in NRG. 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.
"vout" : n, (numeric) the vout value
"fee": x.xxx, (numeric) The amount of the fee in NRG. This is negative and only available for the 'send' category of transactions.
"instantlock" : true|false, (bool) Current transaction lock state. Available for 'send' and 'receive' category of transactions.
"confirmations" : n, (numeric) The number of blockchain confirmations for the transaction. Available for 'send' and 'receive' category of transactions.
"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 (Jan 1 1970 GMT).
"timereceived": xxx, (numeric) The time received in seconds since epoch (Jan 1 1970 GMT). Available for 'send' and 'receive' category of transactions.
"comment": "...", (string) If a comment is associated with the transaction.
"label" : "label" (string) A comment for the address/transaction, if any
"to": "...", (string) If a comment to is associated with the transaction.
],
"lastblock": "lastblockhash" (string) The hash of the last block
}
> energi-cli listsinceblock
> energi-cli listsinceblock "000000000000000bacf66f7497b7dc45ef753ee9a7d38571037cdb1a57f663ad" 6
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "listsinceblock", "params": ["000000000000000bacf66f7497b7dc45ef753ee9a7d38571037cdb1a57f663ad", 6] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Returns up to 'count' most recent transactions skipping the first 'from' transactions for account 'account'.
1. "account" (string, optional) DEPRECATED. The account name. Should be "*".
2. count (numeric, optional, default=10) The number of transactions to return
3. from (numeric, optional, default=0) The number of transactions to skip
4. includeWatchonly (bool, optional, default=false) Include transactions to watchonly addresses (see 'importaddress')
[
{
"account":"accountname", (string) DEPRECATED. The account name associated with the transaction.
It will be "" for the default account.
"address":"energiaddress", (string) The energi address of the transaction. Not present for
move transactions (category = move).
"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 NRG. 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.
"vout": n, (numeric) the vout value
"fee": x.xxx, (numeric) The amount of the fee in NRG. This is negative and only available for the
'send' category of transactions.
"instantlock" : true|false, (bool) Current transaction lock state. Available for 'send' and 'receive' category of transactions.
"confirmations": n, (numeric) The number of blockchain confirmations for the transaction. Available for 'send' and
'receive' category of transactions. Negative confirmations indicate the
transation 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.
"label": "label" (string) A comment for the address/transaction, if any
"otheraccount": "accountname", (string) 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
}
]
List the most recent 10 transactions in the systems
> energi-cli listtransactions
List transactions 100 to 120
> energi-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:9796/
Returns array of unspent transaction outputs with between minconf and maxconf (inclusive) confirmations. Optionally filter to only include txouts paid to specified addresses. Results are an array of Objects, each of which has: {txid, vout, scriptPubKey, amount, confirmations}
1. minconf (numeric, optional, default=1) The minimum confirmations to filter
2. maxconf (numeric, optional, default=9999999) The maximum confirmations to filter
3. "addresses" (string) A json array of energi addresses to filter
[
"address" (string) energi address
,...
]
[ (array of json object)
{
"txid" : "txid", (string) the transaction id
"vout" : n, (numeric) the vout value
"address" : "address", (string) the energi address
"account" : "account", (string) DEPRECATED. The associated account, or "" for the default account
"scriptPubKey" : "key", (string) the script key
"amount" : x.xxx, (numeric) the transaction amount in NRG
"confirmations" : n (numeric) The number of confirmations
"ps_rounds" : n (numeric) The number of PS round
"spendable" : xxx, (bool) Whether we have the private keys to spend this output
"solvable" : xxx (bool) Whether we know how to spend this output, ignoring the lack of keys
}
,...
]
> energi-cli listunspent
> energi-cli listunspent 6 9999999 "[\"XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg\",\"XuQQkwA4FYkq2XERzMY2CiAZhJTEDAbtcg\"]"
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "listunspent", "params": [6, 9999999 "[\"XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg\",\"XuQQkwA4FYkq2XERzMY2CiAZhJTEDAbtcg\"]"] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Updates list of temporarily unspendable outputs. Temporarily lock (unlock=false) or unlock (unlock=true) specified transaction outputs. A locked transaction output will not be chosen by automatic coin selection, when spending NRG. Locks are stored in memory only. Nodes start with zero locked outputs, and the locked output list is always cleared (by virtue of process exit) when a node stops or fails. Also see the listunspent call
1. unlock (boolean, required) Whether to unlock (true) or lock (false) the specified transactions
2. "transactions" (string, required) A json array of objects. Each object the txid (string) vout (numeric)
[ (json array of json objects)
{
"txid":"id", (string) The transaction id
"vout": n (numeric) The output number
}
,...
]
true|false (boolean) Whether the command was successful or not
List the unspent transactions
> energi-cli listunspent
Lock an unspent transaction
> energi-cli lockunspent false "[{\"txid\":\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\",\"vout\":1}]"
List the locked transactions
> energi-cli listlockunspent
Unlock the transaction again
> energi-cli lockunspent true "[{\"txid\":\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\",\"vout\":1}]"
As a json rpc call
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "lockunspent", "params": [false, "[{\"txid\":\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\",\"vout\":1}]"] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
DEPRECATED. Move a specified amount from one account in your wallet to another.
1. "fromaccount" (string, required) The name of the account to move funds from. May be the default account using "".
2. "toaccount" (string, required) The name of the account to move funds to. May be the default account using "".
3. amount (numeric) Quantity of NRG to move between accounts.
4. minconf (numeric, optional, default=1) Only use funds with at least this many confirmations.
5. "comment" (string, optional) An optional comment, stored in the wallet only.
true|false (boolean) true if successful.
Move 0.01 NRG from the default account to the account named tabby
> energi-cli move "" "tabby" 0.01
Move 0.01 NRG timotei to akiko with a comment and funds have 6 confirmations
> energi-cli move "timotei" "akiko" 0.01 6 "happy birthday!"
As a json rpc call
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "move", "params": ["timotei", "akiko", 0.01, 6, "happy birthday!"] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
DEPRECATED (use sendtoaddress). Sent an amount from an account to an energi address.
1. "fromaccount" (string, required) The name of the account to send funds from. May be the default account using "".
2. "toenergiaddress" (string, required) The energi address to send funds to.
3. amount (numeric or string, required) The amount in NRG (transaction fee is added on top).
4. minconf (numeric, optional, default=1) Only use funds with at least this many confirmations.
5. addlockconf (bool, optional, default=false) Whether to add 5 confirmations to transactions locked via InstantSend.
6. "comment" (string, optional) A comment used to store what the transaction is for.
This is not part of the transaction, just kept in your wallet.
7. "comment-to" (string, optional) An optional comment to store the name of the person or organization
to which you're sending the transaction. This is not part of the transaction,
it is just kept in your wallet.
"transactionid" (string) The transaction id.
Send 0.01 NRG from the default account to the address, must have at least 1 confirmation
> energi-cli sendfrom "" "XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg" 0.01
Send 0.01 from the tabby account to the given address, funds must have at least 6 confirmations
> energi-cli sendfrom "tabby" "XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg" 0.01 6 false "donation" "seans outpost"
As a json rpc call
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "sendfrom", "params": ["tabby", "XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg", 0.01, 6, false, "donation", "seans outpost"] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
sendmany "fromaccount" {"address":amount,...} ( minconf addlockconf "comment" ["address",...] subtractfeefromamount use_is use_ps )
Send multiple times. Amounts are double-precision floating point numbers.
1. "fromaccount" (string, required) DEPRECATED. The account to send the funds from. Should be "" for the default account
2. "amounts" (string, required) A json object with addresses and amounts
{
"address":amount (numeric or string) The energi address is the key, the numeric amount (can be string) in NRG is the value
,...
}
3. minconf (numeric, optional, default=1) Only use the balance confirmed at least this many times.
4. addlockconf (bool, optional, default=false) Whether to add 5 confirmations to transactions locked via InstantSend.
5. "comment" (string, optional) A comment
6. subtractfeefromamount (string, optional) A json array with addresses.
The fee will be equally deducted from the amount of each selected address.
Those recipients will receive less NRG than you enter in their corresponding amount field.
If no addresses are specified here, the sender pays the fee.
[
"address" (string) Subtract fee from this address
,...
]
7. "use_is" (bool, optional) Send this transaction as InstantSend (default: false)
8. "use_ps" (bool, optional) Use anonymized funds only (default: false)
"transactionid" (string) The transaction id for the send. Only 1 transaction is created regardless of
the number of addresses.
Send two amounts to two different addresses:
> energi-cli sendmany "tabby" "{\"XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg\":0.01,\"XuQQkwA4FYkq2XERzMY2CiAZhJTEDAbtcg\":0.02}"
Send two amounts to two different addresses setting the confirmation and comment:
> energi-cli sendmany "tabby" "{\"XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg\":0.01,\"XuQQkwA4FYkq2XERzMY2CiAZhJTEDAbtcg\":0.02}" 6 false "testing"
As a json rpc call
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "sendmany", "params": ["tabby", "{\"XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg\":0.01,\"XuQQkwA4FYkq2XERzMY2CiAZhJTEDAbtcg\":0.02}", 6, false, "testing"] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Send an amount to a given address.
1. "energiaddress" (string, required) The energi address to send to.
2. "amount" (numeric or string, required) The amount in NRG to send. eg 0.1
3. "comment" (string, optional) A comment used to store what the transaction is for.
This is not part of the transaction, just kept in your wallet.
4. "comment-to" (string, optional) A comment to store the name of the person or organization
to which you're sending the transaction. This is not part of the
transaction, just kept in your wallet.
5. subtractfeefromamount (boolean, optional, default=false) The fee will be deducted from the amount being sent.
The recipient will receive less amount of Energi than you enter in the amount field.
6. "use_is" (bool, optional) Send this transaction as InstantSend (default: false)
7. "use_ps" (bool, optional) Use anonymized funds only (default: false)
"transactionid" (string) The transaction id.
> energi-cli sendtoaddress "XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg" 0.1
> energi-cli sendtoaddress "XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg" 0.1 "donation" "seans outpost"
> energi-cli sendtoaddress "XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg" 0.1 "" "" true
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "sendtoaddress", "params": ["XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg", 0.1, "donation", "seans outpost"] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
DEPRECATED. Sets the account associated with the given address.
1. "energiaddress" (string, required) The energi address to be associated with an account.
2. "account" (string, required) The account to assign the address to.
> energi-cli setaccount "XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg" "tabby"
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "setaccount", "params": ["XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg", "tabby"] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Set the transaction fee per kB. Overwrites the paytxfee parameter.
1. amount (numeric or sting, required) The transaction fee in NRG/kB
true|false (boolean) Returns true if successful
> energi-cli settxfee 0.00001
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "settxfee", "params": [0.00001] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/
Sign a message with the private key of an address
1. "energiaddress" (string, required) The energi address to use for the private key.
2. "message" (string, required) The message to create a signature of.
"signature" (string) The signature of the message encoded in base 64
Unlock the wallet for 30 seconds
> energi-cli walletpassphrase "mypassphrase" 30
Create the signature
> energi-cli signmessage "XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg" "my message"
Verify the signature
> energi-cli verifymessage "XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg" "signature" "my message"
As json rpc
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "signmessage", "params": ["XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg", "my message"] }' -H 'content-type: text/plain;' http://127.0.0.1:9796/