File tree Expand file tree Collapse file tree
src/main/java/org/ipfsbox/battery/api Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- # java-ipfs-cluster-api
1+ # java-ipfs-cluster-api
2+
3+ ** A client library for the IPFS Cluster HTTP API, implemented in Java.**
4+
5+ UNOFFICIAL AND ALPHA
6+
7+ ````
8+ This is a port of ipfs/java-ipfs-api adapted for the API exposed by ipfs/ipfs-cluster.
9+ ````
10+
11+ ## install
12+
13+ add this code to your project or make it to jar
14+
15+
16+
17+ ## Dependencies
18+
19+ This module requires ipfs-cluster to be running. It is assumed that the IPFS Cluster API is running on "127.0.0.1:9094".
20+
21+
22+
23+ ## Usage
24+
25+ ### To import the module:
26+
27+ ```` java
28+ IPFSCluster ipfsCluster = new IPFSCluster (" 127.0.0.1" , 9094 );
29+ ````
30+
31+
32+
33+ ### API
34+
35+ The API is currently a work-in-progress. The exposed methods are designed to be similar to ipfs-cluster-ctl provided in ipfs/ipfs-cluster.
36+
37+ ```` java
38+ ipfsCluster. id();
39+ ipfsCluster. version();
40+ ipfsCluster. pins. ls();
41+ ipfsCluster. pins. ls(String CID );
42+ ipfsCluster. pins. add(String CID );
43+ ipfsCluster. pins. rm(String CID );
44+ ipfsCluster. peers. ls();
45+ ipfsCluster. peers. rm(String CID );
46+ ipfsCluster. sync. sync();
47+ ipfsCluster. sync. sync(String CID );
48+ ipfsCluster. recover. recover();
49+ ipfsCluster. recover. recover(String CID );
50+ ipfsCluster. allocation. ls();
51+ ipfsCluster. allocation(String CID );
52+ ipfsCluster. health. graph();
53+ ````
54+
55+
56+
57+ The code is mostly from java-ipfs-api modified to consume the ipfs-cluster API.
Original file line number Diff line number Diff line change 103103 <artifactId >commons-logging</artifactId >
104104 <version >1.2</version >
105105 </dependency >
106- <dependency >
107- <groupId >io.ipfs.cluster</groupId >
108- <artifactId >api</artifactId >
109- <version >v0.0.1</version >
110- </dependency >
111- <dependency >
112- <groupId >io.ipfs.cluster</groupId >
113- <artifactId >api</artifactId >
114- <version >v0.0.1</version >
115- </dependency >
116-
117106
118107 </dependencies >
119108
Original file line number Diff line number Diff line change 77
88import java .io .*;
99
10+ /**
11+ * @author liang
12+ * @Date 2018.5.9
13+ * */
1014public class IPFSCluster {
1115
1216 public final String host ;
You can’t perform that action at this time.
0 commit comments