Parse Bitcoin Ledger to Elasticsearch

Source: Internet
Author: User

Dump Bitcoin mainnet Ledger to Elasticsearch. Constructed specify format so we can query balance and Utxo, the main propose of the repo are for wallet or block explorer

Install

Environment require:

    • Golang (Compile)
    • Dep (Package dependency)
    • Elasticsearch (Database)

Before clone the repo, I wanna let claim so there is a bug I had verified the BTCD, an alternative full node Bitcoin im Plementation written in Go. See the detail: [RPC] Getblock command had been changed, and I had given a solution how to fixed the problem

go get -u github.com/wenweih/btc-chaindata-2escd $GOPATH/src/github.com/wenweih/btc-chaindata-2esdep ensure -v -update

After dep ensure -v -update -to-load the repo dependency, you should modify BTCD package in vendor fold flowing by fix open source project Btcd RPC implementation Bitcoin acquisition block The problem.

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 R Equest delay, I hightly recommend you run the three services (Btc-chaindata-2ex, Bitcoind and Elasticsearch) in the same s Erver.

Copy Configure to ~/directory

cat ~/btc-chaindata-2es.ymlbtc_host: "127.0.0.1"btc_port: "8791"btc_usr: "usertest"btc_pass: "passtest"btc_http_mode: truebtc_disable_tls: trueelastic_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

    • Wenweih/btc-chaindata-2es
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.