Documentation ¶
Overview ¶
Package metadata contains build information of executable usually provided by automated build systems like Travis. Default values are populated if not overridden by build system
Index ¶
- Constants
- Variables
- func BuildAsString() string
- func FormatString(commit, branch, buildNumber string) string
- func LicenseCopyright(warrantyCommand, conditionsCommand string) string
- func VersionAsString() string
- func VersionAsSummary(licenseCopyright string) string
- type ChainDefinition
- type ChainDefinitionFlagNames
- type NetworkDefinition
- type NetworkDefinitionFlagNames
- type Payments
Constants ¶
const LicenseConditions = `` /* 28846-byte string literal not displayed */
LicenseConditions of license
const LicenseWarranty = `` /* 551-byte string literal not displayed */
LicenseWarranty of license
Variables ¶
var ( // BuildCommit comes from BUILD_COMMIT env variable (set via linker flags) BuildCommit = "" // BuildBranch comes from BUILD_BRANCH env variable (set via linker flags) BuildBranch = "<unknown>" // BuildNumber comes from BUILD_NUMBER env variable (set via linker flags) BuildNumber = "dev-build" )
var DefaultNetwork = MainnetDefinition
DefaultNetwork defines default network values when no runtime parameters are given
var FlagNames = NetworkDefinitionFlagNames{ NetworkDefinition: NetworkDefinition{ MysteriumAPIAddress: "api.address", DiscoveryAddress: "discovery.address", AccessPolicyOracleAddress: "access-policy.address", TransactorAddress: "transactor.address", AffiliatorAddress: "affiliator.address", MMNAddress: "mmn.web-address", MMNAPIAddress: "mmn.api-address", PilvytisAddress: "pilvytis.address", ObserverAddress: "observer.address", DefaultCurrency: "default-currency", LocationAddress: "location.address", }, BrokerAddressesFlag: "broker-address", Chain1Flag: getChainDefinitionFlagNames(1), Chain2Flag: getChainDefinitionFlagNames(2), DefaultChainIDFlag: "chain-id", PaymentsDataLeewayMegabytes: "payments.consumer.data-leeway-megabytes", }
FlagNames defines the flag that sets each network parameter
var LocalnetDefinition = NetworkDefinition{ MysteriumAPIAddress: "http://localhost:8001/v1", DiscoveryAddress: "http://localhost:8001/v1", AccessPolicyOracleAddress: "https://localhost:8081/api/v1/access-policies/", BrokerAddresses: []string{"localhost"}, MMNAddress: "http://localhost/", MMNAPIAddress: "http://localhost/api/v1", PilvytisAddress: "http://localhost:8002/api/v1", DNSMap: map[string][]string{ "localhost": {"127.0.0.1"}, }, DefaultChainID: 1, }
LocalnetDefinition defines parameters for local network Expects discovery, broker and morqa services on localhost
var MainnetDefinition = NetworkDefinition{ MysteriumAPIAddress: "https://discovery.mysterium.network/api/v4", DiscoveryAddress: "https://discovery.mysterium.network/api/v4", AccessPolicyOracleAddress: "https://trust.mysterium.network/api/v1/access-policies/", BrokerAddresses: []string{"nats://broker.mysterium.network"}, TransactorAddress: "https://transactor.mysterium.network/api/v1", AffiliatorAddress: "https://affiliator.mysterium.network/api/v1", Chain1: ChainDefinition{ RegistryAddress: "0x87F0F4b7e0FAb14A565C87BAbbA6c40c92281b51", ChannelImplAddress: "0xbd20839b331a7a8d10e34cdf7219edf334814c4f", HermesID: "0xa62a2a75949d25e17c6f08a7818e7be97c18a8d2", ChainID: 1, MystAddress: "0x4Cf89ca06ad997bC732Dc876ed2A7F26a9E7f361", EtherClientRPC: []string{ "https://ethereum1.mysterium.network/", "https://cloudflare-eth.com/", }, KnownHermeses: []string{ "0xa62a2a75949d25e17c6f08a7818e7be97c18a8d2", }, }, Chain2: ChainDefinition{ RegistryAddress: "0x87F0F4b7e0FAb14A565C87BAbbA6c40c92281b51", ChannelImplAddress: "0x6b423D3885B4877b5760E149364f85f185f477aD", HermesID: "0x80ed28d84792d8b153bf2f25f0c4b7a1381de4ab", ChainID: 137, MystAddress: "0x1379e8886a944d2d9d440b3d88df536aea08d9f3", EtherClientRPC: []string{ "https://polygon1.mysterium.network/", "https://polygon-rpc.com/", }, KnownHermeses: []string{ "0xa62a2a75949d25e17c6f08a7818e7be97c18a8d2", "0x80ed28d84792d8b153bf2f25f0c4b7a1381de4ab", }, }, MMNAddress: "https://my.mystnodes.com", MMNAPIAddress: "https://api.mystnodes.com/api/v1", PilvytisAddress: "https://pilvytis.mysterium.network", ObserverAddress: "https://observer.mysterium.network", DNSMap: map[string][]string{ "discovery.mysterium.network": {"51.158.204.30", "51.158.204.75", "51.158.204.9", "51.158.204.23"}, "trust.mysterium.network": {"51.158.204.30", "51.158.204.75", "51.158.204.9", "51.158.204.23"}, "broker.mysterium.network": {"51.158.204.30", "51.158.204.75", "51.158.204.9", "51.158.204.23"}, "transactor.mysterium.network": {"51.158.204.30", "51.158.204.75", "51.158.204.9", "51.158.204.23"}, "affiliator.mysterium.network": {"51.158.204.30", "51.158.204.75", "51.158.204.9", "51.158.204.23"}, "pilvytis.mysterium.network": {"51.158.204.30", "51.158.204.75", "51.158.204.9", "51.158.204.23"}, "observer.mysterium.network": {"51.158.204.30", "51.158.204.75", "51.158.204.9", "51.158.204.23"}, }, DefaultChainID: 137, DefaultCurrency: "MYST", LocationAddress: "https://location.mysterium.network/api/v1/location", Payments: Payments{ DataLeewayMegabytes: 20, }, }
MainnetDefinition defines parameters for mainnet network (currently default network)
var TestnetDefinition = NetworkDefinition{ MysteriumAPIAddress: "https://discovery-testnet.mysterium.network/api/v4", DiscoveryAddress: "https://discovery-testnet.mysterium.network/api/v4", AccessPolicyOracleAddress: "https://trust-testnet.mysterium.network/api/v1/access-policies/", BrokerAddresses: []string{"nats://broker.mysterium.network:4223"}, TransactorAddress: "https://transactor-testnet.mysterium.network/api/v1", AffiliatorAddress: "https://affiliator.mysterium.network/api/v1", Chain1: ChainDefinition{ ChainID: 1, EtherClientRPC: []string{ "https://ethereum1.mysterium.network/", "https://cloudflare-eth.com/", }, }, Chain2: ChainDefinition{ RegistryAddress: "0x935305eBD48264E72067c242231b9c1638f8722c", ChannelImplAddress: "0xA7D2b4834e059720b18EAfa56Fc076622a6d6275", HermesID: "0xf1e8f60009005cc760c8e96fb3cabd992f9004e6", ChainID: 80002, MystAddress: "0x5B75A099da7533CC800e77eeAEc3409c12420A15", EtherClientRPC: []string{ "https://polygon-amoy1.mysterium.network", }, KnownHermeses: []string{ "0xf1e8f60009005cc760c8e96fb3cabd992f9004e6", }, }, MMNAddress: "https://my.mystnodes.com", MMNAPIAddress: "https://api.mystnodes.com/api/v1", PilvytisAddress: "https://pilvytis-testnet.mysterium.network", ObserverAddress: "https://observer-testnet.mysterium.network", DNSMap: map[string][]string{ "trust.mysterium.network": {"51.158.204.30", "51.158.204.75", "51.158.204.9", "51.158.204.23"}, "broker.mysterium.network": {"51.158.204.30", "51.158.204.75", "51.158.204.9", "51.158.204.23"}, "affiliator.mysterium.network": {"51.158.204.30", "51.158.204.75", "51.158.204.9", "51.158.204.23"}, }, DefaultChainID: 80002, DefaultCurrency: "MYST", LocationAddress: "https://location.mysterium.network/api/v1/location", Payments: Payments{ DataLeewayMegabytes: 20, }, }
TestnetDefinition defines parameters for testnet network
var Version = ""
Version comes from BUILD_VERSION env variable (set via linker flags)
Functions ¶
func BuildAsString ¶
func BuildAsString() string
BuildAsString returns all defined build constants as single string
func FormatString ¶
FormatString formats build info to string with given build data
func LicenseCopyright ¶
LicenseCopyright returns copyright text string with custom commands
func VersionAsString ¶
func VersionAsString() string
VersionAsString returns all defined version constants as single string
func VersionAsSummary ¶
VersionAsSummary returns overview of current program's version
Types ¶
type ChainDefinition ¶
type ChainDefinition struct { RegistryAddress string HermesID string ChannelImplAddress string ChainID int64 MystAddress string EtherClientRPC []string KnownHermeses []string }
ChainDefinition defines the configuration for the chain.
type ChainDefinitionFlagNames ¶
type ChainDefinitionFlagNames struct { ChainDefinition ChainIDFlag string EtherClientRPCFlag string KnownHermesesFlag string }
ChainDefinitionFlagNames structure holds all parameters which define the flags for a chain
type NetworkDefinition ¶
type NetworkDefinition struct { // Deprecated: use DiscoveryAddress MysteriumAPIAddress string DiscoveryAddress string AccessPolicyOracleAddress string BrokerAddresses []string TransactorAddress string AffiliatorAddress string Chain1 ChainDefinition Chain2 ChainDefinition MMNAddress string MMNAPIAddress string PilvytisAddress string ObserverAddress string DNSMap map[string][]string DefaultChainID int64 DefaultCurrency string LocationAddress string Payments Payments }
NetworkDefinition structure holds all parameters which describe particular network
func (*NetworkDefinition) GetDefaultFlagValues ¶
func (n *NetworkDefinition) GetDefaultFlagValues() map[string]any
GetDefaultFlagValues returns a map of flag name to default value for the network
type NetworkDefinitionFlagNames ¶
type NetworkDefinitionFlagNames struct { NetworkDefinition BrokerAddressesFlag string Chain1Flag ChainDefinitionFlagNames Chain2Flag ChainDefinitionFlagNames DefaultChainIDFlag string PaymentsDataLeewayMegabytes string }
NetworkDefinitionFlagNames structure holds all parameters which define the flags for a network