client

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package client provides an abstraction over the channel client used for running the off-chain network implemented by go-perun project.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEthereumPaymentClient

func NewEthereumPaymentClient(cfg Config, user perun.User, comm perun.CommBackend) (*client, error)

NewEthereumPaymentClient initializes a two party, ethereum payment channel client for the given user. It establishes a connection to the blockchain and verifies the integrity of contracts at the given address. It uses the comm backend to initialize adapters for off-chain communication network.

Types

type ChainConfig

type ChainConfig struct {
	// Addresses of on-chain contracts used for establishing state channel network.
	Adjudicator string
	Asset       string

	// URL for connecting to the blockchain node.
	URL string
	// ConnTimeout is the timeout used when dialing for new connections to the on-chain node.
	ConnTimeout time.Duration
	// OnChainTxTimeout is the timeout to wait for a blockchain transaction to be finalized.
	OnChainTxTimeout time.Duration
}

ChainConfig represents the configuration parameters for connecting to blockchain.

type Closer added in v0.4.0

type Closer interface {
	Close() error
}

Closer is used to call close on database.

type Config

type Config struct {
	Chain ChainConfig

	// Path to directory containing persistence database.
	DatabaseDir string
	// Timeout for re-establishing all open channels (if any) that was persisted during the
	// previous running instance of the node.
	PeerReconnTimeout time.Duration
}

Config represents the configuration parameters for state channel client.

Directories

Path Synopsis
Package clienttest implements test helpers for functionalities defined in client.
Package clienttest implements test helpers for functionalities defined in client.

Jump to

Keyboard shortcuts

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