caver.ipfs
caver.ipfs
is a package that provides functionality related to IPFS (InterPlanetary File System).
NOTE caver.ipfs
is supported since caver-js v1.5.4.
caver.ipfs.setIPFSNode
Initializes a connection with an IPFS Node. When an IPFS Node information is set through this function, you can upload files to IPFS or load files from IPFS.
Parameters
Return Value
None
Example
caver.ipfs.add
Adds a file to IPFS. The CID(Content Identifier) of the uploaded file is returned.
If the path of a file is passed, the contents of the file are loaded from the path and uploaded to IPFS. If a buffer is passed, it is uploaded to IPFS directly.
Parameters
NOTE Buffer
is supported since caver-js v1.5.5.
Return Value
Promise
returns string
Example
caver.ipfs.get
Returns a file addressed by a valid IPFS path.
Parameters
Return Value
Promise
returns Buffer
Example
caver.ipfs.toHex
Converts a CID(Content Identifier) to a Multihash.
Parameters
Return Value
Example
caver.ipfs.fromHex
Converts to CID(Content Identifier) from a Multihash.
Parameters
Return Value
Example
Last updated