{"id":19740364,"url":"https://github.com/distributive-network/dcp-node-example","last_synced_at":"2026-01-31T03:31:50.085Z","repository":{"id":42673369,"uuid":"314645079","full_name":"Distributive-Network/dcp-node-example","owner":"Distributive-Network","description":"An example project of a DCP NodeJS App to deploy work. ","archived":false,"fork":false,"pushed_at":"2023-02-20T14:57:46.000Z","size":499,"stargazers_count":1,"open_issues_count":2,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-12T03:51:14.941Z","etag":null,"topics":["dcp","dcp-node","javascript","nodejs"],"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/Distributive-Network.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":"2020-11-20T19:02:42.000Z","updated_at":"2025-01-09T23:21:41.000Z","dependencies_parsed_at":"2024-11-12T01:22:05.054Z","dependency_job_id":"e9bbf2a4-15df-4b86-9f11-74d7bdfa476e","html_url":"https://github.com/Distributive-Network/dcp-node-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/Distributive-Network/dcp-node-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Distributive-Network%2Fdcp-node-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Distributive-Network%2Fdcp-node-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Distributive-Network%2Fdcp-node-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Distributive-Network%2Fdcp-node-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Distributive-Network","download_url":"https://codeload.github.com/Distributive-Network/dcp-node-example/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Distributive-Network%2Fdcp-node-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28928148,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T02:59:34.861Z","status":"ssl_error","status_checked_at":"2026-01-31T02:59:05.369Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["dcp","dcp-node","javascript","nodejs"],"created_at":"2024-11-12T01:20:49.531Z","updated_at":"2026-01-31T03:31:50.069Z","avatar_url":"https://github.com/Distributive-Network.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dcp-node-example\n\nA Node.js example project that uses the Distributed Computer. It shows how to deploy a job to the Distributed Computer whilst\nreceiving events describing the current state of the job, processing results as\nthey are received, and so on.\n\nFork this github repository to get running quickly with the Distributed Computer on Node.js.\n\n## Important files\n\n| Filename                | Contents                                            |\n| :---------------------- | --------------------------------------------------- |\n| ~/.dcp/id.keystore      | Your identity proxy keystore                        |\n| ~/.dcp/default.keystore | The 'bank account' key to use for paying for work   |\n\n## Environment Variables\n\n| Variable      | Behaviour                            |\n| :------------ | ------------------------------------ |\n| DCP_XHR_DEBUG | Shows network traffic on the console |\n| DCP_XHR_PROXY | Set url of HTTP proxy server         |\n\n### Getting Started\n\nYou will need Node 12 in your path. If you have an older version of NodeJS, use\n`nvm`; see instructions in the FAQ. Additionally, you will need to copy your\nidentity and bank account keystores from the [portal](https://portal.distributed.computer/) of the Distributed Computer into the .dcp directory\ninside your home directory. For more instructions on getting started, visit our [introductory guide here](https://docs.dcp.dev/getting-started).\n\nNote: You will need to join our beta program to have permission to deploy jobs to the Distributed Computer. To do this, please fill out [this form](https://docs.google.com/forms/d/e/1FAIpQLScj6g1PH7Nbejlj5XHrScvtBhTy-2A_l0A8sHMzzihQR79KYw/viewform)!\n\n```shell\nmkdir ~/.dcp\ncp ~/Downloads/id.keystore ~/.dcp\ncp ~/Downloads/default.keystore ~/.dcp\ngit clone git@github.com:Kings-Distributed-Systems/dcp-node-example.git\ncd dcp-node-example\nnpm install\nnode app.js\n```\n\n### FAQ\n\n#### Where do I get an identity proxy keystore?\n\nVisit \u003chttps://portal.distributed.computer/\u003e, then\n\n- Portal\n- First Devs\n- Identity Keys\n- Bottom right, green plus\n\n#### Where do I get a bank account keystore?\n\nVisit \u003chttps://portal.distributed.computer/\u003e, then\n\n- Wallet\n- Accounts\n- Default\n- Click down-pointing chevron\n- Click download\n\n#### I don't want people using my identity proxy anymore. Can I revoke it?\n\nYes, remove it from the same screen in portal that you created it with, and it\nwill become invalid immediately.\n\n#### I shared my bank account keystore and passphrase by accident. What should I do?\n\n- Visit the portal\n- Create a new bank account\n- Transfer all your credits into the new account\n- Remove the old account\n\n#### What versions of NodeJS are supported?\n\nWe currently support Node 12 LTS.\n\nIf your operating system has a different version of Node.js, we suggest using\n[nvm](https://github.com/nvm-sh/nvm#installing-and-updating) to run Node 12.\n\n#### Can I use the node command line debugger with DCP Client?\n\nNo; the node debugger does not interoperate with programs that require you to\ntype passwords. You should use the GUI debuggers instead; node inspector or\nvscode. If you are a die-hard CLI user, you can also try our experimental\ndebugger, [niim](https://github.com/wesgarland/niim). e.g.\n\n```shell\n$ sudo npm install --global niim\n\n[sudo] password for wes:\n/usr/bin/niim -\u003e /usr/lib/node_modules/niim/niim\n+ niim@1.11.6-g\nupdated 1 package in 2.371s\n\n$ niim app.js\n| niim: Node-Inspector IMproved - initialized\n\u003c Debugger listening on ws://127.0.0.1:34117/f1956572-a327-40b2-b70a-20a8b9961228\n\u003c For help, see: https://nodejs.org/en/docs/inspector\n\u003c Debugger attached.\n\nBreak on start in app.js:1\n\u003e 1\n  2 /**\n  3  * @file        app.js\nniim\u003e c\n\u003c new ready state: exec\nEnter passphrase to unlock keystore 'hello-staging':\n\nniim\u003e ctty\n\u003c entering interactive terminal mode, ^C to exit (niim)\n*****\nnew ready state: deploying\nEnter passphrase to unlock keystore 'hello-staging': *****\nnew ready state: authorizeHold\nnew ready state: authorizeFeeStructure\n - Job accepted by scheduler, waiting for results\n - Job has id 0x7f8bd7b58e99f4dc5e9e26d4d898707f079368e484dfb0b52876458c9c7b7edfeb0cabb6c7cb8eb362c192c9d198d2d718e99aeb08f4d1edf5cfcf60ad1101029a\nnew ready state: deployed\n\u003cCONTROL-C\u003e\n| exited interactive terminal mode\nniim\u003e\n```\n\n#### Why does it take so long to get my results back?\n\nOur scheduler is very busy!\n\nWe do prioritize work based on your _bid price_. This is the value per slice\nassigned during to the call to `compute.exec()`.\n\nWe also have a slow-start period which is designed to measure the work you have\nsubmitted, ensure that it is well-behaved, and so on. This means that we will\nhold back your work until we get results back for 5-10 slices.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdistributive-network%2Fdcp-node-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdistributive-network%2Fdcp-node-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdistributive-network%2Fdcp-node-example/lists"}