swap

package
v1.9.0-evmc.6.1.1-0-un... Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2019 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSwap

func NewSwap(localProfile *LocalProfile, remoteProfile *RemoteProfile, backend chequebook.Backend, proto swap.Protocol) (swapInstance *swap.Swap, err error)

NewSwap constructor, parameters * global chequebook, assume deployed service and * the balance is at buffer. swap.Add(n) called in netstore n > 0 called when sending chunks = receiving retrieve requests

OR sending cheques.

n < 0 called when receiving chunks = receiving delivery responses

OR receiving cheques.

Types

type LocalProfile added in v1.8.12

type LocalProfile struct {
	*swap.Params
	*PayProfile
}

LocalProfile combines a PayProfile with *swap.Params

func NewDefaultSwapParams added in v1.8.0

func NewDefaultSwapParams() *LocalProfile

NewDefaultSwapParams create params with default values

func (*LocalProfile) Chequebook added in v1.8.12

func (lp *LocalProfile) Chequebook() *chequebook.Chequebook

Chequebook get's chequebook from the localProfile

func (*LocalProfile) Init added in v1.8.12

func (lp *LocalProfile) Init(contract common.Address, prvkey *ecdsa.PrivateKey)

Init this can only finally be set after all config options (file, cmd line, env vars) have been evaluated

func (*LocalProfile) PrivateKey added in v1.8.12

func (lp *LocalProfile) PrivateKey() *ecdsa.PrivateKey

PrivateKey accessor

func (*LocalProfile) SetChequebook added in v1.8.12

func (lp *LocalProfile) SetChequebook(ctx context.Context, backend chequebook.Backend, path string) error

SetChequebook wraps the chequebook initialiser and sets up autoDeposit to cover spending.

func (*LocalProfile) SetKey added in v1.8.12

func (lp *LocalProfile) SetKey(prvkey *ecdsa.PrivateKey)

SetKey set's private and public key on localProfile

type PayProfile

type PayProfile struct {
	PublicKey   string         // check against signature of promise
	Contract    common.Address // address of chequebook contract
	Beneficiary common.Address // recipient address for swarm sales revenue
	// contains filtered or unexported fields
}

PayProfile is a container for relevant chequebook and beneficiary options

type RemoteProfile added in v1.8.12

type RemoteProfile struct {
	*swap.Profile
	*PayProfile
}

RemoteProfile combines a PayProfile with *swap.Profile

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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