-
-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
blockchain: btc(bitcoin) #14
Comments
ref:官网:
下载地址:
源码库:
|
book:
|
参考:BTC挖矿协议: |
Insight API:官方:参考:
本地环境:https://github.com/bitpay/insight npm install -g bitcore-node
# create:
bitcore-node create mynode
cd mynode
bitcore-node install insight-api
bitcore-node install insight-ui
# start:
bitcore-node start
# Open a web browser to
# http://localhost:3001/insight/
# dev:
npm run build
npm run watch
|
restful api:https://github.com/bitpay/insight-api
|
bitcoin API:rpc:
python lib:https://github.com/petertodd/python-bitcoinlib
https://pypi.python.org/pypi/bitcoin-python/0.3
# 客户端:
>>> import jsonrpclib
>>> server = jsonrpclib.Server('http://localhost:8080')
>>> server.add(5,6)
11
>>> print jsonrpclib.history.request
{"jsonrpc": "2.0", "params": [5, 6], "id": "gb3c9g37", "method": "add"}
>>> print jsonrpclib.history.response
{'jsonrpc': '2.0', 'result': 11, 'id': 'gb3c9g37'}
>>> server.add(x=5, y=10)
15
>>> server._notify.add(5,6)
# No result returned...
>>> batch = jsonrpclib.MultiCall(server)
>>> batch.add(5, 6)
>>> batch.ping({'key':'value'})
>>> batch._notify.add(4, 30)
>>> results = batch()
>>> for result in results:
>>> ... print result
11
{'key': 'value'}
# Note that there are only two responses -- this is according to spec.
# 服务器端:
from jsonrpclib.SimpleJSONRPCServer import SimpleJSONRPCServer
server = SimpleJSONRPCServer(('localhost', 8080))
server.register_function(pow)
server.register_function(lambda x,y: x+y, 'add')
server.register_function(lambda x: x, 'ping')
server.serve_forever()
其他: |
查询测试API:btc, etc, eth:
web3.py
|
No description provided.
The text was updated successfully, but these errors were encountered: