Get notified when my hive-engine witness goes down using Integromat

in #engine3 years ago

I want to know when my hive-engine witness goes down and so I use the Integromat automation tool. Integromat has a lot of really useful tools which I use to take a lot of drudge work out of my life. The free tier is sufficient for this particular task. Also, you won't need to use any of your keys. So, head on over to Integromat and signup.

Run once disabled.png
Integromat automations are called scenarios. Start by creating a new scenario with any title you choose. This particular scenario will use two modules with a filter between them.

AddToolbar.png
Ok, add your first module by clicking the + plus sign on the right side of the toolbar. Type HTTP into the search bar and select the HTTP module (the blue globe).

HTTP Settings.png
Once the HTTP module is added, then click on it to edit the settings. Set things as shown in the image. I'll list the settings to make them cut and paste-able.
URL: https://api.hive-engine.com/rpc/contracts
Method: POST
Body type: RAW
Content type: JSON (application/json)
Request content:
{"id":1,"jsonrpc":"2.0","method":"find","params":{"contract":"witnesses","indexes":[],"query":{"account":{"$in":["yourwitnessaccountnamehere"]}},"table":"witnesses"}}
Ensure you put your own witness account name in the correct place. And finally, enable Parse response. Press OK.
This is basically a manual way of constructing a JSON-RPC query, and specifically a hive-engine RPC query and sending it to the main hive-engine API node. You want to use the main hive-engine API node to ensure that you're testing whether or not your witness can be seen by other witnesses.

Now, save the scenario (disk icon on the toolbar). Then press "Run Once". What this does is contact the API node and download the JSON response. We need this to make the next step easier.

AddingAndroidConnection.png
The next step is to add (+ icon on the toolbar) the Android module. Once the Android module is on the canvas, drag it until there is a link between the HTTP and Android module. Then click on the Android module to open the settings. Add a new device and follow the steps to install the app on your phone and link it with your account. The device name you choose here doesn't matter because you'll link the device via scanning a QR code later.

Android Settings.png
Finish setting out the Android notification to your desires. This image shows the text message I choose, and as a convenience, will open the witness page on tribaldex if I click on the notification. Finally, click on OK.

FilterSetting.png
Now we need to filter the result from the API node so that it only sends notifications if the witness is down. Click on the little filter icon and setup the filter as shown. The key thing is to select the blue part of the condition like this...

Selecting the condition.png
If results don't show then check that the HTTP module is setup correctly and then press Run once. What this condition does is select the enabled property from the JSON-RPC results and only allows further execution if the enabled property is false. Then click Okay.

Scheduling.png
Next, test that the scenario is working by click Run once. If you're happy with how it's working then save using the disk icon on the toolbar. You will need to add scheduling to make have the scenario run automatically. Select whatever schedule suits you - each run will use 2 operations and around 900 bytes so this will fit within your free tier provided you don't schedule too often. I choose 15 minutes.

Finally, enable scheduling, save again for good luck and you're down. You can check your resource usage on the dashboard. If you're running out of free tier resources then you can increase the time between calls.

I hope you find this tutorial useful. And, have fun exploring the facilities that Integromat has to offer. Until next time.

Sort:  

Congratulations @eturnerx-honey! You have completed the following achievement on the Hive blockchain and have been rewarded with new badge(s) :

You distributed more than 15000 upvotes.
Your next target is to reach 16000 upvotes.

You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

To support your work, I also upvoted your post!

Check out the last post from @hivebuzz:

Hive Power Up Day - November 1st 2021 - Hive Power Delegation
Bee ready for the 2nd Hive Power Up Month challenge!
Trick or Treat - Share your scariest story and get your Halloween badge
Support the HiveBuzz project. Vote for our proposal!

Thank you very much. It's definitely very useful.

I've never heard about Integromat :)

@tipu curate

Nice Write Up!
Thank You 🙏

Will have a look, will need it have a sort of a "mute" function or a way to shut up for a certain amount of time (but maybe that can work out by just disabling the app to notify you on iphone).

This is quite useful for when you can't be around especially.

Lol yeah, I was also thinking the same thing. It has to stop after notifying us like 3-5 times. Otherwise, it will be spam. :) But there should be a way to do it.

I currently have my own script doing this for me. But this one looks great. I don't have to worry about maintaining or hosting my script. I'm going to give it a try. Thanks. 👍

This post has been manually curated by @bala41288 from Indiaunited community. Join us on our Discord Server.

Do you know that you can earn a passive income by delegating to @indiaunited. We share 80 % of the curation rewards with the delegators.

Here are some handy links for delegations: 100HP, 250HP, 500HP, 1000HP.

Read our latest announcement post to get more information.

image.png

Please contribute to the community by upvoting this comment and posts made by @indiaunited.

Really nice tool =) I will use it for other stuff too =)

Cheers for this.

Hello.

Allow me to address you in this way.

If it is not against your conviction, I would like to ask for your support.
I need here:

https://www.sportstalksocial.com/@filosof103/i-need-your-support-I-need-your-support.
just a "vote" from you.

This will support the raffle I am running on:

https://www.sportstalksocial.com/

every week.
I would like to encourage the community of Steem - Hive - and Blurt on the
the "sporty" side.
Also a delegation - which you can withdraw at any time - supports the project.

Thank you for your time.
LG.

Translated with www.DeepL.com/Translator (free version)