Return the result after passing a script through the VM.
Note
- This method is to test your VM script as if they were ran on the blockchain at that point in time. This RPC call does not affect the blockchain in any way.
- This method is provided by the plugin RpcWallet. You need to install the plugin before you can invoke the method.
{
"jsonrpc": "2.0",
"method": "invokescript",
"params": [script],
"id": 3
}
script: A script runnable in the VM. This is the same script that is carried in InvocationTransaction
Request body:
{
"jsonrpc": "2.0",
"method": "invokescript",
"params": ["00046e616d656724058e5e1b6008847cd662728549088a9ee82191"],
"id": 3
}
Response body:
{
"jsonrpc": "2.0",
"id": 3,
"result": {
"script": "00046e616d656724058e5e1b6008847cd662728549088a9ee82191",
"state": "HALT, BREAK",
"gas_consumed": "0.161",
"stack": [
{
"type": "ByteArray",
"value": "4e45503520474153"
}
]
}
}