mirror of
https://github.com/scroll-tech/scroll.git
synced 2026-01-14 08:28:02 -05:00
Co-authored-by: Péter Garamvölgyi <th307q@gmail.com> Co-authored-by: Haichen Shen <shenhaichen@gmail.com> Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com> Co-authored-by: HAOYUatHZ <haoyu@protonmail.com>
1.7 KiB
1.7 KiB
Bridge
This repo contains the Scroll bridge.
In addition, launching the bridge will launch a separate instance of l2geth, and sets up a communication channel between the two, over JSON-RPC sockets.
Something we should pay attention is that all private keys inside sender instance cannot be duplicated.
Dependency
- install
abigen
go install -v github.com/scroll-tech/go-ethereum/cmd/abigen
Build
make clean
make bridge
db operation
- init, show version, rollback, check status db
# DB_DSN: db data source name
export DB_DSN="postgres://admin:123456@localhost/test_db?sslmode=disable"
# DB_DRIVER: db driver name
export DB_DRIVER="postgres"
# TEST_DB_DRIVER, TEST_DB_DSN: It is required when executing db test cases
export TEST_DB_DRIVER="postgres"
export TEST_DB_DSN="postgres://admin:123456@localhost/test_db?sslmode=disable"
# init db
./build/bin/bridge reset [--config ./config.json]
# show db version
./build/bin/bridge version [--config ./config.json]
# rollback db
/build/bin/bridge rollback [--version version] [--config ./config.json]
# show db status
./build/bin/bridge status [--config ./config.json]
# migrate db
./build/bin/bridge migrate [--config ./config.json]
Start
- use default ports and config.json
./build/bin/bridge --http
- use specified ports and config.json
./build/bin/bridge --config ./config.json --http --http.addr localhost --http.port 8290