Our API requires the following environment variables to be stored in a .env file in the root directory. Contact a team member for sane defaults.
SESSION_SECRET: String for hashing passwords
SERVICE_SECRET: String for hashing passwords
SALE_FACTORY_ADDRESS: Address of the deployed Token Sale Factory Contract
PURCHASE_FACTORY_ADDRESS: Address of the deployed Token Purchase Factory Contract
INFURA_PROJECT_ID: API Key for the Infura Blockchain connection
S3_BUCKET: Name of the S3 buckets for documents
S3_ENDPOINT: For prod, this should be set to
img.meridio.co, for all other environments should be set to
AWS_ACCESS_KEY_ID: AWS Key ID for S3 bucket
AWS_SECRET_ACCESS_KEY: AWS Key for S3 bucket
MAILGUN_API_KEY: API for email sending
STREAM_API_KEY: Stream Key for notifications
STREAM_API_SECRET: Stream Secret
STREAM_API_APP_ID: Stream App ID
ON_BOARDING_SECRET: hashing for registration tokens
EMAIL_VERIFICATION_SECRET: hashing email verification tokens
POSTGRES_HOST: Hostname of your PostgresDB
POSTGRES_PW: Password pw
POSTGRES_DB: DB name
REDIS_PORT: (optional) Port to connect to Redis, defaults to
REDIS_HOST: (optional) Hostname of your Redis, defaults to
REDIS_PASSWORD: (optional) Password to connect to Redis, defaults to
SENTRY_KEY: (optional) Currently only reports uncaught errors
BLOCKCHAIN_ENV: Currently supporting rinkeby, ropsten, mainnet, ganache
USER_EMAIL: If you'd like to prepopulate your user's wallet address, enter in your email address here.
USER_EMAILis found, this address hash will be added as a wallet for that user.
BLOCKCHAIN_SERVICE: local blockchain service
SEQUELIZE_TIMEOUT: (optional) SQL statement timeout (ms) override (default: 5000)
SEQUELIZE_LOGGING: (optional) SQL logging options override (0 or 1, default 0, no sql logging);
HTTP_LOGGING: (optional) Add apache style http logging via Morgan - always on in development environments (0 or 1 when deployed, default 0, no http logging);
To bring up the entire Meridio Application locally, run the following command:
npm run containers:full
The first time you run the application you must first build the images with the following command:
Subsequent launches only require docker-compose up command.
To run the application locally without docker, execute the following command:
npm run api-dev
To simulate our production environment we use containers in development as well, reloading the application every time changes are detected in the the
npm run containers:watch
Similarly to the application hot reloading in the previous section, the following command will automatically rerun the test suite when it detects code changes.
npm run test:containers:watch
To simulate a single run through the test suite use the following command.
npm run test:containers
To test locally run the following command:
npm run test
We use postman for teams for testing our API directly. For access to our library of prewritten tests, use the following link.
truffle migrate --network development --reset