Closed MartinBenediktBusch closed 1 year ago
Continued the development. Please refer to the README file https://github.com/hoprnet/hopr-devrel/tree/c2553a0d3ca2feb61c1c4141e7ca7f0be13e5baa/subgraph/packages/subgraph-dufour for details
Deployed the subgraph to my own studio and tested it. Approved to merge :)
Will publish this subgraph once a new set of rotsee contracts gets deployed. Waiting for auditor's ack before contract deployment
Overview
We need to program and deploy a subgraph that listens to the smart contracts of the
dufour
environment for several use cases.ct-app
needs the subgraph to create a link between thesafe-address
,node-address
, andwxHOPR stake
of a node runner to create a distribution strategy based on stake.web-app
team needs the subgraph to verify the correctness of the onboarding flow.Expected Outcome of the Subgraph
Current Progress
NodeSafeRegistry
,wxHOPR
,mHOPR
, andxHOPR
smart contracts.AccountBalance
entity that updates the token balance of each address.NodeSafeRegistry
SC is set-upWhat is missing
Strategy discussed with Q
// gets updated per // (NodeSafeRegistry.sol) // 1. event RegisteredNodeSafe(address indexed safeAddress, address indexed nodeAddress); // 2. event DergisteredNodeSafe(address indexed safeAddress, address indexed nodeAddress); // (NetworkRegistry.sol) // 3. event Registered(address indexed stakingAccount, address indexed nodeAddress); // Emit when a node is included in // 4. event Deregistered(address indexed stakingAccount, address indexed nodeAddress); // Emit when a node is removed from // 5. event RegisteredByManager(address indexed stakingAccount, address indexed nodeAddress); // Emit when the contract // 6. event DeregisteredByManager(address indexed stakingAccount, address indexed nodeAddress); // Emit when the contract type NodeSafeRegistration @entity { id: ID! //
${nodeAddress}-${safeAddres}
nodeAddress: Bytes! safeAddress: Bytes! isRegisteredOnNodeSafeRegistry: Boolean! // gets updated when event 1 or 2 is emitted. Default value is false isRegisteredOnNetworkRegistry: Boolean! // gets updated when event 3 - 6 is emitted. Default value is false }// gets updated per event 1 - 6, 7 // 7. event EligibilityUpdated(address indexed stakingAccount, bool indexed eligibility); // Emit when the eligibility of type Safe @entity { id: ID! // safeAddress safeAddress: Bytes! nodes: [NodeSafeRegistration!]! @derivedFrom(field: "safeAddress") networkRegistryEligibility: Boolean! // gets updated when event 7 is emitted. Default value is false }
// gets updated per // 8. event RequirementUpdated(address indexed requirementImplementation); // Emit when the network registry proxy is // 9. event NetworkRegistryStatusUpdated(bool indexed isEnabled); // Global toggle of the network registry type NetworkRegistry @entity { id: ID! //
${nodeAddress}-${safeAddres}
nodes: [NodeSafeRegistration!]! @derivedFrom(field: "nodeAddress") safes: [Safe!]! @derivedFrom(field: "safeAddress") requirementImplementation: Bytes! // gets updated when event 8 is emitted isEnabled: Boolean! // gets updated when event 9 is emitted. Default value is false }