An experimental blockchain implementation written from scratch in Go!
BlockLite aims to build a blockchain from the ground up, with plans to introduce a cryptocurrency called MaskedCoins
. The current codebase includes a basic blockchain structure with proof-of-work consensus, RESTful APIs, and supporting utilities, with more features in development.
- Blockchain Core: Implements a simple blockchain with blocks containing index, timestamp, proof, and previous hash.
- Proof of Work: Uses a basic PoW algorithm requiring 4 leading zeros in the hash.
- API Endpoints: Provides RESTful APIs via Gin to interact with the blockchain (e.g., get blocks, mine new blocks).
- Go (1.18+)
- Git
-
Clone the repository:
git clone https://github.com/maskedsyntax/blocklite.git cd blocklite
-
Install dependencies:
go mod tidy
-
Install
air
for live reloading:go install github.com/air-verse/air@latest
Important
Ensure air
is in your PATH to execute it successfully.
- Start the server with live reloading:
air
- Access the API at
http://localhost:8080
(configurable viaPORT
environment variable).
- Live Reloading: Changes in
.go
files trigger restarts viaair
. The/tmp
folder is temporary and ignored in version control. - Testing: Run tests with:
go test ./...
This is a personal project, but feel free to fork and submit pull requests. Feedback is welcome!
This project is licensed under the MIT License. See the LICENSE
file for details.
Note
Updates on MaskedCoins
and future features will be shared as they progress.