Add instructions for creating the database and the initial table

This commit is contained in:
Eric Meyer 2017-10-25 10:05:29 -05:00
parent 3438c5f256
commit 99c3003ba8
3 changed files with 18 additions and 0 deletions

View File

@ -7,6 +7,8 @@
### Dependencies
- Go 1.9+
- https://github.com/golang/dep
- Postgres 10
### Cloning the Repository
@ -18,6 +20,17 @@
- 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.

View File

@ -0,0 +1 @@
DROP TABLE public.blocks

View File

@ -0,0 +1,4 @@
CREATE TABLE public.blocks
(
block_number BIGINT
)