Parse Bitcoin Ledger To Elasticsearch
老码农不上班 · · 1036 次点击 · · 开始浏览Dump Bitcoin Mainnet ledger to elasticsearch. constructed specify format so we can query balance and utxo, the main propose of the repo is for wallet or block explorer
Install
Environment require:
- Golang (compile)
- Dep (package dependency)
- Elasticsearch (database)
Before clone the repo, I wanna let claim that there is a bug I have verified the btcd, an alternative full node bitcoin implementation written in Go. See the detail: [RPC] getblock command has been changed, and I have given a solution how to fixed the problem
go get -u github.com/wenweih/btc-chaindata-2es
cd $GOPATH/src/github.com/wenweih/btc-chaindata-2es
dep ensure -v -update
After dep ensure -v -update to load the repo dependency, you should modify btcd package in vendor fold flowing by 修复开源项目 btcd RPC 实现比特币获取区块的问题.
cross compile, such as for my Ubuntu Server:
GOARCH=amd64 GOOS=linux go build
Usage
Because of btc-chaindata-2es service interacts with bitcoind by RPC and Elasticsearch by HTTP protocol, to avoid network request delay, I hightly recommend you run the three services (btc-chaindata-2ex, bitcoind and elasticsearch) in the same server.
Copy configure to ~/ directory
cat ~/btc-chaindata-2es.yml
btc_host: "127.0.0.1"
btc_port: "8791"
btc_usr: "usertest"
btc_pass: "passtest"
btc_http_mode: true
btc_disable_tls: true
elastic_url: "http://127.0.0.1:9200"
elastic_sniff: false
Start the service:
nohup ~/btc-chaindata-2es sync > /tmp/btc-chaindata-2es.log 2>&1 &
Links
有疑问加站长微信联系(非本文作者)
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
关注微信- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码` - 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传
收入到我管理的专栏 新建专栏
Dump Bitcoin Mainnet ledger to elasticsearch. constructed specify format so we can query balance and utxo, the main propose of the repo is for wallet or block explorer
Install
Environment require:
- Golang (compile)
- Dep (package dependency)
- Elasticsearch (database)
Before clone the repo, I wanna let claim that there is a bug I have verified the btcd, an alternative full node bitcoin implementation written in Go. See the detail: [RPC] getblock command has been changed, and I have given a solution how to fixed the problem
go get -u github.com/wenweih/btc-chaindata-2es
cd $GOPATH/src/github.com/wenweih/btc-chaindata-2es
dep ensure -v -update
After dep ensure -v -update to load the repo dependency, you should modify btcd package in vendor fold flowing by 修复开源项目 btcd RPC 实现比特币获取区块的问题.
cross compile, such as for my Ubuntu Server:
GOARCH=amd64 GOOS=linux go build
Usage
Because of btc-chaindata-2es service interacts with bitcoind by RPC and Elasticsearch by HTTP protocol, to avoid network request delay, I hightly recommend you run the three services (btc-chaindata-2ex, bitcoind and elasticsearch) in the same server.
Copy configure to ~/ directory
cat ~/btc-chaindata-2es.yml
btc_host: "127.0.0.1"
btc_port: "8791"
btc_usr: "usertest"
btc_pass: "passtest"
btc_http_mode: true
btc_disable_tls: true
elastic_url: "http://127.0.0.1:9200"
elastic_sniff: false
Start the service:
nohup ~/btc-chaindata-2es sync > /tmp/btc-chaindata-2es.log 2>&1 &