{"id":15096087,"url":"https://github.com/streamdp/goblockchain","last_synced_at":"2026-01-07T07:09:19.786Z","repository":{"id":46325887,"uuid":"422962088","full_name":"streamdp/goblockchain","owner":"streamdp","description":"goBlockChain is a version of the classic blockChain with POW algorithms written in golang. May come in handy when learning about this technology.","archived":false,"fork":false,"pushed_at":"2021-10-30T20:59:00.000Z","size":22,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-06T07:42:20.707Z","etag":null,"topics":["blockchain-demos","gin-gonic","gitflow-workflow","sha1"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/streamdp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-10-30T18:34:36.000Z","updated_at":"2024-07-26T03:25:51.000Z","dependencies_parsed_at":"2022-09-19T11:20:33.026Z","dependency_job_id":null,"html_url":"https://github.com/streamdp/goblockchain","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streamdp%2Fgoblockchain","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streamdp%2Fgoblockchain/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streamdp%2Fgoblockchain/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streamdp%2Fgoblockchain/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/streamdp","download_url":"https://codeload.github.com/streamdp/goblockchain/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236699581,"owners_count":19190840,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blockchain-demos","gin-gonic","gitflow-workflow","sha1"],"created_at":"2024-09-25T15:45:23.191Z","updated_at":"2025-02-01T17:43:37.472Z","avatar_url":"https://github.com/streamdp.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# goblockchain\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/streamdp/goblockchain/releases/latest\"\u003e\n        \u003cimg alt=\"GitHub release\" src=\"https://img.shields.io/github/v/release/streamdp/goblockchain.svg?logo=github\u0026style=flat-square\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://goreportcard.com/report/github.com/streamdp/goblockchain\"\u003e\n        \u003cimg src=\"https://goreportcard.com/badge/github.com/streamdp/goblockchain\" alt=\"Code Status\" /\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\nThis repo contains a simple/basic blockchain realisation in Go, with a basic code organization.\nWe use:\n* gin-gonic/gin package to start and serve HTTP server\n* crypto/sha1 to get SHA1 hashes\n\ngoblockchain use [Taskfile](https://dev.to/stack-labs/introduction-to-taskfile-a-makefile-alternative-h92) (a Makefile alternative). \n\nPlease read the [Building Blockchain from Scratch in Python](https://python-scripts.com/blockchain) article in order to know more about this repository.\n\n## Build the app\n```bash\n$ go build -o bin/goBlockChain internal/main.go\n````\nor\n```bash\n$ task build\n````\n## Run the app\n```bash\n$ ./bin/goBlockChain\n```\nor\n```bash\n$ task run\n```\nThe default port is 8080, you can test the application in a browser or with curl:\n```bash\n$ curl 127.0.0.1:8080/chain\n```\nYou can choose a different port and run more than one copy of goBlockChain on your local host.  For example:\n```bash\n$ ./bin/goBlockChain -port 8081\n``` \nList of the endpoints:\n* GET **/ping** _check node status_\n* GET **/mine** _mine a new block_\n* GET **/chain** _get the current state of the blockchain on a node_\n* GET **/nodes/resolve** _get actual copy of the blockchain_ \n* GET **/mine/complexity/increase** _increase the difficulty of mining blocks_\n* GET **/mine/complexity/decrease** _decrease the difficulty of mining blocks_\n* POST **/transactions/new** _make a new transaction_\n* POST **/nodes/register** _add a new node to the list of nodes_\n\nExample of sending a POST request to add a new transaction to the blockchain:\n```bash\n$ curl -X POST -H \"Content-Type: application/json\" -d '{ \"sender\": \"1914116639ac11ec83092c6fc90649b9\", \"recipient\": \"7e93670390396556d432206c1c3231fbb\", \"amount\": 10}' \"http://localhost:8080/transactions/new\"\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstreamdp%2Fgoblockchain","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstreamdp%2Fgoblockchain","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstreamdp%2Fgoblockchain/lists"}