• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

textileio/android-ipfs-lite

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

textileio/android-ipfs-lite

开源软件地址:

https://github.com/textileio/android-ipfs-lite

开源编程语言:

Java 100.0%

开源软件介绍:

android-ipfs-lite

Made by Textile Chat on Slack GitHub license Release CircleCI branch docs standard-readme compliant

A lightweight, extensible IPFS peer for Android.

IPFS Lite runs the minimal setup required to get and put IPLD DAGs on the IPFS network. It is a port of the Go IPFS Lite library.

Table of Contents

Background

IPFS Lite runs the minimal setup required to provide a DAG service. It is a port of the Go IPFS Lite library, and as such, has the same requirements. The goal of IPFS Lite is to run the bare minimal functionality for any IPLD-based application to interact with the IPFS network (by getting and putting blocks). This saves having to deal with the complexities of using a full IPFS daemon, while maintaining the ability to share the underlying libp2p host and DHT with other components.

IPFS-lite Libraries

The following includes information about support for ipfs-lite.

Name Build Language Description
ipfs-lite Build Status golang The reference implementaiton of ipfs-lite, written in Go.
js-ipfs-lite Build status javascript The Javascript version of ipfs-lite available for web, nodejs, and React Native applications.
ios-ipfs-lite Build status objc The iOS ipfs-lite library for use in Objc and Swift apps
android-ipfs-lite Build status java The Java ipfs-lite library for us in Android apps
grpc-ipfs-lite Build status java A common gRPC API interface that runs on the Go ipfs-lite node.

Roadmap

  • Start IPFS Lite
  • Stop IPFS Lite
  • getFile(String cid) Get file by Content Address.
  • getFileSync(String cid) Synchronously get file by Content Address.
  • addFile(byte[] data) Add file to IPFS.
  • addFileSync(byte[] data) Synchronously Add file to IPFS.
  • getNode(String cid) Get IPLD node.
  • removeNode(String cid) Remove IPLD node.
  • Add IPLD node.
  • resolveLink(String link)

Install

The IPFS Lite library is published in Textile's Bintray Maven repository. You can install it using Gradle.

First, you'll need to add Textile's Bintray Maven repository to you project's top level build.gradle in the allProjects.repositories section:

allprojects {
    repositories {
        ...
        maven { url 'https://dl.bintray.com/textile/maven' }
        maven { url 'https://jitpack.io' }
        ...
    }
}

Next, add the IPFS Lite dependency to your app module's build.gradle dependencies section, specifying the latest version available:

dependencies {
    ...
    implementation 'io.textile:ipfslite:0.1.4'
    ...
}

Usage

Initialize and start a Peer

  Boolean debug = false;
  Peer litePeer = new Peer('/path/', debug, true);
  litePeer.start();

Add data

  String message = "Hello World";
  String cid = litePeer.addFileSync(message.getBytes());

Add a file

  File file = openFile("secret_plans");
  byte[] bytes = Files.readAllBytes(file.toPath());
  String cid = litePeer.addFileSync(bytes);

  // OR Asynchronously
  litePeer.addFile(bytes, resultHandler);

Fetch a file by CID

  byte[] data = litePeer.getFileSync("bafybeic35nent64fowmiohupnwnkfm2uxh6vpnyjlt3selcodjipfrokgi");
  // OR Asynchronously
  litePeer.getFile("bafybeic35nent64fowmiohupnwnkfm2uxh6vpnyjlt3selcodjipfrokgi", resultHandler);

Maintainers

Andrew Hill

Contributing

See the contributing file!

PRs accepted.

Small note: If editing the README, please conform to the standard-readme specification.

License

MIT (c) 2019 Textile




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
proofofbeauty/gateway: IPFS gateway for the POB project发布时间:2022-06-22
下一篇:
c-base/ipfs-ringpin: A-ringa-pin-ping-a-ringa-pin-pong发布时间:2022-06-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap