Skip to content

Instantly share code, notes, and snippets.

@chrismatthieu
Created March 31, 2017 22:57
Show Gist options
  • Save chrismatthieu/e639c2ec475e9ebc7b0fd107ac0ca094 to your computer and use it in GitHub Desktop.
Save chrismatthieu/e639c2ec475e9ebc7b0fd107ac0ca094 to your computer and use it in GitHub Desktop.
var msgSend;
var counter = 0
setInterval(function(){
msgSend = new Buffer(counter.toString());
ipfs.pubsub.publish(topic, msgSend, (err) => {
if (err) {
throw err
}
// msg was broadcasted
})
counter++
}, 3000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment