These are chat archives for ethersphere/orange-lounge

14th
Feb 2018
holisticode
@holisticode
Feb 14 15:46
With this code:
size := chunkCount * chunkSize
dpa := storage.NewDPA(lstore, storage.NewChunkerParams())
dpa.Start()
rootkey, wait, err := dpa.Store(io.LimitReader(crand.Reader, int64(size)), int64(size))
rootkey is like, well, the root key of all four chunks? like a file?
in other words, I don't have access to the individual chunks?
I guess then to test retrieval of single chunks, it's ok to iterate over chunkCount and store each chunk's key for later checks on local store(s) availability?
Janoš Guljaš
@janos
Feb 14 15:53
yes, the rootKey is the hash of the file, I suppose that iterating over dbstore could be used to get chunk keys
holisticode
@holisticode
Feb 14 15:54
you mean like just getting all chunk keys because the the store has been initialized empty?
Janoš Guljaš
@janos
Feb 14 15:55
yes, that is right
holisticode
@holisticode
Feb 14 15:55
502   for i:=0; i<chunkCount; i++ {
503     dpa := storage.NewDPA(lstore, storage.NewChunkerParams())
504     dpa.Start()
505     rootkey[i], wait, err := dpa.Store(io.LimitReader(crand.Reader, int64(size)), int64(size))
506     wait()
507    }
I was thinking to do something like the above
well I guess lines 503 and 504 can go outside the loop, but just to convey the idea
Janoš Guljaš
@janos
Feb 14 15:57
to upload the same number of files as the chunk count is?
holisticode
@holisticode
Feb 14 15:57
I think I need to give more info about what I am doing :)
Janoš Guljaš
@janos
Feb 14 15:58
yes :)
holisticode
@holisticode
Feb 14 15:58
I am doing a test where I upload a number of chunks to one node, then check on other nodes if they have been synced
as chunks would end up at different nodes
I need to check each chunk individually to see if the expected node(s) have it
Janoš Guljaš
@janos
Feb 14 15:59
could this be done with only one file upload?
holisticode
@holisticode
Feb 14 15:59
If I upload a file (more than 1 chunk), then I don't directly have the keys of the individual chunks, do I?
only the root key
Janoš Guljaš
@janos
Feb 14 16:01
yes, but the chunk keys to check should be accessible from the localstore
holisticode
@holisticode
Feb 14 16:01
right
Janoš Guljaš
@janos
Feb 14 16:01
but, your suggestion would make the test easier
holisticode
@holisticode
Feb 14 16:01
but if I iterate like my last snippets, then I have the chunk keys right away in an array ]
yes
:)
thanks!
Janoš Guljaš
@janos
Feb 14 16:01
:)
Elad Verbin
@eladve
Feb 14 16:32
Hi all! Here is a technical manuscript about Swarm security.
https://docs.google.com/document/d/1Pkj-pwMTlPyrGb3qtODV536FdJoT2IxX1PgNK8tM1FY/edit?usp=sharing
Any comments will be greatly appreciated! (In the document, or via email at elad.verbin@gmail.com )