Skip to content

Expose proposal API in the node RPC  #873

Open
@alenmestrov

Description

@alenmestrov

API on a node that sends information to contract, similar to only-peers

API that is consumed by calimero-sdk needs to be exposed to the server

Notes

  • We are not calling the storage but the blockchain
  • We would need contextIdentity to sign this approvals

Example

mutate methods are:

pub fn create_and_approve_proposal(&self, proposal: Signed<Proposal>)
pub fn approve(&mut self, proposal: Signed<ProposalApprovalWithSigner>)

both of them return: Option

query methods:

    pub fn get_context_storage_keys(&self) -> HashSet<Box<[u8]>> {
        self.context_storage_keys.clone()
    }

    pub fn get_context_value(&self, key: Box<[u8]>) -> Option<Box<[u8]>> {
        self.context_storage.get(&key).cloned()
    }

    pub fn get_num_approvals(&self) -> u32 {
        self.num_approvals
    }

    pub fn get_active_proposals_limit(&self) -> u32 {
        self.active_proposals_limit
    }

    pub fn requests(&self, offset: usize, length: usize) -> Vec<(&u32, &Proposal)>
    }

you only need these for the rpc, I mean the mutate and these 3

pub fn requests(&self, offset: usize, length: usize) -> Vec<(&u32, &Proposal)>
pub fn get_context_storage_keys(&self) -> HashSet<Box<[u8]>>
pub fn get_context_value(&self, key: Box<[u8]>) -> Option<Box<[u8]>>

just to clarify, you don't need a near account to query but for mutate yes... that's why we put the relayer.

Metadata

Metadata

Labels

Type

No type

Projects

Status

In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions