Documentation
¶
Index ¶
- Constants
- type Block
- type BlockBody
- type BlockHead
- type BlockTail
- type BodyFlags
- type BodyStructure
- type Chain
- func (chain *Chain) AddBlock(newBlock Block)
- func (chain *Chain) AddPeerBlock(peer Peer)
- func (chain *Chain) AddStringBlock(data string)
- func (chain *Chain) CreateGenesisBlock()
- func (chain *Chain) CreatePeer(port int) Peer
- func (chain Chain) Drop(path string)
- func (chain Chain) GetLatestBlock() Block
- func (chain Chain) GetPeers() []Peer
- func (chain Chain) IsValid() bool
- func (chain Chain) Save(path string)
- type Peer
- type PeerData
Constants ¶
View Source
const DIFFICULTY_INCREASE_STEP = 1024
View Source
const PEER_NETWORK_VERSION = "v0.1"
View Source
const SIZE_OF_HEAD = 2 + 4 + 64 + 4 + 1
View Source
const START_DIFFICULTY = 8
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Block ¶
func CreateBlock ¶
func Deserialization ¶
func (Block) CaculateHash ¶
func (Block) SerializationWithTail ¶
func (Block) SerializationWithoutTail ¶
type BodyStructure ¶
type Chain ¶
type Chain struct {
Blocks []Block
}
func CreateChain ¶
func CreateChain() Chain
func (*Chain) AddPeerBlock ¶
func (*Chain) AddStringBlock ¶
func (*Chain) CreateGenesisBlock ¶
func (chain *Chain) CreateGenesisBlock()
func (*Chain) CreatePeer ¶
func (Chain) GetLatestBlock ¶
Click to show internal directories.
Click to hide internal directories.