ethereum

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: 13 Imported by: 0

Documentation

Overview

Package ethereum provides on-chain transaction backend and wallet backend for the ethereum blockchain platform. The actual implementation of the functionality is done in internal package. This implementation can be configured for both real and test uses and shared by this package and the the ethereumtest package.

In addition to the intended functionality, this package is also structured to isolate all the imports from "go-ethereum" project and "go-perun/ethereum/backend" package in go-perun project, as the former is licensed under LGPL and the latter imports (and hence statically links) to code that is licensed under LGPL.

In order to provide this isolation the exported methods in this packages use only those types defined in the root package of this project and in std lib. This restriction enables the other packages in perun-node to compile this package as plugin and load the symbols from it in runtime (using "plugin" library) without importing any package from "go-perun/backend/ethereum" or "go-ethereum" or this package. This enables the possibility to generate a perun-node binary that does not contain any components licensed under LGPL, yet use the functionality from such libraries by dynamically linking to them during runtime.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BalanceAt added in v0.4.0

func BalanceAt(url string, chainConnTimeout, onChainTxTimeout time.Duration, addr pwallet.Address) (
	*big.Int, error)

BalanceAt reads the on-chain balance of the given address.

func NewChainBackend

func NewChainBackend(url string, chainConnTimeout, onChainTxTimeout time.Duration, cred perun.Credential) (
	perun.ChainBackend, error)

NewChainBackend initializes a connection to blockchain node and sets up a wallet with given credentials for funding on-chain transactions and channel balances.

It uses the provided credentials to initialize a new keystore wallet.

The function signature uses only types defined in the root package of this project and types from std lib. This enables the function to be loaded as symbol without importing this package when it is compiled as plugin.

func NewWalletBackend

func NewWalletBackend() perun.WalletBackend

NewWalletBackend initializes an ethereum specific wallet backend.

The function signature uses only types defined in the root package of this project and types from std lib. This enables the function to be loaded as symbol without importing this package when it is compiled as plugin.

Types

This section is empty.

Directories

Path Synopsis
Package ethereumtest provides test helpers for using ethereum backend in test.
Package ethereumtest provides test helpers for using ethereum backend in test.
Package internal implements the ethereum related backend functionality.
Package internal implements the ethereum related backend functionality.

Jump to

Keyboard shortcuts

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