Versions in this module Expand all Collapse all v0 v0.4.1 Mar 17, 2020 Changes in this version + func Init() + type TransProc struct + func NewTransProc(chain uint64, key []byte) *TransProc + func (p *TransProc) Close() + func (p *TransProc) ProcTrans(key []byte) uint64 v0.3.9 Feb 19, 2020 Changes in this version + func Exit() v0.3.5 Dec 10, 2019 Changes in this version + func DeleteTransaction(chain uint64, key []byte) error v0.3.2 Dec 1, 2019 Changes in this version + const StatSyncTime + func BlockOnTheChain(chain uint64, key []byte) bool + func CheckTransList(chain uint64, factory func(uint64) Hash) (err error) + func ProcessBlockOfChain(chain uint64, key []byte) (err error) v0.1.0 Oct 13, 2019 Changes in this version + const AddressLen + const AppFlagGzipCompress + const AppFlagImport + const AppFlagPlublc + const AppFlagRun + const BaseRelia + const HashLen + const MinerNum + const OpsDisableAdmin + const OpsMove + const OpsNewApp + const OpsNewChain + const OpsRegisterMiner + const OpsRunApp + const OpsTransfer + const OpsUpdateAppLife + const StatAvgBlockSize + const StatBaseInfo + const StatBlockInterval + const StatBlockSizeLimit + const StatBroadcast + const StatChangingConfig + const StatFirstBlockKey + const StatGuerdon + const StatHashPower + const StatHateRatio + const StatMax + const StatParentKey + const StatSyncInfo + const StatTransKey + const SyncOpsBroadcast + const SyncOpsBroadcastAck + const SyncOpsHateRatio + const SyncOpsMiner + const SyncOpsMoveCoin + const SyncOpsNewChain + const TimeDay + const TimeHour + const TimeMillisecond + const TimeMinute + const TimeMonth + const TimeSecond + const TimeYear + func Broadcast(user interface{}, msg []byte) + func CheckTransaction(chain uint64, key []byte) (uint32, error) + func CreateAppFromSourceCode(fileName string, flag byte) ([]byte, uint64) + func CreateBiosTrans(chain uint64) + func Decode(typ uint8, in []byte, out interface{}) int + func DecodeOpsDataOfTrans(ops uint8, data []byte) map[string]interface + func DeleteAccount(user interface{}, addr Address) + func DeleteBlock(chain uint64, key []byte) error + func DeleteBlockReliability(chain uint64, key []byte) + func Encode(typ uint8, in interface{}) []byte + func Event(user interface{}, event string, param ...[]byte) + func GetBlockInterval(chain uint64) uint64 + func GetBlockSizeLimit(chain uint64) uint64 + func GetBlockTime(chain uint64) uint64 + func GetDBData(name string, key []byte) ([]byte, uint64) + func GetLastBlockIndex(chain uint64) uint64 + func GetTheBlockKey(chain, index uint64) []byte + func GetUserCoin(chain uint64, addr []byte) uint64 + func IHateYou(user interface{}, peer Address, cost uint64) + func IsExistBlock(chain uint64, key []byte) bool + func IsExistTransaction(chain uint64, key []byte) bool + func IsMiner(chain, index uint64, user []byte) bool + func MoveCost(user interface{}, chain, cost uint64) + func OtherOps(user interface{}, ops int, energy uint64, data []byte) []byte + func ReadBlockData(chain uint64, key []byte) []byte + func ReadTransactionData(chain uint64, key []byte) []byte + func Recover(address, sign, msg []byte) bool + func RegisterAdmin(app interface{}, index uint8, cost uint64) + func RegisterRuntime(in IRuntime) + func SaveBlockReliability(chain uint64, key []byte, rb TReliability) + func TransferAccounts(owner interface{}, payee Address, value uint64) + func UpdateAppLife(AppName Hash, life uint64) + func UpdateConfig(user interface{}, ops uint8, newSize uint32) + func WriteBlock(chain uint64, data []byte) error + func WriteTransaction(chain uint64, data []byte) error + type Address [AddressLen]byte + func GetAppAccount(in interface{}) Address + func (a Address) Empty() bool + type AdminInfo struct + App Hash + Cost uint64 + Index uint8 + type AppInfo struct + Account Address + Flag uint8 + Life uint64 + LineSum uint64 + func GetAppInfo(name Hash) *AppInfo + 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 + Size uint32 + 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 GetDB(owner interface{}) *DB + func (d *DB) Get(key []byte) ([]byte, uint64) + func (d *DB) GetInt(key []byte) uint64 + func (d *DB) Set(key, value []byte, life uint64) + func (d *DB) SetInt(key []byte, value uint64, life uint64) + type DependItem struct + Alias [4]byte + AppName Hash + type Hash [HashLen]byte + func GetAppName(in interface{}) Hash + func GetHash(data []byte) Hash + func GetParentBlockOfChain(chain uint64) Hash + func (h Hash) Empty() bool + type IRuntime interface + ConsumeEnergy func(energy uint64) + DbGet func(owner interface{}, key []byte) ([]byte, uint64) + DbGetLife func(owner interface{}, key []byte) uint64 + DbSet func(owner interface{}, key, value []byte, life uint64) + Decode func(typ uint8, in []byte, out interface{}) int + Encode func(typ uint8, in interface{}) []byte + Event func(user interface{}, event string, param ...[]byte) + GetAppName func(in interface{}) []byte + GetHash func(in []byte) []byte + LogRead func(owner interface{}, chain uint64, key []byte) ([]byte, uint64) + LogReadLife func(owner interface{}, key []byte) uint64 + LogWrite func(owner interface{}, key, value []byte, life uint64) + NewApp func(name []byte, code []byte) + OtherOps func(user interface{}, ops int, data []byte) []byte + Recover func(address, sign, msg []byte) bool + RunApp func(name, user, data []byte, energy, cost uint64) + type Log struct + func GetLog(owner interface{}) *Log + func (l *Log) Read(chain uint64, key []byte) []byte + func (l *Log) Write(key, value []byte) bool + type Miner struct + Cost [minerNum]uint64 + Miner [minerNum]Address + func GetMinerInfo(chain, index uint64) Miner + type RegMiner struct + Chain uint64 + Index uint64 + type StBlock struct + HashpowerLimit uint64 + Key Hash + TransList []Hash + func DecodeBlock(data []byte) *StBlock + func NewBlock(chain uint64, producer Address) *StBlock + func (b *StBlock) GetReliability() TReliability + func (b *StBlock) GetSignData() []byte + func (b *StBlock) GetTransList() []string + func (b *StBlock) Output() []byte + func (b *StBlock) SetSign(sign []byte) error + func (b *StBlock) SetTransList(list []Hash) + 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) CreateRegisterMiner(chain, index, cost 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) SetSign(in []byte) error + type TReliability struct + HashPower uint64 + Index uint64 + Key Hash + LeftChild Hash + Miner bool + Parent Hash + Previous Hash + Producer Address + Ready bool + RightChild Hash + Time uint64 + func ReadBlockReliability(chain uint64, key []byte) (cl TReliability) + func (r *TReliability) Recalculation(chain uint64) + func (r TReliability) Cmp(y TReliability) int + type TransInfo struct + BlockID uint64 + Cost uint64 + Ops uint8 + User Address + func GetTransInfo(chain uint64, key []byte) TransInfo + 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