Documentation ¶
Index ¶
- Constants
- Variables
- func GetName() string
- func Init(name string, cfg *types.TuringchainConfig, sub []byte)
- func InitExecType()
- func NewAccountTable(kvdb db.KV) *table.Table
- type AccountRow
- type Accountmanager
- func (a *Accountmanager) CheckAccountIDIsExist(accountID string) bool
- func (a *Accountmanager) CheckTx(tx *types.Transaction, index int) error
- func (a *Accountmanager) ExecDelLocal(tx *types.Transaction, receipt *types.ReceiptData, index int) (*types.LocalDBSet, error)
- func (a *Accountmanager) ExecLocal_Apply(payload *et.Apply, tx *types.Transaction, receiptData *types.ReceiptData, ...) (*types.LocalDBSet, error)
- func (a *Accountmanager) ExecLocal_Register(payload *et.Register, tx *types.Transaction, receiptData *types.ReceiptData, ...) (*types.LocalDBSet, error)
- func (a *Accountmanager) ExecLocal_ResetKey(payload *et.ResetKey, tx *types.Transaction, receiptData *types.ReceiptData, ...) (*types.LocalDBSet, error)
- func (a *Accountmanager) ExecLocal_Supervise(payload *et.Supervise, tx *types.Transaction, receiptData *types.ReceiptData, ...) (*types.LocalDBSet, error)
- func (a *Accountmanager) ExecLocal_Transfer(payload *et.Transfer, tx *types.Transaction, receiptData *types.ReceiptData, ...) (*types.LocalDBSet, error)
- func (a *Accountmanager) Exec_Apply(payload *aty.Apply, tx *types.Transaction, index int) (*types.Receipt, error)
- func (a *Accountmanager) Exec_Register(payload *aty.Register, tx *types.Transaction, index int) (*types.Receipt, error)
- func (a *Accountmanager) Exec_ResetKey(payload *aty.ResetKey, tx *types.Transaction, index int) (*types.Receipt, error)
- func (a *Accountmanager) Exec_Supervise(payload *aty.Supervise, tx *types.Transaction, index int) (*types.Receipt, error)
- func (a *Accountmanager) Exec_Transfer(payload *aty.Transfer, tx *types.Transaction, index int) (*types.Receipt, error)
- func (a *Accountmanager) ExecutorOrder() int64
- func (a *Accountmanager) GetDriverName() string
- func (a *Accountmanager) Query_QueryAccountByAddr(in *et.QueryAccountByAddr) (types.Message, error)
- func (a *Accountmanager) Query_QueryAccountByID(in *et.QueryAccountByID) (types.Message, error)
- func (a *Accountmanager) Query_QueryAccountsByStatus(in *et.QueryAccountsByStatus) (types.Message, error)
- func (a *Accountmanager) Query_QueryBalanceByID(in *et.QueryBalanceByID) (types.Message, error)
- func (a *Accountmanager) Query_QueryExpiredAccounts(in *et.QueryExpiredAccounts) (types.Message, error)
- type Action
- func (a *Action) Apply(payload *et.Apply) (*types.Receipt, error)
- func (a *Action) GetIndex() int64
- func (a *Action) GetKVSet(account *et.Account) (kvset []*types.KeyValue)
- func (a *Action) Register(payload *et.Register) (*types.Receipt, error)
- func (a *Action) Reset(payload *et.ResetKey) (*types.Receipt, error)
- func (a *Action) Supervise(payload *et.Supervise) (*types.Receipt, error)
- func (a *Action) Transfer(payload *et.Transfer) (*types.Receipt, error)
Constants ¶
const ( //KeyPrefixStateDB state db key必须前缀 KeyPrefixStateDB = "mavl-accountmanager-" //KeyPrefixLocalDB local db的key必须前缀 KeyPrefixLocalDB = "LODB-accountmanager" )
Variables ¶
var ( // ConfNameActiveTime 有效期 ConfNameActiveTime = et.AccountmanagerX + "-" + "activeTime" // ConfNameLockTime 密钥重置锁定期 ConfNameLockTime = et.AccountmanagerX + "-" + "lockTime" // ConfNameManagerAddr 管理员地址 ConfNameManagerAddr = et.AccountmanagerX + "-" + "managerAddr" // DefaultActiveTime 默认有效期 DefaultActiveTime = int64(5 * 360 * 24 * 3600) // DefaultLockTime 默认密钥重置锁定期 DefaultLockTime = int64(15 * 24 * 3600) // DefaultManagerAddr 默认管理员地址 DefaultManagerAddr = "12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv" )
Functions ¶
Types ¶
type AccountRow ¶
AccountRow account table meta 结构
func (*AccountRow) CreateRow ¶
func (m *AccountRow) CreateRow() *table.Row
CreateRow 新建数据行(注意index 数据一定也要保存到数据中,不能就保存eventid)
func (*AccountRow) Get ¶
func (m *AccountRow) Get(key string) ([]byte, error)
Get 按照indexName 查询 indexValue
func (*AccountRow) SetPayload ¶
func (m *AccountRow) SetPayload(data types.Message) error
SetPayload 设置数据
type Accountmanager ¶
type Accountmanager struct {
drivers.DriverBase
}
Accountmanager ...
func (*Accountmanager) CheckAccountIDIsExist ¶
func (a *Accountmanager) CheckAccountIDIsExist(accountID string) bool
CheckAccountIDIsExist ...
func (*Accountmanager) CheckTx ¶
func (a *Accountmanager) CheckTx(tx *types.Transaction, index int) error
CheckTx 实现自定义检验交易接口,供框架调用
func (*Accountmanager) ExecDelLocal ¶
func (a *Accountmanager) ExecDelLocal(tx *types.Transaction, receipt *types.ReceiptData, index int) (*types.LocalDBSet, error)
ExecDelLocal 回退自动删除,重写基类
func (*Accountmanager) ExecLocal_Apply ¶
func (a *Accountmanager) ExecLocal_Apply(payload *et.Apply, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)
ExecLocal_Apply ...
func (*Accountmanager) ExecLocal_Register ¶
func (a *Accountmanager) ExecLocal_Register(payload *et.Register, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)
ExecLocal_Register ...
func (*Accountmanager) ExecLocal_ResetKey ¶
func (a *Accountmanager) ExecLocal_ResetKey(payload *et.ResetKey, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)
ExecLocal_ResetKey ...
func (*Accountmanager) ExecLocal_Supervise ¶
func (a *Accountmanager) ExecLocal_Supervise(payload *et.Supervise, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)
ExecLocal_Supervise ...
func (*Accountmanager) ExecLocal_Transfer ¶
func (a *Accountmanager) ExecLocal_Transfer(payload *et.Transfer, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)
ExecLocal_Transfer ...
func (*Accountmanager) Exec_Apply ¶
func (a *Accountmanager) Exec_Apply(payload *aty.Apply, tx *types.Transaction, index int) (*types.Receipt, error)
Exec_Apply ...
func (*Accountmanager) Exec_Register ¶
func (a *Accountmanager) Exec_Register(payload *aty.Register, tx *types.Transaction, index int) (*types.Receipt, error)
Exec_Register ...
func (*Accountmanager) Exec_ResetKey ¶
func (a *Accountmanager) Exec_ResetKey(payload *aty.ResetKey, tx *types.Transaction, index int) (*types.Receipt, error)
Exec_ResetKey ...
func (*Accountmanager) Exec_Supervise ¶
func (a *Accountmanager) Exec_Supervise(payload *aty.Supervise, tx *types.Transaction, index int) (*types.Receipt, error)
Exec_Supervise ...
func (*Accountmanager) Exec_Transfer ¶
func (a *Accountmanager) Exec_Transfer(payload *aty.Transfer, tx *types.Transaction, index int) (*types.Receipt, error)
Exec_Transfer ...
func (*Accountmanager) ExecutorOrder ¶
func (a *Accountmanager) ExecutorOrder() int64
ExecutorOrder Exec 的时候 同时执行 ExecLocal
func (*Accountmanager) GetDriverName ¶
func (a *Accountmanager) GetDriverName() string
GetDriverName ...
func (*Accountmanager) Query_QueryAccountByAddr ¶
func (a *Accountmanager) Query_QueryAccountByAddr(in *et.QueryAccountByAddr) (types.Message, error)
Query_QueryAccountByAddr 根据ID查询账户信息
func (*Accountmanager) Query_QueryAccountByID ¶
func (a *Accountmanager) Query_QueryAccountByID(in *et.QueryAccountByID) (types.Message, error)
Query_QueryAccountByID 根据ID查询账户信息
func (*Accountmanager) Query_QueryAccountsByStatus ¶
func (a *Accountmanager) Query_QueryAccountsByStatus(in *et.QueryAccountsByStatus) (types.Message, error)
Query_QueryAccountsByStatus 根据状态查询账户列表|| 账户状态 1 正常, 2表示冻结, 3表示锁定 4,过期注销
func (*Accountmanager) Query_QueryBalanceByID ¶
func (a *Accountmanager) Query_QueryBalanceByID(in *et.QueryBalanceByID) (types.Message, error)
Query_QueryBalanceByID 根据ID查询账户余额
func (*Accountmanager) Query_QueryExpiredAccounts ¶
func (a *Accountmanager) Query_QueryExpiredAccounts(in *et.QueryExpiredAccounts) (types.Message, error)
Query_QueryExpiredAccounts 查询逾期注销的账户列表
type Action ¶
type Action struct {
// contains filtered or unexported fields
}
Action action struct
func NewAction ¶
func NewAction(e *Accountmanager, tx *types.Transaction, index int) *Action
NewAction ...