{"id":19788759,"url":"https://github.com/hbarcelos/udacity-private-blockchain","last_synced_at":"2026-06-09T04:04:24.262Z","repository":{"id":53106689,"uuid":"173655967","full_name":"hbarcelos/udacity-private-blockchain","owner":"hbarcelos","description":"Implentation of Udacity's Blockchain Developer Nanodegree Private Blockchain project","archived":false,"fork":false,"pushed_at":"2021-04-06T13:44:20.000Z","size":871,"stargazers_count":0,"open_issues_count":9,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-11T03:53:14.092Z","etag":null,"topics":["blockchain","blockchain-demos","javascript"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hbarcelos.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":"2019-03-04T01:58:25.000Z","updated_at":"2019-05-11T01:10:22.000Z","dependencies_parsed_at":"2022-09-13T15:02:22.591Z","dependency_job_id":null,"html_url":"https://github.com/hbarcelos/udacity-private-blockchain","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hbarcelos%2Fudacity-private-blockchain","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hbarcelos%2Fudacity-private-blockchain/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hbarcelos%2Fudacity-private-blockchain/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hbarcelos%2Fudacity-private-blockchain/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hbarcelos","download_url":"https://codeload.github.com/hbarcelos/udacity-private-blockchain/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241125091,"owners_count":19913840,"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","blockchain-demos","javascript"],"created_at":"2024-11-12T06:28:42.318Z","updated_at":"2026-06-09T04:04:24.231Z","avatar_url":"https://github.com/hbarcelos.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Private Blockchain\n\nThis is my implentation of Udacity\u0026rsquo;s Blockchain Developer Nanodegree Private Blockchain project.\n\n## Prerequisites\n\n- `node`: \u003e=8.9.4 \u003c12.0.0.\n\n## Install dependencies\n\n```\nnpm install\n```\n\n## Testing\n\nThis project as a full test suite implementing all validation described in the probject\u0026rsquo; rubric. To run it:\n\n```\nnpm test\n```\n\n## Running\n\nSet the desired values for the environment variables in the `.env` file, for example:\n\n```bash\nPORT=8000\nBLOCKCHAIN_DATA_STORAGE_DIRECTORY=./chaindata\nVALIDATION_REQUEST_WINDOW=300\nVALIDATION_EXPIRATION=1800\n```\n\nNow you can start the server:\n\n```bash\nnpm start\n```\n\n## Endpoints\n\n\u003ctable style=\"table-layout: fixed; width: 100%;\"\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003ctd\u003ePath\u003c/td\u003e\n      \u003ctd\u003eResponse Code\u003c/td\u003e\n      \u003ctd\u003eResponse Body\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd rowspan=2\u003e\u003ccode\u003eGET /block/{height}\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003e200\u003c/code\u003e: when block exists for \u003ccode\u003eheight\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n      \u003cpre\u003e\n{\n  height: Number,\n  time: UnixTimestamp,\n  body: Any,\n  hash: String,\n  previousBlockHash: String,\n}\n      \u003c/pre\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003e404\u003c/code\u003e: when block does not exist for \u003ccode\u003eheight\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n      \u003cpre\u003e\n{\n  error: {\n    message: String,\n    code: String,\n    cause?: {\n      message: String,\n    } \n  }\n}\n      \u003c/pre\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd rowspan=2\u003e\u003ccode\u003ePOST /block\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003e200\u003c/code\u003e: when body \u003ccode\u003e.body\u003c/code\u003e is valid\u003c/td\u003e\n      \u003ctd\u003e\n      \u003cpre\u003e\n{\n  height: Number,\n  time: UnixTimestamp,\n  body: Any,\n  hash: String,\n  previousBlockHash: String,\n}\n      \u003c/pre\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003e422\u003c/code\u003e: when body \u003ccode\u003e.body\u003c/code\u003e is invalid\u003c/td\u003e\n      \u003ctd\u003e\n      \u003cpre\u003e\n{\n  error: {\n    message: String,\n    code: String,\n    cause?: {\n      message: String,\n    } \n  }\n}\n      \u003c/pre\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003ePOST /requestValidation\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003e200\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n      \u003cpre\u003e\n{\n  walletAddress: String,\n  requestTimeStamp: UnixTimestamp,\n  \"message\": String,\n  \"validationWindow\": Number,\n}\n      \u003c/pre\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd rowspan=3\u003e\u003ccode\u003ePOST /message-signature/validate\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003e200\u003c/code\u003e: when \u003ccode\u003esignature\u003c/code\u003e is valid for the \u003ccode\u003eaddress\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n      \u003cpre\u003e\n{\n  \"registerStar\": true,\n  \"status\": {\n    \"address\": String,\n    \"requestTimeStamp\": UnixTimestamp,\n    \"message\": String,\n    \"validationWindow\": Number,\n    \"messageSignature\": true\n  }\n}\n      \u003c/pre\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003e404\u003c/code\u003e: when there is no pending validation for the \u003ccode\u003eaddress\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n      \u003cpre\u003e\n{\n  error: {\n    message: String,\n    code: String,\n    cause?: {\n      message: String,\n    } \n  }\n}\n      \u003c/pre\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003e403\u003c/code\u003e: when the \u003ccode\u003esignature\u003c/code\u003e is invalid\u003c/td\u003e\n      \u003ctd\u003e\n      \u003cpre\u003e\n{\n  error: {\n    message: String,\n    code: String,\n    cause?: {\n      message: String,\n    } \n  }\n}\n      \u003c/pre\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003eGET /stars/hash:{hash}\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003e200\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n      \u003cpre\u003e\n{\n  height: Number,\n  time: UnixTimestamp,\n  body: Any,\n  hash: String,\n  previousBlockHash: String,\n}\n      \u003c/pre\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003eGET /stars/address:{address}\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\u003ccode\u003e200\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003e\n      \u003cpre\u003e\n[\n  {\n    height: Number,\n    time: UnixTimestamp,\n    body: Any,\n    hash: String,\n    previousBlockHash: String,\n  }?\n  ...\n]\n      \u003c/pre\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n## Remarks\n\n- This project uses Express.js\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhbarcelos%2Fudacity-private-blockchain","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhbarcelos%2Fudacity-private-blockchain","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhbarcelos%2Fudacity-private-blockchain/lists"}