Documentation ¶
Index ¶
- Constants
- Variables
- func ConvertAndEncode(hrp string, data []byte) (string, error)
- func GetCurrentVersion() int64
- func GetSafeShare(part, total, allocation cosmos.Dec) cosmos.Dec
- func GetUncappedShare(part, total, allocation cosmos.Dec) (share cosmos.Dec)
- func MustParseURL(uri string) *url.URL
- func NewSingleHostReverseProxy(target *url.URL) *httputil.ReverseProxy
- func RandStringBytesMask(n int) string
- func Tokens(i int64) int64
- type PubKey
- type PubKeys
- type Service
- type Services
Constants ¶
View Source
const ( // SuperMajorityFactor - super majority 2/3 SuperMajorityFactor = 3 // SimpleMajorityFactor - simple majority 1/2 SimpleMajorityFactor = 2 )
Variables ¶
View Source
var ServiceLookup = map[string]int32{
"unknown": 0,
"mock": 1,
"arkeo-mainnet-fullnode": 2,
"avax-mainnet-fullnode": 3,
"avax-mainnet-archivenode": 4,
"bch-mainnet-fullnode": 5,
"bch-mainnet-lightnode": 6,
"bnb-mainnet-fullnode": 7,
"bsc-mainnet-fullnode": 8,
"bsc-mainnet-archivenode": 9,
"btc-mainnet-fullnode": 10,
"btc-mainnet-lightnode": 11,
"cardano-mainnet-relaynode": 12,
"gaia-mainnet-rpc": 13,
"doge-mainnet-fullnode": 14,
"doge-mainnet-lightnode": 15,
"etc-mainnet-archivenode": 16,
"etc-mainnet-fullnode": 17,
"etc-mainnet-lightnode": 18,
"eth-mainnet-archivenode": 19,
"eth-mainnet-fullnode": 20,
"eth-mainnet-lightnode": 21,
"ltc-mainnet-fullnode": 22,
"ltc-mainnet-lightnode": 23,
"optimism-mainnet-fullnode": 24,
"osmosis-mainnet-fullnode": 25,
"polkadot-mainnet-fullnode": 26,
"polkadot-mainnet-lightnode": 27,
"polkadot-mainnet-archivenode": 28,
"polygon-mainnet-fullnode": 29,
"polygon-mainnet-archivenode": 30,
"sol-mainnet-fullnode": 31,
"thorchain-mainnet-fullnode": 32,
"bch-mainnet-unchained": 33,
"btc-mainnet-unchained": 34,
"bsc-mainnet-unchained": 36,
"gaia-mainnet-unchained": 38,
"doge-mainnet-unchained": 39,
"eth-mainnet-unchained": 40,
"avax-mainnet-unchained": 41,
"ltc-mainnet-unchained": 42,
"osmosis-mainnet-unchained": 43,
"thorchain-mainnet-unchained": 44,
"optimism-mainnet-unchained": 45,
"gaia-mainnet-grpc": 46,
"btc-mainnet-blockbook": 47,
"ltc-mainnet-blockbook": 48,
"bch-mainnet-blockbook": 49,
"doge-mainnet-blockbook": 50,
}
View Source
var ServiceReverseLookup = map[Service]string{
0: "unknown",
1: "mock",
2: "arkeo-mainnet-fullnode",
3: "avax-mainnet-fullnode",
4: "avax-mainnet-archivenode",
5: "bch-mainnet-fullnode",
6: "bch-mainnet-lightnode",
7: "bnb-mainnet-fullnode",
8: "bsc-mainnet-fullnode",
9: "bsc-mainnet-archivenode",
10: "btc-mainnet-fullnode",
11: "btc-mainnet-lightnode",
12: "cardano-mainnet-relaynode",
13: "gaia-mainnet-rpc",
14: "doge-mainnet-fullnode",
15: "doge-mainnet-lightnode",
16: "etc-mainnet-archivenode",
17: "etc-mainnet-fullnode",
18: "etc-mainnet-lightnode",
19: "eth-mainnet-archivenode",
20: "eth-mainnet-fullnode",
21: "eth-mainnet-lightnode",
22: "ltc-mainnet-fullnode",
23: "ltc-mainnet-lightnode",
24: "optimism-mainnet-fullnode",
25: "osmosis-mainnet-fullnode",
26: "polkadot-mainnet-fullnode",
27: "polkadot-mainnet-lightnode",
28: "polkadot-mainnet-archivenode",
29: "polygon-mainnet-fullnode",
30: "polygon-mainnet-archivenode",
31: "sol-mainnet-fullnode",
32: "thorchain-mainnet-fullnode",
33: "bch-mainnet-unchained",
34: "btc-mainnet-unchained",
35: "bnb-mainnet-unchained",
36: "bsc-mainnet-unchained",
37: "bsc-mainnet-unchained",
38: "gaia-mainnet-unchained",
39: "doge-mainnet-unchained",
40: "eth-mainnet-unchained",
41: "avax-mainnet-unchained",
42: "ltc-mainnet-unchained",
43: "osmosis-mainnet-unchained",
44: "thorchain-mainnet-unchained",
45: "optimism-mainnet-unchained",
46: "gaia-mainnet-grpc",
47: "btc-mainnet-blockbook",
48: "ltc-mainnet-blockbook",
49: "bch-mainnet-blockbook",
50: "doge-mainnet-blockbook",
}
Functions ¶
func ConvertAndEncode ¶
ConvertAndEncode converts from a base64 encoded byte string to hex or base32 encoded byte string and then to bech32
func GetCurrentVersion ¶
func GetCurrentVersion() int64
GetCurrentVersion - intended for unit tests, fetches the current version of arkeo via `version` file #nosec G304 this is a method only used for test purpose
func GetSafeShare ¶
GetSafeShare does the same as GetUncappedShare , but GetSafeShare will guarantee the result will not more than total
func GetUncappedShare ¶
GetUncappedShare this method will panic if any of the input parameter can't be convert to cosmos.Dec which shouldn't happen
func MustParseURL ¶
func NewSingleHostReverseProxy ¶
func NewSingleHostReverseProxy(target *url.URL) *httputil.ReverseProxy
func RandStringBytesMask ¶
RandStringBytesMask generate random string used for test purpose
Types ¶
type PubKey ¶
type PubKey []byte
var EmptyPubKey PubKey
func NewPubKeyFromCrypto ¶
func NewPubKeyFromCrypto(pk cryptotypes.PubKey) (PubKey, error)
func (PubKey) GetMyAddress ¶
func (pubKey PubKey) GetMyAddress() (cosmos.AccAddress, error)
func (PubKey) MarshalJSON ¶
MarshalJSON to Marshals to JSON using Bech32
func (*PubKey) UnmarshalJSON ¶
UnmarshalJSON to Unmarshal from JSON assuming Bech32 encoding
type PubKeys ¶
type PubKeys []PubKey
Click to show internal directories.
Click to hide internal directories.