This repository contrain Assessment Submission of task given by HogoByte.
This is a simple implementation of a blockchain ledger in C++. It allows you to add transactions, create blocks, validate the ledger, and print the ledger.
To compile and run this code, you need to have the following installed on your system:
- C++ compiler (supporting C++11 or later)
- OpenSSL library
To compile the code, follow these steps:
- Clone the repository or download the source code files.
- Open a terminal or command prompt.
- Navigate to the directory where the source code files are located.
- Run the following command to compile the code:
- g++ blockchain.cpp -o program -lssl -lcrypto (This command uses the g++ compiler, sets the C++ version to C++11, and links against the OpenSSL library.)
- Open a terminal or command prompt.
- If there are no compilation errors, an executable file named
program
will be generated in the same directory. Navigate to the directory where theprogram
executable is located.- ./program
Here's a brief description of the available operations:
- Add Transaction: Allows you to add a transaction to the transaction pool.
- Add Block: Creates a new block with the transactions in the transaction pool and adds it to the blockchain.
- Validate Ledger: Checks the integrity and validity of the blockchain.
- Print Ledger: Displays the entire blockchain with block details and transactions.
- Exit: Quits the program.