zoukankan      html  css  js  c++  java
  • EOSIO/appbase

    EOSIO/appbase

      AppBase是EOSIO开源一个plugins架构程序框架,被应用于 EOS nodeos中。AppBase manages the plugin life-cycle and ensures that all plugins are configured, initialized, started, and shutdown in the proper order.

      AppBase使用了 boost::program_options 库,以及 boost::asio 库。

    1、KeyFeatures

      

    2、示例

    class net_plugin : public appbase::plugin<net_plugin>
    {
       public:
         net_plugin(){};
         ~net_plugin(){};
    
         APPBASE_PLUGIN_REQUIRES( (chain_plugin) );
    
         virtual void set_program_options( options_description& cli, options_description& cfg ) override
         {
            cfg.add_options()
                  ("listen-endpoint", bpo::value<string>()->default_value( "127.0.0.1:9876" ), "The local IP address and port to listen for incoming connections.")
                  ("remote-endpoint", bpo::value< vector<string> >()->composing(), "The IP address and port of a remote peer to sync with.")
                  ("public-endpoint", bpo::value<string>()->default_value( "0.0.0.0:9876" ), "The public IP address and port that should be advertized to peers.")
                  ;
         }
    
         void plugin_initialize( const variables_map& options ) { std::cout << "initialize net plugin
    "; }
         void plugin_startup()  { std::cout << "starting net plugin 
    "; }
         void plugin_shutdown() { std::cout << "shutdown net plugin 
    "; }
    
    };

    参考:

    1、https://github.com/EOSIO/appbase

    2、

  • 相关阅读:
    将文件移出版本控制 (Revision Control)
    luogu 1966 火柴排队
    bzoj 1069 最大土地面积
    bzoj 1060 时态同步
    luogu 1901 发射站
    bzoj 1007 水平可见直线
    bzoj 2654 tree
    luogu 2024 食物链
    10.21 模拟赛
    tyvj 1013 找啊找啊找GF
  • 原文地址:https://www.cnblogs.com/tekkaman/p/10187589.html
Copyright © 2011-2022 走看看