Skip to content
This repository was archived by the owner on Dec 19, 2024. It is now read-only.
Prev Previous commit
Next Next commit
applied new orbit guides to store
  • Loading branch information
ArcticSpaceFox committed Oct 2, 2019
commit 5015b081063a43dcddccc86edf1eb059ed8a3436
13 changes: 10 additions & 3 deletions src/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,14 @@ const ipfsConfig = {
Addresses: {
Swarm: [
// Use IPFS dev signal server
'/dns4/star-signal.cloud.ipfs.team/wss/p2p-webrtc-star',
// Websocket:
// '/dns4/ws-star-signal-1.servep2p.com/tcp/443/wss/p2p-websocket-star',
// '/dns4/ws-star-signal-2.servep2p.com/tcp/443/wss/p2p-websocket-star',
'/dns4/ws-star.discovery.libp2p.io/tcp/443/wss/p2p-websocket-star',
// WebRTC:
// '/dns4/star-signal.cloud.ipfs.team/wss/p2p-webrtc-star',
// Use local signal server
// '/ip4/0.0.0.0/tcp/9090/wss/p2p-webrtc-star',
]
},
}
Expand Down Expand Up @@ -37,9 +44,9 @@ const store = async (name) => {
ipfs.on('ready', async () => {
try {
// Create an OrbitDB instance
const orbitdb = new OrbitDB(ipfs)
const orbitdb = await OrbitDB.createInstance(ipfs)
// Open (or create) database
const db = await orbitdb.docs(name, dbConfig)
const db = await orbitdb.docstore(name, dbConfig)
// Done
resolve(db)
} catch (e) {
Expand Down