From d3aed38114877ebc040f1677fc0f7a7511b5d674 Mon Sep 17 00:00:00 2001 From: ffsockets <48462819+ffsockets@users.noreply.github.com> Date: Fri, 12 Apr 2019 15:30:01 +0800 Subject: [PATCH] Create db-config.js --- db-config.js | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 db-config.js diff --git a/db-config.js b/db-config.js new file mode 100644 index 0000000..a6227e4 --- /dev/null +++ b/db-config.js @@ -0,0 +1,34 @@ +'use strict' + +const path = require('path') + +const defaultOrbitDbDir = './heroNodeDb' + +const conf = { + repo: process.env.IPFS_PATH || path.join(defaultHeroNodeDbDir, '/ipfs'), + start: false, + EXPERIMENTAL: { + pubsub: true, + }, + config: { + Addresses: { + API: '/ip4/127.0.0.1/tcp/0', + Gateway: '/ip4/0.0.0.0/tcp/0', + Swarm: [ + '/ip4/0.0.0.0/tcp/0', + // '/dns4/ws-star.discovery.libp2p.io/tcp/443/wss/p2p-websocket-star', + ], + }, + }, + Discovery: { + MDNS: { + Enabled: true, + Interval: 1, + }, + }, +} + +module.exports = { + defaultDatabaseDir: defaultOrbitDbDir, + ipfsConfig: conf, +}