42a33457bf
Every Triangles wallet is now a Tor node. Staking rewards subsidize Tor infrastructure. Core changes: - Embedded Tor 0.4.9.6 as git submodule - ConnectNode rejects all non-.onion peers - Tor failure is fatal - wallet requires Tor to operate - All proxies forced through embedded Tor SOCKS - Clearnet (IPv4/IPv6) disabled at startup - HTTP seed fetch routes through Tor proxy (removed boost::asio dep) - Merged PoW cleanup: -623 lines of dead mining code - Stripped dead LEGACY/MIXED bootstrap modes from net_bootstrap - RPC getnetworkinfo reports tor_native mode Tooling: - scripts/bump-version.sh syncs version across all 17+ files - Version bumped to 5.6.0 across all packaging manifests Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
54 lines
1.5 KiB
C++
54 lines
1.5 KiB
C++
// Copyright (c) 2024 Triangles developers
|
|
// Network Bootstrap Configuration for Triangles
|
|
// Distributed under the MIT/X11 software license
|
|
|
|
#ifndef TRIANGLES_NET_BOOTSTRAP_H
|
|
#define TRIANGLES_NET_BOOTSTRAP_H
|
|
|
|
#include <cstdint>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
// Tor-native network bootstrap configuration.
|
|
// All connections route through embedded Tor. Clearnet is disabled.
|
|
|
|
namespace NetBootstrap {
|
|
|
|
// Network protocol compatibility settings
|
|
struct NetworkConfig {
|
|
static const int MIN_PROTOCOL_VERSION_OLD_WALLET = 70200;
|
|
static const int CURRENT_PROTOCOL_VERSION = 70205;
|
|
|
|
// Network ports
|
|
static const int DEFAULT_PORT_MAINNET = 24112;
|
|
static const int DEFAULT_PORT_TESTNET = 24111;
|
|
static const int DEFAULT_RPC_PORT_MAINNET = 19112;
|
|
static const int DEFAULT_RPC_PORT_TESTNET = 19111;
|
|
|
|
// Connection limits
|
|
static const int MAX_CONNECTIONS_DEFAULT = 64;
|
|
static const int MAX_OUTBOUND_CONNECTIONS = 8;
|
|
|
|
// Tor configuration
|
|
static const int TOR_HIDDEN_SERVICE_PORT = 24112;
|
|
|
|
// Timeouts
|
|
static const int CONNECTION_TIMEOUT_SECONDS = 30;
|
|
static const int PEER_DISCOVERY_INTERVAL_SECONDS = 3600;
|
|
};
|
|
|
|
// Network health monitoring
|
|
struct NetworkHealth {
|
|
int connectedPeers;
|
|
int torPeers;
|
|
bool isBootstrapped;
|
|
bool isSyncing;
|
|
int64_t lastBlockTime;
|
|
};
|
|
|
|
NetworkHealth GetNetworkHealth();
|
|
|
|
} // namespace NetBootstrap
|
|
|
|
#endif // TRIANGLES_NET_BOOTSTRAP_H
|