Abstract the interface in a way that we could easily add TCP/IP support, Console support, etc.. for example
class HandlerBase
{
};
class RestHandler : public HandlerBase
{
...
};
class ConsoleHandler: public HandlerBase
{
};
Then we would have an AshServer object that stored a vector of HandlerBase objects.
AshServer server;
server.addHandler(std::make_shared<HttpHandler>(port));
auto console = std::make_shared<ConsoleHandler>();
server.addHandler(console);
Then messages could be registered:
server.registerMessage("summary", []() { ... });
server.registerMessage("createtx", ...); // some type of validation object that ensures the params exist
From this we could have Http calls come in the way they currently do but then you could invoke strings messages as well:
console->inoke("createtx toaddress privatekey amount");
Where ConsoleHandler would parse the info and ass it to the
Abstract the interface in a way that we could easily add TCP/IP support, Console support, etc.. for example
Then we would have an
AshServerobject that stored a vector ofHandlerBaseobjects.Then messages could be registered:
From this we could have Http calls come in the way they currently do but then you could invoke strings messages as well:
Where
ConsoleHandlerwould parse the info and ass it to the