Port 5000 by default:
cd blockchain_server && go run .
Or set port manually
cd blockchain_server && go run . -port <PORT>
- Description: Returns all blocks in the blockchain.
- Response: JSON array of all blocks.
- Description: Creates a new account and adds it to the wallet.
- Response: JSON representation of the new account.
- Description: Loads and prints the wallet information.
- Response: JSON representation of the wallet information.
- Description: Retrieves a block by its hash.
- Query Parameters:
hash
: The hash of the block to retrieve.
- Response: JSON representation of the block.
- Description: Retrieves a transaction by its ID.
- Query Parameters:
id
: The ID of the transaction to retrieve.
- Response: JSON representation of the transaction.
- Description: Adds a new transaction to the blockchain.
- Request Body: JSON object containing
from
,to
, andamount
fields. - Response: JSON representation of the added transaction.
- Description: Retrieves the unspent transaction outputs (UTXOs) for a given address.
- Query Parameters:
address
: The address to query UTXOs for.
- Response: JSON array of UTXOs.
- Description: Retrieves the balance for a given address.
- Query Parameters:
address
: The address to query the balance for.
- Response: JSON object with the balance.
- Description: Reindexes the UTXO set.
- Response: JSON object with the count of transactions in the UTXO set.