Skip to content

Commit e746e63

Browse files
committed
move the parameters in the configuration file
1 parent 4451d89 commit e746e63

4 files changed

Lines changed: 23 additions & 3 deletions

File tree

src/main/java/org/tron/core/config/args/Args.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,14 @@ public class Args {
158158
//If you are running a solidity node for java tron, this flag is set to true
159159
private boolean solidityNode = false;
160160

161+
@Getter
162+
@Setter
163+
private int rpcPort;
164+
165+
@Getter
166+
@Setter
167+
private long maintenanceTimeInterval; // (ms)
168+
161169
@Getter
162170
@Setter
163171
@Parameter(names = {"--trust-node"}, description = "Trust node addr")
@@ -191,6 +199,8 @@ public static void clearParam() {
191199
INSTANCE.nodeP2pPingInterval = 0L;
192200
INSTANCE.syncNodeCount = 0;
193201
INSTANCE.nodeP2pVersion = 0;
202+
INSTANCE.rpcPort = 0;
203+
INSTANCE.maintenanceTimeInterval = 0;
194204
INSTANCE.p2pNodeId = "";
195205
INSTANCE.solidityNode = false;
196206
INSTANCE.trustNodeAddr = "";
@@ -299,6 +309,13 @@ public static void setParam(final String[] args, final String confFileName) {
299309
INSTANCE.nodeP2pVersion =
300310
config.hasPath("node.p2p.version") ? config.getInt("node.p2p.version") : 0;
301311

312+
INSTANCE.rpcPort =
313+
config.hasPath("node.rpc.port") ? config.getInt("node.rpc.port") : 50051;
314+
315+
INSTANCE.maintenanceTimeInterval =
316+
config.hasPath("block.maintenanceTimeInterval") ? config
317+
.getInt("block.maintenanceTimeInterval") : 21600000L;
318+
302319
if (StringUtils.isEmpty(INSTANCE.trustNodeAddr)) {
303320
INSTANCE.trustNodeAddr = config.hasPath("node.trustNode") ? config.getString("node.trustNode") : null;
304321
}

src/main/java/org/tron/core/db/DynamicPropertiesStore.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
@Component
1919
public class DynamicPropertiesStore extends TronStoreWithRevoking<BytesCapsule> {
2020

21-
private static final long MAINTENANCE_TIME_INTERVAL = 24 * 3600 * 1000;// (ms)
21+
private static final long MAINTENANCE_TIME_INTERVAL = Args.getInstance()
22+
.getMaintenanceTimeInterval();
2223
private static final long MAINTENANCE_SKIP_SLOTS = 2;
2324
private static final int SINGLE_REPEAT = 1;
2425

src/main/java/org/tron/core/services/RpcApiService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
@Slf4j
6262
public class RpcApiService implements Service {
6363

64-
private int port = 50051;
64+
private int port = Args.getInstance().getRpcPort();
6565
private Server apiServer;
6666
private Application app;
6767
private ApplicationContext ctx;

src/main/resources/config.conf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ node {
2020
# trustNode = "ip:port"
2121

2222
listen.port = 18888
23+
rpc.port = 50051
2324

2425
connection.timeout = 2
2526

@@ -35,7 +36,7 @@ node {
3536
minParticipationRate = 33
3637

3738
p2p {
38-
version = 58 # 58: testnet; 101: debug
39+
version = 5800 # 58: testnet; 101: debug
3940
}
4041

4142
}
@@ -171,4 +172,5 @@ localwitness = [
171172

172173
block = {
173174
needSyncCheck = true # first node : false, other : true
175+
maintenanceTimeInterval = 21600000 //1day: 86400000(ms), 6 hour
174176
}

0 commit comments

Comments
 (0)