{"id":20796629,"url":"https://github.com/gotocva/nilajs-blockchain","last_synced_at":"2026-04-17T13:02:02.527Z","repository":{"id":245237248,"uuid":"817652846","full_name":"gotocva/nilajs-blockchain","owner":"gotocva","description":null,"archived":false,"fork":false,"pushed_at":"2024-06-20T07:21:58.000Z","size":109,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-18T11:28:54.589Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/gotocva.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":"2024-06-20T07:14:32.000Z","updated_at":"2024-07-07T11:58:53.000Z","dependencies_parsed_at":"2024-06-20T19:59:55.532Z","dependency_job_id":null,"html_url":"https://github.com/gotocva/nilajs-blockchain","commit_stats":null,"previous_names":["gotocva/nilajs-blockchain"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gotocva%2Fnilajs-blockchain","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gotocva%2Fnilajs-blockchain/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gotocva%2Fnilajs-blockchain/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gotocva%2Fnilajs-blockchain/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gotocva","download_url":"https://codeload.github.com/gotocva/nilajs-blockchain/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243141256,"owners_count":20242817,"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":[],"created_at":"2024-11-17T16:28:25.662Z","updated_at":"2025-12-24T13:53:00.164Z","avatar_url":"https://github.com/gotocva.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Blockchain Library\n\nThis library provides a core blockchain implementation accessible via REST APIs and stores data using LevelDB. The current release supports a single-node blockchain feature.\n\n## Features\n\n- Core blockchain functionality exposed as REST APIs\n- Data persistence using LevelDB\n- Single-node blockchain implementation\n\n## Installation\n\nTo use this library, you need to have Node.js installed. \n\nTo clone the repository \n\n```sh \ngit clone https://github.com/gotocva/nilajs-blockchain.git\n```\n\nOpen terminal inside the directory ```cd nilajs-blockchain```\n\nYou can install the required dependencies using npm:\n\n```sh\nnpm install\n```\n\n## Usage\n\n### Running the Server\n\nTo start the Blockchain server, run:\n\n```sh\nnode index.js\n```\n\nThis will start the server on `http://localhost:3000`.\n\n### REST API Endpoints\n\n#### Add a New Block/Transaction\n\n**Endpoint:** `POST /block`\n\n**Description:** Adds a new block/transaction to the blockchain with the specified data.\n\n**Request Body:**\n\n```json\n{\n    \"data\" : {\n        \"from\" : \"aravind\",\n        \"to\" : \"boobalan\",\n        \"amount\" : \"125\"\n    }\n}\n```\n\n**Response:**\n\n```json\n{\n    \"index\": 1,\n    \"timestamp\": \"1718867161\",\n    \"data\": {\n        \"from\": \"aravind\",\n        \"to\": \"boobalan\",\n        \"amount\": \"125\"\n    },\n    \"nonce\": 10457,\n    \"previousHash\": \"00005042da8f149d499f3942ea5bf077e681e2d49e12a57e692a9fadbc99ec8f\",\n    \"hash\": \"0000931257811c594529f0474b50d8c0bd3d1a940e77cd4796235abf10aa8df1\"\n}\n```\n\n#### Get Blockchain\n\n**Endpoint:** `GET /blockchain`\n\n**Description:** Retrieves the entire blockchain.\n\n**Response:**\n\n```json\n[\n  {\n    \"index\": 0,\n    \"timestamp\": \"1718866875\",\n    \"data\": {\n      \"title\": \"Genesis block of the blockchain\",\n      \"difficulty\": 4,\n      \"consensus\": \"Proof of work\"\n    },\n    \"nonce\": 4104,\n    \"previousHash\": \"0000XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\",\n    \"hash\": \"00005042da8f149d499f3942ea5bf077e681e2d49e12a57e692a9fadbc99ec8f\"\n  },\n  {\n    \"index\": 1,\n    \"timestamp\": \"1718867161\",\n    \"data\": {\n      \"from\": \"aravind\",\n      \"to\": \"boobalan\",\n      \"amount\": \"125\"\n    },\n    \"nonce\": 10457,\n    \"previousHash\": \"00005042da8f149d499f3942ea5bf077e681e2d49e12a57e692a9fadbc99ec8f\",\n    \"hash\": \"0000931257811c594529f0474b50d8c0bd3d1a940e77cd4796235abf10aa8df1\"\n  }\n]\n```\n\n### Example\n\n#### Adding a New Block\n\n```sh\ncurl -X POST http://localhost:3000/block -H \"Content-Type: application/json\" -d '{\n    \"data\" : {\n        \"from\" : \"aravind\",\n        \"to\" : \"boobalan\",\n        \"amount\" : \"125\"\n    }\n}'\n```\n\n#### Retrieving the Blockchain\n\n```sh\ncurl http://localhost:3000/blockchain\n```\n\n### Roadmap\n\n- [x] Core Blockchain\n- [x] Proof of work - Consensus\n- [x] Persistant using Level DB\n- [x] REST API\n- [x] Blockchain Explorer\n- [ ] Digital signature \n- [ ] Distributed networks \n- [ ] Broadcasting \u0026 Queuing the transactions\n- [ ] Consensus for Peer to Peer\n\n## Development\n\nTo contribute to this project, follow these steps:\n\n1. Fork the repository\n2. Create a new branch (`git checkout -b feature-branch`)\n3. Make your changes\n4. Commit your changes (`git commit -m 'Add some feature'`)\n5. Push to the branch (`git push origin feature-branch`)\n6. Open a pull request\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n## Contact\n\nFor any questions or issues, please open an issue on GitHub or contact me @ gotocva@gmail.com || +91-8056359277","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgotocva%2Fnilajs-blockchain","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgotocva%2Fnilajs-blockchain","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgotocva%2Fnilajs-blockchain/lists"}