ip -> multiaddr

This commit is contained in:
DieMyst 2020-12-10 16:01:07 +03:00
parent d68f36436d
commit c1e2ed8b2a
3 changed files with 7 additions and 6 deletions

View File

@ -25,9 +25,9 @@ toInstance peerId identify blueprints service =
ip =
List.head identify.external_addresses
|> Maybe.map (String.split "/")
|> Maybe.map (List.drop 2)
|> Maybe.andThen List.head
--|> Maybe.map (String.split "/")
--|> Maybe.map (List.drop 2)
--|> Maybe.andThen List.head
|> Maybe.withDefault "unknown"
in
{ name = name, blueprintId = blueprintId, instance = service.service_id, peerId = peerId, ip = ip }
@ -59,7 +59,7 @@ viewTable instances =
[ th [ classes "fw5 tl pa3 gray-font" ] [ text "BLUEPRINT" ]
, th [ classes "fw5 tl pa3 gray-font" ] [ text "SERVICE ID" ]
, th [ classes "fw5 tl pa3 gray-font dn dtc-ns" ] [ text "NODE" ]
, th [ classes "fw5 tl pa3 gray-font dn dtc-ns" ] [ text "IP" ]
, th [ classes "fw5 tl pa3 gray-font dn dtc-ns" ] [ text "MULTIADDR" ]
]
]
, tbody [ classes "lucida" ] (instances |> List.map viewInstance)

View File

@ -47,7 +47,7 @@ nodesView nodes =
[ thead []
[ tr [ classes "" ]
[ th [ classes "fw5 tl pa3 gray-font" ] [ text "NODE ID" ]
, th [ classes "fw5 tl pa3 gray-font" ] [ text "IP" ]
, th [ classes "fw5 tl pa3 gray-font" ] [ text "MULTIADDR" ]
, th [ classes "fw5 tl pa3 gray-font dn dtc-ns" ] [ text "SERVICES" ]
]
]

View File

@ -50,6 +50,7 @@ function event(name: string,peer: string,peers?: string[],identify?: string[],se
/* eslint-enable */
(async () => {
// Fluence.setLogLevel('silent')
const pid = await Fluence.generatePeerId();
const flags = genFlags(pid.toB58String());
@ -93,7 +94,7 @@ function event(name: string,peer: string,peers?: string[],identify?: string[],se
}
}
const particle = await build(client.selfPeerId, part.script, map, 25000);
const particle = await build(client.selfPeerId, part.script, map, 45000);
await client.sendParticle(particle);
});
})();