Skip to content

Commit

Permalink
Merge pull request #57 from orbs-network/censor_config
Browse files Browse the repository at this point in the history
Censor config
  • Loading branch information
idan-orbs authored May 15, 2023
2 parents 8e1dfd8 + a804ec7 commit d614244
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
with:
node-version: 16
- name: setup-docker
uses: docker-practice/actions-setup-docker@1.0.11
uses: docker-practice/actions-setup-docker@master
- run: node --version
- run: npm --version
- run: docker --version
Expand All @@ -45,7 +45,7 @@ jobs:
with:
node-version: 16
- name: setup-docker
uses: docker-practice/actions-setup-docker@1.0.11
uses: docker-practice/actions-setup-docker@master
- run: ./boyar/create-version-file.sh
- name: Run npm install
run: npm install
Expand Down
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ import {
sendEthereumVoteUnreadyTransaction,
} from './write/ethereum';

export async function runLoop(config: Configuration) {
export async function runLoop(config: Configuration, censoredConfig: Configuration) {
// TODO: Yuval- contracts addresses are not updated in case of RegistryChange
const state = await initializeState(config);
// initialize status.json to make sure healthcheck passes from now on
writeStatusToDisk(config.StatusJsonPath, state, config);
writeStatusToDisk(config.StatusJsonPath, state, censoredConfig);

for (;;) {
try {
Expand All @@ -38,13 +38,13 @@ export async function runLoop(config: Configuration) {
await runLoopTick(config, state);

// write status.json file, we don't mind doing this often (2min)
writeStatusToDisk(config.StatusJsonPath, state, config);
writeStatusToDisk(config.StatusJsonPath, state, censoredConfig);
} catch (err) {
Logger.log('Exception thrown during runLoop, going back to sleep:');
Logger.error(err.stack);

// always write status.json file (and pass the error)
writeStatusToDisk(config.StatusJsonPath, state, config, err);
writeStatusToDisk(config.StatusJsonPath, state, censoredConfig, err);
}
}
}
Expand Down
6 changes: 4 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ process.on('SIGINT', function () {

Logger.log('Service ethereum-writer started.');
const config = parseArgs(process.argv);
Logger.log(`Input config: '${JSON.stringify(config)}'.`);
const censoredConfig = Object.assign({}, config);
censoredConfig.EthereumEndpoint = censoredConfig.EthereumEndpoint.slice(0, -10) + "**********"
Logger.log(`Input config: '${JSON.stringify(censoredConfig)}'.`);

runLoop(config).catch((err) => {
runLoop(config, censoredConfig).catch((err) => {
Logger.log('Exception thrown from runLoop, shutting down:');
Logger.error(err.stack);
process.exit(128);
Expand Down

0 comments on commit d614244

Please sign in to comment.