Skip to content

Instantly share code, notes, and snippets.

@kantai
Last active March 27, 2018 21:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kantai/07e444fce9112adf606c3403a793bd7e to your computer and use it in GitHub Desktop.
Save kantai/07e444fce9112adf606c3403a793bd7e to your computer and use it in GitHub Desktop.
Sweep name from an owner key
var bsk = require('blockstack')
var paymentKey = ''
var ownerKey = ''
var destination = '17MbuGaHvrLMiq2RfgsFj8K55gY1Ywnzrs'
var name = 'ablankst.id'
const zonefile = `$ORIGIN ${name}
$TTL 3600
_https._tcp URI 10 1 "https://gaia.blockstack.org/hub/${destination}/profile.json"
`
bsk.transactions.makeRenewal(name, destination, ownerKey, payerKey, zonefile)
.then(transaction => {
console.log(transaction)
console.log(zonefile)
return bsk.config.network.broadcastTransaction(transaction)
})
.then(txhash => {
console.log(`queueing zonefile to watch ${txhash}`)
bsk.config.network.broadcastZoneFile(zonefile, txhash)
})
.then(() => {
console.log('done')
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment