Code Monkey home page Code Monkey logo

scan's Introduction

L2SCAN

L2scan is the explorer for the layer 2 network. It allows you to search for transactions, blocks, and addresses on the Layer2 Network.

Installation

To install this project, follow these steps:

  1. Clone the repository to your local machine.
  2. Navigate to the project directory.
  3. Run bun to install all dependencies.

Configuration and Setup

Before running the project, you need to configure and set up the environment. Follow these steps:

  1. Copy the .env.example file to .env.
  2. 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=

  1. Run bun run prisma:push to create the necessary database tables.
  2. Run bun dev to start the development server.
  3. 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
  1. Download and install foundry cast binary from here
curl -L https://foundry.paradigm.xyz | bash

Docker

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

4byte Directory

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 '%$%';

Swagger UI

# 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

Technologies Used

This project utilizes the following technologies:

  • Next.js
  • Prisma
  • TRPC
  • Supabase
  • BullMQ
  • Viem
  • Wagmi

Contributing

If you would like to contribute to this project, please follow these steps:

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix.
  3. Make your changes and commit them.
  4. Push your changes to your forked repository.
  5. Submit a pull request to the main repository.

scan's People

Contributors

kadsea avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.