mirror of
https://github.com/pezkuwichain/pezkuwi-wallet-utils.git
synced 2026-10-20 18:56:26 +00:00
Add global config to A+B→C merge pipeline
- Created pezkuwi-overlay/config/global_config_overlay.json (source B) with stakingApiOverrides for Pezkuwi SubQuery + prod API URLs - Updated sync_from_nova.py with sync_config() function Merges: nova-base/global + nova-base/staking (A) + overlay (B) → staking/ (C) - Same merge pattern as chains, XCM, and icons
This commit is contained in:
1 parent
3f91aa103e
commit
c098e4991d
3 files changed
+73
-4
No files matched your search
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"multisigsApiUrl": "https://subquery-multisigs-prod.novasama-tech.org",
|
||||||
|
"proxyApiUrl": "https://subquery-proxy-prod.novasama-tech.org",
|
||||||
|
"stakingApiOverrides": {
|
||||||
|
"https://subquery.pezkuwichain.io": [
|
||||||
|
"1aa94987791a5544e9667ec249d2cef1b8fdd6083c85b93fc37892d54a1156ca",
|
||||||
|
"e7c15092dcbe3f320260ddbbc685bfceed9125a3b3d8436db2766201dec3b949",
|
||||||
|
"69a8d025ab7b63363935d7d9397e0f652826c94271c1bc55c4fdfe72cccf1cfa"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,13 +3,14 @@
|
|||||||
Merge Nova (Polkadot ecosystem) + Pezkuwi overlay.
|
Merge Nova (Polkadot ecosystem) + Pezkuwi overlay.
|
||||||
|
|
||||||
Sources:
|
Sources:
|
||||||
A: nova-base/ -> Polkadot ecosystem (98+ chains, XCM) - git submodule
|
A: nova-base/ -> Polkadot ecosystem (98+ chains, XCM, config) - git submodule
|
||||||
B: pezkuwi-overlay/ -> Pezkuwi ecosystem (4 chains, XCM) - we maintain
|
B: pezkuwi-overlay/ -> Pezkuwi ecosystem (4 chains, XCM, config) - we maintain
|
||||||
|
|
||||||
Output:
|
Output:
|
||||||
chains/ -> Merged chains (Pezkuwi first, then Nova)
|
chains/ -> Merged chains (Pezkuwi first, then Nova)
|
||||||
xcm/ -> Merged XCM (Nova base + Pezkuwi entries added to each section)
|
xcm/ -> Merged XCM (Nova base + Pezkuwi entries added to each section)
|
||||||
icons/ -> Merged icons (Pezkuwi overrides Nova)
|
icons/ -> Merged icons (Pezkuwi overrides Nova)
|
||||||
|
staking/ -> Merged global config (Nova base URLs + Pezkuwi overrides)
|
||||||
|
|
||||||
Rules:
|
Rules:
|
||||||
- NOTHING gets deleted
|
- NOTHING gets deleted
|
||||||
@@ -26,6 +27,7 @@ NOVA_BASE = ROOT / "nova-base"
|
|||||||
PEZKUWI_OVERLAY = ROOT / "pezkuwi-overlay"
|
PEZKUWI_OVERLAY = ROOT / "pezkuwi-overlay"
|
||||||
OUTPUT_CHAINS = ROOT / "chains"
|
OUTPUT_CHAINS = ROOT / "chains"
|
||||||
OUTPUT_XCM = ROOT / "xcm"
|
OUTPUT_XCM = ROOT / "xcm"
|
||||||
|
OUTPUT_STAKING = ROOT / "staking"
|
||||||
|
|
||||||
|
|
||||||
def load_json(path: Path) -> dict | list:
|
def load_json(path: Path) -> dict | list:
|
||||||
@@ -197,6 +199,61 @@ def sync_icons():
|
|||||||
print(f" Pezkuwi: {rel}")
|
print(f" Pezkuwi: {rel}")
|
||||||
|
|
||||||
|
|
||||||
|
def merge_config(nova_config: dict, pezkuwi_overlay: dict) -> dict:
|
||||||
|
"""Deep merge: Nova base config + Pezkuwi overlay (Pezkuwi wins on conflicts)."""
|
||||||
|
merged = dict(nova_config)
|
||||||
|
for key, value in pezkuwi_overlay.items():
|
||||||
|
if key in merged and isinstance(merged[key], dict) and isinstance(value, dict):
|
||||||
|
merged[key] = {**merged[key], **value}
|
||||||
|
else:
|
||||||
|
merged[key] = value
|
||||||
|
return merged
|
||||||
|
|
||||||
|
|
||||||
|
def sync_config():
|
||||||
|
"""
|
||||||
|
Merge global config:
|
||||||
|
A: nova-base/staking/global_config.json (Nova SubQuery URLs)
|
||||||
|
+ nova-base/global/config.json (Nova multisig/proxy URLs)
|
||||||
|
B: pezkuwi-overlay/config/global_config_overlay.json (Pezkuwi stakingApiOverrides)
|
||||||
|
C: staking/global_config.json (output - what the app fetches)
|
||||||
|
"""
|
||||||
|
print("\nSyncing global config...")
|
||||||
|
|
||||||
|
overlay_file = PEZKUWI_OVERLAY / "config" / "global_config_overlay.json"
|
||||||
|
overlay = load_json(overlay_file) if overlay_file.exists() else {}
|
||||||
|
|
||||||
|
# Production: nova-base/staking + nova-base/global + pezkuwi overlay
|
||||||
|
for suffix in ("", "_dev"):
|
||||||
|
nova_staking = NOVA_BASE / "staking" / f"global_config{suffix}.json"
|
||||||
|
nova_global = NOVA_BASE / "global" / f"config{suffix}.json"
|
||||||
|
|
||||||
|
base = {}
|
||||||
|
if nova_global.exists():
|
||||||
|
base.update(load_json(nova_global))
|
||||||
|
if nova_staking.exists():
|
||||||
|
base.update(load_json(nova_staking))
|
||||||
|
|
||||||
|
merged = merge_config(base, overlay)
|
||||||
|
output = OUTPUT_STAKING / f"global_config{suffix}.json"
|
||||||
|
save_json(output, merged)
|
||||||
|
|
||||||
|
label = "production" if suffix == "" else "dev"
|
||||||
|
print(f" {label}: {list(merged.keys())}")
|
||||||
|
|
||||||
|
# Copy validators from Nova (if present)
|
||||||
|
nova_validators = NOVA_BASE / "staking" / "nova_validators.json"
|
||||||
|
if nova_validators.exists():
|
||||||
|
shutil.copy(nova_validators, OUTPUT_STAKING / "nova_validators.json")
|
||||||
|
|
||||||
|
nova_validators_dir = NOVA_BASE / "staking" / "validators"
|
||||||
|
if nova_validators_dir.exists():
|
||||||
|
output_validators = OUTPUT_STAKING / "validators"
|
||||||
|
if output_validators.exists():
|
||||||
|
shutil.rmtree(output_validators)
|
||||||
|
shutil.copytree(nova_validators_dir, output_validators)
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
print("=" * 60)
|
print("=" * 60)
|
||||||
print("Nova + Pezkuwi Merge")
|
print("Nova + Pezkuwi Merge")
|
||||||
@@ -213,6 +270,7 @@ def main():
|
|||||||
sync_chains()
|
sync_chains()
|
||||||
sync_xcm()
|
sync_xcm()
|
||||||
sync_icons()
|
sync_icons()
|
||||||
|
sync_config()
|
||||||
|
|
||||||
print("\n" + "=" * 60)
|
print("\n" + "=" * 60)
|
||||||
print("Done!")
|
print("Done!")
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"multisigsApiUrl": "https://subquery-multisigs-stg.novasama-tech.org",
|
"multisigsApiUrl": "https://subquery-multisigs-prod.novasama-tech.org",
|
||||||
"proxyApiUrl": "https://subquery-proxy-stg.novasama-tech.org",
|
"proxyApiUrl": "https://subquery-proxy-prod.novasama-tech.org",
|
||||||
"multiStakingApiUrl": "https://subquery-multi-staking-stg.novasama-tech.org",
|
"multiStakingApiUrl": "https://subquery-multi-staking-stg.novasama-tech.org",
|
||||||
"stakingApiOverrides": {
|
"stakingApiOverrides": {
|
||||||
"https://subquery.pezkuwichain.io": [
|
"https://subquery.pezkuwichain.io": [
|
||||||
|
|||||||
Reference in new issue
Block a user