Skip to content
This repository was archived by the owner on Jun 14, 2024. It is now read-only.

Commit f371757

Browse files
committed
stop recovering addresses from the filesystem for consistency
1 parent 94788cc commit f371757

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

api/run.js

+1-9
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
const runApp = require('./src/app')
44
const logger = require('./src/logger')
55
const config = require('config')
6-
const { join } = require('path')
7-
const { existsSync } = require('fs')
86

97
const NODE_ENV = config.get('NODE_ENV')
108
const PORT = config.get('PORT')
@@ -15,12 +13,7 @@ const loadCtrAddresses = () => {
1513
let contractAddresses = process.env.CONTRACT_ADDRESSES
1614

1715
if (!contractAddresses) {
18-
const contractAddressesPath = join(__dirname, './contracts/contractAddresses.json')
19-
if (existsSync(contractAddressesPath)) {
20-
contractAddresses = require(contractAddressesPath)
21-
} else {
22-
throw new Error('API: could not recover addresses from the environment or from files')
23-
}
16+
throw new Error('API: could not recover addresses from the environment variable $CONTRACT_ADDRESSES')
2417
} else {
2518
contractAddresses = JSON.parse(contractAddresses)
2619
}
@@ -30,7 +23,6 @@ const loadCtrAddresses = () => {
3023

3124
;(() => {
3225
try {
33-
// TODO: Validate contarct setup
3426
const contractAddresses = loadCtrAddresses()
3527

3628
runApp(contractAddresses)

0 commit comments

Comments
 (0)