L2scan is the explorer for the layer 2 network. It allows you to search for transactions, blocks, and addresses on the Layer2 Network.
To install this project, follow these steps:
- Clone the repository to your local machine.
- Navigate to the project directory.
- Run
bun
to install all dependencies.
Before running the project, you need to configure and set up the environment. Follow these steps:
- Copy the
.env.example
file to.env
. - Add the necessary environment variables in the
.env
file. For example:
DATABASE_URL=
REDIS_URL=
VERIFICATION_URL=
# For Production Redirection
# NEXT_PUBLIC_SITE_URL="https://l2scan.co/"
NEXT_PUBLIC_SUPABASE_URL=
NEXT_PUBLIC_SUPABASE_ANON_KEY=
PRIVATE_KEY=
FROM_ADDRESS=
RPC=
- Run
bun run prisma:push
to create the necessary database tables. - Run
bun dev
to start the development server. - If you need contract verification, you need to run the verification server.
cd smart-contract-verifier
# start the generic rust verifier
docker-compose -f docker-compose.yml up -d
# start zksync verifier
docker-compose -f docker-compose-zksync.yml up -d
- Download and install foundry cast binary from here
curl -L https://foundry.paradigm.xyz | bash
build the docker image
docker build -t l2scan .
run the docker image
docker run \
-e DATABASE_URL="postgres://postgres:[email protected]:5432/kadsea" \
-e REDIS_URL="redis://:A4%[email protected]:7069" \
-e VERIFICATION_URL="http://127.0.0.1:8050" \
-p 3000:3000 \
kadseaorg/kadscan:main-kadsea
Export the 4byte directory from openchain:
curl https://api.openchain.xyz/signature-database/v1/export -s &> sig-db.csv
# convert to tab delimited file
awk -F',' -v OFS='\t' '{sub(/,/, "\t"); print}' sig-db.csv > 4bytes.tsv
Then run the following SQL to import the 4byte directory:
\copy signatures ("hash", "name") FROM '4bytes.tsv' WITH (FORMAT csv, DELIMITER E'\t');
Delete Special Characters from the 4byte directory:
DELETE FROM signatures WHERE name LIKE '%$%';
# should handle cors in your reverse proxy
docker run -p 80:8080 -e SWAGGER_JSON_URL=http://localhost:3000/api/openapi.json swaggerapi/swagger-ui
This project utilizes the following technologies:
- Next.js
- Prisma
- TRPC
- Supabase
- BullMQ
- Viem
- Wagmi
If you would like to contribute to this project, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and commit them.
- Push your changes to your forked repository.
- Submit a pull request to the main repository.