Build the library separately as a static library (libsol). Split top-level CMakeLists into different CMakeLists for the examples, the tests and the library itself for easier management.
Moved all json rpc calls to a Connection class that is used as entrypoint to the library and extracted the rpc implementations to solana.cpp.
Moved all WebSocket subscription methods to the namespace solana::rpc::subscription
Refactored the examples to use the Connection class.
Moved all headers to the include directory and reorganized methods in the global namespace to the solana namespace
auto connection = solana::rpc::Connection(config.endpoint);
const auto group = connection.getAccountInfo<mango_v3::MangoGroup>(config.group);
...
const auto market = connection.getAccountInfo<mango_v3::PerpMarket>(perpMarketPk.toBase58());
...
const auto recentBlockhash = connection.getRecentBlockhash();
Attempt 2:
Changes:
libsol
). Split top-levelCMakeLists
into differentCMakeLists
for the examples, the tests and the library itself for easier management.Connection
class that is used as entrypoint to the library and extracted the rpc implementations tosolana.cpp
.solana::rpc::subscription
Connection
class.include
directory and reorganized methods in the global namespace to thesolana
namespaceTests done:
./bin/tests