Skip to content

Conversation

ernest-nowacki
Copy link
Contributor

@ernest-nowacki ernest-nowacki commented Sep 25, 2025

https://github.com/smartcontractkit/cre-cli/pull/24/files took this, adjusted a bit to 0.0.3-alpha and put in our cre-sdk-examples.

Update:

  • Added @jeffrifwaldsmartcontract touchups from here.
  • Added all the ABIs that ships normally with cre init and GO PoR example
  • Refactored code to adjust for the fact we don't have auto-generated write report helpers
  • Now example is fully working

Comment on lines +211 to +231
const consensusCapability = new cre.capabilities.ConsensusCapability()
const reportResponse = consensusCapability
.report(runtime, {
encodedPayload: hexToBase64(callData),
encoderName: 'evm',
signingAlgo: 'ecdsa',
hashingAlgo: 'keccak256',
})
.result()

// Step 2: Write the generated report - convert to JSON format
const reportJson = {
configDigest: Buffer.from(reportResponse.configDigest).toString('base64'),
seqNr: reportResponse.seqNr.toString(),
reportContext: Buffer.from(reportResponse.reportContext).toString('base64'),
rawReport: Buffer.from(reportResponse.rawReport).toString('base64'),
sigs: reportResponse.sigs.map((sig) => ({
signature: Buffer.from(sig.signature).toString('base64'),
signerId: sig.signerId,
})),
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we need to add helper for this. It's too verbose.

@ernest-nowacki ernest-nowacki merged commit c6d72c6 into main Sep 30, 2025
8 checks passed
@ernest-nowacki ernest-nowacki deleted the feat/PoR branch September 30, 2025 12:55
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

Successfully merging this pull request may close these issues.

3 participants