Skip to content

Instantly share code, notes, and snippets.

@Connoropolous
Last active December 3, 2018 23:43
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Connoropolous/d6d51259d5a64d58619f4933269f5d00 to your computer and use it in GitHub Desktop.
Save Connoropolous/d6d51259d5a64d58619f4933269f5d00 to your computer and use it in GitHub Desktop.
const Container = require('@holochain/holochain-nodejs');
// instantiate an app from the DNA JSON bundle
const app = Container.instanceFromNameAndDna("app", "dist/bundle.json")
const app2 = Container.instanceFromNameAndDna("app2", "dist/bundle.json")
// activate the new instance
app.start()
app2.start()
// create a new channel in the first instance
const create_result = app.call("chat", "main", "create_channel", {
name: "test new channel",
description : "testing params",
public: true
})
// wait some seconds (and use recursion if necessary) to check the list of channels
// to be populated to the other instances
setTimeout(function() {
const channels = app2.call("chat", "main", "get_channels", {})
}, 8000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment