MCPcopy Create free account

hub / github.com/Jeiwan/blockchain_go / functions

Functions100 in github.com/Jeiwan/blockchain_go

↓ 16 callersFunctionNewMerkleNode
NewMerkleNode creates a new Merkle tree node
merkle_tree.go:49
↓ 7 callersMethodNext
Next returns next block starting from the tip
blockchain_iterator.go:16
↓ 7 callersMethodSerialize
Serialize serializes the block
block.go:50
↓ 7 callersMethodUpdate
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 callersFunctioncommandToBytes
(command string)
server.go:60
↓ 7 callersFunctiongobEncode
(data interface{})
server.go:445
↓ 7 callersFunctionsendData
(addr string, data []byte)
server.go:109
↓ 6 callersFunctionDeserializeBlock
DeserializeBlock deserializes a block
block.go:63
↓ 5 callersMethodIsCoinbase
IsCoinbase checks whether the transaction is coinbase
transaction.go:28
↓ 5 callersFunctionNewBlockchain
NewBlockchain creates a new Blockchain with genesis Block
blockchain.go:72
↓ 5 callersMethodString
String returns a human-readable representation of a transaction
transaction.go:90
↓ 5 callersFunctionValidateAddress
ValidateAddress check if address if valid
wallet.go:59
↓ 4 callersFunctionBase58Decode
Base58Decode decodes Base58-encoded data
base58.go:36
↓ 4 callersMethodIterator
Iterator returns a BlockchainIterat
blockchain.go:201
↓ 4 callersMethodReindex
Reindex rebuilds the UTXO set
utxo_set.go:99
↓ 3 callersFunctionDeserializeOutputs
DeserializeOutputs deserializes TXOutputs
transaction_output.go:54
↓ 3 callersFunctionHashPubKey
HashPubKey hashes public key
wallet.go:45
↓ 3 callersFunctionIntToHex
IntToHex converts an int64 to a byte array
utils.go:10
↓ 3 callersFunctionNewCoinbaseTX
NewCoinbaseTX creates a new coinbase transaction
transaction.go:176
↓ 3 callersFunctionNewTXOutput
NewTXOutput create a new TXOutput
transaction_output.go:28
↓ 3 callersFunctionNewWallets
NewWallets creates Wallets and fills it from a file if it exists
wallets.go:21
↓ 3 callersFunctionsendGetData
(address, kind string, id []byte)
server.go:148
↓ 3 callersFunctionsendInv
(address, kind string, items [][]byte)
server.go:133
↓ 2 callersFunctionBase58Encode
Base58Encode encodes a byte array to Base58
base58.go:11
↓ 2 callersMethodFindTransaction
FindTransaction finds a transaction by its ID
blockchain.go:136
↓ 2 callersMethodFindUTXO
FindUTXO finds UTXO for a public key hash
utxo_set.go:49
↓ 2 callersMethodGetAddress
GetAddress returns wallet address
wallet.go:32
↓ 2 callersMethodGetBestHeight
GetBestHeight returns the height of the latest block
blockchain.go:208
↓ 2 callersMethodHash
Hash returns the hash of the Transaction
transaction.go:46
↓ 2 callersMethodIsLockedWithKey
IsLockedWithKey checks if the output can be used by the owner of the pubkey
transaction_output.go:23
↓ 2 callersMethodMineBlock
MineBlock mines a new block with the provided transactions
blockchain.go:269
↓ 2 callersFunctionNewBlock
NewBlock creates and returns Block
block.go:21
↓ 2 callersFunctionNewMerkleTree
NewMerkleTree creates a new Merkle tree from a sequence of data
merkle_tree.go:20
↓ 2 callersFunctionNewProofOfWork
NewProofOfWork builds and returns a ProofOfWork
proofofwork.go:24
↓ 2 callersMethodSerialize
Serialize serializes TXOutputs
transaction_output.go:41
↓ 2 callersMethodTrimmedCopy
TrimmedCopy creates a trimmed copy of Transaction to be used in signing
transaction.go:114
↓ 2 callersMethodVerifyTransaction
VerifyTransaction verifies transaction input signatures
blockchain.go:336
↓ 2 callersFunctionchecksum
Checksum generates a checksum for a public key
wallet.go:70
↓ 2 callersFunctiondbExists
(dbFile string)
blockchain.go:354
↓ 2 callersMethodprepareData
(nonce int)
proofofwork.go:33
↓ 2 callersMethodprintUsage
()
cli.go:14
↓ 2 callersFunctionsendGetBlocks
(address string)
server.go:141
↓ 2 callersFunctionsendTx
(addr string, tnx *Transaction)
server.go:155
↓ 2 callersFunctionsendVersion
(addr string, bc *Blockchain)
server.go:163
↓ 1 callersMethodAddBlock
AddBlock saves the block into the blockchain
blockchain.go:101
↓ 1 callersMethodCountTransactions
CountTransactions returns the number of transactions in the UTXO set
utxo_set.go:77
↓ 1 callersFunctionCreateBlockchain
CreateBlockchain creates a new blockchain DB
blockchain.go:26
↓ 1 callersMethodCreateWallet
CreateWallet adds a Wallet to Wallets
wallets.go:31
↓ 1 callersFunctionDeserializeTransaction
DeserializeTransaction deserializes a transaction
transaction.go:235
↓ 1 callersMethodFindSpendableOutputs
FindSpendableOutputs finds and returns unspent outputs to reference in inputs
utxo_set.go:18
↓ 1 callersMethodGetAddresses
GetAddresses returns an array of addresses stored in the wallet file
wallets.go:41
↓ 1 callersMethodGetBlock
GetBlock finds a block by its hash and returns it
blockchain.go:227
↓ 1 callersMethodGetBlockHashes
GetBlockHashes returns a list of hashes of all the blocks in the chain
blockchain.go:251
↓ 1 callersMethodGetWallet
GetWallet returns a Wallet by its address
wallets.go:52
↓ 1 callersMethodHashTransactions
HashTransactions returns a hash of the transactions in the block
block.go:38
↓ 1 callersMethodLoadFromFile
LoadFromFile loads wallets from the file
wallets.go:57
↓ 1 callersMethodLock
Lock signs the output
transaction_output.go:16
↓ 1 callersFunctionNewGenesisBlock
NewGenesisBlock creates and returns genesis Block
block.go:33
↓ 1 callersFunctionNewUTXOTransaction
NewUTXOTransaction creates a new transaction
transaction.go:196
↓ 1 callersFunctionNewWallet
NewWallet creates and returns a Wallet
wallet.go:24
↓ 1 callersFunctionReverseBytes
ReverseBytes reverses a byte array
utils.go:21
↓ 1 callersMethodRun
Run performs a proof-of-work
proofofwork.go:49
↓ 1 callersMethodRun
Run parses command line arguments and processes commands
cli.go:34
↓ 1 callersMethodSaveToFile
SaveToFile saves wallets to a file
wallets.go:82
↓ 1 callersMethodSerialize
Serialize returns a serialized Transaction
transaction.go:33
↓ 1 callersMethodSign
Sign signs each input of a Transaction
transaction.go:58
↓ 1 callersMethodSignTransaction
SignTransaction signs inputs of a Transaction
blockchain.go:321
↓ 1 callersFunctionStartServer
StartServer starts a node
server.go:421
↓ 1 callersMethodValidate
Validate validates block's PoW
proofofwork.go:76
↓ 1 callersMethodVerify
Verify verifies signatures of Transaction inputs
transaction.go:132
↓ 1 callersFunctionbytesToCommand
(bytes []byte)
server.go:70
↓ 1 callersMethodcreateBlockchain
(address, nodeID string)
cli_createblockchain.go:8
↓ 1 callersMethodcreateWallet
(nodeID string)
cli_createwallet.go:5
↓ 1 callersMethodgetBalance
(address, nodeID string)
cli_getbalance.go:8
↓ 1 callersFunctionhandleAddr
(request []byte)
server.go:172
↓ 1 callersFunctionhandleBlock
(request []byte, bc *Blockchain)
server.go:188
↓ 1 callersFunctionhandleConnection
(conn net.Conn, bc *Blockchain)
server.go:390
↓ 1 callersFunctionhandleGetBlocks
(request []byte, bc *Blockchain)
server.go:255
↓ 1 callersFunctionhandleGetData
(request []byte, bc *Blockchain)
server.go:270
↓ 1 callersFunctionhandleInv
(request []byte, bc *Blockchain)
server.go:218
↓ 1 callersFunctionhandleTx
(request []byte, bc *Blockchain)
server.go:299
↓ 1 callersFunctionhandleVersion
(request []byte, bc *Blockchain)
server.go:364
↓ 1 callersMethodlistAddresses
(nodeID string)
cli_listaddress.go:8
↓ 1 callersFunctionnewKeyPair
()
wallet.go:77
↓ 1 callersFunctionnodeIsKnown
(addr string)
server.go:457
↓ 1 callersMethodprintChain
(nodeID string)
cli_printchain.go:8
↓ 1 callersMethodreindexUTXO
(nodeID string)
cli_reindexutxo.go:5
↓ 1 callersFunctionrequestBlocks
()
server.go:86
↓ 1 callersMethodsend
(from, to string, amount int, nodeID string, mineNow bool)
cli_send.go:8
↓ 1 callersFunctionsendBlock
(addr string, b *Block)
server.go:101
↓ 1 callersMethodstartNode
(nodeID, minerAddress string)
cli_startnode.go:8
↓ 1 callersMethodvalidateArgs
()
cli.go:26
MethodFindUTXO
FindUTXO finds all unspent transaction outputs and returns transactions with spent outputs removed
blockchain.go:157
FunctionTestBase58
(t *testing.T)
base58_test.go:12
FunctionTestNewMerkleNode
(t *testing.T)
merkle_tree_test.go:11
FunctionTestNewMerkleTree
(t *testing.T)
merkle_tree_test.go:52
MethodUsesKey
UsesKey checks whether the address initiated the transaction
transaction_input.go:14
FunctionextractCommand
(request []byte)
server.go:82
Functionmain
()
main.go:3
FunctionsendAddr
(address string)
server.go:92