码迷,mamicode.com
首页 > Web开发 > 详细

A simple json-rpc case for bitcoin blockchains

时间:2016-03-04 16:09:31      阅读:143      评论:0      收藏:0      [点我收藏+]

标签:

#!/usr/bin/env python                                                           
                                                                                
import json                                                                     
import jsonrpc                                                                  
import requests                                                                 
                                                                                
#url = "http://user:password@ip:port/                                           
#you can find user and password in multichain.conf file in path ~/.multichain/chain2
url = "http://multichainrpc:H4MvpnyZix9ynkJ3T8om8PtKziF7CtVtAH7WkZ3eRK1u@localhost:4352/"
headers = {‘content-type‘: ‘application/json‘}                                  
                                                                                
helpload = {                                                                    
    "jsonrpc":"1.0",                                                            
    "method": "getinfo",                                                        
}                                                                               
                                                                                
print "------ test begin --------"                                              
response = requests.post(url, data=json.dumps(helpload), headers=headers).json()
print response

  

A simple json-rpc case for bitcoin blockchains

标签:

原文地址:http://www.cnblogs.com/clor001/p/5242055.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!