@@ -54,6 +54,78 @@ test.all(common)
54
54
55
55
A valid (read: that follows this interface) IPFS core implementation, must expose the following API.
56
56
57
+ ## Block
58
+
59
+ ### ` block.put `
60
+
61
+ > Create a new IPFS Block.
62
+
63
+ ##### ` Go ` ** WIP**
64
+
65
+ ##### ` JavaScript ` - ipfs.block.put(data, [ callback] )
66
+
67
+ Where ` data ` can be a
68
+
69
+ - Buffer, requiring that the encoding is specified on the options. If no
70
+ encoding is specified, Buffer is treated as the Data field
71
+ - [ Block] [ ] instance
72
+
73
+ ` callback ` has the signature ` function (err, block) {} ` , where ` err ` is an error
74
+ if the operation was not successful. and ` block ` is a [ Block] [ ] .
75
+
76
+
77
+
78
+
79
+ ### ` block.get `
80
+
81
+ > Retrieve an IPFS Block from the underlying Block Store by its mulithash.
82
+
83
+ ##### ` Go ` ** WIP**
84
+
85
+ ##### ` JavaScript ` - ipfs.block.get(multihash, [ callback] )
86
+
87
+ ` multihash ` is a [ multihash] [ ] which can be passed as a
88
+
89
+ - Buffer, the raw Buffer of the multihash (or of and encoded version)
90
+ - String, the toString version of the multihash (or of an encoded version)
91
+
92
+ ` callback ` must follow the signature ` function (err, node) {} ` , where ` err ` is
93
+ an error if the operation was not successful and ` block ` is a [ Block] [ ] .
94
+
95
+ If no ` callback ` is passed, a promise is returned.
96
+
97
+
98
+
99
+
100
+ ### ` block.stat `
101
+
102
+ > Returns various stats of an IPFS Block
103
+
104
+ ##### ` Go ` ** WIP**
105
+
106
+ ##### ` JavaScript ` - ipfs.block.stat(multihash, [ options, callback] )
107
+
108
+ ` multihash ` is a [ multihash] [ ] which can be passed as:
109
+
110
+ - Buffer, the raw Buffer of the multihash (or of and encoded version)
111
+ - String, the toString version of the multihash (or of an encoded version)
112
+
113
+ ` callback ` must follow the signature ` function (err, stats) {} ` , where ` err ` is
114
+ an error if the operation was not successful and ` stats ` is an object with
115
+ the format
116
+
117
+ ``` JavaScript
118
+ {
119
+ Key: ' QmPTkMuuL6PD8L2SwTwbcs1NPg14U8mRzerB1ZrrBrkSDD' ,
120
+ Size: 10
121
+ }
122
+ ```
123
+
124
+ If no ` callback ` is passed, a promise is returned.
125
+
126
+
127
+
128
+
57
129
## Object
58
130
59
131
### ` object.new `
@@ -119,10 +191,6 @@ If no `callback` is passed, a promise is returned.
119
191
120
192
If no ` callback ` is passed, a promise is returned.
121
193
122
- ### ` object.data `
123
-
124
- > Returns the Data field of an object
125
-
126
194
##### ` Go ` ** WIP**
127
195
128
196
##### ` JavaScript ` - ipfs.object.data(multihash, [ options, callback] )
@@ -309,5 +377,6 @@ If no `callback` is passed, a promise is returned.
309
377
If no ` callback ` is passed, a promise is returned.
310
378
311
379
380
+ [ Block ] : https://github.com/ipfs/js-ipfs-block
312
381
[ DAGNode ] : https://github.com/vijayee/js-ipfs-merkle-dag
313
382
[ multihash ] : http://github.com/jbenet/multihash
0 commit comments