BlockSimulate is a simple blockchain simulator written in Go. It creates a local blockchain with features for wallet management, transaction signing, and blockchain operations.
- Create and manage wallets
- Transfer funds between wallets
- Sign and verify transactions
- Retrieve blockchain data and transaction history
- Go 1.21 or higher: https://golang.org/dl/
- Clone the repository:
git clone https://github.com/adarshswaminath/BlockSimulate.git2.Navigate to the project directory:
cd BlockSimulate3.Install dependencies:
go mod tidyYou can run the application in two ways:
- Running with go run
go run main.go wallet.go block.go- Building and running the binary
go build -o blocksimulate3.Run the binary:
./blocksimulateFor frontend
4.After running the Go application, open a new terminal:
cd frontend5.Install dependencies
npm install6.Run the frontend
npm run devThe application will start a web server on http://localhost:3000.
- GET
/block-data: Retrieve all blocks in the blockchain. - GET
/latest-block: Retrieve the latest block in the blockchain. - GET
/wallets: Retrieve all wallets. - POST
/create-wallet: Create a new wallet. Responds with the public and private keys and initial balance. - POST
/transfer: Transfer funds between wallets. Request body:
{
"sender_public_key": "Sender's public key",
"sender_private_key": "Sender's private key",
"receiver_public_key": "Receiver's public key",
"amount": 10
}- GET
/account-details/:public_key: Retrieve account details by public key. - GET
/transactions: Retrieve all transactions.
Screenshots of the frontend are available in the /screenshots folder.
