forked from agorise/c-ipfs
b462d9ef53
Successfully writing to lightningdb. Now to pull it back out. Also need to write to the blockstore.
20 lines
436 B
C
20 lines
436 B
C
#include <string.h>
|
|
|
|
#include "ipfs/blocks/blockstore.h"
|
|
#include "ipfs/blocks/block.h"
|
|
|
|
int test_blockstore_put() {
|
|
const unsigned char* input_string = "Hello, World!";
|
|
struct Block* input_block;
|
|
int retVal = 0;
|
|
|
|
retVal = ipfs_blocks_block_new(input_string, strlen((const char*)input_string) + 1, &input_block);
|
|
if (retVal == 0)
|
|
return 0;
|
|
|
|
retVal = ipfs_blockstore_put(input_block);
|
|
if (retVal == 0)
|
|
return 0;
|
|
|
|
return 1;
|
|
}
|