Server backend for indexed ETH IPLD objects
462f94d84a
- Allows us to fetch receipts by block and persist even when associated transaction is unknown. (The associated transaction can still be derived from the tx_hash column at query time, but is an expensive operation to require for inserts). |
||
---|---|---|
cmd | ||
db | ||
environments | ||
integration_test | ||
libraries/shared | ||
pkg | ||
scripts | ||
test_config | ||
utils | ||
vendor | ||
.gitignore | ||
.private_blockchain_password | ||
.travis.yml | ||
Gopkg.lock | ||
Gopkg.toml | ||
LICENSE | ||
main.go | ||
Makefile | ||
README.md |
Vulcanize DB
Dependencies
- Go 1.9+
- Postgres 10
- Ethereum Node
- Go Ethereum (1.8+)
- Parity 1.8.11+
Installation
go get github.com/vulcanize/vulcanizedb
Setting up the Database
-
Install Postgres
-
Create a superuser for yourself and make sure
psql --list
works without prompting for a password. -
createdb vulcanize_public
-
cd $GOPATH/src/github.com/vulcanize/vulcanizedb
-
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
toenvironments/public.toml
and update theipcPath
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
- Mac:
- The IPC file is called
-
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/
- Mac:
- The IPC file is called
-
-
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.
- Start node (if fast syncing wait for initial sync to finish)
- In a separate terminal start vulcanize_db
vulcanizedb sync --config <config.toml> --starting-block-number <block-number>
Running the Tests
Unit Tests
go test ./pkg/...
Integration Tests
go test ./...
to run all tests.