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

personhood oracle demo frequency #38

Open
brenzi opened this issue Oct 4, 2023 · 0 comments
Open

personhood oracle demo frequency #38

brenzi opened this issue Oct 4, 2023 · 0 comments

Comments

@brenzi
Copy link
Member

brenzi commented Oct 4, 2023

fork this repo and start your work based on the ab/node-template-sink branch

the demo setup is described here. should allow to fully reproduce the sub0 demo:
https://github.com/encointer/personhood-oracle/blob/ab/node-template-sink/README.md

make the Oracle write to frequency

refactor this RPC call to send an extrinsic to fequency instead of node_template

definition of rpc method:

io.add_sync_method(personhoodoracle_issue_node_template_xt, move |params: Params| {

here we verify encointer reputation:

// Check reputation first - will be changed later to have the user submit their `ProofOfAttendance`
let reputations = fetch_reputation_inner(params.clone())?;
let verified_reputations = reputations.iter().filter(|rep| rep.is_verified()).count();
if verified_reputations == 0 {
return Err("The user does not have any reputation".to_string())
}

then we compose an extrinsic (here comes your extrinsic). We hard-code metadata here. good enough for demo, but we have upstream issues in the backlog to defive this from metadata more easily

let call = OpaqueCall::from_tuple(&((7u8, 0u8), subject_template_idx));

CLI client

The easiest start will be to use our cli client for the demo:

refactor this according to your needs:

browser dapp

If you insist on a js dapp for the demo, you may find inspiration here: A while back, Encointer has integrated Integritee rpc's:
https://github.com/encointer/encointer-js/tree/master/packages/worker-api

noteworthy technical debt

with relevance to the frequency use case

longterm FYI:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant