This project is a demo of the Propel platform. This project is built with MetaMask Delegation Toolkit.
This project includes the following packages/apps:
@propel-demo/web
: a Next.js app that contains the frontend of the project@propel-demo/contracts
: a Hardhat project that contains the smart contracts used in the project
- Bun
- Node.js v20.x
- Docker Compose
The project is set up so you can run the game locally out of the box.
git clone https://github.com/MetaMask/propel-demo.git
cd propel-demo
git submodule update --init --recursive
- Create a file called
.npmrc
in the root of the project and add the following:
@codefi:registry=https://nexus.eu-west-3.codefi.network/repository/npm-hosted/
//nexus.eu-west-3.codefi.network/repository/npm-hosted/:_authToken=<YOUR-NPM-TOKEN>
bun install
cp .env.example .env
Note
Make sure to update the .env
file with your INFURA_API_KEY
, since we need it to fork the Sepolia network locally.
Create an account and a project on UploadThing and get your APP_ID
and TOKEN
. Update the .env
file with your credentials.
- Create an account and a project on Clerk and get your
PUBLISHABLE_KEY
andSECRET_KEY
. Update the.env
file with your credentials. - Go to
Configure/Sessions
and onCustomize session token
, selectEdit
and add the following:
{
"email": "{{user.primary_email_address}}",
"imageUrl": "{{user.image_url}}",
"username": "{{user.full_name}}"
}
- Also, grab your clerk domain at
Configure/Domains
, we're going to need it later.
Create an account and a project on Web3Auth and get your CLIENT_ID
. Update the .env
file with your credentials.
Also, on the Web3Auth dashboard, go to Custom Authentication
and create a new verifier with the following:
- Name:
<Choose a name>
- Login Provider:
Custom Provider
- JWKS Endpoint:
https://<your-clerk-domain>/.well-known/jwks.json
- JWT Verifier ID:
Email
- JWT Validation:
"iss": https://<your-clerk-domain>
Finally, update the NEXT_PUBLIC_WEB3AUTH_VERIFIER
variable with the name of the verifier you just created.
bun db:start
bun db:migrate
bun chain:start
Tip
Otterscan (local block explorer) is available at http://localhost:5100
6. Deploy contracts and seed database (If you have any issues with the local chain, make sure that it's up and running)
bun seed
bun db:studio
open https://local.drizzle.studio
bun dev
open http://localhost:3000