Documentation ¶
Index ¶
- func NewSwap(localProfile *LocalProfile, remoteProfile *RemoteProfile, ...) (swapInstance *swap.Swap, err error)
- type LocalProfile
- func (lp *LocalProfile) Chequebook() *chequebook.Chequebook
- func (lp *LocalProfile) Init(contract common.Address, prvkey *ecdsa.PrivateKey)
- func (lp *LocalProfile) PrivateKey() *ecdsa.PrivateKey
- func (lp *LocalProfile) SetChequebook(ctx context.Context, backend chequebook.Backend, path string) error
- func (lp *LocalProfile) SetKey(prvkey *ecdsa.PrivateKey)
- type PayProfile
- type RemoteProfile
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.24
type LocalProfile struct { *swap.Params *PayProfile }
LocalProfile combines a PayProfile with *swap.Params
func NewDefaultSwapParams ¶ added in v1.8.24
func NewDefaultSwapParams() *LocalProfile
NewDefaultSwapParams create params with default values
func (*LocalProfile) Chequebook ¶ added in v1.8.24
func (lp *LocalProfile) Chequebook() *chequebook.Chequebook
Chequebook get's chequebook from the localProfile
func (*LocalProfile) Init ¶ added in v1.8.24
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.24
func (lp *LocalProfile) PrivateKey() *ecdsa.PrivateKey
PrivateKey accessor
func (*LocalProfile) SetChequebook ¶ added in v1.8.24
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.24
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.24
type RemoteProfile struct { *swap.Profile *PayProfile }
RemoteProfile combines a PayProfile with *swap.Profile