Skip to content

Commit

Permalink
Updated user configuration initialisation for github actions (#1881)
Browse files Browse the repository at this point in the history
* Updated user configuration initialization

* Stopping the execution if we are not able to read from user configuration

* Updated local network setup readme.md file, operational database password added
  • Loading branch information
djordjekovac authored Apr 1, 2022
1 parent baef689 commit a9b73fb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
7 changes: 6 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,18 @@ const defaultConfig = JSON.parse(JSON.stringify(configjson[process.env.NODE_ENV]
config = rc(pjson.name, defaultConfig);

(async () => {
let userConfig = null;
try {
let userConfig = null;
if (process.env.NODE_ENV === 'development' && process.argv.length === 3) {
const configurationFilename = process.argv[2];
userConfig = JSON.parse(fs.readFileSync(process.argv[2]));
userConfig.configFilename = configurationFilename;
}
} catch (error) {
console.log('Unable to read user configuration from file: ', process.argv[2]);
process.exit(1);
}
try {
const node = new OTNode(userConfig);
await node.start();
} catch (e) {
Expand Down
6 changes: 3 additions & 3 deletions tools/local-network-setup/.bootstrap_origintrail_noderc
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"rpcEndpoints": [
"https://rpc-mumbai.maticvigil.com/"
],
"publicKey": "",
"privateKey": ""
"publicKey": "<insert_here>",
"privateKey": "<insert_here>"
}
],
"graphDatabase": {
Expand All @@ -24,4 +24,4 @@
"::1",
"127.0.0.1"
]
}
}
3 changes: 2 additions & 1 deletion tools/local-network-setup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ Quick Start
* You should have ot-node dependencies installed with the `npm install` command
* You should have run db migrations:
* `npx sequelize --config=./config/sequelizeConfig.js db:migrate`
* generate a .env file in the ot-node root folder and add public and private keys for polygon blockchain:
* generate a .env file in the ot-node root folder and add public, private keys for polygon blockchain and operational database password for root user (optional, default password is empty string):
```dotenv
NODE_ENV=development
PUBLIC_KEY=<insert_here>
PRIVATE_KEY=<insert_here>
OPERATIONAL_DB_PASSWORD=<insert_password_here>
```


Expand Down

0 comments on commit a9b73fb

Please sign in to comment.