Documentation
¶
Index ¶
- type Miner
- type User
- func (user *User) Balance() uint64
- func (user *User) BroadcastTransaction(tran *core.Transaction)
- func (user *User) GetPrivateKey() *rsa.PrivateKey
- func (user *User) GetShortIdentity() string
- func (user *User) RegisterBoostUser(chain core.Blockchain)
- func (user *User) SendTo(receipt *User, amount uint64, fee uint64)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Miner ¶
type Miner struct { Address rsa.PublicKey TransactionPool []*core.Transaction // contains filtered or unexported fields }
func CreateMiner ¶
func CreateMiner(chain core.Blockchain) *Miner
func (*Miner) GetBlockChain ¶
func (miner *Miner) GetBlockChain() *core.Blockchain
func (*Miner) GetPrivateKey ¶
func (miner *Miner) GetPrivateKey() *rsa.PrivateKey
func (*Miner) GetShortIdentity ¶
func (*Miner) StartMining ¶
func (miner *Miner) StartMining()
* StartMining starts to propose and confirm block in the chain * Here assume we only have one miner, otherwise this function need to handle multi-threading
type User ¶
func CreateBoostUser ¶
func CreateBoostUser() *User
* CreateBoostUser to create the first user before boosting the chain
func CreateUser ¶
func CreateUser(chain core.Blockchain) *User
func (*User) BroadcastTransaction ¶
func (user *User) BroadcastTransaction(tran *core.Transaction)
* BroadcastTransaction broadcasts the transaction to all miners * TODO: The broadcast should be based on msg in real world
func (*User) GetPrivateKey ¶
func (user *User) GetPrivateKey() *rsa.PrivateKey
func (*User) GetShortIdentity ¶
func (*User) RegisterBoostUser ¶
func (user *User) RegisterBoostUser(chain core.Blockchain)
* RegisterBoostUser used to register the boost user after initialize the blockchain
Click to show internal directories.
Click to hide internal directories.