mirror of
https://github.com/logos-co/logos-libp2p-module.git
synced 2026-08-31 01:41:12 +00:00
docs(tutorial): add introduction tutorial (#90)
This commit is contained in:
@@ -61,13 +61,15 @@ int main()
|
||||
|
||||
Libp2pModuleImpl node(options);
|
||||
|
||||
if (!node.start().success) {
|
||||
fprintf(stderr, "Failed to start node\n");
|
||||
StdLogosResult startRes = node.start();
|
||||
if (!startRes.success) {
|
||||
fprintf(stderr, "Failed to start node: %s\n",
|
||||
startRes.error.c_str());
|
||||
return 1;
|
||||
}
|
||||
|
||||
/// Verify that the node is actually listening on the configured port:
|
||||
auto info = node.peerInfo();
|
||||
StdLogosResult info = node.peerInfo();
|
||||
if (!info.success) {
|
||||
fprintf(stderr, "Failed to get node info: %s\n",
|
||||
info.error.c_str());
|
||||
@@ -115,12 +117,14 @@ int main()
|
||||
|
||||
Libp2pModuleImpl nodeFromJson(jsonOpts);
|
||||
|
||||
if (!nodeFromJson.start().success) {
|
||||
fprintf(stderr, "Failed to start JSON-configured node\n");
|
||||
StdLogosResult jsonStartRes = nodeFromJson.start();
|
||||
if (!jsonStartRes.success) {
|
||||
fprintf(stderr, "Failed to start JSON-configured node: %s\n",
|
||||
jsonStartRes.error.c_str());
|
||||
return 1;
|
||||
}
|
||||
|
||||
auto info2 = nodeFromJson.peerInfo();
|
||||
StdLogosResult info2 = nodeFromJson.peerInfo();
|
||||
if (!info2.success) {
|
||||
fprintf(stderr, "Failed to get JSON-configured node info: %s\n",
|
||||
info2.error.c_str());
|
||||
|
||||
Reference in New Issue
Block a user