Skip to content

Instantly share code, notes, and snippets.

Avatar

Topper Bowers tobowers

View GitHub Profile
@tobowers
tobowers / index.ts
Created Jan 31, 2020
Multi-step ownership transfer
View index.ts
#!/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,
View working.ts
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()
View p2p.js
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')
View gist:ce78d57ffb38525aec7ca4b64f5afcc3
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')
View indycrypto.js
/* 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];
View main.go
package main
import (
"bytes"
"context"
"fmt"
"io/ioutil"
"log"
"github.com/ipsn/go-ipfs/core"
View atlas_test.go
package serialization
import (
"github.com/polydawn/refmt/obj/atlas"
"testing"
"time"
"github.com/polydawn/refmt/cbor"
"github.com/stretchr/testify/assert"
)
View marshaled-fixed.go
package main
import (
"log"
"crypto/rand"
"crypto/rsa"
"golang.org/x/crypto/ssh"
)
func main() {
@tobowers
tobowers / marshal.go
Created Aug 17, 2017
golang errors when just marshaling and then unmarshaling
View marshal.go
package main
import (
"log"
"crypto/rand"
"crypto/rsa"
"golang.org/x/crypto/ssh"
)
func main() {
View keybase.md

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:

You can’t perform that action at this time.