Skip to content

Instantly share code, notes, and snippets.

@dougvk
Created October 29, 2017 16:10
Show Gist options
  • Select an option

  • Save dougvk/1ac2016ecff4c82ba5432c3a007c44d7 to your computer and use it in GitHub Desktop.

Select an option

Save dougvk/1ac2016ecff4c82ba5432c3a007c44d7 to your computer and use it in GitHub Desktop.
script for creating and signing a profile with blockstack.js
// https://npm.runkit.com/blockstack
var blockstack = require("blockstack")
const profileOfDan = {
"@context": "http://schema.org",
"@type": "Person",
"account": [
{
"@type": "Account",
"identifier": "danvk",
"placeholder": false,
"proofType": "http",
"proofUrl": "https://twitter.com/danvk/status/923971323839373312",
"service": "twitter"
},
{
"@type": "Account",
"identifier": "vonkohorn",
"placeholder": false,
"proofType": "http",
"proofUrl": "https://gist.github.com/dougvk/fb0b8fe658012e913d1b8bfebb47fff2",
"service": "github"
}
],
"description": "CEO & President of Wolfram Ventures",
"image": [
{
"@type": "ImageObject",
"contentUrl": "https://pbs.twimg.com/profile_images/839925162858459140/1l3wExmP.jpg",
"name": "avatar"
}
],
"name": "Dan von Kohorn"
}
const profile = new blockstack.Profile(profileOfDan)
const token = profile.toToken("1234hexblahblah")
const tokenFile = [blockstack.wrapProfileToken(token)]
console.log(JSON.stringify(tokenFile))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment