accounting

package
v1.5.9 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2022 License: MIT Imports: 12 Imported by: 0

README

Accounting

The accounting module provides accounting information for a Sia node.

Subsystems

The Accounting module has the following subsystems

Accounting Subsystem

Key Files

The accounting subsystem is responsible for general actions related to the accounting module, such as initialization and returning information about the module.

Exports

  • Accounting
  • Close
  • NewCustomAccounting

Inbound Complexities

  • callUpdateAccounting updates the accounting information and the persistence object in memory.
    • The persistence subsystem's managedUpdateAndPersistAccounting method calls callUpdateAccounting to update the persistence before saving to disk.

Outbound Complexities

  • NewCustomAccounting will use callThreadedPersistAccounting to launch the background loop for persisting the accounting information.
Persistence Subsystem

Key Files

The persistence subsystem is responsible for ensuring safe and performant ACID operations by using the persist package's AppendOnlyPersist object. The latest persistence is stored in the Accounting struct and is loaded from disk on startup.

Inbound Complexities

  • callThreadedPersistAccounting is a background loop that updates the persistence and saves it to disk.
    • The accounting subsystem's NewCustomAccounting function calls callThreadedPersistAccounting once the Accounting module has been initialized before returning.

Outbound Complexities

  • managedUpdateAndPersistAccounting will use callUpdateAccounting to update the Accounting persistence before saving the persistence to disk.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Accounting

type Accounting struct {
	// contains filtered or unexported fields
}

Accounting contains the information needed for providing accounting information about a Sia node.

func NewCustomAccounting

func NewCustomAccounting(h modules.Host, m modules.Miner, r modules.Renter, w modules.Wallet, persistDir string, deps modules.Dependencies) (*Accounting, error)

NewCustomAccounting initializes the accounting module with custom dependencies

func (*Accounting) Accounting

func (a *Accounting) Accounting() (modules.AccountingInfo, error)

Accounting returns the current accounting information

func (*Accounting) Close

func (a *Accounting) Close() error

Close closes the accounting module

NOTE: It will not call close on any of the modules it is tracking. Those modules are responsible for closing themselves independently.

Jump to

Keyboard shortcuts

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