paritytech / polkadot-testnet-faucet

https://faucet.polkadot.io/
MIT License
36 stars 34 forks source link

📡 Problem with the Faucet Frontend #443

Closed lalitsharma-zeeve closed 2 months ago

lalitsharma-zeeve commented 2 months ago

Faucet Type

Web

Problem

I am trying to run the frontend as follows:-

  1. git clone https://github.com/paritytech/polkadot-testnet-faucet
  2. install run required commands i.e,
  3. copy .env file from example given in above repo yarn install yarn generate:papi yarn simple-git-hooks

3.5. sudo chmod 777 /home/user/faucet/polkadot-testnet-faucet/data

SMF_CONFIG_PORT=5555 SMF_CONFIG_DEPLOYED_REF=local

Steps to retrieve this token:

1. Create a bot account (see instructions below for SMF_BOT_MATRIX_BOT_USER_ID)

2. Log in to the bots matrix account. Click on the name in the top left corner, then "Settings".

3. Click the "Help & About" tab (left side of the dialog).

4. Scroll to the bottom and click on part of Access Token.

Note: Keep the browser login active as the token will be invalidated once you logout

SMF_CONFIG_MATRIX_ACCESS_TOKEN="syt_bGFsa....mBgO_12UyAY"

See https://github.com/paritytech/devops/wiki/Matrix%3A-Registering-a-Matrix-Bot for how to register a bot

Note: The bot account needs to be created in SMF_BOT_MATRIX_SERVER

SMF_CONFIG_MATRIX_BOT_USER_ID="@lalitkumarzeeve:matrix.org"

SMF_CONFIG_MATRIX_BOT_USER_ID="!GitLbaPCZaPQunjvHN:matrix.org"

SMF_CONFIG_MATRIX_BOT_USER_ID="@NotValidExampleAccount:matrix.parity.io"

@lalitkumarzeeve:matrix.org

SMF_CONFIG_FAUCET_IGNORE_LIST="" SMF_CONFIG_MATRIX_SERVER=https://matrix.org

SMF_CONFIG_MATRIX_SERVER=https://app.cinny.in/

To get account mnemonic - create an account in https://polkadot.js.org/apps/#/accounts (save details in password manager)

Prior creating, make sure to switch to according network (in case of westend - TEST WESTEND & PARACHAINS => Westend)

To feed new account with test tokens, go to https://matrix.to/#/#westend_faucet:matrix.org and drip to new address

some convenient for tests amount "!drip
"

SMF_CONFIG_FAUCET_ACCOUNT_MNEMONIC="ridge some words here and there copy advice away vivid believe giant"

Only used with external access

SMF_CONFIG_RECAPTCHA_SECRET="6LeIxAcTA....FuojJ4WifJWe" # Public testing secret, will accept all tokens.

Database

SMF_CONFIG_DB_HOST=localhost SMF_CONFIG_DB_PORT=5432 SMF_CONFIG_DB_USERNAME=postgres SMF_CONFIG_DB_PASSWORD=postgres SMF_CONFIG_DB_DATABASE_NAME=faucet


7. After this i go to client folder $cd client
8. run "yarn install"
9. run "yarn dev"
10. go to localhost:5173
11. I see frontend and try to enter address (5EWNeodpcQ6iYibJ3jmWVe85nsok1EDG8Kk3aFg8ZzpfY1qX) to get balance but in browser network tab it is sending request to https://westend-faucet.polkadot.io/drip/web which results in 400 Bad Request
![image](https://github.com/user-attachments/assets/29818c1a-8034-4c27-806d-7ed9b0343ccd)

![image](https://github.com/user-attachments/assets/bac1aca3-eba3-47a3-997e-9dea51323891)

.env for client

PUBLIC_DEMO_MODE="" PUBLIC_CAPTCHAKEY=6LfU....4W5gGxB

PUBLIC_FAUCET_URL=

uncomment to direct requests to local instance

PUBLIC_FAUCET_URL=http://localhost:5555/drip/web/

PUBLIC_ISSUE_LINK=https://github.com/paritytech/polkadot-testnet-faucet/issues/new/choose PUBLIC_FORUM="https://forum.polkadot.network/t/experiencing-trouble-accessing-our-rococo-faucet-please-post-here/2952"


### Address

_No response_

### Network ID

westend

### Relevant log output

```Shell
Error: Captcha validation was unsuccessful
mutantcornholio commented 2 months ago

you're sending the requests from your local frontend to public faucet instance... Screen Shot 2024-09-12 at 16 36 13

Don't you see this string in the .env?

Screen Shot 2024-09-12 at 16 35 33