Giter Site home page Giter Site logo

iced-holochain's Introduction

HoloMessages

A simple messaging Holochain application based on iced - a Rust GUI library - as an example of a Rust GUI hApp.

Running the application

Clone & run

After cloning the repository, enter the nix shell to make the hc command available:

nix develop --run $SHELL

Then the hApp can be built:

./build-happ.sh

Now the app can be started:

cargo run

A new conductor will be created under the path ./holochain/. It will be reused for every subsequent application start as long as it can be found under that path.

Known bug

holochain_websocket shuts down when a signal is emitted in a post_commit hook, as is the case in the "profiles" zome that is part of this hApp. Therefore after creating a new profile, the app will stop working. A restart is required and as there is an existing profile to restore now, the websocket will not shut down.

Multiple conductors

To start the app with a different conductor, a folder name can be passed in as a parameter:

cargo run -- tmp1

This will create a conductor under ./holochain/tmp1/.

As a way to run the app with multiple conductors, it serves to start up different instances with separate conductors and interact with each other from different application windows.

E. g. to send messages between two agents,

cargo run -- agent1

will create a conductor under ./holochain/agent1/. From another terminal calling

cargo run -- agent2

creates a second conductor at ./holochain/agent2/. Both conductors share the same network and the agents can see each others' messages.

Delete conductors

If you no longer want to use an existing conductor, you can delete its folder under ./holochain. To delete all existing conductors including the default one, delete ./holochain entirely.

Network seed

The network seed can be defined in ./happ/workdir/dna.yaml. It determines if agents running this hApp will be on the same network and see the same data. When you want to run multiple conductors to exchange messages, they need to have the same DNA based on a matching network seed installed.

Tests

Tests can be run with the command

cargo test --all

iced-holochain's People

Contributors

jost-s avatar

Stargazers

 avatar alex (she/they) avatar  avatar  avatar  avatar  avatar Nicholas Stebbings avatar Matt Gabrenya avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.