model

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 24, 2021 License: GPL-3.0 Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SplitTableBlockNum = 1000000

SplitTableBlockNum

Functions

This section is empty.

Types

type ChainBlock

type ChainBlock struct {
	ID              uint   `gorm:"primary_key" json:"id"`
	BlockNum        int    `json:"block_num"`
	BlockTimestamp  int    `json:"block_timestamp"`
	Hash            string `sql:"default: null;size:100" json:"hash"`
	ParentHash      string `sql:"default: null;size:100" json:"parent_hash"`
	StateRoot       string `sql:"default: null;size:100" json:"state_root"`
	ExtrinsicsRoot  string `sql:"default: null;size:100" json:"extrinsics_root"`
	Logs            string `json:"logs" sql:"type:text;"`
	Extrinsics      string `json:"extrinsics" sql:"type:MEDIUMTEXT;"`
	EventCount      int    `json:"event_count"`
	ExtrinsicsCount int    `json:"extrinsics_count"`
	Event           string `json:"event" sql:"type:MEDIUMTEXT;"`
	SpecVersion     int    `json:"spec_version"`
	Validator       string `json:"validator"`
	CodecError      bool   `json:"codec_error"`
	Finalized       bool   `json:"finalized"`
}

func (*ChainBlock) AsPlugin

func (c *ChainBlock) AsPlugin() *storage.Block

func (ChainBlock) TableName

func (c ChainBlock) TableName() string

type ChainBlockJson

type ChainBlockJson struct {
	BlockNum          int                  `json:"block_num"`
	BlockTimestamp    int                  `json:"block_timestamp"`
	Hash              string               `json:"hash"`
	ParentHash        string               `json:"parent_hash"`
	StateRoot         string               `json:"state_root"`
	ExtrinsicsRoot    string               `json:"extrinsics_root"`
	Extrinsics        []ChainExtrinsicJson `json:"extrinsics"`
	Events            []ChainEventJson     `json:"events"`
	Logs              []ChainLogJson       `json:"logs"`
	EventCount        int                  `json:"event_count"`
	ExtrinsicsCount   int                  `json:"extrinsics_count"`
	SpecVersion       int                  `json:"spec_version"`
	Validator         string               `json:"validator"`
	ValidatorName     string               `json:"validator_name"`
	ValidatorIndexIds string               `json:"validator_index_ids"`
	Finalized         bool                 `json:"finalized"`
}

type ChainEvent

type ChainEvent struct {
	ID            uint        `gorm:"primary_key" json:"-"`
	EventIndex    string      `sql:"default: null;size:100;" json:"event_index"`
	BlockNum      int         `json:"block_num" `
	ExtrinsicIdx  int         `json:"extrinsic_idx"`
	Type          string      `json:"-"`
	ModuleId      string      `json:"module_id" `
	EventId       string      `json:"event_id" `
	Params        interface{} `json:"params" sql:"type:text;" `
	ExtrinsicHash string      `json:"extrinsic_hash" sql:"default: null" `
	EventIdx      int         `json:"event_idx"`
}

func (*ChainEvent) AsPlugin

func (c *ChainEvent) AsPlugin() *storage.Event

func (ChainEvent) TableName

func (c ChainEvent) TableName() string

type ChainEventJson

type ChainEventJson struct {
	EventIndex     string `json:"event_index"`
	BlockNum       int    `json:"block_num"`
	ExtrinsicIdx   int    `json:"extrinsic_idx"`
	ModuleId       string `json:"module_id"`
	EventId        string `json:"event_id"`
	Params         string `json:"params"`
	EventIdx       int    `json:"event_idx"`
	ExtrinsicHash  string `json:"extrinsic_hash"`
	BlockTimestamp int    `json:"block_timestamp"`
}

type ChainExtrinsic

type ChainExtrinsic struct {
	ID                 uint            `gorm:"primary_key"`
	ExtrinsicIndex     string          `json:"extrinsic_index" sql:"default: null;size:100"`
	BlockNum           int             `json:"block_num" `
	BlockTimestamp     int             `json:"block_timestamp"`
	ExtrinsicLength    string          `json:"extrinsic_length"`
	VersionInfo        string          `json:"version_info"`
	CallCode           string          `json:"call_code"`
	CallModuleFunction string          `json:"call_module_function"  sql:"size:100"`
	CallModule         string          `json:"call_module"  sql:"size:100"`
	Params             interface{}     `json:"params" sql:"type:MEDIUMTEXT;" `
	AccountId          string          `json:"account_id"`
	Signature          string          `json:"signature"`
	Nonce              int             `json:"nonce"`
	Era                string          `json:"era"`
	ExtrinsicHash      string          `json:"extrinsic_hash" sql:"default: null" `
	IsSigned           bool            `json:"is_signed"`
	Success            bool            `json:"success"`
	Fee                decimal.Decimal `json:"fee" sql:"type:decimal(30,0);"`
	BatchIndex         int             `json:"-" gorm:"-"`
}

func (*ChainExtrinsic) AsPlugin

func (c *ChainExtrinsic) AsPlugin() *storage.Extrinsic

func (ChainExtrinsic) TableName

func (c ChainExtrinsic) TableName() string

type ChainExtrinsicJson

type ChainExtrinsicJson struct {
	BlockTimestamp     int             `json:"block_timestamp"`
	BlockNum           int             `json:"block_num"`
	ExtrinsicIndex     string          `json:"extrinsic_index"`
	CallModuleFunction string          `json:"call_module_function"`
	CallModule         string          `json:"call_module"`
	Params             string          `json:"params"`
	AccountId          string          `json:"account_id"`
	AccountIndex       string          `json:"account_index"`
	Signature          string          `json:"signature"`
	Nonce              int             `json:"nonce"`
	ExtrinsicHash      string          `json:"extrinsic_hash"`
	Success            bool            `json:"success"`
	Fee                decimal.Decimal `json:"fee"`
}

type ChainLog

type ChainLog struct {
	ID        uint   `gorm:"primary_key"`
	BlockNum  int    `json:"block_num" `
	LogIndex  string `json:"log_index" sql:"default: null;size:100"`
	LogType   string `json:"log_type" `
	Data      string `json:"data" sql:"type:text;"`
	Finalized bool   `json:"finalized"`
}

func (ChainLog) TableName

func (c ChainLog) TableName() string

type ChainLogJson

type ChainLogJson struct {
	BlockNum   int    `json:"block_num" es:"type:keyword"`
	LogIndex   string `json:"log_index" sql:"default: null;size:100" es:"type:keyword"`
	LogType    string `json:"log_type" es:"type:keyword"`
	OriginType string `json:"origin_type"`
	Data       string `json:"data"`
}

type EventParam

type EventParam struct {
	Type  string      `json:"type"`
	Value interface{} `json:"value"`
}

type EventRecord

type EventRecord struct {
	Phase        int          `json:"phase"`
	ExtrinsicIdx int          `json:"extrinsic_idx"`
	Type         string       `json:"type"`
	ModuleId     string       `json:"module_id"`
	EventId      string       `json:"event_id"`
	Params       []EventParam `json:"params"`
	Topics       []string     `json:"topics"`
	EventIdx     int          `json:"event_idx"`
}

type ExtrinsicDetail

type ExtrinsicDetail struct {
	BlockTimestamp     int              `json:"block_timestamp"`
	BlockNum           int              `json:"block_num"`
	ExtrinsicIndex     string           `json:"extrinsic_index"`
	CallModuleFunction string           `json:"call_module_function"`
	CallModule         string           `json:"call_module"`
	AccountId          string           `json:"account_id"`
	Signature          string           `json:"signature"`
	Nonce              int              `json:"nonce"`
	ExtrinsicHash      string           `json:"extrinsic_hash"`
	Success            bool             `json:"success"`
	Params             []ExtrinsicParam `json:"params"`
	Event              *[]ChainEvent    `json:"event"`
	Fee                decimal.Decimal  `json:"fee"`
	Finalized          bool             `json:"finalized"`
}

type ExtrinsicParam

type ExtrinsicParam struct {
	Name     string      `json:"name"`
	Type     string      `json:"type"`
	Value    interface{} `json:"value"`
	ValueRaw string      `json:"valueRaw"`
}

type ExtrinsicsJson

type ExtrinsicsJson struct {
	FromHex            string          `json:"from_hex"`
	BlockNum           int             `json:"block_num"`
	BlockTimestamp     int             `json:"block_timestamp"`
	ExtrinsicIndex     string          `json:"extrinsic_index"`
	Hash               string          `json:"extrinsic_hash"`
	Success            bool            `json:"success"`
	CallModule         string          `json:"call_module"`
	CallModuleFunction string          `json:"call_module_function"`
	Params             string          `json:"params"`
	Fee                decimal.Decimal `json:"fee,omitempty"`
	Destination        string          `json:"destination,omitempty"`
	Amount             decimal.Decimal `json:"amount,omitempty"`
	Finalized          bool            `json:"finalized"`
}

type RuntimeVersion

type RuntimeVersion struct {
	Id          int    `json:"-"`
	Name        string `json:"-"`
	SpecVersion int    `json:"spec_version"`
	Modules     string `json:"modules"  sql:"type:TEXT;"`
	RawData     string `json:"-" sql:"type:MEDIUMTEXT;"`
}

type SampleBlockJson

type SampleBlockJson struct {
	BlockNum          int    `json:"block_num"`
	BlockTimestamp    int    `json:"block_timestamp"`
	Hash              string `json:"hash"`
	EventCount        int    `json:"event_count"`
	ExtrinsicsCount   int    `json:"extrinsics_count"`
	Validator         string `json:"validator"`
	ValidatorName     string `json:"validator_name"`
	ValidatorIndexIds string `json:"validator_index_ids"`
	Finalized         bool   `json:"finalized"`
}

type TransferJson

type TransferJson struct {
	From           string          `json:"from"`
	To             string          `json:"to"`
	Module         string          `json:"module"`
	Amount         decimal.Decimal `json:"amount"`
	Hash           string          `json:"hash"`
	BlockTimestamp int             `json:"block_timestamp"`
	BlockNum       int             `json:"block_num"`
	ExtrinsicIndex string          `json:"extrinsic_index"`
	Success        bool            `json:"success"`
	Fee            decimal.Decimal `json:"fee"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL