soc

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2022 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) Chunk added in v0.5.3

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

Chunk returns the SOC chunk.

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) 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