feat: support dashmate regtest as a third network#1
Draft
QuantumExplorer wants to merge 1 commit intomainfrom
Draft
feat: support dashmate regtest as a third network#1QuantumExplorer wants to merge 1 commit intomainfrom
QuantumExplorer wants to merge 1 commit intomainfrom
Conversation
Adds 'local' alongside testnet/mainnet so the bridge can target a local dashmate cluster end-to-end without depending on public infrastructure. What works on local: - Insight UTXO/broadcast via Vite proxy to dashmate's insight container - InstantSend lock retrieval via Dash Core's getislocks RPC (proxied through Vite, which injects basic-auth from .env.local so credentials never enter the client bundle) - Platform RPCs via WasmSdkBuilder.local() + WasmTrustedContext from the dashmate quorum-list sidecar (port 22444) - "Use Local Funds" hero button that RPC-sendtoaddress 1 DASH from the seed node so devs don't need a faucet Refactors: - Extracts createPlatformSdk() into src/platform/sdk.ts and routes every EvoSDK consumer (identity, dpns, contract, main) through it instead of the inline `network === 'mainnet' ? mainnetTrusted : testnetTrusted` ternaries, so adding networks doesn't require touching every call site - Widens 'testnet' | 'mainnet' to NetworkName everywhere UX: - Visible cert-acceptance notice on local pointing at all three https://127.0.0.1:{2443,2543,2643} gateways (each has its own self-signed cert) - For local, banFailedAddress=false and retries=5 so trusting any one of the three certs is sufficient — the SDK just fails over Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a third network —
local— alongside testnet/mainnet, so the bridge runs end-to-end against a localdashmate setup localcluster without depending on any public infrastructure (insight, tRPC mirror, public DAPI evonodes).Activate via the new Local network button or
?network=local.What works on local
/local-insight→ dashmate's insight container on127.0.0.1:23001.getislocksRPC directly. Same wire shape as the public tRPC mirrors; just filters Core's\"None\"sentinel for txids that don't yet have a lock. Auth is handled by the Vite proxy injecting the basic-auth header from `.env.local` so RPC creds never reach the client bundle.Refactor
The `EvoSDK.testnetTrusted/mainnetTrusted` ternary was inlined at 6+ sites across `identity.ts`, `dpns.ts`, `contract.ts`, and `main.ts`. Extracted into `src/platform/sdk.ts:createPlatformSdk(network)` so adding a third (and future) networks is a single-file change. `'testnet' | 'mainnet'` widened to `NetworkName` ('testnet' | 'mainnet' | 'local') throughout.
Cert UX heads-up
Each of the three local DAPI gateways (`https://127.0.0.1:{2443,2543,2643}\`) serves its own self-signed cert. The trusted-context sidecar discovers all three and the SDK round-robins between them, so the bridge would otherwise silently fail with `TypeError: Failed to fetch` until each cert is trusted in the browser.
Two mitigations:
Reviewer notes
Test plan
🤖 Generated with Claude Code