soc

package
v1.12.0-rc4 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2023 License: BSD-3-Clause Imports: 5 Imported by: 7 modules, 15 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 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