Skip to content

Files

Latest commit

2a67b8e · Nov 20, 2023

History

History
This branch is 779 commits behind bitpay/bitcore:master.

bitcore-node

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Aug 21, 2020
May 1, 2018
May 18, 2023
Sep 27, 2023
Nov 14, 2023
Oct 27, 2023
May 18, 2018
May 23, 2018
May 23, 2018
Apr 14, 2023
Apr 5, 2018
Dec 21, 2022
Jul 6, 2022
Nov 20, 2023
Nov 20, 2023
Jan 23, 2019
Jan 31, 2023

Bitcore Node

A standardized API to interact with multiple blockchain networks

Currently supporting: Bitcoin, Bitcoin Cash, Litecoin, Dogecoin, Ripple, Ethereum and Polygon

Getting Started

Requirements

  • Trusted P2P Client with an open RPC endpoint
  • MongoDB Server >= v3.4
  • make g++ gcc

Checkout the repo

git clone [email protected]:bitpay/bitcore.git
git checkout master
npm install

Setup Guide

1. Setup Bitcore config

The definition for all the chain configuration can be found in src/types/Config.ts

Example bitcore.config.json
{
  "bitcoreNode": {
    "chains": {
      "BTC": {
        "mainnet": {
          "chainSource": "p2p",
          "trustedPeers": [
            {
              "host": "127.0.0.1",
              "port": 20008
            }
          ],
          "rpc": {
            "host": "127.0.0.1",
            "port": 20009,
            "username": "username",
            "password": "password"
          }
        },
        "regtest": {
          "chainSource": "p2p",
          "trustedPeers": [
            {
              "host": "127.0.0.1",
              "port": 20020
            }
          ],
          "rpc": {
            "host": "127.0.0.1",
            "port": 20021,
            "username": "username",
            "password": "password"
          }
        }
      },
      "BCH": {
        "mainnet": {
          "parentChain": "BTC",
          "forkHeight": 478558,
          "trustedPeers": [
            {
              "host": "127.0.0.1",
              "port": 30008
            }
          ],
          "rpc": {
            "host": "127.0.0.1",
            "port": 30009,
            "username": "username",
            "password": "password"
          }
        },
        "regtest": {
          "chainSource": "p2p",
          "trustedPeers": [
            {
              "host": "127.0.0.1",
              "port": 30020
            }
          ],
          "rpc": {
            "host": "127.0.0.1",
            "port": 30021,
            "username": "username",
            "password": "password"
          }
        }
      }
    }
  }
}

2. Setup Your Blockchain Nodes

Example Bitcoin Mainnet Config
whitelist=127.0.0.1
txindex=0
listen=1
server=1
irc=1
upnp=1

# Make sure port & rpcport matches the
# bitcore.config.json ports for BTC mainnet

# if using Bitcoin Core v0.17+ prefix
# [main]

port=20008
rpcport=20009
rpcallowip=127.0.0.1

rpcuser=username
rpcpassword=password

3. Run Your Blockchain Nodes

Example Starting a Bitcoin Node
# Path to your bitcoin application and path to the config above
/Applications/Bitcoin-Qt.app/Contents/MacOS/Bitcoin-Qt -datadir=/Users/username/blockchains/bitcoin-core/networks/mainnet/

4. Start Bitcore

npm run node

Bitcore will begin using your blockchain nodes to synchronize its own database so that you can use standardized queries to get data from each of your supported blockchains.

API Documentation

Contributing

See CONTRIBUTING.md on the main bitcore repo for information about how to contribute.

License

Code released under the MIT license.

Copyright 2013-2023 BitPay, Inc. Bitcore is a trademark maintained by BitPay, Inc.