mediachain / concat

Mediachain daemons
MIT License
42 stars 13 forks source link

Datastore and statement metadata #41

Closed vyzo closed 7 years ago

vyzo commented 7 years ago

Closes #36

Note: There is a minor change in the remote query protocol, as the end/error messages where refactored to be reused in the data protocol.

Datastore API details:

Example:

$ head -c 20 /dev/urandom | base64
FCG389RpiSmWkbK96fd0if4gmhw=
$ curl -s -H "Content-Type: application/json" -d '{"data": "FCG389RpiSmWkbK96fd0if4gmhw="}' http://127.0.0.1:9002/data/put
QmT7KTeJYJ7pnvsUk8g56AqFgp1Cqk91HnuhyhmaYZW4dr
$ curl http://127.0.0.1:9002/data/get/QmT7KTeJYJ7pnvsUk8g56AqFgp1Cqk91HnuhyhmaYZW4dr
{"data":"FCG389RpiSmWkbK96fd0if4gmhw="}

Merge API changes:

Example:

# the dataset contains a bunch of statements which all reference the same object
$ curl -H "Content-Type: application/text" -d 'SELECT * FROM * LIMIT 10' http://127.0.0.1:9004/merge/QmW5vgizcxphSSV22fKxxNCnv9TbaidYDiBCbHR9bGg2RM
10
1
$ curl -H "Content-Type: application/text" -d 'SELECT * FROM * LIMIT 10' http://127.0.0.1:9004/merge/QmW5vgizcxphSSV22fKxxNCnv9TbaidYDiBCbHR9bGg2RM
0
0
$ curl -H "Content-Type: application/text" -d 'SELECT * FROM * LIMIT 100' http://127.0.0.1:9004/merge/QmW5vgizcxphSSV22fKxxNCnv9TbaidYDiBCbHR9bGg2RM
90
0
parkan commented 7 years ago

🎆