Created
February 9, 2021 12:59
-
-
Save ptoner/dcd5d6f72eb9189b92caafd6379cdf04 to your computer and use it in GitHub Desktop.
IPFS setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let config = { | |
libp2p: (opts) => { | |
// Set convenience variables to clearly showcase some of the useful things that are available | |
const peerId = opts.peerId; | |
const bootstrapList = opts.config.Bootstrap; | |
// Build and return our libp2p node | |
return new Libp2p({ | |
peerId, | |
addresses: { | |
listen: [ | |
'/dns4/rocky-sands-15324.herokuapp.com/tcp/443/wss/p2p-webrtc-star/' | |
] | |
}, | |
// Lets limit the connection managers peers and have it check peer health less frequently | |
connectionManager: { | |
minPeers: 25, | |
maxPeers: 100, | |
pollInterval: 5000 | |
}, | |
modules: { | |
transport: [WebrtcStar], | |
streamMuxer: [MPLEX], | |
connEncryption: [NOISE], | |
peerDiscovery: [Bootstrap], | |
dht: KadDHT, | |
pubsub: Gossipsub | |
}, | |
config: { | |
transport: { | |
[WebrtcStar.prototype[Symbol.toStringTag]]: { | |
wrtc | |
} | |
}, | |
peerDiscovery: { | |
autoDial: true, | |
webRTCStar: { | |
enabled: true | |
}, | |
bootstrap: { | |
enabled: true, | |
interval: 30e3, | |
list: bootstrapList | |
} | |
}, | |
relay: { | |
enabled: true, | |
hop: { | |
enabled: true, | |
active: true | |
} | |
}, | |
dht: { | |
enabled: true, | |
randomWalk: { | |
enabled: true, | |
} | |
} | |
} | |
}) | |
}, | |
repo: '../dist/console-repo', | |
EXPERIMENTAL: { | |
pubsub: true | |
}, | |
config: { | |
Addresses: { | |
Swarm: [ | |
'/dns4/rocky-sands-15324.herokuapp.com/tcp/443/wss/p2p-webrtc-star/', | |
// '/dns4/wrtc-star1.par.dwebops.pub/tcp/443/wss/p2p-webrtc-star/', | |
// '/dns4/wrtc-star2.sjc.dwebops.pub/tcp/443/wss/p2p-webrtc-star/', | |
// '/dns4/webrtc-star.discovery.libp2p.io/tcp/443/wss/p2p-webrtc-star/', | |
// '/dns4/libp2p-rdv.vps.revolunet.com/tcp/443/wss/p2p-webrtc-star/' | |
] | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment