Commit 32b13c5
authored
feat(cmd): add catalog syncer (#552)
This pull request introduces a new integration for catalog-based
datastore management, allowing the system to use a remote catalog
service for data persistence instead of local file storage. The changes
are designed to be non-breaking, providing configuration options to
select the desired backend and new CLI commands for migration and
synchronization. Additionally, several mock implementations are added to
support testing of the new functionality.
**Catalog Service Integration & Data Management**
* Added catalog service support for datastore management, enabling
transactional operations and providing an alternative to local file
storage. This includes a unified function (`MergeDataStoreToCatalog`)
for both initial migration and ongoing merge operations, ensuring atomic
updates and preventing data inconsistencies.
[[1]](diffhunk://#diff-6183631702722fc2a3ddbc5ec91a559eb5bfcf1f062553cebe75f8e515e6eec7R1-R22)
[[2]](diffhunk://#diff-25ea8888f88aec3194cfd2d4390d937364c653f876ed7901f7512012cbd4a9c6R1-R75)
* Added a new CLI command `datastore sync-to-catalog` for migrating all
local datastore data to the catalog service, supporting CI and
operational workflows.
**Testing & Mock Implementations**
* Added mock implementations for address reference, chain metadata, and
contract metadata stores to facilitate testing of catalog integration
and datastore operations. These mocks support fetch, get, and filter
operations for their respective data types.
(`datastore/mock_address_ref_store_test.go`
[[1]](diffhunk://#diff-0483d90cec93624656eff1726bc11354658127f5090b2a749711a57699ea69afR1-R201)
`datastore/mock_chain_metadata_store_test.go`
[[2]](diffhunk://#diff-e5c07878c88ed6de556788eae5b3250f4ec4904e2a700a26399dd056f523bb38R1-R201)
`datastore/mock_contract_metadata_store_test.go`
[[3]](diffhunk://#diff-516e47a714b875cf2f3d55628994f45e61a5061ecafe106c06589d4af8ca5141R1-R201)
https://smartcontract-it.atlassian.net/browse/CLD-7821 parent e84a39b commit 32b13c5
13 files changed
Lines changed: 2248 additions & 13 deletions
File tree
- .changeset
- datastore
- engine/cld
- domain
- legacy/cli/commands
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
0 commit comments