Skip to content

Instantly share code, notes, and snippets.

View tobowers's full-sized avatar

Topper Bowers tobowers

View GitHub Profile
@tobowers
tobowers / index.ts
Created January 31, 2020 10:25
Multi-step ownership transfer
#!/usr/bin/env ts-node
import assert from 'assert';
import { MemoryDatastore } from 'interface-datastore';
import { ChainTree, EcdsaKey, Community, Repo, setOwnershipTransaction, Tupelo } from 'tupelo-wasm-sdk';
const getRepo = async () => {
const repo = new Repo('test', {
lock: 'memory',
storageBackends: {
root: MemoryDatastore,
import { Community, ChainTree } from 'tupelo-wasm-sdk'
const getBlockchainData = async () => {
console.log('start')
let tipId = 'did:tupelo:0xaD2F7DBB91bf3ab9273D97ff44484fb6205f9772'
let community = await Community.getDefault()
console.log('before next update')
await community.nextUpdate()
const WS = require('libp2p-websockets')
const Multiplex = require('pull-mplex')
const SECIO = require('libp2p-secio')
const Bootstrap = require('libp2p-bootstrap')
const KadDHT = require('libp2p-kad-dht')
const libp2p = require('libp2p')
const mergeOptions = require('merge-options')
const multiaddr = require('multiaddr')
const PeerInfo = require('peer-info')
const libp2p = require('libp2p')
const TCP = require('libp2p-tcp')
const Mplex = require('libp2p-mplex')
const SECIO = require('libp2p-secio')
const DHT = require('libp2p-kad-dht')
const WebRTCStar = require('libp2p-webrtc-star')
const WebSockets = require('libp2p-websockets')
const WebSocketStar = require('libp2p-websocket-star')
const Bootstrap = require('libp2p-bootstrap')
const defaultsDeep = require('@nodeutils/defaults-deep')
/* tslint:disable */
import * as wasm from './indy_crypto_bg';
const stack = [];
const slab = [{ obj: undefined }, { obj: null }, { obj: true }, { obj: false }];
function getObject(idx) {
if ((idx & 1) === 1) {
return stack[idx >> 1];
package main
import (
"bytes"
"context"
"fmt"
"io/ioutil"
"log"
"github.com/ipsn/go-ipfs/core"
package serialization
import (
"github.com/polydawn/refmt/obj/atlas"
"testing"
"time"
"github.com/polydawn/refmt/cbor"
"github.com/stretchr/testify/assert"
)
package main
import (
"log"
"crypto/rand"
"crypto/rsa"
"golang.org/x/crypto/ssh"
)
func main() {
@tobowers
tobowers / marshal.go
Created August 17, 2017 07:54
golang errors when just marshaling and then unmarshaling
package main
import (
"log"
"crypto/rand"
"crypto/rsa"
"golang.org/x/crypto/ssh"
)
func main() {

Keybase proof

I hereby claim:

  • I am tobowers on github.
  • I am tobowers (https://keybase.io/tobowers) on keybase.
  • I have a public key whose fingerprint is 1EF7 3F3E BCBB BBC4 AA97 FFC1 EA4D 8597 EBD8 3F27

To claim this, I am signing this object: