Show / Hide Table of Contents

Class BlockChain<T>

Inheritance
Object
BlockChain<T>
Implements
IEnumerable<Block<T>>
IEnumerable
Inherited Members
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
Namespace: Libplanet.Blockchain
Assembly: Libplanet.dll
Syntax
public class BlockChain<T> : IEnumerable<Block<T>>, IEnumerable where T : IAction, new()
Type Parameters
Name Description
T

Constructors

| Improve this Doc View Source

BlockChain(IBlockPolicy<T>, IStore)

Declaration
public BlockChain(IBlockPolicy<T> policy, IStore store)
Parameters
Type Name Description
IBlockPolicy<T> policy
IStore store
| Improve this Doc View Source

BlockChain(IBlockPolicy<T>, IStore, Guid)

Declaration
public BlockChain(IBlockPolicy<T> policy, IStore store, Guid id)
Parameters
Type Name Description
IBlockPolicy<T> policy
IStore store
Guid id

Properties

| Improve this Doc View Source

Blocks

All Block<T>s in the BlockChain<T> storage, including orphan Block<T>s. Keys are Hashes and values are their corresponding Block<T>s.

Declaration
public IDictionary<HashDigest<SHA256>, Block<T>> Blocks { get; }
Property Value
Type Description
IDictionary<HashDigest<SHA256>, Block<T>>
| Improve this Doc View Source

Id

Declaration
public Guid Id { get; }
Property Value
Type Description
Guid
| Improve this Doc View Source

Item[Int64]

Declaration
public Block<T> this[long index] { get; }
Parameters
Type Name Description
Int64 index
Property Value
Type Description
Block<T>
| Improve this Doc View Source

Policy

Declaration
public IBlockPolicy<T> Policy { get; }
Property Value
Type Description
IBlockPolicy<T>
| Improve this Doc View Source

Tip

Declaration
public Block<T> Tip { get; }
Property Value
Type Description
Block<T>
| Improve this Doc View Source

Transactions

All Transaction<T>s in the BlockChain<T> storage, including orphan Transaction<T>s. Keys are Ids and values are their corresponding Transaction<T>s.

Declaration
public IDictionary<TxId, Transaction<T>> Transactions { get; }
Property Value
Type Description
IDictionary<TxId, Transaction<T>>

Methods

| Improve this Doc View Source

Append(Block<T>)

Declaration
public void Append(Block<T> block)
Parameters
Type Name Description
Block<T> block
| Improve this Doc View Source

Append(Block<T>, DateTimeOffset)

Declaration
public void Append(Block<T> block, DateTimeOffset currentTime)
Parameters
Type Name Description
Block<T> block
DateTimeOffset currentTime
| Improve this Doc View Source

Finalize()

Declaration
protected void Finalize()
| Improve this Doc View Source

GetEnumerator()

Declaration
public IEnumerator<Block<T>> GetEnumerator()
Returns
Type Description
IEnumerator<Block<T>>
| Improve this Doc View Source

GetStates(IEnumerable<Address>, Nullable<HashDigest<SHA256>>)

Declaration
public AddressStateMap GetStates(IEnumerable<Address> addresses, HashDigest<SHA256>? offset = default(HashDigest<SHA256>? ))
Parameters
Type Name Description
IEnumerable<Address> addresses
Nullable<HashDigest<SHA256>> offset
Returns
Type Description
AddressStateMap
| Improve this Doc View Source

MineBlock(Address)

Declaration
public Block<T> MineBlock(Address miner)
Parameters
Type Name Description
Address miner
Returns
Type Description
Block<T>
| Improve this Doc View Source

MineBlock(Address, DateTimeOffset)

Declaration
public Block<T> MineBlock(Address miner, DateTimeOffset currentTime)
Parameters
Type Name Description
Address miner
DateTimeOffset currentTime
Returns
Type Description
Block<T>
| Improve this Doc View Source

StageTransactions(ISet<Transaction<T>>)

Declaration
public void StageTransactions(ISet<Transaction<T>> txs)
Parameters
Type Name Description
ISet<Transaction<T>> txs
| Improve this Doc View Source

Validate(IEnumerable<Block<T>>, DateTimeOffset)

Declaration
public void Validate(IEnumerable<Block<T>> blocks, DateTimeOffset currentTime)
Parameters
Type Name Description
IEnumerable<Block<T>> blocks
DateTimeOffset currentTime

Explicit Interface Implementations

| Improve this Doc View Source

IEnumerable.GetEnumerator()

Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type Description
IEnumerator

Implements

System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable
  • Improve this Doc
  • View Source
Back to top Copyright © 2019 Planetarium
Generated by DocFX