Comments (7)
So my original comment was incorrect, using swarm up
with the same data creates the same hash because it uses a tar upload, which sets the mod time to the mod time of the file:
# create a file
$ echo data > file.txt
# note the modified time
$ stat -c '%y' file.txt
2018-01-24 18:38:49.000000000 +0000
# upload the file multiple times, get the same hash
$ swarm up file.txt
a87da99aa2f3a574dd74beca0922763d80a7cce2c3bade49f9aba8cbbd898272
$ swarm up file.txt
a87da99aa2f3a574dd74beca0922763d80a7cce2c3bade49f9aba8cbbd898272
# same for a manual tar upload
$ tar cf - file.txt | curl -X POST -H "Content-Type: application/x-tar" --data-binary @- http://localhost:8500/bzz:/
f4058423fb14fe73cd51064628b6a736ba916273198429b7d2980727ed7e5767
$ tar cf - file.txt | curl -X POST -H "Content-Type: application/x-tar" --data-binary @- http://localhost:8500/bzz:/
f4058423fb14fe73cd51064628b6a736ba916273198429b7d2980727ed7e5767
So it seems the issue is just with multipart-form uploads, where there is no concept of a mod time, so the server just picks the current time.
from swarm.
suggestion: 1) make it optional 2) set the default as using the mod_time of the file/dir itself and not the current time. So even if I upload the same file at two different times and have mod_time turned on, I get the same hash.
from swarm.
so what do you suggest we do @lmars?
the issue is just with multipart-form uploads
Should they default to having no mod_time set or should they explicitly ask for a time, or ...?
from swarm.
I think we should remove the default mod-time, and support a custom header to set it via multipart uploads (it is not the intended use, but we could consult the Last-Modified
header in the request).
from swarm.
Hi guys !
Another day another question in my mind - i have hash of resource on swarm - like XXX i did it just by "up" command this is not Mutable Resource (here i have meta fields). Is an option to get metadata of this XXX "file" - when was created (current timestamp) and who is the owner (public key / address / digital signature?) - if this is not possible by up command how can I upload file to have this meta data (it can not be set via user it need to be set via network like timestamp of block)
Sorry if this question is stupid I made 1h research and I cannot find proper answer. I found only https://swarm-guide.readthedocs.io/en/latest/usage.html#manifests but "mod_time" is setting time from uploader machine - in my case this is not what i need - I need global timestamp.
from swarm.
@holisticode why is this closed, did we fix it?
from swarm.
I am not sure.
We were rearranging tickets in the swarm board that day during the roundtable, and @zelig requested me to drive the session, so I was sharing my screen and moving tickets around.
I have no clear memory of this specific ticket. It may have happened by mistake or on instruction. @zelig please review
from swarm.
Related Issues (20)
- bug: sometimes serves index.html files within a folder, sometimes does not
- repair globally pinned content without manifest HOT 4
- pinned content disappears when gc is triggered multiple times HOT 2
- add push-sync flag HOT 1
- use bzzaccounts as publishers in global pinning HOT 1
- fix conflict between garbage collection and push sync HOT 1
- fix content recovery request flooding HOT 1
- add global pinning logs HOT 1
- add global pinning simulation test
- flood of recovery requests
- lookup timeout on feed content recovery
- Files from specific sizes instantly disappear after encryption HOT 1
- Swarm Go.1.14 Build FAILED HOT 1
- Files from a Feed are cached by browser HOT 3
- Incompatible with latest go-ethereum v1.9.23 HOT 2
- Does swarm support IPv6 network?
- Deprecation notice HOT 4
- Bzzaar rejected by infura
- Swarm HOT 1
- Error: provided network ID does not match mainnet 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 swarm.