infra-faucet/ansible/roles/faucet-api
Jakub Sokołowski 0e2637f02a
requirements: use full names for all roles
Signed-off-by: Jakub Sokołowski <jakub@status.im>
2024-03-15 11:33:46 +01:00
..
defaults faucet-api: rafactor to use Docker Compose 2021-03-25 14:02:56 +01:00
handlers rename faucet to faucet-api role 2019-05-28 08:20:37 -04:00
tasks requirements: use full names for all roles 2024-03-15 11:33:46 +01:00
templates faucet-api: switch to our own ssl-proxy 2022-10-20 23:08:34 +02:00
README.md remove Rinkeby testnet as it's being deprecated 2022-07-28 09:32:22 +02:00

README.md

Description

This role configures the faucet service which provides a REST API for receiving funds from our Goerli node.

Requirements

This role assumes it has a geth container with JSON RPC port open configured via Docker Compose.

Configuration

It makes sense to set the service name, it should match the Geth name:

faucet_service_name: 'goerli-faucet'

The container needs know the Geth RPC port and account secret:

faucet_geth_rpc_port: 8545
faucet_account_pass: 'my-secret-pass'

In addition to that it needs a domain and network:

faucet_network: 'goerli-faucet.example.org'
faucet_domain: 'goerli'
faucet_cors_rule: '.*'

API

 > curl -s http://localhost:3001/ | jq .
{
  "message": "Status.im Goerli Faucet",
  "methods": [
    "GET /",
    "POST /queue",
    "GET /donate/{address}",
    "GET /faucet-info"
  ]
}

Usage

To check sync state you can use the rpc.sh wrapper for calling JSON RPC API:

 > /docker/goerli-faucet/rpc.sh eth_syncing
{
  currentBlock: 202432,
  highestBlock: 5120931,
  knownStates: 0,
  pulledStates: 0,
  startingBlock: 149504
}