github.com/gagliardetto/solana-go@v1.11.0/rpc/endpoints.go (about)

     1  // Copyright 2021 github.com/gagliardetto
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //      http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  package rpc
    16  
    17  // See more: https://docs.solana.com/cluster/rpc-endpoints
    18  
    19  const (
    20  	protocolHTTPS = "https://"
    21  	protocolWSS   = "wss://"
    22  )
    23  
    24  type Cluster struct {
    25  	Name string
    26  	RPC  string
    27  	WS   string
    28  }
    29  
    30  var (
    31  	MainNetBeta = Cluster{
    32  		Name: "mainnet-beta",
    33  		RPC:  MainNetBeta_RPC,
    34  		WS:   MainNetBeta_WS,
    35  	}
    36  	TestNet = Cluster{
    37  		Name: "testnet",
    38  		RPC:  TestNet_RPC,
    39  		WS:   TestNet_WS,
    40  	}
    41  	DevNet = Cluster{
    42  		Name: "devnet",
    43  		RPC:  DevNet_RPC,
    44  		WS:   DevNet_WS,
    45  	}
    46  	LocalNet = Cluster{
    47  		Name: "localnet",
    48  		RPC:  LocalNet_RPC,
    49  		WS:   LocalNet_WS,
    50  	}
    51  )
    52  
    53  const (
    54  	hostDevNet           = "api.devnet.solana.com"
    55  	hostTestNet          = "api.testnet.solana.com"
    56  	hostMainNetBeta      = "api.mainnet-beta.solana.com"
    57  	hostMainNetBetaSerum = "solana-api.projectserum.com"
    58  )
    59  
    60  const (
    61  	DevNet_RPC           = protocolHTTPS + hostDevNet
    62  	TestNet_RPC          = protocolHTTPS + hostTestNet
    63  	MainNetBeta_RPC      = protocolHTTPS + hostMainNetBeta
    64  	MainNetBetaSerum_RPC = protocolHTTPS + hostMainNetBetaSerum
    65  	LocalNet_RPC         = "http://127.0.0.1:8899"
    66  )
    67  
    68  const (
    69  	DevNet_WS           = protocolWSS + hostDevNet
    70  	TestNet_WS          = protocolWSS + hostTestNet
    71  	MainNetBeta_WS      = protocolWSS + hostMainNetBeta
    72  	MainNetBetaSerum_WS = protocolWSS + hostMainNetBetaSerum
    73  	LocalNet_WS         = "ws://127.0.0.1:8900"
    74  )