You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Run the DBFork tool in the Toolkit to modify the related data. The available parameters are:
51
+
Run the DBFork tool in the Toolkit to modify the related data. First, check [Build The Toolkit](README.md#build-the-toolkit) to generate the `Toolkit.jar` file. After building successfully, you can use the following parameters to run the tool:
52
52
-`-c | --config=<config>`: config the new witnesses, balances, etc for shadow
-`-r | --retain-witnesses`: retain the previous witnesses and active witnesses. Default: false
57
57
58
-
The example of `fork.conf` can be:
58
+
The example of [fork.conf](./src/main/resources/fork.conf) can be:
59
59
60
60
```conf
61
61
witnesses = [
@@ -126,23 +126,23 @@ For the `accounts`, we can configure the following properties:
126
126
-`trc10Id`: the TRC10 token ID
127
127
-`trc10Balance`: change the balance of `trc10Id`
128
128
129
-
*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.
129
+
*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.
130
130
131
131
For the `trc20Contracts`, we can configure the following properties:
132
132
-`contractAddress`: set the TRC20 contract address
133
133
-`balancesSlotPosition`: set the `balances` slot position in the TRC20 contract storage layout
134
134
-`address`: set the account address
135
135
-`balance`: set the TRC20 balance
136
136
137
-
*Note*: the `balancesSlotPosition` sets slot position for
138
-
`mapping(address account => uint256) private _balances` variable in the TRC20 contract.
139
-
For most standard TRC20 contracts, the `balancesSlotPosition` is 0. For some special cases,
140
-
you may need to change the `balancesSlotPosition` value. For more details about the variable slot position
141
-
in the contract, please refer [layout_in_storage](https://docs.soliditylang.org/en/latest/internals/layout_in_storage.html).
137
+
*Note*: the `balancesSlotPosition` sets slot position for
138
+
`mapping(address account => uint256) private _balances` variable in the TRC20 contract.
139
+
For most standard TRC20 contracts, the `balancesSlotPosition` is 0. For some special cases,
140
+
you may need to change the `balancesSlotPosition` value. For more details about the variable slot position
141
+
in the contract, please refer [layout_in_storage](https://docs.soliditylang.org/en/latest/internals/layout_in_storage.html).
142
142
143
-
set`latestBlockHeaderTimestamp` as current millisecond time to avoid the delay in producing blocks.
143
+
Set`latestBlockHeaderTimestamp` as the current time in milliseconds. This timestamp is used before processing new blocks - setting it to the current time reduces debug log output and accelerates the production of the first new block. This setting does not impact the underlying block production logic.
144
144
145
-
set`maintenanceTimeInterval` and `nextMaintenanceTime` optionally to facilitate testing.
145
+
Set`maintenanceTimeInterval` and `nextMaintenanceTime` optionally to facilitate testing.
146
146
147
147
Execute the fork command:
148
148
```shell script
@@ -167,7 +167,9 @@ localwitness = [
167
167
]
168
168
```
169
169
170
-
If another node wants to join the shadow fork network, it needs to execute the above steps, or it copies the state data from the first shadow fork node directly. They need to configure the same `node.p2p.version` and add the `seed.node` in the config, then they can sync and produce blocks to form a local testnet.
170
+
If another node wants to join the shadow fork network, it needs to execute the above steps, or it copies the database from the first shadow fork node directly. They need to configure the same `node.p2p.version` and add the `seed.node` in the config, then they can sync and produce blocks to form a local testnet.
171
+
172
+
For instructions on starting a private chain, please refer to [Setup Private Chain](../../private_net/README.md). Note that you must use the same `genesis.block` configuration as the forked database data to ensure compatibility. If the configurations do not match, the node may fail to start or encounter consensus issues.
171
173
172
174
At last, developers can connect and interact with the node by [wallet-cli](https://tronprotocol.github.io/documentation-en/clients/wallet-cli/),
173
175
[TronBox](https://developers.tron.network/reference/what-is-tronbox), [Tron-IDE](https://developers.tron.network/docs/tron-ide) or other tools, and execute the shadow fork testing.
Copy file name to clipboardExpand all lines: tools/toolkit/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -183,7 +183,7 @@ output-directory
183
183
-`-r, --retain-witnesses`: retain the previous witnesses and active witnesses.
184
184
-`-h, --help`: provide the help info
185
185
186
-
Please refer [DbFork](DbFork.md) guidance for more details.
186
+
Please refer [DBFork](DBFork.md) guidance for more details.
187
187
188
188
## DB Query
189
189
The [ListWitnesses](https://developers.tron.network/reference/listwitnesses) and [getReward](https://developers.tron.network/reference/wallet-getreward)
Copy file name to clipboardExpand all lines: tools/toolkit/src/main/resources/fork.conf
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -53,6 +53,6 @@ trc20Contracts = [
53
53
}
54
54
]
55
55
56
-
latestBlockHeaderTimestamp = 1739269661000
56
+
latestBlockHeaderTimestamp = 1747986162000 # MilliSecond. Used in init setup, setting to current timestamp reduces debug log output and speeds up initialization. This setting does not impact the underlying block production logic.
57
57
maintenanceTimeInterval = 21600000
58
-
nextMaintenanceTime = 1735628894000
58
+
nextMaintenanceTime = 1747996162000 # MilliSecond. Set next maintenance time. It could be anytime. If you set an expired time, it will trigger maintenance logic immediately after node startup.
0 commit comments