Last active
December 3, 2018 23:43
-
-
Save Connoropolous/d6d51259d5a64d58619f4933269f5d00 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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