From 7896786e026f5e9278b6f9139cb7300bce0be9c2 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 22 Aug 2019 18:28:19 -0500 Subject: [PATCH 1/3] config for testnet --- src/config/CryptoNoteConfig.h | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/config/CryptoNoteConfig.h b/src/config/CryptoNoteConfig.h index 728e31c4..ef5edff4 100644 --- a/src/config/CryptoNoteConfig.h +++ b/src/config/CryptoNoteConfig.h @@ -50,7 +50,7 @@ namespace CryptoNote static_assert(EMISSION_SPEED_FACTOR <= 8 * sizeof(uint64_t), "Bad EMISSION_SPEED_FACTOR"); static_assert(EMISSION_SPEED_FACTOR_V2 <= 8 * sizeof(uint64_t), "Bad EMISSION_SPEED_FACTOR"); - const uint64_t EMISSION_SPEED_V2_HEIGHT = 21000; + const uint64_t EMISSION_SPEED_V2_HEIGHT = 0; const uint64_t GENESIS_BLOCK_REWARD = UINT64_C(0); @@ -128,9 +128,9 @@ namespace CryptoNote /* For new projects forked from this code base, the values immediately below should be changed to 0 to prevent issues with transaction processing and other possible unexpected behavior */ - const uint64_t TRANSACTION_SIGNATURE_COUNT_VALIDATION_HEIGHT = 170000; - const uint64_t BLOCK_BLOB_SHUFFLE_CHECK_HEIGHT = 490000; - const uint64_t TRANSACTION_INPUT_BLOCKTIME_VALIDATION_HEIGHT = 490000; + const uint64_t TRANSACTION_SIGNATURE_COUNT_VALIDATION_HEIGHT = 0; + const uint64_t BLOCK_BLOB_SHUFFLE_CHECK_HEIGHT = 0; + const uint64_t TRANSACTION_INPUT_BLOCKTIME_VALIDATION_HEIGHT = 0; /* This describes how many blocks of "wiggle" room transactions have regarding when the outputs can be spent based on a reasonable belief that the outputs @@ -149,9 +149,9 @@ namespace CryptoNote const uint32_t UPGRADE_HEIGHT_V2 = 1; const uint32_t UPGRADE_HEIGHT_V3 = 2; const uint32_t UPGRADE_HEIGHT_V4 = 3; // Upgrade height for CN-Lite Variant 1 switch. - const uint32_t UPGRADE_HEIGHT_V5 = 489999; // Upgrade height for CN-Turtle Variant 2 switch. - const uint32_t UPGRADE_HEIGHT_V6 = 490000; // Upgrade height for Chukwa switch. - const uint32_t UPGRADE_HEIGHT_CURRENT = UPGRADE_HEIGHT_V4; + const uint32_t UPGRADE_HEIGHT_V5 = 4; // Upgrade height for CN-Turtle Variant 2 switch. + const uint32_t UPGRADE_HEIGHT_V6 = 5; // Upgrade height for Chukwa switch. + const uint32_t UPGRADE_HEIGHT_CURRENT = UPGRADE_HEIGHT_V6; /* This value is here to handle the difficult reset needed for the PoW upgrade at block major version V6 */ @@ -270,13 +270,14 @@ namespace CryptoNote const std::string LICENSE_URL = "https://github.com/catalystdevelopment/catalyst/blob/development/LICENSE"; const static boost::uuids::uuid CRYPTONOTE_NETWORK = { - // Another one of Bender's nightmares - { 0x01, 0x11, 0x01, 0x11, 0x00, 0x01, 0x10, 0x11, 0x11, 0x11, 0x00, 0x01, 0x11, 0x00, 0x01, 0x02 } + // I hope I'm unique :^) + { 0xae, 0xaf, 0xab, 0x11, 0x00, 0x01, 0x10, 0x1b, 0x11, 0x01, 0x00, 0x01, 0x11, 0x00, 0x01, 0x02 } }; const char* const SEED_NODES[] = { - "45.76.31.135:17290", // oddbox - "66.42.87.139:17290", - "188.166.157.115:17290" // H3R3TiK + "3.13.173.213:17290", + "34.199.2.94:17290", + "node001.cryptocatalyst.net:17290", + "node002.cryptocatalyst.net:17290" }; } // CryptoNote From bffb248d4138aa6d33631256e61009020d6d8232 Mon Sep 17 00:00:00 2001 From: n8tb1t Date: Mon, 26 Aug 2019 14:19:46 +0500 Subject: [PATCH 2/3] add docker workspace --- docker/Dockerfile | 31 ++++++++++++ docker/docker-compose.yml | 101 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 132 insertions(+) create mode 100644 docker/Dockerfile create mode 100644 docker/docker-compose.yml diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 00000000..58f543fa --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,31 @@ +FROM ubuntu:18.04 + +ENV TERM=xterm + +RUN apt-get update + +RUN apt-get install -y \ + apt-utils \ + git \ + vim \ + zsh \ + iputils-ping \ + net-tools \ + netcat + +ARG LOCALE_LANG_COUNTRY="en_US" +ARG LOCALE_CODIFICATION="UTF-8" +ARG LOCALE_CODIFICATION_ENV="utf8" + +RUN git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh --depth 1 \ + && cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc + +RUN apt-get install -y \ + build-essential \ + python-dev \ + g++-8 \ + gcc-8 \ + cmake \ + libboost-all-dev + +WORKDIR /releases diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml new file mode 100644 index 00000000..7260ea66 --- /dev/null +++ b/docker/docker-compose.yml @@ -0,0 +1,101 @@ +version: '3' + +# nc -zw3 node1 17290 && echo "opened" || echo "closed" + +# BUILD +# docker volume create cn-builds-volume + +# cmake .. -DCMAKE_BUILD_TYPE=Release -DARCH=default +# make -j6 + +# MSBuild Catalyst.sln /p:Configuration=Release /m + +# docker-compose build --force-rm --parallel build +# docker-compose run --rm --name build build + +# docker-compose run --rm --service-ports --name node1 node1 +# docker-compose run --rm --service-ports --name node2 node2 +# docker-compose run --rm --service-ports --name node3 node3 + +# docker-compose run --rm --service-ports --name miner miner + +# external miner +# ./miner --threads 4 --daemon-host fs.local --daemon-rpc-port 17251 --address cat18x93ufCQWaX4f8f2c2fZ8Ku2A4VTcgEoSpweiDbgEBF9i7YA2XGX1dSR7UbguQU5UKYEXyjfaTfnJBmRhHju26n8Y9AAFx + +services: + + build: + container_name: build + image: build:latest + build: + context: . + dockerfile: ./Dockerfile + working_dir: /releases + command: zsh + volumes: + - cn-builds-volume:/releases + + miner: + container_name: miner + image: ubuntu:18.04 + working_dir: /cat-bin + command: ./miner --threads 1 --daemon-host node3 --address cat18x93ufCQWaX4f8f2c2fZ8Ku2A4VTcgEoSpweiDbgEBF9i7YA2XGX1dSR7UbguQU5UKYEXyjfaTfnJBmRhHju26n8Y9AAFx + volumes: + - ./bin:/cat-bin + networks: + testnet: + ipv4_address: 172.16.78.5 + + node1: + container_name: node1 + image: ubuntu:18.04 + working_dir: /cat-bin + command: ./catalystd --log-level=2 --data-dir blockchain --rpc-bind-ip 0.0.0.0 --allow-local-ip + volumes: + - ./bin:/cat-bin + - ./node1-bc:/cat-bin/blockchain + networks: + testnet: + ipv4_address: 172.16.78.10 + + node2: + container_name: node2 + image: ubuntu:18.04 + working_dir: /cat-bin + command: ./catalystd --log-level=2 --data-dir blockchain --rpc-bind-ip 0.0.0.0 --allow-local-ip --add-priority-node=172.16.78.10:17290 + volumes: + - ./bin:/cat-bin + - ./node2-bc:/cat-bin/blockchain + networks: + testnet: + ipv4_address: 172.16.78.11 + + node3: + container_name: node3 + image: ubuntu:18.04 + working_dir: /cat-bin + command: ./catalystd --log-level=2 --data-dir blockchain --rpc-bind-ip 0.0.0.0 --allow-local-ip --add-priority-node=172.16.78.11:17290 + volumes: + - ./bin:/cat-bin + - ./node3-bc:/cat-bin/blockchain + networks: + testnet: + ipv4_address: 172.16.78.12 + ports: + - 17250:17290 + - 17251:17291 + expose: + - 17250 + - 17251 + +networks: + testnet: + ipam: + config: + - subnet: 172.16.78.0/24 + + + +volumes: + cn-builds-volume: + external: true From 38dca12b6fa666827aa90be5fbe72e95544a53f1 Mon Sep 17 00:00:00 2001 From: n8tb1t Date: Mon, 26 Aug 2019 14:20:40 +0500 Subject: [PATCH 3/3] local testnet config --- src/config/CryptoNoteConfig.h | 36 ++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/src/config/CryptoNoteConfig.h b/src/config/CryptoNoteConfig.h index ef5edff4..cbb7f16d 100644 --- a/src/config/CryptoNoteConfig.h +++ b/src/config/CryptoNoteConfig.h @@ -50,7 +50,7 @@ namespace CryptoNote static_assert(EMISSION_SPEED_FACTOR <= 8 * sizeof(uint64_t), "Bad EMISSION_SPEED_FACTOR"); static_assert(EMISSION_SPEED_FACTOR_V2 <= 8 * sizeof(uint64_t), "Bad EMISSION_SPEED_FACTOR"); - const uint64_t EMISSION_SPEED_V2_HEIGHT = 0; + const uint64_t EMISSION_SPEED_V2_HEIGHT = 21000; const uint64_t GENESIS_BLOCK_REWARD = UINT64_C(0); @@ -128,9 +128,9 @@ namespace CryptoNote /* For new projects forked from this code base, the values immediately below should be changed to 0 to prevent issues with transaction processing and other possible unexpected behavior */ - const uint64_t TRANSACTION_SIGNATURE_COUNT_VALIDATION_HEIGHT = 0; - const uint64_t BLOCK_BLOB_SHUFFLE_CHECK_HEIGHT = 0; - const uint64_t TRANSACTION_INPUT_BLOCKTIME_VALIDATION_HEIGHT = 0; + const uint64_t TRANSACTION_SIGNATURE_COUNT_VALIDATION_HEIGHT = 170000; + const uint64_t BLOCK_BLOB_SHUFFLE_CHECK_HEIGHT = 382000; + const uint64_t TRANSACTION_INPUT_BLOCKTIME_VALIDATION_HEIGHT = 382000; /* This describes how many blocks of "wiggle" room transactions have regarding when the outputs can be spent based on a reasonable belief that the outputs @@ -149,13 +149,16 @@ namespace CryptoNote const uint32_t UPGRADE_HEIGHT_V2 = 1; const uint32_t UPGRADE_HEIGHT_V3 = 2; const uint32_t UPGRADE_HEIGHT_V4 = 3; // Upgrade height for CN-Lite Variant 1 switch. - const uint32_t UPGRADE_HEIGHT_V5 = 4; // Upgrade height for CN-Turtle Variant 2 switch. - const uint32_t UPGRADE_HEIGHT_V6 = 5; // Upgrade height for Chukwa switch. + // Next upgrade current (382450) + 1 week (11520) = 394000 + const uint32_t UPGRADE_HEIGHT_V5 = 381999; // Upgrade height for CN-Turtle Variant 2 switch. + const uint32_t UPGRADE_HEIGHT_V6 = 382000; // Upgrade height for Chukwa switch. const uint32_t UPGRADE_HEIGHT_CURRENT = UPGRADE_HEIGHT_V6; /* This value is here to handle the difficult reset needed for the PoW upgrade at block major version V6 */ - const uint64_t DIFFICULTY_RESET_HEIGHT_V1 = UPGRADE_HEIGHT_V6; + // WARNING TODO No, thank you, we will revise the reset option later. + // Let's postpone it for 1000 days from now. 1833950 + const uint64_t DIFFICULTY_RESET_HEIGHT_V1 = 1833950; const float DIFFICULTY_RESET_MULTIPLIER_V1 = 0.1; const uint64_t DIFFICULTY_RESET_WINDOW_V1 = DIFFICULTY_BLOCKS_COUNT_V3; @@ -170,7 +173,7 @@ namespace CryptoNote { 21000, // 0 170000, // 1 - 490000, // 2 + 382000, // 2 770000 // 3 }; @@ -197,7 +200,7 @@ namespace CryptoNote const char MINER_CONFIG_FILE_NAME[] = "miner_conf.json"; } // parameters - const char CRYPTONOTE_NAME[] = "Catalyst"; + const char CRYPTONOTE_NAME[] = "CatalystTestNet"; const uint8_t TRANSACTION_VERSION_1 = 1; const uint8_t TRANSACTION_VERSION_2 = 2; @@ -237,7 +240,7 @@ namespace CryptoNote // P2P Network Configuration Section - This defines our current P2P network version // and the minimum version for communication between nodes const uint8_t P2P_CURRENT_VERSION = 6; - const uint8_t P2P_MINIMUM_VERSION = 3; + const uint8_t P2P_MINIMUM_VERSION = 6; // This defines the minimum P2P version required for lite blocks propogation const uint8_t P2P_LITE_BLOCKS_PROPOGATION_VERSION = 4; @@ -266,18 +269,17 @@ namespace CryptoNote const uint32_t DATABASE_DEFAULT_MAX_OPEN_FILES = 500; // 500 files const uint16_t DATABASE_DEFAULT_BACKGROUND_THREADS_COUNT = 10; // 10 DB threads - const char LATEST_VERSION_URL[] = "http://catalystcrypto.net"; + const char LATEST_VERSION_URL[] = "http://www.cryptocatalyst.net"; const std::string LICENSE_URL = "https://github.com/catalystdevelopment/catalyst/blob/development/LICENSE"; const static boost::uuids::uuid CRYPTONOTE_NETWORK = { - // I hope I'm unique :^) - { 0xae, 0xaf, 0xab, 0x11, 0x00, 0x01, 0x10, 0x1b, 0x11, 0x01, 0x00, 0x01, 0x11, 0x00, 0x01, 0x02 } + // Another one of Bender's nightmares + { 0x01, 0x11, 0x01, 0x11, 0x00, 0x01, 0x10, 0x11, 0x11, 0x11, 0x00, 0x01, 0x11, 0x00, 0x01, 0x02 } }; const char* const SEED_NODES[] = { - "3.13.173.213:17290", - "34.199.2.94:17290", - "node001.cryptocatalyst.net:17290", - "node002.cryptocatalyst.net:17290" + "172.16.78.10:17290", + "172.16.78.11:17290", + "172.16.78.12:17290" }; } // CryptoNote