Versions in this module Expand all Collapse all v0 v0.5.11 Sep 22, 2020 Changes in this version + func InitDefaultDbMgr(addrType, address string, number int) + type DBNWProxyMgr struct + func NewDbProxyMgr(addrType, address string, number int) *DBNWProxyMgr v0.5.6 Jun 17, 2020 Changes in this version + const AddressLen + const AdminNum + const AppFlagGzipCompress + const AppFlagImport + const AppFlagPlublc + const AppFlagRun + const EncBinary + const EncGob + const EncJSON + const HashLen + const MaxGuerdon + const OpsConfig + const OpsMove + const OpsNewApp + const OpsNewChain + const OpsRegisterAdmin + const OpsRegisterMiner + const OpsReportError + const OpsRunApp + const OpsTransfer + const OpsUnvote + const OpsUpdateAppLife + const OpsVote + const StatAdmin + const StatAvgBlockSize + const StatBaseInfo + const StatBlockInterval + const StatBlockSizeLimit + const StatBroadcast + const StatChangingConfig + const StatFirstBlockKey + const StatGuerdon + const StatHashPower + const StatLastRewarID + const StatParentKey + const StatSyncInfo + const StatTotalCoins + const StatTotalVotes + const StatTransKey + const StatUser + const SyncOpsBroadcast + const SyncOpsBroadcastAck + const SyncOpsMiner + const SyncOpsMoveCoin + const SyncOpsNewChain + const TimeDay + const TimeHour + const TimeMillisecond + const TimeMinute + const TimeMonth + const TimeSecond + const TimeYear + func BlockOnTheChain(chain uint64, key []byte) bool + func CheckTransList(chain uint64, factory func(uint64) Hash) (err error) + func CheckTransaction(chain uint64, tKey []byte) (err error) + func CreateAppFromSourceCode(fileName string, flag byte) ([]byte, uint64) + func CreateBiosTrans(chain uint64) + func DecodeOpsDataOfTrans(ops uint8, data []byte) map[string]interface + func DeleteBlock(chain uint64, key []byte) error + func DeleteTransaction(chain uint64, key []byte) error + func GetBlockInterval(chain uint64) uint64 + func GetBlockSizeLimit(chain uint64) uint64 + func GetBlockTime(chain uint64) uint64 + func GetHashPowerLimit(chain uint64) uint64 + func GetLastBlockIndex(chain uint64) uint64 + func GetTheBlockKey(chain, index uint64) []byte + func GetUserCoin(chain uint64, addr []byte) uint64 + func IsAdmin(chain uint64, user []byte) bool + func IsExistBlock(chain uint64, key []byte) bool + func IsExistTransaction(chain uint64, key []byte) bool + func IsMiner(chain uint64, user []byte) bool + func ProcessBlockOfChain(chain uint64, key []byte) (err error) + func ReadBlockData(chain uint64, key []byte) []byte + func ReadTransList(chain uint64, key []byte) []byte + func ReadTransactionData(chain uint64, key []byte) []byte + func TransListExist(chain uint64, key []byte) bool + func TransListToBytes(in []Hash) []byte + func WriteBlock(chain uint64, data []byte) error + func WriteTransList(chain uint64, transList []Hash) error + func WriteTransaction(chain uint64, data []byte) error + type Address [AddressLen]byte + func GetAdminList(chain uint64) []Address + func (a *Address) Decode(hexStr string) + func (a *Address) UnmarshalJSON(b []byte) error + func (a Address) Empty() bool + func (a Address) MarshalJSON() ([]byte, error) + type AdminInfo struct + Deposit uint64 + Votes uint64 + func GetAdminInfo(chain uint64, addr Address) AdminInfo + type AppInfo struct + Account Address + Flag uint8 + Life uint64 + LineSum uint64 + func GetAppInfoOfChain(chain uint64, name []byte) *AppInfo + type BaseInfo struct + BaseOpsEnergy uint64 + Chain uint64 + ID uint64 + Key Hash + LeftChildID uint64 + ParentID uint64 + Producer Address + RightChildID uint64 + Time uint64 + func GetChainInfo(chain uint64) *BaseInfo + type Block struct + Chain uint64 + Index uint64 + LeftChild Hash + Nonce uint64 + Parent Hash + Previous Hash + Producer Address + RightChild Hash + Time uint64 + TransListHash Hash + type BlockInfo struct + Index uint64 + LeftChild Hash + LeftChildID uint64 + Parent Hash + ParentID uint64 + Producer Address + RightChild Hash + RightChildID uint64 + Time uint64 + type BroadcastInfo struct + App Hash + BlockKey Hash + LFlag byte + RFlag byte + type DB struct + func (d *DB) Get(key []byte) ([]byte, uint64) + func (d *DB) GetInt(key []byte) uint64 + func (d *DB) GetValue(key []byte, value interface{}) bool + func (d *DB) Set(key, value []byte, life uint64) + func (d *DB) SetValue(key []byte, value interface{}, life uint64) + type DependItem struct + Alias [4]byte + AppName Hash + type Hash [HashLen]byte + func GetHashOfTransList(transList []Hash) Hash + func GetParentBlockOfChain(chain uint64) Hash + func ParseTransList(data []byte) []Hash + func (h *Hash) UnmarshalJSON(b []byte) error + func (h Hash) Empty() bool + func (h Hash) MarshalJSON() ([]byte, error) + type Log struct + func (l *Log) Read(chain uint64, key []byte) []byte + func (l *Log) Write(key, value []byte) bool + type RewardInfo struct + Admins [AdminNum]Address + Reward uint64 + Votes [AdminNum]uint64 + func GetVoteReward(chain, day uint64) RewardInfo + type StBlock struct + HashpowerLimit uint64 + Key Hash + func DecodeBlock(data []byte) *StBlock + func NewBlock(chain uint64, producer Address) *StBlock + func (b *StBlock) GetSignData() []byte + func (b *StBlock) Output() []byte + func (b *StBlock) SetSign(sign []byte) error + type StTrans struct + Data []byte + Key []byte + Sign []byte + func DecodeTrans(data []byte) *StTrans + func NewTransaction(chain uint64, user Address) *StTrans + func (t *StTrans) CreateMove(dstChain, value uint64) + func (t *StTrans) CreateNewApp(code []byte, lineNum uint64) + func (t *StTrans) CreateNewChain(chain, value uint64) + func (t *StTrans) CreateRunApp(app Hash, cost uint64, data []byte) + func (t *StTrans) CreateTransfer(payee Address, value uint64) + func (t *StTrans) CreateUpdateAppLife(app Hash, life uint64) + func (t *StTrans) GetSignData() []byte + func (t *StTrans) Output() []byte + func (t *StTrans) RegisterAdmin(cost uint64) + func (t *StTrans) RegisterMiner(chain, cost uint64, peer []byte) + func (t *StTrans) SetSign(in []byte) error + func (t *StTrans) VoteAdmin(cost uint64, admin []byte) + type StatSwitch struct + SWAPPRun bool + SWMiningCount bool + SWMove bool + SWTransferIn bool + SWTransferOut bool + var Switch StatSwitch = StatSwitch{ ... } + type TransInfo struct + BlockID uint64 + Cost uint64 + Ops uint8 + User Address + func GetTransInfo(chain uint64, key []byte) TransInfo + type TransProc struct + func NewTransProc(chain uint64, key []byte) *TransProc + func (p *TransProc) Close() + func (p *TransProc) ProcTrans(key []byte) uint64 + type Transaction struct + type TransactionHead struct + Chain uint64 + Cost uint64 + Energy uint64 + Ops uint8 + Time uint64 + User Address + type UpdateInfo struct + Life uint64 + Name Hash + type VoteInfo struct + Admin Address + Cost uint64 + StartDay uint64 + func GetVoteInfo(chain uint64, addr Address) VoteInfo