Documentation ¶
Index ¶
- Variables
- func NewMdbActor(roleIntf role.RoleInterface, db *db.OptionDBService) *actor.PID
- type AccountInfo
- type BlockInfo
- type MdbActor
- type MongoDBPlugin
- func (mdb *MongoDBPlugin) ApplyBlock(block *types.Block) error
- func (mdb *MongoDBPlugin) GetBalanceOp(accountName string) (*role.Balance, error)
- func (mdb *MongoDBPlugin) ParseParam(Contract string, Method string, Param []byte) (map[string]interface{}, error)
- func (mdb *MongoDBPlugin) SetBalanceOp(accountName string, balance *big.Int) error
- type TxInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var ExternalAbiMap map[string]interface{}
GetAbi function
Functions ¶
func NewMdbActor ¶
func NewMdbActor(roleIntf role.RoleInterface, db *db.OptionDBService) *actor.PID
NewMdbActor spawn a named actor
Types ¶
type AccountInfo ¶
type AccountInfo struct { ID bson.ObjectId `bson:"_id"` AccountName string `bson:"account_name"` Balance string `bson:"bto_balance"` StakedBalance string `bson:"staked_balance"` UnstakingBalance string `bson:"unstaking_balance"` PublicKey string `bson:"public_key"` CreateTime time.Time `bson:"create_time"` UpdatedTime time.Time `bson:"updated_time"` }
AccountInfo is definition of account
type BlockInfo ¶
type BlockInfo struct { ID bson.ObjectId `bson:"_id"` BlockHash string `bson:"block_hash"` PrevBlockHash string `bson:"prev_block_hash"` BlockNumber uint64 `bson:"block_number"` Timestamp uint64 `bson:"timestamp"` MerkleRoot string `bson:"merkle_root"` DelegateAccount string `bson:"delegate"` DelegateSign string `bson:"delegate_sign"` Transactions []bson.ObjectId `bson:"transactions"` CreateTime time.Time `bson:"create_time"` }
BlockInfo is definition of block
type MdbActor ¶
type MdbActor struct {
Mdb *MongoDBPlugin
}
func (*MdbActor) HandleReceiveBlock ¶
HandleNewProducedBlock new block msg
type MongoDBPlugin ¶
type MongoDBPlugin struct { Role role.RoleInterface Db *db.OptionDBService }
func NewMongoDBPlugin ¶
func NewMongoDBPlugin(role role.RoleInterface, db *db.OptionDBService) *MongoDBPlugin
func (*MongoDBPlugin) ApplyBlock ¶
func (mdb *MongoDBPlugin) ApplyBlock(block *types.Block) error
func (*MongoDBPlugin) GetBalanceOp ¶
func (mdb *MongoDBPlugin) GetBalanceOp(accountName string) (*role.Balance, error)
GetBalanceOp is to get account balance
func (*MongoDBPlugin) ParseParam ¶
func (mdb *MongoDBPlugin) ParseParam(Contract string, Method string, Param []byte) (map[string]interface{}, error)
ParseParam is to parase param by method
func (*MongoDBPlugin) SetBalanceOp ¶
func (mdb *MongoDBPlugin) SetBalanceOp(accountName string, balance *big.Int) error
SetBalanceOp is to save account balance
type TxInfo ¶
type TxInfo struct { ID bson.ObjectId `bson:"_id"` BlockNum uint64 `bson:"block_number"` TransactionID string `bson:"transaction_id"` SequenceNum uint32 `bson:"sequence_num"` BlockHash string `bson:"block_hash"` CursorNum uint64 `bson:"cursor_num"` CursorLabel uint32 `bson:"cursor_label"` Lifetime uint64 `bson:"lifetime"` Sender string `bson:"sender"` Contract string `bson:"contract"` Method string `bson:"method"` Param interface{} `bson:"param"` SigAlg uint32 `bson:"sig_alg"` Signature string `bson:"signature"` CreateTime time.Time `bson:"create_time"` }
TxInfo is definition of tx
Click to show internal directories.
Click to hide internal directories.