Skip to content

Commit e9c1a02

Browse files
committed
Bug fixes and v3 core added
1 parent deb3cad commit e9c1a02

File tree

9 files changed

+177
-63
lines changed

9 files changed

+177
-63
lines changed

configs/bytecoin/dashcoin.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,15 @@
3636
"529000:b0bbedbd3e8d8051b273a8a7c8e875e1ad4184c37e6cedfb68d930e8235153dd",
3737
"600000:1f265d7710dc8b28478c62d48ef533e462008068cd7a5912b861c350ce82fbae",
3838
"636000:436f4ed7684698160120f25f1bad8aa92c38c93fbedd2b0c74671adf4d4fb191",
39-
"738000:8202b5dc2b070bd7743c44763e6eb5546ea7699f3829dc29594f046f21199b08"
39+
"738000:8202b5dc2b070bd7743c44763e6eb5546ea7699f3829dc29594f046f21199b08",
40+
"748549:b11a3b78379745e448b189866144c0a8c53f23ad1a9cb53697b96e1067496697",
41+
"748550:55cc70a8e1f26fc605d04bceb03f08bfeeebb5d0a171bc35b6f2d6f85ca8333d",
42+
"961300:e751da577d92e0032ed4b300efa47c18bb5d4eaaea9880aff1fd40dc9d6f914d"
4043
],
4144
"P2P_STAT_TRUSTED_PUB_KEY": "4d26c4df7f4ca7037950ad026f9ab36dd05d881952662992f2e4dcfcafbe57eb",
42-
"GENESIS_COINBASE_TX_HEX": "010a01ff0001ffffffffffff0f029b2e4c0271c0b42e7c53291a94d1c0cbff8883f8024f5142ee494ffbbd08807121013c086a48c15fb637a96991bc6d53caf77068b5ba6eeb3c82357228c49790584a",
45+
"GENESIS_COINBASE_TX_HEX": [
46+
"010a01ff0001ffffffffffff0f029b2e4c0271c0b42e7c53291a94d1c0cbff8883f8024f5142ee494ffbbd08807121013c086a48c15fb637a96991bc6d53caf77068b5ba6eeb3c82357228c49790584a"
47+
],
4348
"BYTECOIN_NETWORK": "12112111-1110-4101-1311-001212110110",
4449
"UPGRADE_HEIGHT_V2": 91452,
4550
"UPGRADE_HEIGHT_V3": "static_cast<uint32_t>(-1)",

cores/bytecoin.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,8 @@
22
"extension_folder":"bytecoin",
33
"name": "bytecoin",
44
"git": "https://github.com/bcndev/bytecoin.git",
5-
"branch":"master"
5+
"branch":"master",
6+
"dependencies": [
7+
"https://github.com/LMDB/lmdb"
8+
]
69
}

extensions/bytecoin-v2/bug-fixes.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,21 @@
531531
{
532532
"path": "/Makefile",
533533
"changes": [
534+
{
535+
"action": "add_above",
536+
"marker": "cmake-debug:",
537+
"parameters": {
538+
"text": [
539+
"cmake-debug-static:",
540+
"\tmkdir -p build/debug",
541+
"\tcd build/debug && cmake -D STATIC=ON -D CMAKE_BUILD_TYPE=Debug ../..",
542+
"",
543+
"build-debug-static: cmake-debug-static",
544+
"\tcd build/debug && $(MAKE)",
545+
""
546+
]
547+
}
548+
},
534549
{
535550
"action": "add_above",
536551
"marker": "cmake-release:",

extensions/bytecoin-v2/genesis-block-reward.json

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,19 @@
278278
"text": [
279279
" sub.syncStart.timestamp = m_account.get_createtime() - ACCOUN_CREATE_TIME_ACCURACY;",
280280
" if (m_syncAll == 1)",
281-
" sub.syncStart.timestamp = 0;",
282-
" std::cout << \"Sync from timestamp: \" << sub.syncStart.timestamp << std::endl;"
281+
" sub.syncStart.timestamp = 0;"
282+
]
283+
}
284+
},
285+
{
286+
"action": "replace",
287+
"marker": "m_account.set_createtime(ACCOUN_CREATE_TIME_ACCURACY);",
288+
"parameters": {
289+
"text": [
290+
" uint64_t createTime = ACCOUN_CREATE_TIME_ACCURACY;",
291+
" if (m_syncAll == 1)",
292+
" createTime = 0;",
293+
" m_account.set_createtime(createTime);"
283294
]
284295
}
285296
},

extensions/bytecoin-v2/print-genesis-tx.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,4 +112,4 @@
112112
]
113113
}
114114
]
115-
}
115+
}

extensions/bytecoin/core/bytecoin.json

Lines changed: 98 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
"const char P2P_STAT_TRUSTED_PUB_KEY[] = \"%s\";"
7070
],
7171
"replace_text_alt": [
72-
"const char P2P_STAT_TRUSTED_PUB_KEY[] = \"\";"
72+
"const char P2P_STAT_TRUSTED_PUB_KEY[] = \"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0\";"
7373
],
7474
"var": "P2P_STAT_TRUSTED_PUB_KEY"
7575
}
@@ -197,22 +197,22 @@
197197
},
198198
{
199199
"action": "replace",
200-
"marker": "const uint64_t EXPECTED_NUMBER_OF_BLOCKS_PER_DAY",
200+
"marker": "return 24 * 60 * 60 / difficulty_target;",
201201
"parameters": {
202202
"mandatory": false,
203203
"text": [
204-
"const uint64_t EXPECTED_NUMBER_OF_BLOCKS_PER_DAY = %s;"
204+
"return %s;"
205205
],
206206
"var": "EXPECTED_NUMBER_OF_BLOCKS_PER_DAY"
207207
}
208208
},
209209
{
210210
"action": "replace",
211-
"marker": "const size_t DIFFICULTY_WINDOW",
211+
"marker": "return EXPECTED_NUMBER_OF_BLOCKS_PER_DAY(difficulty_target);",
212212
"parameters": {
213213
"mandatory": false,
214214
"text": [
215-
"const size_t DIFFICULTY_WINDOW = %s;"
215+
"return %s;"
216216
],
217217
"var": "DIFFICULTY_WINDOW"
218218
}
@@ -264,38 +264,16 @@
264264
],
265265
"var": "UPGRADE_HEIGHT_V3"
266266
}
267-
},
268-
{
269-
"action": "replace",
270-
"marker": "const uint32_t KEY_IMAGE_CHECKING_BLOCK_INDEX",
271-
"parameters": {
272-
"text": [
273-
"const uint32_t KEY_IMAGE_CHECKING_BLOCK_INDEX = %s;"
274-
],
275-
"replace_text_alt": [
276-
"const uint32_t KEY_IMAGE_CHECKING_BLOCK_INDEX = 0;"
277-
],
278-
"var": "KEY_IMAGE_CHECKING_BLOCK_INDEX"
279-
}
280-
},
281-
{
282-
"action": "replace",
283-
"marker": "const CheckpointData CHECKPOINTS[] = {",
284-
"parameters": {
285-
"text": [
286-
"const std::initializer_list<CheckpointData> CHECKPOINTS = {"
287-
]
288-
}
289267
}
290268
]
291269
},
292270
{
293-
"path": "/src/CryptoNoteConfig.h",
271+
"path": "/src/CryptoNoteConfig.hpp",
294272
"multiline": true,
295273
"changes": [
296274
{
297275
"action": "replace",
298-
"marker": "(const std::initializer_list<CheckpointData> CHECKPOINTS = {)([^;]+)(};)",
276+
"marker": "(constexpr const CheckpointData CHECKPOINTS\\[\\] = {)([^;]+)(};)",
299277
"parameters": {
300278
"mandatory": false,
301279
"text": [
@@ -307,10 +285,10 @@
307285
},
308286
{
309287
"action": "replace",
310-
"marker": "(const char\\* const\\s+SEED_NODES\\[\\] = {)[^;]+(};)",
288+
"marker": "\"207.246.127.160:8080\", \"108.61.174.232:8080\", \"45.32.156.183:8080\", \"45.76.29.96:8080\"};",
311289
"parameters": {
312290
"text": [
313-
"\\1 %s \\2"
291+
"%s };"
314292
],
315293
"var": "SEED_NODES",
316294
"separator": ", ",
@@ -321,7 +299,7 @@
321299
},
322300
{
323301
"description": "Normalize checkpoints if added",
324-
"path": "/src/CryptoNoteConfig.h",
302+
"path": "/src/CryptoNoteConfig.hpp",
325303
"multiline": true,
326304
"changes": [
327305
{
@@ -338,42 +316,63 @@
338316
]
339317
},
340318
{
341-
"path": "/src/CryptoNoteCore/Currency.cpp",
319+
"path": "/src/Core/Currency.cpp",
342320
"changes": [
343321
{
322+
"description": "GENESIS_COINBASE_TX_HEX",
344323
"action": "replace",
345-
"marker": "std::string genesisCoinbaseTxHex",
324+
"marker": "\"010a01ff0001ffffffffffff0f029b2e4c0281c0b02e7c53291a94d1d0cbff8883f8024f\"",
346325
"parameters": {
347326
"text": [
348-
" std::string genesisCoinbaseTxHex = \"%s\";"
327+
""
328+
]
329+
}
330+
},
331+
{
332+
"action": "replace",
333+
"marker": "\"5142ee494ffbbd08807121013c086a48c15fb637a96991bc6d53caf77068b5ba6eeb3c82357228c49790584a\";",
334+
"parameters": {
335+
"text": [
336+
"%s ;"
349337
],
350-
"var": "GENESIS_COINBASE_TX_HEX"
338+
"var": "GENESIS_COINBASE_TX_HEX",
339+
"separator": ", ",
340+
"quote_it": true
351341
}
352342
}
353343
]
354344
},
355345
{
356-
"path": "/src/P2p/P2pNetworks.h",
346+
"path": "/src/Core/Config.cpp",
357347
"changes": [
358348
{
359349
"action": "replace",
360-
"marker": "const static boost::uuids::uuid BYTECOIN_NETWORK",
350+
"marker": "const static UUID BYTECOIN_NETWORK{{",
361351
"parameters": {
362352
"text": [
363-
" const static boost::uuids::uuid BYTECOIN_NETWORK = { { %s } };"
353+
" const static UUID BYTECOIN_NETWORK{{ %s }};"
364354
],
365355
"var": "BYTECOIN_NETWORK"
366356
}
357+
},
358+
{
359+
"action": "replace",
360+
"marker": "0x01, 0x10}};",
361+
"parameters": {
362+
"text": [
363+
""
364+
]
365+
}
367366
}
368367
]
369368
},
370369
{
371-
"path": "/src/P2p/P2pNetworks.h",
370+
"path": "/src/Core/Config.cpp",
372371
"multiline": true,
373372
"changes": [
374373
{
375374
"action": "replace",
376-
"marker": "(const static boost::uuids::uuid BYTECOIN_NETWORK = { { )([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})-([0-9a-fA-F]{2})([0-9a-fA-F]{2})-([0-9a-fA-F]{2})([0-9a-fA-F]{2})-([0-9a-fA-F]{2})([0-9a-fA-F]{2})-([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})( } };)",
375+
"marker": "(const static UUID BYTECOIN_NETWORK{{ )([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})-([0-9a-fA-F]{2})([0-9a-fA-F]{2})-([0-9a-fA-F]{2})([0-9a-fA-F]{2})-([0-9a-fA-F]{2})([0-9a-fA-F]{2})-([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})( }};)",
377376
"parameters": {
378377
"text": [
379378
"\\1 0x\\2, 0x\\3, 0x\\4, 0x\\5, 0x\\6, 0x\\7, 0x\\8, 0x\\9, 0x\\10, 0x\\11, 0x\\12, 0x\\13, 0x\\14, 0x\\15, 0x\\16, 0x\\17 \\18"
@@ -383,34 +382,84 @@
383382
]
384383
},
385384
{
386-
"path": "/src/PaymentGateService/RpcNodeConfiguration.cpp",
385+
"file_pattern": "src/main_bytecoind.cpp",
386+
"action": "bulk_replace",
387+
"find": "8080",
387388
"changes": [
388389
{
389-
"action": "replace",
390-
"marker": "(\"daemon-port\", po::value<uint16_t>()->default_value(8081), \"bytecoind port\");",
391390
"parameters": {
392391
"text": [
393-
" (\"daemon-port\", po::value<uint16_t>()->default_value(%s), \"daemon port\");"
392+
"%s"
393+
],
394+
"var": "P2P_DEFAULT_PORT"
395+
}
396+
}
397+
]
398+
},
399+
{
400+
"file_pattern": "src/main_bytecoind.cpp",
401+
"action": "bulk_replace",
402+
"find": "8081",
403+
"changes": [
404+
{
405+
"parameters": {
406+
"text": [
407+
"%s"
394408
],
395409
"var": "RPC_DEFAULT_PORT"
396410
}
397411
}
398412
]
399413
},
400414
{
401-
"path": "/src/SimpleWallet/SimpleWallet.cpp",
415+
"file_pattern": "src/main_walletd.cpp",
416+
"action": "bulk_replace",
417+
"find": "8080",
402418
"changes": [
403419
{
404-
"action": "replace",
405-
"marker": "const command_line::arg_descriptor<uint16_t> arg_daemon_port = { \"daemon-port\", \"Use daemon instance at port <arg> instead of 8081\", 0 };",
406420
"parameters": {
407421
"text": [
408-
"const command_line::arg_descriptor<uint16_t> arg_daemon_port = { \"daemon-port\", \"Use daemon instance at port <arg> instead of %s\", 0 };"
422+
"%s"
423+
],
424+
"var": "P2P_DEFAULT_PORT"
425+
}
426+
}
427+
]
428+
},
429+
{
430+
"file_pattern": "src/main_walletd.cpp",
431+
"action": "bulk_replace",
432+
"find": "8081",
433+
"changes": [
434+
{
435+
"parameters": {
436+
"text": [
437+
"%s"
409438
],
410439
"var": "RPC_DEFAULT_PORT"
411440
}
412441
}
413442
]
443+
},
444+
{
445+
"file_pattern": "CMakeLists.txt",
446+
"action": "bulk_replace",
447+
"find": "bytecoind ",
448+
"changes": [
449+
{
450+
"parameters": {
451+
"text": [
452+
"%sd "
453+
],
454+
"var": "CRYPTONOTE_NAME"
455+
}
456+
}
457+
]
458+
},
459+
{
460+
"path": "/Makefile",
461+
"action": "add",
462+
"source": "/files/Makefile"
414463
}
415464
]
416465
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
cmake-release:
2+
mkdir -p build
3+
cd build && cmake -DUSE_SSL=0 ..
4+
5+
build-release: cmake-release
6+
cd build && $(MAKE)
7+
8+
clean:
9+
rm -rf build
10+
11+
.PHONY: cmake-release build-release clean

generator.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,25 @@ function generate_coin {
5353
cd "${PROJECT_DIR}"
5454
fi
5555

56+
# Install dependencies
57+
echo "Installing dependencies..."
58+
export __CONFIG_BASE_COIN_dependencies_text="${__CONFIG_BASE_COIN_dependencies[@]}"
59+
for dependency in "${__CONFIG_BASE_COIN_dependencies[@]}"
60+
do
61+
dependency_dir=$(basename $dependency)
62+
DEPENDENCY_PATH="${WORK_FOLDERS_PATH}/${dependency_dir}"
63+
64+
if [ -d "${DEPENDENCY_PATH}" ]; then
65+
cd "${DEPENDENCY_PATH}"
66+
echo "Updating dependency ${dependency}..."
67+
git pull
68+
cd "${PROJECT_DIR}"
69+
else
70+
echo "Cloning dependency ${dependency}..."
71+
git clone "${dependency}" "${DEPENDENCY_PATH}"
72+
fi
73+
done
74+
5675
# Exit if base coin does not exists
5776
if [ ! -d "${BASE_COIN_PATH}" ]; then
5877
echo "Base coin does not exist"

0 commit comments

Comments
 (0)