View Source MyspaceIPFS.Block (Myspace IPFS v0.1.0)

MyspaceIPFS.Block is where the block commands of the IPFS API reside.

Link to this section Summary

Functions

Get a raw IPFS block.

Put file as an IPFS block.

Remove a block from the blockstore.

Get block stat.

Link to this section Functions

@spec get(cid()) :: okmapped()

Get a raw IPFS block.

parameters

Parameters

https://docs.ipfs.tech/reference/kubo/rpc/#api-v0-block-get cid - The CID of the block to get.

@spec put(fspath(), opts()) :: okmapped()

Put file as an IPFS block.

parameters

Parameters

fspath - The path to the file to be stored as a block.

options

Options

https://docs.ipfs.tech/reference/kubo/rpc/#api-v0-block-put

[
  `cid-codec`: <string>, # CID codec to use.
  `mhtype`: <string>, # Hash function to use.
  `mhlen`: <int>, # Hash length.
  `pin`: <bool>, # Pin added blocks recursively.
  `allow-big-block`: <bool>, # Allow blocks larger than 1MiB.
]
@spec rm(cid()) :: okmapped()

Remove a block from the blockstore.

parameters

Parameters

cid - The CID of the block to remove.

options

Options

https://docs.ipfs.tech/reference/kubo/rpc/#api-v0-block-rm

[
  `force`: <bool>, # Ignore nonexistent blocks.
  `quiet`: <bool>, # Write minimal output.
]
@spec stat(cid()) :: okmapped()

Get block stat.

parameters

Parameters

https://docs.ipfs.tech/reference/kubo/rpc/#api-v0-block-stat cid - The CID of the block to stat.