geth

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2017 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const PoolMonitorClientABI = "" /* 743-byte string literal not displayed */

PoolMonitorClientABI is the input ABI used to generate the binding from.

View Source
const TestPoolABI = "" /* 8270-byte string literal not displayed */

TestPoolABI is the input ABI used to generate the binding from.

Variables

View Source
var BlockTime = 6 * time.Second
View Source
var ErrorMap = map[uint64][]string{
	0x80000000: []string{"register", "miner id is already in use", "miner id"},
	0x80000001: []string{"register", "payment address 0 is forbiden", ""},
	0x81000000: []string{"submitClaim", "miner is not registered", ""},
	0x81000001: []string{"submitClaim", "min counter is too low", "last submission counter value"},
	0x82000000: []string{"setEpochData", "only owner can set data", "msg.sender"},
	0x82000001: []string{"setEpochData", "epoch already set", "epoch number"},
	0x83000000: []string{"verifyExtraData", "miner id not as expected", "miner id"},
	0x83000001: []string{"verifyExtraData", "difficulty is not as expected", "encoded difficulty"},
	0x84000000: []string{"verifyClaim", "contract balance is too low to pay", "payment"},
	0x84000001: []string{"verifyClaim", "claim seed is 0", ""},
	0x84000002: []string{"verifyClaim", "share index is not as expected", "expected index"},
	0x84000003: []string{"verifyClaim", "there are no pending claims", ""},
	0x84000004: []string{"verifyClaim", "extra data not as expected", "extra data"},
	0x84000005: []string{"verifyClaim", "coinbase not as expected", "coinbase"},
	0x84000006: []string{"verifyClaim", "counter is smaller than min", "counter"},
	0x84000007: []string{"verifyClaim", "counter is smaller than max", "counter"},
	0x84000008: []string{"verifyClaim", "verification of augmented merkle tree failed", ""},
	0x84000009: []string{"verifyClaim", "ethash difficulty too low (or hashimoto verification failed)", "computed ethash value"},
	0x8400000a: []string{"verifyClaim", "epoch data was not set", "epoch number"},
}
View Source
var PoolMonitorAddress = common.HexToAddress("0xddcdad6b099b1b237bdb1341cc6881eb63ee3b28")

var PoolMonitorAddress = common.HexToAddress("0x7727D4535f1A9c9ECC59FB17B6bF8145C7d5D58c")

View Source
var RegisterEventTopic = common.HexToHash("0x1d759fb22634fe2d322d688a4b46aaf185dd0a3db78ccf01a9218f00ac3df03f").Big()
View Source
var SetEpochDataEventTopic = common.HexToHash("0x5cd723400be8430351b9cbaa5ea421b3fb2528c6a7650c493f895e7d97750da1").Big()
View Source
var SubmitClaimEventTopic = common.HexToHash("0x53ab9d877ae22286591454f9a8d58501caa34a07c99eac2c09bc0066c065400d").Big()
View Source
var TimestampFile = getTimestampFile()
View Source
var VerifyClaimEventTopic = common.HexToHash("0x096caf97202169a068288f02e51ff9fcc85f98e1477f6ad9acbf6ebf25dbcd00").Big()

Functions

func ErrorMsg

func ErrorMsg(errCode, errInfo *big.Int) string

func GetAddress

func GetAddress(keystorePath string, address common.Address) (common.Address, bool, []common.Address)

Types

type GethContractClient

type GethContractClient struct {
	// contains filtered or unexported fields
}

func NewGethContractClient

func NewGethContractClient(
	contractAddr common.Address, node ethereum.RPCClient, miner common.Address,
	ipc, keystorePath, passphrase string) (*GethContractClient, error)

func (*GethContractClient) CanRegister

func (cc *GethContractClient) CanRegister() bool

func (*GethContractClient) GetClaimSeed

func (cc *GethContractClient) GetClaimSeed() *big.Int

func (*GethContractClient) IsRegistered

func (cc *GethContractClient) IsRegistered() bool

func (*GethContractClient) Register

func (cc *GethContractClient) Register(paymentAddress common.Address) error

func (*GethContractClient) SetEpochData

func (cc *GethContractClient) SetEpochData(merkleRoot []*big.Int, fullSizeIn128Resolution []uint64, branchDepth []uint64, epoch []*big.Int) error

func (*GethContractClient) SubmitClaim

func (cc *GethContractClient) SubmitClaim(
	numShares *big.Int,
	difficulty *big.Int,
	min *big.Int,
	max *big.Int,
	augMerkle *big.Int) error

func (*GethContractClient) VerifyClaim

func (cc *GethContractClient) VerifyClaim(
	rlpHeader []byte,
	nonce *big.Int,
	shareIndex *big.Int,
	dataSetLookup []*big.Int,
	witnessForLookup []*big.Int,
	augCountersBranch []*big.Int,
	augHashesBranch []*big.Int) error

func (*GethContractClient) Version

func (cc *GethContractClient) Version() string

type GethRPC

type GethRPC struct {
	ContractAddr    common.Address
	ExtraData       []byte
	ShareDifficulty *big.Int
	// contains filtered or unexported fields
}

func NewGethRPC

func NewGethRPC(endpoint, contractAddr, extraData string, diff *big.Int) (*GethRPC, error)

func (*GethRPC) BlockNumber

func (g *GethRPC) BlockNumber() (*big.Int, error)

func (*GethRPC) Broadcast added in v0.2.1

func (g *GethRPC) Broadcast(data []byte) (common.Hash, error)

func (*GethRPC) ClientVersion

func (g *GethRPC) ClientVersion() (string, error)

func (*GethRPC) GetBlockHeader

func (g *GethRPC) GetBlockHeader(number int) *types.Header

func (*GethRPC) GetLog

func (g *GethRPC) GetLog(
	from *big.Int, event *big.Int,
	sender *big.Int) (*big.Int, *big.Int)

func (*GethRPC) GetPendingBlockHeader

func (g *GethRPC) GetPendingBlockHeader() *types.Header

func (*GethRPC) GetWork

func (g *GethRPC) GetWork() *ethereum.Work

func (*GethRPC) IsVerified

func (g *GethRPC) IsVerified(h common.Hash) bool

func (*GethRPC) SetEtherbase added in v0.2.0

func (g *GethRPC) SetEtherbase(etherbase common.Address) error

func (*GethRPC) SetExtradata added in v0.2.0

func (g *GethRPC) SetExtradata(extradata string) error

func (*GethRPC) SubmitHashrate

func (g *GethRPC) SubmitHashrate(hashrate hexutil.Uint64, id common.Hash) bool

func (*GethRPC) SubmitWork

func (g *GethRPC) SubmitWork(nonce types.BlockNonce, hash, mixDigest common.Hash) bool

func (*GethRPC) Syncing added in v0.2.0

func (g *GethRPC) Syncing() bool

type KovanRPC

type KovanRPC struct {
	*GethRPC
	// contains filtered or unexported fields
}

func NewKovanRPC

func NewKovanRPC(endpoint, contractAddr, extraData string, diff *big.Int) (*KovanRPC, error)

func (*KovanRPC) GetWork

func (k *KovanRPC) GetWork() *ethereum.Work

func (*KovanRPC) SubmitWork

func (k *KovanRPC) SubmitWork(nonce types.BlockNonce, hash, mixDigest common.Hash) bool

never submit solution to the node because in Kovan, miners can't propose blocks

type MinerAccount

type MinerAccount struct {
	// contains filtered or unexported fields
}

func GetAccount

func GetAccount(keystorePath string, address common.Address, passphrase string) *MinerAccount

Get the first account in key store Return nil if there's no account

func (MinerAccount) Address

func (ma MinerAccount) Address() common.Address

func (MinerAccount) KeyFile

func (ma MinerAccount) KeyFile() string

func (MinerAccount) PassPhrase

func (ma MinerAccount) PassPhrase() string

type PoolMonitor

type PoolMonitor struct {
	// contains filtered or unexported fields
}

func NewPoolMonitor

func NewPoolMonitor(
	contractAddr common.Address, version string, ipc string) (*PoolMonitor, error)

func (*PoolMonitor) ContractAddress

func (pm *PoolMonitor) ContractAddress() common.Address

func (*PoolMonitor) RequireClientUpdate

func (pm *PoolMonitor) RequireClientUpdate() bool

func (*PoolMonitor) RequireContractUpdate

func (pm *PoolMonitor) RequireContractUpdate() bool

type PoolMonitorClient

type PoolMonitorClient struct {
	PoolMonitorClientCaller     // Read-only binding to the contract
	PoolMonitorClientTransactor // Write-only binding to the contract
}

PoolMonitorClient is an auto generated Go binding around an Ethereum contract.

func NewPoolMonitorClient

func NewPoolMonitorClient(address common.Address, backend bind.ContractBackend) (*PoolMonitorClient, error)

NewPoolMonitorClient creates a new instance of PoolMonitorClient, bound to a specific deployed contract.

type PoolMonitorClientCaller

type PoolMonitorClientCaller struct {
	// contains filtered or unexported fields
}

PoolMonitorClientCaller is an auto generated read-only Go binding around an Ethereum contract.

func NewPoolMonitorClientCaller

func NewPoolMonitorClientCaller(address common.Address, caller bind.ContractCaller) (*PoolMonitorClientCaller, error)

NewPoolMonitorClientCaller creates a new read-only instance of PoolMonitorClient, bound to a specific deployed contract.

func (*PoolMonitorClientCaller) ClientVersion

func (_PoolMonitorClient *PoolMonitorClientCaller) ClientVersion(opts *bind.CallOpts) ([32]byte, error)

ClientVersion is a free data retrieval call binding the contract method 0x044c1d4d.

Solidity: function clientVersion() constant returns(bytes32)

func (*PoolMonitorClientCaller) PoolContract

func (_PoolMonitorClient *PoolMonitorClientCaller) PoolContract(opts *bind.CallOpts) (common.Address, error)

PoolContract is a free data retrieval call binding the contract method 0x88d52ef7.

Solidity: function poolContract() constant returns(address)

type PoolMonitorClientCallerRaw

type PoolMonitorClientCallerRaw struct {
	Contract *PoolMonitorClientCaller // Generic read-only contract binding to access the raw methods on
}

PoolMonitorClientCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract.

func (*PoolMonitorClientCallerRaw) Call

func (_PoolMonitorClient *PoolMonitorClientCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error

Call invokes the (constant) contract method with params as input values and sets the output to result. The result type might be a single field for simple returns, a slice of interfaces for anonymous returns and a struct for named returns.

type PoolMonitorClientCallerSession

type PoolMonitorClientCallerSession struct {
	Contract *PoolMonitorClientCaller // Generic contract caller binding to set the session for
	CallOpts bind.CallOpts            // Call options to use throughout this session
}

PoolMonitorClientCallerSession is an auto generated read-only Go binding around an Ethereum contract, with pre-set call options.

func (*PoolMonitorClientCallerSession) ClientVersion

func (_PoolMonitorClient *PoolMonitorClientCallerSession) ClientVersion() ([32]byte, error)

ClientVersion is a free data retrieval call binding the contract method 0x044c1d4d.

Solidity: function clientVersion() constant returns(bytes32)

func (*PoolMonitorClientCallerSession) PoolContract

func (_PoolMonitorClient *PoolMonitorClientCallerSession) PoolContract() (common.Address, error)

PoolContract is a free data retrieval call binding the contract method 0x88d52ef7.

Solidity: function poolContract() constant returns(address)

type PoolMonitorClientRaw

type PoolMonitorClientRaw struct {
	Contract *PoolMonitorClient // Generic contract binding to access the raw methods on
}

PoolMonitorClientRaw is an auto generated low-level Go binding around an Ethereum contract.

func (*PoolMonitorClientRaw) Call

func (_PoolMonitorClient *PoolMonitorClientRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error

Call invokes the (constant) contract method with params as input values and sets the output to result. The result type might be a single field for simple returns, a slice of interfaces for anonymous returns and a struct for named returns.

func (*PoolMonitorClientRaw) Transact

func (_PoolMonitorClient *PoolMonitorClientRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error)

Transact invokes the (paid) contract method with params as input values.

func (*PoolMonitorClientRaw) Transfer

func (_PoolMonitorClient *PoolMonitorClientRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error)

Transfer initiates a plain transaction to move funds to the contract, calling its default method if one is available.

type PoolMonitorClientSession

type PoolMonitorClientSession struct {
	Contract     *PoolMonitorClient // Generic contract binding to set the session for
	CallOpts     bind.CallOpts      // Call options to use throughout this session
	TransactOpts bind.TransactOpts  // Transaction auth options to use throughout this session
}

PoolMonitorClientSession is an auto generated Go binding around an Ethereum contract, with pre-set call and transact options.

func (*PoolMonitorClientSession) ClientVersion

func (_PoolMonitorClient *PoolMonitorClientSession) ClientVersion() ([32]byte, error)

ClientVersion is a free data retrieval call binding the contract method 0x044c1d4d.

Solidity: function clientVersion() constant returns(bytes32)

func (*PoolMonitorClientSession) PoolContract

func (_PoolMonitorClient *PoolMonitorClientSession) PoolContract() (common.Address, error)

PoolContract is a free data retrieval call binding the contract method 0x88d52ef7.

Solidity: function poolContract() constant returns(address)

func (*PoolMonitorClientSession) UpdateClientVersion

func (_PoolMonitorClient *PoolMonitorClientSession) UpdateClientVersion(version [32]byte) (*types.Transaction, error)

UpdateClientVersion is a paid mutator transaction binding the contract method 0x03e9598c.

Solidity: function updateClientVersion(version bytes32) returns()

func (*PoolMonitorClientSession) UpdatePoolContract

func (_PoolMonitorClient *PoolMonitorClientSession) UpdatePoolContract(newAddress common.Address) (*types.Transaction, error)

UpdatePoolContract is a paid mutator transaction binding the contract method 0xff1d9dd4.

Solidity: function updatePoolContract(newAddress address) returns()

type PoolMonitorClientTransactor

type PoolMonitorClientTransactor struct {
	// contains filtered or unexported fields
}

PoolMonitorClientTransactor is an auto generated write-only Go binding around an Ethereum contract.

func NewPoolMonitorClientTransactor

func NewPoolMonitorClientTransactor(address common.Address, transactor bind.ContractTransactor) (*PoolMonitorClientTransactor, error)

NewPoolMonitorClientTransactor creates a new write-only instance of PoolMonitorClient, bound to a specific deployed contract.

func (*PoolMonitorClientTransactor) UpdateClientVersion

func (_PoolMonitorClient *PoolMonitorClientTransactor) UpdateClientVersion(opts *bind.TransactOpts, version [32]byte) (*types.Transaction, error)

UpdateClientVersion is a paid mutator transaction binding the contract method 0x03e9598c.

Solidity: function updateClientVersion(version bytes32) returns()

func (*PoolMonitorClientTransactor) UpdatePoolContract

func (_PoolMonitorClient *PoolMonitorClientTransactor) UpdatePoolContract(opts *bind.TransactOpts, newAddress common.Address) (*types.Transaction, error)

UpdatePoolContract is a paid mutator transaction binding the contract method 0xff1d9dd4.

Solidity: function updatePoolContract(newAddress address) returns()

type PoolMonitorClientTransactorRaw

type PoolMonitorClientTransactorRaw struct {
	Contract *PoolMonitorClientTransactor // Generic write-only contract binding to access the raw methods on
}

PoolMonitorClientTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract.

func (*PoolMonitorClientTransactorRaw) Transact

func (_PoolMonitorClient *PoolMonitorClientTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error)

Transact invokes the (paid) contract method with params as input values.

func (*PoolMonitorClientTransactorRaw) Transfer

func (_PoolMonitorClient *PoolMonitorClientTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error)

Transfer initiates a plain transaction to move funds to the contract, calling its default method if one is available.

type PoolMonitorClientTransactorSession

type PoolMonitorClientTransactorSession struct {
	Contract     *PoolMonitorClientTransactor // Generic contract transactor binding to set the session for
	TransactOpts bind.TransactOpts            // Transaction auth options to use throughout this session
}

PoolMonitorClientTransactorSession is an auto generated write-only Go binding around an Ethereum contract, with pre-set transact options.

func (*PoolMonitorClientTransactorSession) UpdateClientVersion

func (_PoolMonitorClient *PoolMonitorClientTransactorSession) UpdateClientVersion(version [32]byte) (*types.Transaction, error)

UpdateClientVersion is a paid mutator transaction binding the contract method 0x03e9598c.

Solidity: function updateClientVersion(version bytes32) returns()

func (*PoolMonitorClientTransactorSession) UpdatePoolContract

func (_PoolMonitorClient *PoolMonitorClientTransactorSession) UpdatePoolContract(newAddress common.Address) (*types.Transaction, error)

UpdatePoolContract is a paid mutator transaction binding the contract method 0xff1d9dd4.

Solidity: function updatePoolContract(newAddress address) returns()

type TestPool

type TestPool struct {
	TestPoolCaller     // Read-only binding to the contract
	TestPoolTransactor // Write-only binding to the contract
}

TestPool is an auto generated Go binding around an Ethereum contract.

func NewTestPool

func NewTestPool(address common.Address, backend bind.ContractBackend) (*TestPool, error)

NewTestPool creates a new instance of TestPool, bound to a specific deployed contract.

type TestPoolCaller

type TestPoolCaller struct {
	// contains filtered or unexported fields
}

TestPoolCaller is an auto generated read-only Go binding around an Ethereum contract.

func NewTestPoolCaller

func NewTestPoolCaller(address common.Address, caller bind.ContractCaller) (*TestPoolCaller, error)

NewTestPoolCaller creates a new read-only instance of TestPool, bound to a specific deployed contract.

func (*TestPoolCaller) BudgetPerShareUnit

func (_TestPool *TestPoolCaller) BudgetPerShareUnit(opts *bind.CallOpts) (*big.Int, error)

BudgetPerShareUnit is a free data retrieval call binding the contract method 0xe97857db.

Solidity: function budgetPerShareUnit() constant returns(uint256)

func (*TestPoolCaller) CalcPayment

func (_TestPool *TestPoolCaller) CalcPayment(opts *bind.CallOpts, numShares *big.Int, difficulty *big.Int) (*big.Int, error)

CalcPayment is a free data retrieval call binding the contract method 0x17a720ac.

Solidity: function calcPayment(numShares uint256, difficulty uint256) constant returns(uint256)

func (*TestPoolCaller) CalcPaymentShareUnits

func (_TestPool *TestPoolCaller) CalcPaymentShareUnits(opts *bind.CallOpts, numShares *big.Int, difficulty *big.Int) (*big.Int, error)

CalcPaymentShareUnits is a free data retrieval call binding the contract method 0x3c00146b.

Solidity: function calcPaymentShareUnits(numShares uint256, difficulty uint256) constant returns(uint256)

func (*TestPoolCaller) CanRegister

func (_TestPool *TestPoolCaller) CanRegister(opts *bind.CallOpts, sender common.Address) (bool, error)

CanRegister is a free data retrieval call binding the contract method 0x320d46d4.

Solidity: function canRegister(sender address) constant returns(bool)

func (*TestPoolCaller) EpochData

func (_TestPool *TestPoolCaller) EpochData(opts *bind.CallOpts, arg0 *big.Int) (struct {
	MerkleRoot             *big.Int
	FullSizeIn128Resultion uint64
	BranchDepth            uint64
}, error)

EpochData is a free data retrieval call binding the contract method 0x6e821b2e.

Solidity: function epochData( uint256) constant returns(merkleRoot uint128, fullSizeIn128Resultion uint64, branchDepth uint64)

func (*TestPoolCaller) ExistingIds

func (_TestPool *TestPoolCaller) ExistingIds(opts *bind.CallOpts, arg0 [32]byte) (bool, error)

ExistingIds is a free data retrieval call binding the contract method 0xee385304.

Solidity: function existingIds( bytes32) constant returns(bool)

func (*TestPoolCaller) GetClaimSeed

func (_TestPool *TestPoolCaller) GetClaimSeed(opts *bind.CallOpts, sender common.Address) (*big.Int, error)

GetClaimSeed is a free data retrieval call binding the contract method 0x7087ed2c.

Solidity: function getClaimSeed(sender address) constant returns(uint256)

func (*TestPoolCaller) GetEpochData

func (_TestPool *TestPoolCaller) GetEpochData(opts *bind.CallOpts, epoch *big.Int) ([3]*big.Int, error)

GetEpochData is a free data retrieval call binding the contract method 0x859e7d32.

Solidity: function getEpochData(epoch uint256) constant returns(uint256[3])

func (*TestPoolCaller) GetMinerId

func (_TestPool *TestPoolCaller) GetMinerId(opts *bind.CallOpts, sender common.Address) ([32]byte, error)

GetMinerId is a free data retrieval call binding the contract method 0xe2dea715.

Solidity: function getMinerId(sender address) constant returns(bytes32)

func (*TestPoolCaller) GetShareIndex

func (_TestPool *TestPoolCaller) GetShareIndex(opts *bind.CallOpts, sender common.Address) (*big.Int, error)

GetShareIndex is a free data retrieval call binding the contract method 0x0f136527.

Solidity: function getShareIndex(sender address) constant returns(uint256)

func (*TestPoolCaller) Hashimoto

func (_TestPool *TestPoolCaller) Hashimoto(opts *bind.CallOpts, header [32]byte, nonceLe [8]byte, fullSizeIn128Resultion *big.Int, dataSetLookup []*big.Int, witnessForLookup []*big.Int, branchSize *big.Int, root *big.Int) (*big.Int, error)

Hashimoto is a free data retrieval call binding the contract method 0x58e69c5a.

Solidity: function hashimoto(header bytes32, nonceLe bytes8, fullSizeIn128Resultion uint256, dataSetLookup uint256[], witnessForLookup uint256[], branchSize uint256, root uint256) constant returns(uint256)

func (*TestPoolCaller) IsRegistered

func (_TestPool *TestPoolCaller) IsRegistered(opts *bind.CallOpts, sender common.Address) (bool, error)

IsRegistered is a free data retrieval call binding the contract method 0xc3c5a547.

Solidity: function isRegistered(sender address) constant returns(bool)

func (*TestPoolCaller) NewVersionReleased

func (_TestPool *TestPoolCaller) NewVersionReleased(opts *bind.CallOpts) (bool, error)

NewVersionReleased is a free data retrieval call binding the contract method 0x0289e966.

Solidity: function newVersionReleased() constant returns(bool)

func (*TestPoolCaller) Owners

func (_TestPool *TestPoolCaller) Owners(opts *bind.CallOpts, arg0 common.Address) (bool, error)

Owners is a free data retrieval call binding the contract method 0x022914a7.

Solidity: function owners( address) constant returns(bool)

func (*TestPoolCaller) PaymentUnitsPer1000Blocks

func (_TestPool *TestPoolCaller) PaymentUnitsPer1000Blocks(opts *bind.CallOpts, arg0 *big.Int) (*big.Int, error)

PaymentUnitsPer1000Blocks is a free data retrieval call binding the contract method 0xf4d00f99.

Solidity: function paymentUnitsPer1000Blocks( uint256) constant returns(uint256)

func (*TestPoolCaller) To62Encoding

func (_TestPool *TestPoolCaller) To62Encoding(opts *bind.CallOpts, id *big.Int, numChars *big.Int) ([32]byte, error)

To62Encoding is a free data retrieval call binding the contract method 0xff5d2c39.

Solidity: function to62Encoding(id uint256, numChars uint256) constant returns(bytes32)

func (*TestPoolCaller) Version

func (_TestPool *TestPoolCaller) Version(opts *bind.CallOpts) (string, error)

Version is a free data retrieval call binding the contract method 0x54fd4d50.

Solidity: function version() constant returns(string)

type TestPoolCallerRaw

type TestPoolCallerRaw struct {
	Contract *TestPoolCaller // Generic read-only contract binding to access the raw methods on
}

TestPoolCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract.

func (*TestPoolCallerRaw) Call

func (_TestPool *TestPoolCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error

Call invokes the (constant) contract method with params as input values and sets the output to result. The result type might be a single field for simple returns, a slice of interfaces for anonymous returns and a struct for named returns.

type TestPoolCallerSession

type TestPoolCallerSession struct {
	Contract *TestPoolCaller // Generic contract caller binding to set the session for
	CallOpts bind.CallOpts   // Call options to use throughout this session
}

TestPoolCallerSession is an auto generated read-only Go binding around an Ethereum contract, with pre-set call options.

func (*TestPoolCallerSession) BudgetPerShareUnit

func (_TestPool *TestPoolCallerSession) BudgetPerShareUnit() (*big.Int, error)

BudgetPerShareUnit is a free data retrieval call binding the contract method 0xe97857db.

Solidity: function budgetPerShareUnit() constant returns(uint256)

func (*TestPoolCallerSession) CalcPayment

func (_TestPool *TestPoolCallerSession) CalcPayment(numShares *big.Int, difficulty *big.Int) (*big.Int, error)

CalcPayment is a free data retrieval call binding the contract method 0x17a720ac.

Solidity: function calcPayment(numShares uint256, difficulty uint256) constant returns(uint256)

func (*TestPoolCallerSession) CalcPaymentShareUnits

func (_TestPool *TestPoolCallerSession) CalcPaymentShareUnits(numShares *big.Int, difficulty *big.Int) (*big.Int, error)

CalcPaymentShareUnits is a free data retrieval call binding the contract method 0x3c00146b.

Solidity: function calcPaymentShareUnits(numShares uint256, difficulty uint256) constant returns(uint256)

func (*TestPoolCallerSession) CanRegister

func (_TestPool *TestPoolCallerSession) CanRegister(sender common.Address) (bool, error)

CanRegister is a free data retrieval call binding the contract method 0x320d46d4.

Solidity: function canRegister(sender address) constant returns(bool)

func (*TestPoolCallerSession) EpochData

func (_TestPool *TestPoolCallerSession) EpochData(arg0 *big.Int) (struct {
	MerkleRoot             *big.Int
	FullSizeIn128Resultion uint64
	BranchDepth            uint64
}, error)

EpochData is a free data retrieval call binding the contract method 0x6e821b2e.

Solidity: function epochData( uint256) constant returns(merkleRoot uint128, fullSizeIn128Resultion uint64, branchDepth uint64)

func (*TestPoolCallerSession) ExistingIds

func (_TestPool *TestPoolCallerSession) ExistingIds(arg0 [32]byte) (bool, error)

ExistingIds is a free data retrieval call binding the contract method 0xee385304.

Solidity: function existingIds( bytes32) constant returns(bool)

func (*TestPoolCallerSession) GetClaimSeed

func (_TestPool *TestPoolCallerSession) GetClaimSeed(sender common.Address) (*big.Int, error)

GetClaimSeed is a free data retrieval call binding the contract method 0x7087ed2c.

Solidity: function getClaimSeed(sender address) constant returns(uint256)

func (*TestPoolCallerSession) GetEpochData

func (_TestPool *TestPoolCallerSession) GetEpochData(epoch *big.Int) ([3]*big.Int, error)

GetEpochData is a free data retrieval call binding the contract method 0x859e7d32.

Solidity: function getEpochData(epoch uint256) constant returns(uint256[3])

func (*TestPoolCallerSession) GetMinerId

func (_TestPool *TestPoolCallerSession) GetMinerId(sender common.Address) ([32]byte, error)

GetMinerId is a free data retrieval call binding the contract method 0xe2dea715.

Solidity: function getMinerId(sender address) constant returns(bytes32)

func (*TestPoolCallerSession) GetShareIndex

func (_TestPool *TestPoolCallerSession) GetShareIndex(sender common.Address) (*big.Int, error)

GetShareIndex is a free data retrieval call binding the contract method 0x0f136527.

Solidity: function getShareIndex(sender address) constant returns(uint256)

func (*TestPoolCallerSession) Hashimoto

func (_TestPool *TestPoolCallerSession) Hashimoto(header [32]byte, nonceLe [8]byte, fullSizeIn128Resultion *big.Int, dataSetLookup []*big.Int, witnessForLookup []*big.Int, branchSize *big.Int, root *big.Int) (*big.Int, error)

Hashimoto is a free data retrieval call binding the contract method 0x58e69c5a.

Solidity: function hashimoto(header bytes32, nonceLe bytes8, fullSizeIn128Resultion uint256, dataSetLookup uint256[], witnessForLookup uint256[], branchSize uint256, root uint256) constant returns(uint256)

func (*TestPoolCallerSession) IsRegistered

func (_TestPool *TestPoolCallerSession) IsRegistered(sender common.Address) (bool, error)

IsRegistered is a free data retrieval call binding the contract method 0xc3c5a547.

Solidity: function isRegistered(sender address) constant returns(bool)

func (*TestPoolCallerSession) NewVersionReleased

func (_TestPool *TestPoolCallerSession) NewVersionReleased() (bool, error)

NewVersionReleased is a free data retrieval call binding the contract method 0x0289e966.

Solidity: function newVersionReleased() constant returns(bool)

func (*TestPoolCallerSession) Owners

func (_TestPool *TestPoolCallerSession) Owners(arg0 common.Address) (bool, error)

Owners is a free data retrieval call binding the contract method 0x022914a7.

Solidity: function owners( address) constant returns(bool)

func (*TestPoolCallerSession) PaymentUnitsPer1000Blocks

func (_TestPool *TestPoolCallerSession) PaymentUnitsPer1000Blocks(arg0 *big.Int) (*big.Int, error)

PaymentUnitsPer1000Blocks is a free data retrieval call binding the contract method 0xf4d00f99.

Solidity: function paymentUnitsPer1000Blocks( uint256) constant returns(uint256)

func (*TestPoolCallerSession) To62Encoding

func (_TestPool *TestPoolCallerSession) To62Encoding(id *big.Int, numChars *big.Int) ([32]byte, error)

To62Encoding is a free data retrieval call binding the contract method 0xff5d2c39.

Solidity: function to62Encoding(id uint256, numChars uint256) constant returns(bytes32)

func (*TestPoolCallerSession) Version

func (_TestPool *TestPoolCallerSession) Version() (string, error)

Version is a free data retrieval call binding the contract method 0x54fd4d50.

Solidity: function version() constant returns(string)

type TestPoolRaw

type TestPoolRaw struct {
	Contract *TestPool // Generic contract binding to access the raw methods on
}

TestPoolRaw is an auto generated low-level Go binding around an Ethereum contract.

func (*TestPoolRaw) Call

func (_TestPool *TestPoolRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error

Call invokes the (constant) contract method with params as input values and sets the output to result. The result type might be a single field for simple returns, a slice of interfaces for anonymous returns and a struct for named returns.

func (*TestPoolRaw) Transact

func (_TestPool *TestPoolRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error)

Transact invokes the (paid) contract method with params as input values.

func (*TestPoolRaw) Transfer

func (_TestPool *TestPoolRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error)

Transfer initiates a plain transaction to move funds to the contract, calling its default method if one is available.

type TestPoolSession

type TestPoolSession struct {
	Contract     *TestPool         // Generic contract binding to set the session for
	CallOpts     bind.CallOpts     // Call options to use throughout this session
	TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
}

TestPoolSession is an auto generated Go binding around an Ethereum contract, with pre-set call and transact options.

func (*TestPoolSession) BudgetPerShareUnit

func (_TestPool *TestPoolSession) BudgetPerShareUnit() (*big.Int, error)

BudgetPerShareUnit is a free data retrieval call binding the contract method 0xe97857db.

Solidity: function budgetPerShareUnit() constant returns(uint256)

func (*TestPoolSession) CalcPayment

func (_TestPool *TestPoolSession) CalcPayment(numShares *big.Int, difficulty *big.Int) (*big.Int, error)

CalcPayment is a free data retrieval call binding the contract method 0x17a720ac.

Solidity: function calcPayment(numShares uint256, difficulty uint256) constant returns(uint256)

func (*TestPoolSession) CalcPaymentShareUnits

func (_TestPool *TestPoolSession) CalcPaymentShareUnits(numShares *big.Int, difficulty *big.Int) (*big.Int, error)

CalcPaymentShareUnits is a free data retrieval call binding the contract method 0x3c00146b.

Solidity: function calcPaymentShareUnits(numShares uint256, difficulty uint256) constant returns(uint256)

func (*TestPoolSession) CanRegister

func (_TestPool *TestPoolSession) CanRegister(sender common.Address) (bool, error)

CanRegister is a free data retrieval call binding the contract method 0x320d46d4.

Solidity: function canRegister(sender address) constant returns(bool)

func (*TestPoolSession) DeclareNewerVersion

func (_TestPool *TestPoolSession) DeclareNewerVersion() (*types.Transaction, error)

DeclareNewerVersion is a paid mutator transaction binding the contract method 0xe3d86998.

Solidity: function declareNewerVersion() returns()

func (*TestPoolSession) EpochData

func (_TestPool *TestPoolSession) EpochData(arg0 *big.Int) (struct {
	MerkleRoot             *big.Int
	FullSizeIn128Resultion uint64
	BranchDepth            uint64
}, error)

EpochData is a free data retrieval call binding the contract method 0x6e821b2e.

Solidity: function epochData( uint256) constant returns(merkleRoot uint128, fullSizeIn128Resultion uint64, branchDepth uint64)

func (*TestPoolSession) ExistingIds

func (_TestPool *TestPoolSession) ExistingIds(arg0 [32]byte) (bool, error)

ExistingIds is a free data retrieval call binding the contract method 0xee385304.

Solidity: function existingIds( bytes32) constant returns(bool)

func (*TestPoolSession) GetClaimSeed

func (_TestPool *TestPoolSession) GetClaimSeed(sender common.Address) (*big.Int, error)

GetClaimSeed is a free data retrieval call binding the contract method 0x7087ed2c.

Solidity: function getClaimSeed(sender address) constant returns(uint256)

func (*TestPoolSession) GetEpochData

func (_TestPool *TestPoolSession) GetEpochData(epoch *big.Int) ([3]*big.Int, error)

GetEpochData is a free data retrieval call binding the contract method 0x859e7d32.

Solidity: function getEpochData(epoch uint256) constant returns(uint256[3])

func (*TestPoolSession) GetMinerId

func (_TestPool *TestPoolSession) GetMinerId(sender common.Address) ([32]byte, error)

GetMinerId is a free data retrieval call binding the contract method 0xe2dea715.

Solidity: function getMinerId(sender address) constant returns(bytes32)

func (*TestPoolSession) GetShareIndex

func (_TestPool *TestPoolSession) GetShareIndex(sender common.Address) (*big.Int, error)

GetShareIndex is a free data retrieval call binding the contract method 0x0f136527.

Solidity: function getShareIndex(sender address) constant returns(uint256)

func (*TestPoolSession) Hashimoto

func (_TestPool *TestPoolSession) Hashimoto(header [32]byte, nonceLe [8]byte, fullSizeIn128Resultion *big.Int, dataSetLookup []*big.Int, witnessForLookup []*big.Int, branchSize *big.Int, root *big.Int) (*big.Int, error)

Hashimoto is a free data retrieval call binding the contract method 0x58e69c5a.

Solidity: function hashimoto(header bytes32, nonceLe bytes8, fullSizeIn128Resultion uint256, dataSetLookup uint256[], witnessForLookup uint256[], branchSize uint256, root uint256) constant returns(uint256)

func (*TestPoolSession) IsRegistered

func (_TestPool *TestPoolSession) IsRegistered(sender common.Address) (bool, error)

IsRegistered is a free data retrieval call binding the contract method 0xc3c5a547.

Solidity: function isRegistered(sender address) constant returns(bool)

func (*TestPoolSession) NewVersionReleased

func (_TestPool *TestPoolSession) NewVersionReleased() (bool, error)

NewVersionReleased is a free data retrieval call binding the contract method 0x0289e966.

Solidity: function newVersionReleased() constant returns(bool)

func (*TestPoolSession) Owners

func (_TestPool *TestPoolSession) Owners(arg0 common.Address) (bool, error)

Owners is a free data retrieval call binding the contract method 0x022914a7.

Solidity: function owners( address) constant returns(bool)

func (*TestPoolSession) PaymentUnitsPer1000Blocks

func (_TestPool *TestPoolSession) PaymentUnitsPer1000Blocks(arg0 *big.Int) (*big.Int, error)

PaymentUnitsPer1000Blocks is a free data retrieval call binding the contract method 0xf4d00f99.

Solidity: function paymentUnitsPer1000Blocks( uint256) constant returns(uint256)

func (*TestPoolSession) Register

func (_TestPool *TestPoolSession) Register(paymentAddress common.Address) (*types.Transaction, error)

Register is a paid mutator transaction binding the contract method 0x4420e486.

Solidity: function register(paymentAddress address) returns()

func (*TestPoolSession) SetBudgetPerShareUnit

func (_TestPool *TestPoolSession) SetBudgetPerShareUnit(budget *big.Int) (*types.Transaction, error)

SetBudgetPerShareUnit is a paid mutator transaction binding the contract method 0xfad574be.

Solidity: function setBudgetPerShareUnit(budget uint256) returns()

func (*TestPoolSession) SetEpochData

func (_TestPool *TestPoolSession) SetEpochData(merkleRoot []*big.Int, fullSizeIn128Resultion []uint64, branchDepth []uint64, epoch []*big.Int) (*types.Transaction, error)

SetEpochData is a paid mutator transaction binding the contract method 0xf2cfe267.

Solidity: function setEpochData(merkleRoot uint128[], fullSizeIn128Resultion uint64[], branchDepth uint64[], epoch uint256[]) returns()

func (*TestPoolSession) SubmitClaim

func (_TestPool *TestPoolSession) SubmitClaim(numShares *big.Int, difficulty *big.Int, min *big.Int, max *big.Int, augMerkle *big.Int) (*types.Transaction, error)

SubmitClaim is a paid mutator transaction binding the contract method 0xe7dac983.

Solidity: function submitClaim(numShares uint256, difficulty uint256, min uint256, max uint256, augMerkle uint256) returns()

func (*TestPoolSession) SubmitClientError

func (_TestPool *TestPoolSession) SubmitClientError(error string) (*types.Transaction, error)

SubmitClientError is a paid mutator transaction binding the contract method 0x33401c58.

Solidity: function submitClientError(error string) returns()

func (*TestPoolSession) To62Encoding

func (_TestPool *TestPoolSession) To62Encoding(id *big.Int, numChars *big.Int) ([32]byte, error)

To62Encoding is a free data retrieval call binding the contract method 0xff5d2c39.

Solidity: function to62Encoding(id uint256, numChars uint256) constant returns(bytes32)

func (*TestPoolSession) VerifyClaim

func (_TestPool *TestPoolSession) VerifyClaim(rlpHeader []byte, nonce *big.Int, shareIndex *big.Int, dataSetLookup []*big.Int, witnessForLookup []*big.Int, augCountersBranch []*big.Int, augHashesBranch []*big.Int) (*types.Transaction, error)

VerifyClaim is a paid mutator transaction binding the contract method 0x35ffbe74.

Solidity: function verifyClaim(rlpHeader bytes, nonce uint256, shareIndex uint256, dataSetLookup uint256[], witnessForLookup uint256[], augCountersBranch uint256[], augHashesBranch uint256[]) returns(uint256)

func (*TestPoolSession) Version

func (_TestPool *TestPoolSession) Version() (string, error)

Version is a free data retrieval call binding the contract method 0x54fd4d50.

Solidity: function version() constant returns(string)

type TestPoolTransactor

type TestPoolTransactor struct {
	// contains filtered or unexported fields
}

TestPoolTransactor is an auto generated write-only Go binding around an Ethereum contract.

func NewTestPoolTransactor

func NewTestPoolTransactor(address common.Address, transactor bind.ContractTransactor) (*TestPoolTransactor, error)

NewTestPoolTransactor creates a new write-only instance of TestPool, bound to a specific deployed contract.

func (*TestPoolTransactor) DeclareNewerVersion

func (_TestPool *TestPoolTransactor) DeclareNewerVersion(opts *bind.TransactOpts) (*types.Transaction, error)

DeclareNewerVersion is a paid mutator transaction binding the contract method 0xe3d86998.

Solidity: function declareNewerVersion() returns()

func (*TestPoolTransactor) Register

func (_TestPool *TestPoolTransactor) Register(opts *bind.TransactOpts, paymentAddress common.Address) (*types.Transaction, error)

Register is a paid mutator transaction binding the contract method 0x4420e486.

Solidity: function register(paymentAddress address) returns()

func (*TestPoolTransactor) SetBudgetPerShareUnit

func (_TestPool *TestPoolTransactor) SetBudgetPerShareUnit(opts *bind.TransactOpts, budget *big.Int) (*types.Transaction, error)

SetBudgetPerShareUnit is a paid mutator transaction binding the contract method 0xfad574be.

Solidity: function setBudgetPerShareUnit(budget uint256) returns()

func (*TestPoolTransactor) SetEpochData

func (_TestPool *TestPoolTransactor) SetEpochData(opts *bind.TransactOpts, merkleRoot []*big.Int, fullSizeIn128Resultion []uint64, branchDepth []uint64, epoch []*big.Int) (*types.Transaction, error)

SetEpochData is a paid mutator transaction binding the contract method 0xf2cfe267.

Solidity: function setEpochData(merkleRoot uint128[], fullSizeIn128Resultion uint64[], branchDepth uint64[], epoch uint256[]) returns()

func (*TestPoolTransactor) SubmitClaim

func (_TestPool *TestPoolTransactor) SubmitClaim(opts *bind.TransactOpts, numShares *big.Int, difficulty *big.Int, min *big.Int, max *big.Int, augMerkle *big.Int) (*types.Transaction, error)

SubmitClaim is a paid mutator transaction binding the contract method 0xe7dac983.

Solidity: function submitClaim(numShares uint256, difficulty uint256, min uint256, max uint256, augMerkle uint256) returns()

func (*TestPoolTransactor) SubmitClientError

func (_TestPool *TestPoolTransactor) SubmitClientError(opts *bind.TransactOpts, error string) (*types.Transaction, error)

SubmitClientError is a paid mutator transaction binding the contract method 0x33401c58.

Solidity: function submitClientError(error string) returns()

func (*TestPoolTransactor) VerifyClaim

func (_TestPool *TestPoolTransactor) VerifyClaim(opts *bind.TransactOpts, rlpHeader []byte, nonce *big.Int, shareIndex *big.Int, dataSetLookup []*big.Int, witnessForLookup []*big.Int, augCountersBranch []*big.Int, augHashesBranch []*big.Int) (*types.Transaction, error)

VerifyClaim is a paid mutator transaction binding the contract method 0x35ffbe74.

Solidity: function verifyClaim(rlpHeader bytes, nonce uint256, shareIndex uint256, dataSetLookup uint256[], witnessForLookup uint256[], augCountersBranch uint256[], augHashesBranch uint256[]) returns(uint256)

type TestPoolTransactorRaw

type TestPoolTransactorRaw struct {
	Contract *TestPoolTransactor // Generic write-only contract binding to access the raw methods on
}

TestPoolTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract.

func (*TestPoolTransactorRaw) Transact

func (_TestPool *TestPoolTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error)

Transact invokes the (paid) contract method with params as input values.

func (*TestPoolTransactorRaw) Transfer

func (_TestPool *TestPoolTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error)

Transfer initiates a plain transaction to move funds to the contract, calling its default method if one is available.

type TestPoolTransactorSession

type TestPoolTransactorSession struct {
	Contract     *TestPoolTransactor // Generic contract transactor binding to set the session for
	TransactOpts bind.TransactOpts   // Transaction auth options to use throughout this session
}

TestPoolTransactorSession is an auto generated write-only Go binding around an Ethereum contract, with pre-set transact options.

func (*TestPoolTransactorSession) DeclareNewerVersion

func (_TestPool *TestPoolTransactorSession) DeclareNewerVersion() (*types.Transaction, error)

DeclareNewerVersion is a paid mutator transaction binding the contract method 0xe3d86998.

Solidity: function declareNewerVersion() returns()

func (*TestPoolTransactorSession) Register

func (_TestPool *TestPoolTransactorSession) Register(paymentAddress common.Address) (*types.Transaction, error)

Register is a paid mutator transaction binding the contract method 0x4420e486.

Solidity: function register(paymentAddress address) returns()

func (*TestPoolTransactorSession) SetBudgetPerShareUnit

func (_TestPool *TestPoolTransactorSession) SetBudgetPerShareUnit(budget *big.Int) (*types.Transaction, error)

SetBudgetPerShareUnit is a paid mutator transaction binding the contract method 0xfad574be.

Solidity: function setBudgetPerShareUnit(budget uint256) returns()

func (*TestPoolTransactorSession) SetEpochData

func (_TestPool *TestPoolTransactorSession) SetEpochData(merkleRoot []*big.Int, fullSizeIn128Resultion []uint64, branchDepth []uint64, epoch []*big.Int) (*types.Transaction, error)

SetEpochData is a paid mutator transaction binding the contract method 0xf2cfe267.

Solidity: function setEpochData(merkleRoot uint128[], fullSizeIn128Resultion uint64[], branchDepth uint64[], epoch uint256[]) returns()

func (*TestPoolTransactorSession) SubmitClaim

func (_TestPool *TestPoolTransactorSession) SubmitClaim(numShares *big.Int, difficulty *big.Int, min *big.Int, max *big.Int, augMerkle *big.Int) (*types.Transaction, error)

SubmitClaim is a paid mutator transaction binding the contract method 0xe7dac983.

Solidity: function submitClaim(numShares uint256, difficulty uint256, min uint256, max uint256, augMerkle uint256) returns()

func (*TestPoolTransactorSession) SubmitClientError

func (_TestPool *TestPoolTransactorSession) SubmitClientError(error string) (*types.Transaction, error)

SubmitClientError is a paid mutator transaction binding the contract method 0x33401c58.

Solidity: function submitClientError(error string) returns()

func (*TestPoolTransactorSession) VerifyClaim

func (_TestPool *TestPoolTransactorSession) VerifyClaim(rlpHeader []byte, nonce *big.Int, shareIndex *big.Int, dataSetLookup []*big.Int, witnessForLookup []*big.Int, augCountersBranch []*big.Int, augHashesBranch []*big.Int) (*types.Transaction, error)

VerifyClaim is a paid mutator transaction binding the contract method 0x35ffbe74.

Solidity: function verifyClaim(rlpHeader bytes, nonce uint256, shareIndex uint256, dataSetLookup uint256[], witnessForLookup uint256[], augCountersBranch uint256[], augHashesBranch uint256[]) returns(uint256)

type TxWatcher

type TxWatcher struct {
	// contains filtered or unexported fields
}

TxWatcher keeps track of pending transactions and acknowledge corresponding channel when a transaction is confirmed. It also captures event information emitted during the transaction.

func NewTxWatcher

func NewTxWatcher(
	tx *types.Transaction, node ethereum.RPCClient,
	blockNo *big.Int, event *big.Int, sender *big.Int) *TxWatcher

func (*TxWatcher) Wait

func (tw *TxWatcher) Wait() (*big.Int, *big.Int, error)

func (*TxWatcher) WaitAndRetry added in v0.2.1

func (tw *TxWatcher) WaitAndRetry() (*big.Int, *big.Int, error)

Jump to

Keyboard shortcuts

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