public class Ipfs
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
void |
cancelPubsubSub(java.lang.String queryId)
Cancel subscribe to messages on a given topic
|
void |
dataAtPath(java.lang.String path,
Handlers.DataHandler handler)
Get raw data stored at an IPFS path
|
java.lang.String |
peerId()
Fetch the IPFS peer id
|
void |
pubsubPub(java.lang.String topic,
java.lang.String data)
Publishes a message to a given pubsub topic
|
java.lang.String |
pubsubSub(java.lang.String topic)
Subscribes to messages on a given topic
|
java.lang.Boolean |
swarmConnect(java.lang.String multiaddr)
Open a new direct connection to a peer using an IPFS multiaddr
|
public java.lang.String peerId() throws java.lang.Exception
java.lang.Exception
- The exception that occurredpublic java.lang.Boolean swarmConnect(java.lang.String multiaddr) throws java.lang.Exception
multiaddr
- Peer IPFS multiaddrjava.lang.Exception
- The exception that occurredpublic void dataAtPath(java.lang.String path, Handlers.DataHandler handler)
path
- The IPFS path for the data you want to retrievehandler
- An object that will get called with the resulting data and media typepublic void pubsubPub(java.lang.String topic, java.lang.String data) throws java.lang.Exception
topic
- The topic to publish todata
- The payload of message to publishjava.lang.Exception
- The exception that occurredpublic java.lang.String pubsubSub(java.lang.String topic) throws java.lang.Exception
topic
- The ipfs pubsub sub topicjava.lang.Exception
- The exception that occurredpublic void cancelPubsubSub(java.lang.String queryId) throws java.lang.Exception
queryId
- The query ID that can be used to cancel the subjava.lang.Exception
- The exception that occurred