GithubHelp home page GithubHelp logo

lubyruffy / vulcanizedb Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vulcanize/vulcanizedb

0.0 1.0 0.0 19.24 MB

License: Apache License 2.0

Makefile 0.97% Go 94.90% PLpgSQL 3.76% PLSQL 0.02% Shell 0.34%

vulcanizedb's Introduction

Vulcanize DB

Join the chat at https://gitter.im/vulcanizeio/VulcanizeDB

Build Status

Dependencies

Installation

go get github.com/vulcanize/vulcanizedb

Setting up the Database

  1. Install Postgres

  2. Create a superuser for yourself and make sure psql --list works without prompting for a password.

  3. createdb vulcanize_public

  4. cd $GOPATH/src/github.com/vulcanize/vulcanizedb

  5. Run the migrations: make migrate HOST_NAME=localhost NAME=vulcanize_public PORT=5432

    • See below for configuring additional environments

Configuration

  • To use a local Ethereum node, copy environments/public.toml.example to environments/public.toml and update the ipcPath and levelDbPath.

    • ipcPath should match the local node's IPC filepath:

      • when using geth:

        • The IPC file is called geth.ipc.
        • The geth IPC file path is printed to the console when you start geth.
        • The default location is:
          • Mac: $HOME/Library/Ethereum
          • Linux: $HOME/.ethereum
      • when using parity:

        • The IPC file is called jsonrpc.ipc.
        • The default location is:
          • Mac: $HOME/Library/Application\ Support/io.parity.ethereum/
          • Linux: $HOME/.local/share/io.parity.ethereum/
    • levelDbPath should match Geth's chaindata directory path.

      • The geth LevelDB chaindata path is printed to the console when you start geth.
      • The default location is:
        • Mac: $HOME/Library/Ethereum/geth/chaindata
        • Linux: $HOME/.ethereum/geth/chaindata
      • levelDbPath is irrelevant (and coldImport is currently unavailable) if only running parity.
  • See environments/infura.toml to configure commands to run against infura, if a local node is unavailable

Start syncing with postgres

Syncs VulcanizeDB with the configured Ethereum node.

  1. Start node (if fast syncing wait for initial sync to finish)
  2. In a separate terminal start vulcanize_db
    • ./vulcanizedb sync --config <config.toml> --starting-block-number <block-number>

Alternatively, sync from Geth's underlying LevelDB

Sync VulcanizeDB from the LevelDB underlying a Geth node.

  1. Assure node is not running, and that it has synced to the desired block height.
  2. Start vulcanize_db
    • ./vulcanizedb coldImport --config <config.toml> --starting-block-number <block-number> --ending-block-number <block-number>
  3. Optional flags:
    • --starting-block-number/-s: block number to start syncing from
    • --ending-block-number/-e: block number to sync to
    • --all/-a: sync all missing blocks

Running the Tests

Unit Tests

  • go test ./pkg/...

Integration Tests

  • go test ./... to run all tests.

vulcanizedb's People

Contributors

afdudley avatar elizabethengelman avatar gitter-badger avatar mkrump avatar rmulhol avatar

Watchers

 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.