skynetblocklist

package
v1.5.6 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2021 License: MIT Imports: 13 Imported by: 0

README

Skynet Blocklist

The Skynet Blocklist module manages a list of blocked Skylinks by tracking hashes of their merkleroots.

Subsystems

The following subsystems help the Skynet Blocklist module execute its responsibilities:

Skynet Blocklist Subsystem

Key Files

The Skynet Blocklist subsystem contains the structure of the Skynet Blocklist and is used to create a new Skynet Blocklist and return information about the Blocklist. Uses Persist package's Append-Only File subsystem to ensure ACID disk updates.

Exports

  • Blocklist returns the list of hashes of the blocked merkle roots
  • IsBlocked returns whether or not a skylink merkleroot is blocked
  • New creates and returns a new Skynet Blocklist
  • UpdateBlocklist updates the blocklist

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SkynetBlocklist

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

SkynetBlocklist manages a set of blocked skylinks by tracking the merkleroots and persists the list to disk.

func New

func New(persistDir string) (*SkynetBlocklist, error)

New returns an initialized SkynetBlocklist.

func (*SkynetBlocklist) Blocklist

func (sb *SkynetBlocklist) Blocklist() []crypto.Hash

Blocklist returns the hashes of the merkleroots that are blocked

func (*SkynetBlocklist) Close

func (sb *SkynetBlocklist) Close() error

Close closes and frees associated resources.

func (*SkynetBlocklist) IsBlocked

func (sb *SkynetBlocklist) IsBlocked(skylink modules.Skylink) bool

IsBlocked indicates if a skylink is currently blocked

func (*SkynetBlocklist) IsHashBlocked added in v1.5.4

func (sb *SkynetBlocklist) IsHashBlocked(hash crypto.Hash) bool

IsHashBlocked indicates if a hash is currently blocked

func (*SkynetBlocklist) UpdateBlocklist

func (sb *SkynetBlocklist) UpdateBlocklist(additions, removals []crypto.Hash) error

UpdateBlocklist updates the list of skylinks that are blocked.

Jump to

Keyboard shortcuts

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