Skip to content

Add Scope to PG #50

Description

@anthonyra

@jeffgrunewald @andymck thoughts?

pg:start_link().

I was poking around in Sibyl to understand how to view which gateways are connected to the durable validator better then using,

ss -an | grep 8080 | grep EST | wc -l

or similar.

I was able to hack a working list of gateways based on the sibyl code, but adding a scope will help tremendously. Only concern is that there's a note on the PG man page of Erlang.

Scope name is used to register process locally, and to name an ETS table. 
If there is another process registered under this name, or another ETS table 
exists, scope fails to start.

Local membership is not preserved if scope process exits and restarts.

Which tells me it's an ETS table and on restarts of the miner could lead to dropped client connections to the validators. However, shouldn't this already be the case?

TL;DR - Would it make sense if I did a PR to add a scope to the PG to make tracking connected hotspots easier or was there a reason it wasn't done from the get go?

Here's the hacky work around for now...

miner eval 'Topics0 = [{binary:match(M, <<"poc_notification">>), M} || M <- pg:which_groups()], Topics1 = [split_binary(M,E) || {{_,E}, M} = T <- Topics0], [ libp2p_crypto:bin_to_b58(A) || {_,A} = T <- Topics1].'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions