-
Notifications
You must be signed in to change notification settings - Fork 73
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
Community Bounty #3 (Bot) #47
Conversation
Thanks, @traumschule and @mochet, will review! |
@traumschule If I proceed now, I'll have to grade it a little lower than what is perhaps fair, so I prefer to give you another day to:
|
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.
Got it running with both yarn and npm now, so that's good 👍
First of all, I'm not sure what to do with the accountId
in the config?
Part I Validators/Block Production
This may be related to the config, but I haven't seen any updates on the validators yet. Could also be that it only runs occasionally, so I'll give the 24h.
Part II Announce Storage Providers
-
I didn't see anything when I started a Storage Provider that was down. Do I need to setup some environment for this? I won't know for whether stopping reports before ~24 has passed.
-
When an SP opening was created/hired, the link and info was
- Opening:
New opening: Storage Provider 7
- The
openingId
was 6, and the link was to curators - "*/#/working-groups/opportunities/curators/7" - Hired:
member6 was choosen as Storage Provider 7
- Again, the
openingId
was 6, and the link was to curators - "*/#/working-groups/opportunities/curators/7"
- Opening:
-
When multiple SPs were hired in the same opening, only one of them was included.
Ideally, a little more verbosity would be nice (such as "Title"), but fixing the errors is enough.
Part III Fix Council & Proposals
- The council probably works fine, although on the chain I'm using for testing, the election round is too high (112,475). It seemed to work when I changed the endpoint to "wss://rome-rpc-endpoint.joystream.org:9944/" though...
- For proposals, I'm only getting notifications when a proposal is created. Not for anything else...
Open `config.ts` and fill in the variables: | ||
- `token`: To get a bot token talk to @botfather on Telegram. | ||
- `chatid`: See below to find out the id of your group. | ||
- `accountId`: The joystream hash to use for querying the api. |
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.
Not sure what to put in here?
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.
accountId
has to be a 48 character string or any of the accepted arguments below. It is used to query the api for the number of stakers in lib/announcements.js:226
:
const stakers = await api.query.staking.erasStakers(parseInt(era), accountId);
/**
* Exposure of validator at era.
*
* This is keyed first by the era index to allow bulk deletion and then the stash account.
*
* Is it removed after `HISTORY_DEPTH` eras.
* If stakers hasn't been set or has been removed then empty exposure is returned.
**/
erasStakers: AugmentedQueryDoubleMap<ApiType, (key1: EraIndex | AnyNumber | Uint8Array, key2: AccountId | string | Uint8Array) => Observable<Exposure>>;
For example picking one of the validators:
const accountId = "5EHfoRcN9tVa3PJ2XVhsFecxtCVyu7dz1pQ7YmheerPR3tBm";
const era: any = await api.query.staking.currentEra();
const stakers: any = await api.query.staking.erasStakers(+era, accountId);
console.log("number of stakers:", stakers.others.length);
If there is a better way we should use that instead.
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.
Yeah, I understand it was supposed to be an accountId
, but didn't understand why!
Yes, assuming you want to get the validator stats here, there is a better way.
In general, when the chain state
tab in pioneer allows you to toggle on/off "include option", it means it's a double map.
See polkadot js!
If you reduce
Yes, their domains have to be added to
Committed ee4c5c8.
Looking into it.
See below. |
Please retry with latest commits. |
This did make it show up in the log, like so:
All numbers looks wrong, and no post was made to telegram...
To make this work, I think you need to have a look at how
"Hired" was just to show what the message was for.
This didn't fix the issue.
link: */#/working-groups/opportunities/curators/11
The council now works until the reveal period ends, when it crashes. |
We chose to give some more time here to iron out the issues, but will have to grade #41 now. I think this needs a lot more work, and only the storage part is partially working. Granting $25 on this, and closing the PR. |
#41: