Server backend for indexed ETH IPLD objects
Go to file
2017-10-25 10:05:29 -05:00
core Add integration test 2017-10-24 15:36:50 -05:00
fakes Add integration test 2017-10-24 15:36:50 -05:00
integration_test Lower timeout of integration test 2017-10-25 09:02:12 -05:00
migrations Add instructions for creating the database and the initial table 2017-10-25 10:05:29 -05:00
scripts Add start_blockchain script 2017-10-25 08:56:19 -05:00
vendor Add dummy test 2017-10-19 09:22:12 -05:00
.gitignore Add integration test 2017-10-24 15:36:50 -05:00
.private_blockchain_password Add integration test 2017-10-24 15:36:50 -05:00
.travis.yml Add integration test 2017-10-24 15:36:50 -05:00
Gopkg.lock Add dummy test 2017-10-19 09:22:12 -05:00
Gopkg.toml Add dummy test 2017-10-19 09:22:12 -05:00
main.go Pass in IPC path as command line argument 2017-10-23 14:33:08 -05:00
README.md Add instructions for creating the database and the initial table 2017-10-25 10:05:29 -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

Setting up the Development Database

  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
  6. migrate -database 'postgresql://localhost:5432/vulcanize?sslmode=disable' -path ./migrations up

Adding a new migration: migrate -database postgresql://localhost:5432/postgres create -dir ./migrations -ext sql <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.

Connecting to the Public Blockchain

./scripts/start_blockchain

Running Listener

  1. Start a blockchain.
  2. In a separate terminal start listener (ipcDir location)
    • go run main.go --ipcPath /path/to/file.ipc

IPC File Paths

The default location for the Ethereum blockchain to be stored is:

  • $HOME/Library/Ethereum for Mac
  • $HOME/.ethereum for Ubuntu
  • $GOPATH/src/gihub.com/8thlight/vulcanizedb/test_data_dir/geth.ipc for private 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

go test ./core