Documentation ¶
Index ¶
- Variables
- func BindFlagsLoadViper(cmd *cobra.Command, _ []string) error
- func GetConfigFilePath() string
- func Write(cfg Config, path string) error
- type Block
- type ChainConfig
- type CobraCmdFunc
- type Config
- type ConfigParser
- type DatabaseConfig
- type Instruction
- type LoggingConfig
- type ParsingConfig
- type PruningConfig
- type RPCConfig
- type SlotQueue
- type TelemetryConfig
- type Tx
- type Validator
- type WorkerConfig
Constants ¶
This section is empty.
Variables ¶
var (
HomePath = ""
)
Functions ¶
func BindFlagsLoadViper ¶
BindFlagsLoadViper binds all flags and read the config into viper
func GetConfigFilePath ¶
func GetConfigFilePath() string
GetConfigFilePath returns the path to the configuration file given the executable name
Types ¶
type Block ¶
type Block struct { Slot uint64 Height uint64 Hash string Leader string Rewards []clienttypes.Reward Timestamp time.Time Txs []Tx }
Block contains the data of a single chain block
func NewBlock ¶
func NewBlock(slot, height uint64, hash, leader string, rewards []clienttypes.Reward, timestamp time.Time, txs []Tx) Block
NewBlock allows to build a new Block instance
func NewBlockFromResult ¶
func NewBlockFromResult(parserManager manager.ParserManager, slot uint64, b clienttypes.BlockResult) Block
NewBlockFromResult allows to build new Block instance from BlockResult
type ChainConfig ¶
type ChainConfig interface {
GetModules() []string
}
ChainConfig contains the data to configure the ChainConfig SDK
func DefaultChainConfig ¶
func DefaultChainConfig() ChainConfig
DefaultChainConfig returns the default instance of ChainConfig
func NewChainConfig ¶
func NewChainConfig(modules []string) ChainConfig
NewChainConfig returns a new ChainConfig instance
type CobraCmdFunc ¶
CobraCmdFunc represents a cobra command function
func ConcatCobraCmdFuncs ¶
func ConcatCobraCmdFuncs(fs ...CobraCmdFunc) CobraCmdFunc
ConcatCobraCmdFuncs returns a single function that calls each argument function in sequence RunE, PreRunE, PersistentPreRunE, etc. all have this same signature
type Config ¶
type Config interface { GetRPCConfig() RPCConfig GetChainConfig() ChainConfig GetDatabaseConfig() DatabaseConfig GetLoggingConfig() LoggingConfig GetParsingConfig() ParsingConfig SetParsingConfig(config ParsingConfig) GetPruningConfig() PruningConfig GetTelemetryConfig() TelemetryConfig GetWorkerConfig() WorkerConfig }
Config represents the configuration to run Juno
var ( // Cfg represents the configuration to be used during the execution Cfg Config )
func DefaultConfigParser ¶
DefaultConfigParser attempts to read and parse a Juno config from the given string bytes. An error reading or parsing the config results in a panic.
func NewConfig ¶
func NewConfig( rpcConfig RPCConfig, chainConfig ChainConfig, dbConfig DatabaseConfig, loggingConfig LoggingConfig, parsingConfig ParsingConfig, pruningConfig PruningConfig, telemetryConfig TelemetryConfig, workerConfig WorkerConfig, ) Config
NewConfig builds a new Config instance
type ConfigParser ¶
ConfigParser represents a function that allows to parse a file contents as a Config object
type DatabaseConfig ¶
type DatabaseConfig interface { GetName() string GetHost() string GetPort() int64 GetUser() string GetPassword() string GetSSLMode() string GetSchema() string GetMaxOpenConnections() int GetMaxIdleConnections() int }
DatabaseConfig represents a generic database configuration
func DefaultDatabaseConfig ¶
func DefaultDatabaseConfig() DatabaseConfig
DefaultDatabaseConfig returns the default instance of DatabaseConfig
type Instruction ¶
type Instruction struct { TxSignature string Slot uint64 Index int InnerIndex int Program string InvolvedAccounts []string RawData string Parsed types.ParsedInstruction }
func NewInstruction ¶
func NewInstruction( signature string, slot uint64, index int, innerIndex int, program string, involvedAccounts []string, rawData string, parsed types.ParsedInstruction, ) Instruction
type LoggingConfig ¶
LoggingConfig represents the configuration for the logging part
func DefaultLoggingConfig ¶
func DefaultLoggingConfig() LoggingConfig
DefaultLoggingConfig returns the default LoggingConfig instance
func NewLoggingConfig ¶
func NewLoggingConfig(level, format string) LoggingConfig
NewLoggingConfig returns a new LoggingConfig instance
type ParsingConfig ¶
type ParsingConfig interface { GetWorkers() int64 ShouldParseNewBlocks() bool ShouldParseOldBlocks() bool GetStartSlot() uint64 SetStartSlot(slot uint64) }
ParsingConfig represents the configuration of the parsing
func DefaultParsingConfig ¶
func DefaultParsingConfig() ParsingConfig
DefaultParsingConfig returns the default instance of ParsingConfig
func NewParsingConfig ¶
func NewParsingConfig( workers int64, parseNewBlocks, parseOldBlocks bool, startSlot uint64, ) ParsingConfig
NewParsingConfig allows to build a new ParsingConfig instance
type PruningConfig ¶
PruningConfig contains the configuration of the pruning strategy
func DefaultPruningConfig ¶
func DefaultPruningConfig() PruningConfig
DefaultPruningConfig returns the default PruningConfig instance
func NewPruningConfig ¶
func NewPruningConfig(keepRecent, keepEvery, interval int64) PruningConfig
NewPruningConfig returns a new PruningConfig
type RPCConfig ¶
RPCConfig contains the configuration of the RPC endpoint
func DefaultRPCConfig ¶
func DefaultRPCConfig() RPCConfig
DefaultRPCConfig returns the default instance of RPCConfig
func NewRPCConfig ¶
NewRPCConfig allows to build a new RPCConfig instance
type SlotQueue ¶
type SlotQueue chan uint64
SlotQueue is a simple type alias for a (buffered) channel of block heights.
type TelemetryConfig ¶
type TelemetryConfig interface {
GetPort() uint
}
TelemetryConfig contains the configuration of the telemetry strategy
func DefaultTelemetryConfig ¶
func DefaultTelemetryConfig() TelemetryConfig
DefaultTelemetryConfig returns the default TelemetryConfig instance
func NewTelemetryConfig ¶
func NewTelemetryConfig(port uint) TelemetryConfig
NewTelemetryConfig allows to build a new TelemetryConfig instance
type Tx ¶
type Tx struct { Signature string Slot uint64 Index int Error interface{} Fee uint64 Logs []string Instructions []Instruction Accounts []string PostBalances []uint64 PostTokenBalances []clienttypes.TransactionTokenBalance }
Tx represents an already existing blockchain transaction
func NewTx ¶
func NewTx( signature string, slot uint64, index int, err interface{}, fee uint64, logs []string, instructions []Instruction, accounts []string, postBalances []uint64, postTokenBalances []clienttypes.TransactionTokenBalance, ) Tx
NewTx allows to build a new Tx instance
func NewTxFromTxResult ¶
func NewTxFromTxResult(parserManager manager.ParserManager, slot uint64, index int, txResult clienttypes.EncodedTransactionWithStatusMeta) Tx
func (Tx) Successful ¶
Successful tells whether this tx is successful or not
type Validator ¶
Validator contains the data of a single validator
func NewValidator ¶
NewValidator allows to build a new Validator instance
type WorkerConfig ¶
type WorkerConfig interface {
GetPoolSize() int
}
WorkerConfig contains the configuration of the worker strategy
func DefaultWorkerConfig ¶
func DefaultWorkerConfig() WorkerConfig
DefaultWorkerConfig returns the default WorkerConfig instance
func NewWorkerConfig ¶
func NewWorkerConfig(poolSize int) WorkerConfig
NewWorkerConfig allows to build a new WorkerConfig instance