skynetblacklist

package
v0.0.0-...-c98baff Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2020 License: MIT Imports: 12 Imported by: 0

README

Skynet Blacklist

The Skynet Blacklist modules manages a list of blacklisted Skylinks by tracking their merkleroots.

Subsystems

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

Persistence Subsystem

Key Files

The Persistence subsystem is responsible for the disk interaction and ensuring safe and performant ACID operations. An append only structure is used with a length of fsync'd bytes encoded in the metadata.

Inbound Complexities

  • callInitPersist initializes the persistence file
    • The Skynet Blacklist Subsystem's New method uses callInitPersist
  • callUpdateAndAppend updates the skynet blacklist and appends the information to the persistence file
    • The Skynet Blacklist Subsytem's Update method uses callUpdateAndAppend
Skynet Blacklist Subsystem

Key Files

The Skynet Blacklist subsystem contains the structure of the Skynet Blacklist and is used to create a new Skynet Blacklist and return information about the Blacklist.

Exports

  • Blacklist returns the list of blacklisted merkle roots
  • IsBlacklisted returns whether or not a skylink merkleroot is blacklisted
  • New creates and returns a new Skynet Blacklist
  • Update updates the blacklist

Outbound Complexities

  • New calls the Persistence Subsystem's callInitPersist method
  • Update calls the Persistence Subsystem's callUpdateAndAppend method

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SkynetBlacklist

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

SkynetBlacklist manages a set of blacklisted skylinks by tracking the merkleroots and persists the list to disk

func New

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

New creates a new SkynetBlacklist

func (*SkynetBlacklist) Blacklist

func (sb *SkynetBlacklist) Blacklist() []crypto.Hash

Blacklist returns the merkleroots that are blacklisted

func (*SkynetBlacklist) IsBlacklisted

func (sb *SkynetBlacklist) IsBlacklisted(skylink modules.Skylink) bool

IsBlacklisted indicates if a skylink is currently blacklisted

func (*SkynetBlacklist) UpdateSkynetBlacklist

func (sb *SkynetBlacklist) UpdateSkynetBlacklist(additions, removals []modules.Skylink) error

UpdateSkynetBlacklist updates the list of skylinks that are blacklisted

Jump to

Keyboard shortcuts

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