https://github.com/ethersphere/onboarding-faucet
https://github.com/ethersphere/onboarding-faucet
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ethersphere/onboarding-faucet
- Owner: ethersphere
- License: bsd-3-clause
- Created: 2022-03-23T15:13:17.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-03-06T02:14:52.000Z (over 3 years ago)
- Last Synced: 2025-05-03T19:39:25.817Z (about 1 year ago)
- Language: TypeScript
- Size: 10.6 MB
- Stars: 3
- Watchers: 4
- Forks: 2
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# onboarding-faucet
[](https://app.fossa.com/projects/git%2Bgithub.com%2Fethersphere%2Fonboarding-faucet?ref=badge_shield)
[](https://swarm.ethereum.org/)
[](https://github.com/feross/standard)


This faucet aims to create transactions that can be used for the overlay address verification of
[bee](https://github.com/ethersphere/bee) nodes.
## Install
```sh
git clone https://github.com/ethersphere/onboarding-faucet.git
cd onboarding-faucet
```
## Usage
### Example
#### No funding
```sh
export PRIVATE_KEY=...
npm run start
```
#### Funding
```sh
export PRIVATE_KEY=...
export FUND_BZZ_AMOUNT=1000000000000000 # 0.1 BZZ
export FUND_NATIVE_AMOUNT=10000000000000000 # 0.01 ETH
npm run start
```
### Environment variables
| Name | Default Value | Description |
| ------------------ | -------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| LOG_LEVEL | `info` | Log level (`critical`, `error`, `warn`, `info`, `verbose`, `debug`). |
| RPC_URL | `https://rpc.gnosischain.com` | URL of the RPC provider. |
| PRIVATE_KEY | `undefined` | Private key used to create transactions and send tokens. |
| PORT | `3000` | Port used by the faucet's http server. |
| HOSTNAME | `localhost` | Hostname on which the faucet's http server listens to. |
| BZZ_ADDRESS | `0xdBF3Ea6F5beE45c02255B2c26a16F300502F68da` | Address of the BZZ contract. |
| FUND_BZZ_AMOUNT | `0` | Amount of BZZ to send on the funding route. |
| FUND_NATIVE_AMOUNT | `0` | Amount of native tokens (`ETH`, `xDAI`) to send on the funding route. |
| AUTH_TOKEN | `undefined` | Authentication secret, disabled if not set (this secret is checked in the request header `authorization`). |
## API
| Endpoint | Response code | Response text |
| ----------------------------------- | ------------- | --------------------------------------------------------------------------------------------------------- |
| `POST /faucet/overlay/:address` | `200` | `{ blockHash: 'string', transactionHash: 'string', nextBlockHash: 'string', nextBlockHashBee: 'string' }` |
| | `400` | `{ error: 'invalid address' }` |
| | `500` | `Internal Server Error` |
| `POST /faucet/fund/bzz/:address` | `200` | `require("@ethersproject/abstract-provider").TransactionReceipt` |
| | `400` | `{ error: 'invalid address' }` |
| | `500` | `Internal Server Error` |
| | `503` | `{ error: 'amount not configured' }` |
| `POST /faucet/fund/native/:address` | `200` | `require("@ethersproject/abstract-provider").TransactionReceipt` |
| | `400` | `{ error: 'invalid address' }` |
| | `500` | `Internal Server Error` |
| | `503` | `{ error: 'amount not configured' }` |
## Contribute
There are some ways you can make this module better:
- Consult our [open issues](https://github.com/ethersphere/onboarding-faucet/issues) and take on one of them
- Join us in our [Discord chat](https://discord.gg/wdghaQsGq5) in the #develop-on-swarm channel if you have questions or
want to give feedback
## Maintainers
- [filoozom](https://github.com/filoozom)
- [Cafe137](https://github.com/Cafe137)
## License
[BSD-3-Clause](./LICENSE)
[](https://app.fossa.com/projects/git%2Bgithub.com%2Fethersphere%2Fonboarding-faucet?ref=badge_large)