Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SendTransaction ¶
func SendTransaction(tx Transaction) error
Types ¶
type Block ¶
type Block struct {
PrevBlockHash string `json:"prevBlockHash"`
Transactions []Transaction `json:"transactions"`
BlockNumber int `json:"blockNumber"`
Nonce string `json:"nonce"`
BlockHash string `json:"blockHash"`
}
Block represents a block in the blockchain.
type BlockchainResponse ¶
type BlockchainResponse struct {
BlockchainHeader struct {
BlockchainLength int `json:"blockchainLength"`
} `json:"blockchainHeader"`
Blocks []Block `json:"blocks"`
}
BlockchainResponse represents the JSON structure of blockchain data.
type Transaction ¶
type Transaction struct {
Sender string `json:"sender"`
Recipient string `json:"recipient"`
Amount int `json:"amt"`
Nonce string `json:"nonce"`
Data TxData `json:"data"`
Timestamp string `json:"timestamp"`
Sign string `json:"sign"`
}
Transaction represents a transaction in a block.
func FetchBlockchain ¶
func FetchBlockchain(timestamp string) ([]Transaction, error)
FetchDatabaseNode fetches blockchain transactions at a given timestamp.
Click to show internal directories.
Click to hide internal directories.