mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-03 01:15:53 +00:00
first
This commit is contained in:
57
Application.cpp
Normal file
57
Application.cpp
Normal file
@@ -0,0 +1,57 @@
|
||||
#include "Application.h"
|
||||
#include "Config.h"
|
||||
#include "PeerDoor.h"
|
||||
#include "RPCDoor.h"
|
||||
//#include <boost/log/trivial.hpp>
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
Application* theApp=NULL;
|
||||
|
||||
/*
|
||||
What needs to happen:
|
||||
Listen for connections
|
||||
Try to maintain the right number of connections
|
||||
Process messages from peers
|
||||
Process messages from RPC
|
||||
Periodically publish a new ledger
|
||||
Save the various pieces of data
|
||||
|
||||
*/
|
||||
|
||||
Application::Application()
|
||||
{
|
||||
theConfig.load();
|
||||
mKnownNodes.load();
|
||||
mUNL.load();
|
||||
mWallet.load();
|
||||
mLedgerMaster.load();
|
||||
mPeerDoor=NULL;
|
||||
mRPCDoor=NULL;
|
||||
}
|
||||
|
||||
|
||||
void Application::run()
|
||||
{
|
||||
if(theConfig.PEER_PORT)
|
||||
{
|
||||
mPeerDoor=new PeerDoor(mIOService);
|
||||
}//else BOOST_LOG_TRIVIAL(info) << "No Peer Port set. Not listening for connections.";
|
||||
|
||||
if(theConfig.RPC_PORT)
|
||||
{
|
||||
mRPCDoor=new RPCDoor(mIOService);
|
||||
}//else BOOST_LOG_TRIVIAL(info) << "No RPC Port set. Not listening for commands.";
|
||||
|
||||
mConnectionPool.connectToNetwork(mKnownNodes,mIOService);
|
||||
mTimingService.start(mIOService);
|
||||
cout << "Before Run." << endl;
|
||||
mIOService.run();// This blocks
|
||||
|
||||
//BOOST_LOG_TRIVIAL(info) << "Done.";
|
||||
cout << "Done." << endl;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user