石墨烯区块链(4)API
生活随笔
收集整理的這篇文章主要介紹了
石墨烯区块链(4)API
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
1. 步驟
step1. 通過登錄 API 訪問通用身份驗證模塊。
step2. 驗證
step3. 客戶端應用程序能夠收集其他遠程對象引用并調用它們。
正如當前交付的那樣, witness_node 應用程序被配置為接受 HTTP 格式的請求。
1.1 FC 庫
用于管理傳輸細節(jié),允許節(jié)點接受各種傳輸協(xié)議。
在 C++ 應用程序中,Graphene 應用程序庫和 FC 庫協(xié)同工作,為此類訪問提供簡單的編程模型。
2. 這是從cli_wallet 應用程序中獲取的示例
顯示了如何連接到節(jié)點服務器、登錄和進行其他調用
fc::http::websocket_client client;idump((wdata.ws_server));auto con = client.connect( wdata.ws_server );auto apic = std::make_shared<fc::rpc::websocket_api_connection>(*con);auto remote_api = apic->get_remote_api< login_api >(1);edump((wdata.ws_user)(wdata.ws_password) );// TODO: Error message hereFC_ASSERT( remote_api->login( wdata.ws_user, wdata.ws_password ) );auto wapiptr = std::make_shared<wallet_api>( wdata, remote_api );wapiptr->set_wallet_filename( wallet_file.generic_string() );wapiptr->load_wallet_file();fc::api<wallet_api> wapi(wapiptr);auto wallet_cli = std::make_shared<fc::rpc::cli>();for( auto& name_formatter : wapiptr->get_result_formatters() )wallet_cli->format_result( name_formatter.first, name_formatter.second );總結
以上是生活随笔為你收集整理的石墨烯区块链(4)API的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: EOS Dawn 1.0
- 下一篇: 石墨烯区块链(5)智能合约