forked from cerc-io/ipld-eth-server
.. | ||
rinkeby | ||
continuousLogSync-service | ||
lightSync-service | ||
README.md | ||
startup_script.sh |
S
Dockerfile
will build an alpine image containing:
- vDB as a binary with runtime deps statically linked:
/app/vulcanizedb
- The migration tool goose:
/app/goose
- Two services for running
lightSync
andcontinuousLogSync
, started with the default configurationenvironments/staging.toml
.
By default, vDB is configured towards the Kovan deploy. The configuration values can be overridden using environment variables, using the same hierarchical naming pattern but in CAPS and using underscores. For example, the contract address for the Pit
can be set with the variable CONTRACT_ADDRESS_PIT="0x123..."
.
To use the container:
- Setup a postgres database with owner
vulcanize
vulcanize
does not have to be owner, but otherwise permissions for connection, tables, and sequences need to be added for thepublic
andmaker
schemas manually when the migrations have been run.
- Set the env variables
DATABASE_NAME
,DATABASE_HOSTNAME
,DATABASE_PORT
,DATABASE_USER
&DATABASE_PASSWORD
- Run the DB migrations:
./goose postgres "postgresql://$(DATABASE_USER):$(DATABASE_PASSWORD)@$(DATABASE_HOSTNAME):$(DATABASE_PORT)/$(DATABASE_NAME)?sslmode=disable" e
- Set
CLIENT_IPCPATH
to a node endpoint - Set the contract variables:
CONTRACT_ADDRESS_[CONTRACT NAME]=0x123...
CONTRACT_ABI_[CONTRACT NAME]="ABI STRING"
CONTRACT_DEPLOYMENT-BLOCK_[CONTRACT NAME]=0
(doesn't really matter on a short chain, just avoids long unnecessary searching)
- Start the
lightSync
andcontinuousLogSync
services:
rc-service lightSync start
rc-service continuousLogSync start
Automated
The steps above have been rolled into a script: /app/startup_script.sh
, which just assumes the DB env variables have been set, and defaults the rest to Kovan according to environments/staging.toml
.
Logging
When running, vDB services log to /vulcanizedb.log
.