在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:ipfs-shipyard/java-ipfs-http-client开源软件地址:https://github.com/ipfs-shipyard/java-ipfs-http-client开源编程语言:Java 99.2%开源软件介绍:java-ipfs-http-client
Table of ContentsInstallOfficial releasesYou can use this project by including Maven, Gradle, SBTPackage managers are supported through JitPack which supports Maven, Gradle, SBT, etc. for Maven, add the following sections to your pom.xml (replacing $LATEST_VERSION):
Building
Running testsTo run tests, IPFS daemon must be running on IPFS installationCommand lineDownload ipfs from https://dist.ipfs.io/#go-ipfs and run with Docker ComposeRun UsageCreate an IPFS instance with: IPFS ipfs = new IPFS("/ip4/127.0.0.1/tcp/5001"); Then run commands like: ipfs.refs.local(); To add a file use (the add method returns a list of merklenodes, in this case there is only one element): NamedStreamable.FileWrapper file = new NamedStreamable.FileWrapper(new File("hello.txt"));
MerkleNode addResult = ipfs.add(file).get(0); To add a byte[] use: NamedStreamable.ByteArrayWrapper file = new NamedStreamable.ByteArrayWrapper("hello.txt", "G'day world! IPFS rocks!".getBytes());
MerkleNode addResult = ipfs.add(file).get(0); To get a file use: Multihash filePointer = Multihash.fromBase58("QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB");
byte[] fileContents = ipfs.cat(filePointer); DependenciesCurrent versions of dependencies are included in the ReleasingThe version number is specified in ContributeFeel free to join in. All welcome. Open an issue! This repository falls under the IPFS Code of Conduct. License |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论