Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions builds/msvc/vs2026/bs/bs.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@
<Import Project="$(NuGetPackageRoot)libbitcoin-boost_thread-vc145.1.91.0\build\libbitcoin-boost_thread-vc145.targets" Condition="Exists('$(NuGetPackageRoot)libbitcoin-boost_thread-vc145.1.91.0\build\libbitcoin-boost_thread-vc145.targets')" />
<Import Project="$(NuGetPackageRoot)libbitcoin-boost_url-vc145.1.91.0\build\libbitcoin-boost_url-vc145.targets" Condition="Exists('$(NuGetPackageRoot)libbitcoin-boost_url-vc145.1.91.0\build\libbitcoin-boost_url-vc145.targets')" />
<Import Project="$(NuGetPackageRoot)secp256k1_vc145.0.8.0\build\native\secp256k1_vc145.targets" Condition="Exists('$(NuGetPackageRoot)secp256k1_vc145.0.8.0\build\native\secp256k1_vc145.targets')" />
<Import Project="$(NuGetPackageRoot)UltrafastSecp256k1-vc145.4.5.0.0\build\native\UltrafastSecp256k1-vc145.targets" Condition="Exists('$(NuGetPackageRoot)UltrafastSecp256k1-vc145.4.5.0.0\build\native\UltrafastSecp256k1-vc145.targets')" />
<Import Project="$(NuGetPackageRoot)UltrafastSecp256k1-vc145.4.5.0.3\build\native\UltrafastSecp256k1-vc145.targets" Condition="Exists('$(NuGetPackageRoot)UltrafastSecp256k1-vc145.4.5.0.3\build\native\UltrafastSecp256k1-vc145.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
Expand All @@ -184,7 +184,7 @@
<Error Condition="!Exists('$(NuGetPackageRoot)libbitcoin-boost_thread-vc145.1.91.0\build\libbitcoin-boost_thread-vc145.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(NuGetPackageRoot)libbitcoin-boost_thread-vc145.1.91.0\build\libbitcoin-boost_thread-vc145.targets'))" />
<Error Condition="!Exists('$(NuGetPackageRoot)libbitcoin-boost_url-vc145.1.91.0\build\libbitcoin-boost_url-vc145.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(NuGetPackageRoot)libbitcoin-boost_url-vc145.1.91.0\build\libbitcoin-boost_url-vc145.targets'))" />
<Error Condition="!Exists('$(NuGetPackageRoot)secp256k1_vc145.0.8.0\build\native\secp256k1_vc145.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(NuGetPackageRoot)secp256k1_vc145.0.8.0\build\native\secp256k1_vc145.targets'))" />
<Error Condition="!Exists('$(NuGetPackageRoot)UltrafastSecp256k1-vc145.4.5.0.0\build\native\UltrafastSecp256k1-vc145.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(NuGetPackageRoot)UltrafastSecp256k1-vc145.4.5.0.0\build\native\UltrafastSecp256k1-vc145.targets'))" />
<Error Condition="!Exists('$(NuGetPackageRoot)UltrafastSecp256k1-vc145.4.5.0.3\build\native\UltrafastSecp256k1-vc145.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(NuGetPackageRoot)UltrafastSecp256k1-vc145.4.5.0.3\build\native\UltrafastSecp256k1-vc145.targets'))" />
</Target>
<ItemGroup>
<ProjectReference Include="..\libbitcoin-server\libbitcoin-server.vcxproj">
Expand Down
2 changes: 1 addition & 1 deletion builds/msvc/vs2026/bs/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
|
-->
<packages>
<package id="UltrafastSecp256k1-vc145" version="4.5.0.0" targetFramework="Native" />
<package id="UltrafastSecp256k1-vc145" version="4.5.0.3" targetFramework="Native" />
<package id="libbitcoin-boost" version="1.91.0" targetFramework="Native" />
<package id="libbitcoin-boost_container-vc145" version="1.91.0" targetFramework="Native" />
<package id="libbitcoin-boost_iostreams-vc145" version="1.91.0" targetFramework="Native" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@
<Import Project="$(NuGetPackageRoot)libbitcoin-boost_unit_test_framework-vc145.1.91.0\build\libbitcoin-boost_unit_test_framework-vc145.targets" Condition="Exists('$(NuGetPackageRoot)libbitcoin-boost_unit_test_framework-vc145.1.91.0\build\libbitcoin-boost_unit_test_framework-vc145.targets')" />
<Import Project="$(NuGetPackageRoot)libbitcoin-boost_url-vc145.1.91.0\build\libbitcoin-boost_url-vc145.targets" Condition="Exists('$(NuGetPackageRoot)libbitcoin-boost_url-vc145.1.91.0\build\libbitcoin-boost_url-vc145.targets')" />
<Import Project="$(NuGetPackageRoot)secp256k1_vc145.0.8.0\build\native\secp256k1_vc145.targets" Condition="Exists('$(NuGetPackageRoot)secp256k1_vc145.0.8.0\build\native\secp256k1_vc145.targets')" />
<Import Project="$(NuGetPackageRoot)UltrafastSecp256k1-vc145.4.5.0.0\build\native\UltrafastSecp256k1-vc145.targets" Condition="Exists('$(NuGetPackageRoot)UltrafastSecp256k1-vc145.4.5.0.0\build\native\UltrafastSecp256k1-vc145.targets')" />
<Import Project="$(NuGetPackageRoot)UltrafastSecp256k1-vc145.4.5.0.3\build\native\UltrafastSecp256k1-vc145.targets" Condition="Exists('$(NuGetPackageRoot)UltrafastSecp256k1-vc145.4.5.0.3\build\native\UltrafastSecp256k1-vc145.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
Expand All @@ -211,7 +211,7 @@
<Error Condition="!Exists('$(NuGetPackageRoot)libbitcoin-boost_unit_test_framework-vc145.1.91.0\build\libbitcoin-boost_unit_test_framework-vc145.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(NuGetPackageRoot)libbitcoin-boost_unit_test_framework-vc145.1.91.0\build\libbitcoin-boost_unit_test_framework-vc145.targets'))" />
<Error Condition="!Exists('$(NuGetPackageRoot)libbitcoin-boost_url-vc145.1.91.0\build\libbitcoin-boost_url-vc145.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(NuGetPackageRoot)libbitcoin-boost_url-vc145.1.91.0\build\libbitcoin-boost_url-vc145.targets'))" />
<Error Condition="!Exists('$(NuGetPackageRoot)secp256k1_vc145.0.8.0\build\native\secp256k1_vc145.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(NuGetPackageRoot)secp256k1_vc145.0.8.0\build\native\secp256k1_vc145.targets'))" />
<Error Condition="!Exists('$(NuGetPackageRoot)UltrafastSecp256k1-vc145.4.5.0.0\build\native\UltrafastSecp256k1-vc145.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(NuGetPackageRoot)UltrafastSecp256k1-vc145.4.5.0.0\build\native\UltrafastSecp256k1-vc145.targets'))" />
<Error Condition="!Exists('$(NuGetPackageRoot)UltrafastSecp256k1-vc145.4.5.0.3\build\native\UltrafastSecp256k1-vc145.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(NuGetPackageRoot)UltrafastSecp256k1-vc145.4.5.0.3\build\native\UltrafastSecp256k1-vc145.targets'))" />
</Target>
<ItemGroup>
<ProjectReference Include="..\libbitcoin-server\libbitcoin-server.vcxproj">
Expand Down
2 changes: 1 addition & 1 deletion builds/msvc/vs2026/libbitcoin-server-test/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
|
-->
<packages>
<package id="UltrafastSecp256k1-vc145" version="4.5.0.0" targetFramework="Native" />
<package id="UltrafastSecp256k1-vc145" version="4.5.0.3" targetFramework="Native" />
<package id="libbitcoin-boost" version="1.91.0" targetFramework="Native" />
<package id="libbitcoin-boost_container-vc145" version="1.91.0" targetFramework="Native" />
<package id="libbitcoin-boost_iostreams-vc145" version="1.91.0" targetFramework="Native" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@
<Import Project="$(NuGetPackageRoot)libbitcoin-boost_thread-vc145.1.91.0\build\libbitcoin-boost_thread-vc145.targets" Condition="Exists('$(NuGetPackageRoot)libbitcoin-boost_thread-vc145.1.91.0\build\libbitcoin-boost_thread-vc145.targets')" />
<Import Project="$(NuGetPackageRoot)libbitcoin-boost_url-vc145.1.91.0\build\libbitcoin-boost_url-vc145.targets" Condition="Exists('$(NuGetPackageRoot)libbitcoin-boost_url-vc145.1.91.0\build\libbitcoin-boost_url-vc145.targets')" />
<Import Project="$(NuGetPackageRoot)secp256k1_vc145.0.8.0\build\native\secp256k1_vc145.targets" Condition="Exists('$(NuGetPackageRoot)secp256k1_vc145.0.8.0\build\native\secp256k1_vc145.targets')" />
<Import Project="$(NuGetPackageRoot)UltrafastSecp256k1-vc145.4.5.0.0\build\native\UltrafastSecp256k1-vc145.targets" Condition="Exists('$(NuGetPackageRoot)UltrafastSecp256k1-vc145.4.5.0.0\build\native\UltrafastSecp256k1-vc145.targets')" />
<Import Project="$(NuGetPackageRoot)UltrafastSecp256k1-vc145.4.5.0.3\build\native\UltrafastSecp256k1-vc145.targets" Condition="Exists('$(NuGetPackageRoot)UltrafastSecp256k1-vc145.4.5.0.3\build\native\UltrafastSecp256k1-vc145.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
Expand All @@ -286,7 +286,7 @@
<Error Condition="!Exists('$(NuGetPackageRoot)libbitcoin-boost_thread-vc145.1.91.0\build\libbitcoin-boost_thread-vc145.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(NuGetPackageRoot)libbitcoin-boost_thread-vc145.1.91.0\build\libbitcoin-boost_thread-vc145.targets'))" />
<Error Condition="!Exists('$(NuGetPackageRoot)libbitcoin-boost_url-vc145.1.91.0\build\libbitcoin-boost_url-vc145.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(NuGetPackageRoot)libbitcoin-boost_url-vc145.1.91.0\build\libbitcoin-boost_url-vc145.targets'))" />
<Error Condition="!Exists('$(NuGetPackageRoot)secp256k1_vc145.0.8.0\build\native\secp256k1_vc145.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(NuGetPackageRoot)secp256k1_vc145.0.8.0\build\native\secp256k1_vc145.targets'))" />
<Error Condition="!Exists('$(NuGetPackageRoot)UltrafastSecp256k1-vc145.4.5.0.0\build\native\UltrafastSecp256k1-vc145.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(NuGetPackageRoot)UltrafastSecp256k1-vc145.4.5.0.0\build\native\UltrafastSecp256k1-vc145.targets'))" />
<Error Condition="!Exists('$(NuGetPackageRoot)UltrafastSecp256k1-vc145.4.5.0.3\build\native\UltrafastSecp256k1-vc145.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(NuGetPackageRoot)UltrafastSecp256k1-vc145.4.5.0.3\build\native\UltrafastSecp256k1-vc145.targets'))" />
</Target>
<ItemGroup>
<Natvis Include="..\..\debug.natvis" />
Expand Down
2 changes: 1 addition & 1 deletion builds/msvc/vs2026/libbitcoin-server/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
|
-->
<packages>
<package id="UltrafastSecp256k1-vc145" version="4.5.0.0" targetFramework="Native" />
<package id="UltrafastSecp256k1-vc145" version="4.5.0.3" targetFramework="Native" />
<package id="libbitcoin-boost" version="1.91.0" targetFramework="Native" />
<package id="libbitcoin-boost_container-vc145" version="1.91.0" targetFramework="Native" />
<package id="libbitcoin-boost_iostreams-vc145" version="1.91.0" targetFramework="Native" />
Expand Down
9 changes: 8 additions & 1 deletion console/executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,16 @@ executor& executor::factory(parser& metadata, std::istream& input,
std::ostream& output, std::ostream& error)
{
// TODO: expose fork_flags() mapping from system static chain_state method.
////metadata.configured.database.fork_flags =
////metadata.configured.database.fork_flags =
//// metadata.configured.bitcoin.fork_flags();

// Suppress configured batch cache sizing when batching cannot run.
if (!system::batched::accelerated())
{
metadata.configured.database.ecdsa.size = 0;
metadata.configured.database.schnorr.size = 0;
}

static executor instance(metadata, input, output, error);
return instance;
}
Expand Down
2 changes: 1 addition & 1 deletion console/executor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class executor
bool restore_store(bool details=false);
bool hot_backup_store(bool details=false);
bool cold_backup_store(bool details=false);
bool prompt_milestone() const;
bool prompt_milestone_store() const;

// Long-running queries (scans).
void scan_flags() const;
Expand Down
16 changes: 7 additions & 9 deletions console/executor_runner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,15 @@ bool executor::do_run()
return false;
}
}
else if (!prompt_milestone())
else if (!check_store_path(true) || !create_store(true))
{
logger(BS_MILESTONE_HALTED);
stopper(BS_NODE_STOPPED);
return false;
}
else if (!check_store_path(true) || !create_store(true))

if (!prompt_milestone_store())
{
close_store();
stopper(BS_NODE_STOPPED);
return false;
}
Expand Down Expand Up @@ -192,15 +193,12 @@ bool executor::do_run()
////logger(BS_INFORMATION_PROGRESS_START);
////dump_progress();

if (!close_store(true))
{
stopper(BS_NODE_STOPPED);
return false;
}
// Store close logs its own results.
const auto result = close_store(true);

// Stop console capture and issue terminating log message.
stopper(BS_NODE_STOPPED);
return true;
return result;
}

} // namespace server
Expand Down
77 changes: 43 additions & 34 deletions console/executor_store.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,40 +62,6 @@ bool executor::check_store_path(bool create) const
return true;
}

bool executor::prompt_milestone() const
{
const auto& milestone = metadata_.configured.bitcoin.milestone;
if (metadata_.is_configured(settings::milestone))
{
logger(format(BS_MILESTONE_CONFIGURED) % milestone);
return true;
}

if (service_ || is_zero(milestone.height()))
return true;

logger(format(BS_MILESTONE_PROMPT) % milestone);
logger(BS_MILESTONE_CHOICE);

for (std::string line{}; std::getline(input_, line);)
{
if (canceled())
return false;

system::trim(line);
if (line.empty())
return true;

if (line == "c")
return false;

logger(BS_MILESTONE_CHOICE);
}

// Halt on <ctrl-c> invalidation, continue when console is unavailable.
return !canceled();
}

bool executor::create_store(bool details)
{
logger(BS_INITCHAIN_CREATING);
Expand Down Expand Up @@ -296,5 +262,48 @@ bool executor::cold_backup_store(bool details)
return true;
}

bool executor::prompt_milestone_store() const
{
const auto& milestone = metadata_.configured.bitcoin.milestone;
if (metadata_.is_configured(settings::milestone))
{
logger(format(BS_BITCOIN_MILESTONE) % milestone);
return true;
}

const auto genesis_default = is_zero(milestone.height());
if (genesis_default || service_ || store_.is_dirty())
return true;

logger(BS_MILESTONE_SETOFF);
logger(format(BS_MILESTONE_PROMPT1));
logger(format(BS_MILESTONE_PROMPT2));
logger(format(BS_MILESTONE_PROMPT3));
logger(format(BS_BITCOIN_MILESTONE) % milestone);
logger(BS_MILESTONE_CHOICE1);
logger(BS_MILESTONE_CHOICE2);
logger(BS_MILESTONE_SETOFF);

std::string line{};
while (std::getline(input_, line) && !canceled())
{
system::trim(line);
if (line.empty())
return true;

if (line == "c")
{
logger(BS_MILESTONE_HALTED1);
logger(BS_MILESTONE_HALTED2);
return false;
}

logger(BS_MILESTONE_CHOICE1);
logger(BS_MILESTONE_CHOICE2);
}

return false;
}

} // namespace server
} // namespace libbitcoin
30 changes: 20 additions & 10 deletions console/localize.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,26 @@
#define BS_OPERATION_CANCELED \
"CTRL-C detected, canceling operation..."

// bitcoin.milestone
#define BS_MILESTONE_SETOFF \
"--------------------------------------------------------------------------"
#define BS_MILESTONE_PROMPT1 \
"If you have previously validated you may want to utilize a milestone."
#define BS_MILESTONE_PROMPT2 \
"A milestone bypasses full validation of all previous blocks and itself."
#define BS_MILESTONE_PROMPT3 \
"The default milestone in this build is the following block hash:height"
#define BS_BITCOIN_MILESTONE \
"bitcoin.milestone = %1%"
#define BS_MILESTONE_CHOICE1 \
"Press <enter> to continue with this default as a block you have validated."
#define BS_MILESTONE_CHOICE2 \
"Enter 'c' to stop so you can set a different milestone in configuration."
#define BS_MILESTONE_HALTED1 \
"Set a previously-validated milestone in your configuration file."
#define BS_MILESTONE_HALTED2 \
"Set to genesis-hash:0 if you have not validated previously."

// --settings
#define BS_SETTINGS_MESSAGE \
"These are the configuration settings that can be set."
Expand All @@ -59,16 +79,6 @@
"Storing genesis block."
#define BS_INITCHAIN_DATABASE_INITIALIZE_FAILURE \
"Failure storing genesis block."
#define BS_MILESTONE_CONFIGURED \
"The configured milestone %1% will bypass validation up to that block."
#define BS_MILESTONE_PROMPT \
"This is a new store, the default milestone %1% will bypass " \
"validation up to that block."
#define BS_MILESTONE_CHOICE \
"Press <enter> to continue with the default milestone, or 'c' to close."
#define BS_MILESTONE_HALTED \
"Startup halted, set or clear bitcoin.milestone in the configuration " \
"and restart."

// --restore
#define BS_SNAPSHOT_INVALID \
Expand Down
Loading