Comments (4)
Relevant code snippets from BigfilePlugin.py
content["files_optional"][file_relative_path] = {
"sha512": merkle_root,
"size": upload_info["size"],
"piecemap": piecemap_relative_path,
"piece_size": piece_size
}
# ...
return {
"merkle_root": merkle_root,
"piece_num": len(piecemap_info["sha512_pieces"]),
"piece_size": piece_size,
"inner_path": inner_path
}
# ...
def hashBigfile(self, file_in, size, piece_size=1024 * 1024, file_out=None):
# method source code...
Relevant code snippets from the unit tests.
merkle_root, piece_size, piecemap_info = site.content_manager.hashBigfile(...)
piecemap_info["sha512_pieces"][0].encode("hex")
msgpack.pack({file_name: piecemap_info}, stream)
assert file_node["piecemap"] == inner_path + ".piecemap.msgpack"
assert piecemap["sha512_pieces"][0].encode("hex") == \
"a73abad9992b3d0b672d0c2a292046695d31bebdcb1e150c8410bbe7c972eff3"
from documentation.
Thanks for the suggestions it really helped :)
I have added the informations to the docs: https://zeronet.readthedocs.io/en/latest/help_zeronet/network_protocol/#bigfile-plugin
How big files are hashed. How merkle trees are made.
https://zeronet.readthedocs.io/en/latest/help_zeronet/network_protocol/#bigfile-merkle-root
How a big file is represented in content.json
https://zeronet.readthedocs.io/en/latest/help_zeronet/network_protocol/#bigfile-piecemap
Does big file support introduce changes to the network protocol?
Yes, getPieceFields and setPieceFields
What are the preferred ways to store an incomplete big file?
The ZeroNet client creates a sparse file with the final size of the big file at the beginning of the download process. (requires to use fsutil command on windows)
The status of the current specification.
It's already implemented and being used, but nothing is written in stone :)
from documentation.
Packed format:
Turns the string to an list of int by counting the repeating characters starting with 1.
Example:1110000001
to[3, 6, 1]
,0000000001
to[0, 9, 1]
,1111111111
to[10]
Checker-board pattern?
Y | N | Y |
---|---|---|
3 | 6 | 1 |
Y | N | Y |
---|---|---|
0 | 9 | 1 |
Y |
---|
10 |
from documentation.
Yes it assumes most of picefield will not be fragmented and users will download pieces in batches.
from documentation.
Related Issues (20)
- Is Documentation accessible to everyone ? HOT 1
- Description of PoW based ID providers needed HOT 1
- Missing logo on english documentation HOT 5
- Support Chinese Search HOT 1
- Code example for signing content.json HOT 1
- Namecoin example should be updated HOT 1
- Documentation of Multiuser plugin
- Document the different types of ZeroFrame responses (in WebSocket)
- Make JavaScript the default for examples HOT 1
- Document feeds section of content.json
- How does Zeronet work with Tor? HOT 2
- Namecoin buy tip not work anymore
- Broken link in FAQ HOT 1
- Instructions to use with Tor Browser in the FAQ are out of date HOT 1
- [INF] Working on Italian version HOT 3
- Update the faq ZH version
- MORE SCREENSHOTS on Intro Page Leads to 404 HOT 1
- tor section is outdated HOT 2
- Zeronet with Tor on Linux - more universal and work instructions
- build documentation fails HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from documentation.