Documentation ¶
Index ¶
- Constants
- func CheckMainblockTransactions(pointertxs *[]utility.Transaction, root utility.Hash) bool
- func CheckNameBytes(name []byte) bool
- func GetMainblockReward(i uint32) uint64
- type Mainblock
- type Maincore
- func (mn *Maincore) AddBlockChunck(bytes []byte)
- func (mn *Maincore) AddInMemoryBlock(mb *Mainblock)
- func (mn *Maincore) AddTransactionToTxsPool(tx *utility.Transaction, fee uint64, priority uint64)
- func (mn *Maincore) AutoCheckMainblocks() bool
- func (mn *Maincore) AutoCheckMainheaders() bool
- func (mn *Maincore) CheckHeaderChain(pointerheaders *[]Mainheader) bool
- func (mn *Maincore) CheckPropagatingMainheader(header *Mainheader, height uint32) bool
- func (mn *Maincore) CleanMainblocks()
- func (mn *Maincore) CleanMainstate()
- func (mn *Maincore) ConfirmBlocks()
- func (mn *Maincore) ConfirmMainblock(mb *Mainblock)
- func (mn *Maincore) GetConfirmationLayer() uint32
- func (mn *Maincore) GetConfirmedMainblock(i int) *Mainblock
- func (mn *Maincore) GetConfirmedMainchainLength() uint32
- func (mn *Maincore) GetLastConfirmedMainblockTimestamp() int64
- func (mn *Maincore) GetLastMainheader() *Mainheader
- func (mn *Maincore) GetMainblock(i int) *Mainblock
- func (mn *Maincore) GetMainblockState(height uint32) uint32
- func (mn *Maincore) GetMainchainLength() uint32
- func (mn *Maincore) GetMainheader(i int) *Mainheader
- func (mn *Maincore) GetNameState(name []byte) uint32
- func (mn *Maincore) GetPath() string
- func (mn *Maincore) GetSerializedMainblockTransactions(requestedblockheight uint32) []byte
- func (mn *Maincore) GetSerializedMainchainLength() []byte
- func (mn *Maincore) GetSerializedMainheaders(first uint32, last uint32) []byte
- func (mn *Maincore) GetTargetBits() uint32
- func (mn *Maincore) GetTxOutputState(txhash utility.Hash, index uint32) uint32
- func (mn *Maincore) GetTxState(txhash utility.Hash) (uint32, uint32, uint32)
- func (mn *Maincore) LoadMaincore()
- func (mn *Maincore) LoadUnconfirmedBroadcastedTxs(wlt *wallet.Wallet)
- func (mn *Maincore) Lock()
- func (mn *Maincore) Mine(miningaddress utility.Hash) (bool, *Mainblock)
- func (mn *Maincore) PutMainblockState(height uint32, state uint32) error
- func (mn *Maincore) PutNameState(name []byte, stateidentifier uint32) error
- func (mn *Maincore) PutPath(path string)
- func (mn *Maincore) PutTxOutputState(txhash utility.Hash, index uint32, stateidentifier uint32) error
- func (mn *Maincore) PutTxState(txhash utility.Hash, height uint32, number uint32) error
- func (mn *Maincore) RebuildMainstate()
- func (mn *Maincore) SyncWallet(wlt *wallet.Wallet)
- func (mn *Maincore) UnloadMaincore()
- func (mn *Maincore) Unlock()
- func (mn *Maincore) UnserializeMainblockTransactions(bytes []byte) (*[]utility.Transaction, error)
- func (mn *Maincore) UnserializeMainheaders(bytes []byte) (*[]Mainheader, error)
- func (mn *Maincore) UpdateMainstate(tx utility.Transaction, blockheight uint32)
- func (mn *Maincore) ValidateMainblockTransactions(height uint32, pointertxs *[]utility.Transaction) bool
- func (mn *Maincore) ValidateNameRegistration(name []byte) error
- func (mn *Maincore) ValidatePropagatingMainblock(mb *Mainblock) bool
- func (mn *Maincore) ValidateTransaction(tx *utility.Transaction) (bool, uint64)
- func (mn *Maincore) ValidateTxIn(signinghash utility.Hash, tmptxin utility.TxIn) (uint64, error)
- func (mn *Maincore) ValidateTxOut(tmptxout utility.TxOut) (uint64, error)
- type Mainheader
- type TxsPool
- func (txsp *TxsPool) AddTransaction(tx *utility.Transaction, txfee uint64, priority uint64)
- func (txsp *TxsPool) DeleteTransaction(txhash *utility.Hash)
- func (txsp *TxsPool) DisplayTxs()
- func (txsp *TxsPool) GetHighestPriorityTxs(mainchainlength uint32) (*[]utility.Transaction, uint64)
- func (txsp *TxsPool) GetTransaction(txhash *utility.Hash) (utility.Transaction, bool)
- func (txsp *TxsPool) GetTransactionPriority(txhash *utility.Hash) uint64
- func (txsp *TxsPool) SetTxInclusionHeight(txhash *utility.Hash, inclusionheight uint32)
Constants ¶
View Source
const ( GENESIS_BLOCK_REWARD uint64 = 50000000000000 // 50 000 000 globals * 1 000 000 BLOCK_TIME uint32 = 600 //in seconds// ten minutes DIFFICULTY_TUNING_INTERVAL uint32 = 2016 //about two weeks BLOCK_REWARD_TUNING_INTERVAL uint32 = 210000 //blocks //BLOCK_CONFIRMATION_INTERVAL uint32=100//6//blocks ENGAGEMENT_REWARD_FINALIZATION_INTERVAL uint32 = 144 //24*6//about one day BLOCK_MAX_SEIZE uint32 = 1024 * 1024 //1 MO BLOCKTRANSACTIONS_MAX_SEIZE uint32 = BLOCK_MAX_SEIZE - 200 OBSTRUCTED_MINING_TIME int64 = 60 * 600 //10 hours )
View Source
const ( StateKeyIdentifierTxOutput = 1 StateKeyIdentifierTx = 3 StateKeyIdentifierNameRegistration = 4 StateKeyIdentifierMainblock = 6 )
View Source
const ( StateValueIdentifierNotFound = 0 StateValueIdentifierUnspentTxOutput = 1 StateValueIdentifierSpentTxOutput = 2 StateValueIdentifierTx = 3 StateValueIdentifierActifNameRegistration = 4 StateValueIdentifierInactifNameRegistration = 5 StateValueIdentifierValidMainblock = 6 StateValueIdentifierUnvalidMainblock = 7 )
Variables ¶
This section is empty.
Functions ¶
func CheckMainblockTransactions ¶
func CheckMainblockTransactions(pointertxs *[]utility.Transaction, root utility.Hash) bool
func CheckNameBytes ¶
func GetMainblockReward ¶
Types ¶
type Mainblock ¶
type Mainblock struct { // Height uint32 Header Mainheader Transactions []utility.Transaction }
func GenesisBlock ¶
func GenesisBlock() *Mainblock
func NewMainblock ¶
func NewMainblock() *Mainblock
func UnserializeMainblock ¶
func (*Mainblock) ComputeHash ¶
func (mb *Mainblock) ComputeHash()
func (*Mainblock) ComputeRoot ¶
func (mb *Mainblock) ComputeRoot()
type Maincore ¶
type Maincore struct { MissingDataHashArray []utility.Hash MissingDataFileHashArray []utility.Hash // contains filtered or unexported fields }
func NewMaincore ¶
func NewMaincore() *Maincore
func (*Maincore) AddBlockChunck ¶
func (*Maincore) AddInMemoryBlock ¶
func (*Maincore) AddTransactionToTxsPool ¶
func (mn *Maincore) AddTransactionToTxsPool(tx *utility.Transaction, fee uint64, priority uint64)
func (*Maincore) AutoCheckMainblocks ¶
func (*Maincore) AutoCheckMainheaders ¶
func (*Maincore) CheckHeaderChain ¶
func (mn *Maincore) CheckHeaderChain(pointerheaders *[]Mainheader) bool
func (*Maincore) CheckPropagatingMainheader ¶
func (mn *Maincore) CheckPropagatingMainheader(header *Mainheader, height uint32) bool
func (*Maincore) CleanMainblocks ¶
func (mn *Maincore) CleanMainblocks()
func (*Maincore) CleanMainstate ¶
func (mn *Maincore) CleanMainstate()
func (*Maincore) ConfirmBlocks ¶
func (mn *Maincore) ConfirmBlocks()
func (*Maincore) ConfirmMainblock ¶
func (*Maincore) GetConfirmationLayer ¶
func (*Maincore) GetConfirmedMainblock ¶
func (*Maincore) GetConfirmedMainchainLength ¶
func (*Maincore) GetLastConfirmedMainblockTimestamp ¶
func (*Maincore) GetLastMainheader ¶
func (mn *Maincore) GetLastMainheader() *Mainheader
func (*Maincore) GetMainblock ¶
func (*Maincore) GetMainblockState ¶
func (*Maincore) GetMainchainLength ¶
func (*Maincore) GetMainheader ¶
func (mn *Maincore) GetMainheader(i int) *Mainheader
func (*Maincore) GetNameState ¶
func (*Maincore) GetSerializedMainblockTransactions ¶
func (*Maincore) GetSerializedMainchainLength ¶
func (*Maincore) GetSerializedMainheaders ¶
func (*Maincore) GetTargetBits ¶
func (*Maincore) GetTxOutputState ¶
func (*Maincore) GetTxState ¶
func (*Maincore) LoadMaincore ¶
func (mn *Maincore) LoadMaincore()
func (*Maincore) LoadUnconfirmedBroadcastedTxs ¶
func (*Maincore) PutMainblockState ¶
func (*Maincore) PutNameState ¶
func (*Maincore) PutTxOutputState ¶
func (*Maincore) PutTxState ¶
func (*Maincore) RebuildMainstate ¶
func (mn *Maincore) RebuildMainstate()
func (*Maincore) SyncWallet ¶
func (*Maincore) UnloadMaincore ¶
func (mn *Maincore) UnloadMaincore()
func (*Maincore) UnserializeMainblockTransactions ¶
func (mn *Maincore) UnserializeMainblockTransactions(bytes []byte) (*[]utility.Transaction, error)
func (*Maincore) UnserializeMainheaders ¶
func (mn *Maincore) UnserializeMainheaders(bytes []byte) (*[]Mainheader, error)
func (*Maincore) UpdateMainstate ¶
func (mn *Maincore) UpdateMainstate(tx utility.Transaction, blockheight uint32)
func (*Maincore) ValidateMainblockTransactions ¶
func (mn *Maincore) ValidateMainblockTransactions(height uint32, pointertxs *[]utility.Transaction) bool
func (*Maincore) ValidateNameRegistration ¶
func (*Maincore) ValidatePropagatingMainblock ¶
func (*Maincore) ValidateTransaction ¶
func (mn *Maincore) ValidateTransaction(tx *utility.Transaction) (bool, uint64)
func (*Maincore) ValidateTxIn ¶
type Mainheader ¶
type Mainheader struct { // Version int32 Prevblockhash utility.Hash Roothash utility.Hash // Timestamp int64 Bits uint32 Nonce uint32 Hash utility.Hash }
func JSONUnserializeMainheader ¶
func JSONUnserializeMainheader(bytes []byte) (*Mainheader, error)
func UnserializeMainheader ¶
func UnserializeMainheader(bytes []byte) (*Mainheader, error)
func (*Mainheader) JSONSerialize ¶
func (mh *Mainheader) JSONSerialize() []byte
func (*Mainheader) Serialize ¶
func (mh *Mainheader) Serialize() []byte
type TxsPool ¶
type TxsPool struct {
// contains filtered or unexported fields
}
func NewTxsPool ¶
func NewTxsPool() *TxsPool
func (*TxsPool) AddTransaction ¶
func (txsp *TxsPool) AddTransaction(tx *utility.Transaction, txfee uint64, priority uint64)
func (*TxsPool) DeleteTransaction ¶
func (*TxsPool) DisplayTxs ¶
func (txsp *TxsPool) DisplayTxs()
func (*TxsPool) GetHighestPriorityTxs ¶
func (txsp *TxsPool) GetHighestPriorityTxs(mainchainlength uint32) (*[]utility.Transaction, uint64)
func (*TxsPool) GetTransaction ¶
func (*TxsPool) GetTransactionPriority ¶
Click to show internal directories.
Click to hide internal directories.