Documentation ¶
Index ¶
- Variables
- func LoadDappChainPrivateKey(privKeyB64 string) ([]byte, error)
- func LoadDappChainPrivateKeyFile(path string) ([]byte, error)
- func NewLoomchainBackend(cli *client.DAppChainRPCClient, signer auth.Signer) bind.ContractBackend
- type Config
- type GamechainGateway
- func (gw *GamechainGateway) GetLastPlasmaBlockNumber() (uint64, error)
- func (gw *GamechainGateway) GetOracleCommandRequestList() ([]*orctype.OracleCommandRequest, error)
- func (gw *GamechainGateway) ProcessOracleCommandResponseBatch(commandResponses []*orctype.OracleCommandResponse) error
- func (gw *GamechainGateway) ProcessOracleEventBatch(events []*orctype.PlasmachainEvent, endBlock uint64, ...) error
- func (gw *GamechainGateway) SetLastPlasmaBlockNumber(lastBlock uint64) error
- type LoomchainBackend
- func (l *LoomchainBackend) CallContract(ctx context.Context, call ethereum.CallMsg, blockNumber *big.Int) ([]byte, error)
- func (l *LoomchainBackend) CodeAt(ctx context.Context, contract common.Address, blockNumber *big.Int) ([]byte, error)
- func (l *LoomchainBackend) EstimateGas(ctx context.Context, call ethereum.CallMsg) (gas uint64, err error)
- func (l *LoomchainBackend) FilterLogs(ctx context.Context, query ethereum.FilterQuery) ([]types.Log, error)
- func (l *LoomchainBackend) PendingCallContract(ctx context.Context, call ethereum.CallMsg) ([]byte, error)
- func (l *LoomchainBackend) PendingCodeAt(ctx context.Context, contract common.Address) ([]byte, error)
- func (l *LoomchainBackend) PendingNonceAt(ctx context.Context, account common.Address) (uint64, error)
- func (l *LoomchainBackend) SendTransaction(ctx context.Context, tx *types.Transaction) error
- func (l *LoomchainBackend) SubscribeFilterLogs(ctx context.Context, query ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error)
- func (l *LoomchainBackend) SuggestGasPrice(ctx context.Context) (*big.Int, error)
- func (l *LoomchainBackend) TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error)
- type Metrics
- type Oracle
- type PlasmachainGateway
- type Status
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotImplemented = errors.New("not implememented")
Functions ¶
func LoadDappChainPrivateKey ¶
func NewLoomchainBackend ¶
func NewLoomchainBackend(cli *client.DAppChainRPCClient, signer auth.Signer) bind.ContractBackend
Types ¶
type Config ¶
type Config struct { // Plasmachain PlasmachainPrivateKey string PlasmachainChainID string PlasmachainReadURI string PlasmachainWriteURI string PlasmachainEventsURI string PlasmachainZbgCardContractHexAddress string PlasmachainPollInterval int // in second PlasmachainMaxBlockRange int // Gamechain GamechainPrivateKey string GamechainChainID string GamechainReadURI string GamechainWriteURI string GamechainEventsURI string GamechainContractName string // Oracle log verbosity (debug, info, error, etc.) OracleLogLevel string OracleLogDestination string // Number of seconds to wait before starting the Oracle. OracleStartupDelay int32 // Number of seconds to wait between reconnection attempts. OracleReconnectInterval int32 // Address on from which the out-of-process Oracle should expose the status & metrics endpoints. OracleQueryAddress string }
func DefaultConfig ¶
func DefaultConfig() *Config
type GamechainGateway ¶
type GamechainGateway struct { Address loom.Address // Timestamp of the last successful response from the DAppChain LastResponseTime time.Time // contains filtered or unexported fields }
func ConnectToGamechainGateway ¶
func ConnectToGamechainGateway( loomClient *client.DAppChainRPCClient, caller loom.Address, contractName string, signer auth.Signer, logger *loom.Logger, ) (*GamechainGateway, error)
func (*GamechainGateway) GetLastPlasmaBlockNumber ¶
func (gw *GamechainGateway) GetLastPlasmaBlockNumber() (uint64, error)
func (*GamechainGateway) GetOracleCommandRequestList ¶
func (gw *GamechainGateway) GetOracleCommandRequestList() ([]*orctype.OracleCommandRequest, error)
func (*GamechainGateway) ProcessOracleCommandResponseBatch ¶
func (gw *GamechainGateway) ProcessOracleCommandResponseBatch(commandResponses []*orctype.OracleCommandResponse) error
func (*GamechainGateway) ProcessOracleEventBatch ¶
func (gw *GamechainGateway) ProcessOracleEventBatch(events []*orctype.PlasmachainEvent, endBlock uint64, zbgCardContractAddress loom.Address) error
func (*GamechainGateway) SetLastPlasmaBlockNumber ¶
func (gw *GamechainGateway) SetLastPlasmaBlockNumber(lastBlock uint64) error
type LoomchainBackend ¶
type LoomchainBackend struct { *client.DAppChainRPCClient // contains filtered or unexported fields }
func (*LoomchainBackend) CallContract ¶
func (*LoomchainBackend) EstimateGas ¶
func (l *LoomchainBackend) EstimateGas(ctx context.Context, call ethereum.CallMsg) (gas uint64, err error)
func (*LoomchainBackend) FilterLogs ¶
func (*LoomchainBackend) PendingCallContract ¶
func (l *LoomchainBackend) PendingCallContract(ctx context.Context, call ethereum.CallMsg) ([]byte, error)
func (*LoomchainBackend) PendingCodeAt ¶
func (*LoomchainBackend) PendingNonceAt ¶
func (*LoomchainBackend) SendTransaction ¶
func (l *LoomchainBackend) SendTransaction(ctx context.Context, tx *types.Transaction) error
func (*LoomchainBackend) SubscribeFilterLogs ¶
func (*LoomchainBackend) SuggestGasPrice ¶
func (*LoomchainBackend) TransactionReceipt ¶
type Metrics ¶
type Metrics struct {
// contains filtered or unexported fields
}
func NewMetrics ¶
func (*Metrics) FetchedPlasmachainEvents ¶
func (*Metrics) MethodCalled ¶
func (*Metrics) SubmittedPlasmachainEvents ¶
type Oracle ¶
type Oracle struct {
// contains filtered or unexported fields
}
func (*Oracle) RunWithRecovery ¶
func (orc *Oracle) RunWithRecovery()
RunWithRecovery should run in a goroutine, it will ensure the oracle keeps on running as long as it doesn't panic due to a runtime error.
type PlasmachainGateway ¶
type PlasmachainGateway struct { Address loom.Address // Timestamp of the last successful response from the DAppChain LastResponseTime time.Time // contains filtered or unexported fields }
func (*PlasmachainGateway) GetTokensOwned ¶
func (gw *PlasmachainGateway) GetTokensOwned(owner loom.LocalAddress) ([]tokensOwnedResponseItem, error)
func (*PlasmachainGateway) LastBlockNumber ¶
func (gw *PlasmachainGateway) LastBlockNumber() (uint64, error)
type Status ¶
type Status struct { Version string OracleAddress string GamechainGatewayAddress string GamechainGatewayLastSeen time.Time PlasmachainGatewayAddress string PlasmachainGatewayLastSeen time.Time NextPlasmachainBlockNumber uint64 `json:",string"` // Number of Plamachain events submitted to the DAppChain Gateway successfully PlasmachainEventsFetchedCount uint64 `json:",string"` // Total number of Plamachain events fetched PlasmachainEventsSubmittedCount uint64 `json:",string"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.