Skip to content

Commit

Permalink
Fix RPC URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
gagliardetto committed Jul 12, 2021
1 parent 90e9476 commit 2a9d117
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ import "github.com/gagliardetto/solana-go/rpc"
import "github.com/gagliardetto/solana-go/token"

addr := solana.MustPublicKeyFromBase58("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v")
cli := rpc.NewClient("http://api.mainnet-beta.solana.com/rpc")
cli := rpc.NewClient("http://api.mainnet-beta.solana.com")

var m token.Mint
err := cli.GetAccountDataIn(context.Background(), addr, &m)
Expand All @@ -115,7 +115,7 @@ import "github.com/gagliardetto/solana-go/rpc"
import "github.com/gagliardetto/solana-go/token"

addr := solana.MustPublicKeyFromBase58("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v")
cli := rpc.NewClient("http://api.mainnet-beta.solana.com/rpc")
cli := rpc.NewClient("http://api.mainnet-beta.solana.com")

acct, err := cli.GetAccountInfo(context.Background(), addr)
// handle `err`
Expand Down
4 changes: 2 additions & 2 deletions cmd/slnc/cmd/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ func getClient() *rpc.Client {
func sanitizeAPIURL(input string) string {
switch input {
case "devnet":
return "https://devnet.solana.com"
return "https://api.devnet.solana.com"
case "testnet":
return "https://testnet.solana.com"
return "https://api.testnet.solana.com"
case "mainnet":
return "https://api.mainnet-beta.solana.com"
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/slnc/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
var Version string

//const defaultRPCURL = "http://localhost:8899"
const defaultRPCURL = "http://api.mainnet-beta.solana.com/rpc"
const defaultRPCURL = "http://api.mainnet-beta.solana.com"

// RootCmd represents the eosc command
var RootCmd = &cobra.Command{
Expand Down

0 comments on commit 2a9d117

Please sign in to comment.