Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

11 Commits

Folders and files

Repository files navigation

CONUN Manager Application

Minimum Node Requirement NPM

CONUN preview

CONUN DECENTRALIZED NETWORK (P2P)

This is conun-p2p-network module for implementing to Node.js



CONUN DECENTRALIZED NETWORK MODULE

Project Status

This project is still in Alpha, lots of development is happening, API might change. The documentation in the master branch may contain changes from a pre-release. If you are looking for the documentation of the latest release, you can view the latest release on npm.

Lead Maintainer

Saidov Jamshid

Development

🔧 Installation

You can use npm to install dependencies, to do;

NPM
npm install @CONUN-Global/conun-p2p-network

That's it!

How to Play

Network Configuration

CONUNP2P.Config.createNode({server: 'BOOT_SERVER_IP', address: 'BOOT_PEER_ADDRES'}, 'SWARM_KEY')

Define Interfaces Type:

  • ProtocolIO - protocol
  • TopicIO - router
  router = new CONUNP2P.TopicIO(p2p)
  protocol = new CONUNP2P.ProtocolIO(p2p)

Protocol IO

Protocol Type: protocol | Method: Listener

  • protocol.link (url/content/jobId)
  • res(from, message, event)
  await protocol.link(`/p2p/protocol/0.0.1/${content}/${jobID}`, (res) => {
  ''' your code here'''
  })

Protocol Type: protocol | Method: Send

  • protocol.push (url/content/jobId, event, message)
  protocol.push(`/p2p/protocol/0.0.1/${content}/${jobID}`, 'event-name', 'message')

Protocol Type: protocol | Method: Send (send message direct to destination (p2p) )

  • protocol.pin (url/content/jobId, event, destination_peer_id, message)
  • res(from, message, event)
  await protocol.pin(`/p2p/protocol/0.0.1/${content}/${jobID}`, '', 'destination_peer_id', 'message')

Topic IO

Protocol Type: Router | Method: link ( get message from subscribed endpoint)

  • router.link (url/content/jobId, callback(response))
  • res(from, message, event)
    router.link(`/p2p/router/1.0.0/${content}/${jobID}`, (res) => {
       ''' your code here'''
    })

Protocol Type: Router | Method: link ( get message from subscribed endpoint)

  • router.link (url/content/jobId, callback(response))
  • res(from, message, event)
  router.push(`/p2p/router/1.0.0/${content}/${jobID}`, 'event-name', 'message')

CONUN preview


Ask from Developers Discord

Released since 2021.02.22

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages