RPC call to create wallet
variant variant_from_stream(T &in, uint32_t max_depth)
{
cout << ∈
if (max_depth == 0)
FC_THROW_EXCEPTION(parse_error_exception, "Too many nested items in JSON input!");
skip_white_space(in);
variant var;
while (1)
{
signed char c = in.peek();
switch (c)
{
case ' ':
case '\t':
case '\n':
case '\r':
in.get();
continue;
case '"':
return stringFromStream(in);
case '{':
return objectFromStream<T, parser_type>(in, max_depth - 1);
case '[':
return arrayFromStream<T, parser_type>(in, max_depth - 1);
case '-':
case '.':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
return number_from_stream<T, parser_type>(in);
// null, true, false, or 'warning' / string
case 'n':
case 't':
case 'f':
return token_from_stream(in);
case 0x04: // ^D end of transmission
case EOF:
case '\0':
FC_THROW_EXCEPTION(eof_exception, "unexpected end of file");
default:
FC_THROW_EXCEPTION(parse_error_exception, "Unexpected char '${c}' in \"${s}\"",
("c", c)("s", stringFromToken(in)));
}
}
return variant();
}
variant json::from_string(const std::string &utf8_str, parse_type ptype, uint32_t max_depth)
{
try
{
std::stringstream in(utf8_str);
//in.exceptions( std::ifstream::eofbit );
switch (ptype)
{
case legacy_parser:
return variant_from_stream<std::stringstream, legacy_parser>(in, max_depth);
case legacy_parser_with_string_doubles:
return variant_from_stream<std::stringstream, legacy_parser_with_string_doubles>(in, max_depth);
case strict_parser:
return json_relaxed::variant_from_stream<std::stringstream, true>(in, max_depth);
case relaxed_parser:
return json_relaxed::variant_from_stream<std::stringstream, false>(in, max_depth);
default:
FC_ASSERT(false, "Unknown JSON parser type {ptype}", ("ptype", ptype));
}
}
FC_RETHROW_EXCEPTIONS(warn, "", ("str", utf8_str))
}
my keosd is running on http://127.0.0.1:9999. When Trying to call rpc http://127.0.0.1:9999/v1/wallet/create i am not able to create the wallet of my name i am only able to create the wallet of names given in the cases of this json.cpp file
The filename is the only name of the wallet, and it is not manipulated by the cited JSON code at all. Only the contents of the file is serialized to JSON.
Instead, your problem is with wallet_manager.cpp#L24 which restricts wallet filenames to boost's concept of alphanumeric characters plus the characters ., _, and -. If you wish to use wallet filenames with glyphs outside of that set, you may delete line 24 and recompile. This is untested, but should work, as wallet names are stored in the plugin as simply std::string. Use at your own risk. Test wallet creation, locking, unlocking, and key retrieval with start up and shut down of keosd before destroying other copies of keys.