Documentation ¶
Index ¶
- Constants
- Variables
- func BindFlagsLoadViper(cmd *cobra.Command, _ []string) error
- func ConvertValidatorAddressToBech32String(address types.Address) string
- func ConvertValidatorPubKeyToBech32String(pubKey tmcrypto.PubKey) (string, error)
- func DefaultConfigSetup(cfg Config, sdkConfig *sdk.Config)
- func GetConfigFilePath() string
- func Write(cfg Config, path string) error
- type Block
- type CobraCmdFunc
- type CommitSig
- type Config
- type ConfigParser
- type CosmosConfig
- type DatabaseConfig
- type EncodingConfigBuilder
- type GrpcConfig
- type HeightQueue
- type LoggingConfig
- type Message
- type ParsingConfig
- type PruningConfig
- type RPCConfig
- type SdkConfigSetup
- type TelemetryConfig
- type Tx
- type Validator
Constants ¶
const (
DefaultMaxConnections = 20
)
Variables ¶
var (
HomePath = ""
)
Functions ¶
func BindFlagsLoadViper ¶
BindFlagsLoadViper binds all flags and read the config into viper
func ConvertValidatorAddressToBech32String ¶
ConvertValidatorAddressToBech32String converts the given validator address to its Bech32 string representation
func ConvertValidatorPubKeyToBech32String ¶
ConvertValidatorPubKeyToBech32String converts the given pubKey to a Bech32 string
func DefaultConfigSetup ¶
DefaultConfigSetup represents a handy implementation of SdkConfigSetup that simply setups the prefix inside the configuration
func GetConfigFilePath ¶
func GetConfigFilePath() string
GetConfigFilePath returns the path to the configuration file given the executable name
Types ¶
type Block ¶
type Block struct { Height int64 Hash string TxNum int TotalGas uint64 ProposerAddress string Timestamp time.Time }
Block contains the data of a single chain block
func NewBlock ¶
func NewBlock( height int64, hash string, txNum int, totalGas uint64, proposerAddress string, timestamp time.Time, ) *Block
NewBlock allows to build a new Block instance
func NewBlockFromTmBlock ¶
func NewBlockFromTmBlock(blk *tmctypes.ResultBlock, totalGas uint64) *Block
NewBlockFromTmBlock builds a new Block instance from a given ResultBlock object
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 CommitSig ¶
type CommitSig struct { Height int64 ValidatorAddress string VotingPower int64 ProposerPriority int64 Timestamp time.Time }
CommitSig contains the data of a single validator commit signature
type Config ¶
type Config interface { GetRPCConfig() RPCConfig GetGrpcConfig() GrpcConfig GetCosmosConfig() CosmosConfig GetDatabaseConfig() DatabaseConfig GetLoggingConfig() LoggingConfig GetParsingConfig() ParsingConfig GetPruningConfig() PruningConfig GetTelemetryConfig() TelemetryConfig }
Config represents the configuration to run Juno
var ( // Cfg represents the configuration to be used during the execution Cfg Config HTTPProtocols = regexp.MustCompile("https?://") )
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, grpConfig GrpcConfig, cosmosConfig CosmosConfig, dbConfig DatabaseConfig, loggingConfig LoggingConfig, parsingConfig ParsingConfig, pruningConfig PruningConfig, telemetryConfig TelemetryConfig, ) 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 CosmosConfig ¶
CosmosConfig contains the data to configure the CosmosConfig SDK
func DefaultCosmosConfig ¶
func DefaultCosmosConfig() CosmosConfig
DefaultCosmosConfig returns the default instance of CosmosConfig
func NewCosmosConfig ¶
func NewCosmosConfig(prefix string, modules []string) CosmosConfig
NewCosmosConfig returns a new CosmosConfig instance
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 EncodingConfigBuilder ¶
type EncodingConfigBuilder func() params.EncodingConfig
EncodingConfigBuilder represents a function that is used to return the proper encoding config.
type GrpcConfig ¶
GrpcConfig contains the configuration of the gRPC endpoint
func DefaultGrpcConfig ¶
func DefaultGrpcConfig() GrpcConfig
DefaultGrpcConfig returns the default instance of a GrpcConfig
func NewGrpcConfig ¶
func NewGrpcConfig(address string, insecure bool) GrpcConfig
NewGrpcConfig allows to build a new GrpcConfig instance
type HeightQueue ¶
type HeightQueue chan int64
HeightQueue is a simple type alias for a (buffered) channel of block heights.
func NewQueue ¶
func NewQueue(size int) HeightQueue
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 ShouldParseGenesis() bool GetGenesisFilePath() string GetStartHeight() int64 UseFastSync() bool }
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, parseGenesis bool, genesisFilePath string, startHeight int64, fastSync bool, ) 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 SdkConfigSetup ¶
SdkConfigSetup represents a method that allows to customize the given sdk.ParsingConfig. This should be used to set custom Bech32 addresses prefixes and other app-related configurations.
type TelemetryConfig ¶
TelemetryConfig contains the configuration of the pruning strategy
func DefaultTelemetryConfig ¶
func DefaultTelemetryConfig() TelemetryConfig
DefaultTelemetryConfig returns the default TelemetryConfig instance
func NewTelemetryConfig ¶
func NewTelemetryConfig(enabled bool, port uint) TelemetryConfig
NewTelemetryConfig allows to build a new TelemetryConfig instance
type Tx ¶
type Tx struct { *tx.Tx *sdk.TxResponse }
Tx represents an already existing blockchain transaction
func (Tx) FindAttributeByKey ¶
FindAttributeByKey searches inside the specified event of the given tx to find the attribute having the given key. If the specified event does not contain a such attribute, returns an error instead.
func (Tx) FindEventByType ¶
FindEventByType searches inside the given tx events for the message having the specified index, in order to find the event having the given type, and returns it. If no such event is found, returns an error instead.
func (Tx) Successful ¶
Successful tells whether this tx is successful or not