-
Notifications
You must be signed in to change notification settings - Fork 7
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
Add tip bot balance to metrics #50
Conversation
Also some necessary refactors - tip url is no longer in chain config.
src/balance.ts
Outdated
import { TipNetwork } from "./types"; | ||
|
||
export const updateAllBalances = async (tipBotAddress: string, log: Probot["log"]): Promise<void> => { | ||
const networks: TipNetwork[] = ["localpolkadot", "localkusama", "kusama", "polkadot"]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
afaiu this will be running on prod?
therefore 2 dumb questions
- do we need on prod to update local* networks?
- is the tipBotAddress same for each network?
i guess on prod we will see local* networks failed to check balance
i wonder why we need to update All if we run one instance per its address/network and thus they will run updateBalance for itself?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The answer to (2) should be yes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need on prod to update local* networks?
i guess on prod we will see local* networks failed to check balance
We don't need local*
, my idea was to not do anything special for those and just let it fail once to check balance.
But maybe I better change it so we don't have errors every time the app is restarted.
is the tipBotAddress same for each network?
The answer to (2) should be yes.
I believe it is a yes.
if we run one instance per its address/network
My understanding is that we run one instance per all networks (so Polkadot and Kusama in our case), using a single instance and a single seed for accounts on both those networks. So I wanted to update all of those networks on startup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah right, if we run all at once for api now, and one address, so then looks like we just need to remove local.* ones 👌
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tipUrl
is no longer part ofChainConfig
, because it depends on a given tip instance