24 (
"wallet-dir", bpo::value<boost::filesystem::path>()->default_value(
"."),
25 "The path of the wallet files (absolute path or relative to application data dir)")
26 (
"unlock-timeout", bpo::value<int64_t>()->default_value(900),
27 "Timeout for unlocked wallet in seconds (default 900 (15 minutes)). "
28 "Wallets will automatically lock after specified number of seconds of inactivity. "
29 "Activity is defined as any wallet command e.g. list-wallets.")
30 (
"yubihsm-url", bpo::value<string>()->value_name(
"URL"),
31 "Override default URL of http://localhost:12345 for connecting to yubihsm-connector")
32 (
"yubihsm-authkey", bpo::value<uint16_t>()->value_name(
"key_num"),
33 "Enables YubiHSM support using given Authkey")
38 ilog(
"initializing wallet plugin");
40 wallet_manager_ptr = std::make_unique<wallet_manager>();
42 if (options.count(
"wallet-dir")) {
43 auto dir = options.at(
"wallet-dir").as<boost::filesystem::path>();
44 if (dir.is_relative())
46 if( !bfs::exists(dir) )
47 bfs::create_directories(dir);
48 wallet_manager_ptr->set_dir(dir);
50 if (options.count(
"unlock-timeout")) {
51 auto timeout = options.at(
"unlock-timeout").as<
int64_t>();
52 SYS_ASSERT(timeout > 0, chain::invalid_lock_timeout_exception,
"Please specify a positive timeout ${t}", (
"t", timeout));
53 std::chrono::seconds t(timeout);
54 wallet_manager_ptr->set_timeout(t);
56 if (options.count(
"yubihsm-authkey")) {
58 string connector_endpoint =
"http://localhost:12345";
59 if(options.count(
"yubihsm-url"))
60 connector_endpoint = options.at(
"yubihsm-url").as<
string>();
62 wallet_manager_ptr->own_and_use_wallet(
"YubiHSM", make_unique<yubihsm_wallet>(connector_endpoint, key));
stores null, int64, uint64, double, bool, string, std::vector<variant>, and variant_object's.