From d6297acbefa6fb7220bda09d813fdf6315182a99 Mon Sep 17 00:00:00 2001 From: forcodedancing Date: Mon, 1 Jul 2024 14:40:41 +0800 Subject: [PATCH 1/3] chore: add bsc commands to readme --- README.md | 58 +++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 46 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 486956e83c..78ae97acb7 100644 --- a/README.md +++ b/README.md @@ -5,16 +5,20 @@ [![Discord Chat][discord-badge]][discord-url] [gh-ci]: https://github.com/bnb-chain/reth/actions/workflows/unit.yml + [gh-deny]: https://github.com/bnb-chain/reth/actions/workflows/deny.yml + [discord-badge]: https://img.shields.io/badge/discord-join%20chat-blue.svg + [discord-url]: https://discord.gg/z2VpC455eU -BNB Chain Reth is a cutting-edge rust client developed in collaboration with Paradigm, designed to provide seamless support -for [BNB Smart Chain(BSC)](https://github.com/bnb-chain/bsc) and [opBNB](https://github.com/bnb-chain/op-geth). +BNB Chain Reth is a cutting-edge rust client developed in collaboration with Paradigm, designed to provide seamless +support for [BNB Smart Chain(BSC)](https://github.com/bnb-chain/bsc) and [opBNB](https://github.com/bnb-chain/op-geth). ## Build from Source -For prerequisites and detailed build instructions please read the [Installation Instructions](https://paradigmxyz.github.io/reth/installation/source.html). +For prerequisites and detailed build instructions please read +the [Installation Instructions](https://paradigmxyz.github.io/reth/installation/source.html). With Rust and the dependencies installed, you're ready to build BNB Chain Reth. First, clone the repository: @@ -23,16 +27,16 @@ git clone https://github.com/bnb-chain/reth.git cd reth ``` -In the realm of BSC, you have the option to execute the following commands to compile reth: +In the realm of BSC, you have the option to execute the following commands to compile bsc-reth: ```shell -make build +make build-bsc ``` Alternatively, you can install reth using the following command: ```shell -make install +make install-bsc ``` When it comes to opBNB, you can run the following commands to compile op-reth: @@ -49,14 +53,40 @@ make install-op ## Run Reth for BSC -Coming soon...... +The command below is for an archive node. To run a full node, simply add the `--full` tag. + +```shell +# for testnet +export network=bsc-testnet + +# for mainnet +# export network=bsc + +./target/release/bsc-reth node \ + --datadir=./datadir \ + --chain=${network} \ + --http \ + --http.addr=0.0.0.0 \ + --http.port=8545 \ + --http.api="admin, debug, eth, net, trace, txpool, web3, rpc, reth, ots, eth-call-bundle" \ + --ws \ + --ws.addr=0.0.0.0 \ + --ws.port=8546 \ + --nat=any \ + --log.file.directory ./datadir/logs +``` + +You can run `bsc-reth --help` for command explanations. ## Run Reth for opBNB -The op-reth is an [execution client](https://ethereum.org/en/developers/docs/nodes-and-clients/#execution-clients) for opBNB. +The op-reth is an [execution client](https://ethereum.org/en/developers/docs/nodes-and-clients/#execution-clients) for +opBNB. You need to run op-node along with op-reth to synchronize with the opBNB network. -Here is the quick command for running the op-node. For more details, refer to the [opbnb repository](https://github.com/bnb-chain/opbnb). +Here is the quick command for running the op-node. For more details, refer to +the [opbnb repository](https://github.com/bnb-chain/opbnb). + ```shell git clone https://github.com/bnb-chain/opbnb cd opbnb @@ -99,8 +129,10 @@ export P2P_BOOTNODES="enr:-J24QGQBeMsXOaCCaLWtNFSfb2Gv50DjGOKToH2HUTAIn9yXImowlR --l2.jwt-secret=./jwt.txt ``` -Copy the JWT file generated when running the op-node to the current workspace. Here is a quick command for running op-reth. +Copy the JWT file generated when running the op-node to the current workspace. Here is a quick command for running +op-reth. The command below is for an archive node. To run a full node, simply add the `--full` tag. + ```shell # for testnet export network=testnet @@ -129,7 +161,8 @@ export L2_RPC=https://opbnb-testnet-rpc.bnbchain.org --log.file.directory ./datadir/logs ``` -You can run `op-reth --help` for command explanations. More details on running opbnb nodes can be found [here](https://docs.bnbchain.org/opbnb-docs/docs/tutorials/running-a-local-node/). +You can run `op-reth --help` for command explanations. More details on running opbnb nodes can be +found [here](https://docs.bnbchain.org/opbnb-docs/docs/tutorials/running-a-local-node/). ## Contribution @@ -138,7 +171,8 @@ from anyone on the internet, and are grateful for even the smallest of fixes! If you'd like to contribute to bnb chain reth, please fork, fix, commit and send a pull request for the maintainers to review and merge into the main code base. If you wish to submit -more complex changes though, please check up with the core devs first on [our discord channel](https://discord.gg/bnbchain) +more complex changes though, please check up with the core devs first +on [our discord channel](https://discord.gg/bnbchain) to ensure those changes are in line with the general philosophy of the project and/or get some early feedback which can make both your efforts much lighter as well as our review and merge procedures quick and simple. From 24f89baa6cddb71ebcf688ff56ffe1d0d97926e5 Mon Sep 17 00:00:00 2001 From: forcodedancing Date: Mon, 1 Jul 2024 18:59:42 -0600 Subject: [PATCH 2/3] fix review comments --- README.md | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 72 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 78ae97acb7..c60ba5c264 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ export network=bsc-testnet --http \ --http.addr=0.0.0.0 \ --http.port=8545 \ - --http.api="admin, debug, eth, net, trace, txpool, web3, rpc, reth, ots, eth-call-bundle" \ + --http.api="eth, net, txpool, web3, rpc" \ --ws \ --ws.addr=0.0.0.0 \ --ws.port=8546 \ @@ -78,6 +78,36 @@ export network=bsc-testnet You can run `bsc-reth --help` for command explanations. +For running bsc-reth with docker, please use the following command: + +```shell +# for testnet +export network=bsc-testnet + +# for mainnet +# export network=bsc + +# check this for version of the docker image, https://github.com/bnb-chain/reth/pkgs/container/bsc-reth +export version=latest + +# the directory where reth data will be stored +export data_dir=/xxx/xxx + +docker run -d -p 8545:8545 -p 8546:8546 -p 30303:30303 -p 30303:30303/udp -v ${data_dir}:/data \ + --name bsc-reth ghcr.io/bnb-chain/bsc-reth:${version} node \ + --datadir=/data \ + --chain=${network} \ + --http \ + --http.addr=0.0.0.0 \ + --http.port=8545 \ + --http.api="eth, net, txpool, web3, rpc" \ + --ws \ + --ws.addr=0.0.0.0 \ + --ws.port=8546 \ + --nat=any \ + --log.file.directory /data/logs +``` + ## Run Reth for opBNB The op-reth is an [execution client](https://ethereum.org/en/developers/docs/nodes-and-clients/#execution-clients) for @@ -152,7 +182,7 @@ export L2_RPC=https://opbnb-testnet-rpc.bnbchain.org --http \ --http.addr=0.0.0.0 \ --http.port=8545 \ - --http.api="admin, debug, eth, net, trace, txpool, web3, rpc, reth, ots, eth-call-bundle" \ + --http.api="eth, net, txpool, web3, rpc" \ --ws \ --ws.addr=0.0.0.0 \ --ws.port=8546 \ @@ -164,6 +194,46 @@ export L2_RPC=https://opbnb-testnet-rpc.bnbchain.org You can run `op-reth --help` for command explanations. More details on running opbnb nodes can be found [here](https://docs.bnbchain.org/opbnb-docs/docs/tutorials/running-a-local-node/). +For running op-reth with docker, please use the following command: + +```shell +# for testnet +export network=testnet +export L2_RPC=https://opbnb-testnet-rpc.bnbchain.org + +# for mainnet +# export network=mainnet +# export L2_RPC=https://opbnb-mainnet-rpc.bnbchain.org + +# check this for version of the docker image, https://github.com/bnb-chain/reth/pkgs/container/op-reth +export version=latest + +# the directory where reth data will be stored +export data_dir=/xxx/xxx + +# the directory where the jwt.txt file is stored +export jwt_dir=/xxx/xxx + +docker run -d -p 8545:8545 -p 8546:8546 -p 30303:30303 -p 30303:30303/udp -v ${data_dir}:/data -v ${jwt_dir}:/jwt \ + --name op-reth ghcr.io/bnb-chain/op-reth:${version} node \ + --datadir=/data \ + --chain=opbnb-${network} \ + --rollup.sequencer-http=${L2_RPC} \ + --authrpc.addr="0.0.0.0" \ + --authrpc.port=8551 \ + --authrpc.jwtsecret=/jwt/jwt.txt \ + --http \ + --http.addr=0.0.0.0 \ + --http.port=8545 \ + --http.api="eth, net, txpool, web3, rpc" \ + --ws \ + --ws.addr=0.0.0.0 \ + --ws.port=8546 \ + --builder.gaslimit=150000000 \ + --nat=any \ + --log.file.directory /data/logs +``` + ## Contribution Thank you for considering helping out with the source code! We welcome contributions From 9441111d05c217821cec2b6697932d167bd43255 Mon Sep 17 00:00:00 2001 From: forcodedancing Date: Mon, 1 Jul 2024 19:00:25 +0800 Subject: [PATCH 3/3] fix op dockerfile issue --- op.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/op.Dockerfile b/op.Dockerfile index a4692dad54..833ca9f693 100644 --- a/op.Dockerfile +++ b/op.Dockerfile @@ -43,7 +43,7 @@ FROM ubuntu AS runtime WORKDIR /app # Copy reth over from the build stage -COPY --from=builder /app/bsc-reth /usr/local/bin +COPY --from=builder /app/op-reth /usr/local/bin # Copy licenses COPY LICENSE-* ./