Skip to content

songjiayang/p2pedge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

p2pedge

Edge compute with p2p (peer to peer) network, base on IPFS & IPFS pubsub.

edage

Why p2p edge compute?

  • With the rise of the Internet of Things, the emergence of 5G networks will generate more data and more connections. The IDC construction of traditional cloud solutions is time-consuming and labor-intensive, and it is impossible to achieve large-area coverage, so that a large amount of data is transmitted over long distances. There will be a large delay in the process.

  • P2p networks have a large number (smart hardware, sensors, personal computers, etc.). Most of them have low resource utilization. If we can use some way to integrate these resources, it can solve the geographical coverage in edge computing not enough problems, and it has a very big economic advantage.

Requirements

If everything is ok the folder will look like:

drwxr-xr-x   5 songjiayang  1603212982      160 Feb 14 15:16 .
drwx------+ 19 songjiayang  1603212982      608 Feb 14 15:00 ..
-rwxr-xr-x   1 songjiayang  1603212982  6709700 Feb 14 14:57 edge-ctl
-rwxr-xr-x   1 songjiayang  1603212982  6951396 Feb 14 14:54 edge-manager
drwxr-xr-x   4 songjiayang  1603212982      128 Feb 14 11:44 examples

Usage

  • start ipfs enable pubsub
ipfs daemon --enable-namesys-pubsub 
  • start edge-manager
./edge-manager 
  • add task's data to ipfs
ipfs add -r examples

added QmXtTrmq1cMWvvBRHFj46D6sMpzud2zaZw8EBLMDNW31jW examples/echo/task.json
added QmQtNxAtDZe1RJcmwngQBPdGMnAyufpxPUfWUXRPqzJ4wS examples/echo
added QmY7Ruumkyyg1NkbXJthnfhJ3jPfoDCfHDGNiKmMHcQ5Jk examples
 6.22 MiB / 6.22 MiB [==========================================
  • add echo task to edge node
./edge-ctl add QmWeAxGEuZzmBWP2okuSgzKUiPH4yyMVB4otdSbzxUYBsq QmXtTrmq1cMWvvBRHFj46D6sMpzud2zaZw8EBLMDNW31jW

2019/02/14 15:22:42 Add successful, you can use `edge-ctl data QmXtTrmq1cMWvvBRHFj46D6sMpzud2zaZw8EBLMDNW31jW` to get the result.

Afer add, you can get print info at edge-manager console:

2019/02/14 15:22:42 New task with cid: QmXtTrmq1cMWvvBRHFj46D6sMpzud2zaZw8EBLMDNW31jW 

QmWeAxGEuZzmBWP2okuSgzKUiPH4yyMVB4otdSbzxUYBsq is ipfs node id, QmXtTrmq1cMWvvBRHFj46D6sMpzud2zaZw8EBLMDNW31jW is task's CID.

  • get task's result
./edge-ctl data QmXtTrmq1cMWvvBRHFj46D6sMpzud2zaZw8EBLMDNW31jW
echo
echo

About

Edge compute with p2p network, base on IPFS.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages