Doing these steps in order is more likely to result in success
- Install Telegram Desktop
- In the Telegram app, Enable Web View Debug
- Obtain a Telegram Bot Token
- Get a Pretix API token from a member of the 0xPARC PCD team.
In the environment file apps/passport-server/.env
, fill in the TELEGRAM_BOT_TOKEN
with the Telegram token you obtained in the prerequisites section. If this file does not exist, follow the instructions in the README.
yarn
yarn build
yarn localdb:init && yarn localdb:up
yarn passport:dev
cd apps/passport-server && yarn scratch new-dev-event <token>
- Note: You can call
yarn scratch new-dev-event <token> <orgUrl> <eventId> <activeItemIds>
to pull from a specific event
- Note: You can call
- Copy the output from the
scratch
script (ex:/link ProgCrypto (Internal Test)
) - You will paste the output in the following step.
- Make a new private group chat in the Telegram app (ex:
test chat
). - Go to the chat with your bot (ex: https://t.me/zulearn_bot)
- Go to
Info
, then clickAdd to group or channel
. Add the bot totest chat
- Now, in
test chat
, type/link
. You should get a message confirming that the test event was linked to the TG chat. - You can double check by using a GUI like Postico to view the
telegram_bot_events
table.
-
In the Telegram app, go to the chat with your bot and type
/start
-
Click
Generate ZKP
-
Follow the link to Zupass within Telegram (http://localhost:3000) and hit
Prove
when your ticket appears -
If this is your first time, you will need to make a new Zupass account:
- Make a new Zupass account with an email you know has a ticket for the event in question (
[email protected]
should work). - Note: This account will only exist locally on your device
- Make a new Zupass account with an email you know has a ticket for the event in question (
-
You should be returned to the Telegram app and presented with the
Send ZKP
option. -
Click
Send ZKP
, then you will be redirected totest_chat
This is a one-time setup for serving https locally. You need it for Telegram, because Telegram hates http and localhost. At the end, you will be able to access 127.0.0.1 (aka localhost) from a fake domain, dev.local
(this is important for https)
-
Install mkcert - https://github.com/FiloSottile/mkcert
-
After installing, create a new local Certificate Authority (CA)
mkcert -install
-
Now, run the following commands from the repo root to generate a new certificate
mkdir apps/certificates && cd apps/certificates && mkcert dev.local
-
Add the local domain to the hosts file.
sudo vi /etc/hosts # and add a line in /etc/hosts, 127.0.0.1 dev.local localhost
-
In
passport-client/.env
andpassport-server/.env
# passport-client IS_LOCAL_HTTPS=true PASSPORT_SERVER_URL="https://dev.local:3002"
# passport-server # ... a bunch of other stuff IS_LOCAL_HTTPS=true PASSPORT_SERVER_URL="https://dev.local:3002" PASSPORT_CLIENT_URL="https://dev.local:3000"
-
When restarting your database, make sure to run
localdb:restart
notyarn localdb:init && yarn localdb:up
.- If you do accidentally run
init
, you will clear all local data. This is ok, but it causes some problems because your local Zupass ticket still exists in localStorage in the Telegram Web View of Zupass, but doesn't exist in the database. - To rectify this situation, you should clear localStorage on Telegram Zupass by right-clicking on the Web view, then selecting
Inspect Element
. From there, you can go to theStorage
tab and clear everything. - Then, you just have to login again with an account that has a ticket
- If you do accidentally run