This repository is used to deploy all the contracts and migrate configuration and seed data for the Origin project of the Energy Web Foundation.
Command line options:
-c, --config <config_file_path> path to the config file
-s, --seed-file <seed_sql_path> path to the SQL file that will be used for seeding the database
-e, --env <env_file_path> path to the .env file or system variables when not set
In a development mode use:
yarn start <options>
WEB3
- web3 endpoint urlDEPLOY_KEY
- private key to be used for smart contracts deploymentDATABASE_URL
- formatted aspostgresql://[user[:password]@][netloc][:port][/dbname][?param1=value1&...]
- has precedence over DB_HOST, DB_PORT, DB_USERNAME, DB_PASSWORD, DB_DATABASEDB_HOST, DB_PORT, DB_USERNAME, DB_PASSWORD, DB_DATABASE
- database connection details
Note: When no DATABASE_URL
and DB_HOST, DB_PORT, DB_USERNAME, DB_PASSWORD, DB_DATABASE
provided, the migration program will default to:
DB_HOST = 'localhost'
DB_PORT = 5432
DB_USERNAME = 'postgres'
DB_PASSWORD = 'postgres'
DB_DATABASE = 'origin'
Migrations program will read the .env
file and process.env
by default, this location of .env
file can be specified using -e
switch
Migrations project requires the database schema and tables to be migrated before.
Migrations will check the existence of the configuration tables in the provided database connection parameters. Process will perform:
- deploy issuer and registry contracts from
@energyweb/issuer
package - stores initial configuration from provided
-c
JSON file path - stores the demo/seed data from provided -s sql file