Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

📡 Problem with running the Faucet #442

Closed
lalitsharma-zeeve opened this issue Sep 12, 2024 · 2 comments
Closed

📡 Problem with running the Faucet #442

lalitsharma-zeeve opened this issue Sep 12, 2024 · 2 comments
Assignees
Labels
client Changes related to th client

Comments

@lalitsharma-zeeve
Copy link

Faucet Type

Web

Problem

I am trying to run faucet locally following the steps:-

OS: ubuntu 20.04
node version: v20.17.0

  1. git clone https://github.com/paritytech/polkadot-testnet-faucet
  2. copy .env file from example given in above repo
  3. yarn install
    yarn generate:papi
    yarn simple-git-hooks
    3.5 sudo chmod 777 /home/user/faucet/polkadot-testnet-faucet/data
  4. yarn dev:db
  5. yarn build
    yarn migrations:run
  6. Register on app.element.io —> get access token
  7. yarn dev
  8. .env file content
SMF_CONFIG_NETWORK="westend"

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 <click to reveal> 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://m.parity.io
# 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 <address> <amount>"
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

I am seeing following error for westend network:-

] }
[1] Token no longer valid - assuming logout
[1] SyncApi.stop
[1] Checking lazy load status...
[1] Checking whether lazy loading has changed in store...
[1] Storing client options...
[1] Stored client options
[1] Getting filter...
[1] Getting filter failed M_UNKNOWN_TOKEN: MatrixError: [401] Invalid access token passed. (https://m.parity.io/_matrix/client/r0/user/%40lalitkumarzeeve%3Amatrix.org/filter)
[1] at parseErrorResponse (/home/lalit/faucet/polkadot-testnet-faucet/node_modules/matrix-js-sdk/lib/http-api/utils.js:81:12)
[1] at MatrixHttpApi.requestOtherUrl (/home/lalit/faucet/polkadot-testnet-faucet/node_modules/matrix-js-sdk/lib/http-api/fetch.js:244:44)
[1] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
[1] httpStatus: 401,
[1] url: 'https://m.parity.io/_matrix/client/r0/user/%40lalitkumarzeeve%3Amatrix.org/filter',
[1] event: undefined,
[1] errcode: 'M_UNKNOWN_TOKEN',
[1] data: {
[1] errcode: 'M_UNKNOWN_TOKEN',
[1] error: 'Invalid access token passed.',
[1] soft_logout: false
[1] }
[1] }
[1] Token no longer valid - assuming logout
[1] SyncApi.stop
[1] INFO (app): Faucet balance update. It's now 30 WND
[1] INFO (app): Faucet balance fetched, it's now 30 WND

Address

No response

Network ID

westend

Relevant log output

] }
[1] Token no longer valid - assuming logout
[1] SyncApi.stop
[1] Checking lazy load status...
[1] Checking whether lazy loading has changed in store...
[1] Storing client options...
[1] Stored client options
[1] Getting filter...
[1] Getting filter failed M_UNKNOWN_TOKEN: MatrixError: [401] Invalid access token passed. (https://m.parity.io/_matrix/client/r0/user/%40lalitkumarzeeve%3Amatrix.org/filter)
[1] at parseErrorResponse (/home/lalit/faucet/polkadot-testnet-faucet/node_modules/matrix-js-sdk/lib/http-api/utils.js:81:12)
[1] at MatrixHttpApi.requestOtherUrl (/home/lalit/faucet/polkadot-testnet-faucet/node_modules/matrix-js-sdk/lib/http-api/fetch.js:244:44)
[1] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
[1] httpStatus: 401,
[1] url: 'https://m.parity.io/_matrix/client/r0/user/%40lalitkumarzeeve%3Amatrix.org/filter',
[1] event: undefined,
[1] errcode: 'M_UNKNOWN_TOKEN',
[1] data: {
[1] errcode: 'M_UNKNOWN_TOKEN',
[1] error: 'Invalid access token passed.',
[1] soft_logout: false
[1] }
[1] }
[1] Token no longer valid - assuming logout
[1] SyncApi.stop
[1] INFO (app): Faucet balance update. It's now 30 WND
[1] INFO (app): Faucet balance fetched, it's now 30 WND
@lalitsharma-zeeve lalitsharma-zeeve added the client Changes related to th client label Sep 12, 2024
@mutantcornholio
Copy link
Contributor

Well the error is invalid token for matrix bot.
I can imagine that you wanted to use matrix.org instead of m.parity.io in SMF_CONFIG_MATRIX_SERVER variable?

@lalitsharma-zeeve
Copy link
Author

Thanks it is working!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client Changes related to th client
Projects
None yet
Development

No branches or pull requests

3 participants