dledger

package
v0.0.0-...-17ab8cc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 15, 2024 License: GPL-3.0 Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DLedger

type DLedger struct {
	Node           *hashgraph.Node
	MyAddress      string
	PeerAddresses  []string
	PeerAddressMap map[string]string
}

DLedger : Struct for a member of the distributed ledger

func NewDLedger

func NewDLedger(port string, peersFilePath string) *DLedger

NewDLedger : Initialize a member in the distributed ledger. This is not adding a new member, but rather reading a member from a list and initializing it.

func NewDLedgerFromPeers

func NewDLedgerFromPeers(port string, peerAddressMap map[string]string) *DLedger

func (*DLedger) PerformTransaction

func (dl *DLedger) PerformTransaction(receiverAddr string, amount float64)

PerformTransaction : Adds a transaction to the member's buffer.

func (*DLedger) Start

func (dl *DLedger) Start()

Start : Starts the gossip routine in a go routine.

func (*DLedger) WaitForPeers

func (dl *DLedger) WaitForPeers()

WaitForPeers : Waits for all members in the member list to be online and responsive.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL