Giter Club home page Giter Club logo

social-triangulation's Introduction

Social Triangulation Zome

TLDR: "this hApp can only be joined by friends of friends".

This social triangulation zome is a basic membrane to be reused in holochain applications. It may be useful in contexts where the application is tuned for a small number of participants that loosely know each other, or have to live nearby, etc.

This is a work in progress, not production ready. Contact us if you want to collaborate!

Membrane workflow

  1. The hApp includes this zome and sets two properties in the DNA:
  • initial_members: initial list of friends that are allowed in the hApp.
  • necessary_vouches: number of friends that have to "vouch" for you to be allowed in the hApp. This must be equal or less than the number of initial members.
  1. The agents with address inside the initial_members join the hApp. They are automatically valid.
  2. If an agent wants to enter the hApp, the agents that are already inside the app have to vouch for him, using their agent address. When the agent receives a number of vouches equal or more than the necessary_vouches, they can install the hApp and enter the network.
  3. From now on, this new agent can also vouch for other agents to enter the hApp.

Todo list

  • Implement tests when tryorama accepts DNA properties.
  • Implement UI native module
  • Publish code to npm and crates.io

Building

Assuming you have nix-shell installed, to build the DNA, execute:

nix shell
hc package

Tests

Until @holochain/tryorama supports passing in properties, tests have to be manual, since there is no way to automatically start vouching for anyone if the initial_members property can't be set.

Usage

This is a membrane zome: it only defines how agents can enter the network. It does not define any domain logic in your application, but rather has to be used with other zomes that do.

Usage until there is a better zome distribution channel:

  1. Copy and paste the zome code into your application.
  2. Set the initial_members and necessary_vouches properties in the app.json.
  3. Good to go!

social-triangulation's People

Contributors

guillemcordoba avatar hedayatabedijoo 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.