ethereum

package
v0.0.0-...-f21d47c Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2019 License: LGPL-3.0 Imports: 16 Imported by: 1

Documentation

Index

Constants

View Source
const (

	// TemporalENSName is our official ens name
	TemporalENSName = "ipfstemporal.eth"
)
View Source
const (
	// TxStatusSuccess is the status emitted on a successfuly transaction for onrik/ethrpc
	TxStatusSuccess = "0x1"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	ETH                    *ethclient.Client
	RPC                    *ethrpc.EthRPC
	Auth                   *bind.TransactOpts
	RTCAddress             string
	PaymentContractAddress string
	ConfirmationCount      int
	// contains filtered or unexported fields
}

Client is our connection to ethereum

func NewClient

func NewClient(cfg *config.TemporalConfig, connectionType string) (*Client, error)

NewClient is used to generate our Ethereum client wrapper

func (*Client) GetCombinedName

func (c *Client) GetCombinedName(subName, parentName string) string

GetCombinedName is used to return a combined ens name

func (*Client) ProcessPaymentTx

func (c *Client) ProcessPaymentTx(txHash string) error

ProcessPaymentTx is used to process an ethereum/rtc based credit purchase

func (*Client) RegisterName

func (c *Client) RegisterName(name string) error

RegisterName is used to register an ENS name

func (*Client) RegisterSubDomain

func (c *Client) RegisterSubDomain(subName, parentName string) error

RegisterSubDomain is used to register a subdomain under ipfstemporal.eth, allowing it to be updated with a content hash

func (*Client) SetResolver

func (c *Client) SetResolver(name string) error

SetResolver is used to check if name doesnt have a public resolver, set it

func (*Client) UnlockAccount

func (c *Client) UnlockAccount(keys ...string) error

UnlockAccount is used to unlck our main account

func (*Client) UnlockAccountFromConfig

func (c *Client) UnlockAccountFromConfig(cfg *config.TemporalConfig) error

UnlockAccountFromConfig generates a bind transactor opts from temporal config

func (*Client) UpdateContentHash

func (c *Client) UpdateContentHash(subName, parentName, hash string) error

UpdateContentHash is used to update the ipfs content hash of a particular *.ipfstemporal.eth subdomain

func (*Client) WaitForConfirmations

func (c *Client) WaitForConfirmations(tx *types.Transaction) error

WaitForConfirmations is used to wait for enough block confirmations for a tx to be considered valid

Jump to

Keyboard shortcuts

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