Giter VIP home page Giter VIP logo

chainwalkers_bitcoin's Introduction

Chainwalkers Bitcoin Parser

This parser communicates with a Bitcoin node to extract and decode blocks & transactions.

Chainwalkers Framework Docs: docs.flipsidecrypto.com

Getting Started

Create a .secrets.json at the top level directory with a node url. Chainwalkers will use this to communicate with a Bitcoin node's RPC interface.

{
  "NODE_URL": "{protocol}://{username}:{password}@{host}:{port}"
}

Building

A docker image of the Bitcoin chainwalker can be built by running:

bash builder_docker_image.sh

This will create an image with the tag chainwalkers_bitcoin:latest.

Up and Running

This parser has two entry points, each of which writes a json response to stdout.

  1. get_height.sh: returns the current height
  2. parse_blocks.sh [int, int, ...]: returns an array of decoded blocks and each blocks transactions

To get the latest height of the blockchain run:

> docker run chainwalkers_bitcoin:latest bash get_height.sh
{
    "height": 574158
}

To parse a list of blocks run:

> docker run chainwalkers_bitcoin:latest bash parse_blocks.sh 200000 200001 200002
[
    {
        "height": 200000,
        "hash": "000000000000034a7dedef4a161fa058a2d67a173a90155f3a2fe6fc132e0ebf",
        ...,
        "transactions": [
            {
                "id": "",
                "hash": "",
                "vin": [
                    {
                        "prev_output": {...},
                        ...
                    },
                    ...
                ],
                "vout": [...],
                ...
            }
        ],
        ...
    },
    ...
]

Note that each "vin" object include a reference to it's previous output vector. This is required for all UTXO style chains integrating with Chainwalkers (we use bulk RPC calls to make the inclusion of this data as efficient as possible).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.