mongodb

package
v3.8.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2020 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

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

func (actor *MdbActor) HandleReceiveBlock(ctx actor.Context, block *types.Block)

HandleNewProducedBlock new block msg

func (*MdbActor) Receive

func (actor *MdbActor) Receive(context actor.Context)

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

Jump to

Keyboard shortcuts

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