Advertisement

终端命令行通过JSON-RPC接口与智能合约交互

阅读量:

(0)协议

复制代码
 contract Multiply7 {

    
  
    
    event Print(uint);
    
  
    
    function multiply(uint input) returns (uint) {
    
  
    
       Print(input * 7);
    
  
    
       return input * 7;
    
  
    
    }
    
  
    
 }
    
    
    
    

(1)合约的编译过程

复制代码
    curl --data '{"jsonrpc":"2.0","method": "eth_compileSolidity", "params": ["contract Multiply7 {event Print(uint);function multiply(uint input) returns (uint) {Print(input * 7);return input * 7;}}"], "id": 5}' localhost:8545
    
复制代码
 {

    
     "jsonrpc":"2.0",
    
     "id":5,
    
     "result":{

全部评论 (0)

还没有任何评论哟~