diff --git a/.gitignore b/.gitignore index 33c10ad..153ddeb 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,4 @@ tools/dbfork/logs/ libs/ metric_monitor/datadir private_net/datadir -tron-docker.iml \ No newline at end of file +tron-docker.iml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c2a947b..bcfcac3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,8 +17,6 @@ repos: - id: script-must-have-extension - id: git-dirty - id: git-check - - id: forbid-binary - exclude: \.(jpg|jpeg|png)$ - repo: local # check java files format use a customized script hooks: - id: checkstyle diff --git a/tools/dbfork/README.md b/tools/dbfork/README.md index 3d6fbde..fee2cc6 100644 --- a/tools/dbfork/README.md +++ b/tools/dbfork/README.md @@ -1,5 +1,5 @@ ## Database Fork Tool -Database fork tool can help launch a private java-tron FullNode or network based on the state of public chain database to support shadow fork testing. +Database fork tool can help launch a private java-tron FullNode or network based on the state of public chain database to support shadow fork testing. The public chain database can come from the Mainnet, Nile Testnet, or Shasta Testnet. Database fork tool provides the ability to modify the witnesses and other related data in the database to @@ -7,7 +7,7 @@ implement shadow fork testing, which includes: - Erase the historical witnesses and active witnesses - Write new witnesses to the state and update new active witnesses - Write new balance for new addresses -- Modify the owner permission of existing account to simulate the account operation +- Modify the owner permission of existing account to simulate the account operation - Set the new `latesteBlockHeaderTimestamp` to avoid the delay in producing blocks - Set the new `maintenanceTimeInterval` and `nextMaintenanceTime` optionally to facilitate testing @@ -37,7 +37,7 @@ node.shutdown = { } ``` -Please refer [Startup a fullnode](https://tronprotocol.github.io/documentation-en/using_javatron/installing_javatron/#startup-a-fullnode) to launch the FullNode and sync to the specified block number. The FullNode will halt when it syncs to the target block height. +Please refer [Startup a fullnode](https://tronprotocol.github.io/documentation-en/using_javatron/installing_javatron/#startup-a-fullnode) to launch the FullNode and sync to the specified block number. The FullNode will halt when it syncs to the target block height. **Note**: `node.shutdown.BlockHeight` is the solidified block height. You can use the `/wallet/getnowblock` api to check the latest block height, which should be `node.shutdown.BlockHeight + 20` when the FullNode halts. @@ -103,10 +103,10 @@ For the `accounts`, we can configure the following properties: - `address`: add or modify the account address - `accountName`: set the name of the account - `accountType`: set the account type, namely `Normal`, `AssetIssue` and `Contract` -- `balance`: set the balance of the account +- `balance`: set the balance of the account - `owner`: set the owner permission of the account -*Note*: If you need to add new address, you can use the [tronlink](https://www.tronlink.org/) or [wallet-cli](https://github.com/tronprotocol/wallet-cli?tab=readme-ov-file#account-related-commands) to +*Note*: If you need to add new address, you can use the [tronlink](https://www.tronlink.org/) or [wallet-cli](https://github.com/tronprotocol/wallet-cli?tab=readme-ov-file#account-related-commands) to genrate the private key and address. set `latestBlockHeaderTimestamp` as current millisecond time to avoid the delay in producing blocks. @@ -121,7 +121,7 @@ git clone https://github.com/tronprotocol/tron-docker.git # enter the directory cd tron-docker/tools/gradlew # compile the database fork tool -./gradlew :dbfork:build +./gradlew :dbfork:build # execute full command java -jar ../dbfork/build/libs/dbfork.jar -c /path/to/fork.conf -d /path/to/output-directory ``` diff --git a/tools/dbfork/build.gradle b/tools/dbfork/build.gradle index 131af48..201ac53 100644 --- a/tools/dbfork/build.gradle +++ b/tools/dbfork/build.gradle @@ -81,5 +81,3 @@ task checkstyleDBForkTest(type: Checkstyle) { } check.dependsOn checkstyleDBForkMain, checkstyleDBForkTest - - diff --git a/tools/dbfork/src/main/resources/logback.xml b/tools/dbfork/src/main/resources/logback.xml index e0d701f..10cd6fa 100644 --- a/tools/dbfork/src/main/resources/logback.xml +++ b/tools/dbfork/src/main/resources/logback.xml @@ -51,4 +51,3 @@ - diff --git a/tools/dbfork/src/test/java/org/tron/DBForkTest.java b/tools/dbfork/src/test/java/org/tron/DBForkTest.java index 2f4cad2..6c670ee 100644 --- a/tools/dbfork/src/test/java/org/tron/DBForkTest.java +++ b/tools/dbfork/src/test/java/org/tron/DBForkTest.java @@ -166,4 +166,3 @@ private static String getConfig(String config) { return path == null ? null : path.getPath(); } } - diff --git a/tools/dbfork/src/test/resources/fork.conf b/tools/dbfork/src/test/resources/fork.conf index 21142a4..b14a27d 100644 --- a/tools/dbfork/src/test/resources/fork.conf +++ b/tools/dbfork/src/test/resources/fork.conf @@ -36,5 +36,3 @@ accounts = [ latestBlockHeaderTimestamp = 1735628883000 maintenanceTimeInterval = 21600000 nextMaintenanceTime = 1735628894000 - - diff --git a/tools/docker/Dockerfile b/tools/docker/Dockerfile index 37d64e8..64d5026 100644 --- a/tools/docker/Dockerfile +++ b/tools/docker/Dockerfile @@ -59,4 +59,4 @@ LABEL org.label-schema.build-date=$BUILD_DATE \ org.label-schema.vcs-url="https://github.com/tronprotocol/java-tron.git" \ org.label-schema.vendor="TRON protocol" \ org.label-schema.version=$VERSION \ - org.label-schema.schema-version="1.0" \ No newline at end of file + org.label-schema.schema-version="1.0" diff --git a/tools/docker/docker-entrypoint.sh b/tools/docker/docker-entrypoint.sh index d3c5d4c..a73eb5e 100755 --- a/tools/docker/docker-entrypoint.sh +++ b/tools/docker/docker-entrypoint.sh @@ -3,4 +3,4 @@ set -eo pipefail shopt -s nullglob echo "./bin/FullNode $@" > command.txt -exec "./bin/FullNode" "$@" \ No newline at end of file +exec "./bin/FullNode" "$@" diff --git a/tools/docker/docker.md b/tools/docker/docker.md index 79aa6b0..f6e0635 100644 --- a/tools/docker/docker.md +++ b/tools/docker/docker.md @@ -5,7 +5,7 @@ java-tron support containerized processes, we maintain a Docker image with lates ## Prerequisites -Requires a docker to be installed on the system. Docker version >=20.10.12. +Requires a docker to be installed on the system. Docker version >=20.10.12. ## Quick Start @@ -35,7 +35,7 @@ $ sh docker.sh --run --net main or you can use `-p` to customize the port mapping, more custom parameters, please refer to [Options](#Options) ```shell -$ sh docker.sh --run --net main -p 8080:8090 -p 40051:50051 +$ sh docker.sh --run --net main -p 8080:8090 -p 40051:50051 ``` #### Full node on the nile test network @@ -106,5 +106,3 @@ Parameters for all functions: * **`-v`** bind mount a volume for the container,format: `-v host-src:container-dest`, the `host-src` is an absolute path * **`--net`** select the network, you can join the main-net, test-net * **`--update-config`** update configuration file, default true - - diff --git a/tools/docker/test.sh b/tools/docker/test.sh index 1cc7ce3..d961920 100755 --- a/tools/docker/test.sh +++ b/tools/docker/test.sh @@ -32,4 +32,4 @@ bash $TEST_PATH/dgoss run --sysctl net.ipv6.conf.all.disable_ipv6=1 $DOCKER_IMAG #-p 8090:8090 -p 8091:8091 -p 18888:18888 -p 18888:18888/udp -p 50051:50051 \ > ./reports/01.xml || i=`expr $i + 1` -exit $i \ No newline at end of file +exit $i diff --git a/tools/docker/tests/01/goss.yaml b/tools/docker/tests/01/goss.yaml index 3fd01e4..cbe6dc8 100644 --- a/tools/docker/tests/01/goss.yaml +++ b/tools/docker/tests/01/goss.yaml @@ -3,4 +3,3 @@ process: java: running: true - diff --git a/tools/docker/tests/01/goss_wait.yaml b/tools/docker/tests/01/goss_wait.yaml index 487d628..9b5820f 100644 --- a/tools/docker/tests/01/goss_wait.yaml +++ b/tools/docker/tests/01/goss_wait.yaml @@ -36,4 +36,4 @@ http: command: /goss/testSync.sh: # use absolute directory to run shell exit-status: 0 - timeout: 10000000 \ No newline at end of file + timeout: 10000000 diff --git a/tools/docker/tests/01/testSync.sh b/tools/docker/tests/01/testSync.sh index 42a4fc6..17f9bc8 100755 --- a/tools/docker/tests/01/testSync.sh +++ b/tools/docker/tests/01/testSync.sh @@ -53,4 +53,4 @@ for((i=1;i<=$count;i++)); do fi done echo "sync not increased" -exit 1 \ No newline at end of file +exit 1 diff --git a/tools/gradlew/gradlew b/tools/gradlew/gradlew index 65dcd68..79a61d4 100755 --- a/tools/gradlew/gradlew +++ b/tools/gradlew/gradlew @@ -144,7 +144,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +152,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac