• 官网
  • 中文
  • English
  • Russian
  • More language
Show / Hide Table of Contents
  • Home
  • Getting Started
  • NEO Node
    • Introduction
    • Installation
    • Graphical User Interface
    • Test Network
    • CLI Reference
    • Private Chain
    • API Reference
      • dumpprivkey
      • getaccountstate
      • getassetstate
      • getbalance
      • getbestblockhash
      • getblock
      • getblock
      • getblockcount
      • getblockhash
      • getblocksysfee
      • getconnectioncount
      • getcontractstate
      • getnewaddress
      • getrawmempool
      • getrawtransaction
      • getstorage
      • gettxout
      • getpeers
      • getversion
      • invoke
      • invokefunction
      • invokescript
      • sendrawtransaction
      • sendtoaddress
      • sendmany
      • validateaddress
    • Network Protocol
    • Consensus
      • Consensus Whitepaper
      • Consensus Diagram
  • Smart Contract
    • Introduction
    • Getting Started (C#)
    • Getting Started (Java)
    • Getting Started (Python)
      • Using Prompt
      • Settings and Logging
      • Interacting with Smart Contracts
      • Tests
      • Python Compiler
    • Tutorial
      • Basics
      • Hello World
      • Lock Contract
      • Domain (Domain Name System)
      • Smart Contract Parameters and Return Values
      • Contract Authentication Tutorial
      • Deploying a Lock Contract
      • Contract Call
      • Deploying and Invoking
    • Test
    • Whitepaper
    • API Reference
      • NEO
      • System
    • Framework
      • .NET framework
        • NEO
          • Account
          • Asset
          • Block
          • Blockchain
          • Enrollment
          • Header
          • Storage
          • StorageContext
          • Transaction
          • TransactionAttribute
          • TransactionInput
          • TransactionOutput
        • System
          • ExecutionEngine
    • System Fees
  • Document for Exchange Developers
  • Contributors

Metodo invoke

Restituisce il risultato dopo la chiamata a uno smart contract in scripthash con i parametri specificati.

[!Nota]

Questo metodo è per testare il tuo script della macchina virtuale (VM) come se fosse stato eseguito sulla blockchain in quel momento. Questa chiamata RPC, non ha in alcun modo effetto sulla blockchain.

Desrizione del parametro

scripthash: Smart contract scripthash

params: I parametri da passare allo smart contract

Esempio

Corpo della richiesta:

{
  "jsonrpc": "2.0",
  "method": "invoke",
  "params": [
"dc675afc61a7c0f7b3d2682bf6e1d8ed865a0e5f",
[
  {
    "type": "String",
    "value": "name"
  },
  {
    "type":"Boolean",
    "value": false
  }
]
  ],
  "id": 1
}

Corpo della risposta:

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
        "state": "HALT, BREAK",
        "gas_consumed": "2.489",
        "stack": [
            {
                "type": "ByteArray",
                "value": "576f6f6c6f6e67"
            }
        ]
    }
}
  • Improve this Doc
Back to top Copyright © 2014-2018 NEO