Server backend for indexed ETH IPLD objects
Go to file
2017-11-06 11:25:58 -06:00
blockchain_listener Refactor DB observer to depend on repository 2017-11-06 11:25:58 -06:00
config Update to use TOML config 2017-11-03 11:53:31 -05:00
core Merge pull request #49 from 8thlight/add_block_fields 2017-11-03 16:53:31 -05:00
fakes Refactor DB observer to depend on repository 2017-11-06 11:25:58 -06:00
geth Merge pull request #49 from 8thlight/add_block_fields 2017-11-03 16:53:31 -05:00
Gododir Refactor DB observer to depend on repository 2017-11-06 11:25:58 -06:00
integration_test Refactor DB observer to depend on repository 2017-11-06 11:25:58 -06:00
migrations Add fields to block tables 2017-11-03 09:56:24 -05:00
observers Refactor DB observer to depend on repository 2017-11-06 11:25:58 -06:00
repositories Refactor DB observer to depend on repository 2017-11-06 11:25:58 -06:00
scripts Add the concept of multiple environments 2017-11-01 12:15:55 -05:00
.gitignore Ignore non-private environments 2017-11-03 16:37:17 -05:00
.private_blockchain_password Add integration test 2017-10-24 15:36:50 -05:00
.travis.yml Reorganize files into separate packages 2017-11-02 15:07:38 -05:00
Gopkg.lock Update to use TOML config 2017-11-03 11:53:31 -05:00
Gopkg.toml Add BlockchainDBObserver 2017-10-25 15:57:05 -05:00
README.md Update README to account for environment based changes 2017-11-03 16:52:19 -05:00

Vulcanize DB

Build Status

Development Setup

Dependencies

Cloning the Repository

  1. git config --global url."git@github.com:".insteadOf "https://github.com/"
    • By default, go get does not work for private GitHub repos. This will fix that.
  2. go get github.com/8thlight/vulcanizedb
  3. go get github.com/ethereum/go-ethereum
    • This will take a while and gives poor indication of progress.
  4. go install github.com/ethereum/go-ethereum/cmd/geth
  5. cd $GOPATH/src/github.com/8thlight/vulcanizedb
  6. dep ensure

Setting up the Databases

  1. Install Postgres
  2. Create a superuser for yourself and make sure psql --list works without prompting for a password.
  3. go get -u -d github.com/mattes/migrate/cli github.com/lib/pq
  4. go build -tags 'postgres' -o /usr/local/bin/migrate github.com/mattes/migrate/cli
  5. createdb vulcanize_private
  6. cd $GOPATH/src/github.com/8thlight/vulcanizedb
  7. godo migrate -- --environment=<some-environment>
    • See below for configuring additional environments

Adding a new migration: ./scripts/create_migration <migration-name>

Creating/Using a Private Blockchain

Syncing the public blockchain takes many hours for the initial sync and will download 20+ GB of data. Here are some instructions for creating a private blockchain that does not depend on having a network connection.

  1. Run ./scripts/setup to create a private blockchain with a new account.
    • This will result in a warning.
  2. Run ./scripts/start_private_blockchain.
  3. Run godo run -- --environment=private to start listener.

Connecting to the Public Blockchain

./scripts/start_blockchain

IPC File Paths

The default location for Ethereum is:

  • $HOME/Library/Ethereum for Mac
  • $HOME/.ethereum for Ubuntu
  • $GOPATH/src/gihub.com/8thlight/vulcanizedb/test_data_dir/geth.ipc for private blockchain.

Note the location of the ipc file is outputted when you connect to a blockchain. It is needed to for configuration

Running Listener

  1. Start a blockchain.
  2. In a separate terminal start listener (ipcDir location)
    • godo run -- --environment=<some-environment>

Configuring Additional Environments

You can create configuration files for additional environments.

  • Among other things, it will require the IPC file path
  • See config/environments/private.toml for an example
  • You will need to do this if you want to run a node connecting to the public blockchain

Running the Tests

Integration Test

In order to run the integration tests, you will need to run them against a real blockchain.

  1. Run ./scripts/start_private_blockchain as a separate process.
  2. go test ./...

Unit Tests

  1. go test ./core