redistribution

package
v2.3.2 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: BSD-3-Clause Imports: 13 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChunkInclusionProof

type ChunkInclusionProof struct {
	ProofSegments  []common.Hash `json:"proofSegments"`
	ProveSegment   common.Hash   `json:"proveSegment"`
	ProofSegments2 []common.Hash `json:"proofSegments2"`
	ProveSegment2  common.Hash   `json:"proveSegment2"`
	ChunkSpan      uint64        `json:"chunkSpan"`
	ProofSegments3 []common.Hash `json:"proofSegments3"`
	PostageProof   PostageProof  `json:"postageProof"`
	SocProof       []SOCProof    `json:"socProof"`
}

ChunkInclusionProof structure must exactly match corresponding structure (of the same name) in Redistribution.sol smart contract. github.com/ethersphere/storage-incentives/blob/ph_f2/src/Redistribution.sol github.com/ethersphere/storage-incentives/blob/master/src/Redistribution.sol (when merged to master)

func NewChunkInclusionProof

func NewChunkInclusionProof(proofp1, proofp2, proofp3 bmt.Proof, sampleItem storer.SampleItem) (ChunkInclusionProof, error)

NewChunkInclusionProof transforms arguments to ChunkInclusionProof object

type ChunkInclusionProofs

type ChunkInclusionProofs struct {
	A ChunkInclusionProof `json:"proof1"`
	B ChunkInclusionProof `json:"proof2"`
	C ChunkInclusionProof `json:"proofLast"`
}

type Contract

type Contract interface {
	ReserveSalt(context.Context) ([]byte, error)
	IsPlaying(context.Context, uint8) (bool, error)
	IsWinner(context.Context) (bool, error)
	Claim(context.Context, ChunkInclusionProofs) (common.Hash, error)
	Commit(context.Context, []byte, uint64) (common.Hash, error)
	Reveal(context.Context, uint8, []byte, []byte) (common.Hash, error)
}

func New

func New(
	overlay swarm.Address,
	owner common.Address,
	logger log.Logger,
	txService transaction.Service,
	incentivesContractAddress common.Address,
	incentivesContractABI abi.ABI,
	setGasLimit bool,
) Contract

type PostageProof

type PostageProof struct {
	Signature []byte      `json:"signature"`
	PostageId common.Hash `json:"postageId"`
	Index     uint64      `json:"index"`
	TimeStamp uint64      `json:"timeStamp"`
}

SOCProof structure must exactly match corresponding structure (of the same name) in Redistribution.sol smart contract.

type SOCProof

type SOCProof struct {
	Signer     common.Address `json:"signer"`
	Signature  []byte         `json:"signature"`
	Identifier common.Hash    `json:"identifier"`
	ChunkAddr  common.Hash    `json:"chunkAddr"`
}

SOCProof structure must exactly match corresponding structure (of the same name) in Redistribution.sol smart contract.

Jump to

Keyboard shortcuts

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