Skip to content
This repository has been archived by the owner on Apr 29, 2019. It is now read-only.
/ PeerVis Public archive

A way to visually see who is online and connected as a peer in your Holochain app

License

Notifications You must be signed in to change notification settings

holochain/PeerVis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PeerVis

A way to visually see who is online and connected as a peer in your Holochain app

PeerVis is a "Zome" that you can include in your Holochain app. This means it is a modular unit of code that is standalone, and won't affect the rest of your code.

PeerVis screenshot

To add it to your app, do the following.

  1. Add the following to the Zomes array in your dna.json
  {
    "Name": "peerVis",
    "Desription": "show whos online",
    "CodeFile": "peerVis.js",
    "RibosomeType": "js",
    "Config": {
      "ErrorHandling": "throwErrors"
    },
    "Entries": [
      {
        "Name": "peerLink",
        "DataFormat": "links"
      }
    ],
    "Functions": [
      {
        "Name": "getPeers",
        "CallingType": "json",
        "Exposure": "public"
      }
    ]
  }
  1. Copy the peerVis folder INTO the dna folder of your app

  2. Copy peervis.html and cytoscape.min.js into the ui folder of your app

How to use it

When you're running your application, navigate to the localhost address of your app, plus the path /peervis.html. This will dynamically update and show you who how many other nodes are connected to your node, that the app will be gossiping with.

How it does this

In order to know who else is online, it attempts to send a node to node message to each peer who has written to the DHT about their presence in the app. Within the peerVis zome, it adds an entry during genesis announcing their presence within the app. So it uses the send method of the api, and listens for a response from other nodes. It does this at a regular interval.

About

A way to visually see who is online and connected as a peer in your Holochain app

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published