Created
May 26, 2020 22:44
-
-
Save devadutta/92af8abed492254a530dfd3a55c0c684 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getTranscoderState(worker.PuK): | |
# The call fails if the worker is not registered else returns | |
# one of the following states. | |
# enum TranscoderState { BONDING, BONDED, UNBONDED, UNBONDING } | |
worker.stakeReady is equal to BONDED state. The current implementation allows delegation in any of the states. | |
onlineWorkers = select online workers \ | |
where worker.directStake > minDirectStake \ | |
AND getTranscoderState(worker.PuK) == BONDED | |
for worker in onlineWorkers: | |
if worker.encodeCapacity > profile.minimumEncodeCapacity | |
and | |
worker.currentCPU < profile.maxCurrentCPU | |
# other selection criteria can come here later | |
qualifiedWorkers.append(worker) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment