在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:textileio/android-ipfs-lite开源软件地址:https://github.com/textileio/android-ipfs-lite开源编程语言:Java 100.0%开源软件介绍:android-ipfs-lite
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 ContentsBackgroundIPFS 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
Roadmap
InstallThe 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 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 dependencies {
...
implementation 'io.textile:ipfslite:0.1.4'
...
} UsageInitialize 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); MaintainersContributingPRs accepted. Small note: If editing the README, please conform to the standard-readme specification. LicenseMIT (c) 2019 Textile |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论