mirror of https://gitlab.com/ecentrics/concordia
Apostolos Fanakis
4 years ago
3 changed files with 26 additions and 18 deletions
@ -1,4 +1,5 @@ |
|||||
import path from 'path'; |
import path from 'path'; |
||||
|
|
||||
export const ORBIT_DIRECTORY_DEFAULT = path.join(__dirname, '..', 'orbitdb'); |
export const ORBIT_DIRECTORY_DEFAULT = path.join(__dirname, '..', 'orbitdb'); |
||||
|
export const IPFS_DIRECTORY_DEFAULT = path.join(__dirname, '..', 'ipfs'); |
||||
export const LOGS_PATH = path.join(__dirname, '..', 'logs'); |
export const LOGS_PATH = path.join(__dirname, '..', 'logs'); |
||||
|
@ -1,30 +1,36 @@ |
|||||
import getLibp2pBundle from './libp2pBundle'; |
import getLibp2pBundle from './libp2pBundle'; |
||||
import { getSwarmAddresses } from '../utils/ipfsUtils'; |
import { getSwarmAddresses } from '../utils/ipfsUtils'; |
||||
import { logger } from '../utils/logger'; |
import { logger } from '../utils/logger'; |
||||
|
import { IPFS_DIRECTORY_DEFAULT } from '../constants'; |
||||
|
|
||||
const getIpfsOptions = async () => getSwarmAddresses() |
const getIpfsOptions = async () => getSwarmAddresses() |
||||
.then((swarmAddresses) => { |
.then((swarmAddresses) => { |
||||
logger.info(`Swarm addresses used: ${swarmAddresses.join(', ')}`); |
logger.info(`Swarm addresses used: ${swarmAddresses.join(', ')}`); |
||||
return swarmAddresses; |
return swarmAddresses; |
||||
}) |
}) |
||||
.then((swarmAddresses) => ({ |
.then((swarmAddresses) => { |
||||
repo: 'ipfs', |
const IPFS_DIRECTORY = process.env.IPFS_DIRECTORY || IPFS_DIRECTORY_DEFAULT; |
||||
config: { |
logger.info(`Setting up IPFS in repo: ${IPFS_DIRECTORY}`); |
||||
Profile: 'server', |
|
||||
Addresses: { |
return ({ |
||||
Swarm: swarmAddresses, |
repo: IPFS_DIRECTORY, |
||||
|
config: { |
||||
|
Profile: 'server', |
||||
|
Addresses: { |
||||
|
Swarm: swarmAddresses, |
||||
|
}, |
||||
|
}, |
||||
|
libp2p: getLibp2pBundle(swarmAddresses), |
||||
|
EXPERIMENTAL: { |
||||
|
pubsub: true, |
||||
|
}, |
||||
|
preload: { |
||||
|
enabled: false, |
||||
|
}, |
||||
|
init: { |
||||
|
emptyRepo: true, |
||||
}, |
}, |
||||
}, |
}); |
||||
libp2p: getLibp2pBundle(swarmAddresses), |
}); |
||||
EXPERIMENTAL: { |
|
||||
pubsub: true, |
|
||||
}, |
|
||||
preload: { |
|
||||
enabled: false, |
|
||||
}, |
|
||||
init: { |
|
||||
emptyRepo: true, |
|
||||
}, |
|
||||
})); |
|
||||
|
|
||||
export default getIpfsOptions; |
export default getIpfsOptions; |
||||
|
Loading…
Reference in new issue