@xyo-network/xl1-cli-lib 1.7.4

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 (296) hide show
  1. package/LICENSE +165 -0
  2. package/README.md +46 -0
  3. package/dist/node/commands/api/index.d.ts +2 -0
  4. package/dist/node/commands/api/index.d.ts.map +1 -0
  5. package/dist/node/commands/api/runApi.d.ts +9 -0
  6. package/dist/node/commands/api/runApi.d.ts.map +1 -0
  7. package/dist/node/commands/index.d.ts +4 -0
  8. package/dist/node/commands/index.d.ts.map +1 -0
  9. package/dist/node/commands/producer/index.d.ts +2 -0
  10. package/dist/node/commands/producer/index.d.ts.map +1 -0
  11. package/dist/node/commands/producer/runProducer.d.ts +11 -0
  12. package/dist/node/commands/producer/runProducer.d.ts.map +1 -0
  13. package/dist/node/commands/validator/index.d.ts +2 -0
  14. package/dist/node/commands/validator/index.d.ts.map +1 -0
  15. package/dist/node/commands/validator/runValidator.d.ts +11 -0
  16. package/dist/node/commands/validator/runValidator.d.ts.map +1 -0
  17. package/dist/node/images.d.ts +2 -0
  18. package/dist/node/images.d.ts.map +1 -0
  19. package/dist/node/index.d.ts +4 -0
  20. package/dist/node/index.d.ts.map +1 -0
  21. package/dist/node/index.mjs +1712 -0
  22. package/dist/node/index.mjs.map +1 -0
  23. package/dist/node/initConfig.d.ts +3 -0
  24. package/dist/node/initConfig.d.ts.map +1 -0
  25. package/dist/node/initLogger.d.ts +4 -0
  26. package/dist/node/initLogger.d.ts.map +1 -0
  27. package/dist/node/optionsFromZodSchema.d.ts +4 -0
  28. package/dist/node/optionsFromZodSchema.d.ts.map +1 -0
  29. package/dist/node/orchestration/ChainInitializableParams.d.ts +11 -0
  30. package/dist/node/orchestration/ChainInitializableParams.d.ts.map +1 -0
  31. package/dist/node/orchestration/actor/implementation/BalanceActor.d.ts +18 -0
  32. package/dist/node/orchestration/actor/implementation/BalanceActor.d.ts.map +1 -0
  33. package/dist/node/orchestration/actor/implementation/ChainHeadUpdateActor.d.ts +19 -0
  34. package/dist/node/orchestration/actor/implementation/ChainHeadUpdateActor.d.ts.map +1 -0
  35. package/dist/node/orchestration/actor/implementation/ProducerActor.d.ts +28 -0
  36. package/dist/node/orchestration/actor/implementation/ProducerActor.d.ts.map +1 -0
  37. package/dist/node/orchestration/actor/implementation/ValidatorActor.d.ts +26 -0
  38. package/dist/node/orchestration/actor/implementation/ValidatorActor.d.ts.map +1 -0
  39. package/dist/node/orchestration/actor/implementation/index.d.ts +5 -0
  40. package/dist/node/orchestration/actor/implementation/index.d.ts.map +1 -0
  41. package/dist/node/orchestration/actor/index.d.ts +3 -0
  42. package/dist/node/orchestration/actor/index.d.ts.map +1 -0
  43. package/dist/node/orchestration/actor/model/Actor.d.ts +39 -0
  44. package/dist/node/orchestration/actor/model/Actor.d.ts.map +1 -0
  45. package/dist/node/orchestration/actor/model/Orchestrator.d.ts +27 -0
  46. package/dist/node/orchestration/actor/model/Orchestrator.d.ts.map +1 -0
  47. package/dist/node/orchestration/actor/model/index.d.ts +3 -0
  48. package/dist/node/orchestration/actor/model/index.d.ts.map +1 -0
  49. package/dist/node/orchestration/archivists/ChainFinalized/archivist.d.ts +4 -0
  50. package/dist/node/orchestration/archivists/ChainFinalized/archivist.d.ts.map +1 -0
  51. package/dist/node/orchestration/archivists/ChainFinalized/index.d.ts +2 -0
  52. package/dist/node/orchestration/archivists/ChainFinalized/index.d.ts.map +1 -0
  53. package/dist/node/orchestration/archivists/ChainFinalized/local.d.ts +7 -0
  54. package/dist/node/orchestration/archivists/ChainFinalized/local.d.ts.map +1 -0
  55. package/dist/node/orchestration/archivists/ChainFinalized/remote.d.ts +7 -0
  56. package/dist/node/orchestration/archivists/ChainFinalized/remote.d.ts.map +1 -0
  57. package/dist/node/orchestration/archivists/ChainSubmissions/archivist.d.ts +7 -0
  58. package/dist/node/orchestration/archivists/ChainSubmissions/archivist.d.ts.map +1 -0
  59. package/dist/node/orchestration/archivists/ChainSubmissions/index.d.ts +2 -0
  60. package/dist/node/orchestration/archivists/ChainSubmissions/index.d.ts.map +1 -0
  61. package/dist/node/orchestration/archivists/ChainSubmissions/remote.d.ts +7 -0
  62. package/dist/node/orchestration/archivists/ChainSubmissions/remote.d.ts.map +1 -0
  63. package/dist/node/orchestration/archivists/PendingTransactions/archivist.d.ts +6 -0
  64. package/dist/node/orchestration/archivists/PendingTransactions/archivist.d.ts.map +1 -0
  65. package/dist/node/orchestration/archivists/PendingTransactions/index.d.ts +2 -0
  66. package/dist/node/orchestration/archivists/PendingTransactions/index.d.ts.map +1 -0
  67. package/dist/node/orchestration/archivists/PendingTransactions/local.d.ts +7 -0
  68. package/dist/node/orchestration/archivists/PendingTransactions/local.d.ts.map +1 -0
  69. package/dist/node/orchestration/archivists/PendingTransactions/remote.d.ts +7 -0
  70. package/dist/node/orchestration/archivists/PendingTransactions/remote.d.ts.map +1 -0
  71. package/dist/node/orchestration/archivists/RejectedTransactions/archivist.d.ts +4 -0
  72. package/dist/node/orchestration/archivists/RejectedTransactions/archivist.d.ts.map +1 -0
  73. package/dist/node/orchestration/archivists/RejectedTransactions/index.d.ts +2 -0
  74. package/dist/node/orchestration/archivists/RejectedTransactions/index.d.ts.map +1 -0
  75. package/dist/node/orchestration/archivists/RejectedTransactions/local.d.ts +4 -0
  76. package/dist/node/orchestration/archivists/RejectedTransactions/local.d.ts.map +1 -0
  77. package/dist/node/orchestration/archivists/StakeIntentState/archivist.d.ts +5 -0
  78. package/dist/node/orchestration/archivists/StakeIntentState/archivist.d.ts.map +1 -0
  79. package/dist/node/orchestration/archivists/StakeIntentState/index.d.ts +2 -0
  80. package/dist/node/orchestration/archivists/StakeIntentState/index.d.ts.map +1 -0
  81. package/dist/node/orchestration/archivists/StakeIntentState/local.d.ts +7 -0
  82. package/dist/node/orchestration/archivists/StakeIntentState/local.d.ts.map +1 -0
  83. package/dist/node/orchestration/archivists/index.d.ts +6 -0
  84. package/dist/node/orchestration/archivists/index.d.ts.map +1 -0
  85. package/dist/node/orchestration/archivists/lib/index.d.ts +2 -0
  86. package/dist/node/orchestration/archivists/lib/index.d.ts.map +1 -0
  87. package/dist/node/orchestration/archivists/lib/localPersistentArchivist.d.ts +20 -0
  88. package/dist/node/orchestration/archivists/lib/localPersistentArchivist.d.ts.map +1 -0
  89. package/dist/node/orchestration/health/index.d.ts +2 -0
  90. package/dist/node/orchestration/health/index.d.ts.map +1 -0
  91. package/dist/node/orchestration/health/initHealthEndpoints.d.ts +11 -0
  92. package/dist/node/orchestration/health/initHealthEndpoints.d.ts.map +1 -0
  93. package/dist/node/orchestration/host/implementation/DefaultHost.d.ts +12 -0
  94. package/dist/node/orchestration/host/implementation/DefaultHost.d.ts.map +1 -0
  95. package/dist/node/orchestration/host/implementation/DefaultServiceCollection.d.ts +24 -0
  96. package/dist/node/orchestration/host/implementation/DefaultServiceCollection.d.ts.map +1 -0
  97. package/dist/node/orchestration/host/implementation/DefaultServiceProvider.d.ts +7 -0
  98. package/dist/node/orchestration/host/implementation/DefaultServiceProvider.d.ts.map +1 -0
  99. package/dist/node/orchestration/host/implementation/index.d.ts +3 -0
  100. package/dist/node/orchestration/host/implementation/index.d.ts.map +1 -0
  101. package/dist/node/orchestration/host/index.d.ts +3 -0
  102. package/dist/node/orchestration/host/index.d.ts.map +1 -0
  103. package/dist/node/orchestration/host/model/Host.d.ts +19 -0
  104. package/dist/node/orchestration/host/model/Host.d.ts.map +1 -0
  105. package/dist/node/orchestration/host/model/ServiceCollection.d.ts +20 -0
  106. package/dist/node/orchestration/host/model/ServiceCollection.d.ts.map +1 -0
  107. package/dist/node/orchestration/host/model/ServiceProvider.d.ts +4 -0
  108. package/dist/node/orchestration/host/model/ServiceProvider.d.ts.map +1 -0
  109. package/dist/node/orchestration/host/model/index.d.ts +4 -0
  110. package/dist/node/orchestration/host/model/index.d.ts.map +1 -0
  111. package/dist/node/orchestration/index.d.ts +6 -0
  112. package/dist/node/orchestration/index.d.ts.map +1 -0
  113. package/dist/node/orchestration/initServices.d.ts +9 -0
  114. package/dist/node/orchestration/initServices.d.ts.map +1 -0
  115. package/dist/node/orchestration/map/BalanceSummary/index.d.ts +2 -0
  116. package/dist/node/orchestration/map/BalanceSummary/index.d.ts.map +1 -0
  117. package/dist/node/orchestration/map/BalanceSummary/initBalanceSummaryMap.d.ts +7 -0
  118. package/dist/node/orchestration/map/BalanceSummary/initBalanceSummaryMap.d.ts.map +1 -0
  119. package/dist/node/orchestration/map/BalanceSummary/local.d.ts +7 -0
  120. package/dist/node/orchestration/map/BalanceSummary/local.d.ts.map +1 -0
  121. package/dist/node/orchestration/map/driver/index.d.ts +2 -0
  122. package/dist/node/orchestration/map/driver/index.d.ts.map +1 -0
  123. package/dist/node/orchestration/map/driver/lmdb/Params.d.ts +7 -0
  124. package/dist/node/orchestration/map/driver/lmdb/Params.d.ts.map +1 -0
  125. package/dist/node/orchestration/map/driver/lmdb/SynchronousLmdbMap.d.ts +32 -0
  126. package/dist/node/orchestration/map/driver/lmdb/SynchronousLmdbMap.d.ts.map +1 -0
  127. package/dist/node/orchestration/map/driver/lmdb/index.d.ts +2 -0
  128. package/dist/node/orchestration/map/driver/lmdb/index.d.ts.map +1 -0
  129. package/dist/node/orchestration/map/driver/lmdb/spec/SynchronousLmdbMap.spec.d.ts +2 -0
  130. package/dist/node/orchestration/map/driver/lmdb/spec/SynchronousLmdbMap.spec.d.ts.map +1 -0
  131. package/dist/node/orchestration/map/index.d.ts +3 -0
  132. package/dist/node/orchestration/map/index.d.ts.map +1 -0
  133. package/dist/node/orchestration/map/localPersistentMap.d.ts +13 -0
  134. package/dist/node/orchestration/map/localPersistentMap.d.ts.map +1 -0
  135. package/dist/node/orchestration/repository/index.d.ts +2 -0
  136. package/dist/node/orchestration/repository/index.d.ts.map +1 -0
  137. package/dist/node/orchestration/repository/lib/index.d.ts +2 -0
  138. package/dist/node/orchestration/repository/lib/index.d.ts.map +1 -0
  139. package/dist/node/orchestration/repository/lib/repositoryFromArchivist.d.ts +6 -0
  140. package/dist/node/orchestration/repository/lib/repositoryFromArchivist.d.ts.map +1 -0
  141. package/dist/node/orchestration/services/implementation/account.d.ts +7 -0
  142. package/dist/node/orchestration/services/implementation/account.d.ts.map +1 -0
  143. package/dist/node/orchestration/services/implementation/balance.d.ts +4 -0
  144. package/dist/node/orchestration/services/implementation/balance.d.ts.map +1 -0
  145. package/dist/node/orchestration/services/implementation/chain/evm.d.ts +7 -0
  146. package/dist/node/orchestration/services/implementation/chain/evm.d.ts.map +1 -0
  147. package/dist/node/orchestration/services/implementation/chain/index.d.ts +4 -0
  148. package/dist/node/orchestration/services/implementation/chain/index.d.ts.map +1 -0
  149. package/dist/node/orchestration/services/implementation/evm/index.d.ts +2 -0
  150. package/dist/node/orchestration/services/implementation/evm/index.d.ts.map +1 -0
  151. package/dist/node/orchestration/services/implementation/evm/initChainId.d.ts +4 -0
  152. package/dist/node/orchestration/services/implementation/evm/initChainId.d.ts.map +1 -0
  153. package/dist/node/orchestration/services/implementation/evm/initEvmProvider.d.ts +11 -0
  154. package/dist/node/orchestration/services/implementation/evm/initEvmProvider.d.ts.map +1 -0
  155. package/dist/node/orchestration/services/implementation/evm/initInfuraProvider.d.ts +6 -0
  156. package/dist/node/orchestration/services/implementation/evm/initInfuraProvider.d.ts.map +1 -0
  157. package/dist/node/orchestration/services/implementation/evm/initJsonRpcProvider.d.ts +6 -0
  158. package/dist/node/orchestration/services/implementation/evm/initJsonRpcProvider.d.ts.map +1 -0
  159. package/dist/node/orchestration/services/implementation/head.d.ts +10 -0
  160. package/dist/node/orchestration/services/implementation/head.d.ts.map +1 -0
  161. package/dist/node/orchestration/services/implementation/index.d.ts +11 -0
  162. package/dist/node/orchestration/services/implementation/index.d.ts.map +1 -0
  163. package/dist/node/orchestration/services/implementation/iterator.d.ts +6 -0
  164. package/dist/node/orchestration/services/implementation/iterator.d.ts.map +1 -0
  165. package/dist/node/orchestration/services/implementation/pendingTransactions.d.ts +4 -0
  166. package/dist/node/orchestration/services/implementation/pendingTransactions.d.ts.map +1 -0
  167. package/dist/node/orchestration/services/implementation/producer.d.ts +4 -0
  168. package/dist/node/orchestration/services/implementation/producer.d.ts.map +1 -0
  169. package/dist/node/orchestration/services/implementation/reward.d.ts +4 -0
  170. package/dist/node/orchestration/services/implementation/reward.d.ts.map +1 -0
  171. package/dist/node/orchestration/services/implementation/validator.d.ts +4 -0
  172. package/dist/node/orchestration/services/implementation/validator.d.ts.map +1 -0
  173. package/dist/node/orchestration/services/index.d.ts +2 -0
  174. package/dist/node/orchestration/services/index.d.ts.map +1 -0
  175. package/dist/node/orchestration/status/RuntimeStatusMonitor.d.ts +31 -0
  176. package/dist/node/orchestration/status/RuntimeStatusMonitor.d.ts.map +1 -0
  177. package/dist/node/orchestration/status/ServiceStatus.d.ts +9 -0
  178. package/dist/node/orchestration/status/ServiceStatus.d.ts.map +1 -0
  179. package/dist/node/orchestration/status/index.d.ts +3 -0
  180. package/dist/node/orchestration/status/index.d.ts.map +1 -0
  181. package/dist/node/orchestration/store/StoreKind.d.ts +2 -0
  182. package/dist/node/orchestration/store/StoreKind.d.ts.map +1 -0
  183. package/dist/node/orchestration/store/getStoreDirectory.d.ts +10 -0
  184. package/dist/node/orchestration/store/getStoreDirectory.d.ts.map +1 -0
  185. package/dist/node/orchestration/store/index.d.ts +3 -0
  186. package/dist/node/orchestration/store/index.d.ts.map +1 -0
  187. package/dist/node/runCLI.d.ts +2 -0
  188. package/dist/node/runCLI.d.ts.map +1 -0
  189. package/dist/node/spec/BootstrapChain.spec.d.ts +2 -0
  190. package/dist/node/spec/BootstrapChain.spec.d.ts.map +1 -0
  191. package/dist/node/start.d.ts +2 -0
  192. package/dist/node/start.d.ts.map +1 -0
  193. package/dist/node/waitForHostPort.d.ts +2 -0
  194. package/dist/node/waitForHostPort.d.ts.map +1 -0
  195. package/dist/node/xl1.d.ts +2 -0
  196. package/dist/node/xl1.d.ts.map +1 -0
  197. package/dist/node/xl1.mjs +1610 -0
  198. package/dist/node/xl1.mjs.map +1 -0
  199. package/package.json +96 -0
  200. package/src/commands/api/index.ts +1 -0
  201. package/src/commands/api/runApi.ts +12 -0
  202. package/src/commands/index.ts +3 -0
  203. package/src/commands/producer/index.ts +1 -0
  204. package/src/commands/producer/runProducer.ts +38 -0
  205. package/src/commands/validator/index.ts +1 -0
  206. package/src/commands/validator/runValidator.ts +38 -0
  207. package/src/images.ts +19 -0
  208. package/src/index.ts +3 -0
  209. package/src/initConfig.ts +6 -0
  210. package/src/initLogger.ts +23 -0
  211. package/src/optionsFromZodSchema.ts +69 -0
  212. package/src/orchestration/ChainInitializableParams.ts +12 -0
  213. package/src/orchestration/actor/implementation/BalanceActor.ts +50 -0
  214. package/src/orchestration/actor/implementation/ChainHeadUpdateActor.ts +65 -0
  215. package/src/orchestration/actor/implementation/ProducerActor.ts +244 -0
  216. package/src/orchestration/actor/implementation/ValidatorActor.ts +113 -0
  217. package/src/orchestration/actor/implementation/index.ts +4 -0
  218. package/src/orchestration/actor/index.ts +2 -0
  219. package/src/orchestration/actor/model/Actor.ts +114 -0
  220. package/src/orchestration/actor/model/Orchestrator.ts +71 -0
  221. package/src/orchestration/actor/model/index.ts +2 -0
  222. package/src/orchestration/archivists/ChainFinalized/archivist.ts +29 -0
  223. package/src/orchestration/archivists/ChainFinalized/index.ts +1 -0
  224. package/src/orchestration/archivists/ChainFinalized/local.ts +18 -0
  225. package/src/orchestration/archivists/ChainFinalized/remote.ts +20 -0
  226. package/src/orchestration/archivists/ChainSubmissions/archivist.ts +20 -0
  227. package/src/orchestration/archivists/ChainSubmissions/index.ts +1 -0
  228. package/src/orchestration/archivists/ChainSubmissions/remote.ts +20 -0
  229. package/src/orchestration/archivists/PendingTransactions/archivist.ts +29 -0
  230. package/src/orchestration/archivists/PendingTransactions/index.ts +1 -0
  231. package/src/orchestration/archivists/PendingTransactions/local.ts +21 -0
  232. package/src/orchestration/archivists/PendingTransactions/remote.ts +20 -0
  233. package/src/orchestration/archivists/RejectedTransactions/archivist.ts +18 -0
  234. package/src/orchestration/archivists/RejectedTransactions/index.ts +1 -0
  235. package/src/orchestration/archivists/RejectedTransactions/local.ts +20 -0
  236. package/src/orchestration/archivists/StakeIntentState/archivist.ts +21 -0
  237. package/src/orchestration/archivists/StakeIntentState/index.ts +1 -0
  238. package/src/orchestration/archivists/StakeIntentState/local.ts +19 -0
  239. package/src/orchestration/archivists/index.ts +5 -0
  240. package/src/orchestration/archivists/lib/index.ts +1 -0
  241. package/src/orchestration/archivists/lib/localPersistentArchivist.ts +57 -0
  242. package/src/orchestration/health/index.ts +1 -0
  243. package/src/orchestration/health/initHealthEndpoints.ts +72 -0
  244. package/src/orchestration/host/implementation/DefaultHost.ts +25 -0
  245. package/src/orchestration/host/implementation/DefaultServiceCollection.ts +60 -0
  246. package/src/orchestration/host/implementation/DefaultServiceProvider.ts +12 -0
  247. package/src/orchestration/host/implementation/index.ts +2 -0
  248. package/src/orchestration/host/index.ts +2 -0
  249. package/src/orchestration/host/model/Host.ts +21 -0
  250. package/src/orchestration/host/model/ServiceCollection.ts +22 -0
  251. package/src/orchestration/host/model/ServiceProvider.ts +3 -0
  252. package/src/orchestration/host/model/index.ts +3 -0
  253. package/src/orchestration/index.ts +5 -0
  254. package/src/orchestration/initServices.ts +240 -0
  255. package/src/orchestration/map/BalanceSummary/index.ts +1 -0
  256. package/src/orchestration/map/BalanceSummary/initBalanceSummaryMap.ts +22 -0
  257. package/src/orchestration/map/BalanceSummary/local.ts +21 -0
  258. package/src/orchestration/map/driver/index.ts +1 -0
  259. package/src/orchestration/map/driver/lmdb/Params.ts +7 -0
  260. package/src/orchestration/map/driver/lmdb/SynchronousLmdbMap.ts +66 -0
  261. package/src/orchestration/map/driver/lmdb/index.ts +1 -0
  262. package/src/orchestration/map/driver/lmdb/spec/SynchronousLmdbMap.spec.ts +97 -0
  263. package/src/orchestration/map/index.ts +2 -0
  264. package/src/orchestration/map/localPersistentMap.ts +52 -0
  265. package/src/orchestration/repository/index.ts +1 -0
  266. package/src/orchestration/repository/lib/index.ts +1 -0
  267. package/src/orchestration/repository/lib/repositoryFromArchivist.ts +27 -0
  268. package/src/orchestration/services/implementation/account.ts +24 -0
  269. package/src/orchestration/services/implementation/balance.ts +13 -0
  270. package/src/orchestration/services/implementation/chain/evm.ts +38 -0
  271. package/src/orchestration/services/implementation/chain/index.ts +22 -0
  272. package/src/orchestration/services/implementation/evm/index.ts +1 -0
  273. package/src/orchestration/services/implementation/evm/initChainId.ts +20 -0
  274. package/src/orchestration/services/implementation/evm/initEvmProvider.ts +23 -0
  275. package/src/orchestration/services/implementation/evm/initInfuraProvider.ts +27 -0
  276. package/src/orchestration/services/implementation/evm/initJsonRpcProvider.ts +21 -0
  277. package/src/orchestration/services/implementation/head.ts +44 -0
  278. package/src/orchestration/services/implementation/index.ts +10 -0
  279. package/src/orchestration/services/implementation/iterator.ts +36 -0
  280. package/src/orchestration/services/implementation/pendingTransactions.ts +14 -0
  281. package/src/orchestration/services/implementation/producer.ts +13 -0
  282. package/src/orchestration/services/implementation/reward.ts +41 -0
  283. package/src/orchestration/services/implementation/validator.ts +14 -0
  284. package/src/orchestration/services/index.ts +1 -0
  285. package/src/orchestration/status/RuntimeStatusMonitor.ts +117 -0
  286. package/src/orchestration/status/ServiceStatus.ts +21 -0
  287. package/src/orchestration/status/index.ts +2 -0
  288. package/src/orchestration/store/StoreKind.ts +1 -0
  289. package/src/orchestration/store/getStoreDirectory.ts +14 -0
  290. package/src/orchestration/store/index.ts +2 -0
  291. package/src/runCLI.ts +111 -0
  292. package/src/spec/BootstrapChain.spec.ts +133 -0
  293. package/src/spec/MultiProducer.ChainOutput.json +864 -0
  294. package/src/start.ts +8 -0
  295. package/src/waitForHostPort.ts +26 -0
  296. package/src/xl1.ts +8 -0
@@ -0,0 +1,60 @@
1
+ import type {
2
+ ServiceCollection, ServiceDescriptor, ServiceProvider,
3
+ } from '../model/index.ts'
4
+ import { ServiceLifetime } from '../model/index.ts'
5
+ import { DefaultServiceProvider } from './DefaultServiceProvider.ts'
6
+
7
+ /**
8
+ * A collection of service descriptors, allowing adding/removing services before building.
9
+ */
10
+ export class DefaultServiceCollection implements ServiceCollection {
11
+ private readonly descriptors: ServiceDescriptor[] = []
12
+
13
+ /**
14
+ * Register a service as Singleton: a single instance is created and shared.
15
+ */
16
+ addSingleton<T>(
17
+ identifier: string | symbol,
18
+ implementationFactory: () => T,
19
+ ): void {
20
+ this.descriptors.push({
21
+ identifier,
22
+ lifetime: ServiceLifetime.Singleton,
23
+ implementationFactory,
24
+ })
25
+ }
26
+
27
+ /**
28
+ * Register a service as Transient: a new instance is created on each request.
29
+ */
30
+ addTransient<T>(
31
+ _identifier: string | symbol,
32
+ _implementationFactory: () => T,
33
+ ): void {
34
+ throw new Error('Not implemented')
35
+ }
36
+
37
+ /**
38
+ * Build a concrete, immutable service provider from the current descriptors.
39
+ */
40
+ build(): ServiceProvider {
41
+ const services: Record<string, unknown> = {}
42
+ for (const descriptor of this.descriptors) {
43
+ if (descriptor.lifetime === ServiceLifetime.Singleton) {
44
+ services[descriptor.identifier.toString()] = descriptor.implementationFactory()
45
+ }
46
+ }
47
+ return new DefaultServiceProvider(services)
48
+ }
49
+
50
+ /**
51
+ * Removes all registrations matching the given identifier.
52
+ */
53
+ remove(identifier: string | symbol): void {
54
+ for (let i = this.descriptors.length - 1; i >= 0; i--) {
55
+ if (this.descriptors[i].identifier === identifier) {
56
+ this.descriptors.splice(i, 1)
57
+ }
58
+ }
59
+ }
60
+ }
@@ -0,0 +1,12 @@
1
+ import type { ServiceProvider } from '../model/index.ts'
2
+
3
+ export class DefaultServiceProvider implements ServiceProvider {
4
+ protected _services: Record<string, unknown>
5
+ constructor(services: Record<string, unknown>) {
6
+ this._services = services
7
+ }
8
+
9
+ getService<T>(serviceIdentifier: string): T | undefined {
10
+ return this._services[serviceIdentifier] as T
11
+ }
12
+ }
@@ -0,0 +1,2 @@
1
+ export * from './DefaultHost.ts'
2
+ export * from './DefaultServiceProvider.ts'
@@ -0,0 +1,2 @@
1
+ export * from './implementation/index.ts'
2
+ export * from './model/index.ts'
@@ -0,0 +1,21 @@
1
+ import type { ServiceProvider } from './ServiceProvider.ts'
2
+
3
+ /**
4
+ * Represents the host for an application.
5
+ */
6
+ export interface Host {
7
+ /**
8
+ * Provides access to the application's services (for dependency injection).
9
+ */
10
+ services: ServiceProvider
11
+
12
+ /**
13
+ * Starts the host and any underlying services (e.g., background tasks).
14
+ */
15
+ start(): Promise<void>
16
+
17
+ /**
18
+ * Stops the host and attempts to gracefully shut down services.
19
+ */
20
+ stop(): Promise<void>
21
+ }
@@ -0,0 +1,22 @@
1
+ import type { ServiceProvider } from './ServiceProvider.ts'
2
+
3
+ export interface ServiceCollection {
4
+ build(): ServiceProvider
5
+ }
6
+
7
+ /**
8
+ * Represents the lifetime of a service
9
+ */
10
+ export const ServiceLifetime = {
11
+ Singleton: 'Singleton',
12
+ Transient: 'Transient',
13
+ } as const
14
+
15
+ /**
16
+ * Describes a single service registration
17
+ */
18
+ export interface ServiceDescriptor<T = unknown> {
19
+ identifier: string | symbol
20
+ implementationFactory: () => T
21
+ lifetime: keyof typeof ServiceLifetime
22
+ }
@@ -0,0 +1,3 @@
1
+ export interface ServiceProvider {
2
+ getService<T = unknown>(serviceIdentifier: string): T | undefined
3
+ }
@@ -0,0 +1,3 @@
1
+ export * from './Host.ts'
2
+ export * from './ServiceCollection.ts'
3
+ export * from './ServiceProvider.ts'
@@ -0,0 +1,5 @@
1
+ export * from './actor/index.ts'
2
+ export * from './health/index.ts'
3
+ export * from './initServices.ts'
4
+ export * from './services/index.ts'
5
+ export * from './status/index.ts'
@@ -0,0 +1,240 @@
1
+ import { assertEx } from '@xylabs/assert'
2
+ import { asAddress } from '@xylabs/hex'
3
+ import type { Logger } from '@xylabs/logger'
4
+ import { isDefined } from '@xylabs/typeof'
5
+ import { balanceSummaryRepositoryFromMap } from '@xyo-network/chain-modules'
6
+ import type { BaseBlockProducerServiceParams, XyoValidatorParams } from '@xyo-network/chain-services'
7
+ import { initTelemetry } from '@xyo-network/chain-telemetry'
8
+ import { startupSpanAsync } from '@xyo-network/chain-utils'
9
+ import { validateHydratedBlockState } from '@xyo-network/chain-validation'
10
+ import type { ChainServiceCollectionV2, Config } from '@xyo-network/xl1-protocol-sdk'
11
+
12
+ import {
13
+ initChainFinalizedArchivist, initChainSubmissionsArchivist, initPendingBundledTransactionsArchivist, initRejectedTransactionsArchivist,
14
+ initStakeIntentStateArchivist,
15
+ } from './archivists/index.ts'
16
+ import type { ChainInitializableParams } from './ChainInitializableParams.ts'
17
+ import { initHealthEndpoints } from './health/index.ts'
18
+ import { initBalanceSummaryMap } from './map/index.ts'
19
+ import {
20
+ initAccount, initBalanceService, initBlockProducer, initBlockRewardService, initChainIterator, initChainService, initElectionService, initHead,
21
+ initPendingTransactions, initStakeIntentService,
22
+ } from './services/index.ts'
23
+ import { RuntimeStatusMonitor } from './status/index.ts'
24
+
25
+ const telemetryConfig = {
26
+ attributes: {
27
+ serviceName: 'xl1-producer',
28
+ serviceVersion: '1.0.0',
29
+ },
30
+ metricsConfig: {
31
+ endpoint: '/metrics',
32
+ port: 9464,
33
+ },
34
+ }
35
+
36
+ interface Startable {
37
+ start: () => Promise<void>
38
+ }
39
+
40
+ const isStartable = (value: unknown): value is Startable => {
41
+ return isDefined((value as Startable).start) && typeof (value as Startable).start === 'function'
42
+ }
43
+
44
+ interface InitServicesContext {
45
+ config: Config
46
+ logger: Logger
47
+ }
48
+
49
+ export const initServices = async (context: InitServicesContext): Promise<ChainServiceCollectionV2> => {
50
+ const { config, logger } = context
51
+ const statusReporter = new RuntimeStatusMonitor(logger)
52
+ statusReporter.onGlobalTransition({ to: 'started' }, () => {
53
+ logger.log('All services started.')
54
+ })
55
+ statusReporter.onGlobalTransition({ to: 'error' }, () => {
56
+ logger.error('Producer encountered an unhandled error!')
57
+ // eslint-disable-next-line unicorn/no-process-exit
58
+ process.exit(1)
59
+ })
60
+
61
+ await startupSpanAsync('initHealthEndpoints', () => initHealthEndpoints({ ...context, statusReporter }))
62
+
63
+ const [
64
+ { traceProvider, meterProvider },
65
+ account,
66
+ ] = await Promise.all([
67
+ startupSpanAsync('initTelemetry', () => initTelemetry(telemetryConfig)),
68
+ startupSpanAsync('initAccount', () => initAccount(context)),
69
+ ])
70
+
71
+ const initParams: ChainInitializableParams = {
72
+ config, logger, meterProvider, statusReporter, traceProvider,
73
+ }
74
+
75
+ // Archivists
76
+ const [
77
+ chainArchivist,
78
+ [pendingBundledTransactionsArchivist, pendingBundledTransactionsArchivistWrite],
79
+ rejectedTransactionsArchivist,
80
+ chainSubmissionsArchivistWrite,
81
+ stakeIntentStateArchivist,
82
+ chainService,
83
+ balanceSummaryMap,
84
+ ] = await Promise.all([
85
+ startupSpanAsync(
86
+ 'ChainFinalizedArchivist',
87
+ () => initChainFinalizedArchivist(initParams),
88
+ ),
89
+ startupSpanAsync(
90
+ 'PendingBundledTransactionsArchivist',
91
+ () => initPendingBundledTransactionsArchivist(initParams),
92
+ ),
93
+ startupSpanAsync(
94
+ 'RejectedTransactionsArchivist',
95
+ () => initRejectedTransactionsArchivist(initParams),
96
+ ),
97
+ startupSpanAsync(
98
+ 'ChainSubmissionsArchivist',
99
+ () => initChainSubmissionsArchivist(initParams),
100
+ ),
101
+ startupSpanAsync(
102
+ 'StakeIntentStateArchivist',
103
+ () => initStakeIntentStateArchivist(initParams),
104
+ ),
105
+ startupSpanAsync(
106
+ 'ChainService',
107
+ () => initChainService({
108
+ ...initParams, account, name: 'ChainService',
109
+ }),
110
+ ),
111
+ startupSpanAsync(
112
+ 'BalanceSummaryMap',
113
+ () => initBalanceSummaryMap(initParams),
114
+ ),
115
+ ])
116
+
117
+ const chainId = chainService.chainId
118
+ const chainContractViewer = chainService
119
+ const chainStakeViewer = chainService
120
+ const chainStaker = chainService
121
+ const head = await startupSpanAsync('initHead', () => initHead({
122
+ ...initParams, account, chainArchivist, chainSubmissionsArchivistWrite,
123
+ }))
124
+ const [
125
+ pendingTransactionsService,
126
+ rewardService,
127
+ chainIterator,
128
+ balanceService,
129
+ ] = await Promise.all([
130
+ startupSpanAsync('PendingTransactions', () => initPendingTransactions({
131
+ name: 'PendingTransactionsService',
132
+ chainArchivist,
133
+ chainId,
134
+ pendingBundledTransactionsArchivist,
135
+ rejectedTransactionsArchivist,
136
+ ...initParams,
137
+ })),
138
+ startupSpanAsync(
139
+ 'RewardService',
140
+ () => initBlockRewardService({
141
+ name: 'RewardService',
142
+ account,
143
+ chainService,
144
+ ...initParams,
145
+ }),
146
+ ),
147
+ startupSpanAsync(
148
+ 'ChainIterator',
149
+ () => initChainIterator({
150
+ name: 'ChainIterator',
151
+ chainArchivist,
152
+ head,
153
+ ...initParams,
154
+ }),
155
+ ),
156
+ startupSpanAsync(
157
+ 'BalanceService',
158
+ () => initBalanceService({
159
+ name: 'BalanceService',
160
+ chainArchivist,
161
+ summaryRepository: balanceSummaryRepositoryFromMap(balanceSummaryMap),
162
+ ...initParams,
163
+ }),
164
+ ),
165
+ ])
166
+
167
+ const stakeIntentService = await startupSpanAsync(
168
+ 'StakeIntentService',
169
+ () => initStakeIntentService({
170
+ name: 'StakeIntentService',
171
+ chainArchivist,
172
+ chainIterator,
173
+ chainStakeViewer,
174
+ stakeIntentStateArchivist,
175
+ ...initParams,
176
+ }),
177
+ )
178
+
179
+ const electionService = await startupSpanAsync(
180
+ 'ElectionService',
181
+ () => initElectionService({
182
+ name: 'ElectionService',
183
+ chainIterator,
184
+ chainStakeViewer,
185
+ stakeIntentService,
186
+ ...initParams,
187
+ }),
188
+ )
189
+
190
+ const validatorParams: XyoValidatorParams = {
191
+ name: 'Validator',
192
+ account,
193
+ chainId,
194
+ pendingBundledTransactionsArchivist,
195
+ chainArchivist,
196
+ electionService,
197
+ rewardService,
198
+ stakeIntentService,
199
+ validateHydratedBlockState,
200
+ ...initParams,
201
+ }
202
+ const rewardAddress = isDefined(config.producer.rewardAddress)
203
+ ? assertEx(asAddress(config.producer.rewardAddress), () => 'Invalid block reward address provided')
204
+ : account.address
205
+ const producerParams: BaseBlockProducerServiceParams = {
206
+ ...validatorParams,
207
+ name: 'Producer',
208
+ balanceService,
209
+ chainArchivist,
210
+ pendingBundledTransactionsArchivist,
211
+ pendingTransactionsService,
212
+ rejectedTransactionsArchivist,
213
+ rewardAddress,
214
+ ...initParams,
215
+ }
216
+ const producer = await startupSpanAsync('Producer', () => initBlockProducer(producerParams))
217
+ // TODO: Add to base service collection
218
+ const result: ChainServiceCollectionV2 = {
219
+ account,
220
+ balanceService,
221
+ chainArchivist,
222
+ chainContractViewer,
223
+ chainIterator,
224
+ chainStaker,
225
+ chainStakeViewer,
226
+ chainSubmissionsArchivistWrite,
227
+ electionService,
228
+ pendingBundledTransactionsArchivistWrite,
229
+ pendingTransactionsService,
230
+ producer,
231
+ rewardService,
232
+ stakeIntentService,
233
+ }
234
+
235
+ logger?.log('All services created. Starting...')
236
+ const startableServices = [balanceSummaryMap, ...Object.values(result)].filter(isStartable)
237
+ // Start all services that have a start method
238
+ await Promise.all(startableServices.map(service => service.start()))
239
+ return result
240
+ }
@@ -0,0 +1 @@
1
+ export * from './initBalanceSummaryMap.ts'
@@ -0,0 +1,22 @@
1
+ import type { Hash } from '@xylabs/hex'
2
+ import { isDefined } from '@xylabs/typeof'
3
+ import type { MapType } from '@xyo-network/chain-protocol'
4
+ import { startupSpanAsync } from '@xyo-network/chain-utils'
5
+ import type { WithStorageMeta } from '@xyo-network/payload-model'
6
+ import type { BalancesStepSummary } from '@xyo-network/xl1-protocol-sdk'
7
+ import { Mutex } from 'async-mutex'
8
+
9
+ import type { ChainInitializableParams } from '../../ChainInitializableParams.ts'
10
+ import { initLocalBalanceSummaryMap } from './local.ts'
11
+
12
+ const mutex = new Mutex()
13
+ let singleton: MapType<Hash, WithStorageMeta<BalancesStepSummary>> | undefined
14
+
15
+ export async function initBalanceSummaryMap(params: ChainInitializableParams): Promise<MapType<Hash, WithStorageMeta<BalancesStepSummary>>> {
16
+ return await mutex.runExclusive(async () => {
17
+ if (isDefined(singleton)) return singleton
18
+ const local = await startupSpanAsync('BalanceSummaryMap:initLocal', () => initLocalBalanceSummaryMap(params))
19
+ singleton = local
20
+ return singleton
21
+ })
22
+ }
@@ -0,0 +1,21 @@
1
+ import type { Hash } from '@xylabs/hex'
2
+ import { isDefined } from '@xylabs/typeof'
3
+ import type { MapType } from '@xyo-network/chain-protocol'
4
+ import type { WithStorageMeta } from '@xyo-network/payload-model'
5
+ import type { BalancesStepSummary } from '@xyo-network/xl1-protocol-sdk'
6
+ import { Mutex } from 'async-mutex'
7
+
8
+ import type { ChainInitializableParams } from '../../ChainInitializableParams.ts'
9
+ import { getLocalPersistentMap } from '../localPersistentMap.ts'
10
+
11
+ const mutex = new Mutex()
12
+ let singleton: MapType<Hash, WithStorageMeta<BalancesStepSummary>> | undefined
13
+
14
+ export const initLocalBalanceSummaryMap = async (params: ChainInitializableParams): Promise<MapType<Hash, WithStorageMeta<BalancesStepSummary>>> => {
15
+ return await mutex.runExclusive(async () => {
16
+ if (isDefined(singleton)) return singleton
17
+ const { root } = params.config.storage
18
+ singleton = await getLocalPersistentMap<Hash, WithStorageMeta<BalancesStepSummary>>('balance', 'summary', root)
19
+ return singleton
20
+ })
21
+ }
@@ -0,0 +1 @@
1
+ export * from './lmdb/index.ts'
@@ -0,0 +1,7 @@
1
+ import type { CreatableParams } from '@xylabs/creatable'
2
+
3
+ export interface LmdbMapParams extends CreatableParams {
4
+ dbName: string
5
+ location: string
6
+ storeName: string
7
+ }
@@ -0,0 +1,66 @@
1
+ import { AbstractCreatable, creatable } from '@xylabs/creatable'
2
+ import { SynchronousMap } from '@xyo-network/chain-protocol'
3
+ import {
4
+ Database, Key, open, RootDatabase,
5
+ } from 'lmdb'
6
+
7
+ import { LmdbMapParams } from './Params.ts'
8
+
9
+ // TODO: Abstract creatable instead of service?
10
+ /**
11
+ * A synchronous LMDB-backed Map implementation.
12
+ * This class provides a synchronous interface to an LMDB database, allowing for key-value storage.
13
+ * It allows for multi-tenancy within a single LMDB environment by using a root database (located
14
+ * at this.folderPath) and a specific DB within the environment (specified by this.params.storeName).
15
+ * @template K - The type of keys in the map.
16
+ * @template V - The type of values in the map.
17
+ */
18
+ @creatable()
19
+ export class SynchronousLmdbMap<K extends Key, V> extends AbstractCreatable<LmdbMapParams> implements SynchronousMap<K, V> {
20
+ protected db!: Database<V, K>
21
+ protected rootDatabase!: RootDatabase
22
+
23
+ /**
24
+ * The path to the LMDB folder where the database is stored.
25
+ * This is constructed from the location and dbName parameters
26
+ * allowing for multiple DBs within the root (by specifying a
27
+ * different storeName).
28
+ * @returns The folder path for the LMDB database.
29
+ */
30
+ get folderPath() {
31
+ return `${this.params.location}/${this.params.dbName}`
32
+ }
33
+
34
+ all(): V[] {
35
+ return [...this.db.getRange({})].map(entry => entry.value)
36
+ }
37
+
38
+ clear(): void {
39
+ this.db.clearSync()
40
+ }
41
+
42
+ delete(id: K): boolean {
43
+ return this.db.removeSync(id)
44
+ }
45
+
46
+ get(id: K): V | undefined {
47
+ return this.db.get(id)
48
+ }
49
+
50
+ has(id: K): boolean {
51
+ return this.db.doesExist(id)
52
+ }
53
+
54
+ set(id: K, data: V): this {
55
+ this.db.putSync(id, data)
56
+ return this
57
+ }
58
+
59
+ override async startHandler(): Promise<void> {
60
+ await super.startHandler()
61
+ // Initialize the DB Environment (opens the default LMDB database)
62
+ this.rootDatabase = open({ path: this.folderPath })
63
+ // Open the desired DB (using the store name)
64
+ this.db = this.rootDatabase.openDB<V, K>({ name: this.params.storeName })
65
+ }
66
+ }
@@ -0,0 +1 @@
1
+ export * from './SynchronousLmdbMap.ts'
@@ -0,0 +1,97 @@
1
+ import { mkdtempSync, rmSync } from 'node:fs'
2
+ import { tmpdir } from 'node:os'
3
+ import path from 'node:path'
4
+
5
+ import {
6
+ afterEach, beforeEach, describe, expect, it,
7
+ } from 'vitest'
8
+
9
+ import type { LmdbMapParams } from '../Params.ts'
10
+ import { SynchronousLmdbMap } from '../SynchronousLmdbMap.ts'
11
+
12
+ type TestKey = string
13
+ type TestValue = { age: number; name: string }
14
+
15
+ describe('SynchronousLmdbMap', () => {
16
+ let map: SynchronousLmdbMap<TestKey, TestValue>
17
+ let tempDir: string
18
+
19
+ const params: LmdbMapParams = {
20
+ dbName: 'test-db',
21
+ storeName: 'test-store',
22
+ location: '', // Will be set to temp dir
23
+ }
24
+
25
+ beforeEach(async () => {
26
+ tempDir = mkdtempSync(path.join(tmpdir(), 'lmdb-test-'))
27
+ params.location = tempDir
28
+ map = await SynchronousLmdbMap.create<SynchronousLmdbMap<TestKey, TestValue>>(params)
29
+ await map.start()
30
+ })
31
+
32
+ afterEach(async () => {
33
+ map.clear()
34
+ await map.stop()
35
+ rmSync(tempDir, { recursive: true, force: true })
36
+ })
37
+
38
+ it('should set and get a value', () => {
39
+ const key = 'user-1'
40
+ const value = { name: 'Alice', age: 30 }
41
+ map.set(key, value)
42
+ const result = map.get(key)
43
+ expect(result).toEqual(value)
44
+ })
45
+
46
+ it('should return true for has() if key exists', () => {
47
+ const key = 'user-2'
48
+ const value = { name: 'Bob', age: 25 }
49
+ map.set(key, value)
50
+ expect(map.has(key)).toBe(true)
51
+ })
52
+
53
+ it('should return false for has() if key does not exist', () => {
54
+ expect(map.has('nonexistent')).toBe(false)
55
+ })
56
+
57
+ it('should delete a key and return true', () => {
58
+ const key = 'user-3'
59
+ const value = { name: 'Charlie', age: 40 }
60
+ map.set(key, value)
61
+ const deleted = map.delete(key)
62
+ expect(deleted).toBe(true)
63
+ expect(map.has(key)).toBe(false)
64
+ expect(map.get(key)).toBeUndefined()
65
+ })
66
+
67
+ it('should return false for delete() if key does not exist', () => {
68
+ const deleted = map.delete('missing')
69
+ expect(deleted).toBe(false)
70
+ })
71
+
72
+ it('should clear all data', () => {
73
+ const key1 = 'user-4'
74
+ const value1 = { name: 'Dana', age: 22 }
75
+ const key2 = 'user-5'
76
+ const value2 = { name: 'Eve', age: 28 }
77
+ map.set(key1, value1)
78
+ map.set(key2, value2)
79
+ map.clear()
80
+ expect(map.has(key1)).toBe(false)
81
+ expect(map.has(key2)).toBe(false)
82
+ expect(map.all()).toEqual([])
83
+ })
84
+
85
+ it('should return all values', () => {
86
+ const key1 = 'a'
87
+ const value1 = { name: 'Anna', age: 33 }
88
+ const key2 = 'b'
89
+ const value2 = { name: 'Ben', age: 44 }
90
+ map.set(key1, value1)
91
+ map.set(key2, value2)
92
+ const values = map.all()
93
+ expect(values).toContainEqual(value1)
94
+ expect(values).toContainEqual(value2)
95
+ expect(values.length).toBe(2)
96
+ })
97
+ })
@@ -0,0 +1,2 @@
1
+ export * from './BalanceSummary/index.ts'
2
+ export * from './driver/index.ts'
@@ -0,0 +1,52 @@
1
+ import { rm } from 'node:fs/promises'
2
+ import Path from 'node:path'
3
+
4
+ import type { MapType } from '@xyo-network/chain-protocol'
5
+
6
+ import type { StoreKind } from '../store/index.ts'
7
+ import { getStoreDirectory } from '../store/index.ts'
8
+ import { SynchronousLmdbMap } from './driver/index.ts'
9
+
10
+ const DEFAULT_STORAGE_ROOT = Path.join(process.cwd(), '.store')
11
+
12
+ /**
13
+ * Returns a local persistent map
14
+ * @param dbName The name of the database
15
+ * @param storeName The name of the store
16
+ * @param storageRoot The root directory for storage (default is '.store' in the current working directory)
17
+ * @param kind The kind of the map
18
+ * @returns a map
19
+ */
20
+ export const getLocalPersistentMap = async <TId, TData>(
21
+ dbName: string,
22
+ storeName: string,
23
+ storageRoot?: string,
24
+ kind: StoreKind = 'lmdb'): Promise<MapType<TId, TData>> => {
25
+ switch (kind) {
26
+ case 'lmdb': {
27
+ const root = storageRoot ?? DEFAULT_STORAGE_ROOT
28
+ const location = getStoreDirectory(dbName, root, 'lmdb')
29
+ const store = await SynchronousLmdbMap.create({
30
+ location, dbName, storeName,
31
+ })
32
+ return store as unknown as MapType<TId, TData>
33
+ }
34
+ }
35
+ }
36
+
37
+ export const deleteLocalPersistentMap = async (
38
+ dbName: string,
39
+ storageRoot?: string,
40
+ kind: StoreKind = 'lmdb',
41
+ ): Promise<void> => {
42
+ await Promise.resolve()
43
+ let location = ''
44
+ switch (kind) {
45
+ case 'lmdb': {
46
+ const root = storageRoot ?? DEFAULT_STORAGE_ROOT
47
+ location = getStoreDirectory(dbName, root, 'lmdb')
48
+ break
49
+ }
50
+ }
51
+ await rm(location, { recursive: true, force: true })
52
+ }
@@ -0,0 +1 @@
1
+ export * from './lib/index.ts'
@@ -0,0 +1 @@
1
+ export * from './repositoryFromArchivist.ts'