Documentation ¶
Index ¶
- Variables
- func BytesToCmd(bytes []byte) string
- func CloseDB(chain *blockchain.BlockChain)
- func CmdToBytes(cmd string) []byte
- func ExtractCmd(request []byte) []byte
- func GetIP() string
- func GobEncode(data interface{}) []byte
- func Handle(err error)
- func HandleAddr(request []byte)
- func HandleBlock(request []byte, chain *blockchain.BlockChain)
- func HandleConnection(conn net.Conn, chain *blockchain.BlockChain)
- func HandleGetBlocks(request []byte, chain *blockchain.BlockChain)
- func HandleGetData(request []byte, chain *blockchain.BlockChain)
- func HandleInv(request []byte, chain *blockchain.BlockChain)
- func HandleTx(request []byte, chain *blockchain.BlockChain)
- func HandleVersion(request []byte, chain *blockchain.BlockChain)
- func MineTx(chain *blockchain.BlockChain)
- func NodeIsKnown(addr string) bool
- func RequestBlocks()
- func SendAddr(address string)
- func SendBlock(addr string, b *blockchain.Block)
- func SendData(addr string, data []byte)
- func SendGetBlocks(address string)
- func SendGetData(address, kind string, id []byte)
- func SendInv(address, kind string, items [][]byte)
- func SendTx(addr string, tnx *blockchain.Transaction)
- func SendVersion(addr string, chain *blockchain.BlockChain)
- func StartServer(nodeID, minerAddress string)
- type Addr
- type Block
- type GetBlocks
- type GetData
- type Inv
- type Tx
- type Version
Constants ¶
This section is empty.
Variables ¶
View Source
var (
KnownNodes = []string{"localhost:3000"}
)
Functions ¶
func BytesToCmd ¶
func CloseDB ¶
func CloseDB(chain *blockchain.BlockChain)
func CmdToBytes ¶
func ExtractCmd ¶
func HandleAddr ¶
func HandleAddr(request []byte)
func HandleBlock ¶
func HandleBlock(request []byte, chain *blockchain.BlockChain)
func HandleConnection ¶
func HandleConnection(conn net.Conn, chain *blockchain.BlockChain)
func HandleGetBlocks ¶
func HandleGetBlocks(request []byte, chain *blockchain.BlockChain)
func HandleGetData ¶
func HandleGetData(request []byte, chain *blockchain.BlockChain)
func HandleInv ¶
func HandleInv(request []byte, chain *blockchain.BlockChain)
func HandleTx ¶
func HandleTx(request []byte, chain *blockchain.BlockChain)
func HandleVersion ¶
func HandleVersion(request []byte, chain *blockchain.BlockChain)
func MineTx ¶
func MineTx(chain *blockchain.BlockChain)
func NodeIsKnown ¶
func RequestBlocks ¶
func RequestBlocks()
func SendBlock ¶
func SendBlock(addr string, b *blockchain.Block)
func SendGetBlocks ¶
func SendGetBlocks(address string)
func SendGetData ¶
func SendTx ¶
func SendTx(addr string, tnx *blockchain.Transaction)
func SendVersion ¶
func SendVersion(addr string, chain *blockchain.BlockChain)
func StartServer ¶
func StartServer(nodeID, minerAddress string)
Types ¶
Click to show internal directories.
Click to hide internal directories.