-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pin command arg are now addresses, launchLander takes an orbiter address
- Loading branch information
Showing
10 changed files
with
55 additions
and
88 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
const defaultFilter = () => true | ||
import { peerIdFromString } from '@libp2p/peer-id' | ||
|
||
const connectIpfsNodes = async (ipfs1, ipfs2, options = { | ||
filter: defaultFilter | ||
}) => { | ||
await ipfs2.libp2p.peerStore.save(ipfs1.libp2p.peerId, { multiaddrs: ipfs1.libp2p.getMultiaddrs().filter(options.filter) }) | ||
await ipfs2.libp2p.dial(ipfs1.libp2p.peerId) | ||
const connectIpfsNodes = async (ipfs, peerAddress) => { | ||
const peerId = peerIdFromString(peerAddress.getPeerId()) | ||
await ipfs.libp2p.peerStore.save(peerId, { multiaddrs: [peerAddress] }) | ||
await ipfs.libp2p.dial(peerId) | ||
} | ||
|
||
export default connectIpfsNodes |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
export const createPins = async (howMany, lander) => { | ||
const dbs = [] | ||
const addresses = [] | ||
|
||
for (let i = 1; i <= howMany; i++) { | ||
dbs.push(await lander.orbitdb.open(`db${i}`)) | ||
const db = await lander.orbitdb.open(`db${i}`) | ||
addresses.push(db.address) | ||
} | ||
|
||
const pinned = await lander.pin(dbs) | ||
const pinned = await lander.pin(addresses) | ||
|
||
return { pinned, dbs } | ||
return { pinned, addresses } | ||
} |
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