Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Blockchain Proof-of-Concept

Minimal blockchain implementation in Go, inspired by naivechain. Provides an HTTP node plus a CLI client to list the ledger, mine new blocks, and test longest-chain replacement.

Layout

  • internal/blockchain: core chain logic (genesis, hashing, validation, replacement).
  • server: HTTP node exposing /blocks, /mine, /replace.
  • client: CLI for interacting with a running node.

Quickstart

  1. Start the node:
cd server
go run .
  1. In another terminal, interact with the client:
cd client
go run . -action list
go run . -action mine -data "hello chain"

Use -host to point at a remote node (default http://localhost:8080).

Testing

From the repo root:

GOCACHE=$(pwd)/.gocache go test ./...

Notes

  • Longest-chain replacement logic is covered by table-driven tests, including branch/merge scenarios.

About

A simple proof of concept of blockchain

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages