Setup dependencies and git hooks
yarn install
yarn simple-git-hooks
To launch a hot-reloading dev environment
yarn dev:backend
yarn dev:bot
The only common variable between the bot and the server is the NETWORK_DECIMALS.
Also the server's PORT
should be part of the bot's BACKEND_URL
.
Setup a .env file with the following variables
FAUCET_ACCOUNT_MNEMONIC #required - mnemonic seed from faucet account
FAUCET_BALANCE_CAP # optional - Upper limit cap on whether or not the account can recieve more tokens. Defaults to 100.
INJECTED_TYPES #optional - if any type must be overriden
NETWORK_DECIMALS #optional - decimal amount for the network
PORT #optional - the port you want the server to listen on
RPC_ENDPOINT #required - ws rpc node endpoint
example:
FAUCET_ACCOUNT_MNEMONIC="this is a fake mnemonic"
FAUCET_BALANCE_CAP=100
INJECTED_TYPES="{ "Address": "AccountId", "LookupSource": "AccountId" }"
NETWORK_DECIMALS=12
PORT=5555
RPC_ENDPOINT="https://westend-rpc.parity.io/"
Setup a .env file with the following variables
BACKEND_URL #optional - full url for the bot to reach the backend
DRIP_AMOUNT #optional - default amount of token to send
MATRIX_ACCESS_TOKEN #required - your bot access token here is how to find it https://t2bot.io/docs/access_tokens/
MATRIX_BOT_USER_ID #required - your bot user id
NETWORK_DECIMALS #optional - decimal amount for the network
NETWORK_UNIT #optional - token unit for the network
example:
BACKEND_URL="http://localhost:5555"
DRIP_AMOUNT=10
MATRIX_ACCESS_TOKEN="ThisIsNotARealAccessToken"
MATRIX_BOT_USER_ID="@test_bot_faucet:matrix.org"
NETWORK_DECIMALS=12
NETWORK_UNIT="CAN"
A list of Matrix accounts that will be silently (but logged) ignored:
FAUCET_IGNORE_LIST="@alice:matrix.org,@bob:domain.com"
-
Create an account for your MATRIX_BOT_USER_ID at https://matrix.org/, login and retrieve MATRIX_ACCESS_TOKEN in
Settigns -> Help and about -> click to reveal
-
Create a chainName-values.yaml file and define all non default variables. Secret variables (MATRIX_ACCESS_TOKEN & FAUCET_ACCOUNT_MNEMONIC) you need to supply externally via CI / command line / ...
-
Create a new CI-Job / Environment in .gitlab-ci.yml file and add Secrets (in clear / non-base64 encoded format) to
gitlab -> CI/CD Settings -> Secret Variables
). -
Run CI/CD or use
helm
to deploy.
helm template westend . \
--values ./westend-values.yaml \
--set server.secret.FAUCET_ACCOUNT_MNEMONIC='ich und du muellers esel das bist du' \
--set server.image.dockerTag=latest \
--set bot.secret.MATRIX_ACCESS_TOKEN='asdf-not-a-secret-asfd'
helm -n faucetbots ls --all
helm -n faucetbots rollback westend 2
- Bump API:
yarn upgrade @polkadot/util@latest @polkadot/wasm-crypto@latest @polkadot/keyring@latest @polkadot/x-randomvalues@latest @polkadot/api@latest @polkadot/keyring@latest @polkadot/util-crypto@latest
- Server can be queried for Prometheus metrics via http://$BACKEND_URL/metrics
- Readiness check URL via http://$BACKEND_URL/ready
- Health check URL via http://$BACKEND_URL/health