| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [View Raw Code] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
parent directory.. | ||||
This directory contains the bridge-history-api service that provides REST APIs to query txs interact with Scroll official bridge contracts
The bridge-history-api contains three distinct components
Provide init, show version, rollback, and check status services of DB
cd ./bridge-history-api
make bridgehistoryapi-db-cli
./build/bin/bridgehistoryapi-db-cli [command]
Fetch the transactions from both L1 and L2
cd ./bridge-history-api
make bridgehistoryapi-fetcher
./build/bin/bridgehistoryapi-fetcher
provides REST APIs. Please refer to the API details below.
cd ./bridge-history-api
make bridgehistoryapi-api
./build/bin/bridgehistoryapi-api
// @Summary get all txs under the given address // @Accept plain // @Produce plain // @Param address query string true "wallet address" // @Param page_size query int true "page size" // @Param page query int true "page" // @Success 200 // @Router /api/txs [get]
// @Summary get all L2 withdrawals under given address // @Accept plain // @Produce plain // @Param address query string true "wallet address" // @Param page_size query int true "page size" // @Param page query int true "page" // @Success 200 // @Router /api/l2/withdrawals [get]
// @Summary get all L2 unclaimed withdrawals under the given address // @Accept plain // @Produce plain // @Param address query string true "wallet address" // @Param page_size query int true "page size" // @Param page query int true "page" // @Success 200 // @Router /api/l2/unclaimed/withdrawals [get]
// @Summary get txs by given tx hashes // @Accept plain // @Produce plain // @Param hashes query string array true "array of hashes" // @Success 200 // @Router /api/txsbyhashes [post]
Pull the latest Redis image:
docker pull redis:latest
Run the Redis container:
docker run --name bridgehistoryapi-redis -d -p 6379:6379 redis:latest
Pull the latest PostgreSQL image:
docker pull postgres:latest
Run the PostgreSQL container:
docker run --name bridgehistoryapi-history-db -p 5444:5432 -e POSTGRES_PASSWORD=123456 -e POSTGRES_DB=test -d postgres
Run database migrations to initialize the tables:
make bridgehistoryapi-db-cli ./build/bin/bridgehistoryapi-db-cli migrate
Run bridgehistoryapi-fetcher:
make bridgehistoryapi-fetcher ./build/bin/bridgehistoryapi-fetcher
Run bridgehistoryapi-api:
make bridgehistoryapi-api ./build/bin/bridgehistoryapi-api
The endpoints provided in ./conf/config.json are all public endpoints and have rate limits.
For production usage:
| Back | FazBrowse Home | New Git URL |