Documentation ¶
Index ¶
- Constants
- func BlackListInterceptor() grpc.UnaryServerInterceptor
- func BlackListStreamInterceptor() grpc.StreamServerInterceptor
- func GetClientAddr(ctx context.Context) string
- func GrpcHandlerFunc(grpcServer *grpc.Server, otherHandler http.Handler) http.Handler
- func LoggingInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, ...) (interface{}, error)
- func MonitorInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, ...) (interface{}, error)
- func RateLimitInterceptor() grpc.UnaryServerInterceptor
- func RecoveryInterceptor(ctx context.Context, req interface{}, _ *grpc.UnaryServerInfo, ...) (resp interface{}, err error)
- func StreamRecoveryInterceptor() grpc.StreamServerInterceptor
- type ApiService
- func (s *ApiService) CheckNewBlockChainConfig(context.Context, *configPb.CheckNewBlockChainConfigRequest) (*configPb.CheckNewBlockChainConfigResponse, error)
- func (s *ApiService) GetHerbtVersion(ctx context.Context, req *configPb.HerbtVersionRequest) (*configPb.HerbtVersionResponse, error)
- func (s *ApiService) GetPoolStatus(ctx context.Context, request *txpoolPb.GetPoolStatusRequest) (*txpoolPb.TxPoolStatus, error)
- func (s *ApiService) GetTxIdsByTypeAndStage(ctx context.Context, request *txpoolPb.GetTxIdsByTypeAndStageRequest) (*txpoolPb.GetTxIdsByTypeAndStageResponse, error)
- func (s *ApiService) GetTxsInPoolByTxIds(ctx context.Context, request *txpoolPb.GetTxsInPoolByTxIdsRequest) (*txpoolPb.GetTxsInPoolByTxIdsResponse, error)
- func (s *ApiService) RefreshLogLevelsConfig(ctx context.Context, req *configPb.LogLevelsRequest) (*configPb.LogLevelsResponse, error)
- func (s *ApiService) SendRequest(ctx context.Context, req *commonPb.TxRequest) (*commonPb.TxResponse, error)
- func (s *ApiService) Subscribe(req *commonPb.TxRequest, server apiPb.RpcNode_SubscribeServer) error
- func (s *ApiService) SubscribeWS(rawTxReq *commonPb.RawTxRequest, server apiPb.RpcNode_SubscribeWSServer) error
- func (s *ApiService) UpdateDebugConfig(ctx context.Context, req *configPb.DebugConfigRequest) (*configPb.DebugConfigResponse, error)
- type RPCServer
Constants ¶
const ( TLS_MODE_DISABLE = "disable" TLS_MODE_ONEWAY = "oneway" TLS_MODE_TWOWAY = "twoway" )
TLS Mode
const (
//SYSTEM_CHAIN the system chain name
SYSTEM_CHAIN = "system_chain"
)
const (
// TRUE true string
TRUE = "true"
)
const (
//UNKNOWN unknown string
UNKNOWN = "unknown"
)
Variables ¶
This section is empty.
Functions ¶
func BlackListInterceptor ¶
func BlackListInterceptor() grpc.UnaryServerInterceptor
BlackListInterceptor - set ip blacklist interceptor
func BlackListStreamInterceptor ¶
func BlackListStreamInterceptor() grpc.StreamServerInterceptor
BlackListStreamInterceptor - set ip blacklist interceptor
func GetClientAddr ¶
func GrpcHandlerFunc ¶
func LoggingInterceptor ¶
func LoggingInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)
LoggingInterceptor - set logging interceptor
func MonitorInterceptor ¶
func MonitorInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)
MonitorInterceptor - set monitor interceptor
func RateLimitInterceptor ¶
func RateLimitInterceptor() grpc.UnaryServerInterceptor
RateLimitInterceptor - set ratelimit interceptor
func RecoveryInterceptor ¶
func RecoveryInterceptor(ctx context.Context, req interface{}, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error)
RecoveryInterceptor - set recovery interceptor
func StreamRecoveryInterceptor ¶
func StreamRecoveryInterceptor() grpc.StreamServerInterceptor
StreamRecoveryInterceptor - set stream recovery interceptor
Types ¶
type ApiService ¶
type ApiService struct {
// contains filtered or unexported fields
}
ApiService struct define
func NewApiService ¶
func NewApiService(ctx context.Context, herbtServer *blockchain.HerbtServer) *ApiService
NewApiService - new ApiService object
func (*ApiService) CheckNewBlockChainConfig ¶
func (s *ApiService) CheckNewBlockChainConfig(context.Context, *configPb.CheckNewBlockChainConfigRequest) ( *configPb.CheckNewBlockChainConfigResponse, error)
CheckNewBlockChainConfig check new block chain config.
func (*ApiService) GetHerbtVersion ¶
func (s *ApiService) GetHerbtVersion(ctx context.Context, req *configPb.HerbtVersionRequest) ( *configPb.HerbtVersionResponse, error)
GetHerbtVersion get herbt version by rpc request
func (*ApiService) GetPoolStatus ¶
func (s *ApiService) GetPoolStatus(ctx context.Context, request *txpoolPb.GetPoolStatusRequest) (*txpoolPb.TxPoolStatus, error)
GetPoolStatus Returns the max size of config transaction pool and common transaction pool, the num of config transaction in queue and pendingCache, and the the num of common transaction in queue and pendingCache.
func (*ApiService) GetTxIdsByTypeAndStage ¶
func (s *ApiService) GetTxIdsByTypeAndStage(ctx context.Context, request *txpoolPb.GetTxIdsByTypeAndStageRequest) (*txpoolPb.GetTxIdsByTypeAndStageResponse, error)
GetTxIdsByTypeAndStage Returns config or common txIds in different stage. TxType may be TxType_CONFIG_TX, TxType_COMMON_TX, (TxType_CONFIG_TX|TxType_COMMON_TX) TxStage may be TxStage_IN_QUEUE, TxStage_IN_PENDING, (TxStage_IN_QUEUE|TxStage_IN_PENDING)
func (*ApiService) GetTxsInPoolByTxIds ¶
func (s *ApiService) GetTxsInPoolByTxIds(ctx context.Context, request *txpoolPb.GetTxsInPoolByTxIdsRequest) (*txpoolPb.GetTxsInPoolByTxIdsResponse, error)
GetTxsInPoolByTxIds Retrieve the transactions by the txIds from the txPool, return transactions in the txPool and txIds not in txPool. default query upper limit is 1w transaction, and error is returned if the limit is exceeded.
func (*ApiService) RefreshLogLevelsConfig ¶
func (s *ApiService) RefreshLogLevelsConfig(ctx context.Context, req *configPb.LogLevelsRequest) ( *configPb.LogLevelsResponse, error)
RefreshLogLevelsConfig - refresh log level
func (*ApiService) SendRequest ¶
func (s *ApiService) SendRequest(ctx context.Context, req *commonPb.TxRequest) (*commonPb.TxResponse, error)
SendRequest - deal received TxRequest
func (*ApiService) Subscribe ¶
func (s *ApiService) Subscribe(req *commonPb.TxRequest, server apiPb.RpcNode_SubscribeServer) error
Subscribe - deal block/tx/contracEvent subscribe request
func (*ApiService) SubscribeWS ¶
func (s *ApiService) SubscribeWS(rawTxReq *commonPb.RawTxRequest, server apiPb.RpcNode_SubscribeWSServer) error
SubscribeWS processing requests for message subscription by websocket
func (*ApiService) UpdateDebugConfig ¶
func (s *ApiService) UpdateDebugConfig(ctx context.Context, req *configPb.DebugConfigRequest) ( *configPb.DebugConfigResponse, error)
UpdateDebugConfig - update debug config for test
type RPCServer ¶
type RPCServer struct {
// contains filtered or unexported fields
}
RPCServer struct define
func NewRPCServer ¶
func NewRPCServer(herbtServer *blockchain.HerbtServer) (*RPCServer, error)
NewRPCServer - new RPCServer object
func (*RPCServer) RegisterHandler ¶
RegisterHandler - register apiservice handler to rpcserver