Documentation
¶
Index ¶
- Constants
- type Configuration
- func (c Configuration) IsAnalyticsMode() bool
- func (c Configuration) IsOfflineMode() bool
- func (c Configuration) IsOnlineMode() bool
- func (c Configuration) IsStandardMode() bool
- func (c Configuration) IsTokenListEmpty() bool
- func (c Configuration) IsTrustlessAccountValidationEnabled() bool
- func (c Configuration) IsTrustlessBlockValidationEnabled() bool
- type HTTPHeader
- type Mode
- type RosettaConfig
- type Token
Constants ¶
const ( GethNativeTrace = iota // == 0 GethJsTrace = iota // == 1 OpenEthereumTrace = iota // == 2 ModeOffline = "OFFLINE" ModeOnline = "ONLINE" StandardIngestion = "standard" AnalyticsIngestion = "analytics" DefaultBaseFeeFloor = 0 DefaultBaseFeeMultiplier = 1 DefaultPriorityFeeDivisor = 1 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Configuration ¶
type Configuration struct {
// Mode is the setting that determines if
// the implementation is "online" or "offline".
Mode Mode
// NetworkIdentifier specifies which network our Rosetta server uses
Network *RosettaTypes.NetworkIdentifier
// GenesisBlockIdentifier is the genesis block
GenesisBlockIdentifier *RosettaTypes.BlockIdentifier
// GethURL is the blockchain node we are connecting to
GethURL string
// RemoteGeth indicates whether we are using a local or remote blockchain node
RemoteGeth bool
// Port is the Rosetta server's listening port
Port int
// 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.
SkipGethAdmin bool
// GethArguments are the arguments to start a blockchain instance.
GethArguments string
// ChainConfig is the core config which determines the blockchain settings.
ChainConfig *params.ChainConfig
// RosettaCfg defines the config that used to implement Rosetta APIs
RosettaCfg RosettaConfig
}
Configuration determines how the we setup the blockchain and Rosetta server
func (Configuration) IsAnalyticsMode ¶
func (c Configuration) IsAnalyticsMode() bool
IsAnalyticsMode returns true if running in standard
func (Configuration) IsOfflineMode ¶
func (c Configuration) IsOfflineMode() bool
IsOfflineMode returns true if running in offline mode
func (Configuration) IsOnlineMode ¶
func (c Configuration) IsOnlineMode() bool
IsOnlineMode returns true if running in online mode
func (Configuration) IsStandardMode ¶
func (c Configuration) IsStandardMode() bool
IsStandardMode returns true if running in standard
func (Configuration) IsTokenListEmpty ¶
func (c Configuration) IsTokenListEmpty() bool
IsTokenListEmpty returns true if the token addresses list is empty
func (Configuration) IsTrustlessAccountValidationEnabled ¶ added in v0.1.1
func (c Configuration) IsTrustlessAccountValidationEnabled() bool
IsTrustlessAccountValidationEnabled returns true if trustless account validation is enabled
func (Configuration) IsTrustlessBlockValidationEnabled ¶ added in v0.1.1
func (c Configuration) IsTrustlessBlockValidationEnabled() bool
IsTrustlessBlockValidationEnabled returns true if trustless block validation is enabled
type HTTPHeader ¶
HTTPHeader is key, value pair to be set on the HTTP and GraphQL SDKClient.
type Mode ¶
type Mode string
Mode is the setting that determines if the implementation is "online" or "offline".
type RosettaConfig ¶
type RosettaConfig struct {
// SupportRewardTx indicates whether the blockchain supports block reward
SupportRewardTx bool
// TraceType sets which type of tracing the blockchain supports
// The options are: GethNativeTrace, GethJsTrace, and OpenEthereumTrace
TraceType int
// SupportsSyncing indicates if the blockchain support eth_syncing RPC or not.
// Status syncing is used in Rosetta /network/status api
SupportsSyncing bool
// SupportsPeering indicates if the blockchain support admin_peers RPC or not.
// Peers retrieving is used in Rosetta /network/status api
SupportsPeering bool
// SupportsBlockAuthor indicates if blockchain supports author
SupportsBlockAuthor bool
// SupportsEIP1559 indicates if the blockchain supports EIP-1559
SupportsEIP1559 bool
// SupportsWithdrawals indicates if the blockchain supports EIP-4895 (withdrawals)
SupportsWithdrawals bool
// SupportsOpStack indicates if the blockchain supports OP stack
SupportsOpStack bool
// Currency is the native currency blockchain supports
Currency *RosettaTypes.Currency
// TracePrefix is the prefix appended to trace RPC calls
TracePrefix string
// IngestionMode indicates if blockchain ingestion mode
IngestionMode string
// IndexUnknownTokens determines whether we parse unknown ERC20 tokens
IndexUnknownTokens bool
// FilterToken determines whether we using our token whitelist
FilterTokens bool
// TokenWhiteList is a list of ERC20 tokens we only support
TokenWhiteList []Token
// UseTokenWhiteListMetadata indicates whether we use token metadata from token white list or fetch from nodes
UseTokenWhiteListMetadata bool
// DefaultBlockNumber is the default block number if block identifier is not specified
// This is mainly used for Optimism and Base, it can be "safe" or "finalized" to avoid reorg issues
DefaultBlockNumber string
// BaseFeeFloor is the floor base fee for EIP-1559
BaseFeeFloor *big.Int
// BaseFeeMultiplier is the multiplier of base fee for EIP-1559
BaseFeeMultiplier *big.Int
// PriorityFeeDivisor is the divisor of priority fee for EIP-1559
PriorityFeeDivisor *big.Int
// SupportCustomizedTraceConfig indicates if the blockchain supports customized trace config
SupportCustomizedTraceConfig bool
// CustomizedTraceConfig is the blockchain customized trace config
CustomizedTraceConfig interface{}
// SupportCustomizedBlockBody indicates if the blockchain supports customized block body
SupportCustomizedBlockBody bool
// SupportHeaderForwarding indicates if rosetta should forward rosetta request headers to the
// native node, and forward native node response headers to the rosetta caller
SupportHeaderForwarding bool
// ForwardHeaders is the list of headers to forward to and from the native node
ForwardHeaders []string
// EnableTrustlessBlockValidation determines whether we will try to enable block validation
EnableTrustlessBlockValidation bool
// EnableTrustlessAccountValidation determines whether we will try to enable account validation
EnableTrustlessAccountValidation bool
// Functor to access allowlisted tokens.
// This should be defined in rosetta-xxx implementation if needed
TokenWhitelistAccessor func() ([]Token, error)
}