[bisq-network/bisq] Reduce initial request size (#4233)

Florian Reimair notifications at github.com
Fri May 22 08:15:19 UTC 2020


@freimair commented on this pull request.



> +        store = readStore(getFileName());
+
+        // create file list of files we should have by now
+        List<String> versions = new ArrayList<>();
+        versions.add(Version.VERSION);
+        versions.addAll(Version.history);
+
+        // go through the list one by one
+        versions.forEach(version -> {
+            String filename = getFileName() + "_" + version + postFix; // postFix has a preceding "_"
+            if (new File(absolutePathOfStorageDir, filename).exists()) {
+                // if it is there already, load
+                history.put(version, readStore(getFileName() + "_" + version));
+            } else {
+                // either copy and split
+                history.put(version, copyAndSplit(version, postFix));

> make an identical copy of the resource data and put a version number on it.

I believe you got it already. We rename the resource files and stick a "version" to it manually. So eg. with 1.3.6 we ship 3 stores: name_1.3.4_BTC_MAINNET, name_1.3.5_BTC_MAINNET, name_1.3.6_BTC_MAINNET. Then, as copyAndSplit knows about the version, each file is copied if necessary.

- the storage format remains the same. It is still Protobuf and files.
- `name_1.3.4_BTC_MAINNET` yes, exactly (I will be renaming the files in the PR once all is said and done)
- but in the future, there is not one big data store, but multiple - one for each release of Bisq
- why multiple?
  - because then we get some time relations and thus, chronological order. Once we have some order, we can start deciding which parts we keep in RAM (not in this PR, but down the line)
  - reduce the amount of data added to the repository by each release (deprecated by https://github.com/bisq-network/bisq/pull/4114)
  - in the long run, keep small chunks if possible

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/4233#discussion_r429106970
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20200522/fbbb36a5/attachment.html>


More information about the bisq-github mailing list