GithubHelp home page GithubHelp logo

millerm / nabu Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sonudoo/nabu

0.0 0.0 0.0 2.09 MB

A minimal Java implementation of IPFS

License: MIT License

Shell 0.05% Java 99.16% Kotlin 0.71% Dockerfile 0.08%

nabu's Introduction

Investigating tracing for IPFS with a minimal implementation

This project explores adding tracing functionality to IPFS. To create a prototype, we started with Nabu, a minimal implementation of IPFS.

To focus on the tracing aspect, several features of Nabu were disabled:

  • Bootstrap discovery: Nabu doesn't include bootstrap peer discovery. To establish a private network, ten peers are manually connected to each other.
  • Optimistic BitSwap and flow control: These features, related to data exchange between peers, were removed for the prototype.
  • File caching: The ability to cache fetched files was also disabled.

Note: Only the content retrieval (GET) path is traced.

Setup

./compile.sh
./run-local.sh <node-id>

node-id can be 0-9.

API

PUT

Description

Adds content provided in raw request body and returns the content id for it.

PUT /api/v0/block/put

Response

{
  "cid" : string
}

Status Codes

  • 200 - OK
  • 400 - BAD_REQUEST

GET

Description

Retrieves content provided for the provided cid. Optionally exports trace for the request if trace is set to 1.

GET /api/v0/block/get?cid=<cid>[&trace=1]

Response

Response body contains content bytes.

Status Codes

  • 200 - OK
  • 400 - BAD_REQUEST

Example

Request 1

curl -X PUT -d "abc" http://localhost:5001/api/v0/block/put

Response 1

{"Hash":"bafkreif2pall7dybz7vecqka3zo24irdwabwdi4wc55jznaq75q7eaavvu"}

Request 2

curl 'http://localhost:5001/api/v0/block/get?cid=bafkreif2pall7dybz7vecqka3zo24irdwabwdi4wc55jznaq75q7eaavvu&trace=1'

Response 2

abc

nabu's People

Contributors

ianopolous avatar kevodwyer avatar sonudoo avatar pedropietro 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.