Giter Site home page Giter Site logo

zh-cool / bitcore Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bitpay/bitcore

0.0 1.0 0.0 59.14 MB

A full stack for bitcoin and blockchain-based applications

Home Page: https://bitcore.io/

License: MIT License

JavaScript 94.83% Dockerfile 0.02% Shell 0.02% TypeScript 4.46% HTML 0.50% Makefile 0.01% CSS 0.17%

bitcore's Introduction

Installing

npm install

Running Bitcore-Node

To run bitcore-node you'll need

  • mongoDB v3.4.11
  • node 8.9.4
  • a valid bitcore.config.json
    • see bitcore-node/README

Alternatively, if you have docker

npm run build
docker-compose up

Services

  • bitcore-node
    • port 3000
  • insight
    • port 8100

Configuring Bitcore Services

Bitcore services can be configured through a bitcore.config.json file

Each service should have it's own namespace in the config

Eg:

{
  bitcoreNode : {},
  insight: {},
  someOtherService: {}
}

Bitcore-Node Config

Bitcore-Node can access a bitcore.config.json file from

  • Environment Variable
    • $BITCORE_CONFIG_PATH=some/path/to/config
  • node arguments
    • --config some/path/to/config
  • ~/bitcore.config.json
  • ${BITCORE_DIR}/bitcore.config.json
  • ${BITCORE_DIR}/packages/bitcore-node/bitcore.config.json

Example Config

{
  "bitcoreNode": {
    "dbHost": "OPTIONAL IP FOR REMOTE DB",
    "pruneSpentScripts": true,
    "chains": {
      "BTC": {
        "mainnet": {
          "chainSource": "p2p",
          "trustedPeers": [
            {
              "host": "127.0.0.1",
              "port": 8333
            }
          ],
          "rpc": {
            "host": "127.0.0.1",
            "port": 44444,
            "username": "RPCUSER",
            "password": "RPCPASS"
          }
        }
      },
      "BCH": {
        "mainnet": {
          "parentChain": "BTC",
          "forkHeight": 478558,
          "trustedPeers": [
            {
              "host": "127.0.0.1",
              "port": 8433
            }
          ]
        }
      }
    }
  }
}

Trusted Peer Environment Variables

Trusted peers can also be added via enviroment variables.

TRUSTED_BTC_REGTEST_PEER=127.0.0.1
TRUSTED_BTC_REGTEST_PEER_PORT=30000

This would accomplish the same thing as adding a peer to the trustedPeers array in the config

Bitcore Wallet

Create a wallet

./bin/wallet-create "testing wallet creation" 1-1 --coin btc --network testnet -f ~/newtestwallet.dat

Register a wallet

./bin/wallet-import

bitcore's People

Contributors

matiu avatar isocolsky avatar maraoz avatar micahriggan avatar nitsujlangston avatar eordano avatar cmgustavo avatar chjj avatar yemel avatar bitjson avatar gasteve avatar braydonf avatar harshitjoshi avatar martindale avatar ryanxcharles avatar illegalprime avatar gabegattis avatar pnagurny avatar gabrielbazan7 avatar olalonde avatar bechi avatar throughnothing avatar dabura667 avatar troggy avatar dskloet avatar rubensayshi avatar fanatid avatar kleetus avatar andrewfhart avatar trevinhofmann avatar

Watchers

austin 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.