The following RPC calls interact with the komodod software, and are made available through the komodo-cli software.
getblocksubsidy
getblocksubsidy height_number
The getblocksubsidy method returns the block-subsidy reward. The resulting calculation takes into account the mining slow start. This method can be used in conjunction with custom mining rewards designed by the developers of a KMD-based Smart Chain.
Arguments
Name
Type
Description
height
(numeric, optional)
the block height; if the block height is not provided, the method defaults to the current height of the chain
Response
Name
Type
Description
"miner"
(numeric)
the mining reward amount
📌 Examples
Command:
./komodo-cligetblocksubsidy100
{"miner":3.0}
You can find your rpcuser, rpcpassword, and rpcport in the coin's .conf file.
The getblocktemplate method returns data that is necessary to construct a block.
If the request parameters include a mode key, it is used to explicitly select between the default 'template' request, a 'proposal' or 'disablecb'.
A Note on Unique Mining Circumstances
There are many features in the Komodo Ecosystem that can make a Smart Chain's daemon produce non-standard coinbase transactions. Examples include a Smart Chain parameter that creates new coins for a specific pubkey in every block or a CC module that adds outputs to the coinbase transaction.
The block template produced using this mode doesn't have the "coinbasetxn": { ... } json object but adds the coinbase transaction to the "transactions":[ ... ] array, just like a regular transaction.
Now the pool software can use the "transactions":[ ... ] array to create a block and take fees in the payment processor. Team member, Blackjok3r, developed a coinbase-override method for this purpose. Please see this repo for details.
Arguments
Name
Type
Description
"jsonrequestobject" : { ... }
(string, optional)
a json object in the following spec
"mode"
(string, optional)
this must be set to "template" or omitted
"capabilities": [ ... ]
(array, optional)
a list of strings
"support"
(string)
client side supported features: "longpoll", "coinbasetxn", "coinbasevalue", "proposal", "serverlist", "workid"
Response
Name
Type
Description
"version"
(numeric)
the block version
"previousblockhash"
(string)
the hash of current highest block
"finalsaplingroothash"
(string)
the hash of the final sapling root
"transactions":[ ... ]
(array)
the contents of non-coinbase transactions that should be included in the next block
"data"
(string)
transaction data encoded in hexadecimal (byte-for-byte)
"hash"
(string)
the hash/id encoded in little-endian hexadecimal
"depends" : [ ... ]
(array)
an array of numbers
number
(numeric)
the indexes of transactions that must be present in the final block if this transaction is present in the final block; the index of the array of transactions starts with "1"
"fee"
(numeric)
the difference in value between transaction inputs and outputs in satoshis; for coinbase transactions, this is the negative number of the total collected block fees, not including the block subsidy; if a key is not present, the fee is unknown and clients MUST NOT assume it is not present
"sigops"
(numeric)
the total number of sigops, as counted for the purposes of block limits; if a key is not present, the sigop count is unknown and clients MUST NOT assume they are not present.
"required"
(boolean)
if provided and true, this transaction must be in the final block
"coinbasetxn": { ... }
(json object)
information for the coinbase transaction
"longpollid"
(string)
the last seen longpollid when this response was sent by the server
"data"
(string)
transaction data encoded in hexadecimal (byte-for-byte)
"hash"
(string)
the hash/id encoded in little-endian hexadecimal
"depends" : [ ... ]
(array)
an array of numbers
"fee"
(numeric)
the difference in value between transaction inputs and outputs in satoshis; for coinbase transactions, this is the negative number of the total collected block fees, not including the block subsidy; if a key is not present, the fee is unknown and clients MUST NOT assume it is not present
"sigops"
(numeric)
the total number of sigops, as counted for the purposes of block limits; if a key is not present, the sigop count is unknown and clients MUST NOT assume they are not present.
"foundersreward"
(numeric)
the founder's reward that should be paid out in this block; this key is present only in the blocks that payout the founder's reward; present only in chains with ac_founders enabled
"coinbasevalue"
(numeric)
the value of the coinbase transaction (in satoshis)
"required"
(boolean)
if provided and true, this transaction must be in the final block
"target"
(string)
the hash target
"mintime"
(numeric)
the minimum timestamp appropriate for next block time in seconds since epoch (Jan 1 1970 GMT)
"mutable": [ ... ]
(array of strings)
a 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"
(string)
a range of valid nonces
"sigoplimit"
(numeric)
the limit of sigops in blocks
"sizelimit"
(numeric)
the limit of block size
"curtime"
(numeric)
current timestamp in seconds since epoch (Jan 1 1970 GMT)
::: warning DEPRECATED: Use getnetworksolps instead. :::
The getnetworkhashps method returns the estimated network solutions per second based on the last n blocks.
Pass in blocks value to override the default number of blocks. Passing in -1 will return a value based on the average hashps of the relevant difficulty window.
Pass in height to estimate the network speed at the time when a certain block was found.
Arguments
Name
Type
Description
blocks
(numeric, optional, default=120)
the number of blocks (use -1 to calculate over the relevant difficulty averaging window)
height
(numeric, optional, default=-1)
the block height that corresponds to the requested data
Response
Name
Type
Description
data
(numeric)
the solutions-per-second estimate
📌 Examples
Command:
./komodo-cligetnetworkhashps
10724120
You can find your rpcuser, rpcpassword, and rpcport in the coin's .conf file.
The getnetworksolps method returns the estimated network solutions per second based on the last n blocks.
Pass in blocks to override the default number of blocks. Use -1 to calculate according to the relevant difficulty averaging window. Pass in height to estimate the network speed at the time when a certain block was found.
Arguments
Name
Type
Description
blocks
(numeric, optional, default=120)
the number of blocks; use -1 to calculate according to the relevant difficulty averaging window
height
(numeric, optional, default=-1)
the block height that corresponds to the requested data
Response
Name
Type
Description
data
(numeric)
solutions per second, estimated
📌 Examples
Command:
./komodo-cligetnetworksolps
17547717
You can find your rpcuser, rpcpassword, and rpcport in the coin's .conf file.
The prioritisetransaction method instructs the daemon to accept the indicated transaction into mined blocks at a higher (or lower) priority. The transaction selection algorithm considers the transaction as it would have a higher priority.
::: tip This method is inherited from the original Bitcoin protocol, of which KMD is a fork (via Zcash). For more examples regarding this method, please see the linked documentation. :::
Arguments
Name
Type
Description
"transaction_id"
(string, required)
the transaction id
priority_delta
(numeric, required)
the priority to add or subtract (if negative). The transaction selection algorithm assigns the tx a higher or lower priority. The transaction priority calculation: coinage * value_in_satoshis / txsize
fee_delta
(numeric, required)
the fee value in satoshis 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 if it paid a higher (or lower) fee.