Skip to main content

ResQ.Blockchain.INeoClient

INeoClient.RecordEvidenceAsync(EvidenceRecord, CancellationToken) Method

Records evidence metadata on the blockchain with a reference to IPFS storage.
System.Threading.Tasks.Task<ResQ.Blockchain.TransactionResult> RecordEvidenceAsync(ResQ.Blockchain.EvidenceRecord evidence, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

evidence EvidenceRecord The evidence record containing IPFS CID and metadata. cancellationToken System.Threading.CancellationToken Cancellation token for the operation.

Returns

System.Threading.Tasks.Task<TransactionResult>
A TransactionResult containing the transaction hash and confirmation status.

Exceptions

System.InvalidOperationException
Thrown when the blockchain operation fails.
System.OperationCanceledException
Thrown when the operation is cancelled.

Example

var evidence = new EvidenceRecord(
    IncidentId: "inc-001",
    IpfsCid: "Qmabc123...",
    ContentType: "image/jpeg",
    SizeBytes: 1024567,
    Hash: "sha256:..."
);

var result = await neoClient.RecordEvidenceAsync(evidence);
Console.WriteLine($"Evidence recorded: {result.TransactionHash}");

Remarks

Evidence is stored on IPFS for decentralized storage, while the blockchain records a permanent, immutable reference to the evidence along with its hash for integrity verification.