GithubHelp home page GithubHelp logo

tarekbadrshalaan / ipfs-pubsub-compute Goto Github PK

View Code? Open in Web Editor NEW

This project forked from drbh/ipfs-pubsub-compute

0.0 1.0 0.0 10.8 MB

An easy way to run code on other machines using IPFS Pubsub as the message queue, AWS's Python3.7 Lambda Docker Container for execution

Home Page: https://medium.com/@david.richard.holtz/an-ipfs-application-demo-49a1255ffd0

Go 0.02% HTML 0.08% JavaScript 99.90%

ipfs-pubsub-compute's Introduction

ipfs-pubsub-compute

Article here https://medium.com/@david.richard.holtz/an-ipfs-application-demo-49a1255ffd0

Overview

This is a tiny IPFS PubSub application built in Golang and is less than 130 lines of code. It allows you to write Python 3.7 code in the browser send the code and the input to IPFS pubsub, which another listening device in the channel then picks up and executes using AWS's Lambda Docker container.

Features

  • Web UI for Python 3.7 code

  • Send code and event in Base64 to IPFS pubsub channel

  • Lambda Docker listens to pubsub channel

  • Docker executes code and returns to IPFS pubsub result channel

  • Server listen to response channel and sends compute result to web UI

  • End to end WEB→IPFS→DOCKER→IPFS→WEB

  • Make channel changable from UI

  • Stop panic on code execute failure

  • Allow user to deploy code to IPFS as file

  • Allow compute app to execute file contents and not just pubsub message

Setup

Please install the dependencies

docker - version 18.09.1
go     - go1.11.5 
ipfs   - version 0.4.18

Also you'll need to fetch the AWS Lambda Docker at, https://github.com/lambci/docker-lambda

To get the image just run:


docker pull lambci/lambda:python3.7 

Running

First we need to make sure we can connect to a IPFS gateway that has PubSub enabled. The app is looking for a gateway at http://localhost:5001 so please use go-ipfs to start a local node. check out https://github.com/ipfs/go-ipfs to get IPFS setup on your computer.

Now start the deamon with the pubsub flag enabled.

ipfs daemon --enable-pubsub-experiment

Now, we can start out app that uses IPFS's new gen protocols.

git clone https://github.com/drbh/ipfs-pubsub-compute.git
cd ipfs-pubsub-compute

Running precompiled binary (on OSX)

./ipfs-pubsub-compute 

Run go source files files, you'll need to go get a few libraries

go run execute.go server.go 

The application is available at

http://localhost:8769/

ipfs-pubsub-compute's People

Contributors

drbh avatar

Watchers

James Cloos 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.