Documentation ¶
Index ¶
- func Compress(publKey ecdsa.PublicKey) string
- func GenPublicKey() string
- func GetAddress(publicKey string) string
- func Hash160(inputByte []byte) []byte
- func Hash256(inputByte []byte) []byte
- func IntToHex(num int64) []byte
- func ReverseBytes(data []byte)
- func Ripemd160Once(inputByte []byte) []byte
- func Serialize(obj any) []byte
- func SetHashAndAddress(b *Block, mp *MinerPool)
- func Sha256Once(inputByte []byte) []byte
- type Block
- type Blockchain
- type BlockchainIterator
- type Miner
- type MinerPool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenPublicKey ¶
func GenPublicKey() string
func GetAddress ¶
func Ripemd160Once ¶
func SetHashAndAddress ¶
func Sha256Once ¶
Types ¶
type Block ¶
type Block struct { Timestamp int64 PrevHash []byte Hash []byte Data []byte Height int64 DiffNum uint Nonce int64 Address string }
func DeserializeBlock ¶
func NewGenesisBlock ¶
type Blockchain ¶
type Blockchain struct {
// contains filtered or unexported fields
}
func NewBlockchain ¶
func NewBlockchain(mp *MinerPool) *Blockchain
func (*Blockchain) AddBlock ¶
func (bc *Blockchain) AddBlock(data string)
func (*Blockchain) BlockChainIteration ¶
func (bc *Blockchain) BlockChainIteration()
func (*Blockchain) NewIterator ¶
func (bc *Blockchain) NewIterator() *BlockchainIterator
func (*Blockchain) ShowBlocksOfMiner ¶
func (bc *Blockchain) ShowBlocksOfMiner(address string)
type BlockchainIterator ¶
type BlockchainIterator struct {
// contains filtered or unexported fields
}
func (*BlockchainIterator) Next ¶
func (bci *BlockchainIterator) Next() *Block
type Miner ¶
func DeserializeMiner ¶
Click to show internal directories.
Click to hide internal directories.