Documentation
¶
Index ¶
- Variables
- func ApplyRate(ether *big.Int, rate *big.Rat) *big.Rat
- func EnsureKeystoreExists(path string) error
- func FormatEther(ether *big.Int) string
- func FormatGwei(ether *big.Int) string
- type Blockchain
- type GethBlockchain
- func (c *GethBlockchain) BurnAntiSpamFee(antiSpamID big.Int, antiSpamFee big.Int) error
- func (c *GethBlockchain) CheckAntiSpamConfirmations(antiSpamID big.Int, antiSpamFee big.Int) (int64, error)
- func (c *GethBlockchain) CheckBalance() error
- func (c *GethBlockchain) CheckDepositConfirmations(recipient common.Address, adaptorPubKey ed25519.CurvePoint, ether big.Int, ...) (int64, error)
- func (c *GethBlockchain) CheckSmartContract() error
- func (c *GethBlockchain) ClaimDeposit(adaptorPrivKey ed25519.Adaptor, antiSpamID big.Int) error
- func (c *GethBlockchain) DepositEther(recipient common.Address, adaptorPubKey ed25519.CurvePoint, ether big.Int, ...) error
- func (c *GethBlockchain) FetchServers(maxAge big.Int) ([]ServerDetails, error)
- func (c *GethBlockchain) LookupAdaptorPrivKey(adaptorPubKey ed25519.CurvePoint) (bool, *ed25519.Adaptor, error)
- func (c *GethBlockchain) ReclaimDeposit(antiSpamID big.Int) error
- func (c *GethBlockchain) RegisterServer(target string, cert []byte) error
- func (c *GethBlockchain) SuggestGasPrice() (*big.Int, error)
- func (c *GethBlockchain) WalletAddress() common.Address
- type ServerDetails
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrStillSyncing = errors.New("Ethereum node is still syncing") ErrIncompatibleVersion = errors.New("smart contract has an incompatible version - please upgrade") ErrDeprecated = errors.New("smart contract is marked as deprecated - please check for updates") ErrUnexpectedDirectory = errors.New("keystore location appears to be a directory") ErrLowBalance = fmt.Errorf("Please deposit funds into the address listed above. "+ "A minimum of %s is needed to proceed.", FormatEther(minimumBalance)) )
Functions ¶
func EnsureKeystoreExists ¶
EnsureKeystoreExists tries to determine whether we already have a keystore. Otherwise it will create a fresh key. The key will be 'encrypted' with an empty password. This provides no protection, but will make the keystore compatible with other Ethereum wallets.
func FormatEther ¶
func FormatGwei ¶
Types ¶
type Blockchain ¶
type Blockchain interface { CheckSmartContract() error CheckBalance() error BurnAntiSpamFee(antiSpamID big.Int, antiSpamFee big.Int) error CheckAntiSpamConfirmations(antiSpamID big.Int, antiSpamFee big.Int) (int64, error) DepositEther(recipient common.Address, adaptorPubKey ed25519.CurvePoint, ether big.Int, antiSpamID big.Int) error CheckDepositConfirmations(recipient common.Address, adaptorPubKey ed25519.CurvePoint, ether big.Int, antiSpamID big.Int) (int64, error) ClaimDeposit(adaptorPrivKey ed25519.Adaptor, antiSpamID big.Int) error LookupAdaptorPrivKey(adaptorPubKey ed25519.CurvePoint) (bool, *ed25519.Adaptor, error) ReclaimDeposit(antiSpamID big.Int) error RegisterServer(target string, cert []byte) error FetchServers(maxAge big.Int) ([]ServerDetails, error) WalletAddress() common.Address SuggestGasPrice() (*big.Int, error) }
type GethBlockchain ¶
type GethBlockchain struct {
// contains filtered or unexported fields
}
func NewGanacheBlockchain ¶
func NewGanacheBlockchain(contractAddress *common.Address) (*GethBlockchain, error)
func NewLocalNodeBlockchain ¶
func NewSimulatedBlockchain ¶
func NewSimulatedBlockchain() (*GethBlockchain, error)
func (*GethBlockchain) BurnAntiSpamFee ¶
func (*GethBlockchain) CheckAntiSpamConfirmations ¶
func (*GethBlockchain) CheckBalance ¶
func (c *GethBlockchain) CheckBalance() error
func (*GethBlockchain) CheckDepositConfirmations ¶
func (*GethBlockchain) CheckSmartContract ¶
func (c *GethBlockchain) CheckSmartContract() error
func (*GethBlockchain) ClaimDeposit ¶
func (*GethBlockchain) DepositEther ¶
func (c *GethBlockchain) DepositEther( recipient common.Address, adaptorPubKey ed25519.CurvePoint, ether big.Int, antiSpamID big.Int) error
func (*GethBlockchain) FetchServers ¶
func (c *GethBlockchain) FetchServers(maxAge big.Int) ([]ServerDetails, error)
func (*GethBlockchain) LookupAdaptorPrivKey ¶
func (c *GethBlockchain) LookupAdaptorPrivKey(adaptorPubKey ed25519.CurvePoint) (bool, *ed25519.Adaptor, error)
func (*GethBlockchain) ReclaimDeposit ¶
func (c *GethBlockchain) ReclaimDeposit(antiSpamID big.Int) error
func (*GethBlockchain) RegisterServer ¶
func (c *GethBlockchain) RegisterServer(target string, cert []byte) error
func (*GethBlockchain) SuggestGasPrice ¶
func (c *GethBlockchain) SuggestGasPrice() (*big.Int, error)
func (*GethBlockchain) WalletAddress ¶
func (c *GethBlockchain) WalletAddress() common.Address
type ServerDetails ¶
Click to show internal directories.
Click to hide internal directories.