DJDNS / go-deje

Golang library for DEJE Next, a protocol/technology for decentralized document hosting and concurrent editing.
GNU Lesser General Public License v2.1
8 stars 0 forks source link

Add 'convert' program to turn existing .json files into document caches #24

Closed MaddieM4 closed 10 years ago

MaddieM4 commented 10 years ago

A document cache is a JSON-serialized version of a Document, containing a topic, a map of events, and a map of quorums.

We want to "upconvert" a lot of static JSON files into DEJE documents. Something that would accelerate the process is a converter program to turn a static JSON file into a document cache file. This is really simple - create a document cache with one SET event, setting the root object's contents to the contents of the static file.

We also want to support downconverting from a document cache to an exported snapshot (given an event hash, or event hash prefix).

djconvert up original.json deje.json
djconvert up original.json deje.json --pretty

djconvert down deje.json snapshot.json 89efc6
djconvert down deje.json snapshot.json 89efc6 --pretty