Skip to content

v1.7.0

Latest
Compare
Choose a tag to compare
@github-actions github-actions released this 30 Mar 06:20
6ec3866

Changelog

Uplifted Substrate base version to polkadot-v0.9.43.

Client

Block height manipulation

Developers can forward blocks and revert blocks to requested block heights.

Forward blocks via RPC

Forwarding blocks to requested block height by calling engine_forwardBlocksTo.

$ curl http://127.0.0.1:9944 -H "Content-Type:application/json;charset=utf-8" -d   '{
     "jsonrpc":"2.0",
      "id":1,
      "method":"engine_forwardBlocksTo",
      "params": [120]  
    }'

Params

  • Height
    height denotes an integral value that signifies the desired block height towards which the user intends to progress. If the value is lower than current height, RPC returns an error.

Revert blocks via RPC

Reverting blocks to requested block height by calling engine_revertBlocksTo.

Note that reverting finalized blocks only works when node is launched with archive mode --state-pruning archive (or --pruning archive) since reverting blocks requires past blocks' states.
When blocks' states are pruned, RPC won't revert finalized blocks.

$ curl http://127.0.0.1:9944 -H "Content-Type:application/json;charset=utf-8" -d   '{
     "jsonrpc":"2.0",
      "id":1,
      "method":"engine_revertBlocksTo",
      "params": [50]
    }'

Params

  • Height
    height denotes an integral value that represents the desired block height which the user intends to revert to. If the value is higher than current height, RPC returns an error.

Runtimes

Account Balance manipulation

For local development purpose, developers can manipulate any users' account balance via RPC without requiring their accounts' signatures and transaction cost to pay.

Get Account Balance

Getting users' account balance by balance_getAccount method.

curl http://127.0.0.1:9944 -H "Content-Type:application/json;charset=utf-8" -d   '{
     "jsonrpc":"2.0",
      "id":1,
      "method":"balance_getAccount",
      "params": ["5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY", null]
    }'

Params

  • Account ID
    account_id is AccountID whose balance information you would like to check.

Set Free Balance

Free balance is amount of unreserved token owner can freely spend. balance_setFreeBalance alters the amount of free token a specified account has.

curl http://127.0.0.1:9944 -H "Content-Type:application/json;charset=utf-8" -d   '{
     "jsonrpc":"2.0",
      "id":1,
      "method":"balance_setFreeBalance",
      "params": ["5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY", 120000000000000000000, null]
    }'

Params

  • Account ID
    account_id is AccountID whose balance you would like to modify.

  • Free Balance
    free_balance is new Balance value you would like to set to accounts.

Arch Link
MacOS universal Download
Ubuntu amd64 Download
Ubuntu arm64 Download