Updates to README

- update configuration section
- remove creating and migrating the db as a prerequisite for running test - it doesn't seem to be necessary
- add a public.toml.example config file to be copied and updated locally
This commit is contained in:
Elizabeth Engelman 2018-04-09 11:51:21 -05:00
parent edf3dbe00c
commit ba9efc2be0
2 changed files with 36 additions and 29 deletions

View File

@ -2,55 +2,55 @@
[![Build Status](https://travis-ci.org/vulcanize/VulcanizeDB.svg?branch=master)](https://travis-ci.org/vulcanize/VulcanizeDB) [![Build Status](https://travis-ci.org/vulcanize/VulcanizeDB.svg?branch=master)](https://travis-ci.org/vulcanize/VulcanizeDB)
### Dependencies ## Dependencies
- Go 1.9+ - Go 1.9+
- Postgres 10 - Postgres 10
- Ethereum Node - Ethereum Node
- [Go Ethereum](https://ethereum.github.io/go-ethereum/downloads/) (1.8+) - [Go Ethereum](https://ethereum.github.io/go-ethereum/downloads/) (1.8+)
- [Parity 1.8.11+](https://github.com/paritytech/parity/releases) - [Parity 1.8.11+](https://github.com/paritytech/parity/releases)
### Installation ## Installation
`go get github.com/vulcanize/vulcanizedb` `go get github.com/vulcanize/vulcanizedb`
### Setting up the Databases ## Setting up the Database
1. Install Postgres 1. Install Postgres
1. Create a superuser for yourself and make sure `psql --list` works without prompting for a password. 1. Create a superuser for yourself and make sure `psql --list` works without prompting for a password.
1. `createdb vulcanize_private` 1. `createdb vulcanize_public`
1. `cd $GOPATH/src/github.com/vulcanize/vulcanizedb` 1. `cd $GOPATH/src/github.com/vulcanize/vulcanizedb`
1. Import the schema: `psql vulcanize_private < db/schema.sql` 1. Import the schema: `psql vulcanize_public < db/schema.sql`
or run the migrations: `make migrate HOST_NAME=localhost NAME=vulcanize_public PORT=5432` or run the migrations: `make migrate HOST_NAME=localhost NAME=vulcanize_public PORT=5432`
* See below for configuring additional environments * See below for configuring additional environments
### IPC File Paths ## Configuration
- To use a local Ethereum node, copy `environments/public.toml.example` to
`environments/public.toml` and update the `ipcPath` to 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`
The default location for Ethereum is: - when using parity:
- `$HOME/Library/Ethereum` for Mac - The IPC file is called `jsonrpc.ipc`.
- `$HOME/.ethereum` for Ubuntu - The default location is:
- `$GOPATH/src/gihub.com/vulcanize/vulcanizedb/test_data_dir/geth.ipc` for private node. - Mac: `$HOME/Library/Application\ Support/io.parity.ethereum/`
- Linux: `$HOME/.local/share/io.parity.ethereum/`
**Note the location of the ipc file is printed to the console when you start geth. It is needed to for configuration** - `environments/infura.toml` can be used to run commands with a full
archive node, rather than a local quick sync node.
## Start syncing with postgres ## Start syncing with postgres
1. Start geth node (**if fast syncing wait for geth to finsh initial sync**) Syncs VulcanizeDB with the configured Ethereum node.
1. Start node (**if fast syncing wait for initial sync to finish**)
1. In a separate terminal start vulcanize_db 1. In a separate terminal start vulcanize_db
- `vulcanizedb sync --config <config.toml> --starting-block-number <block-number>` - `vulcanizedb sync --config <config.toml> --starting-block-number <block-number>`
* see `./environments` for example config
## Running the Tests ## Running the Tests
### Unit Tests ### Unit Tests
- `go test ./pkg/...`
1. `go test ./pkg/...` ### Integration Tests
- `go test ./...` to run all tests.
### Integration Test
1. Setup a test database and import the schema:
`createdb vulcanize_private`
`psql vulcanize_private < db/schema.sql`
1. `go test ./...` to run all tests.

View File

@ -0,0 +1,7 @@
[database]
name = "vulcanize_public"
hostname = "localhost"
port = 5432
[client]
ipcPath = <local node's IPC filepath>