3 ms·
Small nitpick, I ran the example and found I could only create 3 blocks. (I'm on ubuntu if that matters) looking more into it, it seems like the issues is the
by swalsh 9y ago
Small nitpick, I ran the example and found I could only create 3 blocks. (I'm on ubuntu if that matters) looking more into it, it seems like the issues is the glob.glob in sync.py is not always read in order so the chain is out of order. My solution was to move the add block to chain call lower, and to sort the blocks first. After changing that code it seemed to work fine.
- jackschultz 9y agoAhh yeah, on a Mac, using os.list_dir leaves 10.json ahead of 2.json. I heard from someone else on Linux that had that problem. If you have the code that works would you make a pull request and I'll throw that in?
- aisofteng 9y agoThis is pretty universal. Use lexicographic sorting.
- jackschultz 9y agoWell yes. That's why I put at least 6 characters of 0 in front of the index of a block,so the filenames were 000001.json, and used glob rather than list_dir. But that didn't work for Linux.