Skip to content

Instantly share code, notes, and snippets.

View ptoner's full-sized avatar

Patrick Toner ptoner

View GitHub Profile
//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)
//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
@ptoner
ptoner / test.js
Last active September 30, 2019 04:22
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: {
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({
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({
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,