soc

package
v1.18.2 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: BSD-3-Clause Imports: 5 Imported by: 15

Documentation

Overview

Package soc provides the single-owner chunk implementation and validator.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAddress

func CreateAddress(id ID, owner []byte) (swarm.Address, error)

CreateAddress creates a new SOC address from the id and the ethereum address of the owner.

func Valid added in v0.4.1

func Valid(ch swarm.Chunk) bool

Valid checks if the chunk is a valid single-owner chunk.

Types

type ID added in v0.5.3

type ID []byte

ID is a SOC identifier

type SOC added in v0.5.3

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

SOC wraps a content-addressed chunk.

func FromChunk

func FromChunk(sch swarm.Chunk) (*SOC, error)

FromChunk recreates a SOC representation from swarm.Chunk data.

func New

func New(id ID, ch swarm.Chunk) *SOC

New creates a new SOC representation from arbitrary id and a content-addressed chunk.

func NewSigned added in v0.5.3

func NewSigned(id ID, ch swarm.Chunk, owner, sig []byte) (*SOC, error)

NewSigned creates a single-owner chunk based on already signed data.

func (*SOC) Address added in v1.17.0

func (s *SOC) Address() (swarm.Address, error)

Address returns the SOC chunk address.

func (*SOC) Chunk added in v0.5.3

func (s *SOC) Chunk() (swarm.Chunk, error)

Chunk returns the SOC chunk.

func (*SOC) ID added in v1.17.0

func (s *SOC) ID() []byte

ID returns the SOC id.

func (*SOC) OwnerAddress added in v1.17.0

func (s *SOC) OwnerAddress() []byte

OwnerAddress returns the ethereum address of the SOC owner.

func (*SOC) Sign added in v0.5.3

func (s *SOC) Sign(signer crypto.Signer) (swarm.Chunk, error)

Sign signs a SOC using the given signer. It returns a signed SOC chunk ready for submission to the network.

func (*SOC) Signature added in v1.17.0

func (s *SOC) Signature() []byte

Signature returns the SOC signature.

func (*SOC) WrappedChunk added in v0.5.3

func (s *SOC) WrappedChunk() swarm.Chunk

WrappedChunk returns the chunk wrapped by the SOC.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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