Git Product home page Git Product logo

py-ipfs-client's Introduction

IPFS Client

A Python client for interacting with IPFS and Filecoin using an asynchronous interface. This client supports adding data to IPFS, pinning, remote pinning services, archival and unpinning to save bandwith, and retrieving data from Filecoin using Lassie.

Features

  • Add JSON or string data to IPFS.
  • Archive data to Filecoin via lighthouse.storage.
  • Retrieve data from Filecoin via Lassie.
  • Unpin data from IPFS.
  • Get proof of storage from Filecoin().

Installation

This project uses IPFS and Lassie for its core functionality and Poetry for dependency management.

Follow the steps here to install IPFS: Link

Follow the steps here to install Lassie: Link

To install the dependencies, run:

$ pip install poetry
$ poetry install

Configuration

  1. Start the IPFS Node
    $ ipfs daemon
  2. Start the Lassie Service
     $ lassie daemon

Note the ports for both the service and update them respectively.

By Default:

ipfs_url = os.getenv('IPFS_URL', 'http://localhost:5001') # in tests directory
url = f'http://127.0.0.1:36711/ipfs/{cid}?filename={outputfname}' # in main.py:248
  1. Update the lighthouse.storage API key for archival. Generate an API key here
    headers = {'Authorization': f'Bearer YOUR_API_KEY'} # in main.py:228

Usage

The usage of each function is defined in the tests folder.

$ poetry run python -m ipfs_client.tests.<FILE_NAME>

Update FILE_NAME with the respective implementation you want to check.

License

This project is an enhancement to Powerloom's IPFS Client made during ETH Global's HackFS 2024

This `README.md` provides a comprehensive guide to understanding, configuring, and using the IPFS client, including how to run the provided tests. Adjust paths and variables as needed to match your project's specific configuration and requirements.

py-ipfs-client's People

Contributors

xadahiya avatar anomit avatar garv-aga 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.