diff --git a/pkg/evm/evm.go b/pkg/evm/evm.go index b9ed0537c..a0c14ac33 100644 --- a/pkg/evm/evm.go +++ b/pkg/evm/evm.go @@ -804,21 +804,3 @@ func TransactionError(tx *types.Transaction, err error, msg string, args ...inte args = append(args, err) return fmt.Errorf(msg+msgSuffix, args...) } - -func WaitForRPC(ctx context.Context, rpcURL string) error { - client, err := GetClient(rpcURL) - if err != nil { - return err - } - for { - _, err := client.ChainID(ctx) - if err == nil { - return nil - } - select { - case <-ctx.Done(): - return ctx.Err() - case <-time.After(1 * time.Second): - } - } -} diff --git a/pkg/node/local.go b/pkg/node/local.go index bc7f995c8..74e932078 100644 --- a/pkg/node/local.go +++ b/pkg/node/local.go @@ -16,7 +16,6 @@ import ( "github.com/ava-labs/avalanche-cli/pkg/application" "github.com/ava-labs/avalanche-cli/pkg/binutils" "github.com/ava-labs/avalanche-cli/pkg/constants" - "github.com/ava-labs/avalanche-cli/pkg/evm" "github.com/ava-labs/avalanche-cli/pkg/localnet" "github.com/ava-labs/avalanche-cli/pkg/models" "github.com/ava-labs/avalanche-cli/pkg/networkoptions" @@ -99,8 +98,6 @@ func TrackSubnetWithLocalMachine( if err != nil { return err } - networkInfo := sc.Networks[network.Name()] - rpcEndpoints := []string{} for _, nodeInfo := range status.ClusterInfo.NodeInfos { ux.Logger.PrintToUser("Restarting node %s to track newly deployed network", nodeInfo.Name) if err := LocalNodeTrackSubnet( @@ -119,18 +116,11 @@ func TrackSubnetWithLocalMachine( if err := AddNodeInfoToSidecar(&sc, nodeInfo, network); err != nil { return fmt.Errorf("failed to update sidecar with new node info: %w", err) } - rpcEndpoints = append(rpcEndpoints, models.GetRPCEndpoint(nodeInfo.Uri, networkInfo.BlockchainID.String())) } - ux.Logger.PrintToUser("Waiting for blockchain %s to be bootstrapped", blockchainName) + ux.Logger.PrintToUser("Waiting for blockchain %s ID %s to be bootstrapped", blockchainName, blockchainID.String()) if err := WaitBootstrapped(ctx, cli, blockchainID.String()); err != nil { return fmt.Errorf("failure waiting for local cluster %s bootstrapping: %w", blockchainName, err) } - for _, rpcURL := range rpcEndpoints { - ux.Logger.PrintToUser("Waiting for rpc %s to be available", rpcURL) - if err := evm.WaitForRPC(ctx, rpcURL); err != nil { - return err - } - } if err := app.UpdateSidecar(&sc); err != nil { return err } diff --git a/tests/e2e/testcases/subnet/sov/addRemoveValidatorPoA/suite.go b/tests/e2e/testcases/subnet/sov/addRemoveValidatorPoA/suite.go index e43d2798c..e8b4a548d 100644 --- a/tests/e2e/testcases/subnet/sov/addRemoveValidatorPoA/suite.go +++ b/tests/e2e/testcases/subnet/sov/addRemoveValidatorPoA/suite.go @@ -74,7 +74,7 @@ var _ = ginkgo.Describe("[Etna AddRemove Validator SOV PoA]", func() { gomega.Expect(err).Should(gomega.BeNil()) fmt.Println(output) // parse blockchainID from output - re := regexp.MustCompile(`Waiting for rpc http://.*?/bc/([A-Za-z0-9]+)/rpc`) + re := regexp.MustCompile(`Waiting for blockchain .* ID ([A-Za-z0-9]+) to be bootstrapped`) // Find the first match match := re.FindStringSubmatch(output) gomega.Expect(match).ToNot(gomega.BeEmpty()) diff --git a/tests/e2e/testcases/subnet/sov/addRemoveValidatorPoS/suite.go b/tests/e2e/testcases/subnet/sov/addRemoveValidatorPoS/suite.go index e9b496ddd..792765d15 100644 --- a/tests/e2e/testcases/subnet/sov/addRemoveValidatorPoS/suite.go +++ b/tests/e2e/testcases/subnet/sov/addRemoveValidatorPoS/suite.go @@ -76,7 +76,7 @@ var _ = ginkgo.Describe("[Etna AddRemove Validator SOV PoS]", func() { gomega.Expect(err).Should(gomega.BeNil()) fmt.Println(output) // parse blockchainID from output - re := regexp.MustCompile(`Waiting for rpc http://.*?/bc/([A-Za-z0-9]+)/rpc`) + re := regexp.MustCompile(`Waiting for blockchain .* ID ([A-Za-z0-9]+) to be bootstrapped`) // Find the first match match := re.FindStringSubmatch(output) gomega.Expect(match).ToNot(gomega.BeEmpty())