Skip to content
Draft
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: 7 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@
if (config.httpCertPath && config.httpKeyPath) {
try {
const options = {
cert: fs.readFileSync(config.httpCertPath),

Check warning on line 199 in src/index.ts

View workflow job for this annotation

GitHub Actions / lint

Found readFileSync from package "fs" with non literal argument at index 0
key: fs.readFileSync(config.httpKeyPath)
}
https.createServer(options, app).listen(config.httpPort, () => {
Expand All @@ -218,3 +218,10 @@
// Call the function to schedule the cron job to delete old logs
scheduleCronJobs(oceanNode)
}

process.on('unhandledRejection', (reason) => {
console.log({ reason })
})
process.on('uncaughtException', (reason) => {
console.log({ reason })
})
13 changes: 12 additions & 1 deletion src/test/unit/download.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { AssetUtils, isConfidentialChainDDO } from '../../utils/asset.js'
import { DEVELOPMENT_CHAIN_ID, KNOWN_CONFIDENTIAL_EVMS } from '../../utils/address.js'
import { DDO } from '@oceanprotocol/ddo-js'
import { Wallet, ethers } from 'ethers'
import { KeyManager } from '../../components/KeyManager/index.js'

let envOverrides: OverrideEnvConfig[]
let config: OceanNodeConfig
Expand All @@ -35,8 +36,18 @@ describe('Should validate files structure for download', () => {
)
envOverrides = await setupEnvironment(TEST_ENV_CONFIG_FILE, envOverrides)
config = await getConfiguration(true)
const keyManager = new KeyManager(config)
db = await Database.init(config.dbConfig)
oceanNode = OceanNode.getInstance(config, db)
oceanNode = OceanNode.getInstance(
config,
db,
null,
null,
null,
keyManager,
null,
true
)
consumerAccount = new Wallet(process.env.PRIVATE_KEY)
})

Expand Down
Loading