Skip to content

Commit 7d29d1c

Browse files
committed
Fixing branch change in the Bytecoin repo
1 parent cbb6419 commit 7d29d1c

12 files changed

+80
-31
lines changed

configs/crossnote.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@
66
"mandatory-transaction-in-block.json",
77
"genesis-block-reward.json"
88
],
9-
"base_coin": {
10-
"name": "bytecoin",
11-
"git": "https://github.com/amjuarez/bytecoin.git"
12-
},
9+
"base_coin": "bytecoin-v2",
1310
"core": {
1411
"CRYPTONOTE_NAME": "crossnote.testnet",
1512
"DIFFICULTY_TARGET": 20,

configs/dashcoin.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@
77
"simplewallet-import-keys.json",
88
"simplewallet-export-keys.json"
99
],
10-
"base_coin": {
11-
"name": "bytecoin",
12-
"git": "https://github.com/amjuarez/bytecoin.git"
13-
},
10+
"base_coin": "bytecoin-v2",
1411
"core": {
1512
"CRYPTONOTE_NAME": "dashcoin",
1613
"CRYPTONOTE_DISPLAY_DECIMAL_POINT": 12,

configs/forknote-messages.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,8 @@
3636
"simplewallet-import-keys.json",
3737
"simplewallet-export-keys.json",
3838
"walletd-extension.json"
39-
],
40-
"base_coin": {
41-
"name": "bytecoin",
42-
"git": "https://github.com/amjuarez/bytecoin.git"
43-
},
39+
],
40+
"base_coin": "bytecoin-v2",
4441
"core": {
4542
"CRYPTONOTE_NAME": "forknote",
4643
"CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX": 6,

configs/forknote-webwallet.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,7 @@
3838
"simplewallet-export-keys.json",
3939
"walletd-extension.json"
4040
],
41-
"base_coin": {
42-
"name": "bytecoin",
43-
"git": "https://github.com/amjuarez/bytecoin.git"
44-
},
41+
"base_coin": "bytecoin-v2",
4542
"core": {
4643
"CRYPTONOTE_NAME": "forknote",
4744
"CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX": 6,

configs/forknote.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,7 @@
3737
"simplewallet-export-keys.json",
3838
"mnemonics.json"
3939
],
40-
"base_coin": {
41-
"name": "bytecoin",
42-
"git": "https://github.com/amjuarez/bytecoin.git"
43-
},
40+
"base_coin": "bytecoin-v2",
4441
"core": {
4542
"CRYPTONOTE_NAME": "forknote",
4643
"CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX": 6,

cores/bytecoin-v2.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extension_folder":"bytecoin-v2",
3+
"name": "bytecoin-v2",
4+
"git": "https://github.com/amjuarez/bytecoin.git",
5+
"branch":"frozen-master"
6+
}

cores/bytecoin.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extension_folder":"bytecoin",
3+
"name": "bytecoin",
4+
"git": "https://github.com/bcndev/bytecoin.git",
5+
"branch":"master"
6+
}

cores/monero.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extension_folder":"monero",
3+
"name": "monero",
4+
"git": "https://github.com/monero-project/monero.git",
5+
"branch":"master"
6+
}

extensions/walletd-spent-transfers-tracking-mode.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1916,7 +1916,7 @@
19161916
" std::vector<CachedTransactionInfo> cachedTransactions;",
19171917
" if (!requestCachedTransactionInfos({info.transactionHash}, database, cachedTransactions)) {",
19181918
" return ExtractOutputKeysResult::INVALID_GLOBAL_INDEX;",
1919-
"}",
1919+
" }",
19201920
"",
19211921
" if (cachedTransactions.empty()) {",
19221922
" return ExtractOutputKeysResult::INVALID_GLOBAL_INDEX;",

generator.sh

Lines changed: 49 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,26 +30,37 @@ trap finish EXIT
3030
# Generate source code and compile
3131
function generate_coin {
3232
# Define coin paths
33-
export BASE_COIN_PATH="${WORK_FOLDERS_PATH}/${__CONFIG_base_coin_name}"
33+
export BASE_COIN_PATH="${WORK_FOLDERS_PATH}/${__CONFIG_BASE_COIN_extension_folder}"
3434
export NEW_COIN_PATH="${WORK_FOLDERS_PATH}/${__CONFIG_core_CRYPTONOTE_NAME}"
3535
if [ -d "${BASE_COIN_PATH}" ]; then
3636
cd "${BASE_COIN_PATH}"
37-
echo "Updating ${__CONFIG_base_coin_name}..."
37+
echo "Updating ${__CONFIG_BASE_COIN_name}..."
38+
git checkout master
3839
git pull
3940
cd "${PROJECT_DIR}"
4041
else
41-
echo "Cloning ${__CONFIG_base_coin_name}..."
42-
git clone "${__CONFIG_base_coin_git}" "${BASE_COIN_PATH}"
42+
echo "Cloning ${__CONFIG_BASE_COIN_name}..."
43+
git clone "${__CONFIG_BASE_COIN_git}" "${BASE_COIN_PATH}"
44+
fi
45+
46+
if [[ ! -z $BRANCH ]]; then
47+
cd "${BASE_COIN_PATH}"
48+
git checkout ${BRANCH}
49+
cd "${PROJECT_DIR}"
50+
else
51+
cd "${BASE_COIN_PATH}"
52+
git checkout ${__CONFIG_BASE_COIN_branch}
53+
cd "${PROJECT_DIR}"
4354
fi
4455

4556
# Exit if base coin does not exists
4657
if [ ! -d "${BASE_COIN_PATH}" ]; then
47-
echo "Base coin does not exists"
58+
echo "Base coin does not exist"
4859
echo "Abort clone generation"
4960
exit 4
5061
fi
5162

52-
echo "Make temporary ${__CONFIG_base_coin_name} copy..."
63+
echo "Make temporary ${__CONFIG_BASE_COIN_name} copy..."
5364
[ -d "${TEMP_PATH}" ] || mkdir -p "${TEMP_PATH}"
5465
cp -af "${BASE_COIN_PATH}/." "${TEMP_PATH}"
5566

@@ -81,6 +92,11 @@ function generate_coin {
8192

8293
bash "${SCRIPTS_PATH}/compile.sh" -c "${COMPILE_ARGS}" -z
8394
fi
95+
96+
if [[ ! -z $BRANCH ]]; then
97+
cd "${BASE_COIN_PATH}"
98+
git checkout master
99+
fi
84100
}
85101

86102
# Usage info
@@ -91,6 +107,7 @@ Reads a config file and creates and compiles Cryptonote coin. "config.json" as d
91107
92108
-h display this help and exit
93109
-f config file
110+
-b branch
94111
-c compile arguments
95112
EOF
96113
}
@@ -100,16 +117,19 @@ OPTIND=1 # Reset in case getopts has been used previously in the shell.
100117

101118
# Initialize our own variables:
102119
CONFIG_FILE='config.json'
120+
CORE_CONFIG_FILE=''
103121
COMPILE_ARGS=''
104122

105-
while getopts "h?f:c:" opt; do
123+
while getopts "h?f:b:c:" opt; do
106124
case "$opt" in
107125
h|\?)
108126
show_help
109127
exit 0
110128
;;
111129
f) CONFIG_FILE=${OPTARG}
112130
;;
131+
b) BRANCH=${OPTARG}
132+
;;
113133
c) COMPILE_ARGS=${OPTARG}
114134
;;
115135
esac
@@ -123,7 +143,7 @@ if [[ "${CONFIG_FILE}" != /* ]]; then
123143
fi
124144

125145
if [ ! -f ${CONFIG_FILE} ]; then
126-
echo "ERROR: config file does not exist"
146+
echo "ERROR: config file does not exits"
127147
exit
128148
fi
129149

@@ -138,4 +158,25 @@ if [ ! -f ${BASH_CONFIG} ]; then
138158
fi
139159
source ${BASH_CONFIG}
140160

161+
CORE_CONFIG_FILE=${__CONFIG_base_coin}
162+
# Setting core config file
163+
if [[ "${CORE_CONFIG_FILE}" != /* ]]; then
164+
CORE_CONFIG_FILE="${CORE_CONFIG_PATH}/cores/${CORE_CONFIG_FILE}.json"
165+
fi
166+
167+
if [ ! -f ${CORE_CONFIG_FILE} ]; then
168+
echo "ERROR: core config file does not exits"
169+
echo "${CORE_CONFIG_FILE}"
170+
exit
171+
fi
172+
173+
# Get environment environment_variables
174+
python "lib/environment_variables.py" --config=$CORE_CONFIG_FILE --output=$BASH_CONFIG --prefix="_BASE_COIN"
175+
if [ ! -f ${BASH_CONFIG} ]; then
176+
echo "Core config file was not translated to bash."
177+
echo "Abort coin generation"
178+
exit 3
179+
fi
180+
source ${BASH_CONFIG}
181+
141182
generate_coin

0 commit comments

Comments
 (0)