Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script for reading leaderboard data into database #1810

Merged
merged 69 commits into from
Dec 10, 2019

Conversation

mrsmkl
Copy link
Contributor

@mrsmkl mrsmkl commented Nov 20, 2019

Description

A script for reading data needed to calculate leaderboard score
Reads the following things:

  • Multiplier from the sheet (currently points to test sheet)
  • Claimed accounts from account metadata
  • Exchange rate from SortedOracles contract (probably should be moved into blockscout)

Tested

Only manual testing so far. Needs credentials to access Google sheets.

Other changes

Related issues

Backwards compatibility

@mrsmkl mrsmkl changed the title [wip] Script for reading leaderboard data into database Script for reading leaderboard data into database Nov 25, 2019
@codecov
Copy link

codecov bot commented Nov 25, 2019

Codecov Report

Merging #1810 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           master    #1810    +/-   ##
========================================
  Coverage   74.77%   74.77%            
========================================
  Files         280      280            
  Lines        7826     7826            
  Branches      974      690   -284     
========================================
  Hits         5852     5852            
  Misses       1858     1858            
  Partials      116      116
Flag Coverage Δ
#mobile 74.77% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 097748a...30753dd. Read the comment docs.

Copy link
Contributor

@diminator diminator left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small changes for env vars

I've ran it locally and it seems to work with a graphql query:

  query AddresessOrderedByBalance {
    leaderboard {
      points
      address
      identity
    }
  }

which responds:

{
  "data": {
    "leaderboard": [
      {
        "address": "0x47E172F6CFB6C7D01C1574FA3E2BE7CC73269D95",
        "identity": "CLabs Validator #0 on testing",
        "points": 1.4878347512330449e+26
      },
      {
        "address": "0x19A22C25A9C1C14AFE2E792F71FD639540D052E0",
        "identity": "account-0x19a22c25a9c1c14Afe2e792F71fd639540d052E0",
        "points": 1.2e+24
      },
      {
        "address": "0xA42C9B0D1A30722AEA8B81E72957134897E7A11A",
        "identity": "CLabs Validator #2 on testing",
        "points": 7.920946203704226e+22
      },
      {
        "address": "0xA0AF2E71CECC248F4A7FD606F203467B500DD53B",
        "identity": "CLabs Validator #1 on testing",
        "points": 6.600856324429959e+22
      }
    ]
  }
}

for my test sheet
Some additional questions:

  • Is this meant to run as a cronjob?
  • how to test exchange rates?

packages/leaderboard/README.md Outdated Show resolved Hide resolved
packages/leaderboard/src/board.ts Outdated Show resolved Hide resolved
packages/leaderboard/src/board.ts Outdated Show resolved Hide resolved
packages/leaderboard/src/board.ts Outdated Show resolved Hide resolved
packages/leaderboard/src/board.ts Outdated Show resolved Hide resolved
packages/leaderboard/src/board.ts Outdated Show resolved Hide resolved
packages/leaderboard/src/board.ts Outdated Show resolved Hide resolved
packages/leaderboard/src/board.ts Outdated Show resolved Hide resolved
packages/leaderboard/src/board.ts Outdated Show resolved Hide resolved
@diminator
Copy link
Contributor

Also, does a competitor only show up if she's on the spreadsheet?

@diminator
Copy link
Contributor

it also needs mentioning that this script has to run where there's access to the blockscout DB (within blockscout container or so)

.env Outdated Show resolved Hide resolved
@cmcewen cmcewen added the automerge Have PR merge automatically when checks pass label Dec 5, 2019
@cmcewen cmcewen removed their assignment Dec 5, 2019
@celo-ci-bot-user celo-ci-bot-user merged commit 7066f39 into celo-org:master Dec 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Have PR merge automatically when checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Devs SBAT to resolve the multipliers that are required for the GCSO
8 participants