Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,9 @@ typings/
.serverless

# FuseBox cache
.fusebox/src/config/fresh.js
.fusebox/
src/config/fresh.js

# PM2 process definition: holds the production DB password in plaintext.
# Use ecosystem.config.example.js as the template.
ecosystem.config.js
50 changes: 50 additions & 0 deletions ecosystem.config.example.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// PM2 process definition for the production event-source indexer.
//
// Copy this to `ecosystem.config.js` ON THE SERVER and fill in the real values.
// The real file is intentionally NOT tracked: it holds the production database
// password in plaintext. It is also the only copy that exists, so if you change
// it, back it up off-box as well (see "Backups" below).
//
// cp ecosystem.config.example.js ecosystem.config.js
// $EDITOR ecosystem.config.js
// pm2 restart event-source --update-env
//
// Every value below is read by src/config/prod.js straight off process.env, so
// the names here must match that file exactly.
//
// Backups: the live file lives at
// /home/ubuntu/apps/event-source/ecosystem.config.js
// on app.cambiatus.io. Keep a copy somewhere private and chmod 600 — losing it
// means reconstructing the DB credentials by hand.

module.exports = {
apps: [
{
name: 'event-source',
time: true,
script: 'src/app.js',
watch: false,
exec_mode: 'fork',
autorestart: true,
env: {
NODE_ENV: 'prod',

// Chain
BLOCKCHAIN_INIT_BLOCK: '60000000',
BLOCKCHAIN_TOKEN_CONTRACT: 'cambiatus.tk',
BLOCKCHAIN_COMMUNITY_CONTRACT: 'cambiatus.cm',
// Optional: src/config/prod.js defaults it to cambiatus.es when unset.
BLOCKCHAIN_ESCROW_CONTRACT: 'cambiatus.es',
BLOCKCHAIN_URL: 'https://<nodeos-host>',

// Database — same Postgres the backend writes to.
DB_USER: '<user>',
DB_PASS: '<password>',
DB_HOST: '<rds-endpoint>',
DB_NAME: '<database>',

EVENT_SOURCE_HTTP_PORT: 3001
}
}
]
}
Loading