Skip to content
This repository has been archived by the owner on Jan 22, 2019. It is now read-only.

Gas Price Oracle Reducer #8

Open
shrugs opened this issue May 28, 2018 · 40 comments
Open

Gas Price Oracle Reducer #8

shrugs opened this issue May 28, 2018 · 40 comments
Labels
gitcoin There's a Gitcoin bounty attached to this! good first issue Good for newcomers

Comments

@shrugs
Copy link
Member

shrugs commented May 28, 2018

Implement a reducer that calculates ethgasstation's gas price oracle and stores the relevant variables using a typeStore.

ETHGasStation's backend uses the following logic, in python: https://github.com/ethgasstation/ethgasstation-backend/blob/master/egs/main.py

ETHGasStation uses GNU GPL v3, which would normally be an issue, but algorithms are usually not subject to copyright law (IANAL). So it should be reasonable to use the same algorithm with our our implementation, and give recognition where do.

Bonus points for showing how an API could read from these variables and construct a gas price prediction.

@shrugs shrugs added the good first issue Good for newcomers label May 28, 2018
@gitcoinbot
Copy link

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


This issue now has a funding of 0.15 ETH (84.77 USD @ $565.13/ETH) attached to it.

@shrugs shrugs added the gitcoin There's a Gitcoin bounty attached to this! label May 30, 2018
@nuke-web3
Copy link

@shrugs - I would like to tackle this possibly! Full disclosure though - I am new to the space and will likely need some help scoping the work and getting some feedback/help along the way. So it this is not mission critical as a first issue - count me in! 🎉

@shrugs
Copy link
Member Author

shrugs commented Jun 3, 2018

@nukemandan would love to work with you on this! For starters, let me know if you have trouble getting the project set up and gnarly-bin working on your local machine.

@nuke-web3
Copy link

nuke-web3 commented Jun 4, 2018

🎊 @shrugs! Thanks! So ironically yes - I can't get lerna up:

$ yarn global add lerna
yarn global v1.7.0
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "lerna@2.11.0" with binaries:
      - lerna
Done in 1.00s.
$ ~/github/gnarly$ lerna bootstrap
lerna: command not found

@nuke-web3
Copy link

following directions on the main page with a fresh npm install of yarn. On a Ubuntu MATE distro FYI.

@shrugs
Copy link
Member Author

shrugs commented Jun 4, 2018

@nukemandan looks like your path isn't set up to make the yarn binaries accessible. you can also use node_modules/.bin/lerna in place of the bare lerna command.

@nuke-web3
Copy link

nuke-web3 commented Jun 4, 2018

🤦‍♂️ easy link on a howto to get that setup?

@shrugs
Copy link
Member Author

shrugs commented Jun 4, 2018

@nukemandan yarnpkg/yarn#648 (comment) should help, but not familiar with MATE much

@nuke-web3
Copy link

Killer - that did it. so then the goal here is to build a reducer based roughly on this: https://github.com/XLNT/gnarly#writing-a-reducer ?

@shrugs
Copy link
Member Author

shrugs commented Jun 4, 2018

I haven't looked too much at the ethgasstation algorithm, but I expect it's something like "get information about the last N blocks and then do some stats on it to generate some variables. then use those variables as part of a formula for calculating duration of a transaction with a certain gas price"

So you can write a reducer following that pattern, yeah. Look at the -events and -block-meta reducers for full examples, since the readme is just the logic part of it.

@vs77bb
Copy link

vs77bb commented Jun 4, 2018

Hi @nukemandan please click 'Start Work' on Gitcoin (here) as well to show you're working this one 🙂welcome!

@nuke-web3
Copy link

sorry for the delay - working on getting the gnarly-demo up to test and play. New docker install but get this:

 1321 ?        00:00:10 dockerd
 1492 ?        00:00:07 docker-containe
$docker-compose up -d postgres
ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running?

If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.

thoughts?

@shrugs
Copy link
Member Author

shrugs commented Jun 5, 2018

@nukemandan you may have to sudo docker, depending on how you installed it

@nuke-web3
Copy link

nuke-web3 commented Jun 5, 2018

right - got that part previously

$ sudo service docker stop
$ sudo service docker start
$ ps -e |grep docker
16271 ?        00:00:00 dockerd
16296 ?        00:00:00 docker-containe
$ docker-compose up -d postgres
ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running?

If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.

@shrugs
Copy link
Member Author

shrugs commented Jun 5, 2018

You'd have to sudo docker-compose as well, since docker-compose just uses docker as normal

@nuke-web3
Copy link

🤦‍♂️ du. Man I can't thank you enough for your patience and support. This a fantastic way for me to learn a lot of new tools. I figured I would make sure to let you know that you can let me know if you would rather have someone else take lead on this - ROI may be a little low for holding my hand on this one :) .

@shrugs
Copy link
Member Author

shrugs commented Jun 6, 2018

If you end up using gnarly for a project or use this sort of knowledge elsewhere, the ROI is already there! the gitcoin bounty is just for funsies :D

Let's collab on it? If you fork the repo I can take a minute and kind of sketch out what I think might be needed.

@nuke-web3
Copy link

@shrugs thanks so much! I wanted to update you - I am up and running - now more comfortable docker, and a crash course TS. Also looking into the eth-price algo... Are you sure that IP protections don't cover them? I though that was kinda the point in licencing software....

@shrugs
Copy link
Member Author

shrugs commented Jun 7, 2018

@shrugs
Copy link
Member Author

shrugs commented Jun 7, 2018

So it seems like the algorithm is not what's licensed, since it's just an idea; it's the implementation that's licensed

@nuke-web3
Copy link

@shrugs - So I want to update you - I was at a hackathon this weekend - so zero progress on this. And my week also just got packed. I think the soonest I can commit time for sure to this is Thursday. With that I will stop work on this bounty to let someone else feel open to take over. I plan on checking in on this then to evaluate if I can devote time. Otherwise next week I will join back on this. :)

@mkosowsk
Copy link

Hi @nukemandan any update on work on this one? Thanks!

@nuke-web3
Copy link

Nada. I have been pulled in a different direction and think I will not be back on this one. :/ I like gnarly a lot though - and am spreading the word on it in my circles!

@shrugs
Copy link
Member Author

shrugs commented Jul 1, 2018

no worries @nukemandan thanks for taking a look at this issue to begin with!

@mkosowsk
Copy link

mkosowsk commented Jul 1, 2018

Thanks for the update @nukemandan :)

@vs77bb looks like we can throw this one back in the pool if you'd like to drum up some interest from the Gitcoin community 👍🏻

@farhaanbukhsh
Copy link

Hey I might want to give it a go, few pointers I am new to this problem statement and there is a limited amount of time I would be able to give on the issue.

A little guidance on setting up and reproducing the issue is requested. Thanks 😊

@farhaanbukhsh
Copy link

@mkosowsk any update on this?

@mkosowsk
Copy link

@shrugs do you have a moment to get @farhaanbukhsh up and started? thanks!

@shrugs
Copy link
Member Author

shrugs commented Jul 20, 2018

@farhaanbukhsh The first thing you'll want to do is get the current project up and running.

Note that I have a bug on master right now regarding how we handle reorgs, so run your reducers from a block a few days in the past to avoid that.

Once you've got the project running, you can clone one of the existing reducer packages and start implementing your sequelize models and reducer logic. The logic in the reducer will mirror the ethgasstation algorithm and then store the output in the database as well by emitting a change. See existing reducers for examples and how they should be structured.

@farhaanbukhsh
Copy link

@shrugs awesome will set this up and get back to you I am excited to learn and collaborate do we have a gitter or IRC where we can talk?

@shrugs
Copy link
Member Author

shrugs commented Jul 24, 2018

there's a #gnarly channel on https://XLNT.chat that I'm frequently available in

@subramanianv
Copy link

@shrugs Is this task still available ?

@shrugs
Copy link
Member Author

shrugs commented Sep 6, 2018

@subramanianv yup!

@subramanianv
Copy link

@shrugs I get this error Incorrect table definition; there can be only one auto column and it must be defined as a key when I try to run yarn run ts-start inside gnarly-bin. I am using mysql

@shrugs
Copy link
Member Author

shrugs commented Sep 7, 2018

@subramanianv looks like mysql isn't as plug-and-play with sequelize as I'd have hoped. Can you try with postgresql? Also, check out the #gnarly channel in https://xlnt.chat for more real-time help.

@subramanianv
Copy link

@shrugs I got it up and running using postgresql. Now on to the next step

@rstormsf
Copy link

@frankchen07
Copy link

hey @shrugs - Frank from Gitcoin here - is this issue still open? It's expired on Gitcoin, but remains open.

@subramanianv, are you still working on this issue?

@shrugs
Copy link
Member Author

shrugs commented Oct 25, 2018 via email

@ali2210

This comment has been minimized.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
gitcoin There's a Gitcoin bounty attached to this! good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

10 participants