config

package
v0.0.20 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 14, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Blockchain is Ethereum.
	Blockchain string = "Ethereum"

	// MainnetNetwork is the value of the network
	// in MainnetNetworkIdentifier.
	MainnetNetwork string = "Mainnet"

	// GoerliNetwork is the value of the network
	// in GoerliNetworkNetworkIdentifier.
	GoerliNetwork string = "Goerli"

	// SepoliaNetwork is the value of the network
	// in SepoliaNetworkNetworkIdentifier.
	SepoliaNetwork string = "Sepolia"

	// Symbol is the symbol value
	// used in Currency.
	Symbol = "ETH"

	// Decimals is the decimals value
	// used in Currency.
	Decimals = 18

	// Online is when the implementation is permitted
	// to make outbound connections.
	Online configuration.Mode = "ONLINE"

	// Offline is when the implementation is not permitted
	// to make outbound connections.
	Offline configuration.Mode = "OFFLINE"

	// Mainnet is the Ethereum Mainnet.
	Mainnet string = "MAINNET"

	// Goerli is the Ethereum Görli testnet.
	Goerli string = "GOERLI"

	// Sepolia is the Ethereum Sepolia testnet.
	Sepolia string = "SEPOLIA"

	// Testnet defaults to `Ropsten` for backwards compatibility.
	Testnet string = "TESTNET"

	// DataDirectory is the default location for all
	// persistent data.
	DataDirectory = "/data"

	// ModeEnv is the environment variable read
	// to determine mode.
	ModeEnv = "MODE"

	// NetworkEnv is the environment variable
	// read to determine network.
	NetworkEnv = "NETWORK"

	// PortEnv is the environment variable
	// read to determine the port for the Rosetta
	// implementation.
	PortEnv = "PORT"

	// TokenFilterEnv is the environment variable
	// read to determine if we will filter tokens
	// using our token white list
	TokenFilterEnv = "FILTER"

	// UseTokenWhiteListMetadataEnv is the environment variable
	// read to determine if we will use token metadata
	// from the token white list or fetch from nodes
	UseTokenWhiteListMetadataEnv = "USE_TOKEN_WHITE_LIST_METADATA"

	// GethEnv is an optional environment variable
	// used to connect rosetta-ethereum to an already
	// running geth node.
	GethEnv = "GETH"

	// DefaultGethURL is the default URL for
	// a running geth node. This is used
	// when GethEnv is not populated.
	DefaultGethURL = "http://127.0.0.1:8546"

	// SkipGethAdminEnv is an optional environment variable
	// to skip geth `admin` calls which are typically not supported
	// by hosted node services. When not set, defaults to false.
	SkipGethAdminEnv = "SKIP_GETH_ADMIN"

	// MiddlewareVersion is the version of rosetta-ethereum.
	MiddlewareVersion = "0.0.4"

	// MainnetGethArguments are the arguments to start a mainnet geth instance.
	MainnetGethArguments = `--config=/app/ethereum/geth.toml --gcmode=archive --graphql`

	// GenesisBlockIndex is the index of the genesis block.
	GenesisBlockIndex = int64(0)
)

Variables

View Source
var (
	// GoerliGethArguments are the arguments to start a goerli geth instance.
	GoerliGethArguments = fmt.Sprintf("%s --goerli", MainnetGethArguments)

	// SepoliaGethArguments are the arguments to start a sepolia geth instance.
	SepoliaGethArguments = fmt.Sprintf("%s --sepolia", MainnetGethArguments)

	// MainnetGenesisBlockIdentifier is the *types.BlockIdentifier
	// of the mainnet genesis block.
	MainnetGenesisBlockIdentifier = &types.BlockIdentifier{
		Hash:  params.MainnetGenesisHash.Hex(),
		Index: GenesisBlockIndex,
	}

	// GoerliGenesisBlockIdentifier is the *types.BlockIdentifier
	// of the Goerli genesis block.
	GoerliGenesisBlockIdentifier = &types.BlockIdentifier{
		Hash:  params.GoerliGenesisHash.Hex(),
		Index: GenesisBlockIndex,
	}

	// SepoliaGenesisBlockIdentifier is the *types.BlockIdentifier
	// of the Sepolia genesis block.
	SepoliaGenesisBlockIdentifier = &types.BlockIdentifier{
		Hash:  params.SepoliaGenesisHash.Hex(),
		Index: GenesisBlockIndex,
	}
)

Functions

func LoadConfiguration

func LoadConfiguration() (*configuration.Configuration, error)

LoadConfiguration attempts to create a new Configuration using the ENVs in the environment.

Types

type Mode

type Mode string

Mode is the setting that determines if the implementation is "online" or "offline".

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL