{"id":21399355,"url":"https://github.com/streamr-dev/data-union-admin-tools","last_synced_at":"2026-04-22T21:33:30.045Z","repository":{"id":39187781,"uuid":"238513461","full_name":"streamr-dev/data-union-admin-tools","owner":"streamr-dev","description":"A selection of command-line tools for administering Data Unions","archived":false,"fork":false,"pushed_at":"2023-01-08T00:21:18.000Z","size":935,"stargazers_count":1,"open_issues_count":12,"forks_count":1,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-06-30T06:08:45.817Z","etag":null,"topics":["data-unions","ethereum","streamr","tools"],"latest_commit_sha":null,"homepage":"https://dataunions.org","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/streamr-dev.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}},"created_at":"2020-02-05T17:54:11.000Z","updated_at":"2022-10-18T20:55:46.000Z","dependencies_parsed_at":"2023-02-08T03:46:08.836Z","dependency_job_id":null,"html_url":"https://github.com/streamr-dev/data-union-admin-tools","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/streamr-dev/data-union-admin-tools","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streamr-dev%2Fdata-union-admin-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streamr-dev%2Fdata-union-admin-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streamr-dev%2Fdata-union-admin-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streamr-dev%2Fdata-union-admin-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/streamr-dev","download_url":"https://codeload.github.com/streamr-dev/data-union-admin-tools/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streamr-dev%2Fdata-union-admin-tools/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263184965,"owners_count":23427121,"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":["data-unions","ethereum","streamr","tools"],"created_at":"2024-11-22T15:14:11.831Z","updated_at":"2026-04-22T21:33:25.011Z","avatar_url":"https://github.com/streamr-dev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## data-union-admin-tools\n\n![CI badge](https://github.com/streamr-dev/data-union-admin-tools/actions/workflows/nodejs.yml/badge.svg)\n\n**UTILITIES IN THIS REPOSITORY SHOULD BE CONSIDERED EXPERIMENTAL. USE AT YOUR OWN RISK, PLEASE KNOW WHAT YOU'RE DOING. [Contact us in Discord](https://discord.com/invite/gZAm8P7hK8) if you're unsure.**\n\nThis repository contains a selection of command-line tools for administering Data Unions on Streamr:\n\n* [autokick](#binautokickjs)\n* [signed withdraw server](#signed-withdraw-server)\n\n### Installation\n\nTo use the tools, you should have node.js and `git` installed as prerequisites.\n\n* Clone the repo: `git clone git@github.com:streamr-dev/data-union-admin-tools.git`\n* `cd data-union-admin-tools`\n* Install dependencies: `npm ci`\n\n### bin/autokick.js\n\n**WARNING: this tool depends on large historical resends, which are currently unreliable. Do NOT run the util without the `--dry-run` flag. You have been warned!**\n\nA utility to automatically remove non-contributing members from your data union.\n\nShips with a simple inactivity logic, which kicks users who haven't sent any data within the inspected time window. More elaborate logic can be plugged in.\n\nTo get help, just run `bin/autokick.js` without any arguments:\n\n```\nUsage: autokick.js --stream [streamId] --contract-address [0x...] ...\n\nOptions:\n  --help                   Show help                                   [boolean]\n  --version                Show version number                         [boolean]\n  --stream                 ID of your content stream (to which members produce\n                           data). Give this option multiple times to cover\n                           multiple streams.                  [array] [required]\n  --contract-address       The address of the data union smart contract.\n                                                             [string] [required]\n  --window-hours           The time window during which to observe messages in\n                           the content stream(s).         [number] [default: 48]\n  --kick-logic             Loads the desired kick logic from src/autokick\n                           folder. The default 'inactivity' logic simply kicks\n                           members who haven't published any data during the\n                           inspected period.    [string] [default: \"inactivity\"]\n  --batch                  Does a resend on the stream, runs the kick logic, and\n                           quits. No continuous monitoring.\n                                                      [boolean] [default: false]\n  --kick-interval-minutes  How often, in minutes, to check for kickable members\n                           and send part messages to kick them. Has no effect in\n                           --batch mode.                  [number] [default: 10]\n  --api-key                API key of a user that has publish permission to the\n                           join/part stream. Either --api-key or --private-key\n                           must be given.\n  --private-key            Ethereum private key of a user that has publish\n                           permission to the join/part stream. Either api-key or\n                           private-key must be given.\n  --streamr-url            The Streamr websocket API URL. By default, uses the\n                           default value in the Streamr JS SDK\n                           (wss://streamr.network/api/v1/ws)\n  --streamr-rest-url       The Streamr REST API URL. By default, uses the\n                           default value in the Streamr JS SDK\n                           (https://streamr.network/api/v1)\n  --order-messages         Set the orderMessages Streamr client option to true,\n                           activating message ordering and gapfill.\n                                                      [boolean] [default: false]\n  --dry-run                If this option is given, the script doesn't really\n                           kick members from the data union, but instead logs\n                           kicks to the console.      [boolean] [default: false]\n\nMissing required arguments: stream, contract-address\n```\n\nTo try it out with default settings and in `--dry-run` mode to avoid accidents, try:\n\n```\nbin/autokick.js --stream [streamId] --contract-address [address] --private-key [key] --dry-run\n```\n\nWhere the arguments are:\n\n* `--stream [streamId]`: The id of the stream your users are sending signed messages to. You can give the `--stream` option multiple times if there are multiple streams related to your data union.\n* `--contract-address [address]`: The Ethereum address of your data union smart contract.\n* `--private-key [key]`: An Ethereum private key for an address that has been granted permissions to:\n  * Read data in all the streams given with `--stream`, and\n  * Write to the join/part stream of your data union (not required in `--dry-run` mode, as you're not really kicking anybody)\n\n### Signed withdraw server\n\nOpens a HTTP port and executes the signed withdrawals from given data unions. This way the data union member doesn't need to pay for the gas when the withdrawn tokens are transported to mainnet over the Asyncronous Message-passing Bridge (AMB).\n\nThe data union member only signs a permission to withdraw their tokens into a given (maybe 3rd party) address. The signature is created using StreamrClient:\n```javascript\nconst client = new StreamrClient({\n    auth: { privateKey },\n    dataUnion,\n})\nconst signature = await client.signWithdrawTo(recipientAddress)\n```\n\nPass arguments as environment variables:\n\n```$xslt\nUsage: SERVER_PRIVATE_KEY=0x1234... DATA_UNION_ADDRESS=0x1234... bin/start-signed-withdraw-server.js\n\nSERVER_PRIVATE_KEY is the Ethereum key that will be used for paying the transaction fees\n                   so the account must have ETH in it\n\nDATA_UNION_ADDRESS is the Ethereum address or comma-separated list of Ethereum addresses,\n                   of the data union whose withdraws are handled by this server (default: handle all)\n\nPORT is where the HTTP server listens for incoming connections (default: 3000)\n\nETHEREUM_URL is the Ethereum (mainnet) node used for sending the transactions (default: ethers.js)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstreamr-dev%2Fdata-union-admin-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstreamr-dev%2Fdata-union-admin-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstreamr-dev%2Fdata-union-admin-tools/lists"}