envio 3.12.1 → 3.13.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/package.json +6 -6
  2. package/src/BatchProcessing.res +9 -9
  3. package/src/BatchProcessing.res.mjs +5 -5
  4. package/src/Bin.res +24 -17
  5. package/src/Bin.res.mjs +5 -0
  6. package/src/ChainFetching.res +24 -10
  7. package/src/ChainFetching.res.mjs +8 -3
  8. package/src/ChainState.res +43 -0
  9. package/src/ChainState.res.mjs +43 -0
  10. package/src/ChainState.resi +2 -0
  11. package/src/Config.res +35 -0
  12. package/src/Config.res.mjs +39 -0
  13. package/src/Core.res +4 -0
  14. package/src/Core.res.mjs +4 -0
  15. package/src/CrossChainState.res +60 -3
  16. package/src/CrossChainState.res.mjs +38 -4
  17. package/src/CrossChainState.resi +10 -1
  18. package/src/Env.res +4 -0
  19. package/src/IndexerLoop.res +2 -0
  20. package/src/IndexerLoop.res.mjs +1 -0
  21. package/src/IndexerState.res +41 -1
  22. package/src/IndexerState.res.mjs +43 -4
  23. package/src/IndexerState.resi +10 -0
  24. package/src/Logging.res +38 -6
  25. package/src/Logging.res.mjs +32 -5
  26. package/src/Main.res +131 -268
  27. package/src/Main.res.mjs +28 -152
  28. package/src/Metrics.res +263 -102
  29. package/src/Metrics.res.mjs +227 -48
  30. package/src/Persistence.res +27 -2
  31. package/src/Persistence.res.mjs +9 -2
  32. package/src/PgStorage.res +17 -9
  33. package/src/PgStorage.res.mjs +11 -8
  34. package/src/Server.res +181 -0
  35. package/src/Server.res.mjs +143 -0
  36. package/src/Supervisor.res +415 -0
  37. package/src/Supervisor.res.mjs +325 -0
  38. package/src/TestIndexer.res.mjs +1 -1
  39. package/src/Worker.res +95 -0
  40. package/src/Worker.res.mjs +80 -0
  41. package/src/bindings/NodeJs.res +41 -0
  42. package/src/db/InternalTable.res +8 -1
  43. package/src/db/InternalTable.res.mjs +5 -1
  44. package/src/tui/Tui.res +24 -0
  45. package/src/tui/Tui.res.mjs +18 -0
  46. package/src/tui/components/SyncETA.res +12 -6
  47. package/src/tui/components/SyncETA.res.mjs +12 -8
@@ -1,12 +1,18 @@
1
1
  open Ink
2
2
 
3
3
  let isIndexerFullySynced = (chains: array<TuiData.chain>) => {
4
- chains->Array.reduce(true, (accum, current) => {
5
- switch current.progress {
6
- | Synced(_) => accum
7
- | _ => false
8
- }
9
- })
4
+ switch chains {
5
+ // A supervised run draws its first frame before any worker has reported, and
6
+ // a run with nothing to report hasn't finished syncing.
7
+ | [] => false
8
+ | chains =>
9
+ chains->Array.every(chain =>
10
+ switch chain.progress {
11
+ | Synced(_) => true
12
+ | _ => false
13
+ }
14
+ )
15
+ }
10
16
  }
11
17
 
12
18
  let getTotalRemainingBlocks = (chains: array<TuiData.chain>) => {
@@ -9,14 +9,18 @@ import * as Primitive_float from "@rescript/runtime/lib/es6/Primitive_float.js";
9
9
  import * as JsxRuntime from "react/jsx-runtime";
10
10
 
11
11
  function isIndexerFullySynced(chains) {
12
- return Stdlib_Array.reduce(chains, true, (accum, current) => {
13
- let match = current.progress;
14
- if (typeof match !== "object" || match.TAG === "Syncing") {
15
- return false;
16
- } else {
17
- return accum;
18
- }
19
- });
12
+ if (chains.length !== 0) {
13
+ return chains.every(chain => {
14
+ let match = chain.progress;
15
+ if (typeof match !== "object") {
16
+ return false;
17
+ } else {
18
+ return match.TAG !== "Syncing";
19
+ }
20
+ });
21
+ } else {
22
+ return false;
23
+ }
20
24
  }
21
25
 
22
26
  function getTotalRemainingBlocks(chains) {