Skip to content

Commit

Permalink
rename ppc-main to wedpr-main
Browse files Browse the repository at this point in the history
  • Loading branch information
cyjseagull committed Sep 4, 2024
1 parent 0fba05a commit 905ac0f
Show file tree
Hide file tree
Showing 25 changed files with 14 additions and 10 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* @date 2022-11-14
*/
#include "AirNodeInitializer.h"
#include "ppc-gateway/Gateway.h"
#include "ppc-gateway/GatewayFactory.h"
#include "ppc-gateway/GatewayConfigContext.h"
#include "ppc-rpc/src/RpcFactory.h"
#include "ppc-rpc/src/RpcMemory.h"
Expand Down Expand Up @@ -50,15 +50,13 @@ void AirNodeInitializer::init(std::string const& _configPath)

// init the gateway
initGateway(_configPath);
// set the gateway into front
front->setGatewayInterface(m_gateway);

INIT_LOG(INFO) << LOG_DESC("init the rpc");
// load the rpc config
// not specify the certPath in air-mode
m_nodeInitializer->config()->loadRpcConfig(nullptr, pt);
// init RpcStatusInterface
RpcStatusInterface::Ptr rpcStatusInterface = std::make_shared<ppc::rpc::RpcMemory>(m_gateway);
RpcStatusInterface::Ptr rpcStatusInterface = std::make_shared<ppc::rpc::RpcMemory>();

m_nodeInitializer->frontInitializer()->setRpcStatus(rpcStatusInterface);
auto rpcFactory = std::make_shared<RpcFactory>(m_nodeInitializer->config()->agencyID());
Expand All @@ -82,12 +80,16 @@ void AirNodeInitializer::initGateway(std::string const& _configPath)
auto threadPool = std::make_shared<bcos::ThreadPool>(
"gateway", config->gatewayConfig().networkConfig.threadPoolSize);

// Note: no need use redis as cache in-air-mode
GatewayFactory gatewayFactory;
auto gateway = gatewayFactory.buildGateway(ppc::protocol::NodeArch::AIR, config, nullptr,
GatewayFactory gatewayFactory(config);
m_gateway = gatewayFactory.build(m_frontBuilder);
// TODO: register the nodeInfo
//m_gateway->registerNodeInfo();
// ppc::front::IFrontBuilder::Ptr const& frontBuilder
// registerNodeInfo(ppc::protocol::INodeInfo::Ptr const& nodeInfo)
/*auto gateway = gatewayFactory.buildGateway(ppc::protocol::NodeArch::AIR, config, nullptr,
m_nodeInitializer->protocolInitializer()->ppcMsgFactory(), threadPool);
auto frontInitializer = m_nodeInitializer->frontInitializer();
gateway->registerFront(frontInitializer->front()->selfEndPoint(), frontInitializer->front());
gateway->registerFront(frontInitializer->front()->selfEndPoint(), frontInitializer->front());*/
m_gateway = gateway;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
#pragma once
#include "libinitializer/Common.h"
#include "libinitializer/Initializer.h"
#include "ppc-framework/gateway/GatewayInterface.h"
#include "ppc-framework/front/IFront.h"
#include "ppc-framework/gateway/IGateway.h"
#include <bcos-utilities/BoostLogInitializer.h>
#include <memory>
namespace ppc::rpc
Expand All @@ -46,7 +47,8 @@ class AirNodeInitializer
private:
bcos::BoostLogInitializer::Ptr m_logInitializer;
ppc::initializer::Initializer::Ptr m_nodeInitializer;
ppc::gateway::GatewayInterface::Ptr m_gateway;
ppc::gateway::IGateway::Ptr m_gateway;
std::shared_ptr<ppc::rpc::Rpc> m_rpc;
ppc::front::IFrontBuilder::Ptr m_frontBuilder;
};
} // namespace ppc::node
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 905ac0f

Please sign in to comment.