1
0
Fork 0
forked from lthn/blockchain

Switch to conanfile.py, update build scripts and genesis data

Replaces conanfile.txt with conanfile.py for improved Conan package management. Updates Makefile and CMakeLists.txt to align with new Conan workflow and build folder structure. Increases premine amount in default.cmake and updates genesis transaction data. Comments out a hardcoded seed node in net_node.inl.
This commit is contained in:
Snider 2025-10-01 18:04:44 +01:00
parent edbbf2888b
commit 89c6833845
8 changed files with 58 additions and 20 deletions

View file

@ -86,7 +86,7 @@ endif()
set(USE_PCH FALSE CACHE BOOL "Use shared precompiled headers")
set(DISABLE_TOR FALSE CACHE BOOL "Disable TOR library(and related tor-connect submodule)")
set(TESTNET FALSE CACHE BOOL "Compile for testnet")
set(TESTNET 0 CACHE BOOL "Build TESTNET")
set(BUILD_GUI FALSE CACHE BOOL "Build qt-daemon")
set(USE_BITCOIN_SECP256K1_FOR_ECDSA FALSE CACHE BOOL "Use bitcoin-secp256k1 library for validating ECDSA(instead of OpenSSL)")
if(NOT USE_BITCOIN_SECP256K1_FOR_ECDSA)

View file

@ -15,6 +15,7 @@ TESTNET:= 0
STATIC:= 0
BUILD_TYPE ?=Release
BUILD_VERSION:=6.0.1
BUILD_FOLDER:=build/Release
# -----------------------------------------------------------------
# Unixlike systems (Linux, macOS, *BSD, etc.)
@ -82,11 +83,11 @@ CC_DOCKER_FILE?=utils/docker/images/lthn-chain/Dockerfile
all: help
release: conan-profile-detect
@echo "Building profile: release $(TESTNET)"
CONAN_HOME=$(CONAN_CACHE) conan install . --output-folder=build/release --build=missing -s build_type=$(BUILD_TYPE)
cmake -S . -B build/release -DCMAKE_TOOLCHAIN_FILE=build/release/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -DSTATIC=$(STATIC) -DTESTNET=$(TESTNET) -DBUILD_VERSION=$(BUILD_VERSION)
cmake --build build/release --config=$(BUILD_TYPE) --parallel=$(CPU_CORES)
(cd build/release && cpack)
@echo "Building profile: $(BUILD_TYPE) testnet=$(TESTNET)"
CONAN_HOME=$(CONAN_CACHE) conan install . --build=missing -s build_type=$(BUILD_TYPE)
cmake -S . -B $(BUILD_FOLDER) -DCMAKE_TOOLCHAIN_FILE=$(BUILD_FOLDER)/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -DSTATIC=$(STATIC) -DTESTNET=$(TESTNET) -DBUILD_VERSION=$(BUILD_VERSION)
cmake --build $(BUILD_FOLDER) --config=$(BUILD_TYPE) --parallel=$(CPU_CORES)
(cd $(BUILD_FOLDER) && cpack)
debug: conan-profile-detect
@echo "Building profile: debug"

47
conanfile.py Normal file
View file

@ -0,0 +1,47 @@
import os
from conan import ConanFile
from conan.tools.cmake import cmake_layout, CMakeDeps, CMakeToolchain, CMake
class BlockchainConan(ConanFile):
name = "blockchain"
version = "6.0.1"
settings = "os", "compiler", "build_type", "arch"
options = {
"static": [True, False],
"testnet": [True, False]
}
default_options = {
"static": False,
"testnet": False
}
requires = [
"zlib/1.3.1",
"boost/1.85.0",
"openssl/3.2.0",
"miniupnpc/2.2.5",
"jwt-cpp/0.7.1"
]
def generate(self):
tc = CMakeToolchain(self)
tc.user_presets_path = False
tc.variables["STATIC"] = self.options.static
tc.variables["TESTNET"] = self.options.testnet
# tc.preprocessor_definitions["TESTNET"] = None
# tc.variables["BUILD_VERSION"] = self.options.build_version
tc.generate()
deps = CMakeDeps(self)
deps.generate()
def layout(self):
cmake_layout(self)
def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()

View file

@ -1,10 +0,0 @@
[requires]
zlib/1.3.1
boost/1.85.0
openssl/3.2.0
miniupnpc/2.2.5
jwt-cpp/0.7.1
[generators]
CMakeDeps
CMakeToolchain

View file

@ -1,6 +1,6 @@
# Tokenomics
set(coin 1000000000000 CACHE STRING "COIN" )
set(premine_amount 4000000000000000000 CACHE STRING "PREMINE_AMOUNT" )
set(premine_amount 10000000000000000000 CACHE STRING "PREMINE_AMOUNT" )
set(tx_default_fee 10000000000 CACHE STRING "TX_DEFAULT_FEE" )
set(tx_minimum_fee 10000000000 CACHE STRING "TX_MINIMUM_FEE" )
set(currency_block_reward 1000000000000 CACHE STRING "CURRENCY_BLOCK_REWARD" )

View file

@ -1,4 +1,4 @@
const std::string ggenesis_tx_pub_key_str = "6f7fbc7dfa2809974084b92e8930353b7e93f8759979ff037984a1837fb3948a";
const std::string ggenesis_tx_pub_key_str = "f971f914382e875df5655f591c8df7b126d95f5e8331613ba3f5c797f541839c";
const crypto::public_key ggenesis_tx_pub_key = epee::string_tools::parse_tpod_from_hex_string<crypto::public_key>(ggenesis_tx_pub_key_str);
extern const genesis_tx_dictionary_entry ggenesis_dict[1];
const genesis_tx_dictionary_entry ggenesis_dict[1] = {

View file

@ -1,3 +1,3 @@
const genesis_tx_raw_data ggenesis_tx_raw = {{
0xa080800100000101,0x03018ae3c8e0c8cf,0xa0a1421a26cc1373,0x73787ce6cb72c402,0x3fda9ba544cff9e4,0xa0e3d415d65186dd,0xfa7dbc7f6f160500,0x892eb98440970928,0x9975f8937e3b3530,0x7f83a1847903ff79,0x2074496b138a94b3,0x64612073656b6174,0x20656761746e6176,0x6e2065687420666f,0x666f206572757461,0x616d726f666e6920,0x696562206e6f6974,0x207973616520676e,0x6165727073206f74,0x6168207475622064,0x7473206f74206472,0x202d202e656c6669,0x206968736f746153,0x6f746f6d616b614e,0x0a0eddbc020b0015},
0xa080800100000101,0x03018ae3c8e0c8cf,0x7b0287d2a2218485,0x720c5b385edbe3dd,0x178e7c64d18a598f,0x98bb613ff63e6d03,0x3814f971f9160500,0x1c595f65f55d872e,0x835e5fd926b1f78d,0xf597c7f5a33b6131,0x2074496b139c8341,0x64612073656b6174,0x20656761746e6176,0x6e2065687420666f,0x666f206572757461,0x616d726f666e6920,0x696562206e6f6974,0x207973616520676e,0x6165727073206f74,0x6168207475622064,0x7473206f74206472,0x202d202e656c6669,0x206968736f746153,0x6f746f6d616b614e,0x0a0e0d66020b0015},
{0x00,0x00}};

View file

@ -434,7 +434,7 @@ namespace nodetool
{
#ifndef TESTNET
//TODO:
ADD_HARDCODED_SEED_NODE(std::string("0.0.0.0:") + std::to_string(P2P_DEFAULT_PORT));
// ADD_HARDCODED_SEED_NODE(std::string("0.0.0.0:") + std::to_string(P2P_DEFAULT_PORT));
ADD_HARDCODED_SEED_NODE("116.202.82.115", P2P_DEFAULT_PORT);
//ADD_HARDCODED_SEED_NODE("94.130.137.230", P2P_DEFAULT_PORT);
//ADD_HARDCODED_SEED_NODE("95.217.42.247", P2P_DEFAULT_PORT);