Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Jeiwan/blockchain_go
/ functions
Functions
100 in github.com/Jeiwan/blockchain_go
⨍
Functions
100
◇
Types & classes
21
↓ 16 callers
Function
NewMerkleNode
NewMerkleNode creates a new Merkle tree node
merkle_tree.go:49
↓ 7 callers
Method
Next
Next returns next block starting from the tip
blockchain_iterator.go:16
↓ 7 callers
Method
Serialize
Serialize serializes the block
block.go:50
↓ 7 callers
Method
Update
Update updates the UTXO set with transactions from the Block The Block is considered to be the tip of a blockchain
utxo_set.go:143
↓ 7 callers
Function
commandToBytes
(command string)
server.go:60
↓ 7 callers
Function
gobEncode
(data interface{})
server.go:445
↓ 7 callers
Function
sendData
(addr string, data []byte)
server.go:109
↓ 6 callers
Function
DeserializeBlock
DeserializeBlock deserializes a block
block.go:63
↓ 5 callers
Method
IsCoinbase
IsCoinbase checks whether the transaction is coinbase
transaction.go:28
↓ 5 callers
Function
NewBlockchain
NewBlockchain creates a new Blockchain with genesis Block
blockchain.go:72
↓ 5 callers
Method
String
String returns a human-readable representation of a transaction
transaction.go:90
↓ 5 callers
Function
ValidateAddress
ValidateAddress check if address if valid
wallet.go:59
↓ 4 callers
Function
Base58Decode
Base58Decode decodes Base58-encoded data
base58.go:36
↓ 4 callers
Method
Iterator
Iterator returns a BlockchainIterat
blockchain.go:201
↓ 4 callers
Method
Reindex
Reindex rebuilds the UTXO set
utxo_set.go:99
↓ 3 callers
Function
DeserializeOutputs
DeserializeOutputs deserializes TXOutputs
transaction_output.go:54
↓ 3 callers
Function
HashPubKey
HashPubKey hashes public key
wallet.go:45
↓ 3 callers
Function
IntToHex
IntToHex converts an int64 to a byte array
utils.go:10
↓ 3 callers
Function
NewCoinbaseTX
NewCoinbaseTX creates a new coinbase transaction
transaction.go:176
↓ 3 callers
Function
NewTXOutput
NewTXOutput create a new TXOutput
transaction_output.go:28
↓ 3 callers
Function
NewWallets
NewWallets creates Wallets and fills it from a file if it exists
wallets.go:21
↓ 3 callers
Function
sendGetData
(address, kind string, id []byte)
server.go:148
↓ 3 callers
Function
sendInv
(address, kind string, items [][]byte)
server.go:133
↓ 2 callers
Function
Base58Encode
Base58Encode encodes a byte array to Base58
base58.go:11
↓ 2 callers
Method
FindTransaction
FindTransaction finds a transaction by its ID
blockchain.go:136
↓ 2 callers
Method
FindUTXO
FindUTXO finds UTXO for a public key hash
utxo_set.go:49
↓ 2 callers
Method
GetAddress
GetAddress returns wallet address
wallet.go:32
↓ 2 callers
Method
GetBestHeight
GetBestHeight returns the height of the latest block
blockchain.go:208
↓ 2 callers
Method
Hash
Hash returns the hash of the Transaction
transaction.go:46
↓ 2 callers
Method
IsLockedWithKey
IsLockedWithKey checks if the output can be used by the owner of the pubkey
transaction_output.go:23
↓ 2 callers
Method
MineBlock
MineBlock mines a new block with the provided transactions
blockchain.go:269
↓ 2 callers
Function
NewBlock
NewBlock creates and returns Block
block.go:21
↓ 2 callers
Function
NewMerkleTree
NewMerkleTree creates a new Merkle tree from a sequence of data
merkle_tree.go:20
↓ 2 callers
Function
NewProofOfWork
NewProofOfWork builds and returns a ProofOfWork
proofofwork.go:24
↓ 2 callers
Method
Serialize
Serialize serializes TXOutputs
transaction_output.go:41
↓ 2 callers
Method
TrimmedCopy
TrimmedCopy creates a trimmed copy of Transaction to be used in signing
transaction.go:114
↓ 2 callers
Method
VerifyTransaction
VerifyTransaction verifies transaction input signatures
blockchain.go:336
↓ 2 callers
Function
checksum
Checksum generates a checksum for a public key
wallet.go:70
↓ 2 callers
Function
dbExists
(dbFile string)
blockchain.go:354
↓ 2 callers
Method
prepareData
(nonce int)
proofofwork.go:33
↓ 2 callers
Method
printUsage
()
cli.go:14
↓ 2 callers
Function
sendGetBlocks
(address string)
server.go:141
↓ 2 callers
Function
sendTx
(addr string, tnx *Transaction)
server.go:155
↓ 2 callers
Function
sendVersion
(addr string, bc *Blockchain)
server.go:163
↓ 1 callers
Method
AddBlock
AddBlock saves the block into the blockchain
blockchain.go:101
↓ 1 callers
Method
CountTransactions
CountTransactions returns the number of transactions in the UTXO set
utxo_set.go:77
↓ 1 callers
Function
CreateBlockchain
CreateBlockchain creates a new blockchain DB
blockchain.go:26
↓ 1 callers
Method
CreateWallet
CreateWallet adds a Wallet to Wallets
wallets.go:31
↓ 1 callers
Function
DeserializeTransaction
DeserializeTransaction deserializes a transaction
transaction.go:235
↓ 1 callers
Method
FindSpendableOutputs
FindSpendableOutputs finds and returns unspent outputs to reference in inputs
utxo_set.go:18
↓ 1 callers
Method
GetAddresses
GetAddresses returns an array of addresses stored in the wallet file
wallets.go:41
↓ 1 callers
Method
GetBlock
GetBlock finds a block by its hash and returns it
blockchain.go:227
↓ 1 callers
Method
GetBlockHashes
GetBlockHashes returns a list of hashes of all the blocks in the chain
blockchain.go:251
↓ 1 callers
Method
GetWallet
GetWallet returns a Wallet by its address
wallets.go:52
↓ 1 callers
Method
HashTransactions
HashTransactions returns a hash of the transactions in the block
block.go:38
↓ 1 callers
Method
LoadFromFile
LoadFromFile loads wallets from the file
wallets.go:57
↓ 1 callers
Method
Lock
Lock signs the output
transaction_output.go:16
↓ 1 callers
Function
NewGenesisBlock
NewGenesisBlock creates and returns genesis Block
block.go:33
↓ 1 callers
Function
NewUTXOTransaction
NewUTXOTransaction creates a new transaction
transaction.go:196
↓ 1 callers
Function
NewWallet
NewWallet creates and returns a Wallet
wallet.go:24
↓ 1 callers
Function
ReverseBytes
ReverseBytes reverses a byte array
utils.go:21
↓ 1 callers
Method
Run
Run performs a proof-of-work
proofofwork.go:49
↓ 1 callers
Method
Run
Run parses command line arguments and processes commands
cli.go:34
↓ 1 callers
Method
SaveToFile
SaveToFile saves wallets to a file
wallets.go:82
↓ 1 callers
Method
Serialize
Serialize returns a serialized Transaction
transaction.go:33
↓ 1 callers
Method
Sign
Sign signs each input of a Transaction
transaction.go:58
↓ 1 callers
Method
SignTransaction
SignTransaction signs inputs of a Transaction
blockchain.go:321
↓ 1 callers
Function
StartServer
StartServer starts a node
server.go:421
↓ 1 callers
Method
Validate
Validate validates block's PoW
proofofwork.go:76
↓ 1 callers
Method
Verify
Verify verifies signatures of Transaction inputs
transaction.go:132
↓ 1 callers
Function
bytesToCommand
(bytes []byte)
server.go:70
↓ 1 callers
Method
createBlockchain
(address, nodeID string)
cli_createblockchain.go:8
↓ 1 callers
Method
createWallet
(nodeID string)
cli_createwallet.go:5
↓ 1 callers
Method
getBalance
(address, nodeID string)
cli_getbalance.go:8
↓ 1 callers
Function
handleAddr
(request []byte)
server.go:172
↓ 1 callers
Function
handleBlock
(request []byte, bc *Blockchain)
server.go:188
↓ 1 callers
Function
handleConnection
(conn net.Conn, bc *Blockchain)
server.go:390
↓ 1 callers
Function
handleGetBlocks
(request []byte, bc *Blockchain)
server.go:255
↓ 1 callers
Function
handleGetData
(request []byte, bc *Blockchain)
server.go:270
↓ 1 callers
Function
handleInv
(request []byte, bc *Blockchain)
server.go:218
↓ 1 callers
Function
handleTx
(request []byte, bc *Blockchain)
server.go:299
↓ 1 callers
Function
handleVersion
(request []byte, bc *Blockchain)
server.go:364
↓ 1 callers
Method
listAddresses
(nodeID string)
cli_listaddress.go:8
↓ 1 callers
Function
newKeyPair
()
wallet.go:77
↓ 1 callers
Function
nodeIsKnown
(addr string)
server.go:457
↓ 1 callers
Method
printChain
(nodeID string)
cli_printchain.go:8
↓ 1 callers
Method
reindexUTXO
(nodeID string)
cli_reindexutxo.go:5
↓ 1 callers
Function
requestBlocks
()
server.go:86
↓ 1 callers
Method
send
(from, to string, amount int, nodeID string, mineNow bool)
cli_send.go:8
↓ 1 callers
Function
sendBlock
(addr string, b *Block)
server.go:101
↓ 1 callers
Method
startNode
(nodeID, minerAddress string)
cli_startnode.go:8
↓ 1 callers
Method
validateArgs
()
cli.go:26
Method
FindUTXO
FindUTXO finds all unspent transaction outputs and returns transactions with spent outputs removed
blockchain.go:157
Function
TestBase58
(t *testing.T)
base58_test.go:12
Function
TestNewMerkleNode
(t *testing.T)
merkle_tree_test.go:11
Function
TestNewMerkleTree
(t *testing.T)
merkle_tree_test.go:52
Method
UsesKey
UsesKey checks whether the address initiated the transaction
transaction_input.go:14
Function
extractCommand
(request []byte)
server.go:82
Function
main
()
main.go:3
Function
sendAddr
(address string)
server.go:92