Documentation
¶
Index ¶
- Constants
- Variables
- func GetExtrinsicFee(p websocket.WsConn, encodeExtrinsic string) (fee decimal.Decimal, err error)
- type EventJSONData
- type JSONData
- 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) CreateChainBlock(conn websocket.WsConn, hash string, block *rpcModel.Block, event string, ...) (err error)
- 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) RenderEvents(page, row int, order string, where ...string) ([]model.ChainEventJson, int)
- func (s *Service) Subscribe(ctx context.Context, conn ws.WsConn)
- 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 Solution
- type SubscribeService
- type V0
- type Value
- type Vote
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 ¶
View Source
var GlobalEventDetail *eventDetailWatcher
Functions ¶
Types ¶
type EventJSONData ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
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) SubstrateRuntimeInfo ¶
func (*Service) SubstrateRuntimeList ¶
func (s *Service) SubstrateRuntimeList() []model.RuntimeVersion
func (*Service) UpdateBlockData ¶
type Solution ¶
type Solution struct { Chunk string `json:"chunk"` ChunkWitness string `json:"chunk_witness"` HistorySize int `json:"history_size"` PieceOffset int `json:"piece_offset"` ProofOfSpace string `json:"proof_of_space"` PublicKey string `json:"public_key"` RecordCommitment string `json:"record_commitment"` RecordWitness string `json:"record_witness"` RewardAddress string `json:"reward_address"` SectorIndex int `json:"sector_index"` }
type SubscribeService ¶
type SubscribeService struct { *Service // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.