Documentation ¶
Index ¶
- Constants
- func GetExtrinsicFee(p websocket.WsConn, encodeExtrinsic string) (fee decimal.Decimal, err error)
- type Service
- func (s *Service) AddEvent(txn *dao.GormDB, block *model.ChainBlock, e []model.ChainEvent, ...) (eventCount int, err error)
- func (s *Service) BlockAsSampleJson(block *model.ChainBlock) *model.SampleBlockJson
- func (s *Service) Close()
- func (s *Service) CreateChainBlock(conn websocket.WsConn, hash string, block *rpc.Block, event string, spec int, ...) (err error)
- func (s *Service) DaemonHealth(ctx context.Context) map[string]bool
- func (s *Service) EmitLog(txn *dao.GormDB, blockNum int, l []storage.DecoderLog, finalized bool, ...) (validator string, err error)
- func (s *Service) EventByIndex(index string) *model.ChainEvent
- func (s *Service) ExtrinsicsAsJson(e *model.ChainExtrinsic) *model.ChainExtrinsicJson
- func (s *Service) FillBlockData(conn websocket.WsConn, blockNum int, finalized bool) (err error)
- func (s *Service) GetBlockByHash(hash string) *model.ChainBlock
- func (s *Service) GetBlockByHashJson(hash string) *model.ChainBlockJson
- func (s *Service) GetBlockByNum(num int) *model.ChainBlockJson
- func (s *Service) GetBlocksSampleByNums(page, row int) []model.SampleBlockJson
- func (s *Service) GetCurrentBlockNum(c context.Context) (uint64, error)
- func (s *Service) GetCurrentRuntimeSpecVersion(blockNum int) int
- func (s *Service) GetExtrinsicByHash(hash string) *model.ChainExtrinsic
- func (s *Service) GetExtrinsicByIndex(index string) *model.ExtrinsicDetail
- func (s *Service) GetExtrinsicDetailByHash(hash string) *model.ExtrinsicDetail
- func (s *Service) GetExtrinsicList(page, row int, order string, query ...string) ([]*model.ChainExtrinsicJson, int)
- func (s *Service) Metadata() (map[string]string, error)
- func (s *Service) Ping(ctx context.Context, e *empty.Empty) (*empty.Empty, error)
- func (s *Service) RenderEvents(page, row int, order string, where ...string) ([]model.ChainEventJson, int)
- func (s *Service) SetHeartBeat(action string)
- func (s *Service) Subscribe(conn ws.WsConn, interrupt chan os.Signal)
- func (s *Service) SubstrateRuntimeInfo(spec int) *metadata.Instant
- func (s *Service) SubstrateRuntimeList() []model.RuntimeVersion
- func (s *Service) UpdateBlockData(conn websocket.WsConn, block *model.ChainBlock, finalized bool) (err error)
- func (s *Service) ValidatorsList(conn websocket.WsConn, hash string) (validatorList []string)
- type SubscribeService
Constants ¶
View Source
const ( FinalizedWaitingBlockCount = 3 ChainNewHead = "chain_newHead" ChainFinalizedHead = "chain_finalizedHead" StateStorage = "state_storage" BlockTime = 6 )
FinalizedWaitingBlockCount Because when receive chain_finalizedHead, get block still not finalized so set Waiting block count to try avoid
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service
func (*Service) BlockAsSampleJson ¶
func (s *Service) BlockAsSampleJson(block *model.ChainBlock) *model.SampleBlockJson
func (*Service) CreateChainBlock ¶
func (*Service) EventByIndex ¶
func (s *Service) EventByIndex(index string) *model.ChainEvent
func (*Service) ExtrinsicsAsJson ¶
func (s *Service) ExtrinsicsAsJson(e *model.ChainExtrinsic) *model.ChainExtrinsicJson
func (*Service) FillBlockData ¶
func (*Service) GetBlockByHash ¶
func (s *Service) GetBlockByHash(hash string) *model.ChainBlock
func (*Service) GetBlockByHashJson ¶
func (s *Service) GetBlockByHashJson(hash string) *model.ChainBlockJson
func (*Service) GetBlockByNum ¶
func (s *Service) GetBlockByNum(num int) *model.ChainBlockJson
func (*Service) GetBlocksSampleByNums ¶
func (s *Service) GetBlocksSampleByNums(page, row int) []model.SampleBlockJson
func (*Service) GetCurrentBlockNum ¶
func (*Service) GetCurrentRuntimeSpecVersion ¶
func (*Service) GetExtrinsicByHash ¶
func (s *Service) GetExtrinsicByHash(hash string) *model.ChainExtrinsic
func (*Service) GetExtrinsicByIndex ¶
func (s *Service) GetExtrinsicByIndex(index string) *model.ExtrinsicDetail
func (*Service) GetExtrinsicDetailByHash ¶
func (s *Service) GetExtrinsicDetailByHash(hash string) *model.ExtrinsicDetail
func (*Service) GetExtrinsicList ¶
func (*Service) RenderEvents ¶
func (*Service) SetHeartBeat ¶
func (*Service) SubstrateRuntimeInfo ¶
func (*Service) SubstrateRuntimeList ¶
func (s *Service) SubstrateRuntimeList() []model.RuntimeVersion
func (*Service) UpdateBlockData ¶
type SubscribeService ¶
type SubscribeService struct { *Service // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.