HelloZeroNet/Documentation

Diff update, how does it work?

MuxZeroNet opened this issue · 3 comments

Please explain the format of file diffs, and add the explanation/specification to the docs.

I just added explanation for this: https://zeronet.readthedocs.io/en/latest/help_zeronet/network_protocol/#update-site-inner_path-body-diffs

The diff is generated and the patch is applied by util/Diff.py file.
Currently when you write a .json file using the API the current one will be renames to .json-old, then on publish it will diff this and the current .json

The content.json is not diff/patched currently, but it's planned as sending updates on large content.json files could waste lots of bw.

If the diff key is present, should the program ignore the body key?

The body contains the new content.json, the diffs contains the diff opcodes for the other changed files.