text: // Copyright (c) 2014-2019, The Mask Project
  //
  // All rights reserved.
  //
  // Redistribution and use in source and binary forms, with or without modification, are
  // permitted provided that the following conditions are met:
  //
  // 1. Redistributions of source code must retain the above copyright notice, this list of
  //    conditions and the following disclaimer.
  //
  // 2. Redistributions in binary form must reproduce the above copyright notice, this list
  //    of conditions and the following disclaimer in the documentation and/or other
  //    materials provided with the distribution.
  //
  // 3. Neither the name of the copyright holder nor the names of its contributors may be
  //    used to endorse or promote products derived from this software without specific
  //    prior written permission.
  //
  // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
  // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
  // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
  // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  //
  // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers
  
  #pragma once
  
  #include <stdexcept>
  #include <string>
  #include <boost/uuid/uuid.hpp>
  #include <vector>
  
  #define CRYPTONOTE_DNS_TIMEOUT_MS                       20000
  
  #define CRYPTONOTE_MAX_BLOCK_NUMBER                     500000000
  #define CRYPTONOTE_GETBLOCKTEMPLATE_MAX_BLOCK_SIZE	196608 //size of block (bytes) that is the maximum that miners will produce
  #define CRYPTONOTE_MAX_TX_SIZE                          1000000
  #define CRYPTONOTE_MAX_TX_PER_BLOCK                     0x10000000
  #define CRYPTONOTE_PUBLIC_ADDRESS_TEXTBLOB_VER          0
  #define CRYPTONOTE_MINED_MONEY_UNLOCK_WINDOW            60
  #define CURRENT_TRANSACTION_VERSION                     2
  #define CURRENT_BLOCK_MAJOR_VERSION                     1
  #define CURRENT_BLOCK_MINOR_VERSION                     0
  #define CRYPTONOTE_BLOCK_FUTURE_TIME_LIMIT              60*60*2
  #define CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE             10
  
  #define BLOCKCHAIN_TIMESTAMP_CHECK_WINDOW               60
  
  // MONEY_SUPPLY - total number coins to be generated
  #define MONEY_SUPPLY                                    ((uint64_t)(-1))
  
  #define EMISSION_SPEED_FACTOR_PER_MINUTE                (22)
  #define EMISSION_SPEED_FACTOR_PER_MINUTE_ZAP            (26)
  #define EMISSION_SPEED_FACTOR_PER_MINUTE_FLASH          (23)
  #define EMISSION_SPEED_FACTOR_PER_MINUTE_ICE            (27)
  
  #define FINAL_SUBSIDY_PER_MINUTE                        ((uint64_t)300000000000) // 3 * pow(10, 11)
  
  #define CRYPTONOTE_REWARD_BLOCKS_WINDOW                 100
  #define CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE_V2    60000 //size of block (bytes) after which reward for block calculated using block size
  #define CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE_V1    20000 //size of block (bytes) after which reward for block calculated using block size - before first fork
  #define CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE_V5    300000 * 10 //size of block (bytes) after which reward for block calculated using block size - second change, from v5
  #define CRYPTONOTE_LONG_TERM_BLOCK_WEIGHT_WINDOW_SIZE   100000 // size in blocks of the long term block weight median window
  #define CRYPTONOTE_SHORT_TERM_BLOCK_WEIGHT_SURGE_FACTOR 50
  #define CRYPTONOTE_COINBASE_BLOB_RESERVED_SIZE          600
  #define CRYPTONOTE_DISPLAY_DECIMAL_POINT                12
  // COIN - number of smallest units in one coin
  #define COIN                                            ((uint64_t)1000000000000) // pow(10, 12)
  
  #define FEE_PER_KB_OLD                                  ((uint64_t)10000000000) // pow(10, 10)
  #define FEE_PER_KB                                      ((uint64_t)2000000000) // 2 * pow(10, 9)
  #define FEE_PER_BYTE                                    ((uint64_t)300000)
  #define DYNAMIC_FEE_PER_KB_BASE_FEE                     ((uint64_t)2000000000) // 2 * pow(10,9)
  #define DYNAMIC_FEE_PER_KB_BASE_BLOCK_REWARD            ((uint64_t)10000000000000) // 10 * pow(10,12)
  #define DYNAMIC_FEE_PER_KB_BASE_FEE_V5                  ((uint64_t)2000000000 * (uint64_t)CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE_V2 / CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE_V5)
  #define DYNAMIC_FEE_REFERENCE_TRANSACTION_WEIGHT         ((uint64_t)3000)
  
  #define ORPHANED_BLOCKS_MAX_COUNT                       100
  
  
  #define DIFFICULTY_TARGET_V2                            600  // 10 minutes
  #define DIFFICULTY_TARGET_V1                            600  // seconds - before first fork
  #define DIFFICULTY_WINDOW                               720 // blocks
  #define DIFFICULTY_LAG                                  15  // !!!
  #define DIFFICULTY_CUT                                  60  // timestamps to cut after sorting
  #define DIFFICULTY_BLOCKS_COUNT                         DIFFICULTY_WINDOW + DIFFICULTY_LAG
  
  
  #define CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_SECONDS_V1   DIFFICULTY_TARGET_V1 * CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_BLOCKS
  #define CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_SECONDS_V2   DIFFICULTY_TARGET_V2 * CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_BLOCKS
  #define CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_BLOCKS       1
  
  
  #define DIFFICULTY_BLOCKS_ESTIMATE_TIMESPAN             DIFFICULTY_TARGET_V1 //just alias; used by tests
  
  
  #define BLOCKS_IDS_SYNCHRONIZING_DEFAULT_COUNT          10000  //by default, blocks ids count in synchronizing
  #define BLOCKS_SYNCHRONIZING_DEFAULT_COUNT_PRE_V4       100    //by default, blocks count in blocks downloading
  #define BLOCKS_SYNCHRONIZING_DEFAULT_COUNT              20     //by default, blocks count in blocks downloading
  #define BLOCKS_SYNCHRONIZING_MAX_COUNT                  2048   //must be a power of 2, greater than 128, equal to SEEDHASH_EPOCH_BLOCKS
  
  #define CRYPTONOTE_MEMPOOL_TX_LIVETIME                    (86400*3) //seconds, three days
  #define CRYPTONOTE_MEMPOOL_TX_FROM_ALT_BLOCK_LIVETIME     604800 //seconds, one week
  
  
  #define CRYPTONOTE_DANDELIONPP_STEMS              2 // number of outgoing stem connections per epoch
  #define CRYPTONOTE_DANDELIONPP_FLUFF_PROBABILITY 10 // out of 100
  #define CRYPTONOTE_DANDELIONPP_MIN_EPOCH         10 // minutes
  #define CRYPTONOTE_DANDELIONPP_EPOCH_RANGE       30 // seconds
  #define CRYPTONOTE_DANDELIONPP_FLUSH_AVERAGE      5 // seconds average for poisson distributed fluff flush
  #define CRYPTONOTE_DANDELIONPP_EMBARGO_AVERAGE  173 // seconds (see tx_pool.cpp for more info)
  
  // see src/cryptonote_protocol/levin_notify.cpp
  #define CRYPTONOTE_NOISE_MIN_EPOCH                      5      // minutes
  #define CRYPTONOTE_NOISE_EPOCH_RANGE                    30     // seconds
  #define CRYPTONOTE_NOISE_MIN_DELAY                      10     // seconds
  #define CRYPTONOTE_NOISE_DELAY_RANGE                    5      // seconds
  #define CRYPTONOTE_NOISE_BYTES                          3*1024 // 3 KiB
  #define CRYPTONOTE_NOISE_CHANNELS                       2      // Max outgoing connections per zone used for noise/covert sending
  
  #define CRYPTONOTE_MAX_FRAGMENTS                        20 // ~20 * NOISE_BYTES max payload size for covert/noise send
  
  #define COMMAND_RPC_GET_BLOCKS_FAST_MAX_COUNT           1000
  
  #define P2P_LOCAL_WHITE_PEERLIST_LIMIT                  1000
  #define P2P_LOCAL_GRAY_PEERLIST_LIMIT                   5000
  
  #define P2P_DEFAULT_CONNECTIONS_COUNT                   8
  #define P2P_DEFAULT_HANDSHAKE_INTERVAL                  60           //secondes
  #define P2P_DEFAULT_PACKET_MAX_SIZE                     50000000     //50000000 bytes maximum packet size
  #define P2P_DEFAULT_PEERS_IN_HANDSHAKE                  250
  #define P2P_DEFAULT_CONNECTION_TIMEOUT                  5000       //5 seconds
  #define P2P_DEFAULT_SOCKS_CONNECT_TIMEOUT               45         // seconds
  #define P2P_DEFAULT_PING_CONNECTION_TIMEOUT             2000       //2 seconds
  #define P2P_DEFAULT_INVOKE_TIMEOUT                      60*2*1000  //2 minutes
  #define P2P_DEFAULT_HANDSHAKE_INVOKE_TIMEOUT            5000       //5 seconds
  #define P2P_DEFAULT_WHITELIST_CONNECTIONS_PERCENT       70
  #define P2P_DEFAULT_ANCHOR_CONNECTIONS_COUNT            2
  #define P2P_DEFAULT_SYNC_SEARCH_CONNECTIONS_COUNT       2
  #define P2P_DEFAULT_LIMIT_RATE_UP                       2048       // kB/s
  #define P2P_DEFAULT_LIMIT_RATE_DOWN                     8192       // kB/s
  
  #define P2P_FAILED_ADDR_FORGET_SECONDS                  (60*60)     //1 hour
  #define P2P_IP_BLOCKTIME                                (60*60*24)  //24 hour
  #define P2P_IP_FAILS_BEFORE_BLOCK                       10
  #define P2P_IDLE_CONNECTION_KILL_INTERVAL               (5*60) //5 minutes
  
  #define P2P_SUPPORT_FLAG_FLUFFY_BLOCKS                  0x01
  #define P2P_SUPPORT_FLAGS                               P2P_SUPPORT_FLAG_FLUFFY_BLOCKS
  
  #define RPC_IP_FAILS_BEFORE_BLOCK                       3
  
  #define CRYPTONOTE_NAME                         "mask"
  #define CRYPTONOTE_POOLDATA_FILENAME            "poolstate.bin"
  #define CRYPTONOTE_BLOCKCHAINDATA_FILENAME      "data.mdb"
  #define CRYPTONOTE_BLOCKCHAINDATA_LOCK_FILENAME "lock.mdb"
  #define P2P_NET_DATA_FILENAME                   "p2pstate.bin"
  #define RPC_PAYMENTS_DATA_FILENAME              "rpcpayments.bin"
  #define MINER_CONFIG_FILE_NAME                  "miner_conf.json"
  
  #define THREAD_STACK_SIZE                       5 * 1024 * 1024
  
  #define HF_VERSION_DYNAMIC_FEE                  4
  #define HF_VERSION_MIN_MIXIN_4                  6
  #define HF_VERSION_MIN_MIXIN_6                  7
  #define HF_VERSION_MIN_MIXIN_10                 8
  #define HF_VERSION_ENFORCE_RCT                  6
  #define HF_VERSION_PER_BYTE_FEE                 8
  #define HF_VERSION_SMALLER_BP                   10
  #define HF_VERSION_LONG_TERM_BLOCK_WEIGHT       10
  #define HF_VERSION_MIN_2_OUTPUTS                12
  #define HF_VERSION_MIN_V2_COINBASE_TX           12
  #define HF_VERSION_SAME_MIXIN                   12
  #define HF_VERSION_REJECT_SIGS_IN_COINBASE      12
  #define HF_VERSION_ENFORCE_MIN_AGE              12
  #define HF_VERSION_EFFECTIVE_SHORT_TERM_MEDIAN_IN_PENALTY 12
  #define HF_VERSION_FUND                         12
  
  #define PER_KB_FEE_QUANTIZATION_DECIMALS        8
  
  #define HASH_OF_HASHES_STEP                     512
  
  #define DEFAULT_TXPOOL_MAX_WEIGHT               648000000ull // 3 days at 300000, in bytes
  
  #define BULLETPROOF_MAX_OUTPUTS                 16
  
  #define CRYPTONOTE_PRUNING_STRIPE_SIZE          4096 // the smaller, the smoother the increase
  #define CRYPTONOTE_PRUNING_LOG_STRIPES          3 // the higher, the more space saved
  #define CRYPTONOTE_PRUNING_TIP_BLOCKS           5500 // the smaller, the more space saved
  //#define CRYPTONOTE_PRUNING_DEBUG_SPOOF_SEED
  
  #define RPC_CREDITS_PER_HASH_SCALE ((float)(1<<24))
  
  // New constants are intended to go here
  namespace config
  {
    uint64_t const DEFAULT_FEE_ATOMIC_MASK_PER_KB = 500; // Just a placeholder!  Change me!
    uint8_t const FEE_CALCULATION_MAX_RETRIES = 10;
    uint64_t const DEFAULT_DUST_THRESHOLD = ((uint64_t)2000000000); // 2 * pow(10, 9)
    uint64_t const BASE_REWARD_CLAMP_THRESHOLD = ((uint64_t)100000000); // pow(10, 8)
  
    uint64_t const CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX = 18;
    uint64_t const CRYPTONOTE_PUBLIC_INTEGRATED_ADDRESS_BASE58_PREFIX = 19;
    uint64_t const CRYPTONOTE_PUBLIC_SUBADDRESS_BASE58_PREFIX = 42;
    uint16_t const P2P_DEFAULT_PORT = 40040;
    uint16_t const RPC_DEFAULT_PORT = 40041;
    uint16_t const ZMQ_RPC_DEFAULT_PORT = 40042;
    boost::uuids::uuid const NETWORK_ID = { {
        0xA1, 0x30, 0x46, 0xD2, 0xC3, 0x20, 0x09, 0xFF, 0xBA, 0x35, 0x59, 0x19, 0x20, 0xB3, 0x6A, 0xE1
      } }; // Bender's nightmare
  
    std::string const GENESIS_TX = "013c01ff0008ffb3ff83030269f8f9787e903e8ea30362026641ead7c2cc013627eab8e0c173dd2748505c7b80b4c4c32102b8b84982f853d8ffba142c3bfa2ec30e09d20b15427bfdad06a786f7b9a85fa58088aca3cf0202e93e16276e4d88d23dc0fbc89450ffac6a01dcf76e6ef577de0ed176f42dcae280b081daaf140229b45db9473dc7f7938ae7fd59d55a78449b31ff98a90fb97357c49ca6857da880a094a58d1d02b69c6c230b5a8f825328486878e66fd595b1b33cf366100088f28cac0db1621c80c0f4c198af0b02699a1aa0024be71bf195909c5bf0909452f5709e66cad307a67a8d4ced01d2ca8080d287e2bc2d028b68de3010b55b3d2c064a00550569a74978b9643e4196269d75a6f7a413e2ab8080b4ccd4dfc60302f39416eb0ed92ac05d25597f2fa4ad980b35c7f34bac31eefe9ec3238c73136321016e45b1f3436f133c9188ea7c547716af466d1a8dd8567b27f86d98992d35d15a";
  
    uint32_t const GENESIS_NONCE = 10000;
  
    const std::vector<std::string> FUND_WALLET_ADDRESS = {
      "48h2r1jgR4BVH4nfC3KMmQVqLSByw7XPuBvz3tkCvFwiCeRZSfNYWEZdqbNz2YR6iAgGFumB8DAwYfEwZSDe4ggx4eTn3ff",
      "49zzYJWw7fC17GghxcxtD4Zm4nfRnGt4x1KBc1d2Vs45ZYCu3Dwf5GQH24edVUmN2DMvH4FHGK1qDcuuuedmACeM94DScwA",
      "47r4Jm9jmdDPTgMuLa95Y4dEsMRKdpUF9PeDXCEifH8nUMyyTfwY5Pxe29b94p4mV5dU27yK9mkQbWZ4xnjWTqV2G3kuvhB"
    };
  
    // Hash domain separators
    const char HASH_KEY_BULLETPROOF_EXPONENT[] = "bulletproof";
    const char HASH_KEY_RINGDB[] = "ringdsb";
    const char HASH_KEY_SUBADDRESS[] = "SubAddr";
    const unsigned char HASH_KEY_ENCRYPTED_PAYMENT_ID = 0x8d;
    const unsigned char HASH_KEY_WALLET = 0x8c;
    const unsigned char HASH_KEY_WALLET_CACHE = 0x8d;
    const unsigned char HASH_KEY_RPC_PAYMENT_NONCE = 0x58;
    const unsigned char HASH_KEY_MEMORY = 'k';
    const unsigned char HASH_KEY_MULTISIG[] = {'M', 'u', 'l', 't' , 'i', 's', 'i', 'g', 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
  
    namespace testnet
    {
      uint64_t const CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX = 53;
      uint64_t const CRYPTONOTE_PUBLIC_INTEGRATED_ADDRESS_BASE58_PREFIX = 54;
      uint64_t const CRYPTONOTE_PUBLIC_SUBADDRESS_BASE58_PREFIX = 63;
      uint16_t const P2P_DEFAULT_PORT = 50050;
      uint16_t const RPC_DEFAULT_PORT = 50051;
      uint16_t const ZMQ_RPC_DEFAULT_PORT = 50052;
      boost::uuids::uuid const NETWORK_ID = { {
          0xD3 ,0x22 ,0xC7 ,0x19 ,0x43 ,0x10 ,0x11 ,0xA6 ,0xE2 ,0x1D ,0x17 ,0xB2 ,0xA8 ,0x21 ,0x51 ,0x1F
        } }; // Bender's daydream
  
      std::string const GENESIS_TX = "013c01ff0008ffb3ff830302c92f1a283a0064acc30f30c57b20b802d811d3c977424ed1a9d0268fb435d8c180b4c4c321025f54ae99f772c06b8fba408618939cb334af82b3491f6e6bdd7c80fc96a825868088aca3cf02024eb1ff87461196f1a62a05a4a86fcdb788a00aad25b56be801f279b2d85fe75980b081daaf14026bbe3de04645d53b36b82966f31676d25a0edbf17b15577d6c53f2825fe41dc180a094a58d1d02b77763819ab3b3d2265c7a0f73c6ade147296572dcd406e01331a77695cf035480c0f4c198af0b02f78705c171ad2f13f5f44243690917a9ebd6f45a22f4fb38442a73b4d46361eb8080d287e2bc2d023806d8f4208db98a7fae9d95a0d2f7ccdf9414994d0bd4e6b066f0edc32226108080b4ccd4dfc60302e6bc94af36bb1abb85aba480814a68e6556eef43686bb8846db8f7d6a8107a7d21011ea1ffb80474c5a6e38e2e6c8700c4879d2c7324f3c9e64ada5aec8b9e9c15d0";
  
      uint32_t const GENESIS_NONCE = 10001;
  
      const std::vector<std::string> FUND_WALLET_ADDRESS = {
        "48h2r1jgR4BVH4nfC3KMmQVqLSByw7XPuBvz3tkCvFwiCeRZSfNYWEZdqbNz2YR6iAgGFumB8DAwYfEwZSDe4ggx4eTn3ff",
        "49zzYJWw7fC17GghxcxtD4Zm4nfRnGt4x1KBc1d2Vs45ZYCu3Dwf5GQH24edVUmN2DMvH4FHGK1qDcuuuedmACeM94DScwA",
        "47r4Jm9jmdDPTgMuLa95Y4dEsMRKdpUF9PeDXCEifH8nUMyyTfwY5Pxe29b94p4mV5dU27yK9mkQbWZ4xnjWTqV2G3kuvhB"
      };
  
    }
  
    namespace stagenet
    {
      uint64_t const CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX = 24;
      uint64_t const CRYPTONOTE_PUBLIC_INTEGRATED_ADDRESS_BASE58_PREFIX = 25;
      uint64_t const CRYPTONOTE_PUBLIC_SUBADDRESS_BASE58_PREFIX = 36;
      uint16_t const P2P_DEFAULT_PORT = 60060;
      uint16_t const RPC_DEFAULT_PORT = 60061;
      uint16_t const ZMQ_RPC_DEFAULT_PORT = 60062;
      boost::uuids::uuid const NETWORK_ID = { {
          0x5B ,0x22 ,0xAA ,0x35 ,0xD1 ,0x3D ,0x4A ,0x9F ,0x54 ,0x14 ,0x4D ,0xCA ,0xB5 ,0x23 ,0xCA ,0x20
        } }; // Bender's daydream
  
      std::string const GENESIS_TX = "013c01ff0008ffb3ff83030279b33295ac9bea0149eb4c24f90b156a6458afe5f42111649fa16de2526df8a680b4c4c32102094bf709c7546d169b1ee9a6d707cfc30395e90f626299b3cd1fe1530793971f8088aca3cf0202fb092d6cc502202803ba4e7089e2e8b92e720fde36943758a41a883c67895c9480b081daaf140215adde259c42a0e9d54336448fa34c672c4469252aafe8e74044963044d867c580a094a58d1d02814c99207e53193a1bac0f307e3c78e4bcb83f89310b79e80628cdaaeb08ef4d80c0f4c198af0b02d2bf8f9754b5bae89877d012234df85f50a2e1b3a09d2d11508676851eee4a2a8080d287e2bc2d021a9c81abdccf5b1dcc59b7e57b365809a05c4738a138cfb6aa0380ae2f1551868080b4ccd4dfc60302a3f07c9af972b68365ba57ae5e9a61c1aa0bfdaa480526af16588e56efa568a02101ae917410f9f15ce4f7b15ba290577068e59b7f2d6332f11a93742bdfc91e7b32";
  
      uint32_t const GENESIS_NONCE = 10002;
  
      const std::vector<std::string> FUND_WALLET_ADDRESS = {
        "48h2r1jgR4BVH4nfC3KMmQVqLSByw7XPuBvz3tkCvFwiCeRZSfNYWEZdqbNz2YR6iAgGFumB8DAwYfEwZSDe4ggx4eTn3ff",
        "49zzYJWw7fC17GghxcxtD4Zm4nfRnGt4x1KBc1d2Vs45ZYCu3Dwf5GQH24edVUmN2DMvH4FHGK1qDcuuuedmACeM94DScwA",
        "47r4Jm9jmdDPTgMuLa95Y4dEsMRKdpUF9PeDXCEifH8nUMyyTfwY5Pxe29b94p4mV5dU27yK9mkQbWZ4xnjWTqV2G3kuvhB"
      };
  
    }
  }
  
  namespace cryptonote
  {
    enum network_type : uint8_t
    {
      MAINNET = 0,
      TESTNET,
      STAGENET,
      FAKECHAIN,
      UNDEFINED = 255
    };
    struct config_t
    {
      uint64_t const CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX;
      uint64_t const CRYPTONOTE_PUBLIC_INTEGRATED_ADDRESS_BASE58_PREFIX;
      uint64_t const CRYPTONOTE_PUBLIC_SUBADDRESS_BASE58_PREFIX;
      uint16_t const P2P_DEFAULT_PORT;
      uint16_t const RPC_DEFAULT_PORT;
      uint16_t const ZMQ_RPC_DEFAULT_PORT;
      boost::uuids::uuid const NETWORK_ID;
      std::string const GENESIS_TX;
      uint32_t const GENESIS_NONCE;
    };
    inline const config_t& get_config(network_type nettype)
    {
      static const config_t mainnet = {
        ::config::CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX,
        ::config::CRYPTONOTE_PUBLIC_INTEGRATED_ADDRESS_BASE58_PREFIX,
        ::config::CRYPTONOTE_PUBLIC_SUBADDRESS_BASE58_PREFIX,
        ::config::P2P_DEFAULT_PORT,
        ::config::RPC_DEFAULT_PORT,
        ::config::ZMQ_RPC_DEFAULT_PORT,
        ::config::NETWORK_ID,
        ::config::GENESIS_TX,
        ::config::GENESIS_NONCE
      };
      static const config_t testnet = {
        ::config::testnet::CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX,
        ::config::testnet::CRYPTONOTE_PUBLIC_INTEGRATED_ADDRESS_BASE58_PREFIX,
        ::config::testnet::CRYPTONOTE_PUBLIC_SUBADDRESS_BASE58_PREFIX,
        ::config::testnet::P2P_DEFAULT_PORT,
        ::config::testnet::RPC_DEFAULT_PORT,
        ::config::testnet::ZMQ_RPC_DEFAULT_PORT,
        ::config::testnet::NETWORK_ID,
        ::config::testnet::GENESIS_TX,
        ::config::testnet::GENESIS_NONCE
      };
      static const config_t stagenet = {
        ::config::stagenet::CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX,
        ::config::stagenet::CRYPTONOTE_PUBLIC_INTEGRATED_ADDRESS_BASE58_PREFIX,
        ::config::stagenet::CRYPTONOTE_PUBLIC_SUBADDRESS_BASE58_PREFIX,
        ::config::stagenet::P2P_DEFAULT_PORT,
        ::config::stagenet::RPC_DEFAULT_PORT,
        ::config::stagenet::ZMQ_RPC_DEFAULT_PORT,
        ::config::stagenet::NETWORK_ID,
        ::config::stagenet::GENESIS_TX,
        ::config::stagenet::GENESIS_NONCE
      };
      switch (nettype)
      {
        case MAINNET: return mainnet;
        case TESTNET: return testnet;
        case STAGENET: return stagenet;
        case FAKECHAIN: return mainnet;
        default: throw std::runtime_error("Invalid network type");
      }
    };
  }
  