1 | <?php |
||
24 | final class Block implements Api |
||
25 | { |
||
26 | /** |
||
27 | * Get a raw IPFS block. |
||
28 | * |
||
29 | * @Endpoint(name="block:get") |
||
30 | * |
||
31 | * @param string $arg the base58 multihash of an existing block to get |
||
32 | * |
||
33 | * @return Command |
||
34 | */ |
||
35 | public function get(string $arg): Command |
||
39 | |||
40 | /** |
||
41 | * Store input as an IPFS block. |
||
42 | * |
||
43 | * @Endpoint(name="block:put") |
||
44 | * |
||
45 | * @param string $file the data to be stored as an IPFS block |
||
46 | * @param string $format cid format for blocks to be created with |
||
47 | * @param string $mhtype multihash hash function |
||
48 | * @param int $mhlen multihash hash length |
||
49 | * |
||
50 | * @return Command |
||
51 | */ |
||
52 | public function put(string $file, string $format = 'v0', string $mhtype = 'sha2-256', int $mhlen = -1): Command |
||
56 | |||
57 | /** |
||
58 | * Remove IPFS block(s). |
||
59 | * |
||
60 | * @Endpoint(name="block:rm") |
||
61 | * |
||
62 | * @param string $arg bash58 encoded multihash of block(s) to remove |
||
63 | * @param bool $force ignore nonexistent blocks |
||
64 | * @param bool $quiet write minimal output |
||
65 | * |
||
66 | * @return Command |
||
67 | */ |
||
68 | public function rm(string $arg, bool $force = false, bool $quiet = false): Command |
||
72 | |||
73 | /** |
||
74 | * Print information of a raw IPFS block. |
||
75 | * |
||
76 | * @Endpoint(name="block:stat") |
||
77 | * |
||
78 | * @param string $arg the base58 multihash of an existing block to stat |
||
79 | * |
||
80 | * @return Command |
||
81 | */ |
||
82 | public function stat(string $arg): Command |
||
86 | } |
||
87 |