holochain-in-action / peer-share

9 stars 5 forks source link

Peer-Share

What is it?

Peer-Share is a distributed peer to peer holochain application (hApp) that enables peers to shared their contents with others. This content can be shared either completely free of charge or with a paid subscription by using some centralized or distributed payment methods.

Basically this project is an experimental hApp to learn and challenge holochain technology and then design and test some practices and architectures during the Holochain-in-Action meetings.

Holochain-in-Action is a weekly virtual meetings for:

on Holochain technology and also Holoport echosystem.

If you would like to participate in the Holochain-in-Action meetings please fill out this application form. here


Run hApp

  1. Install nix-shell
  2. Clone this repository
  3. Go to holo-layer folder and run nix-shell (It takes a lot of time for the first time.)
  4. Go to tests folder and run npm i
  5. In the tests folder run npm test

    Watch Youtube Channel:

    https://www.youtube.com/playlist?list=PL2hOZGg8QnUDiTkJF2CD2Fu1D9F6KbsmB


    General Purposes

  6. Implementing Dev-ops in Holochain with minimum DNA changes.
  7. Implementing hybrid solution with holocahin (oracle topic).
  8. Implementing modularity by using some ready modules like File_Storage into the solution.
  9. Designing holochain app with Holoport
  10. Introducing some patterns and desings for implementing hApps.

    Architect Schema

Layers:

User Stories

Guest (user without identity):


DNA design

Schema Definition in Zome

Validation Rules: 1- definition, version, owner_address are required. 2- owner_address should be progenitor pattern 3- json schema should be valid.

Peer-Share Example:
Schema will be created by Admin User.
```json=
Schema {
 name: "Channel",
  definition:{
     [field:title, type:string,lenght:50, required:yes],
     [field:category, type:int, required:yes],
     [field:createdat, type:datetime, required:yes],
     [field:description, type:string, lenght:4000, required:no],     
 },
 version:"v1",
 owner_address:"asdf234sfsewr#$2"
}

Schema {
 name: "Tag",
  definition:{
     [field:name, type:string(25), required:yes]    
 },
 version:"v1",
 owner_address:"asdf234sfsewr#$2"
}

Content Definition in Zome

Public Data Definition

Validation Rules: 1- ower address is valid 2- validate content based on the referenced schema using schema format.

Example:
```json=
Public_Content { // Channel is public entry in DHT
 content:{
     title:"Holochain in Action",
     category:1
     createdat:"01-01-2021 12:30",
     description:"empty"
 },
 schema:"HNsj6tQ51s1SPrCBkedbNf0Tp0GbM",
 owner:"o23KMBAuJGSYnRmoBZM3lMfTKevIkA"
}

Private Data Definition

Validation Rules: 1- ower address is valid 2- validate content based on the referenced schema using schema format.

Example:
```json=
Private_Content { // Draft-Channel is private entry in source-chain
 content:{
     title:"Holochain in Action",
     category:1
     createdat:"01-01-2021 12:30",
     description:"empty"
 },
 schema:"HNsj6tQ51s1SPrCBkedbNf0Tp0GbM",
 owner:"o23KMBAuJGSYnRmoBZM3lMfTKevIkA"
}

Outlet layer(MVC Pattern)