{"_id":"@_koi/logs","_rev":"4-75ec5f4352b240130f3f367a63c8d7e1","name":"@_koi/logs","dist-tags":{"latest":"1.0.5-beta"},"versions":{"1.0.5-beta":{"name":"@_koi/logs","version":"1.0.5-beta","description":"Koi is a network designed to reward and help to coordinate the creation of public data resources. Install the SDK to register your gateway to the network and begin receiving traffic awards when you contribute logging data.","main":"dist/index.js","scripts":{"lint":"eslint *.ts","build":"rimraf dist && tsc && rollup -c rollup.config.js","test":"npm run build && node test/test.js"},"author":{"name":"Koi Labs Inc."},"license":"ISC","dependencies":{"@_koi/sdk":"^2.1.16-beta.27","@rollup/plugin-json":"^4.1.0","@rollup/plugin-typescript":"^8.2.0","@types/express":"^4.17.11","@types/morgan":"^1.9.2","@types/node-cron":"^2.0.3","@types/shortid":"0.0.29","@types/tmp":"^0.2.0","crypto-random-string":"^3.3.1","express":"^4.17.1","fs":"^0.0.1-security","js-sha256":"^0.9.0","mockdate":"^3.0.5","moment":"^2.29.1","morgan":"^1.10.0","node-cron":"^2.0.3","path":"^0.12.7","shortid":"^2.2.16","temp":"^0.9.4","tmp":"^0.2.1","tslib":"^2.1.0","typescript":"^4.2.3"},"devDependencies":{"@types/node":"^14.14.28","rollup":"^2.41.4"},"directories":{"test":"test"},"repository":{"type":"git","url":"git+https://github.com/open-koi/koi-log.git"},"bugs":{"url":"https://github.com/open-koi/koi-log/issues"},"homepage":"https://github.com/open-koi/koi-log#readme","gitHead":"aa1fcb23eb4cca6c00d140518bb39f51dff09b57","_id":"@_koi/logs@1.0.5-beta","_nodeVersion":"14.17.4","_npmVersion":"6.14.14","dist":{"integrity":"sha512-91yfeF/hnqMN2Wo5w5TZ9As9swIr5U5VHjJAZoE3SfUe6ZqewJ7RyOwtt5Khu2lXKQV+onPYkclGJFU5KsdxEQ==","shasum":"8cc58ced2b4e5fec5bfbce4397e08fcdfa6412d4","tarball":"https://registry.npmjs.org/@_koi/logs/-/logs-1.0.5-beta.tgz","fileCount":18,"unpackedSize":1598015,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh1vrSCRA9TVsSAnZWagAAHEQP/j5QszCzruFxTWI79Mpb\nGvuofXKiyGpSedjGvcxpkNYwAv4MybpnBeM0Q8urvpdwCv99lYVpY5mtyIAN\nEtIB9jCOPPPtbZ8LYnbGPmQd8s67jtkSW1YlVBPqm9BP7SnYGMOnmmkyWtNu\nYe7dD6Xd7HOu4aTb8BSfPjA0Tai0bv9+09rgkDh0UBku6OT0LKNibGfS+8q1\n8PfMlU68V0twfeKcph7bvfyFuziT3i5QSGmrutrhMAp+taQ/NnosAMhleqWg\nrqOQxuuCNdlmlqRuIkX/IBMRs0+88zQYIqcxtmCbcGqEnLQakwNu2+gcZo5g\nbe/YZSYfpUI7C7hVJWSMDY+bDXhvheCOHiwXxPdoYzwZxKOmdLWRYZh04ZIX\nK4NAeRzsVCqvJb5NOXOYMHeW11Al3oiqtiX1C+EcpB+hJTkQa6gVDK5W2NFb\n4tkyhJSl1T/0XMj0le/I0xuNuwAb8FhA/lDLtR9Ehj+pSvuBxA9ycyDdw7/3\n+UHSMaeTJ9rI6cJo+W3fInGkR3mJQH1nVwFfhunazWuxX8uST/kiql/fAvCz\nUy0lzUUyfC7WBZyUtuWB8RK42EXkhFn6WtE/qmwi5EO/CSDW4fvmqRTD8gEL\nYT4M7iJDvdAZ8DUcX8E4cjdkIMWJbdye39b+kzQa3XRwq3PvxeJ4HInjH9hl\nAyYF\r\n=Ba4r\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCal6eFHreOtk9g1NV6tgptHSEszhMzQxbkyyp9ou3D5QIgb1jLsZLZmA3qngtCNTksYUFn2Mcuc3PezO8bRb8hH3E="}]},"_npmUser":{"name":"salmankoi","email":"salman@openkoi.com"},"maintainers":[{"name":"koi-fish","email":"al@openkoi.com"},{"name":"makdaa","email":"makda@openkoi.com"},{"name":"ghazanferanwar","email":"s.ghazanfer@openkoi.com"},{"name":"salmankoi","email":"salman@openkoi.com"},{"name":"koii-andre","email":"andre@koii.network"},{"name":"koiiali","email":"ahmad@koii.network"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/logs_1.0.5-beta_1628206223474_0.25715242358567436"},"_hasShrinkwrap":false}},"time":{"created":"2021-08-05T23:30:23.405Z","1.0.5-beta":"2021-08-05T23:30:23.737Z","modified":"2022-04-04T10:51:30.607Z"},"maintainers":[{"email":"abel@koii.network","name":"abel_koii"},{"email":"josh@koii.network","name":"josh-koii"},{"email":"al@openkoi.com","name":"koi-fish"},{"email":"makda@openkoi.com","name":"makdaa"},{"email":"s.ghazanfer@openkoi.com","name":"ghazanferanwar"},{"email":"salman@openkoi.com","name":"salmankoi"},{"email":"andre@koii.network","name":"koii-andre"},{"email":"ahmad@koii.network","name":"koiiali"}],"description":"Koi is a network designed to reward and help to coordinate the creation of public data resources. Install the SDK to register your gateway to the network and begin receiving traffic awards when you contribute logging data.","homepage":"https://github.com/open-koi/koi-log#readme","repository":{"type":"git","url":"git+https://github.com/open-koi/koi-log.git"},"author":{"name":"Koi Labs Inc."},"bugs":{"url":"https://github.com/open-koi/koi-log/issues"},"license":"ISC","readme":"NOTE: This project is a work in progress. Currently testing is in progress on the Arweave Gateway Network, but this repo represents the current state of the work there for reference. \n\n# Koi Logs SDK\nKoi is a network designed to reward and help to coordinate the creation of public data resources. Install the SDK to register your gateway to the network and begin receiving traffic awards when you contribute logging data.\n\n## Implementation\nKoi is installed as a feature of any gateway or software library to track traffic reliably and provide access to it when audited by another node. \n\n### Installation\nKoi gateway logging can be implemented for express servers by adding the necessary routes and middleware shown below:\n\n```\n \n\nvar app = new express();\n\napp.get(\"/logs/\", async function (req, res) {\n  return await koiLogger.koiLogsHelper(req, res)\n});\napp.get(\"/logs/raw/\", async function(req, res) { \n  return await koiLogger.koiRawLogsHelper(req, res)\n});\n\napp.use(koiLogger.logger);\n\napp.get(\"/info/\", async function (req, res) {\n  return res.status(200).send(\"<html><i>Welcome to the fish pond.</i><html>\");\n})\n\n```\n\nNow, any traffic on your gateway will automatically be obfuscated and provided to the koi network, and you'll earn some koi. \n\n### Permissions\nPlease note: your /tmp/ directory must be writeable to your runtime user to ensure that the logs can be written properly. \n\n### Submitting Proofs\nIf you are building a tool that will interact with Koi gateways, you can submit two headers to opt into verifiable attention monitoring. This process is designed to be pseudonymous, but ensures the long term viability of attention tracking by substantiating raw traffic volume with bellweather data which can identify when there is a sufficiently large abnormality to represent possibly falsified traffic. \n\nProofs can be submitted by attaching two additional HTTP headers to all requests to gateways:\nKOI => \n`< base 64 sha 256 hash of id metadata + timestamp + requested resource, with difficulty below network limit >`\nKOI_ID => \n`< Any valid arweave address >`\n\nThe proof data is stored in the standard log files, and provides an added layer of security and verification. Participating members of the community, in turn, receive Koi tokens proportionate to their value as a bellweather. \n\n## Log Files & Clearing Cycle\nEach day, log files are updated over a 24 hour period, and subsequently released for public consumption via a /logs endpoint. \n\n## Example \nCheck run `yarn test` to start.\n","readmeFilename":"readme.md"}