Module Experiment
RPC Module Experiment for experimenting methods.
EXPERIMENTAL warning
The methods here may be removed or changed in future releases without prior notifications.
Method dry_run_transaction
dry_run_transaction(tx)tx:Transaction
- result:
EstimateCycles
👎Deprecated since 0.105.1: Please use the RPC method estimate_cycles instead
Dry run a transaction and return the execution cycles.
This method will not check the transaction validity, but only run the lock script and type script and then return the execution cycles.
It is used to debug transaction scripts and query how many cycles the scripts consume.
Errors
TransactionFailedToResolve (-301)- Failed to resolve the referenced cells and headers used in the transaction, as inputs or dependencies.TransactionFailedToVerify (-302)- There is a script returns with an error.
Example
Use a native SQIsign transaction with a signed witness and current unspent inputs. Save just the transaction object to signed-transaction.json before calling this method.
jq -c '{jsonrpc:"2.0",id:1,method:"dry_run_transaction",params:[.]}' signed-transaction.json |
curl -fsS http://127.0.0.1:8114 -H 'Content-Type: application/json' --data-binary @-
Method estimate_fee_rate
estimate_fee_rate(estimate_mode, enable_fallback)estimate_mode:EstimateMode|nullenable_fallback:boolean|null
- result:
Uint64
Get fee estimates.
Params
-
estimate_mode- The fee estimate mode.Default:
no_priority. -
enable_fallback- True to enable a simple fallback algorithm, when lack of historical empirical data to estimate fee rates with configured algorithm.Default:
true.
####### The fallback algorithm
Since KRYVON transaction confirmation involves a two-step process—1) propose and 2) commit, it is complex to predict the transaction fee accurately with the expectation that it will be included within a certain block height.
This algorithm relies on two assumptions and uses a simple strategy to estimate the transaction fee: 1) all transactions in the pool are waiting to be proposed, and 2) no new transactions will be added to the pool.
In practice, this simple algorithm should achieve good accuracy fee rate and running performance.
Returns
The estimated fee rate in quarks per kilobyte.
Example
Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "estimate_fee_rate",
"params": []
}
Response
{
"jsonrpc": "2.0",
"result": "0x3e8",
"id": 1
}