diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2015-11-27 18:24:29 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2015-11-27 18:27:24 +0000 |
commit | 75742977a8cd765175c1d3e39e2e74d25c6ca774 (patch) | |
tree | 11d0d4b2950f3929afde0070a8b4b765183a5a71 /src/rpc/core_rpc_server.cpp | |
parent | Merge pull request #501 (diff) | |
download | monero-75742977a8cd765175c1d3e39e2e74d25c6ca774.tar.xz |
core_rpc_server: add a --restricted-rpc option
It does not expose the RPC for commands like start_mining, etc
(ie, commands a public node operator might want to be restricted)
Diffstat (limited to 'src/rpc/core_rpc_server.cpp')
-rw-r--r-- | src/rpc/core_rpc_server.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp index f5e700033..aeb8d7d2a 100644 --- a/src/rpc/core_rpc_server.cpp +++ b/src/rpc/core_rpc_server.cpp @@ -51,6 +51,7 @@ namespace cryptonote command_line::add_arg(desc, arg_rpc_bind_ip); command_line::add_arg(desc, arg_rpc_bind_port); command_line::add_arg(desc, arg_testnet_rpc_bind_port); + command_line::add_arg(desc, arg_restricted_rpc); } //------------------------------------------------------------------------------------------------------------------------------ core_rpc_server::core_rpc_server( @@ -69,6 +70,7 @@ namespace cryptonote m_bind_ip = command_line::get_arg(vm, arg_rpc_bind_ip); m_port = command_line::get_arg(vm, p2p_bind_arg); + m_restricted = command_line::get_arg(vm, arg_restricted_rpc); return true; } //------------------------------------------------------------------------------------------------------------------------------ @@ -957,4 +959,10 @@ namespace cryptonote , std::to_string(config::testnet::RPC_DEFAULT_PORT) }; + const command_line::arg_descriptor<bool> core_rpc_server::arg_restricted_rpc = { + "restricted-rpc" + , "Restrict RPC to view only commands" + , false + }; + } // namespace cryptonote |