The goal of this project is to create a network of BlockChains using the given class structures. This is an extension of Simple-Blockchain-Implementation.
In this project, we have an additional class called blockNetwork
that includes four fields: numNodes
, allNodes
, u
, and v
. The input file provides a list of u-v
values representing the connections between nodes.
The input file is structured as follows:
- Number of Nodes: Specifies the total number of nodes in the network.
- Number of Transactions per Block: Indicates the number of transactions per block.
- Total Number of Transactions: Represents the overall number of transactions.
- Number of Edges: Specifies the number of edges connecting nodes.
- Edge List: Lists the edges connecting nodes
u
andv
. - Transactions: Provides the transactions in the format: Transaction ID, FromID, ToID, Amount, and Timestamp.
- Understand the provided class structures and relationships.
- Parse the input file and extract relevant information.
- Use the provided boilerplate code as a starting point.
- Implement logic to track
fromValue
andtoValue
for each transaction. - Update the blockchain for each node based on the transactions.
- Open or create a new project.
- Go to Project > Project Properties.
- Expand Configuration Properties and select Debugging.
- In the Command Arguments field, type
<input_filename
. - Build and run the program.
If you have g++ installed, compile and run the program using the terminal:
g++ project4.cpp -o p4
./p4 < input1.txt
For powershell:
Get-Content input1.txt | ./p4