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, |
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
var assert = require('assert') | |
const OrbitDB = require('orbit-db') | |
const IPFS = require('ipfs') | |
describe('Orbit', function() { | |
it('weird behavior', async function() { | |
const ipfs = await IPFS.create({ |
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
var assert = require('assert') | |
const OrbitDB = require('orbit-db') | |
const IPFS = require('ipfs') | |
describe('Orbit', function() { | |
it('weird behavior', async function() { | |
const ipfs = await IPFS.create({ |
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
var assert = require('assert') | |
const OrbitDB = require('orbit-db') | |
const IPFS = require('ipfs') | |
describe('Orbit', function() { | |
it('should post without needing to call load on the store', async function() { | |
const ipfs = await IPFS.create({ | |
EXPERIMENTAL: { |
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
//Add 100 records to the store | |
for (var i=0; i < 100; i++) { | |
await store.add({content: (i + 10).toString() }) | |
} | |
//Close the store | |
await store.close() | |
//Ok now reopen it |
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 seems to be how ethers wants you to connect to web3. | |
let provider = new ethers.providers.Web3Provider(web3.currentProvider) | |
let signer = provider.getSigner(0) | |
//Ok now I have this signers object...what do I do with it? Orbit seems to want a Wallet instead. | |
//I can't seem to find a way to create the actual "Wallet" object. | |
let keystore = Keystore.create(keypath) |