[BCN] Multi Provider With Alchemy Adapter#4111
Open
leolambo wants to merge 9 commits intobitpay:masterfrom
Open
[BCN] Multi Provider With Alchemy Adapter#4111leolambo wants to merge 9 commits intobitpay:masterfrom
leolambo wants to merge 9 commits intobitpay:masterfrom
Conversation
Replace the circuit breaker state machine with a simpler consecutive-failure counter and cooldown approach. N failures in a row, skip for M seconds, then retry.
- Fix getBlockBeforeTime signature to match GetBlockBeforeTimeParams - Fix AlchemyAssetTransferStream field collision with base class - Fix blockHeight possibly undefined in confirmation - Remove unused imports and dead code - Cast test args as any to satisfy type constraints - Add operational logging to csp.ts (stream lifecycle, failover events, block-by-date resolution) - Rename _enforceFloorSemantics to _verifyBlockBeforeDate
- Rename IProviderConfig to IMultiProviderConfig with only health/priority/timeout fields - Move apiKey to global config.externalProviders.alchemy (matches Moralis pattern) - Resolve Alchemy URLs dynamically per-call via ALCHEMY_NETWORK_MAP - Add chain/network to AdapterBlockByDateParams for dynamic URL resolution - Add blockAtTimeCache (LRU per chain:network) to multi-provider CSP - Rename isBreakerable to affectsHealth across error taxonomy - Update all tests (47 passing)
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.
Description
Add multi-provider external chain state adapter with Alchemy integration, enabling failover between multiple indexed API providers for EVM chains.
Follow-up:
Moralis Adapter, API streaming improvements, Integration tests
Changelog
IIndexedAPIAdapterinterface, config types, andAdapterFactoryAlchemyAdapterwith asset transfer streamisBreakerable→affectsHealth)Testing Notes
Checklist
BWCif modifying the bitcore-wallet-client package,CLIif modifying the bitcore-cli package, etc.)