This service is monitoring transfers executed through the OmniBridge on the xDai chain and reward the tokens recipients with small amount of xdai.
-
Prepare
.env
file with the following (at least) variables definitons:FAUCET_PRIVKEY=cafe...cafe JSON_DB_DIR=/db INITIAL_START_BLOCK=123
See below with the variables explanation.
-
Create the directory where the faucet service will store its data.
mkdir ./db
-
Run the service
docker run -ti --rm -v $(pwd)/db:/db --env-file .env omnibridge/faucet:latest
Note: the source mount point after the key
-v
is the directory created on the step 2. The destination mount point is the directory specified in the variableJSON_DB_DIR
.
-
Create the directory where the faucet service will store its data.
mkdir ./db
-
Initialize the
docker-compose.yml
file based ondocker-compose.yml.example
. Set proper values for the following variables (at least) there:FAUCET_PRIVKEY
,JSON_DB_DIR
andINITIAL_START_BLOCK
.Make sure that the source mount point in the
volumes
section is the directory created on the step 1.See below with the variables explanation.
-
Run the service
docker-compose up -d
The following environment variables may be used to configure the faucet behavior:
XDAI_RPC
- JSON RPC endpoint the faucet uses to monitor OB events and get data. Default:https://xdai.poanetwork.dev
.BSC_OB
- an address of BSC-xDai OB mediator on the xDai side. Default:0x59447362798334d3485c64D1e4870Fde2DDC0d75
.ETH_OB
- an address of ETH-xDai OB mediator on the xDai side. Default:0xf6A78083ca3e2a662D6dd1703c939c8aCE2e268d
.MOONS_EXT
- an address of Rinkeby-xDai ERC20-to-ERC677 mediator for MOONs tokens on the xDai side. Default:0x1E0507046130c31DEb20EC2f870ad070Ff266079
.BRICKS_EXT
- an address of Rinkeby-xDai ERC20-to-ERC677 mediator for BRICKs tokens on the xDai side. Default:0xf85b17E64Bc788D0CB1A8c8C87c0d74e520c2A54
.FAUCET_PRIVKEY
- a private key of an account holding xdai to reward. No default value!.GAS_PRICE
- the gas price (in gwei) the faucet uses for reward transactions (pre-EIP1559 transactions).-1
means to use EIP1559 transactions. Default:-1
.HISTORICAL_BASE_FEE_DEPTH
- number of recent blocks to estimate the base fee as per gas (EIP1559 related). Default:20
.MAX_PRIORITY_FEE
- the priority fee per gas (in gwei) used by the faucet (EIP1559 related). Default:1
.MAX_FEE_RATIO
- a coefficient to adjust the base fee per gas acquired from the historical data (EIP1559 related). Default:1.3
.FEE_LIMIT
- the higher bound of max fee per gas (in gwei) which is used in order to avoid expensive transactions (EIP1559 related). Default:150
.GAS_LIMIT
- the gas limit the faucet uses for reward transactions. Default:30000
.REWARD
- amount of xdai used as reward. Default:0.005
.POLLING_INTERVAL
- amount of time (in seconds) between two subsequent cycles to discover OB transfers and send rewards. Default:60
.INITIAL_START_BLOCK
- a block the first faucet's attempt to discover OB transfers starts from. No default value!.FINALIZATION_INTERVAL
- a number of blocks starting from the chain head to consider the chain as finalized. Default:12
.JSON_DB_DIR
- a directory where the faucet service keeps its data. No default value!.JSON_START_BLOCK
- a name of JSON file where the last observed block is stored. Default:faucet_start_block.json
.JSON_CONTRACTS
- a name of JSON file where addresses of recipient-contracts are stored. Default:xdai-contracts.json
.TEST_TO_SEND
- make a transaction to itself just after running the service. Default:false
.