{"_id":"@anythread/gsoc","_rev":"3-d73fa18c860fed263f421afbf81c4192","name":"@anythread/gsoc","dist-tags":{"latest":"0.2.2"},"versions":{"0.1.0":{"name":"@anythread/gsoc","version":"0.1.0","keywords":["gsoc","anythread","swarm","decentralized","information-signaling","p2p"],"author":{"name":"Viktor Levente Tóth @nugaon"},"license":"Apache-2.0","_id":"@anythread/gsoc@0.1.0","maintainers":[{"name":"nugaon","email":"toth.viktor.levente@gmail.com"}],"homepage":"https://github.com/anythread/gsoc#readme","bugs":{"url":"https://github.com/anythread/gsoc/issues"},"dist":{"shasum":"117a8bab9f1ad366ea63a4e70ad17f864eda31ab","tarball":"https://registry.npmjs.org/@anythread/gsoc/-/gsoc-0.1.0.tgz","fileCount":29,"integrity":"sha512-hxugjDlb0uFDXlyDPSk3pIO0001l+nX01PcCP2lbmXywK0TNqb9agU827JXBrQmTPZqkdDj/6QkdLFKXR09eSQ==","signatures":[{"sig":"MEUCIDlrvCoPv391SMedw5mbaJewcTtEdGoqUG6xSEeSTQ/dAiEA1QorvmpVltZ36KA/+ji7Q82dUE7kwNgZA1AF6h/6U48=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":116383},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"2fbed56c967b88b62de37a9ef91f5c0e9db063c3","scripts":{"bee":"npx @fairdatasociety/fdp-play start --detach --fresh","dev":"npm run compile -- --watch --env mode=development","lint":"eslint --fix \"src/**/*.ts\" && prettier --write \"src/**/*.ts\"","test":"jest --config=jest.config.ts --runInBand --verbose","compile":"tsc","prepare":"rimraf dist && npm run compile:types && npm run compile","lint:check":"eslint \"src/**/*.ts\" && prettier --check \"src/**/*.ts\"","check:types":"tsc --project tsconfig.json --skipLibCheck","compile:types":"tsc --emitDeclarationOnly --declaration --skipLibCheck"},"_npmUser":{"name":"nugaon","email":"toth.viktor.levente@gmail.com"},"repository":{"url":"git+https://github.com/anythread/gsoc.git","type":"git"},"_npmVersion":"10.8.3","description":"Graffiti Several Owner Chunk implementation on Swarm network","directories":{},"_nodeVersion":"22.9.0","dependencies":{"ws":"^8.18.0","axios":"^1.7.2","elliptic":"^6.5.6","isomorphic-ws":"^5.0.0","@nugaon/bmt-js":"^3.0.2"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","eslint":"^8.57.0","rimraf":"^5.0.7","ts-jest":"^29.2.5","ts-node":"^10.9.2","@types/ws":"^8.5.11","typescript":"^5.6.2","@types/jest":"^29.5.12","@types/elliptic":"^6.4.18","eslint-plugin-jest":"^28.8.3","eslint-config-prettier":"^9.1.0","eslint-plugin-prettier":"^5.1.3","@typescript-eslint/parser":"^8.8.0","eslint-plugin-unused-imports":"^4.1.4","@typescript-eslint/eslint-plugin":"^8.8.0"},"_npmOperationalInternal":{"tmp":"tmp/gsoc_0.1.0_1728911312073_0.9806079804662011","host":"s3://npm-registry-packages"}},"0.2.0":{"name":"@anythread/gsoc","version":"0.2.0","keywords":["gsoc","anythread","swarm","decentralized","information-signaling","p2p"],"author":{"name":"Viktor Levente Tóth @nugaon"},"license":"Apache-2.0","_id":"@anythread/gsoc@0.2.0","maintainers":[{"name":"nugaon","email":"toth.viktor.levente@gmail.com"}],"homepage":"https://github.com/anythread/gsoc#readme","bugs":{"url":"https://github.com/anythread/gsoc/issues"},"dist":{"shasum":"569bce9c123941f9b24e38fd9f96ce6c250a0a93","tarball":"https://registry.npmjs.org/@anythread/gsoc/-/gsoc-0.2.0.tgz","fileCount":29,"integrity":"sha512-0bltLiptTSIMKdG7OTG7v+nBIQB+NCUaerDYwTjRROBI4n5Dq1q3ZYSbKNwmjNb292o6UYtwNGPlI7h05kLcnA==","signatures":[{"sig":"MEUCICzkgCH/vkSFbx2so5A2BZFWSXRG0hUVMjjfkuJVmnuIAiEAuQOQdCm+4/6qoMkQ17yjX18f+P6dwfPDu3P365fWt4I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":118021},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"89829ff4b8477b2f99f400a5866796a5270566cc","scripts":{"bee":"npx @fairdatasociety/fdp-play start --detach --fresh","dev":"npm run compile -- --watch --env mode=development","lint":"eslint --fix \"src/**/*.ts\" && prettier --write \"src/**/*.ts\"","test":"jest --config=jest.config.ts --runInBand --verbose","compile":"tsc","prepare":"rimraf dist && npm run compile:types && npm run compile","lint:check":"eslint \"src/**/*.ts\" && prettier --check \"src/**/*.ts\"","check:types":"tsc --project tsconfig.json --skipLibCheck","compile:types":"tsc --emitDeclarationOnly --declaration --skipLibCheck"},"_npmUser":{"name":"nugaon","email":"toth.viktor.levente@gmail.com"},"repository":{"url":"git+https://github.com/anythread/gsoc.git","type":"git"},"_npmVersion":"10.9.0","description":"Graffiti Several Owner Chunk implementation on Swarm network","directories":{},"_nodeVersion":"22.10.0","dependencies":{"ws":"^8.18.0","axios":"^1.7.2","elliptic":"^6.5.6","isomorphic-ws":"^5.0.0","@nugaon/bmt-js":"^3.0.2"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","eslint":"^8.57.0","rimraf":"^5.0.7","ts-jest":"^29.2.5","ts-node":"^10.9.2","@types/ws":"^8.5.11","typescript":"^5.6.2","@types/jest":"^29.5.12","@types/elliptic":"^6.4.18","eslint-plugin-jest":"^28.8.3","eslint-config-prettier":"^9.1.0","eslint-plugin-prettier":"^5.1.3","@typescript-eslint/parser":"^8.8.0","eslint-plugin-unused-imports":"^4.1.4","@typescript-eslint/eslint-plugin":"^8.8.0"},"_npmOperationalInternal":{"tmp":"tmp/gsoc_0.2.0_1729253908257_0.4323764796022376","host":"s3://npm-registry-packages"}},"0.2.1":{"name":"@anythread/gsoc","version":"0.2.1","keywords":["gsoc","anythread","swarm","decentralized","information-signaling","p2p"],"author":{"name":"Viktor Levente Tóth @nugaon"},"license":"Apache-2.0","_id":"@anythread/gsoc@0.2.1","maintainers":[{"name":"nugaon","email":"toth.viktor.levente@gmail.com"}],"homepage":"https://github.com/anythread/gsoc#readme","bugs":{"url":"https://github.com/anythread/gsoc/issues"},"dist":{"shasum":"0b3fb53e197e162f24f6d52760e598cb8a609e08","tarball":"https://registry.npmjs.org/@anythread/gsoc/-/gsoc-0.2.1.tgz","fileCount":29,"integrity":"sha512-zgo9C6qjJGkEa1YiIpPZPA9+oQuFDR9JOoiN5MEj+WNcNoTMG1TdYRshhQKi2UY+bcswaUmi+b646H+Zmx3Zow==","signatures":[{"sig":"MEYCIQDKIn8iLYs0KFrsRduqNrGtXZSHqM53SLCYuzWYXf47kwIhAJ1yBBUvSmVbo8oKXIbd9ovjRggX3mXkMmfx6eaaW/j1","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":118481},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"608705949910910fee94d1fcca03036fb6a20201","scripts":{"bee":"npx @fairdatasociety/fdp-play start --detach --fresh","dev":"npm run compile -- --watch --env mode=development","lint":"eslint --fix \"src/**/*.ts\" && prettier --write \"src/**/*.ts\"","test":"jest --config=jest.config.ts --runInBand --verbose","compile":"tsc","prepare":"rimraf dist && npm run compile:types && npm run compile","lint:check":"eslint \"src/**/*.ts\" && prettier --check \"src/**/*.ts\"","check:types":"tsc --project tsconfig.json --skipLibCheck","compile:types":"tsc --emitDeclarationOnly --declaration --skipLibCheck"},"_npmUser":{"name":"nugaon","email":"toth.viktor.levente@gmail.com"},"repository":{"url":"git+https://github.com/anythread/gsoc.git","type":"git"},"_npmVersion":"10.9.0","description":"Graffiti Several Owner Chunk implementation on Swarm network","directories":{},"_nodeVersion":"22.10.0","dependencies":{"ws":"^8.18.0","axios":"^1.7.2","elliptic":"^6.5.6","isomorphic-ws":"^5.0.0","@nugaon/bmt-js":"^3.0.2"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","eslint":"^8.57.0","rimraf":"^5.0.7","ts-jest":"^29.2.5","ts-node":"^10.9.2","@types/ws":"^8.5.11","typescript":"^5.6.2","@types/jest":"^29.5.12","@types/elliptic":"^6.4.18","eslint-plugin-jest":"^28.8.3","eslint-config-prettier":"^9.1.0","eslint-plugin-prettier":"^5.1.3","@typescript-eslint/parser":"^8.8.0","eslint-plugin-unused-imports":"^4.1.4","@typescript-eslint/eslint-plugin":"^8.8.0"},"_npmOperationalInternal":{"tmp":"tmp/gsoc_0.2.1_1729257710948_0.8710713353598869","host":"s3://npm-registry-packages"}},"0.2.2":{"name":"@anythread/gsoc","version":"0.2.2","description":"Graffiti Several Owner Chunk implementation on Swarm network","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"prepare":"rimraf dist && npm run compile:types && npm run compile","compile":"tsc","compile:types":"tsc --emitDeclarationOnly --declaration --skipLibCheck","dev":"npm run compile -- --watch --env mode=development","lint":"eslint --fix \"src/**/*.ts\" && prettier --write \"src/**/*.ts\"","lint:check":"eslint \"src/**/*.ts\" && prettier --check \"src/**/*.ts\"","check:types":"tsc --project tsconfig.json --skipLibCheck","test":"jest --config=jest.config.ts --runInBand --verbose","bee":"npx @fairdatasociety/fdp-play start --detach --fresh"},"keywords":["gsoc","anythread","swarm","decentralized","information-signaling","p2p"],"author":{"name":"Viktor Levente Tóth @nugaon"},"license":"Apache-2.0","bugs":{"url":"https://github.com/anythread/gsoc/issues"},"homepage":"https://github.com/anythread/gsoc#readme","repository":{"type":"git","url":"git+https://github.com/anythread/gsoc.git"},"dependencies":{"@nugaon/bmt-js":"^3.0.2","axios":"^1.7.2","elliptic":"^6.5.6","isomorphic-ws":"^5.0.0","ws":"^8.18.0"},"devDependencies":{"@types/elliptic":"^6.4.18","@types/jest":"^29.5.12","@types/ws":"^8.5.11","@typescript-eslint/eslint-plugin":"^8.8.0","@typescript-eslint/parser":"^8.8.0","eslint":"^8.57.0","eslint-config-prettier":"^9.1.0","eslint-plugin-jest":"^28.8.3","eslint-plugin-prettier":"^5.1.3","eslint-plugin-unused-imports":"^4.1.4","jest":"^29.7.0","rimraf":"^5.0.7","ts-jest":"^29.2.5","ts-node":"^10.9.2","typescript":"^5.6.2"},"_id":"@anythread/gsoc@0.2.2","gitHead":"31828411e300565f641b88db5191f7048e25ea34","_nodeVersion":"22.10.0","_npmVersion":"10.9.0","dist":{"integrity":"sha512-i68GxSUylfev9qUepapuaI7DPA/yC+JN1TqDPsi6/iITFFpfUPqS6+f+REajHgBna6La0nQvyIM3EHeKn5c8eA==","shasum":"16c06e8f5a50784a276f10b22044d74e2c3492b1","tarball":"https://registry.npmjs.org/@anythread/gsoc/-/gsoc-0.2.2.tgz","fileCount":29,"unpackedSize":118705,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBua5NLUf9BFpoPXHsL8EzUp2IAoDQIn4oB1AS4/c9K3AiEA1Xtlvr4xnK9xjphjZbzI6ZBtFZxLo2Q5c6lJbS9dUls="}]},"_npmUser":{"name":"nugaon","email":"toth.viktor.levente@gmail.com"},"directories":{},"maintainers":[{"name":"nugaon","email":"toth.viktor.levente@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/gsoc_0.2.2_1729258258993_0.6841608034578444"},"_hasShrinkwrap":false}},"time":{"created":"2024-10-14T13:08:31.962Z","modified":"2024-10-18T13:30:59.458Z","0.1.0":"2024-10-14T13:08:32.289Z","0.2.0":"2024-10-18T12:18:28.460Z","0.2.1":"2024-10-18T13:21:51.138Z","0.2.2":"2024-10-18T13:30:59.267Z"},"bugs":{"url":"https://github.com/anythread/gsoc/issues"},"author":{"name":"Viktor Levente Tóth @nugaon"},"license":"Apache-2.0","homepage":"https://github.com/anythread/gsoc#readme","keywords":["gsoc","anythread","swarm","decentralized","information-signaling","p2p"],"repository":{"type":"git","url":"git+https://github.com/anythread/gsoc.git"},"description":"Graffiti Several Owner Chunk implementation on Swarm network","maintainers":[{"name":"nugaon","email":"toth.viktor.levente@gmail.com"}],"readme":"# GSOC\n\nThis library facilitates to use [Graffiti Several Owner Chunks (GSOC)](https://github.com/nugaon/SWIPs/blob/graffiti-soc/SWIPs/swip-draft_graffiti-soc.md) on [Ethereum Swarm](https://www.ethswarm.org/).\n\nLeveraging its features, any data can be referenced to other related data without maintaing any external registry or running service.\n\n** WARNING! This project is in the experimental phase! **\n\nIt is intended to be an upgraded version of the predecessor Graffiti Feed based [zerodash library](https://github.com/anythread/zerodash).\nMissing feature is the reading part though the communication is possible by running storer node and subscribe to incoming infromation signals.\n\n# Install\n\n** NPM release will be available later, [compile](#Compilation) the project instead! **\n```sh\nnpm install @anythread/gsoc --save\n```\n\n# Usage\n\nThe library provides `InformationSignal` class that reads/writes GSOC according to the consensus and other configuration parameters.\n\nThe consensus consists of an arbitrary `id` and an assert function that validates the handled records in the GSOC address space.\n```ts\nconst id = 'SampleDapp:v1'\n\nexport interface SampleDappRecord {\n  /** text of the message */\n  text: string\n  /** creation time of the comment */\n  timestamp: number\n}\n\nfunction assertRecord(value: unknown): asserts value is SampleDappRecord {\n  if (\n    value !== null &&\n    typeof value === 'object' &&\n    Object.keys(value).includes('text') &&\n    Object.keys(value).includes('timestamp')\n  ) {\n    return\n  }\n  \n  throw new Error('The given value is not a valid personal storage record')\n}\n```\n\nWith that, the rules have been created for kademlia information signaling on any data.\n\n## Information Signal\n\nInformation Signal class facilitates GSOC data reading based on the passed consensus rules.\n\n```ts\nimport { InformationSignal } from '@anythread/gsoc'\n\nbeeUrl = 'http://localhost:1633' // Bee API URL to connect p2p storage network\npostage = '0000000000000000000000000000000000000000000000000000000000000000' // for write operations, the Postage Batch ID (64 length hex) or a Postage Stamp (226 length hex) must be set \nresourceId = 'demo' // any string/content hash that represents the resource to which the Personal Storage record will be associated.\n\n// initialize object that will read and write the GSOC according to the passed consensus/configuration\ninformationSignal = new InformationSignal(beeUrl, {\n  postage,\n  consensus: {\n    id,\n    assertRecord,\n  },\n})\n\n// it is also possible to mine the resourceId to the desired Bee node to ensure they will get the message as soon as possible on the forwarding Kademlia network\ntargetBeeOverlayAddress = 'b0baf37700000000000000000000000000000000000000000000000000000000'\n{ resourceId } = informationSignal.mine(targetBeeOverlayAddress, 16)\n\n// subscribe to incoming topics on the receiver node\n// this will immediately invoge `onMessage` and `onError` function if the message arrives to the target neighborhood of the Kademlia network.\ncancelSub = informationSignal.subscribe({onMessage: msg => console.log('my-life-event', msg), onError: console.log}, resourceId)\n\n// write GSOC record that satisfies the message format with the `write` method.\nuploadedSoc = await informationSignal.write({ text: 'Hello there!', timestamp: 1721989685349 }, resourceId)\n```\n\n# Compilation\n\nIn order to compile code run\n\n```sh\nnpm run compile\n```\n\nYou can find the resulted code under the `dist` folder.\n\nFor types compilation, run\n\n```sh\nnpm run compile:types\n```\n\n# Testing\n\nThe testing needs running Bee client node for integration testing.\nYou should set `BEE_POSTAGE` and `BEE_POSTAGE_2` environment variable with valid Postage batch IDs.\n\nIn order to test on different node than `http://localhost:1633` and `http://localhost:11633`, set `BEE_API_URL` and `BEE_PEER_API_URL` environment variable, respectively.\n\nTo run test execute\n\n```sh\nnpm run test\n```\n","readmeFilename":"README.md"}