Coder Social home page Coder Social logo

delta-edge's Introduction

EdgeUR (Upload/Retrieve)

CodeQL

Edge is currently under heavy development.

Goal/Purpose

Dedicated light node to upload and retrieve their CIDs. To do this, we decoupled the upload and retrieval aspect from the Estuary API node so we can create a node that can live on the "edge" closer to the customer.

By decoupling this to a light node, we achieve the following:

  • dedicated node assignment for each customer. The customer or user can now launch an edge node and use it for both uploading to Estuary and retrieval using the same API keys issued from Estuary.
  • switches the upload protocol. The user still needs to upload via HTTP but the edge node will transfer the file over to a delta node to make deals.

image

Features

  • Only supports online/e2e verified deals for now.
  • Accepts concurrent uploads (small to large)
  • Stores the CID and content on the local blockstore using whypfs
  • Save the data on local sqlite DB
  • retries the storage deals if it fails. Uses delta auto_retry feature.
  • periodically checks the status of the deals and update the database.
  • For 32GB and above, the node will split the file into 32GB chunks and make deals for each chunk and car them. [WIP]

Quick how to

Upload a file with a given miner

We have a working live server that you can use. To run basic upload, please get API key first. You can get one here https://auth.estuary.tech/register-new-token

curl --location 'http://localhost:3000/api/v1/content/add' \
--header 'Authorization: Bearer [APIKEY]' \
--form 'data=@"/file.zip"' \
--form 'miners="f0137168,f0717969"' // list of miners (optional)
{
    "status": "success",
    "message": "File uploaded and pinned successfully to miners. Please take note of the ids.",
    "contents": [
        {
            "ID": 53,
            "name": "bafybeicgdjdvwes3e5aaicqljrlv6hpdfsducknrjvsq66d4gsvepolk6y.zip",
            "size": 1157548,
            "cid": "bafybeicgdjdvwes3e5aaicqljrlv6hpdfsducknrjvsq66d4gsvepolk6y",
            "delta_content_id": 0,
            "delta_node_url": "https://node.delta.store",
            "status": "pinned",
            "last_message": "",
            "miner": "f0137168",
            "replication": 0,
            "created_at": "2023-04-22T14:40:43.10918+02:00",
            "updated_at": "2023-04-22T14:40:43.10918+02:00"
        },
        {
            "ID": 54,
            "name": "bafybeicgdjdvwes3e5aaicqljrlv6hpdfsducknrjvsq66d4gsvepolk6y.zip",
            "size": 1157548,
            "cid": "bafybeicgdjdvwes3e5aaicqljrlv6hpdfsducknrjvsq66d4gsvepolk6y",
            "delta_content_id": 0,
            "delta_node_url": "https://node.delta.store",
            "status": "pinned",
            "last_message": "",
            "miner": "f0717969",
            "replication": 0,
            "created_at": "2023-04-22T14:40:43.112161+02:00",
            "updated_at": "2023-04-22T14:40:43.112161+02:00"
        }
    ]
}

Check status

Get the content id and use the following call

curl --location 'http://localhost:3000/api/v1/status/53' \
--header 'Authorization: Bearer [APIKEY]'
{
    "content": {
        "ID": 53,
        "name": "bafybeicgdjdvwes3e5aaicqljrlv6hpdfsducknrjvsq66d4gsvepolk6y.zip",
        "size": 1157548,
        "cid": "bafybeicgdjdvwes3e5aaicqljrlv6hpdfsducknrjvsq66d4gsvepolk6y",
        "delta_content_id": 67547,
        "delta_node_url": "https://node.delta.store",
        "status": "uploaded-to-delta",
        "last_message": "",
        "miner": "f0137168",
        "replication": 0,
        "created_at": "2023-04-22T14:40:43.10918+02:00",
        "updated_at": "2023-04-22T14:40:46.564971+02:00"
    }
}

View the file using the gateway url

http://localhost:1313/gw/<cid>
http://localhost:1313/gw/content/<content_id>

Getting Started

To get started, follow the guide here.

Author

Protocol Labs Outercore Engineering

delta-edge's People

Contributors

10d9e avatar alvin-reyes avatar zorlin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

delta-edge's Issues

Support for RPC/Bitswap transfers

Proposal

  • Edge uses HTTP to transfer files over to delta.
  • We need to add support for RPC and Bitswap transfers using delta /existing endpoint to connect directly with the edge node.

Design an S3 Compatible Storage Adapter

Multiple users in the Enterprise space are looking to interface directly with S3. As an edge, delta user I want to be able to push data up to our services through the S3 api, and have it automatically flow the data through the backend into Filecoin per usual.

Tasks

Add S3 and Cloud management Diagrams to our overall architecture

We would like to have S3 integration added to our overall architecture diagrams. Should demonstrate how Amazon/Azure/GCP S3 storage fits into the Delta stack.

cc: @schreck23 @jimmylee

Tasks

EdgeUR - Statistics and Metrics

Stats

Global and API key specific stats:

  • total number and size of uploads
  • total number and size of uploads with deal_ids
  • day to day and month to month stats
  • number of edge-ur peers
  • number of CIDs hosted by this edge-node

Integrate lassie

Users should be able to retrieve a cid from the network using lassie.

Integrate boxo as the underlying IPFS & friends library

Instead of using the myriad of legacy ipfs libraries, EngRes has produced the boxo initiative. This library should be used to replace blockstore, bitswap and all other direct calls to underlying libraries for edge-ur.

Update:
blocked by: ipfs/boxo#291
blocked by: ipfs/go-merkledag#105

Moving to boxo 0.9.0 yeilds the following:

~/Documents/code/edge-ur boxo-wip*
❯ make       
go generate
go build -tags netgo -ldflags="-s -w -X main.Commit=3b0eb73 -X main.Version=v1.0.2-53-g3b0eb73-dirty" -o edge
# github.com/ipfs/go-merkledag
../../../go/pkg/mod/github.com/ipfs/[email protected]/merkledag.go:26:9: undefined: format.Register
../../../go/pkg/mod/github.com/ipfs/[email protected]/merkledag.go:27:9: undefined: format.Register
../../../go/pkg/mod/github.com/ipfs/[email protected]/merkledag.go:28:9: undefined: format.Register
../../../go/pkg/mod/github.com/ipfs/[email protected]/merkledag.go:30:9: undefined: ipldlegacy.RegisterCodec
../../../go/pkg/mod/github.com/ipfs/[email protected]/merkledag.go:31:9: undefined: ipldlegacy.RegisterCodec
../../../go/pkg/mod/github.com/ipfs/[email protected]/merkledag.go:86:16: undefined: ipldlegacy.DecodeNode
../../../go/pkg/mod/github.com/ipfs/[email protected]/merkledag.go:146:16: undefined: ipldlegacy.DecodeNode
../../../go/pkg/mod/github.com/ipfs/[email protected]/merkledag.go:254:23: undefined: ipldlegacy.DecodeNode
make: *** [build] Error 2

Offline mode

Edge node should still be able to consolidate files even without an network connection or "immediate" connection with delta node.

  • Edge should consolidate the request into a dispatch queue
  • Dispatch queue monitors the network and dispatch the upload jobs when it's ready.

Edge-ur Swagger

Generate the swagger file for all the edge-ur endpoints available

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.