Documentation ¶
Overview ¶
Websocket client implementation. This will be used in tests.
Index ¶
- Constants
- type Confirmation
- type ErisNodeClient
- func (erisNodeClient *ErisNodeClient) Broadcast(tx txs.Tx) (*txs.Receipt, error)
- func (erisNodeClient *ErisNodeClient) ChainId() (ChainName, ChainId string, GenesisHash []byte, err error)
- func (erisNodeClient *ErisNodeClient) DeriveWebsocketClient() (nodeWsClient NodeWebsocketClient, err error)
- func (erisNodeClient *ErisNodeClient) DumpStorage(address []byte) (storage *core_types.Storage, err error)
- func (erisNodeClient *ErisNodeClient) GetAccount(address []byte) (*acc.Account, error)
- func (erisNodeClient *ErisNodeClient) GetName(name string) (owner []byte, data string, expirationBlock int, err error)
- func (erisNodeClient *ErisNodeClient) ListValidators() (blockHeight int, bondedValidators []consensus_types.Validator, ...)
- func (erisNodeClient *ErisNodeClient) QueryContract(callerAddress, calleeAddress, data []byte) (ret []byte, gasUsed int64, err error)
- func (erisNodeClient *ErisNodeClient) QueryContractCode(address, code, data []byte) (ret []byte, gasUsed int64, err error)
- func (erisNodeClient *ErisNodeClient) Status() (GenesisHash []byte, ValidatorPublicKey []byte, LatestBlockHash []byte, ...)
- type ErisNodeWebsocketClient
- func (erisNodeWebsocketClient *ErisNodeWebsocketClient) Close()
- func (erisNodeWebsocketClient *ErisNodeWebsocketClient) Subscribe(eventid string) error
- func (erisNodeWebsocketClient *ErisNodeWebsocketClient) Unsubscribe(subscriptionId string) error
- func (erisNodeWebsocketClient *ErisNodeWebsocketClient) WaitForConfirmation(tx txs.Tx, chainId string, inputAddr []byte) (chan Confirmation, error)
- type NodeClient
- type NodeWebsocketClient
- type WSClient
Constants ¶
const (
MaxCommitWaitTimeSeconds = 10
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Confirmation ¶
type ErisNodeClient ¶
type ErisNodeClient struct {
// contains filtered or unexported fields
}
func NewErisNodeClient ¶
func NewErisNodeClient(rpcString string) *ErisNodeClient
ErisKeyClient.New returns a new eris-keys client for provided rpc location Eris-keys connects over http request-responses
func (*ErisNodeClient) ChainId ¶
func (erisNodeClient *ErisNodeClient) ChainId() (ChainName, ChainId string, GenesisHash []byte, err error)
func (*ErisNodeClient) DeriveWebsocketClient ¶
func (erisNodeClient *ErisNodeClient) DeriveWebsocketClient() (nodeWsClient NodeWebsocketClient, err error)
func (*ErisNodeClient) DumpStorage ¶
func (erisNodeClient *ErisNodeClient) DumpStorage(address []byte) (storage *core_types.Storage, err error)
DumpStorage returns the full storage for an account.
func (*ErisNodeClient) GetAccount ¶
func (erisNodeClient *ErisNodeClient) GetAccount(address []byte) (*acc.Account, error)
GetAccount returns a copy of the account
func (*ErisNodeClient) ListValidators ¶
func (erisNodeClient *ErisNodeClient) ListValidators() (blockHeight int, bondedValidators []consensus_types.Validator, unbondingValidators []consensus_types.Validator, err error)
func (*ErisNodeClient) QueryContract ¶
func (erisNodeClient *ErisNodeClient) QueryContract(callerAddress, calleeAddress, data []byte) (ret []byte, gasUsed int64, err error)
QueryContract executes the contract code at address with the given data NOTE: there is no check on the caller;
func (*ErisNodeClient) QueryContractCode ¶
func (erisNodeClient *ErisNodeClient) QueryContractCode(address, code, data []byte) (ret []byte, gasUsed int64, err error)
QueryContractCode executes the contract code at address with the given data but with provided code
func (*ErisNodeClient) Status ¶
func (erisNodeClient *ErisNodeClient) Status() (GenesisHash []byte, ValidatorPublicKey []byte, LatestBlockHash []byte, LatestBlockHeight int, LatestBlockTime int64, err error)
Status returns the ChainId (GenesisHash), validator's PublicKey, latest block hash the block height and the latest block time.
type ErisNodeWebsocketClient ¶
type ErisNodeWebsocketClient struct {
// contains filtered or unexported fields
}
func (*ErisNodeWebsocketClient) Close ¶
func (erisNodeWebsocketClient *ErisNodeWebsocketClient) Close()
func (*ErisNodeWebsocketClient) Subscribe ¶
func (erisNodeWebsocketClient *ErisNodeWebsocketClient) Subscribe(eventid string) error
Subscribe to an eventid
func (*ErisNodeWebsocketClient) Unsubscribe ¶
func (erisNodeWebsocketClient *ErisNodeWebsocketClient) Unsubscribe(subscriptionId string) error
Unsubscribe from an eventid
func (*ErisNodeWebsocketClient) WaitForConfirmation ¶
func (erisNodeWebsocketClient *ErisNodeWebsocketClient) WaitForConfirmation(tx txs.Tx, chainId string, inputAddr []byte) (chan Confirmation, error)
Returns a channel that will receive a confirmation with a result or the exception that has been confirmed; or an error is returned and the confirmation channel is nil.
type NodeClient ¶
type NodeClient interface { Broadcast(transaction txs.Tx) (*txs.Receipt, error) DeriveWebsocketClient() (nodeWsClient NodeWebsocketClient, err error) Status() (ChainId []byte, ValidatorPublicKey []byte, LatestBlockHash []byte, LatestBlockHeight int, LatestBlockTime int64, err error) GetAccount(address []byte) (*acc.Account, error) QueryContract(callerAddress, calleeAddress, data []byte) (ret []byte, gasUsed int64, err error) QueryContractCode(address, code, data []byte) (ret []byte, gasUsed int64, err error) DumpStorage(address []byte) (storage *core_types.Storage, err error) GetName(name string) (owner []byte, data string, expirationBlock int, err error) ListValidators() (blockHeight int, bondedValidators, unbondingValidators []consensus_types.Validator, err error) }
type NodeWebsocketClient ¶
type WSClient ¶
type WSClient struct {
// contains filtered or unexported fields
}
A websocket client subscribes and unsubscribes to events