bzz

package
v1.14.1 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2023 License: BSD-3-Clause Imports: 10 Imported by: 2 modules, 6 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package bzz exposes the data structure and operations necessary on the bzz.Address type which used in the handshake protocol, address-book and hive protocol.

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidAddress = errors.New("invalid address")

Functions

func ContainsAddress added in v1.11.0

func ContainsAddress(addrs []Address, a *Address) bool

ContainsAddress reports whether a is present in addrs.

Types

type Address

type Address struct {
	Underlay        ma.Multiaddr
	Overlay         swarm.Address
	Signature       []byte
	Transaction     []byte
	EthereumAddress []byte
}

Address represents the bzz address in swarm. It consists of a peers underlay (physical) address, overlay (topology) address and signature. Signature is used to verify the `Overlay/Underlay` pair, as it is based on `underlay|networkID`, signed with the public key of Overlay address

func NewAddress

func NewAddress(signer crypto.Signer, underlay ma.Multiaddr, overlay swarm.Address, networkID uint64, trx []byte) (*Address, error)

func ParseAddress

func ParseAddress(underlay, overlay, signature, nonce []byte, validateOverlay bool, networkID uint64) (*Address, error)

func (*Address) Equal

func (a *Address) Equal(b *Address) bool

func (*Address) MarshalJSON

func (a *Address) MarshalJSON() ([]byte, error)

func (*Address) ShortString

func (a *Address) ShortString() string

ShortString returns shortened versions of bzz address in a format: [Overlay, Underlay] It can be used for logging

func (*Address) String

func (a *Address) String() string

func (*Address) UnmarshalJSON

func (a *Address) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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