 9d9d377fce
			
		
	
	
	
	
	9d9d377fce* IPC 2.0 * Use nano::locked for confirmation subscriber vector * Remove unused local * Update toml tests, fix some const issues * Some access permission improvements * Comments and nano::locked improvements * Guilherme review feedback: formatting, advanced cmake flags, disallow deny for roles * Wesley feedback * Try to please win build on CI * Add generated file to git ignore * install api/flatbuffers/* depending on platform * correct path for api in MacOS app * add api to docker image Co-authored-by: Russel Waters <vaelstrom@gmail.com>
		
			
				
	
	
		
			67 lines
		
	
	
	
		
			1.8 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			67 lines
		
	
	
	
		
			1.8 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
| #include <nano/lib/config.hpp>
 | |
| 
 | |
| #include <boost/filesystem/path.hpp>
 | |
| #include <boost/lexical_cast.hpp>
 | |
| 
 | |
| #include <valgrind/valgrind.h>
 | |
| 
 | |
| namespace nano
 | |
| {
 | |
| const char * network_constants::active_network_err_msg = "Invalid network. Valid values are live, beta and test.";
 | |
| 
 | |
| uint8_t get_major_node_version ()
 | |
| {
 | |
| 	return boost::numeric_cast<uint8_t> (boost::lexical_cast<int> (NANO_MAJOR_VERSION_STRING));
 | |
| }
 | |
| uint8_t get_minor_node_version ()
 | |
| {
 | |
| 	return boost::numeric_cast<uint8_t> (boost::lexical_cast<int> (NANO_MINOR_VERSION_STRING));
 | |
| }
 | |
| uint8_t get_patch_node_version ()
 | |
| {
 | |
| 	return boost::numeric_cast<uint8_t> (boost::lexical_cast<int> (NANO_PATCH_VERSION_STRING));
 | |
| }
 | |
| uint8_t get_pre_release_node_version ()
 | |
| {
 | |
| 	return boost::numeric_cast<uint8_t> (boost::lexical_cast<int> (NANO_PRE_RELEASE_VERSION_STRING));
 | |
| }
 | |
| 
 | |
| void force_nano_test_network ()
 | |
| {
 | |
| 	nano::network_constants::set_active_network (nano::nano_networks::nano_test_network);
 | |
| }
 | |
| 
 | |
| bool running_within_valgrind ()
 | |
| {
 | |
| 	return (RUNNING_ON_VALGRIND > 0);
 | |
| }
 | |
| 
 | |
| std::string get_config_path (boost::filesystem::path const & data_path)
 | |
| {
 | |
| 	return (data_path / "config.json").string ();
 | |
| }
 | |
| 
 | |
| std::string get_rpc_config_path (boost::filesystem::path const & data_path)
 | |
| {
 | |
| 	return (data_path / "rpc_config.json").string ();
 | |
| }
 | |
| 
 | |
| std::string get_node_toml_config_path (boost::filesystem::path const & data_path)
 | |
| {
 | |
| 	return (data_path / "config-node.toml").string ();
 | |
| }
 | |
| 
 | |
| std::string get_rpc_toml_config_path (boost::filesystem::path const & data_path)
 | |
| {
 | |
| 	return (data_path / "config-rpc.toml").string ();
 | |
| }
 | |
| 
 | |
| std::string get_qtwallet_toml_config_path (boost::filesystem::path const & data_path)
 | |
| {
 | |
| 	return (data_path / "config-qtwallet.toml").string ();
 | |
| }
 | |
| std::string get_access_toml_config_path (boost::filesystem::path const & data_path)
 | |
| {
 | |
| 	return (data_path / "config-access.toml").string ();
 | |
| }
 | |
| }
 |