SecureSECO / SearchSECOController

GNU Affero General Public License v3.0
6 stars 8 forks source link

It would be great to receive an email when a new node joins the mining pool #29

Open slingerbv opened 2 years ago

slingerbv commented 2 years ago

If the miner id has not been seen before, it would be great if an email was sent to notifications@secureseco.org if a new miner joins. In this way we can better track community activity.

gitcoinbot commented 2 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work has been started.

These users each claimed they can complete the work by 1 month from now. Please review their action plans below:

1) lyledavids has been approved to start work.

Integrate a email notification with Sendgrid or preferred email provider

Learn more on the Gitcoin Issue Details page.

slingerbv commented 2 years ago

Please note that in the portal project an email feature has already been built in. It's really simple and rudimentary and doesn't have to be more complicated.

slingerbv commented 2 years ago

I still need to set up the email account, btw. More later ;-).

slingerbv commented 2 years ago

Email is now active!

lyledavids commented 2 years ago

Hi Slinger, Is there an api or way to see the mining pool?

slingerbv commented 2 years ago

https://secureseco.science.uu.nl/portal/

On Mon, Aug 29, 2022 at 3:34 PM Lyle Davids @.***> wrote:

Hi Slinger, Is there an api or way to see the mining pool?

— Reply to this email directly, view it on GitHub https://github.com/SecureSECO/SearchSECOController/issues/29#issuecomment-1230315808, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAERHLEDRVYJ3D2EPPHT2WDV3S36HANCNFSM57VRVMYA . You are receiving this because you authored the thread.Message ID: @.***>

-- dr. Slinger Jansen (Roijackers) Do you want to secure software ecosystems https://secureseco.org/ with us? Software Production Research Group https://www.uu.nl/en/research/software-systems/organization-and-information , Utrecht University http://www.slingerjansen.nl +31 6 19 884 880 book me through YouCanBook.me http://slingerroijackers.YouCanBook.me

lyledavids commented 2 years ago

Okay, is there portal to see when new miner joins? or api for that?

slingerbv commented 2 years ago

Weird, I replied by email but it never came here: I believe these identifier entries are stored in the DB, to show the top 5 miners on the portal. As everything is decentralized, it's probably best to do the following:

  1. See if this identifier has mined in the last week.
  2. If not, send email from client.
  3. Start mining.

After the mining starts, the portal will show the new client anyway. But only 5 clients are shown, so after a while it'll be harder to track all the identifiers.

slingerbv commented 2 years ago

The identifier I allude to here is the name of the worker, such as currently "dove", "turtle", on the portal.

lyledavids commented 2 years ago

Hi, I have the code ready to send the email. Sort of a "trigger email". But the only stumbling block is I don't know when a node joins and not sure how many nodes there are. This info is not available on the portal. Is the "localWorker" the amount of nodes?

slingerbv commented 2 years ago

Hi Lyle, the node itself needs to send the message. When it starts mining it should check: have I mined before? If no, send email. There's no central server (because decentralized) so who else can do it besides the node itself?

So it's basically at the start of SearchSECOController.

lyledavids commented 2 years ago

Okay, I understand that but where do I get information about the node or when a new node joins? I was only given the link to this portal, https://secureseco.science.uu.nl/portal/

slingerbv commented 2 years ago

The system is fully decentralized, so there is no "get information". What you need to do is when a SearchSECO node is started, check whether it's run before (probably, because it crashes a lot). However, if it hasn't run before with that identifier, an email must be sent by the node itself.

lyledavids commented 2 years ago

How will I know when a node starts? and where can I see the identifier?

slingerbv commented 2 years ago

When the node starts... It starts? How do you know when a car starts? When you turn the key right? And then you have to ask its own name, like what is self.identifier or smth.

You can get the list of recently active nodes the same way the portal does it: https://github.com/SecureSECO/SearchSECOPortal/blob/main/views/index.pug

lyledavids commented 2 years ago

When the node starts... It starts? How do you know when a car starts? When you turn the key right? And then you have to ask its own name, like what is self.identifier or smth.

You can get the list of recently active nodes the same way the portal does it: https://github.com/SecureSECO/SearchSECOPortal/blob/main/views/index.pug

This code file you gave me is just the code for the portal. But it doesn't solve my issue. My issue is the portal doesn't show me anything about nodes

lyledavids commented 2 years ago

Screenshot 2022-09-09 at 10 43 36

slingerbv commented 2 years ago

No, but through the DB API you can get the data. That's why I showed how the portal got its data from the DB.

I'm assuming the node immediately has a DB connection, so all you need to do is ask for the right data (i.e., currently active nodes) to check whether your own client is already a member of that set.

lyledavids commented 2 years ago

What table? What is the api endpoint? Is there an api design schema somewhere?

slingerbv commented 2 years ago

I'm probably saying something stupid now, but I think you can find it here? https://secureseco.science.uu.nl/api/ds/query

I found this link in the portal code somewhere in the Javascript. You can find more in the DB project about the documentation: https://github.com/SecureSECO/SearchSECODatabaseAPI

slingerbv commented 2 years ago

I believe these identifier entries are stored in the DB, to show the top 5 miners on the portal. As everything is decentralized, it's probably best to do the following:

  1. See if this identifier has mined in the last week.
  2. If not, send email from client.
  3. Start mining.

After the mining starts, the portal will show the new client anyway. But only 5 clients are shown, so after a while it'll be harder to track all the identifiers.

Slinger

On Mon, Aug 29, 2022 at 3:57 PM Lyle Davids @.***> wrote:

Okay, is there portal to see when new miner joins? or api for that?

— Reply to this email directly, view it on GitHub https://github.com/SecureSECO/SearchSECOController/issues/29#issuecomment-1230345253, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAERHLAMWN4UNJYP27TGWDTV3S6TVANCNFSM57VRVMYA . You are receiving this because you authored the thread.Message ID: @.***>

-- dr. Slinger Jansen (Roijackers) Do you want to secure software ecosystems https://secureseco.org/ with us? Software Production Research Group https://www.uu.nl/en/research/software-systems/organization-and-information , Utrecht University http://www.slingerjansen.nl +31 6 19 884 880 book me through YouCanBook.me http://slingerroijackers.YouCanBook.me

lyledavids commented 2 years ago

Okay, thanks. Will look into this approach

slingerbv commented 2 years ago

I've also extended the deadline for this bounty, had expired by now.

On Thu, Oct 13, 2022 at 1:42 PM Lyle Davids @.***> wrote:

Okay, thanks. Will look into this approach

— Reply to this email directly, view it on GitHub https://github.com/SecureSECO/SearchSECOController/issues/29#issuecomment-1277477278, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAERHLDI2KBGIOU53UX4J5DWC7YRNANCNFSM57VRVMYA . You are receiving this because you authored the thread.Message ID: @.***>

-- dr. Slinger Jansen (Roijackers) Do you want to secure software ecosystems https://secureseco.org/ with us? Software Production Research Group https://www.uu.nl/en/research/software-systems/organization-and-information , Utrecht University http://www.slingerjansen.nl +31 6 19 884 880 book me through YouCanBook.me http://slingerroijackers.YouCanBook.me

lyledavids commented 2 years ago

How do I obtain a api key?

slingerbv commented 2 years ago

I'm guessing you mean from Github? Please check out the documentation in that regard: https://github.com/SecureSECO/SearchSECOController

(search for API key)

lyledavids commented 2 years ago

I'm looking for the one that will be in keys.json

lyledavids commented 2 years ago

Can't find anything about that in link above

slingerbv commented 2 years ago

I'm looking for the one that will be in keys.json

Euhm... These are not the droids you are looking for?

lyledavids commented 2 years ago

droids?

slingerbv commented 2 years ago

There is no keys.json?

lyledavids commented 2 years ago

no