You are viewing a single comment's thread from:

RE: Wishes container - test

in Open Genie Dev5 months ago (edited)

Looking for someone to work on Hive-Engine code to write a new feature to time out API requests if they take too long: https://github.com/hive-engine/hivesmartcontracts/issues/68

This is a post created on the open genie platform you can view it best on this user interface: https://genie.peakd.com/@rishi556/hive-engine-api-development-1715295144280

Sort:  

HE application uses "axios" module if I remember for outgoing calls. In your case here you're looking to modify the API in order to time out requests?

What duration of timeout you looking for? And do I submit a branch on the github in order to apply for this?

I've run an HE node for some time (with your help initially) and am in the top 20 witness list, would gladly have a whack at this if it would help improve the HE application and ecosystem.

Get ahold of me on here or on discord if you have any info on this and how you'd like it set up.

Link to my account: https://genie.peakd.com/@klye

Found the syntax to add timeouts to MongoDB calls:

db.collection.find(
{ },
{ }
).maxTimeMS( );

I'm willing to take this on. I will create a new branch here locally and begin refactoring everything.

Link to my account: https://genie.peakd.com/@klye

Yeah that looks about right from my attempt at it. I think that it doesn’t work for findOne though and you’ll have to find a different solution for that

A conditional setTimout wrapping around it that executes if the query surpasses the time limit which would return false or timeout error or whatever.

I can have a whack at it here by the weekend or if I get some free time in the next couple days.. It shouldn't be hard per say, just tedious and a bunch of shit to refactor..!

I'm not sure if the setTimeout(assuming you are going to use it as an abort controller?) will stop executing the query on the mongo side of things. Killing the request running on Node is fairly simple, it's interfacing with mongo that gets a bit trickier(though still don't expect it to be terribly hard).

A slightly new DB control mechanism likely needs implemented with everything being transactional, calling back and managed by a function that it's wrapped in that can be null'd or cancelled when needed..

I might try a few things here later on my node and see if I break anything.. a few problems to solve but I think with some architecture refactoring what you wish to have implemented is possible.

lemme think on it a little bit. has to be a relatively straight answer.

Sounds good. Lets hope this does the trick!

Sketchy to test on my main witness server but I may in fact do that.. Need to time it right to not miss blocks and shit.. There was a site that showed the HE witness shceduling.. Do you remember the URL for that?

I may just spin up another HE instance to test on honestly.. I don't want to accidently break the chain or cause lag in the network..

Totally going to try some things though.. this task isn't super difficult.. but it's going to require refactor of a lot of lines of code.

Not sure what this wish site stuff is. I don't really even want to inquire about bounty pay or whatever as it's not why I'd help fix this.. I'm already top 20 so I view this as giving back to the community that put me into the top 20 slots.

Shall talk later... I'll branch main and have a whack at this.

Have a gooder sir! talk soon.

@klye

Assigned - Genie chosen

Any progress @klye?

Started looking at it then got sidetracked. Will try and make some time for this on the weekend.

Sounds good!

@klye

Assigned - Genie chosen

Gonna look at the timeout shit for HE some tomorrow! Cheers!

@klye

Assigned - Genie chosen

Going to get a local HE instance running here... But I need some computing in the cloud to run tests against? :/

Tests against?

Syncing my local HE node.. I'm jsut not sure how I can query the API locally in a way that replicates the external calls.

But yeah.. I'm still working on this. Sorry for the delays

Just call the API using your local endpoint?

This wish is closed due to actions of the Hive-Engine team not keeping the platform decentralized, but instead centralizing it HEAVILY.

Gonna have another look at this here... Need to get a node synced up anyways...

Figure "postman" would be useful for the testing of the calls eh? Need to look at my modded version and see if it's doing what it needs to.. Sorry for the delay on this.

Link to my account: https://genie.peakd.com/@klye

Wish status: Closed - Wish Failed