Skip to content

BlockSimulate is a blockchain simulator in Go with a React frontend. It supports wallet management, transaction signing, and viewing blockchain data. Ideal for learning and experimenting with blockchain technology.

Notifications You must be signed in to change notification settings

adarshswaminath/BlockSimulate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BlockSimulate

Gemini_Generated_Image_84eq9k84eq9k84eq

BlockSimulate is a simple blockchain simulator written in Go. It creates a local blockchain with features for wallet management, transaction signing, and blockchain operations.

Features

  • Create and manage wallets
  • Transfer funds between wallets
  • Sign and verify transactions
  • Retrieve blockchain data and transaction history

Getting Started

Prerequisites

Installation

  1. Clone the repository:
git clone https://github.com/adarshswaminath/BlockSimulate.git

2.Navigate to the project directory:

cd BlockSimulate

3.Install dependencies:

go mod tidy

Usage

You can run the application in two ways:

  1. Running with go run
go run main.go wallet.go block.go
  1. Building and running the binary
go build -o blocksimulate

3.Run the binary:

./blocksimulate

For frontend

4.After running the Go application, open a new terminal:

cd frontend

5.Install dependencies

npm install

6.Run the frontend

npm run dev

The application will start a web server on http://localhost:3000.

API Endpoints

  • 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

Screenshots of the frontend are available in the /screenshots folder.

About

BlockSimulate is a blockchain simulator in Go with a React frontend. It supports wallet management, transaction signing, and viewing blockchain data. Ideal for learning and experimenting with blockchain technology.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published