{"id":19125725,"url":"https://github.com/0xsharma/compact-chain","last_synced_at":"2025-05-05T20:16:35.307Z","repository":{"id":109480999,"uuid":"594720844","full_name":"0xsharma/compact-chain","owner":"0xsharma","description":"A simple light weight blockchain written in Golang for devs with interest in blockchain architecture.","archived":false,"fork":false,"pushed_at":"2023-10-24T07:57:31.000Z","size":126,"stargazers_count":25,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-05T20:16:14.566Z","etag":null,"topics":["blockchain","golang","grpc","p2p","rpc"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/0xsharma.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-29T12:48:44.000Z","updated_at":"2025-03-12T10:20:48.000Z","dependencies_parsed_at":"2023-10-05T02:51:22.153Z","dependency_job_id":"9f636d5b-9d52-4406-9e2f-924ab89d7d6a","html_url":"https://github.com/0xsharma/compact-chain","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xsharma%2Fcompact-chain","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xsharma%2Fcompact-chain/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xsharma%2Fcompact-chain/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xsharma%2Fcompact-chain/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0xsharma","download_url":"https://codeload.github.com/0xsharma/compact-chain/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252569648,"owners_count":21769517,"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","golang","grpc","p2p","rpc"],"created_at":"2024-11-09T05:36:30.494Z","updated_at":"2025-05-05T20:16:35.289Z","avatar_url":"https://github.com/0xsharma.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\r\n# Compact-Chain\r\nThis is a simple implentation of Blockchain in Golang. This project is undertaken to enhance my knowlege on advanced(p2p, db, state-transitions) blockchain concepts. This can be used by anyone who wants to learn about blockchain and how it works. \r\n\r\n### Prerequisites\r\n\r\nWhat things you need to install the software and how to install them.\r\n\r\n```\r\nGolang 1.20+\r\n```\r\n\r\n### Run Demo Chain\r\n\r\n```\r\ngo mod tidy\r\ngo run main.go demo\r\n```\r\n\r\n### Run Multiple Nodes Chain\r\n\r\n```\r\ngo mod tidy\r\ngo run main.go start \u003cNODE_ID\u003e\r\n\r\nfor example : \r\nterminal/instance 1 : go run main.go start 1\r\nterminal/instance 2 : go run main.go start 2\r\nterminal/instance 3 : go run main.go start 3\r\nAnd so on....\r\n```\r\n\r\n### Send Transactions\r\n\r\n\r\nMake sure a node is running and note the endpoint.\r\n\r\n```\r\ngo run main.go send-tx --to \u003cTO_ADDR\u003e --privatekey \u003cSENDER_PRIV_KEY\u003e --value \u003cTX_VALUE\u003e --rpc \u003cRPC_ADDR\u003e --nonce \u003cNONCE\u003e\r\n```\r\nexample (also, will run with fresh chain and default config) :\r\n```\r\ngo run main.go send-tx --to 0x93a63fc45341fc02ac9cce62cc5aeb5c5799403e --privatekey c3fc038a9abc0f483e2e1f8a0b4db676bce3eaebd7d9afc68e1e7e28ca8738a6 --value 1 --rpc localhost:17111 --nonce 0\r\n```\r\n(increase the nonce for the consecutive transactions by 1 to fire more transactions)\r\n###### NOTE : Transactions can also be send using RPC calls directly.\r\n\r\n### Run Tests\r\n\r\n```\r\nmake test\r\n```\r\n\r\n### Modules Implemented\r\n\r\n```\r\n- Consensus (POW)\r\n- p2p (gRPC)\r\n- DbStore\r\n- State Executor\r\n- RPC (add and get Transactions)\r\n- TxPool\r\n- Encoding\r\n- Hashing\r\n```\r\n### License\r\nThe entire code is licensed under the [GNU General Public License v3.0](https://www.gnu.org/licenses/gpl-3.0.en.html).\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xsharma%2Fcompact-chain","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0xsharma%2Fcompact-chain","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xsharma%2Fcompact-chain/lists"}