Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var GenesisBlocks map[shard.Index]*wire.MsgBlock
GenesisBlocks contains all shards' genesis blocks In each genesis blocks, there is NumberOfOutsInEachGenesisBlock outs. However they have none transaction. Outs are directly added into merkle trees, and the roots of the merkle trees are added into genesis blocks. GenesisBlockOutsMerkleTrees are the merkle trees that contains outs in genesis blocks. When building ledger merkle tree, don't directly use outs merkle tree. Outs merkle trees are second layer tree. Create a merkle tree with the OutsMerkleRoot in blockheader, then hook a outs merkle tree. For example:
block := GenesisBlocks[shard] tree := merkle.NewFullMerkleTree(&block.Header.OutsMerkleRoot) outsMerkleTree := GenesisBlocksOutsMerkleTrees[shard] tree.HookSecondLayerTree(outsMerkleTree)
var GenesisBlocksOutsMerkleTrees map[shard.Index]*merkle.FullMerkleTree
GenesisBlocksOutsMerkleTrees contains all shards' out merkle tree
var GenesisPrivateKeys = privateKeys()
GenesisPrivateKeys returns the privateKeys()'s return.
var GenesisPublicKeys = publicKeys()
GenesisPublicKeys contains all genesis public keys
var NumberOfOutsInEachGenesisBlock = 1000
NumberOfOutsInEachGenesisBlock indicats how many outs are there in each genesis block.
var TestNetToolsPrvs = []string{} /* 300 elements not displayed */
TestNetToolsPrvs is private key array for testnet.
var TestNetToolsPubs = []string{} /* 300 elements not displayed */
TestNetToolsPubs is public key array for testnet.
var TotalAmountOfEachShard *big.Int
TotalAmountOfEachShard represents number of crypto coins are there in each genesis block.
Functions ¶
func ConvertByteToPkHash ¶
ConvertByteToPkHash coverts pk bytes to chainhash.Hash
func ConvertStringToPkHash ¶
ConvertStringToPkHash coverts pk string to chainhash.Hash
func CreateGenesisOutState ¶
CreateGenesisOutState makes it easier to create an out state corresponding to a outpoint in genesis block.
Types ¶
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
Pool is the pk pool for the first batch of miners. All of the pks in pool will store in all miners' genesis block.
Notion: Pool should be used by a scheduler, the scheduler should ensure that each miner gets a different pk.
func NewPool ¶
func NewPool() *Pool
NewPool returns a new instance of Pool, it will read config file from the given path. TODO: should not hard coee.
func (*Pool) GetSkFromAddress ¶
func (pool *Pool) GetSkFromAddress(address multivacaddress.Address) ([]byte, error)
GetSkFromAddress returns the pk of the given address