{"id":22378916,"url":"https://github.com/codebrahma/blockchain","last_synced_at":"2025-07-27T20:07:32.701Z","repository":{"id":70954950,"uuid":"115072856","full_name":"Codebrahma/blockchain","owner":"Codebrahma","description":"A blockchain built from scratch for learning","archived":false,"fork":false,"pushed_at":"2018-12-07T06:10:42.000Z","size":106,"stargazers_count":2,"open_issues_count":4,"forks_count":1,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-07-21T21:13:32.103Z","etag":null,"topics":["blockchain","cryptocurrency","javascript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Codebrahma.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2017-12-22T03:32:34.000Z","updated_at":"2020-02-13T16:39:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"b1ed5460-ee3d-4fb6-9dd3-7d9001be1da3","html_url":"https://github.com/Codebrahma/blockchain","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Codebrahma/blockchain","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Codebrahma%2Fblockchain","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Codebrahma%2Fblockchain/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Codebrahma%2Fblockchain/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Codebrahma%2Fblockchain/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Codebrahma","download_url":"https://codeload.github.com/Codebrahma/blockchain/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Codebrahma%2Fblockchain/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267417664,"owners_count":24083839,"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","status":"online","status_checked_at":"2025-07-27T02:00:11.917Z","response_time":82,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","cryptocurrency","javascript"],"created_at":"2024-12-04T23:08:21.686Z","updated_at":"2025-07-27T20:07:32.695Z","avatar_url":"https://github.com/Codebrahma.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"#  CB Chain\nA blockchain built from scratch for learning.\n\n## Nmap service\nHighlevel service which maintains the list of active nodes in the blockchain network. It unregisters nodes within 60s of no heartbeat.\n```\nnode nmap.js\n```\n\n## Genesis block and miner ( only once for the network )\n```\nNODE_ID=3000 DB_PATH=./db node app.js createWallet\n# Creates keys =\u003e pubkey 0400ea77060547eb078aed59c2e120b94ccf3a01b837e69d0244838c9d9991606c027d2a59121b8b0f4a1c659e60cbedd4055f779d2bfe975d59bb02973f6bad2f [GENESIS_MINER]\n# Create Genesis block ( run only once )\nNODE_ID=3000 DB_PATH=./db BLOCKCHAIN_MINER=[GENESIS_MINER] node app.js initChain --minerAddress [GENESIS_MINER]\n# Begin mining\nNODE_ID=3000 DB_PATH=./db BLOCKCHAIN_MINER=[GENESIS_MINER] node miner.js\n```\n\n## Create other miners ()\n```\nNODE_ID=3001 DB_PATH=./db node app.js createWallet [ MINER_1=\u003eresult of create wallet ]\nNODE_ID=3001 DB_PATH=./db BLOCKCHAIN_MINER=[MINER_1] node miner.js\n```\n\n## Move money\n```\nNODE_ID=3000 DB_PATH=./db BLOCKCHAIN_MINER=[GENESIS_MINER] node app.js add --from [BLOCKCHAIN_MINER] --to [MINER_1] --amount 0.01\nNODE_ID=3000 DB_PATH=./db BLOCKCHAIN_MINER=[GENESIS_MINER] node app.js checkBalance --address [BLOCKCHAIN_MINER]\nNODE_ID=3001 DB_PATH=./db BLOCKCHAIN_MINER=[MINER_1] node app.js checkBalance --address [MINER_1]\n```\n## Logging\n\nWe are using [logem](https://github.com/Codebrahma/logem), codebrahma's own Opinionated logger based on top of winston with Papertrail integration. To see debug logs you may start any command with LOG_LEVEL as debug\n```\nLOG_LEVEL=debug npm run nmap\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodebrahma%2Fblockchain","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodebrahma%2Fblockchain","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodebrahma%2Fblockchain/lists"}