diff --git a/cmd/zetaclientd/utils.go b/cmd/zetaclientd/utils.go index 06dd645edd..fb18c3e5b0 100644 --- a/cmd/zetaclientd/utils.go +++ b/cmd/zetaclientd/utils.go @@ -193,7 +193,7 @@ func CreateChainObserverMap( } } - // TODO: config this + // FIXME: config this solChainParams := observertypes.ChainParams{ GatewayAddress: "94U5AHQMKkV5txNJ17QPXWoh474PheGou6cNP2FEuL1d", IsSupported: true, diff --git a/cmd/zetae2e/config/clients.go b/cmd/zetae2e/config/clients.go index 8ca92ba0d9..1c12636dea 100644 --- a/cmd/zetae2e/config/clients.go +++ b/cmd/zetae2e/config/clients.go @@ -35,7 +35,11 @@ func getClientsFromConfig(ctx context.Context, conf config.Config, account confi *bind.TransactOpts, error, ) { + if conf.RPCs.SolanaRPC == "" { + return nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, fmt.Errorf("solana rpc is empty") + } solanaClient := rpc.New(conf.RPCs.SolanaRPC) + fmt.Printf("solana client URL: %s\n", conf.RPCs.SolanaRPC) if solanaClient == nil { return nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, fmt.Errorf("failed to get solana client") } diff --git a/cmd/zetae2e/config/config.go b/cmd/zetae2e/config/config.go index 51c35feb11..503e1ca8a8 100644 --- a/cmd/zetae2e/config/config.go +++ b/cmd/zetae2e/config/config.go @@ -4,6 +4,7 @@ import ( "context" "fmt" + "github.com/davecgh/go-spew/spew" "github.com/zeta-chain/zetacore/e2e/config" "github.com/zeta-chain/zetacore/e2e/runner" ) @@ -18,6 +19,7 @@ func RunnerFromConfig( logger *runner.Logger, opts ...runner.E2ERunnerOption, ) (*runner.E2ERunner, error) { + spew.Dump("RunnerFromConfig conf struct", conf) // initialize clients btcRPCClient, solanaClient, diff --git a/cmd/zetae2e/config/localnet.yml b/cmd/zetae2e/config/localnet.yml index abb780db39..8324136d85 100644 --- a/cmd/zetae2e/config/localnet.yml +++ b/cmd/zetae2e/config/localnet.yml @@ -48,4 +48,6 @@ rpcs: params: regnet zetacore_grpc: "zetacore0:9090" zetacore_rpc: "http://zetacore0:26657" + solana_rpc: "http://solana:8899" + # contracts will be populated on first run \ No newline at end of file diff --git a/cmd/zetae2e/init.go b/cmd/zetae2e/init.go index 742b3ebd96..f0526188be 100644 --- a/cmd/zetae2e/init.go +++ b/cmd/zetae2e/init.go @@ -26,6 +26,7 @@ func NewInitCmd() *cobra.Command { InitCmd.Flags(). StringVar(&initConf.RPCs.Zevm, "zevmURL", "http://zetacore0:8545", "--zevmURL http://zetacore0:8545") InitCmd.Flags().StringVar(&initConf.RPCs.Bitcoin.Host, "btcURL", "bitcoin:18443", "--grpcURL bitcoin:18443") + InitCmd.Flags().StringVar(&initConf.RPCs.SolanaRPC, "solanaURL", "http://solana:8899", "--solanaURL http://solana:8899") InitCmd.Flags().StringVar(&initConf.ZetaChainID, "chainID", "athens_101-1", "--chainID athens_101-1") InitCmd.Flags().StringVar(&configFile, local.FlagConfigFile, "e2e.config", "--cfg ./e2e.config") diff --git a/e2e/e2etests/test_solana_deposit.go b/e2e/e2etests/test_solana_deposit.go index b022a90f1c..67bedaaaef 100644 --- a/e2e/e2etests/test_solana_deposit.go +++ b/e2e/e2etests/test_solana_deposit.go @@ -9,6 +9,7 @@ import ( "github.com/gagliardetto/solana-go/rpc" "github.com/near/borsh-go" "github.com/zeta-chain/zetacore/e2e/runner" + "github.com/zeta-chain/zetacore/pkg/chains" ) func TestSolanaInitializeGateway(r *runner.E2ERunner, args []string) { @@ -17,6 +18,20 @@ func TestSolanaInitializeGateway(r *runner.E2ERunner, args []string) { } client := r.SolanaClient + //r.Logger.Print("solana client URL", client.) + if client == nil { + r.Logger.Error("Solana client is nil") + panic("Solana client is nil") + } + { + res, err := client.GetVersion(context.Background()) + if err != nil { + r.Logger.Error("error getting solana version: %v", err) + panic(err) + } + r.Logger.Print("solana RPC version: %+v", res) + } + // building the transaction recent, err := client.GetRecentBlockhash(context.TODO(), rpc.CommitmentFinalized) if err != nil { @@ -59,7 +74,7 @@ func TestSolanaInitializeGateway(r *runner.E2ERunner, args []string) { inst.DataBytes, err = borsh.Serialize(InitializeParams{ Discriminator: [8]byte{175, 175, 109, 31, 13, 152, 155, 237}, TssAddress: r.TSSAddress, - ChainId: 111111, + ChainId: uint64(chains.SolanaLocalnet.ChainId), }) if err != nil { panic(err) diff --git a/e2e/txserver/zeta_tx_server.go b/e2e/txserver/zeta_tx_server.go index 6d4e1d876e..6f62ec0f39 100644 --- a/e2e/txserver/zeta_tx_server.go +++ b/e2e/txserver/zeta_tx_server.go @@ -367,6 +367,16 @@ func (zts ZetaTxServer) DeploySystemContractsAndZRC20( return "", "", "", "", "", fmt.Errorf("failed to deploy btc zrc20: %s", err.Error()) } + //chainParams := getNewEVMChainParams(newRunner) + //adminAddr, err := newRunner.ZetaTxServer.GetAccountAddressFromName(utils.FungibleAdminName) + //require.NoError(r, err) + // + //_, err = zts.BroadcastTx(utils.FungibleAdminName, observertypes.NewMsgUpdateChainParams( + // adminAddr, + // chainParams, + //)) + //require.NoError(r, err) + // deploy sol zrc20 _, err = zts.BroadcastTx(account, fungibletypes.NewMsgDeployFungibleCoinZRC20( addr.String(),