Skip to content

Commit ceafa78

Browse files
committed
create a new test config for the StorageTest
1 parent 24797d5 commit ceafa78

3 files changed

Lines changed: 315 additions & 37 deletions

File tree

‎src/test/java/org/tron/core/config/args/StorageTest.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public class StorageTest {
3030
private static Storage storage;
3131

3232
static {
33-
Args.setParam(new String[]{}, Constant.TEST_CONF);
33+
Args.setParam(new String[]{}, "config-test-storagetest.conf");
3434
storage = Args.getInstance().getStorage();
3535
}
3636

Lines changed: 278 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,278 @@
1+
net {
2+
// type = mainnet
3+
type = testnet
4+
}
5+
6+
7+
storage {
8+
# Directory for storing persistent data
9+
10+
db.version = 2,
11+
db.engine ="LEVELDB"
12+
db.directory = "database",
13+
index.directory = "index",
14+
15+
# You can custom these 14 databases' configs:
16+
17+
# account, account-index, asset-issue, block, block-index,
18+
# block_KDB, peers, properties, recent-block, trans,
19+
# utxo, votes, witness, witness_schedule.
20+
21+
# Otherwise, db configs will remain defualt and data will be stored in
22+
# the path of "output-directory" or which is set by "-d" ("--output-directory").
23+
24+
# Attention: name is a required field that must be set !!!
25+
properties = [
26+
{
27+
name = "account",
28+
path = "storage_directory_test",
29+
createIfMissing = true,
30+
paranoidChecks = true,
31+
verifyChecksums = true,
32+
compressionType = 1, // compressed with snappy
33+
blockSize = 4096, // 4 KB = 4 * 1024 B
34+
writeBufferSize = 10485760, // 10 MB = 10 * 1024 * 1024 B
35+
cacheSize = 10485760, // 10 MB = 10 * 1024 * 1024 B
36+
maxOpenFiles = 100
37+
},
38+
{
39+
name = "account-index",
40+
path = "storage_directory_test",
41+
createIfMissing = true,
42+
paranoidChecks = true,
43+
verifyChecksums = true,
44+
compressionType = 1, // compressed with snappy
45+
blockSize = 4096, // 4 KB = 4 * 1024 B
46+
writeBufferSize = 10485760, // 10 MB = 10 * 1024 * 1024 B
47+
cacheSize = 10485760, // 10 MB = 10 * 1024 * 1024 B
48+
maxOpenFiles = 100
49+
},
50+
{ # only for unit test
51+
name = "test_name",
52+
path = "test_path",
53+
createIfMissing = false,
54+
paranoidChecks = false,
55+
verifyChecksums = false,
56+
compressionType = 1,
57+
blockSize = 2,
58+
writeBufferSize = 3,
59+
cacheSize = 4,
60+
maxOpenFiles = 5
61+
},
62+
]
63+
64+
needToUpdateAsset = false
65+
66+
}
67+
68+
node.discovery = {
69+
enable = true
70+
persist = true
71+
bind.ip = "127.0.0.1"
72+
external.ip = "46.168.1.1"
73+
}
74+
75+
node {
76+
77+
trustNode = "127.0.0.1:50051"
78+
79+
listen.port = 18888
80+
81+
connection.timeout = 2
82+
83+
active = [
84+
# Sample entries:
85+
# { url = "enode://<hex nodeID>@hostname.com:30303" }
86+
# {
87+
# ip = hostname.com
88+
# port = 30303
89+
# nodeId = e437a4836b77ad9d9ffe73ee782ef2614e6d8370fcf62191a6e488276e23717147073a7ce0b444d485fff5a0c34c4577251a7a990cf80d8542e21b95aa8c5e6c
90+
# }
91+
]
92+
93+
maxActiveNodes = 30
94+
95+
p2p {
96+
version = 43 # 43: testnet; 101: debug
97+
}
98+
99+
rpc {
100+
port = 50051
101+
102+
# Number of gRPC thread, default availableProcessors / 2
103+
# thread = 16
104+
105+
# The maximum number of concurrent calls permitted for each incoming connection
106+
# maxConcurrentCallsPerConnection =
107+
108+
# The HTTP/2 flow control window, default 1MB
109+
# flowControlWindow =
110+
111+
# Connection being idle for longer than which will be gracefully terminated
112+
maxConnectionIdleInMillis = 60000
113+
114+
# Connection lasting longer than which will be gracefully terminated
115+
# maxConnectionAgeInMillis =
116+
117+
# The maximum message size allowed to be received on the server, default 4MB
118+
# maxMessageSize =
119+
120+
# The maximum size of header list allowed to be received, default 8192
121+
# maxHeaderListSize =
122+
}
123+
124+
}
125+
126+
sync {
127+
node.count = 30
128+
}
129+
130+
seed.node = {
131+
# List of the seed nodes
132+
# Seed nodes are stable full nodes
133+
# example:
134+
# ip.list = [
135+
# "ip:port",
136+
# "ip:port"
137+
# ]
138+
ip.list = [
139+
"47.254.16.55:18888",
140+
"47.254.18.49:18888",
141+
"18.188.111.53:18888",
142+
"54.219.41.56:18888",
143+
"35.169.113.187:18888",
144+
"34.214.241.188:18888",
145+
"47.254.146.147:18888",
146+
"47.254.144.25:18888",
147+
"47.91.246.252:18888",
148+
"47.91.216.69:18888",
149+
"39.106.220.120:18888"
150+
]
151+
}
152+
153+
genesis.block = {
154+
# Reserve balance
155+
assets = [
156+
# {
157+
# accountName = "tron"
158+
# accountType = "AssetIssue" # Normal/AssetIssue/Contract
159+
# address = "27V2x39zmmJeVGBGSheAk1281z8svbWgn6C"
160+
# balance = "10"
161+
# }
162+
{
163+
accountName = "Devaccount"
164+
accountType = "AssetIssue"
165+
address = "27d3byPxZXKQWfXX7sJvemJJuv5M65F3vjS"
166+
balance = "10000000000000000"
167+
},
168+
{
169+
accountName = "Zion"
170+
accountType = "AssetIssue"
171+
address = "27fXgQ46DcjEsZ444tjZPKULcxiUfDrDjqj"
172+
balance = "15000000000000000"
173+
},
174+
{
175+
accountName = "Sun"
176+
accountType = "AssetIssue"
177+
address = "27SWXcHuQgFf9uv49FknBBBYBaH3DUk4JPx"
178+
balance = "10000000000000000"
179+
},
180+
{
181+
accountName = "Blackhole"
182+
accountType = "AssetIssue"
183+
address = "27WtBq2KoSy5v8VnVZBZHHJcDuWNiSgjbE3"
184+
balance = "-9223372036854775808"
185+
}
186+
]
187+
188+
witnesses = [
189+
{
190+
address: 27Ssb1WE8FArwJVRRb8Dwy3ssVGuLY8L3S1
191+
url = "http://Mercury.org",
192+
voteCount = 105
193+
},
194+
{
195+
address: 27anh4TDZJGYpsn4BjXzb7uEArNALxwiZZW
196+
url = "http://Venus.org",
197+
voteCount = 104
198+
},
199+
{
200+
address: 27Wkfa5iEJtsKAKdDzSmF1b2gDm5s49kvdZ
201+
url = "http://Earth.org",
202+
voteCount = 103
203+
},
204+
{
205+
address: 27bqKYX9Bgv7dgTY7xBw5SUHZ8EGaPSikjx
206+
url = "http://Mars.org",
207+
voteCount = 102
208+
},
209+
{
210+
address: 27fASUY6qKtsaAEPz6QxhZac2KYVz2ZRTXW
211+
url = "http://Jupiter.org",
212+
voteCount = 101
213+
},
214+
{
215+
address: 27Q3RSbiqm59VXcF8shQWHKbyztfso5FwvP
216+
url = "http://Saturn.org",
217+
voteCount = 100
218+
},
219+
{
220+
address: 27YkUVSuvCK3K84DbnFnxYUxozpi793PTqZ
221+
url = "http://Uranus.org",
222+
voteCount = 99
223+
},
224+
{
225+
address: 27kdTBTDJ16hK3Xqr8PpCuQJmje1b94CDJU
226+
url = "http://Neptune.org",
227+
voteCount = 98
228+
},
229+
{
230+
address: 27mw9UpRy7inTMQ5kUzsdTc2QZ6KvtCX4uB
231+
url = "http://Pluto.org",
232+
voteCount = 97
233+
},
234+
{
235+
address: 27QzC4PeQZJ2kFMUXiCo4S8dx3VWN5U9xcg
236+
url = "http://Altair.org",
237+
voteCount = 96
238+
},
239+
{
240+
address: 27VZHn9PFZwNh7o2EporxmLkpe157iWZVkh
241+
url = "http://AlphaLyrae.org",
242+
voteCount = 95
243+
}
244+
]
245+
246+
timestamp = "0" #2017-8-26 12:00:00
247+
248+
parentHash = "0x0000000000000000000000000000000000000000000000000000000000000000"
249+
}
250+
251+
252+
// Optional.The default is empty.
253+
// It is used when the witness account has set the witnessPermission.
254+
// When it is not empty, the localWitnessAccountAddress represents the address of the witness account,
255+
// and the localwitness is configured with the private key of the witnessPermissionAddress in the witness account.
256+
// When it is empty,the localwitness is configured with the private key of the witness account.
257+
258+
//localWitnessAccountAddress =
259+
260+
localwitness = [
261+
f31db24bfbd1a2ef19beddca0a0fa37632eded9ac666a05d3bd925f01dde1f62
262+
]
263+
264+
block = {
265+
needSyncCheck = true # first node : false, other : true
266+
}
267+
268+
vm = {
269+
supportConstant = true
270+
minTimeRatio = 0.0
271+
maxTimeRatio = 5.0
272+
273+
# In rare cases, transactions that will be within the specified maximum execution time (default 10(ms)) are re-executed and packaged
274+
# longRunningTime = 10
275+
}
276+
committee = {
277+
allowCreationOfContracts = 1 //mainnet:0 (reset by committee),test:1
278+
}

‎src/test/resources/config-test.conf‎

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -23,42 +23,42 @@ storage {
2323

2424
# Attention: name is a required field that must be set !!!
2525
properties = [
26-
{
27-
name = "account",
28-
path = "storage_directory_test",
29-
createIfMissing = true,
30-
paranoidChecks = true,
31-
verifyChecksums = true,
32-
compressionType = 1, // compressed with snappy
33-
blockSize = 4096, // 4 KB = 4 * 1024 B
34-
writeBufferSize = 10485760, // 10 MB = 10 * 1024 * 1024 B
35-
cacheSize = 10485760, // 10 MB = 10 * 1024 * 1024 B
36-
maxOpenFiles = 100
37-
},
38-
{
39-
name = "account-index",
40-
path = "storage_directory_test",
41-
createIfMissing = true,
42-
paranoidChecks = true,
43-
verifyChecksums = true,
44-
compressionType = 1, // compressed with snappy
45-
blockSize = 4096, // 4 KB = 4 * 1024 B
46-
writeBufferSize = 10485760, // 10 MB = 10 * 1024 * 1024 B
47-
cacheSize = 10485760, // 10 MB = 10 * 1024 * 1024 B
48-
maxOpenFiles = 100
49-
},
50-
{ # only for unit test
51-
name = "test_name",
52-
path = "test_path",
53-
createIfMissing = false,
54-
paranoidChecks = false,
55-
verifyChecksums = false,
56-
compressionType = 1,
57-
blockSize = 2,
58-
writeBufferSize = 3,
59-
cacheSize = 4,
60-
maxOpenFiles = 5
61-
},
26+
// {
27+
// name = "account",
28+
// path = "storage_directory_test",
29+
// createIfMissing = true,
30+
// paranoidChecks = true,
31+
// verifyChecksums = true,
32+
// compressionType = 1, // compressed with snappy
33+
// blockSize = 4096, // 4 KB = 4 * 1024 B
34+
// writeBufferSize = 10485760, // 10 MB = 10 * 1024 * 1024 B
35+
// cacheSize = 10485760, // 10 MB = 10 * 1024 * 1024 B
36+
// maxOpenFiles = 100
37+
// },
38+
// {
39+
// name = "account-index",
40+
// path = "storage_directory_test",
41+
// createIfMissing = true,
42+
// paranoidChecks = true,
43+
// verifyChecksums = true,
44+
// compressionType = 1, // compressed with snappy
45+
// blockSize = 4096, // 4 KB = 4 * 1024 B
46+
// writeBufferSize = 10485760, // 10 MB = 10 * 1024 * 1024 B
47+
// cacheSize = 10485760, // 10 MB = 10 * 1024 * 1024 B
48+
// maxOpenFiles = 100
49+
// },
50+
// { # only for unit test
51+
// name = "test_name",
52+
// path = "test_path",
53+
// createIfMissing = false,
54+
// paranoidChecks = false,
55+
// verifyChecksums = false,
56+
// compressionType = 1,
57+
// blockSize = 2,
58+
// writeBufferSize = 3,
59+
// cacheSize = 4,
60+
// maxOpenFiles = 5
61+
// },
6262
]
6363

6464
needToUpdateAsset = false

0 commit comments

Comments
 (0)