{"id":19369172,"url":"https://github.com/joystream/membership-faucet","last_synced_at":"2025-04-23T15:31:19.012Z","repository":{"id":40414398,"uuid":"348631501","full_name":"Joystream/membership-faucet","owner":"Joystream","description":null,"archived":false,"fork":false,"pushed_at":"2023-11-01T08:14:45.000Z","size":1071,"stargazers_count":1,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-02T16:53:46.839Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/Joystream.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}},"created_at":"2021-03-17T08:21:28.000Z","updated_at":"2024-10-16T17:13:26.000Z","dependencies_parsed_at":"2023-11-01T09:28:55.023Z","dependency_job_id":null,"html_url":"https://github.com/Joystream/membership-faucet","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Joystream%2Fmembership-faucet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Joystream%2Fmembership-faucet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Joystream%2Fmembership-faucet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Joystream%2Fmembership-faucet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Joystream","download_url":"https://codeload.github.com/Joystream/membership-faucet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250460362,"owners_count":21434239,"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":[],"created_at":"2024-11-10T08:09:56.061Z","updated_at":"2025-04-23T15:31:18.703Z","avatar_url":"https://github.com/Joystream.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Membership Faucet\n\nMembership on-boarding service for Joystream network.\n\n## Install\n\nClone the repo, then run:\n\n```\n$ npm install\n```\n\nto install dependencies.\n\n## Run\nAdd your config variables to `env.example` and rename it to `.env` and then run:\n\n```\n$ npm run build\n$ npm run start\n```\n\nWill build and start the server.\n\n## API\n\n### `POST -H Authorization: Bearer {CAPTCHA_BYPASS_KEY} /register`\nSend a JSON in the request body with an optional Bearer Authentication (if request wants to bypass captcha verification):\n\n```\n{\n    \"account\": \"5HGjWAeFDfFCWPsjFQdVV2Msvz2XtMktvgocEZcCj68kUMaw\",\n    \"handle\": \"myhandle\",\n    \"avatar\": \"https://example.com/avatar.png\"\n}\n```\n\nOn success expect a JSON response:\n\n```\n{\n    \"memberId\": 21,\n    \"block\": 1337,\n    \"blockHash\": \"0xb3f394043b4a0dde625a630486f6e64388f124aa9ba4f7f23d54d4fc5a94ea82\"\n}\n```\n\nOn error expect a JSON response:\n```\n{\n    \"error\": \"ErrorType\"\n}\n```\n\n### `GET /status`\n\nSend a GET request to the /status endpoint to get an overview of the readiness of the service.\n- If the joystream-node used by the service is fully synced\n- If the balance of the inviting/gifting account has sufficient balance for atleast one member.\n\n\n## Configuration\n\nThe faucet service is configurable through various environment variables (either in the shell environment or in an `.env` file)\n\n\n| Variable | Default if not specified | Description | Required |\n|---------|------|---------|----| \n| INVITER_KEY | //Alice | The Substrate URI (SURI) representation of the private key corresponding to the account that will gift new membership. The should have sufficient funds at all times or registration will fail. | yes |\n| PORT | 3002 | The web service will bind to `localhost:PORT` | no |\n| PROVIDER |  | Websocket Url to a joystream-node eg. `ws://localhost:9944/` It is recommended to use fully qualified url to your host if the joystream-node is not a docker service in the same docker-compose network. | yes |\n| BALANCE_CREDIT | 0 | The amount of funds to credit gifted member in base units | no |\n| BALANCE_LOCKED | 0 | The portion of the credited funds that are locked in base units | no |\n| SENDGRID_API_KEY | | The API key for [SendGrid](sendgrid.com) account used to send alert emails | no |\nALERT_FROM_EMAIL | | email address the alert emails will be be sent from | yes if SENDGRID_API_KEY is configured |\nALERT_TO_EMAIL | | comma separated list of destination email addresses to send alerts to | yes if SENDGRID_API_KEY is configured |\n| ENABLE_API_THROTTLING | false | If API rate limit will be applied | no |\n| GLOBAL_API_LIMIT_INTERVAL_HOURS | 1 | Interval in hours for which limit is applied | no |\n| GLOBAL_API_LIMIT_MAX_IN_INTERVAL| 10 | The max number of registration allowed in the interval defined | no |\n| PER_IP_API_LIMIT_INTERVAL_HOURS | 48 | The interval in hours for which limit is applied to a specific IP address | no |\n| PER_IP_API_LIMIT_MAX_IN_INTERVAL | 1 | The max number of registration allowed from IP address in the defined interval | no|\nHCAPTCHA_SECRET | | The [hCaptcha](https://www.hcaptcha.com/) secret to use for the deployed service | no but recommended |\n\n\n## Running with docker\n\n### Docker build\n\n```\ndocker build . --tag joystream/faucet\n```\n\n### Docker-compose\n\ncopy the `env.example` to `.env` and configure the variables.\nTo see what the final configuration will look like:\n\n```\ndocker compose convert\n```\n\nIf you are satisfied, star the service with:\n\n```\ndocker compose up -d\n```\n\n### Setup Reverse proxy\nThe webserice will be listening on localhost on the port you configured in your .env file.\nTo make the service available publicly you will need to setup a reverse proxy with an ssl certificate.\nNginx and caddy are good options. Example usage of caddy with [docker/docker-compose stack](https://hub.docker.com/_/caddy)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoystream%2Fmembership-faucet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoystream%2Fmembership-faucet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoystream%2Fmembership-faucet/lists"}