File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed
Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -127,7 +127,9 @@ public List<MerkleNode> put(List<byte[]> data) throws IOException {
127127 return JSONParser .parseStream (res ).stream ().map (x -> MerkleNode .fromJSON ((Map <String , Object >) x )).collect (Collectors .toList ());
128128 }
129129
130- //TODO stat
130+ public Map <String , Object > stat (MerkleNode merkleObject ) throws IOException {
131+ return (Map )retrieveAndParse ("block/stat?stream-channels=true&arg=" + merkleObject .hash );
132+ }
131133 }
132134
133135 /* 'ipfs object' is a plumbing command used to manipulate DAG objects directly. {Object} is a subset of {Block}
Original file line number Diff line number Diff line change @@ -76,6 +76,7 @@ public void objectTest() {
7676 public void blockTest () {
7777 try {
7878 MerkleNode pointer = new MerkleNode ("QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB" );
79+ Map stat = ipfs .block .stat (pointer );
7980 byte [] object = ipfs .block .get (pointer );
8081 List <MerkleNode > newPointer = ipfs .block .put (Arrays .asList ("Some random data..." .getBytes ()));
8182 } catch (IOException e ) {
You can’t perform that action at this time.
0 commit comments