mirror of
https://github.com/Permissionless-Software-Foundation/bch-dex.git
synced 2026-09-23 01:22:03 -07:00
feat(ipfs): Allowing disabling IPFS features with config flag
This commit is contained in:
@@ -50,7 +50,9 @@ class Adapters {
|
||||
// Start the IPFS node.
|
||||
// Do not start these adapters if this is an e2e test.
|
||||
if (this.config.env !== 'test') {
|
||||
await this.ipfs.start()
|
||||
if (this.config.useIpfs) {
|
||||
await this.ipfs.start()
|
||||
}
|
||||
} else {
|
||||
// These lines are here to ensure code coverage hits 100%.
|
||||
console.log('Not starting IPFS node since this is an e2e test.')
|
||||
|
||||
@@ -6,28 +6,21 @@
|
||||
|
||||
// Public npm libraries.
|
||||
|
||||
// Load the Clean Architecture Adapters library
|
||||
// Local libraries
|
||||
import Adapters from '../adapters/index.js'
|
||||
|
||||
// Load the JSON RPC Controller.
|
||||
import JSONRPC from './json-rpc/index.js'
|
||||
|
||||
// Load the Clean Architecture Use Case libraries.
|
||||
import UseCases from '../use-cases/index.js'
|
||||
|
||||
// const useCases = new UseCases({ adapters })
|
||||
|
||||
// Load the REST API Controllers.
|
||||
import RESTControllers from './rest-api/index.js'
|
||||
|
||||
// Load the time controller library
|
||||
import TimerControllers from './timer-controllers.js'
|
||||
import config from '../../config/index.js'
|
||||
|
||||
class Controllers {
|
||||
constructor (localConfig = {}) {
|
||||
// Encapsulate dependencies
|
||||
this.adapters = new Adapters()
|
||||
this.useCases = new UseCases({ adapters: this.adapters })
|
||||
this.timerControllers = new TimerControllers({ adapters: this.adapters, useCases: this.useCases })
|
||||
this.config = config
|
||||
}
|
||||
|
||||
// Spin up any adapter libraries that have async startup needs.
|
||||
@@ -57,8 +50,10 @@ class Controllers {
|
||||
// Wait for any startup processes to complete for the Adapters libraries.
|
||||
// await this.adapters.start()
|
||||
|
||||
// Attach JSON RPC controllers
|
||||
this.attachRPCControllers()
|
||||
if (this.config.useIpfs) {
|
||||
// Attach JSON RPC controllers
|
||||
this.attachRPCControllers()
|
||||
}
|
||||
|
||||
// Attach and start the timer controllers
|
||||
this.timerControllers.startTimers()
|
||||
|
||||
Reference in New Issue
Block a user