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

Overview

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"
You might also like...
mercuryPQCrypto is a go post quantum cryptography (PQC) algorithms lib for studying the pqc migration and application adaptation.

mercuryPQCrypto-README 1 mercuryPQCrypto: Mercury Cryptography Project mercuryPQCrypto is a cryptography project conducted by Chongqing University, Ch

A simplified blockchain implementation in Golang

A simplified blockchain implementation in Golang

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,

 Implementing blockchain using Golang ✔️
Implementing blockchain using Golang ✔️

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

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

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.

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

Implementation of blockchain using golang

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

Creating a blockchain in golang

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

Owner
Alexandr Primak
Alexandr Primak
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

null 0 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

BerylBit 9 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

Read Write Pro 0 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

Onyeka 1 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

null 1 Feb 21, 2022
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

Jonas Ampferl 8 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

Jorge Izquierdo 822 Dec 29, 2022
Proof of Work Algorithms For Golang

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

2zo 0 Jan 7, 2022
Aegis - Implementation of AEGIS-128L and AEGIS-256 AEAD algorithms.

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

Eric Lagergren 4 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

null 1 Mar 6, 2022