Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitializeWebServer ¶
InitializeWebServer sets up and initializes the web server with all necessary dependencies.
func InstallGenericAPI ¶
InstallGenericAPI 注册业务无关的路由,例如 pprof、404 处理等.
func NewAggregatorServer ¶
func NewAggregatorServer(serverConfig *ServerConfig) (server.Server, error)
Types ¶
type AggregatorServer ¶
type AggregatorServer struct {
// contains filtered or unexported fields
}
func (*AggregatorServer) GracefulStop ¶
func (s *AggregatorServer) GracefulStop(ctx context.Context)
func (*AggregatorServer) RunOrDie ¶
func (s *AggregatorServer) RunOrDie()
type Config ¶
type Config struct { Miner bool MinMineInterval time.Duration Address string Accounts map[string]string HTTPOptions *genericoptions.HTTPOptions TLSOptions *genericoptions.TLSOptions P2PAddr string Peers []string }
Config contains application-related configurations.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents the web server.
type ServerConfig ¶
type ServerConfig struct {
// contains filtered or unexported fields
}
ServerConfig contains the core dependencies and configurations of the server.
func (*ServerConfig) InstallRESTAPI ¶
func (c *ServerConfig) InstallRESTAPI(engine *gin.Engine)
注册 API 路由。路由的路径和 HTTP 方法,严格遵循 REST 规范.
func (*ServerConfig) NewBlockChainServer ¶
func (c *ServerConfig) NewBlockChainServer() *blcServer
func (*ServerConfig) NewP2PServer ¶
func (c *ServerConfig) NewP2PServer() *p2pServer
Click to show internal directories.
Click to hide internal directories.