-
Notifications
You must be signed in to change notification settings - Fork 1
build/devenv: support multiple executors in deployment #356
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
base: main
Are you sure you want to change the base?
Changes from all commits
b287f5f
a24752e
abcd75e
290fac6
497c535
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -157,7 +157,10 @@ type OffChainConfigurable interface { | |
| // ConfigureNodes configure CL nodes from blockchain data | ||
| // returns a piece of TOML config as a string that the framework inject into final configuration | ||
| ConfigureNodes(ctx context.Context, blockchain *blockchain.Input) (string, error) | ||
| // FundNodes Fund Chainlink nodes for some amount of native/LINK currency | ||
| // FundNodes funds Chainlink nodes for some amount of native/LINK currency | ||
| // using chain-specific clients or CLDF | ||
| FundNodes(ctx context.Context, cls []*nodeset.Input, bc *blockchain.Input, linkAmount, nativeAmount *big.Int) error | ||
| // FundAddresses funds addresses for some amount of native currency | ||
| // using chain-specific clients or CLDF | ||
| FundAddresses(ctx context.Context, bc *blockchain.Input, addresses []protocol.UnknownAddress, nativeAmount *big.Int) error | ||
|
Comment on lines
-160
to
+165
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are very similar - could they be combined gracefully? |
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,7 @@ import ( | |
| "errors" | ||
| "fmt" | ||
| "math/big" | ||
| "os" | ||
| "time" | ||
|
|
||
| "github.com/Masterminds/semver/v3" | ||
|
|
@@ -18,6 +19,7 @@ import ( | |
| "github.com/google/uuid" | ||
| "github.com/prometheus/client_golang/prometheus" | ||
| "github.com/rs/zerolog" | ||
| "github.com/rs/zerolog/log" | ||
|
|
||
| "github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/deployment/v1_7_0/operations/burn_mint_token_pool" | ||
| "github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/deployment/v1_7_0/operations/committee_verifier" | ||
|
|
@@ -250,6 +252,18 @@ type CCIP17EVM struct { | |
| offRampBySelector map[uint64]*offramp.OffRamp | ||
| } | ||
|
|
||
| // NewEmptyCCIP17EVM creates a new CCIP17EVM with a logger that logs to the console. | ||
| func NewEmptyCCIP17EVM() *CCIP17EVM { | ||
| return &CCIP17EVM{ | ||
| logger: log. | ||
| Output(zerolog.ConsoleWriter{Out: os.Stderr}). | ||
| Level(zerolog.DebugLevel). | ||
| With(). | ||
| Fields(map[string]any{"component": "CCIP17EVM"}). | ||
| Logger(), | ||
|
Comment on lines
+258
to
+263
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We were previously creating the object with just |
||
| } | ||
| } | ||
|
|
||
| // NewCCIP17EVM creates new smart-contracts wrappers with utility functions for CCIP17EVM implementation. | ||
| func NewCCIP17EVM(ctx context.Context, logger zerolog.Logger, e *deployment.Environment, chainIDs, wsURLs []string) (*CCIP17EVM, error) { | ||
| if len(chainIDs) != len(wsURLs) { | ||
|
|
@@ -1530,6 +1544,34 @@ func (m *CCIP17EVM) ConnectContractsWithSelectors(ctx context.Context, e *deploy | |
| return nil | ||
| } | ||
|
|
||
| func (m *CCIP17EVM) FundAddresses(ctx context.Context, bc *blockchain.Input, addresses []protocol.UnknownAddress, nativeAmount *big.Int) error { | ||
| client, _, _, err := ETHClient(ctx, bc.Out.Nodes[0].ExternalWSUrl, &GasSettings{ | ||
| FeeCapMultiplier: 2, | ||
| TipCapMultiplier: 2, | ||
| }) | ||
| if err != nil { | ||
| return fmt.Errorf("could not create basic eth client: %w", err) | ||
| } | ||
| chainInfo, err := chainsel.GetChainDetailsByChainIDAndFamily(bc.ChainID, chainsel.FamilyEVM) | ||
| if err != nil { | ||
| return fmt.Errorf("could not get chain details: %w", err) | ||
| } | ||
| for _, addr := range addresses { | ||
| a, _ := nativeAmount.Float64() | ||
| addrStr := common.BytesToAddress(addr).Hex() | ||
| m.logger.Info().Uint64("ChainSelector", chainInfo.ChainSelector).Str("Address", addrStr).Msg("Funding address") | ||
| if err := FundNodeEIP1559(ctx, client, getNetworkPrivateKey(), addrStr, a); err != nil { | ||
| return fmt.Errorf("failed to fund address %s: %w", addrStr, err) | ||
| } | ||
| bal, err := client.BalanceAt(ctx, common.HexToAddress(addrStr), nil) | ||
| if err != nil { | ||
| return fmt.Errorf("failed to get balance: %w", err) | ||
| } | ||
| m.logger.Info().Uint64("ChainSelector", chainInfo.ChainSelector).Str("Address", addrStr).Int64("Balance", bal.Int64()).Msg("Address balance") | ||
| } | ||
| return nil | ||
| } | ||
|
|
||
| func (m *CCIP17EVM) FundNodes(ctx context.Context, ns []*simple_node_set.Input, bc *blockchain.Input, linkAmount, nativeAmount *big.Int) error { | ||
| l := m.logger | ||
| l.Info().Msg("Funding CL nodes with ETH and LINK") | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing this due to noise from the comments, they're already unweildly.