goBlockChain is a version of the classic blockChain with POW algorithms written in golang.

goblockchain

GitHub release Code Status

This repo contains a simple/basic blockchain realisation in Go, with a basic code organization. We use:

  • gin-gonic/gin package to start and serve HTTP server
  • crypto/sha1 to get SHA1 hashes

goblockchain use Taskfile (a Makefile alternative).

Please read the Building Blockchain from Scratch in Python article in order to know more about this repository.

Build the app

$ go build -o bin/goBlockChain internal/main.go

or

$ task build

Run the app

$ ./bin/goBlockChain

or

$ task run

The default port is 8080, you can test the application in a browser or with curl:

$ curl 127.0.0.1:8080/chain

You can choose a different port and run more than one copy of goBlockChain on your local host. For example:

$ ./bin/goBlockChain -port 8081

List of the endpoints:

  • GET /ping check node status
  • GET /mine mine a new block
  • GET /chain get the current state of the blockchain on a node
  • GET /nodes/resolve get actual copy of the blockchain
  • GET /mine/complexity/increase increase the difficulty of mining blocks
  • GET /mine/complexity/decrease decrease the difficulty of mining blocks
  • POST /transactions/new make a new transaction
  • POST /nodes/register add a new node to the list of nodes

Example of sending a POST request to add a new transaction to the blockchain:

$ curl -X POST -H "Content-Type: application/json" -d '{ "sender": "1914116639ac11ec83092c6fc90649b9", "recipient": "7e93670390396556d432206c1c3231fbb", "amount": 10}' "http://localhost:8080/transactions/new"
Similar Resources

Implementing blockchain using Golang ✔️

 Implementing blockchain using Golang ✔️

Implementing blockchain using Golang ✔️ Keys The Blockchain uses ECDSA (224 bits) keys.

May 24, 2022

Use golang to reproduce the basic blockchain

Blockchain_with_Go Use golang to reproduce the basic blockchain Update Panel V0.1 No transactions but noly blocks are allowed. V0.5 Transactions are n

Dec 30, 2022

The Cosmos-SDK is a framework for building blockchain applications in Golang.

The Cosmos-SDK is a framework for building blockchain applications in Golang.

The Cosmos-SDK is a framework for building blockchain applications in Golang. It is being used to build Gaia, the first implementation of the Cosmos Hub.

Nov 26, 2021

Pasaje de código de JS a Golang. Ejemplo de funcionamiento de una blockchain simple.

Pasaje de código de JS a Golang. Ejemplo de funcionamiento de una blockchain simple.

blockchain-dummy-test Pasaje de código de JS a Golang. Ejemplo de funcionamiento de una blockchain simple. Fuente: https://medium.com/geekculture/bloc

Oct 3, 2022

Implementation of blockchain using golang

go-blockchain Basic implementation of blockchain using golang. Initialize Blockc

Feb 18, 2022

Creating a blockchain in golang

blockchain-in-go Creating a blockchain in go Disclaimer : This code base is sour

Dec 26, 2021

Mini Blockchain Implementation In Golang Inspired by Go-Ethereum🚀

JP Blockchain 🚀 🚀 Mini Blockchain Implementation In Golang Inspired by Go Ethereum & BlockChain Bar by Lukas (Web3Coach) Features Working Core Compo

Aug 8, 2022

Aegis - Implementation of AEGIS-128L and AEGIS-256 AEAD algorithms.

Aegis - Implementation of AEGIS-128L and AEGIS-256 AEAD algorithms.

Dec 29, 2022

Easy to use crypto library with multiple algorithms

crypka Crypka is library, which abstracts away crypto, so one can easily do: Swap cryptosystems by swapping algorithm object in one place Easily and s

Mar 6, 2022
Proof of Work (POW) using SHA1 hashes

Important The main repository is hosted at Codeberg. Proof of Work (SHA1) This repository contains a naive implementation of a Proof of Work (POW) usi

Dec 23, 2021
Berylbit PoW chain using Ethash, EPI-Burn and geth. The chain will be using bot congestion flashbot bundles through nodes

Berylbit PoW chain using Ethash, EPI-Burn and geth. The chain will be using bot congestion flashbot bundles through nodes. Soon, We will work towards

Jun 30, 2022
Uses Google's classic diff-match-patch algorithm to compare two files, sending the color highlighted output to *testing.T for use when testing expected versus actual results.

Compare-files uses Google's classic diff-match-patch algorithm to compare two files. It sends the color highlighted output to *testing.T for use when

Dec 30, 2021
Blockchain-go - A repository that houses a blockchain implemented in Go

blockchain-go This is a repository that houses a blockchain implemented in Go. F

May 1, 2022
Stackledger: a new blockchain written in golang

StackLedger Stackledger is a new blockchain. It is written in golang and uses a novel networking stack built from two primitives: channels and extensi

Feb 21, 2022
Gochain is a Blockchain written in go
Gochain is a Blockchain written in go

gochain gochain is a proof-of-work blockchain written in go. Features Proof-Of-Work Persistence CLI Transactions Addresses Merkle Tree Network How to

Jul 14, 2022
A basic blockchain implementation written in Go

Blockchain Having fun implementing a blockchain using Golang. Using Minimum Viable Blockchain Keys The Blockchain uses ECDSA (224 bits) keys. When a u

Dec 29, 2022
Proof of Work Algorithms For Golang

Proof of Work Algorithms Overview Note: This library is still in active developm

Jan 7, 2022
A simplified blockchain implementation in Golang

A simplified blockchain implementation in Golang

Dec 31, 2022
chia-blockchain some function implement in golang

gochia chia-blockchain some function implement in golang Package bls-signatures implement blspy Usage? Now we can use it to generate plot memo and id,

May 27, 2022