-
Notifications
You must be signed in to change notification settings - Fork 2
add Stellar support for mcms adapters, RPC providers, chain config, and blockchain #714
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 6 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
6fd4cfc
add simple rpc provider for Stellar
FelixFan1992 5cd6e54
Merge branch 'main' into NONEVM-3584
FelixFan1992 f6f2ec8
add a changeset
FelixFan1992 153d420
Update chain/stellar/stellar_chain.go
FelixFan1992 4c28319
Update chain/stellar/provider/rpc_provider.go
FelixFan1992 dd9f8b3
Apply suggestion from @Copilot
faisal-chainlink a684209
return references
faisal-chainlink b30b3af
add stellar chain support
FelixFan1992 d220292
stellar adds rpcs by name in metadat
ajaskolski 39b8ca2
add support for stellar rpc provider
FelixFan1992 2647335
fix tests and lint
FelixFan1992 66b7ca1
enhance chain struct
FelixFan1992 5eac1fb
add chain access for mcms
FelixFan1992 21abc90
small fixes
FelixFan1992 18faf9e
fix a test
FelixFan1992 b0e7036
update changeset
FelixFan1992 673922b
update
FelixFan1992 77846e5
update
FelixFan1992 da90030
update
FelixFan1992 83cd735
update
FelixFan1992 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "chainlink-deployments-framework": patch | ||
| --- | ||
|
|
||
| add a Stellar RPC provider and chain |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| package provider | ||
|
|
||
| import ( | ||
| "context" | ||
| "errors" | ||
|
|
||
| "github.com/smartcontractkit/chainlink-deployments-framework/chain" | ||
| "github.com/smartcontractkit/chainlink-deployments-framework/chain/stellar" | ||
| ) | ||
|
|
||
| type RPCChainProviderConfig struct { | ||
| NetworkPassphrase string | ||
| FriendbotURL string | ||
| SorobanRPCURL string | ||
| } | ||
|
|
||
| func (c RPCChainProviderConfig) validate() error { | ||
| if c.NetworkPassphrase == "" { | ||
| return errors.New("network passphrase is required") | ||
| } | ||
| if c.FriendbotURL == "" { | ||
| return errors.New("Friendbot URL is required") | ||
| } | ||
| if c.SorobanRPCURL == "" { | ||
| return errors.New("Soroban RPC URL is required") | ||
| } | ||
|
|
||
| return nil | ||
| } | ||
FelixFan1992 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| type RPCChainProvider struct { | ||
| selector uint64 | ||
| config RPCChainProviderConfig | ||
|
|
||
| chain *stellar.Chain | ||
| } | ||
|
|
||
| var _ chain.Provider = (*RPCChainProvider)(nil) | ||
|
|
||
| func NewRPCChainProvider(selector uint64, config RPCChainProviderConfig) *RPCChainProvider { | ||
| return &RPCChainProvider{ | ||
| selector: selector, | ||
| config: config, | ||
| } | ||
| } | ||
|
|
||
| func (p *RPCChainProvider) Initialize(_ context.Context) (chain.BlockChain, error) { | ||
| if p.chain != nil { | ||
| return p.chain, nil // already initialized | ||
| } | ||
faisal-chainlink marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| if err := p.config.validate(); err != nil { | ||
| return nil, err | ||
| } | ||
|
|
||
| p.chain = &stellar.Chain{ | ||
| ChainMetadata: stellar.ChainMetadata{Selector: p.selector}, | ||
| } | ||
FelixFan1992 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| return *p.chain, nil | ||
faisal-chainlink marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
faisal-chainlink marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
graham-chainlink marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| func (p *RPCChainProvider) Name() string { | ||
| return "Stellar RPC Chain Provider" | ||
| } | ||
|
|
||
| func (p *RPCChainProvider) ChainSelector() uint64 { | ||
| return p.selector | ||
| } | ||
|
|
||
| func (p *RPCChainProvider) BlockChain() chain.BlockChain { | ||
FelixFan1992 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| if p.chain == nil { | ||
| return nil | ||
faisal-chainlink marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
| return *p.chain | ||
faisal-chainlink marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
faisal-chainlink marked this conversation as resolved.
Show resolved
Hide resolved
FelixFan1992 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| package stellar | ||
|
|
||
| import ( | ||
| chaincommon "github.com/smartcontractkit/chainlink-deployments-framework/chain/internal/common" | ||
| ) | ||
|
|
||
| type ChainMetadata = chaincommon.ChainMetadata | ||
|
|
||
| // Chain represents a Stellar network instance used by the Chainlink Deployments Framework (CLDF). | ||
| type Chain struct { | ||
| ChainMetadata | ||
| } |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.