Skip to content

Commit

Permalink
only for testnet
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcelusCH committed Feb 9, 2022
1 parent 88bb52b commit 5e659bd
Show file tree
Hide file tree
Showing 10 changed files with 151 additions and 76 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# BitcoinZ 2.1.0
# BitcoinZ 2.1.0 | MANDO
**Keep running wallet to strengthen the BitcoinZ network. Backup your wallet in many locations & keep your coins wallet offline.**

### Ports:
Expand Down Expand Up @@ -64,6 +64,12 @@ apt-get update \
automake p7zip-full pwgen mingw-w64 cmake
```

Choose the posix alternate from these commands:
```
update-alternatives --config x86_64-w64-mingw32-gcc
update-alternatives --config x86_64-w64-mingw32-g++
```

Execute the build command:
```
./zcutil/build-win.sh -j$(nproc)
Expand Down
25 changes: 13 additions & 12 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ class CMainParams : public CChainParams {
consensus.vUpgrades[Consensus::UPGRADE_SAPLING].hashActivationBlock =
uint256S("000000806b0edc3e39108fa95c35d02ff58975388ca50141d10d7dd52deb13eb");
consensus.vUpgrades[Consensus::UPGRADE_BLOSSOM].nProtocolVersion = 770009;
consensus.vUpgrades[Consensus::UPGRADE_BLOSSOM].nActivationHeight = 865600;

consensus.vUpgrades[Consensus::UPGRADE_BLOSSOM].nActivationHeight =
Consensus::NetworkUpgrade::ALWAYS_ACTIVE;
// The best chain should have at least this much work.
consensus.nMinimumChainWork = uint256S("000000000000000000000000000000000000000000000000000092816fe948b0");

Expand Down Expand Up @@ -365,17 +365,18 @@ class CTestNetParams : public CChainParams {
Consensus::NetworkUpgrade::NO_ACTIVATION_HEIGHT;
consensus.vUpgrades[Consensus::UPGRADE_OVERWINTER].nProtocolVersion = 770006;
consensus.vUpgrades[Consensus::UPGRADE_OVERWINTER].nActivationHeight = 1500;
consensus.vUpgrades[Consensus::UPGRADE_OVERWINTER].hashActivationBlock =
uint256S("0001bd0b788908fe416ac3c2909735bccb8c79b591e76a359ec657a97fb48a6d");
//consensus.vUpgrades[Consensus::UPGRADE_OVERWINTER].hashActivationBlock =
// uint256S("0001bd0b788908fe416ac3c2909735bccb8c79b591e76a359ec657a97fb48a6d");
consensus.vUpgrades[Consensus::UPGRADE_SAPLING].nProtocolVersion = 770006;
consensus.vUpgrades[Consensus::UPGRADE_SAPLING].nActivationHeight = 1500;
consensus.vUpgrades[Consensus::UPGRADE_SAPLING].hashActivationBlock =
uint256S("0001bd0b788908fe416ac3c2909735bccb8c79b591e76a359ec657a97fb48a6d");
//consensus.vUpgrades[Consensus::UPGRADE_SAPLING].hashActivationBlock =
// uint256S("0001bd0b788908fe416ac3c2909735bccb8c79b591e76a359ec657a97fb48a6d");
consensus.vUpgrades[Consensus::UPGRADE_BLOSSOM].nProtocolVersion = 770009;
consensus.vUpgrades[Consensus::UPGRADE_BLOSSOM].nActivationHeight = 32600;
consensus.vUpgrades[Consensus::UPGRADE_BLOSSOM].nActivationHeight = Consensus::NetworkUpgrade::NO_ACTIVATION_HEIGHT;

// The best chain should have at least this much work.
consensus.nMinimumChainWork = uint256S("000000000000000000000000000000000000000000000000000000000470fb4c");
//consensus.nMinimumChainWork = uint256S("000000000000000000000000000000000000000000000000000000000470fb4c");
consensus.nMinimumChainWork = uint256S("0x00");

pchMessageStart[0] = 0xfa;
pchMessageStart[1] = 0x1a;
Expand Down Expand Up @@ -408,7 +409,7 @@ class CTestNetParams : public CChainParams {

vFixedSeeds.clear();
vSeeds.clear();
vSeeds.push_back(CDNSSeedData("6be074a62041bb2bee54f8c48ef41bac55c44b0e1f49aef7c319d992844667c2.TZB", "test.seed.btcz.app"));
//vSeeds.push_back(CDNSSeedData("6be074a62041bb2bee54f8c48ef41bac55c44b0e1f49aef7c319d992844667c2.TZB", "test.seed.btcz.app"));
//vSeeds.push_back(CDNSSeedData("rotorproject.org", "test-dnsseed.rotorproject.org")); // Zclassic

// guarantees the first 2 characters, when base58 encoded, are "tm"
Expand Down Expand Up @@ -452,10 +453,10 @@ class CTestNetParams : public CChainParams {
// Hardcoded fallback value for the Sprout shielded value pool balance
// for nodes that have not reindexed since the introduction of monitoring
// in #2795.
nSproutValuePoolCheckpointHeight = 21000;
nSproutValuePoolCheckpointBalance = 825099960000;
//nSproutValuePoolCheckpointHeight = 21000;
//nSproutValuePoolCheckpointBalance = 825099960000;
fZIP209Enabled = true;
hashSproutValuePoolCheckpointBlock = uint256S("00360d4e02fbea84aa687722584e24bdc94dd7b768f35b095d453d81c0469d3a");
//hashSproutValuePoolCheckpointBlock = uint256S("00360d4e02fbea84aa687722584e24bdc94dd7b768f35b095d453d81c0469d3a");

// Founders reward script expects a vector of 2-of-3 multisig addresses
vCommunityFeeAddress = {
Expand Down
2 changes: 1 addition & 1 deletion src/clientversion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* for both bitcoind and bitcoin-core, to make it harder for attackers to
* target servers or GUI users specifically.
*/
const std::string CLIENT_NAME("YODA");
const std::string CLIENT_NAME("MANDO"); // This is the way ;-)

/**
* Client version number
Expand Down
4 changes: 2 additions & 2 deletions src/consensus/params.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ struct NetworkUpgrade {
};

/** ZIP208 block target interval in seconds. */
static const unsigned int PRE_BLOSSOM_POW_TARGET_SPACING = 150;
static const unsigned int POST_BLOSSOM_POW_TARGET_SPACING = 150;
static const unsigned int PRE_BLOSSOM_POW_TARGET_SPACING = 5;
static const unsigned int POST_BLOSSOM_POW_TARGET_SPACING = 5;
static_assert(POST_BLOSSOM_POW_TARGET_SPACING <= PRE_BLOSSOM_POW_TARGET_SPACING, "Blossom target spacing must be less than pre-Blossom target spacing.");
static const unsigned int PRE_BLOSSOM_HALVING_INTERVAL = 840000;
static const unsigned int PRE_BLOSSOM_REGTEST_HALVING_INTERVAL = 150;
Expand Down
2 changes: 1 addition & 1 deletion src/deprecation.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// Deprecation policy:
// * Shut down 16 weeks' worth of blocks after the estimated release block height.
// * A warning is shown during the 2 weeks' worth of blocks prior to shut down.
static const int APPROX_RELEASE_HEIGHT = 850500; // 17 days after first halving !
static const int APPROX_RELEASE_HEIGHT = 1050000;
static const int WEEKS_UNTIL_DEPRECATION = 16;
static const int DEPRECATION_HEIGHT = APPROX_RELEASE_HEIGHT + (WEEKS_UNTIL_DEPRECATION * 7 * 24 * 24);

Expand Down
51 changes: 46 additions & 5 deletions src/metrics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -466,13 +466,54 @@ void ThreadShowMetricsScreen()
std::cout << "\e[2J";

// Print art
std::cout << METRICS_ART << std::endl;
std::cout << std::endl;
//std::cout << METRICS_ART << std::endl;
//std::cout << std::endl;

// Thank you text
std::cout << _("BTCZ Node Version 2.1.0 (YODA) - Protocol 770009") << std::endl;
std::cout << strprintf(_("Thank you for running a %s BitcoinZ node!"), WhichNetwork()) << std::endl;
std::cout << _("You're helping to strengthen the network and contributing to a social good :)") << std::endl;
//std::cout << _("BTCZ Node Version 2.1.0 (MANDO) - Protocol 770009") << std::endl;
std::cout << strprintf(_("\n"
// "\n |~"
// "\n |.---. █▄▄ █ ▀█▀ █▀▀ █▀█ █ █▄░█ ▀█"
// "\n .'_____`. /\\ █▄█ █ ░█░ █▄▄ █▄█ █ █░▀█ █▄"
// "\n |~xxxxx~| ||"
// "\n |_ # _| || █▄█ █▀█ █░█ █▀█   █▀▀ █ █▄░█ ▄▀█ █▄░█ █▀▀ █ ▄▀█ █░░ "
// "\n .------`-#-'-----. ░█░ █▄█ █▄█ █▀▄   █▀░ █ █░▀█ █▀█ █░▀█ █▄▄ █ █▀█ █▄▄ "
// "\n (___|\\_________/|_.`."
// "\n / | _________ | | | █▀▀ █▀█ █▀▀ █▀▀ █▀▄ █▀█ █▀▄▀█"
// "\n / |/ _|_ \\| | | █▀░ █▀▄ ██▄ ██▄ █▄▀ █▄█ █░▀░█"
// "\n / /X| __|__ |/ `.|"
// "\n ( --< \\/ _\\//|_ |`."
// "\n `. ~----.-~=====,:======="
// "\n ~-._____/___:__(``/| |"
// "\n | | XX|~ | |"
// "\n \\__/======| /| `.|"
// "\n |_\\|\\ /|/_| )"
// "\n |_ \\__/ _| .-' %s "
// "\n | \\ .'||`. / |(_|"
// "\n | ||.'`.|| | ) BTCZ Node Version 2.1.0 "
// "\n | `'| |`' | / Protocol 770009"
// "\n | | | |\\/ MANDO"
// "\n"
// "\n"
// "\n In decentralization we trust."
// "\n You're helping to strengthen the network and contributing to a social good :)"
// "\n\n"

"\n |~"
"\n |.---. __ _ _____ ___ __ _ __ _ ___ "
"\n .'_____`. /\\ | \\ |_ _/ _//__\\| | \\| |_ | "
"\n |~xxxxx~| || | -< | | || \\_| \\/ | | | ' |/ / "
"\n |_ # _| || |__/_|_|_|_\\__/\\__/|_|_|\\__|___| "
"\n .------`-#-'-----. "
"\n (___|\\_________/|_.`. BTCZ Node Version 2.1.0 (MANDO)"
"\n / | _________ | | | Protocol 770009"
"\n / |/ _|_ \\| | | Network: %s "
"\n"
"\n YOUR FINANCIAL FREEDOM."
"\n You're helping to strengthen the network and contributing to a social good :)"
"\n\n"
), WhichNetwork()) << std::endl;
//std::cout << _("You're helping to strengthen the network and contributing to a social good :)") << std::endl;
}

while (true) {
Expand Down
4 changes: 3 additions & 1 deletion src/metrics.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,6 @@ void ThreadShowMetricsScreen();
* Rendering options:
* Logo: img2txt -W 90 -H 20 -f utf8 -d none -g design.png >> design.ansi
*/
const std::string METRICS_ART = "\n\nBitcoinZ - Your Financial Freedom\n\n";


//const std::string METRICS_ART = "";
12 changes: 6 additions & 6 deletions src/netbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ struct timeval MillisToTimeval(int64_t nTimeout)
*
* @note This function requires that hSocket is in non-blocking mode.
*/
bool static InterruptibleRecv(uint8_t* data, size_t len, int timeout, SOCKET& hSocket)
bool static InterruptibleRecv(char* data, size_t len, int timeout, SOCKET& hSocket)
{
int64_t curTime = GetTimeMillis();
int64_t endTime = curTime + timeout;
Expand Down Expand Up @@ -314,7 +314,7 @@ static bool Socks5(const std::string& strDest, int port, const ProxyCredentials
CloseSocket(hSocket);
return error("Error sending to proxy");
}
uint8_t pchRet1[2];
char pchRet1[2];
if (!InterruptibleRecv(pchRet1, 2, SOCKS5_RECV_TIMEOUT, hSocket)) {
CloseSocket(hSocket);
return error("Error reading proxy response");
Expand All @@ -339,7 +339,7 @@ static bool Socks5(const std::string& strDest, int port, const ProxyCredentials
return error("Error sending authentication to proxy");
}
LogPrint("proxy", "SOCKS5 sending proxy authentication %s:%s\n", auth->username, auth->password);
uint8_t pchRetA[2];
char pchRetA[2];
if (!InterruptibleRecv(pchRetA, 2, SOCKS5_RECV_TIMEOUT, hSocket)) {
CloseSocket(hSocket);
return error("Error reading proxy authentication response");
Expand Down Expand Up @@ -368,7 +368,7 @@ static bool Socks5(const std::string& strDest, int port, const ProxyCredentials
CloseSocket(hSocket);
return error("Error sending to proxy");
}
uint8_t pchRet2[4];
char pchRet2[4];
if (!InterruptibleRecv(pchRet2, 4, SOCKS5_RECV_TIMEOUT, hSocket)) {
CloseSocket(hSocket);
return error("Error reading proxy response");
Expand Down Expand Up @@ -396,7 +396,7 @@ static bool Socks5(const std::string& strDest, int port, const ProxyCredentials
CloseSocket(hSocket);
return error("Error: malformed proxy response");
}
uint8_t pchRet3[256];
char pchRet3[256];
switch (pchRet2[3])
{
case 0x01: ret = InterruptibleRecv(pchRet3, 4, SOCKS5_RECV_TIMEOUT, hSocket); break;
Expand All @@ -408,7 +408,7 @@ static bool Socks5(const std::string& strDest, int port, const ProxyCredentials
CloseSocket(hSocket);
return error("Error reading from proxy");
}
size_t nRecv = pchRet3[0];
int nRecv = pchRet3[0];
ret = InterruptibleRecv(pchRet3, nRecv, SOCKS5_RECV_TIMEOUT, hSocket);
break;
}
Expand Down
2 changes: 1 addition & 1 deletion zcutil/build-win.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ CC=x86_64-w64-mingw32-gcc-posix
set -eu -o pipefail
set -x

HOST="${HOST}" CC="${CC}" CXX="${CXX}" ./zcutil/build.sh
HOST="${HOST}" CC="${CC}" CXX="${CXX}" ./zcutil/build.sh
Loading

0 comments on commit 5e659bd

Please sign in to comment.