# HG changeset patch # User neko259 # Date 2015-05-20 14:32:32 # Node ID 762bb5078ec527226a73a8295e1225f4dbc581de # Parent d679decc9ebf2680b853778b8b8014632f62b15a Moved the samples to the protocol document. Title the protocol "DIP" and number its first document diff --git a/docs/sync.markdown b/docs/dip-1.markdown rename from docs/sync.markdown rename to docs/dip-1.markdown --- a/docs/sync.markdown +++ b/docs/dip-1.markdown @@ -1,10 +1,16 @@ +# 0 Title # + +DIP-1 Common protocol description + # 1 Intro # -This document describes the server sync protocol. +This document describes the Data Interchange Protocol (DIP), designed to +exchange filtered data that can be stored as a graph structure between +network nodes. # 2 Purpose # -This protocol will be used to share the models (currently imageboard posts) +This protocol will be used to share the models (originally imageboard posts) across multiple servers. The main differnce of this protocol is that the node can specify what models it wants to get and from whom. The nodes can get models from a specific server, or from all except some specific servers. Also @@ -14,7 +20,7 @@ the models can be filtered by timestamps The node requests other node's changes list since some time (since epoch if this is the start). The other node sends a list of post ids or posts in the -XML or JSON format. +XML format. Protocol version is the version of the sync api. Model version is the version of data models. If at least one of them is different, the sync cannot be @@ -60,9 +66,119 @@ The server is required to return the sta "pull" request gets the desired model id list by the given filter (e.g. thread, tags, author) +Sample request is as follows: + + + + + 0 + 0 + + tag1 + + + + abcehy3h9t + ehoehyoe + + + + + + +Under the tag there are filters. Filters for the "post" model can +be found in DIP-2. + +Sample response: + + + + success + + + + + + + + ### 3.1.2 get ### -"get" gets models by id list +"get" gets models by id list. + +Sample request: + + + + + + + + + +Id consists of a key, key type and local id. This key is used for signing and +validating of data in the model content. + +Sample response: + + + + + success + + + + + + 13 + Thirteen + + 12 + + + + TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sIGJ1dCBieSB0 + aGlzIHNpbmd1bGFyIHBhc3Npb24gZnJvbSBvdGhlciBhbmltYWxzLCB3aGljaCBpcyBhIGx1 + c3Qgb2YgdGhlIG1pbmQsIHRoYXQgYnkgYSBwZXJzZXZlcmFuY2Ugb2YgZGVsaWdodCBpbiB0 + aGUgY29udGludWVkIGFuZCBpbmRlZmF0aWdhYmxlIGdlbmVyYXRpb24gb2Yga25vd2xlZGdl + LCBleGNlZWRzIHRoZSBzaG9ydCB2ZWhlbWVuY2Ugb2YgYW55IGNhcm5hbCBwbGVhc3VyZS4= + + + + + + + + + + + + + 13 + Thirteen + 12 + 13 + + tag1 + + + + + + + + ### 3.1.3 put ### @@ -78,7 +194,7 @@ across the pool. If the request if completely not supported, a "not supported" status will be returned. -### 3.2.2 "success"" ### +### 3.2.2 "success" ### "success" status means the request was processed and the result is returned. diff --git a/docs/samples/request_get.xml b/docs/samples/request_get.xml deleted file mode 100644 --- a/docs/samples/request_get.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/docs/samples/request_pull.xml b/docs/samples/request_pull.xml deleted file mode 100644 --- a/docs/samples/request_pull.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - 0 - 0 - - tag1 - - - - abcehy3h9t - ehoehyoe - - - - - diff --git a/docs/samples/response_get.xml b/docs/samples/response_get.xml deleted file mode 100644 --- a/docs/samples/response_get.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - - success - - - - - - 13 - Thirteen - - 12 - - - - TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sIGJ1dCBieSB0 - aGlzIHNpbmd1bGFyIHBhc3Npb24gZnJvbSBvdGhlciBhbmltYWxzLCB3aGljaCBpcyBhIGx1 - c3Qgb2YgdGhlIG1pbmQsIHRoYXQgYnkgYSBwZXJzZXZlcmFuY2Ugb2YgZGVsaWdodCBpbiB0 - aGUgY29udGludWVkIGFuZCBpbmRlZmF0aWdhYmxlIGdlbmVyYXRpb24gb2Yga25vd2xlZGdl - LCBleGNlZWRzIHRoZSBzaG9ydCB2ZWhlbWVuY2Ugb2YgYW55IGNhcm5hbCBwbGVhc3VyZS4= - - - - - - - - - - - - - 13 - Thirteen - 12 - 13 - - tag1 - - - - - - - - diff --git a/docs/samples/response_pull.xml b/docs/samples/response_pull.xml deleted file mode 100644 --- a/docs/samples/response_pull.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - success - - - - - - - diff --git a/docs/samples/response_versionmismatch.xml b/docs/samples/response_versionmismatch.xml deleted file mode 100644 --- a/docs/samples/response_versionmismatch.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - error - - protocol version mismatch -