Show / Hide Table of Contents

    Interface IDeltaCache

    This service should be used to retrieve and cache Delta from the Dfs

    Namespace: Catalyst.Abstractions.Consensus.Deltas
    Assembly: Catalyst.Abstractions.dll
    Syntax
    public interface IDeltaCache

    Properties

    | Improve this Doc View Source

    GenesisAddress

    Declaration
    string GenesisAddress { get; }
    Property Value
    Type Description
    System.String
    | Improve this Doc View Source

    GenesisHash

    Dfs address of the content for the very first delta.

    Declaration
    MultiHash GenesisHash { get; set; }
    Property Value
    Type Description
    MultiHash

    Methods

    | Improve this Doc View Source

    AddLocalDelta(CandidateDeltaBroadcast, Delta)

    Stores a locally produced delta, with Hash of the corresponding candidate as a key. This allows for later retrieval of the full content of the delta if the candidate gets confirmed.

    Declaration
    void AddLocalDelta(CandidateDeltaBroadcast localCandidate, Delta delta)
    Parameters
    Type Name Description
    CandidateDeltaBroadcast localCandidate

    The candidate produced locally (>)

    Delta delta

    The full content of the produced delta.

    | Improve this Doc View Source

    TryGetLocalDelta(CandidateDeltaBroadcast, out Delta)

    Attempts to retrieve a local delta which was locally produced and stored in cache in case it was elected in a later phase of the cycle. If the delta is not found it is because the confirmed delta was not locally produced.

    Declaration
    bool TryGetLocalDelta(CandidateDeltaBroadcast candidate, out Delta delta)
    Parameters
    Type Name Description
    CandidateDeltaBroadcast candidate

    The candidate for which we want too retrieve the full content.

    Delta delta

    The full delta content retrieved expected to be found on cache.

    Returns
    Type Description
    System.Boolean

    true if the retrieval was successful, false otherwise.

    | Improve this Doc View Source

    TryGetOrAddConfirmedDelta(MultiHash, out Delta, CancellationToken)

    Attempts to retrieve a delta which has already been confirmed by other producers from the local cache first, then, if the delta was not found there, the retrieval is done from the Dfs and the delta is added to the local cache for later use.

    Declaration
    bool TryGetOrAddConfirmedDelta(MultiHash hash, out Delta delta, CancellationToken cancellationToken = default(CancellationToken))
    Parameters
    Type Name Description
    MultiHash hash

    The hash or address of the delta on the Dfs.

    Delta delta

    The delta retrieved on the Dfs.

    System.Threading.CancellationToken cancellationToken

    A token allowing to cancel the task before it ends.

    Returns
    Type Description
    System.Boolean

    true if the retrieval was successful, false otherwise.

    • Improve this Doc
    • View Source
    Back to top Copyright © 2019 Catalyst Network