Documentation ¶
Overview ¶
Package soc provides the single-owner chunk implemenation and validator.
Index ¶
Constants ¶
const ( IdSize = 32 SignatureSize = 65 )
Variables ¶
This section is empty.
Functions ¶
func CreateAddress ¶
CreateAddress creates a new soc address from the soc id and the ethereum address of the signer
func NewChunk ¶
NewChunk is a convenience function to create a single-owner chunk ready to be sent on the network.
func NewSignedChunk ¶ added in v0.5.0
NewChunk is a convenience function to create a single-owner chunk ready to be sent on the network.
Types ¶
type Owner ¶
type Owner struct {
// contains filtered or unexported fields
}
Owner is a wrapper that enforces valid length address of soc owner.
type Soc ¶
Soc wraps a single soc.
func New ¶
New creates a new Soc representation from arbitrary soc id and a content-addressed chunk.
By default the span of the soc data is set to the length of the payload.
func (*Soc) AddSigner ¶
AddSigner currently sets a single signer for the soc.
This method will overwrite any value set with WithOwnerAddress with the address derived from the given signer.
func (*Soc) OwnerAddress ¶
OwnerAddress returns the ethereum address of the signer of the Chunk.
func (*Soc) ToChunk ¶
ToChunk generates a signed chunk payload ready for submission to the swarm network.
The method will fail if no signer has been added.
func (*Soc) WithOwnerAddress ¶
WithOwnerAddress provides the possibility of setting the ethereum address for the owner of an soc in the absence of a signer.