Versions in this module Expand all Collapse all v0 v0.0.6 Sep 25, 2019 Changes in this version + type Proposal struct + ChainID string + CreatedAt time.Time + CreatedAtUnix int64 + Description string + Id int64 + ProposalID int64 + Status string + SubmitTime time.Time + Title string + TotalDeposit int64 + Type string + UpdatedAt time.Time + UpdatedAtUnix int64 + VotingStartTime time.Time + func Proposals(chainID string) ([]*Proposal, error) + func (n *Proposal) AfterSet(colName string, _ xorm.Cell) + func (n *Proposal) BeforeInsert() + func (n *Proposal) BeforeUpdate() + func (n *Proposal) Insert(chainID string) error + func (pro *Proposal) Update(chainID string) error + func (pro *Proposal) UpdateStatus(chainID string) error type Validator + Commission string v0.0.5 Aug 23, 2019 v0.0.4 Jul 11, 2019 Changes in this version + const DefaultFeeTx + const NetworkStatusInvalid + const NetworkStatusValid + const VerifyCodeDuration + const VerifyCodeExpired + func AccountIsExist(mail string) (bool, error) + func CreateEvidences(chainID string, es types.EvidenceList) (err error) + func CreateGenesis(chainId string, genesisTime time.Time, data string) error + func CreateNetworkOrUpdate(chainID string, n *Network) error + func DeleteNodeByName(name string) error + func DropDatabase(name string) error + func GetNodeEngine(name string) (*xorm.Engine, error) + func InitDb(cfg *config.DBConfig) (err error) + func NewTestEngine(cfg *config.DBConfig) (*testEngine, error) + func UpdateFee(chainID, tx, fee string, gasWanted, gasUsed int64) error + type Account struct + Avatar string + CreatedAt time.Time + CreatedAtUnix int64 + Description string + Id int64 + Mail string + Name string + Password string + Status int + UpdatedAt time.Time + UpdatedAtUnix int64 + Version int + func Accounts(opt *AccountOption) ([]*Account, error) + func CreateAccount(mail, password string) (*Account, error) + func RetrieveAccountByID(id int64) (*Account, error) + func RetrieveAccountByMail(mail string) (*Account, error) + func (a *Account) AfterSet(colName string, _ xorm.Cell) + func (a *Account) Apps() ([]*App, error) + func (a *Account) BeforeInsert() + func (a *Account) BeforeUpdate() + func (a *Account) CheckPassword(pwd string) bool + func (a *Account) CreateApp(name string) (*App, error) + func (a *Account) CreateSession(loginType int, expire time.Duration) (string, error) + func (a *Account) DeleteAppByID(id int64) error + func (a *Account) DeleteSession() error + func (a *Account) Insert() error + func (a *Account) UpdatePassword(pwd string) error + func (a *Account) UpdateProfile(opt *AccountOption) error + type AccountOption struct + Avatar string + Description string + Limit int + Name string + Offset int + type Agent struct + BaseUrl string + CreatedAt time.Time + CreatedAtUnix int64 + Id int64 + NodeType string + UpdatedAt time.Time + UpdatedAtUnix int64 + Version int + func Agents() ([]*Agent, error) + func AgentsByNodeType(nodeType string) ([]*Agent, error) + func CreateAgent(agentType, baseURL string) (*Agent, error) + func (n *Agent) AfterSet(colName string, _ xorm.Cell) + func (n *Agent) BeforeInsert() + func (n *Agent) BeforeUpdate() + func (n *Agent) Insert() error + type App struct + AccountId int64 + CreatedAt time.Time + CreatedAtUnix int64 + DeletedAt time.Time + Id int64 + Name string + SecretKey string + Status int + UpdatedAt time.Time + UpdatedAtUnix int64 + Version int + func AppById(id int64) (*App, error) + func AppBySecretKey(secretKey string) (*App, error) + func AppsByAccount(id int64) ([]*App, error) + func (a *App) Account() (*Account, error) + func (a *App) AfterSet(colName string, _ xorm.Cell) + func (a *App) BeforeInsert() + func (a *App) BeforeUpdate() + func (a *App) Insert() error + type AtmIpRecord struct + Amount int + Chainid string + CreatedAt time.Time + CreatedAtUnix int64 + Id int64 + Ip string + UpdatedAt time.Time + UpdatedAtUnix int64 + Version int + func RetrieveAtmIpRecordByIpCreateat(chainID string, ip string, t time.Time) (*AtmIpRecord, error) + func (air *AtmIpRecord) AfterSet(colName string, _ xorm.Cell) + func (air *AtmIpRecord) BeforeInsert() + func (air *AtmIpRecord) BeforeUpdate() + func (air *AtmIpRecord) Insert(chainID string) error + func (air *AtmIpRecord) Update(chainID string) error + type AtmRecord struct + Address string + Amount string + Coin string + Createat time.Time + CreatedAt time.Time + CreatedAtUnix int64 + Hash string + Height int64 + Id int64 + UpdatedAt time.Time + UpdatedAtUnix int64 + Version int + func RetrieveAtmRecordByAddressCreateat(chainID string, address string, t time.Time) (*AtmRecord, error) + func (ar *AtmRecord) AfterSet(colName string, _ xorm.Cell) + func (ar *AtmRecord) BeforeInsert() + func (ar *AtmRecord) BeforeUpdate() + func (ar *AtmRecord) Insert(chainID string) error + func (ar *AtmRecord) Update(chainID string) error + type Block struct + ChainId string + DataHash string + Height int64 + Id int64 + NumTxs int64 + ProposerAddress string + Time time.Time + TimeUnix int64 + TotalTxs int64 + ValidatorsHash string + ValidatorsNum int64 + ValidatorsTotal int64 + func Blocks(chainID string, opt *BlockOption) ([]*Block, error) + func (b *Block) AfterSet(colName string, _ xorm.Cell) + func (b *Block) BeforeInsert() + func (b *Block) BeforeUpdate() + func (b *Block) Insert(chainID string) error + type BlockOption struct + Height int64 + Limit int + MaxHeight int64 + MinHeight int64 + NumTxs int64 + Offset int + type BlockValidator struct + Accum int64 + ChainId string + Height int64 + Id int64 + Round int64 + Signature string + Time time.Time + TimeUnix int64 + Type int64 + ValidatorAddress string + ValidatorIndex int64 + VotingPower int64 + func BlockValidators(chainID string, opt *BlockValidatorOption) ([]*BlockValidator, error) + func (bv *BlockValidator) AfterSet(colName string, _ xorm.Cell) + func (bv *BlockValidator) BeforeInsert() + func (bv *BlockValidator) BeforeUpdate() + func (bv *BlockValidator) Insert(chainID string) error + type BlockValidatorOption struct + Height int64 + Limit int + MaxHeight int64 + MinHeight int64 + Offset int + ValidatorAddress string + type ConsensusState struct + ChainId string + Height string + Id int64 + PrecommitsNum int64 + PrecommitsValue string + PrevotesNum int64 + PrevotesValue string + Round string + StartTime string + Step string + func RetrieveConsensusState(chainID string) (*ConsensusState, error) + func (cs *ConsensusState) Insert(chainID string) error + func (cs *ConsensusState) Update(chainID string) error + type Engine interface + Delete func(interface{}) (int64, error) + Exec func(string, ...interface{}) (sql.Result, error) + Find func(interface{}, ...interface{}) error + Get func(interface{}) (bool, error) + ID func(interface{}) *xorm.Session + In func(string, ...interface{}) *xorm.Session + Insert func(...interface{}) (int64, error) + InsertOne func(interface{}) (int64, error) + Iterate func(interface{}, xorm.IterFunc) error + Sql func(string, ...interface{}) *xorm.Session + Table func(interface{}) *xorm.Session + Where func(interface{}, ...interface{}) *xorm.Session + type Evidence struct + CreatedAt time.Time + CreatedAtUnix int64 + Data string + Hash string + Height int64 + Id int64 + ValidatorAddress string + func RetrieveEvidenceByHeight(chainID, validator string, height int64) (*Evidence, error) + func RetrieveEvidences(chainID, validator string) ([]*Evidence, error) + func (n *Evidence) AfterSet(colName string, _ xorm.Cell) + func (n *Evidence) BeforeInsert() + func (n *Evidence) BeforeUpdate() + func (n *Evidence) Insert(chainID string) error + type Fee struct + ChainID string + CreatedAt time.Time + CreatedAtUnix int64 + Fee string + GasUsed int64 + GasWanted int64 + Id int64 + Tx string + UpdatedAt time.Time + UpdatedAtUnix int64 + Version int + func RetrieveFeeByTx(chainID, tx string) (*Fee, error) + func (n *Fee) AfterSet(colName string, _ xorm.Cell) + func (n *Fee) BeforeInsert() + func (n *Fee) BeforeUpdate() + func (n *Fee) Insert(chainID string) error + type Genesis struct + ChainId string + Data string + GenesisTime time.Time + GenesisTimeUnix int64 + Id int64 + func RetrieveGenesis(chainId string) (*Genesis, error) + func (g *Genesis) AfterSet(colName string, _ xorm.Cell) + func (g *Genesis) BeforeInsert() + func (g *Genesis) BeforeUpdate() + func (g *Genesis) Insert(chainID string) error + type LoginStatus struct + AccountId int64 + CreatedAt time.Time + CreatedAtUnix int64 + ExpiredAtUnix int64 + Id int64 + LoginType int + Token string + UpdatedAt time.Time + UpdatedAtUnix int64 + Version int + func LoginStatusByAccountID(id int64) (*LoginStatus, error) + func LoginStatusByLoginStatusByToken(token string) (*LoginStatus, error) + func (ls *LoginStatus) Account() (*Account, error) + func (ls *LoginStatus) AfterSet(colName string, _ xorm.Cell) + func (ls *LoginStatus) BeforeInsert() + func (ls *LoginStatus) BeforeUpdate() + func (ls *LoginStatus) Insert(chainID string) error + type Missing struct + CreatedAt time.Time + CreatedAtUnix int64 + Height int64 + Id int64 + ValidatorAddress string + func RetrieveMissings(chainID, validator string) ([]*Missing, error) + func (n *Missing) AfterSet(colName string, _ xorm.Cell) + func (n *Missing) BeforeInsert() + func (n *Missing) BeforeUpdate() + func (n *Missing) Insert(chainID string) error + type Network struct + CreatedAt time.Time + CreatedAtUnix int64 + Delay int64 + ID int64 + LastTestAt time.Time + LastTestAtUnix int64 + Remote string + Status int + func Networks(chainID string, opt *NetworkOption) ([]*Network, error) + func (n *Network) AfterSet(colName string, _ xorm.Cell) + func (n *Network) BeforeInsert() + func (n *Network) BeforeUpdate() + func (n *Network) Check() + func (n *Network) InsertOrUpdate(chainID string) error + type NetworkOption struct + Limit int + Offset int + Status int + type Node struct + BaseUrl string + ChainId string + CreatedAt time.Time + CreatedAtUnix int64 + Id int64 + Name string + NodeType string + NodeVersion string + SecretKey string + Sort int + UpdatedAt time.Time + UpdatedAtUnix int64 + Version int + func CreateNode(name, baseURL, nodeType, nodeVersion, secretKey, chainID string) (*Node, error) + func Nodes() ([]*Node, error) + func RetrieveNodeByName(name string) (*Node, error) + func (n *Node) AfterSet(colName string, _ xorm.Cell) + func (n *Node) BeforeInsert() + func (n *Node) BeforeUpdate() + func (n *Node) Insert() error + type NodeRoute struct + Hidden bool + Id int64 + NodeId int64 + Route string + type Peer struct + ChainID string + Channels string + ID int64 + ListenAddr string + Moniker string + Network string + PeerID string + RecvStart time.Time + RecvStartUnix int64 + SendStart time.Time + SendStartUnix int64 + Version string + func Peers(chainID string, opt *PeerOption) ([]*Peer, error) + func (p *Peer) AfterSet(colName string, _ xorm.Cell) + func (p *Peer) BeforeInsert() + func (p *Peer) BeforeUpdate() + func (p *Peer) Insert(chainID string) error + type PeerOption struct + Limit int + Offset int + type QmoonStatus struct + CreatedAt time.Time + CreatedAtUnix int64 + Id int64 + Key string + UpdatedAt time.Time + UpdatedAtUnix int64 + Value string + Version int + func RetrieveQmoonStatusByKey(key string) (*QmoonStatus, error) + func (qs *QmoonStatus) AfterSet(colName string, _ xorm.Cell) + func (qs *QmoonStatus) BeforeInsert() + func (qs *QmoonStatus) BeforeUpdate() + func (qs *QmoonStatus) Insert() error + func (qs *QmoonStatus) Update() error + type TmBlock struct + Data string + Height int64 + Id int64 + func (tb *TmBlock) Insert(chainID string) error + type Tx struct + ChainId string + Fee string + GasUsed int64 + GasWanted int64 + Hash string + Height int64 + Id int64 + Index int64 + JsonTx string + Log string + Maxgas int64 + OriginTx string + QcpFrom string + QcpIsresult bool + QcpSequence int64 + QcpTo string + QcpTxindex int64 + Time time.Time + TimeUnix int64 + TxStatus int + TxType string + func TxByHash(chainID string, hash string) (*Tx, error) + func TxByHeightIndex(chainID string, height, index int64) (*Tx, error) + func Txs(chainID string, opt *TxOption) ([]*Tx, error) + func (t *Tx) AfterSet(colName string, _ xorm.Cell) + func (t *Tx) BeforeInsert() + func (t *Tx) BeforeUpdate() + func (t *Tx) Insert(chainID string) error + type TxOption struct + Address string + Limit int + MaxHeight int64 + MinHeight int64 + Offset int + TxType string + type TxTransfer struct + Address string + Amount string + ChainId string + Coin string + Hash string + Height int64 + Id int64 + IsMulti bool + MultiData string + Time time.Time + TimeUnix int64 + TxStatus int + Type int + func TxTransfers(chainID string, opt *TxTransferOption) ([]*TxTransfer, error) + func (tt *TxTransfer) AfterSet(colName string, _ xorm.Cell) + func (tt *TxTransfer) BeforeInsert() + func (tt *TxTransfer) BeforeUpdate() + func (tt *TxTransfer) Insert(chainID string) error + type TxTransferOption struct + Address string + Coin string + Limit int + Offset int + type Validator struct + Accum int64 + Address string + BondHeight int64 + ChainId string + Details string + FirstBlockHeight int64 + FirstBlockTime time.Time + FirstBlockTimeUnix int64 + Id int64 + Identity string + InactiveCode int + InactiveHeight int64 + InactiveTime time.Time + InactiveTimeUnix int64 + Logo string + Name string + Owner string + PrecommitNum int64 + PubKeyType string + PubKeyValue string + Status int + VotingPower int64 + Website string + func ValidatorByAddress(chainID, address string) (*Validator, error) + func Validators(chainID string) ([]*Validator, error) + func (val *Validator) AfterSet(colName string, _ xorm.Cell) + func (val *Validator) BeforeInsert() + func (val *Validator) BeforeUpdate() + func (val *Validator) Insert(chainID string) error + func (val *Validator) Update(chainID string) error + func (val *Validator) UpdateStatus(chainID string) error + type VerifyCode struct + Code string + CreatedAt time.Time + CreatedAtUnix int64 + Email string + Id int64 + Version int + func CreateVerifyCode(email, code string) (*VerifyCode, error) + func VerifyCodeByEmail(email string) (*VerifyCode, error) + func (vc *VerifyCode) AfterSet(colName string, _ xorm.Cell) + func (vc *VerifyCode) BeforeInsert() + func (vc *VerifyCode) BeforeUpdate() + func (vc *VerifyCode) Delete() error + func (vc *VerifyCode) Insert() error