Documentation ¶
Index ¶
- Constants
- func GetGRPCAddress(cmd *cobra.Command) string
- func GetRPCAddress(cmd *cobra.Command) string
- func GetRPCPort(cmd *cobra.Command) string
- func PreRun(cmd *cobra.Command, _ []string) error
- func ResolveAddr(address string, defaultIP string) (*net.TCPAddr, error)
- func Run(cmd *cobra.Command, args []string)
- func SetFlags(cmd *cobra.Command)
- type CLIOutput
- type CommandResult
- type Config
- type Headers
- type JSONOutput
- type Network
- type OutputFormatter
- type Server
- type ServerConfig
Constants ¶
View Source
const ( JsonrpcAddress = "http.addr" JsonrpcPort = "http.port" )
View Source
const ( NoDiscoverFlag = "no-discover" BootnodeFlag = "bootnode" LogLevelFlag = "log-level" GRPCAddressFlag = "grpc-address" )
View Source
const (
JSONOutputFlag = "json"
)
Variables ¶
This section is empty.
Functions ¶
func GetGRPCAddress ¶
func GetRPCAddress ¶
func GetRPCPort ¶
func ResolveAddr ¶
ResolveAddr resolves the passed in TCP address The second param is the default ip to bind to, if no ip address is specified
Types ¶
type CLIOutput ¶
type CLIOutput struct {
// contains filtered or unexported fields
}
func (*CLIOutput) SetCommandResult ¶
func (c *CLIOutput) SetCommandResult(result CommandResult)
func (*CLIOutput) WriteOutput ¶
func (cli *CLIOutput) WriteOutput()
type CommandResult ¶
type CommandResult interface {
GetOutput() string
}
type Config ¶
type Config struct { GenesisPath string `json:"chain_config"` SecretsConfigPath string `json:"secrets_config"` DataDir string `json:"data_dir"` BlockGasTarget string `json:"block_gas_target"` GRPCAddr string `json:"grpc_addr"` HttpAddr string `json:"rpc_addr"` HttpPort string `json:"rpc_port"` Network *Network `json:"network"` LogLevel string `json:"log_level"` BlockTime uint64 `json:"block_time_s"` Headers *Headers `json:"headers"` LogFilePath string `json:"log_to"` }
Config defines the server configuration params
func DefaultConfig ¶
func DefaultConfig() *Config
type Headers ¶
type Headers struct {
AccessControlAllowOrigins []string `json:"access_control_allow_origins"`
}
Headers defines the HTTP response headers required to enable CORS.
type JSONOutput ¶
type JSONOutput struct {
// contains filtered or unexported fields
}
func (*JSONOutput) SetCommandResult ¶
func (c *JSONOutput) SetCommandResult(result CommandResult)
func (*JSONOutput) WriteOutput ¶
func (jo *JSONOutput) WriteOutput()
type Network ¶
type Network struct { NoDiscover bool `json:"no_discover"` Libp2pAddr string `json:"libp2p_addr"` NatAddr string `json:"nat_addr"` DNSAddr string `json:"dns_addr"` MaxPeers int64 `json:"max_peers,omitempty"` MaxOutboundPeers int64 `json:"max_outbound_peers,omitempty"` MaxInboundPeers int64 `json:"max_inbound_peers,omitempty"` }
Network defines the network configuration params
type OutputFormatter ¶
type OutputFormatter interface { // SetError sets the encountered error SetError(err error) // SetCommandResult sets the result of the command execution SetCommandResult(result CommandResult) // WriteOutput writes the result / error output WriteOutput() // contains filtered or unexported methods }
OutputFormatter is the standardized interface all output formatters should use
func InitializeOutputter ¶
func InitializeOutputter(cmd *cobra.Command) OutputFormatter
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(ctx context.Context, config *ServerConfig) (*Server, error)
NewServer creates a new Minimal server, using the passed in configuration
type ServerConfig ¶
type ServerConfig struct { Chain *chain.Chain EnableGraphQL bool GRPCAddr *net.TCPAddr LibP2PAddr *net.TCPAddr RpcAddr string RpcPort string PriceLimit uint64 MaxSlots uint64 BlockTime uint64 PruneTickSeconds uint64 PromoteOutdateSeconds uint64 Network *network.Config DataDir string RestoreFile *string Seal bool SecretsManager *secrets.SecretsManagerConfig LogLevel hclog.Level LogFilePath string Daemon bool ValidatorKey string }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.