eth

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 5, 2019 License: GPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAuth

func GetAuth() (*bind.TransactOpts, error)

Types

type EthService

type EthService struct {
	Token   *token.Token
	Scanner *ScanEventDispatcher
	// contains filtered or unexported fields
}

func NewEthService

func NewEthService(ks *keystore.KeyStore, acc *accounts.Account, storage *storage.Storage) *EthService

func (*EthService) Account

func (ethSrv *EthService) Account() *accounts.Account

func (*EthService) Client

func (ethSrv *EthService) Client() *ethclient.Client

func (*EthService) ConnectWeb3

func (ethSrv *EthService) ConnectWeb3() *ethclient.Client

func (*EthService) DeployTokenContract

func (ethSrv *EthService) DeployTokenContract() error

DeployTokenContract deploys the Token contract to eth network

func (*EthService) GetBalance

func (ethSrv *EthService) GetBalance(address common.Address) (*big.Float, error)

func (*EthService) LoadTokenContract

func (ethSrv *EthService) LoadTokenContract(contractAddr common.Address)

LoadTokenContract loads already deployed Token contract

func (*EthService) SavePointLoad

func (ethSrv *EthService) SavePointLoad() (lastBlock uint64, lastTxIndex uint, err error)

func (*EthService) SavePointSave

func (ethSrv *EthService) SavePointSave(lastBlock uint64, lastTxIndex uint) error

func (*EthService) SignBytes

func (ethSrv *EthService) SignBytes(b []byte) (*SignatureEthMsg, error)

SignBytes performs a keccak256 hash over the bytes and signs it

type EventHandlerFunc

type EventHandlerFunc func(*types.Block, *types.Transaction, *types.Receipt) error

type ReceiptDownloader

type ReceiptDownloader struct {
	sync.Mutex
	// contains filtered or unexported fields
}

receiptDownloader allows to download multiple receipts at the same time.

func NewReceiptDownloader

func NewReceiptDownloader(client *ethclient.Client, concurrency int) *ReceiptDownloader

func (*ReceiptDownloader) Forget

func (r *ReceiptDownloader) Forget(txid common.Hash)

Forget (deletes) an already downloaded transaction.

func (*ReceiptDownloader) Get

func (r *ReceiptDownloader) Get(txid common.Hash) (*types.Receipt, error)

Get the requested transaction, if not still downloaded, it waits.

func (*ReceiptDownloader) Join

func (r *ReceiptDownloader) Join()

Join waits until all background jobs stopped

func (*ReceiptDownloader) Request

func (r *ReceiptDownloader) Request(txid common.Hash)

Request to download a transaction.

func (*ReceiptDownloader) Start

func (r *ReceiptDownloader) Start()

Start processing requests

func (*ReceiptDownloader) Stats

func (r *ReceiptDownloader) Stats() (queuelen, pendinglen int)

Stats retrieves the status.

func (*ReceiptDownloader) Stop

func (r *ReceiptDownloader) Stop()

Stop processing requests

type ReceiptTask

type ReceiptTask struct {
	Tx common.Hash

	Err     error
	Receipt *types.Receipt
	// contains filtered or unexported fields
}

receiptTask is a single receipt download task.

type SavePoint

type SavePoint interface {
	SavePointLoad() (lastBlock uint64, lastTxIndex uint, err error)
	SavePointSave(lastBlock uint64, lastTxIndex uint) error
}

type ScanEventDispatcher

type ScanEventDispatcher struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewScanEventDispatcher

func NewScanEventDispatcher(client *ethclient.Client, handler EventHandlerFunc, savepoint SavePoint) *ScanEventDispatcher

func (*ScanEventDispatcher) Join

func (e *ScanEventDispatcher) Join()

Join waits all background jobs finished

func (*ScanEventDispatcher) Start

func (e *ScanEventDispatcher) Start()

Start scanning the blockchain for events

func (*ScanEventDispatcher) Stop

func (e *ScanEventDispatcher) Stop()

Stop scanning the blockchain for events

type SignatureEthMsg

type SignatureEthMsg [65]byte

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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