Giter VIP home page Giter VIP logo

explorer's Introduction

Blockchain Explorer

(BTC, LTC, DOGE etc. compatible)

Based off the Bitcoin Core JSON RPC API.

It uses bitcoin's default JSON RPC API, meaning that you need bitcoind / bitcoin-qt running in background with txindex=1 enabled, the explorer will use the data directly from the index, no extra index is added.

Prerequisites

  • redis
  • bitcoin-core (btc, bch, ltc, doge, etc...)

API

This project includes also an API:

API_PATH: http://explorer.example.com/api/

GET /blocks/:block_number

Retrieves block info including all the following fields: block, hash, confirmations, size, height, version, versionHex, merkleroot, time, mediantime, nonce, bits, difficulty, chainwork, nextblockhash

Plus on tx you will get an array containing all the transaction hashes of the transactions included in the block

Few examples:

Genesis block: http://explorer.example.com/api/blocks/0

Pre-fork block: http://explorer.example.com/api/blocks/556765

GET /blocks_latest_num

Gets the latest block number, sample response:

  "block_num": 556766
}

GET /txs/:tx_id

Gets all the information contained in a transaction such as: txid, hash, size, version, locktime and then all the inputs (vin) and outputs (vout).


Local Development Setup

Install Dependencies

bundle

Run

bundle exec rackup

or

rackup

Docker

Build locally:

docker-compose up --build

or, get it from dockerhub:

URL: https://hub.docker.com/r/makevoid/explorer

docker pull makevoid/explorer

docker run -e

Bitcoin Core configuration (bitcoind / bitcoin-qt) (valid for BTC bitcoind, Bitcoin "Core" ABC, Bitcoin "Core" SV)

This is a sample ~/.bitcoin/bitcoin.conf to make sure this explorer can connect and get all the infos from your bitcoind / bitcoin-qt whatever chain is on.

txindex=1
rpcuser=bitcoinrpc
rpcpassword=YOUR_PASSWORD
rpcallowip=YOUR_IP

rpcallowip is used to whitelist IPs, you can have multiple lines for rpcallowip (for example if you have multiple application servers for high/availabilty or horizontal scaling)

Note that for a recent version of BTC bitcoind/bitcoin-qt (bitcoin core) you will need to use rpcauth instead of rpcuser/rcppassword.

explorer's People

Contributors

makevoid avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

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.