github.com/electroneum/electroneum-sc@v0.0.0-20230105223411-3bc1d078281e/cmd/faucet/README.md (about)

     1  # Faucet
     2  
     3  The `faucet` is a simplistic web application with the goal of distributing small amounts of Electroneum in private and test networks.
     4  
     5  Users need to post their Electroneum addresses to fund in a Twitter status update or public Facebook post and share the link to the faucet. The faucet will in turn deduplicate user requests and send the Electroneum. After a funding round, the faucet prevents the same user requesting again for a pre-configured amount of time, proportional to the amount of Ether requested.
     6  
     7  ## Operation
     8  
     9  The `faucet` is a single binary app (everything included) with all configurations set via command line flags and a few files.
    10  
    11  First thing's first, the `faucet` needs to connect to an Electroneum network, for which it needs the necessary genesis and network infos. Each of the following flags must be set:
    12  
    13  - `-genesis` is a path to a file containin the network `genesis.json`. or using:
    14  - `-testnet` with the faucet with testnet network config
    15  - `-network` is the devp2p network id used during connection
    16  - `-bootnodes` is a list of `enode://` ids to join the network through
    17  
    18  The `faucet` will use the `les` protocol to join the configured Electroneum network and will store its data in `$HOME/.faucet` (currently not configurable).
    19  
    20  ## Funding
    21  
    22  To be able to distribute funds, the `faucet` needs access to an already funded Electroneum account. This can be configured via:
    23  
    24  - `-account.json` is a path to the Electroneum account's JSON key file
    25  - `-account.pass` is a path to a text file with the decryption passphrase
    26  
    27  The faucet is able to distribute various amounts of Ether in exchange for various timeouts. These can be configured via:
    28  
    29  - `-faucet.amount` is the number of Ethers to send by default
    30  - `-faucet.minutes` is the time to wait before allowing a rerequest
    31  - `-faucet.tiers` is the funding tiers to support  (x3 time, x2.5 funds)
    32  
    33  ## Sybil protection
    34  
    35  To prevent the same user from exhausting funds in a loop, the `faucet` ties requests to social networks and captcha resolvers.
    36  
    37  Captcha protection uses Google's invisible ReCaptcha, thus the `faucet` needs to run on a live domain. The domain needs to be registered in Google's systems to retrieve the captcha API token and secrets. After doing so, captcha protection may be enabled via:
    38  
    39  - `-captcha.token` is the API token for ReCaptcha
    40  - `-captcha.secret` is the API secret for ReCaptcha
    41  
    42  Sybil protection via Twitter requires an API key as of 15th December, 2020. To obtain it, a Twitter user must be upgraded to developer status and a new Twitter App deployed with it. The app's `Bearer` token is required by the faucet to retrieve tweet data:
    43  
    44  - `-twitter.token` is the Bearer token for `v2` API access
    45  - `-twitter.token.v1` is the Bearer token for `v1` API access
    46  
    47  Sybil protection via Facebook uses the website to directly download post data thus does not currently require an API configuration. 
    48  
    49  ## Miscellaneous
    50  
    51  Beside the above - mostly essential - CLI flags, there are a number that can be used to fine tune the `faucet`'s operation. Please see `faucet --help` for a full list.