首页 > Web开发 > 详细

A simple json-rpc case for bitcoin blockchains

时间:2016-03-04 16:07:56      阅读:222      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!