Giter Site home page Giter Site logo

ipfs-computing-router's Introduction

ipfs-computing-router

IPFS Computing Router is a CDN that enables users to fetch datasets from the closest SP to computing resources and perform computing jobs. If the data is not found on the SP, it will fetch the data from the closest SP and pay for the retrieval and hosting cost via FEVM contract.

Installation

$ pip install -r requirements.txt

Data Computing

A Sample AI training job image_classification.ipynb can be found in computing folder monkey.png

Setup MCS environment file

This setup is for setting up the wallet for pay mcs backup cost.

Create an .env file

wallet_address = ""
private_key = ""
web3_api = "https://matic-testnet-archive-rpc.bwarelabs.com"

Gateway and Computing result

The main script compares two IPFS gateways:

https://mcs.filswan.com 
https://ipfs.io

The script will choose the one has less latency and backup the computing result to it.

mcs.filswan.com Montréal
ipfs.io San Francisco
ipfs_io_response_time 0.091187
mcs_response_time 0.084746
Chose mcs gateway
url: https://mcs-api.filswan.com/api/v1/storage/ipfs/upload
body: {'wallet_address': '0x98B2D0D7439086d3c76315484363870422C14577', 'duration': '525', 'storage_copy': '5'}
url: https://mcs-api.filswan.com/api/v1/common/system/params
url: https://mcs-api.filswan.com/api/v1/billing/price/filecoin

If MCS is selected ,it will show your backup on MCS as follows:

https://calibration-ipfs.filswan.com/ipfs/QmYvgMcF7J7MnpaynYKMdJaqDMcSZbeF5pj34fS6V4T7TZ

ai_result.png

It takes up to 12h for backup to Filecoin nodes.

ipfs-computing-router's People

Contributors

claydrone avatar flyworker avatar bq1024 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.