{"_id":"@daggle/bacalhau-js","_rev":"3-3a317df259b6555f7fab84f564f6ebaf","name":"@daggle/bacalhau-js","dist-tags":{"latest":"0.0.13"},"versions":{"0.0.1":{"name":"@daggle/bacalhau-js","version":"0.0.1","description":"JavaScript SDK to interact with Bacalhau network.","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":[],"author":{"name":"Daggle"},"license":"ISC","dependencies":{"axios":"^1.4.0","crypto":"^1.0.1","request":"^2.88.2"},"devDependencies":{},"repository":{"type":"git","url":"https://github.com/dagglexyz"},"gitHead":"62c205d04e8a3f3244d2329592809886ca1e7b7a","_id":"@daggle/bacalhau-js@0.0.1","_nodeVersion":"16.20.2","_npmVersion":"8.19.4","dist":{"integrity":"sha512-TTv7FLZQmjHrkjvf1HYnpxdzSfzhGAJa+ju43RKCibbZ2aMgFCkW1PAWjmI3IcsD40bxy4RB7ARPck4XClk6ug==","shasum":"783c0424979e1e422de24c70c65c115f3ba7f444","tarball":"https://registry.npmjs.org/@daggle/bacalhau-js/-/bacalhau-js-0.0.1.tgz","fileCount":14,"unpackedSize":12756,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDQMZ+yKwFuV9E1H862qCLkhhjuuG8b844M/ETi+8yQjwIge4wO+M/DNFMWOKsdLzuCMGmAIonxwwflCPk1U+gLqYk="}]},"_npmUser":{"name":"leostelon","email":"leostelon17@gmail.com"},"directories":{},"maintainers":[{"name":"leostelon","email":"leostelon17@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bacalhau-js_0.0.1_1692357157517_0.08833087101237402"},"_hasShrinkwrap":false},"0.0.11":{"name":"@daggle/bacalhau-js","version":"0.0.11","description":"JavaScript SDK to interact with Bacalhau network.","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":[],"author":{"name":"Daggle"},"license":"ISC","dependencies":{"axios":"^1.4.0","crypto":"^1.0.1","request":"^2.88.2"},"devDependencies":{},"repository":{"type":"git","url":"https://github.com/dagglexyz"},"gitHead":"4f6a39080ac19b7aefc5ca9d1dccebfa153e61fa","_id":"@daggle/bacalhau-js@0.0.11","_nodeVersion":"16.20.2","_npmVersion":"8.19.4","dist":{"integrity":"sha512-Tgk6shvsyBYKLrtlz/asJtGQQyiP9yApvQ5Ruzt1IJj1O0pvcT/Lk0sgFPtJgwuaeyTQ4Xmisziot5LI/nwXYA==","shasum":"f642115b357b49b2f51934efd3fe124dce53bd72","tarball":"https://registry.npmjs.org/@daggle/bacalhau-js/-/bacalhau-js-0.0.11.tgz","fileCount":16,"unpackedSize":16807,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD2TcH6NPejM4zK23CxDm61QA02+bz8q5jc9Hap/XKf9AIgKRkJKrkIco2sWGsZ6SMOOnFSQTx4m2XkbnLvYUWCawM="}]},"_npmUser":{"name":"leostelon","email":"leostelon17@gmail.com"},"directories":{},"maintainers":[{"name":"leostelon","email":"leostelon17@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bacalhau-js_0.0.11_1692673459160_0.6168105590719157"},"_hasShrinkwrap":false},"0.0.12":{"name":"@daggle/bacalhau-js","version":"0.0.12","description":"JavaScript SDK to interact with Bacalhau network.","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":[],"author":{"name":"Daggle"},"license":"ISC","dependencies":{"axios":"^1.4.0","crypto":"^1.0.1","request":"^2.88.2"},"devDependencies":{},"repository":{"type":"git","url":"https://github.com/dagglexyz"},"gitHead":"c3c1a356a0d5b1181a1e24ccf342f82311f667c7","_id":"@daggle/bacalhau-js@0.0.12","_nodeVersion":"16.20.2","_npmVersion":"8.19.4","dist":{"integrity":"sha512-06QP2hvNj3qvGekX5MoqCKyIqzn8bVIJx2ZfvI3eWUepHRuhZNVAXJBrcMVL6EnjvL3okia3lvirl+GODYKBpg==","shasum":"7324dc53c8cf761e7a900999e09860fd142374d6","tarball":"https://registry.npmjs.org/@daggle/bacalhau-js/-/bacalhau-js-0.0.12.tgz","fileCount":16,"unpackedSize":16787,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHoqt0P3UVEwD2yGHSXliMuBe4mwwn2hy8DYIQYucS4rAiEAp7qNwuCLPMZyAj29CJz4my/GsWxtAzH//xEGcA90gHs="}]},"_npmUser":{"name":"leostelon","email":"leostelon17@gmail.com"},"directories":{},"maintainers":[{"name":"leostelon","email":"leostelon17@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bacalhau-js_0.0.12_1693322420700_0.46352532722777084"},"_hasShrinkwrap":false},"0.0.13":{"name":"@daggle/bacalhau-js","version":"0.0.13","description":"JavaScript SDK to interact with Bacalhau network.","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":[],"author":{"name":"Daggle"},"license":"ISC","dependencies":{"axios":"^1.4.0","crypto":"^1.0.1","request":"^2.88.2"},"devDependencies":{},"repository":{"type":"git","url":"https://github.com/dagglexyz"},"gitHead":"c3c1a356a0d5b1181a1e24ccf342f82311f667c7","_id":"@daggle/bacalhau-js@0.0.13","_nodeVersion":"16.20.2","_npmVersion":"8.19.4","dist":{"integrity":"sha512-hKli9aaFeDEYaejjubVR5R3hGGqdG3ouDBV6y+i5/GI2YTi2b7/ZI++24fV3zhnIcv6ekixo1VSe3SUa1FbUyg==","shasum":"c668e0284c8770effd621d6008a51f660ac2a38e","tarball":"https://registry.npmjs.org/@daggle/bacalhau-js/-/bacalhau-js-0.0.13.tgz","fileCount":16,"unpackedSize":16787,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICuRURf8hgqzYQ8emimPkJu5XyWK/cos788pveQj76+EAiEAz1qYXJTKCIkTJfcCvrswFU70jpT/0iuTzbJo/0+3a/A="}]},"_npmUser":{"name":"leostelon","email":"leostelon17@gmail.com"},"directories":{},"maintainers":[{"name":"leostelon","email":"leostelon17@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bacalhau-js_0.0.13_1694231832709_0.21767840562806873"},"_hasShrinkwrap":false}},"time":{"created":"2023-08-18T11:12:37.398Z","0.0.1":"2023-08-18T11:12:37.797Z","modified":"2023-09-09T03:57:13.096Z","0.0.11":"2023-08-22T03:04:19.324Z","0.0.12":"2023-08-29T15:20:20.844Z","0.0.13":"2023-09-09T03:57:12.884Z"},"maintainers":[{"name":"leostelon","email":"leostelon17@gmail.com"}],"description":"JavaScript SDK to interact with Bacalhau network.","keywords":[],"repository":{"type":"git","url":"https://github.com/dagglexyz"},"author":{"name":"Daggle"},"license":"ISC","readme":"\r\n# Bacalhau JS🟨\r\n\r\n\r\n```js\r\nconst { submit } = require('@daggle/bacalhau-js')\r\nconst { Payload } =  require(\"@daggle/bacalhau-js/models\");\r\n\r\nlet data = new Payload({\r\n\tClientID: ...,\r\n\tspec: ...\r\n})\r\n\r\nsubmit(data)\r\n```\r\n[Check examples↗️](https://github.com/dagglexyz/bacalhau-js-example)\r\n\r\n## Installation\r\n\r\nThis is a [Node.js](https://nodejs.org/en/) module available through the [npm registry](https://www.npmjs.com/).\r\n\r\nBefore installing, [download and install Node.js](https://nodejs.org/en/download/). Node.js 0.10 or higher is required.\r\n\r\nIf this is a brand new project, make sure to create a `package.json` first with the [`npm init` command](https://docs.npmjs.com/creating-a-package-json-file).\r\n\r\nInstallation is done using the [`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):\r\n\r\n```console\r\n$ npm install @daggle/bacalhau-js\r\n```\r\n\r\n## Example\r\n```js\r\nconst { submit } =  require(\"@daggle/bacalhau-js\");\r\n\r\nconst {\r\nPayload,\r\nSpec,\r\nPublisherSpec,\r\nStorageSpec,\r\nDeal,\r\nJobSpecDocker,\r\n} =  require(\"@daggle/bacalhau-js/models\");\r\n\r\nasync function submitJob() {\r\n\tlet data = new Payload({\r\n\tClientID: getClientId(),\r\n\tspec: new Spec({\r\n\tdeal: new Deal(),\r\n\tdocker: new JobSpecDocker({\r\n\t\t\timage: \"ubuntu\",\r\n\t\t\tentrypoint: [\"echo\", \"Hello World!\"],\r\n\t\t}),\r\n\t\tengine: \"Docker\",\r\n\t\tpublisher_spec: new PublisherSpec({ type:  \"Estuary\" }),\r\n\t\ttimeout: 1800,\r\n\t\tverifier: \"Noop\",\r\n\t\toutputs: [\r\n\t\t\tnew  StorageSpec({\r\n\t\t\t\tpath: \"/outputs\",\r\n\t\t\t\tstorage_source: \"IPFS\",\r\n\t\t\t\tname: \"outputs\",\r\n\t\t\t}),\r\n\t\t],\r\n\t\t}),\r\n\t});\r\n\r\n\tconst  response = await submit(data);\r\n\tconsole.log(response);\r\n}\r\nsubmitJob()\r\n```\r\n[Check complete example↗️](https://github.com/dagglexyz/bacalhau-js-example)\r\n\r\n## Local Testing\r\n\r\nFollow the below steps to run it locally.\r\n\r\n### Clone repo⚙️\r\n\r\n1. Clone Repo.\r\n\t```console\r\n\t$ git clone https://github.com/dagglexyz/bacalhau-js bacalhau-js\r\n\t```\r\n\t**Change Host**\r\n\tInitialize the SDK by passing in the host URL as parameter.\r\n\t***./src/sdk/config.js***\r\n\t```js\r\n\t...\r\n\t} = require(\"./config\");\r\n\t// Change host here\r\n\tconst  config = initializeSDK(\"http://127.0.0.1:1234\");\r\n\tconst  jobApi = new  JobApi(config);\r\n\t\r\n\tasync  function  submit(data  =  new  Payload()) {\r\n\t...\r\n\t```\r\n2. Create a simple node project\r\n\t```console\r\n\t$ mkdir example-project\r\n\t$ cd example-project\r\n\t$ npm init\r\n\t```\t \r\n3. Install package\r\n\t```console\r\n\t$ npm install ../bacalhau-js\r\n\t```\r\n4. Testing, create a file at root, *index.js*.\r\n\t```js\r\n\tconst { list} =  require(\"@daggle/bacalhau-js\");\r\n\r\n\tasync function listJobs() {\r\n\t\tconst response = await list();\r\n\t\tconsole.log(response.jobs);\r\n\t}\r\n\tlistJobs()\r\n\t```\r\n\r\n## Note⚠️\r\n This is not a  production ready SDK, this repo will be moved to [Bacalhau](https://github.com/bacalhau-project) organization's GitHub and  maintained by [Bacalhau](https://github.com/bacalhau-project) in the future.\r\n","readmeFilename":"README.md"}