Skip to main content

ResQ.Blockchain

INeoClient Interface

Interface for Neo N3 blockchain operations.
public interface INeoClient
Derived
MockNeoClient

Example

// Dependency injection registration
services.AddSingleton<INeoClient, MockNeoClient>();

// Usage
public class IncidentService
{
    private readonly INeoClient _neoClient;
    
    public IncidentService(INeoClient neoClient)
    {
        _neoClient = neoClient;
    }
    
    public async Task RecordIncidentAsync(BlockchainEvent evt)
    {
        var result = await _neoClient.RecordEventAsync(evt);
        if (result.IsConfirmed)
        {
            Console.WriteLine($"Recorded: {result.TransactionHash}");
        }
    }
}

Remarks

This interface defines the contract for interacting with the Neo N3 blockchain. Implementations provide methods for recording events, verifying attestations, and querying blockchain state. Use MockNeoClient for testing and development without a real blockchain connection.
Methods
GetBlockHeightAsync(CancellationToken)Gets the current block height of the blockchain.
GetEventsByIncidentAsync(string, CancellationToken)Retrieves all blockchain events associated with a specific incident.
RecordEventAsync(BlockchainEvent, CancellationToken)Records an event on the Neo N3 blockchain.
RecordEvidenceAsync(EvidenceRecord, CancellationToken)Records evidence metadata on the blockchain with a reference to IPFS storage.
RecordLocationAttestationAsync(LocationAttestation, CancellationToken)Records a drone location attestation on the blockchain.
VerifyLocationAttestationAsync(LocationAttestation, CancellationToken)Verifies a location attestation signature on the blockchain.