Commit 9627b660 authored by freetrader's avatar freetrader
Browse files

Merge branch 'rebrand_useragent_and_config' into 'master'

Rebrand: User agent, related tests, proper translation context, migrate GUI settings from ABC, and OSX bundle name.

See merge request !17
parents 3715074a 06d0578a
Pipeline #120749166 passed with stages
in 39 minutes and 51 seconds
description "Bitcoin ABC Daemon"
description "Bitcoin Cash Node Daemon"
start on runlevel [2345]
stop on starting rc RUNLEVEL=[016]
......
#!/usr/bin/env bash
#
# bitcoind The bitcoin core server.
# bitcoind The Bitcoin Cash Node server.
#
#
# chkconfig: 345 80 20
......
......@@ -18,7 +18,7 @@ BITCOIND_BIN=${BITCOIND_BIN:-/usr/bin/bitcoind}
BITCOIND_NICE=${BITCOIND_NICE:-${NICELEVEL:-0}}
BITCOIND_OPTS="${BITCOIND_OPTS:-${BITCOIN_OPTS}}"
name="Bitcoin ABC Daemon"
name="Bitcoin Cash Node Daemon"
description="Bitcoin cryptocurrency P2P network daemon"
command="/usr/bin/bitcoind"
......
[Unit]
Description=Bitcoin's distributed currency daemon
Description=Bitcoin Cash Node Daemon
After=network.target
[Service]
......
......@@ -13,7 +13,7 @@
* for both bitcoind and bitcoin-qt, to make it harder for attackers to
* target servers or GUI users specifically.
*/
const std::string CLIENT_NAME("Bitcoin ABC");
const std::string CLIENT_NAME("Bitcoin Cash Node");
/**
* Client version number
......
......@@ -997,8 +997,8 @@ void SetupServerArgs() {
std::string LicenseInfo() {
const std::string URL_SOURCE_CODE =
"<https://github.com/Bitcoin-ABC/bitcoin-abc>";
const std::string URL_WEBSITE = "<https://www.bitcoinabc.org>";
"<https://gitlab.com/bitcoin-cash-node/bitcoin-cash-node>";
const std::string URL_WEBSITE = "<https://www.bitcoincashnode.org>";
return CopyrightHolders(
strprintf(_("Copyright (C) %i-%i"), 2009, COPYRIGHT_YEAR) +
......
......@@ -347,14 +347,14 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
"${EMPTY_LPROJ_FILE}"
)
set(BITCOIN_QT_OSX_BUNDLE_NAME "BitcoinABC-Qt")
set(BITCOIN_QT_OSX_BUNDLE_NAME "BitcoinCashNode-Qt")
set_target_properties(bitcoin-qt PROPERTIES
MACOSX_BUNDLE ON
OUTPUT_NAME "${BITCOIN_QT_OSX_BUNDLE_NAME}"
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_SOURCE_DIR}/share/qt/Info.plist.cmake.in"
MACOSX_BUNDLE_BUNDLE_NAME "${BITCOIN_QT_OSX_BUNDLE_NAME}"
MACOSX_BUNDLE_BUNDLE_VERSION "${bitcoin-cash-node_VERSION}"
MACOSX_BUNDLE_GUI_IDENTIFIER "org.bitcoinabc.${BITCOIN_QT_OSX_BUNDLE_NAME}"
MACOSX_BUNDLE_GUI_IDENTIFIER "org.bitcoincashnode.${BITCOIN_QT_OSX_BUNDLE_NAME}"
MACOSX_BUNDLE_ICON_FILE "${BITCOINQT_BUNDLE_ICON_NAME}"
MACOSX_BUNDLE_INFO_STRING "${bitcoin-cash-node_VERSION}, Copyright © 2009-${COPYRIGHT_YEAR} ${COPYRIGHT_HOLDERS_FINAL}"
MACOSX_BUNDLE_LONG_VERSION_STRING "${bitcoin-cash-node_VERSION}"
......
......@@ -153,14 +153,14 @@ void DebugMessageHandler(QtMsgType type, const QMessageLogContext &context,
}
}
BitcoinABC::BitcoinABC(interfaces::Node &node) : QObject(), m_node(node) {}
BitcoinCashNode::BitcoinCashNode(interfaces::Node &node) : QObject(), m_node(node) {}
void BitcoinABC::handleRunawayException(const std::exception *e) {
void BitcoinCashNode::handleRunawayException(const std::exception *e) {
PrintExceptionContinue(e, "Runaway exception");
Q_EMIT runawayException(QString::fromStdString(m_node.getWarnings("gui")));
}
void BitcoinABC::initialize(Config *config, RPCServer *rpcServer,
void BitcoinCashNode::initialize(Config *config, RPCServer *rpcServer,
HTTPRPCRequestProcessor *httpRPCRequestProcessor) {
try {
qDebug() << __func__ << ": Running initialization in thread";
......@@ -174,7 +174,7 @@ void BitcoinABC::initialize(Config *config, RPCServer *rpcServer,
}
}
void BitcoinABC::shutdown() {
void BitcoinCashNode::shutdown() {
try {
qDebug() << __func__ << ": Running Shutdown in thread";
m_node.appShutdown();
......@@ -270,15 +270,15 @@ void BitcoinApplication::startThread() {
return;
}
coreThread = new QThread(this);
BitcoinABC *executor = new BitcoinABC(m_node);
BitcoinCashNode *executor = new BitcoinCashNode(m_node);
executor->moveToThread(coreThread);
/* communication to and from thread */
connect(executor, &BitcoinABC::initializeResult, this,
connect(executor, &BitcoinCashNode::initializeResult, this,
&BitcoinApplication::initializeResult);
connect(executor, &BitcoinABC::shutdownResult, this,
connect(executor, &BitcoinCashNode::shutdownResult, this,
&BitcoinApplication::shutdownResult);
connect(executor, &BitcoinABC::runawayException, this,
connect(executor, &BitcoinCashNode::runawayException, this,
&BitcoinApplication::handleRunawayException);
// Note on how Qt works: it tries to directly invoke methods if the signal
......@@ -295,10 +295,10 @@ void BitcoinApplication::startThread() {
// crash because initialize() gets executed in another thread at some
// unspecified time (after) requestedInitialize() is emitted!
connect(this, &BitcoinApplication::requestedInitialize, executor,
&BitcoinABC::initialize);
&BitcoinCashNode::initialize);
connect(this, &BitcoinApplication::requestedShutdown, executor,
&BitcoinABC::shutdown);
&BitcoinCashNode::shutdown);
/* make sure executor object is deleted in its own thread */
connect(this, &BitcoinApplication::stopThread, executor,
&QObject::deleteLater);
......@@ -474,36 +474,34 @@ static void SetupUIArgs() {
static void MigrateSettings() {
assert(!QApplication::applicationName().isEmpty());
static const QString legacyAppName("Bitcoin-Qt"),
static const QString abcAppName("BitcoinABC-Qt"),
#ifdef Q_OS_DARWIN
// Macs and/or iOS et al use a domain-style name for Settings
// files. All other platforms use a simple orgname. This
// difference is documented in the QSettings class documentation.
legacyOrg("bitcoin.org");
abcOrg("bitcoinabc.org");
#else
legacyOrg("Bitcoin");
abcOrg("BitcoinABC");
#endif
QSettings
// below picks up settings file location based on orgname,appname
legacy(legacyOrg, legacyAppName),
abc(abcOrg, abcAppName),
// default c'tor below picks up settings file location based on
// QApplication::applicationName(), et al -- which was already set
// in main()
abc;
bchn;
#ifdef Q_OS_DARWIN
// Disable bogus OSX keys from MacOS system-wide prefs that may cloud our
// judgement ;) (this behavior is also documented in QSettings docs)
legacy.setFallbacksEnabled(false);
abc.setFallbacksEnabled(false);
bchn.setFallbacksEnabled(false);
#endif
const QStringList legacyKeys(legacy.allKeys());
// We only migrate settings if we have Core settings but no Bitcoin-ABC
// settings
if (!legacyKeys.isEmpty() && abc.allKeys().isEmpty()) {
for (const QString &key : legacyKeys) {
// We only migrate settings if we have ABC settings but no bchn
// settings (first run).
if (bchn.allKeys().isEmpty()) {
for (const QString &key : abc.allKeys()) {
// now, copy settings over
abc.setValue(key, legacy.value(key));
bchn.setValue(key, abc.value(key));
}
}
}
......@@ -579,8 +577,8 @@ int GuiMain(int argc, char *argv[]) {
QApplication::setOrganizationName(QAPP_ORG_NAME);
QApplication::setOrganizationDomain(QAPP_ORG_DOMAIN);
QApplication::setApplicationName(QAPP_APP_NAME_DEFAULT);
// Migrate settings from core's/our old GUI settings to Bitcoin ABC
// only if core's exist but Bitcoin ABC's doesn't.
// Migrate GUI settings from Bitcoin ABC to our Bitcoin Cash Node
// only if ABC's exists but ours doesn't.
// NOTE -- this function needs to be called *after* the above 3 lines
// that set the app orgname and app name! If you move the above 3 lines
// to elsewhere, take this call with you!
......
......@@ -32,13 +32,13 @@ class Node;
} // namespace interfaces
/**
* Class encapsulating Bitcoin ABC startup and shutdown.
* Class encapsulating Bitcoin Cash Node startup and shutdown.
* Allows running startup and shutdown in a different thread from the UI thread.
*/
class BitcoinABC : public QObject {
class BitcoinCashNode : public QObject {
Q_OBJECT
public:
explicit BitcoinABC(interfaces::Node &node);
explicit BitcoinCashNode(interfaces::Node &node);
public Q_SLOTS:
void initialize(Config *config, RPCServer *rpcServer,
......
......@@ -46,9 +46,9 @@ static const int MAX_URI_LENGTH = 255;
/* Number of frames in spinner animation */
#define SPINNER_FRAMES 36
#define QAPP_ORG_NAME "BitcoinABC"
#define QAPP_ORG_DOMAIN "bitcoinabc.org"
#define QAPP_APP_NAME_DEFAULT "BitcoinABC-Qt"
#define QAPP_APP_NAME_TESTNET "BitcoinABC-Qt-testnet"
#define QAPP_ORG_NAME "BitcoinCashNode"
#define QAPP_ORG_DOMAIN "bitcoincashnode.org"
#define QAPP_APP_NAME_DEFAULT "BitcoinCashNode-Qt"
#define QAPP_APP_NAME_TESTNET "BitcoinCashNode-Qt-testnet"
#endif // BITCOIN_QT_GUICONSTANTS_H
......@@ -12,7 +12,7 @@
@implementation NSBundle (returnCorrectIdentifier)
- (NSString *)__bundleIdentifier {
if (self == [NSBundle mainBundle]) {
return @"org.bitcoinabc.BitcoinABC-Qt";
return @"org.bitcoincashnode.BitcoinCashNode-Qt";
} else {
return [self __bundleIdentifier];
}
......
......@@ -12,7 +12,7 @@
/** Translate string to current locale using Qt. */
extern const std::function<std::string(const char *)> G_TRANSLATION_FUN =
[](const char *psz) {
return QCoreApplication::translate("bitcoin-abc", psz).toStdString();
return QCoreApplication::translate("bitcoin-cash-node", psz).toStdString();
};
int main(int argc, char *argv[]) {
......
......@@ -76,7 +76,7 @@ int main(int argc, char *argv[]) {
// Don't remove this, it's needed to access
// QApplication:: and QCoreApplication:: in the tests
BitcoinApplication app(*node, argc, argv);
app.setApplicationName("BitcoinABC-Qt-test");
app.setApplicationName("BitcoinCashNode-Qt-test");
#ifdef ENABLE_BIP70
// This is necessary to initialize openssl on the test framework
......
......@@ -219,7 +219,7 @@ BOOST_AUTO_TEST_CASE(test_userAgent) {
gArgs.ForceSetMultiArg("-uacomment", uacomment);
const std::string versionMessage =
"/Bitcoin ABC:" + std::to_string(CLIENT_VERSION_MAJOR) + "." +
"/Bitcoin Cash Node:" + std::to_string(CLIENT_VERSION_MAJOR) + "." +
std::to_string(CLIENT_VERSION_MINOR) + "." +
std::to_string(CLIENT_VERSION_REVISION) + "(EB8.0; " + uacomment + ")/";
......
......@@ -48,7 +48,7 @@ class ABC_CmdLine_Test (BitcoinTestFramework):
2 * LEGACY_MAX_BLOCK_SIZE)])
self.check_excessive(2 * LEGACY_MAX_BLOCK_SIZE)
# Check for EB correctness in the subver string
self.check_subversion(r"/Bitcoin ABC:.*\(EB2\.0; .*\)/")
self.check_subversion(r"/Bitcoin Cash Node:.*\(EB2\.0; .*\)/")
self.log.info(" Attempt to set below legacy limit of 1MB - try {} bytes".format(
LEGACY_MAX_BLOCK_SIZE))
......
......@@ -66,7 +66,7 @@ class ABC_RPC_Test (BitcoinTestFramework):
ebs = getsize['excessiveBlockSize']
assert_equal(ebs, 2 * ONE_MEGABYTE)
# Check for EB correctness in the subver string
self.check_subversion(r"/Bitcoin ABC:.*\(EB2\.0; .*\)/")
self.check_subversion(r"/Bitcoin Cash Node:.*\(EB2\.0; .*\)/")
# Check setting to 13MB
self.nodes[0].setexcessiveblock(13 * ONE_MEGABYTE)
......@@ -74,7 +74,7 @@ class ABC_RPC_Test (BitcoinTestFramework):
ebs = getsize['excessiveBlockSize']
assert_equal(ebs, 13 * ONE_MEGABYTE)
# Check for EB correctness in the subver string
self.check_subversion(r"/Bitcoin ABC:.*\(EB13\.0; .*\)/")
self.check_subversion(r"/Bitcoin Cash Node:.*\(EB13\.0; .*\)/")
# Check setting to 13.14MB
self.nodes[0].setexcessiveblock(13140000)
......@@ -82,7 +82,7 @@ class ABC_RPC_Test (BitcoinTestFramework):
ebs = getsize['excessiveBlockSize']
assert_equal(ebs, 13.14 * ONE_MEGABYTE)
# check for EB correctness in the subver string
self.check_subversion(r"/Bitcoin ABC:.*\(EB13\.1; .*\)/")
self.check_subversion(r"/Bitcoin Cash Node:.*\(EB13\.1; .*\)/")
def run_test(self):
self.genesis_hash = int(self.nodes[0].getbestblockhash(), 16)
......
......@@ -181,7 +181,7 @@ def main():
default=os.path.join(build_dir, 'test', 'tmp'), help="Root directory for datadirs")
parser.add_argument('--junitoutput', '-J', default='junit_results.xml',
help="File that will store JUnit formatted test results. If no absolute path is given it is treated as relative to the temporary directory.")
parser.add_argument('--testsuitename', '-n', default='Bitcoin ABC functional tests',
parser.add_argument('--testsuitename', '-n', default='Bitcoin Cash Node functional tests',
help="Name of the test suite, as it will appear in the logs and in the JUnit report.")
args, unknown_args = parser.parse_known_args()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment