Giter VIP home page Giter VIP logo

Comments (7)

lmars avatar lmars commented on June 9, 2024 1

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.

cobordism avatar cobordism commented on June 9, 2024

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.

cobordism avatar cobordism commented on June 9, 2024

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.

lmars avatar lmars commented on June 9, 2024

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.

xrn avatar xrn commented on June 9, 2024

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.

lmars avatar lmars commented on June 9, 2024

@holisticode why is this closed, did we fix it?

from swarm.

holisticode avatar holisticode commented on June 9, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.