2024-11-27 13:28:45 +01:00
|
|
|
#include "actions.hpp"
|
2024-11-26 12:49:24 +01:00
|
|
|
#include "json.hpp"
|
|
|
|
#include "rpc_server.hpp"
|
2024-12-09 13:03:21 +01:00
|
|
|
#include "vm_provider.hpp"
|
2024-11-26 12:49:24 +01:00
|
|
|
|
2024-11-08 12:22:42 +01:00
|
|
|
int main()
|
|
|
|
{
|
2024-12-09 13:03:21 +01:00
|
|
|
auto state = sliger::rpc::vm_provider::VmProvider();
|
|
|
|
|
2024-11-26 13:04:40 +01:00
|
|
|
auto rpc = sliger::rpc::RpcServer(
|
2024-11-26 12:49:24 +01:00
|
|
|
[&](std::unique_ptr<sliger::json::Value> req,
|
2024-11-26 13:04:40 +01:00
|
|
|
std::unique_ptr<sliger::rpc::BufferedWriter> writer) {
|
2024-11-27 13:28:45 +01:00
|
|
|
auto action = sliger::rpc::action::action_from_json(std::move(req));
|
|
|
|
action->perform_action(std::move(writer));
|
2024-11-26 12:49:24 +01:00
|
|
|
});
|
|
|
|
rpc.listen();
|
2024-11-08 12:22:42 +01:00
|
|
|
}
|