Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unstub validator rpc #188

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions src/validator/rpc/interface.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import {BeaconAPI} from "../../rpc/api";
import {AttestationData, BeaconState, Slot} from "../../types";

export interface RpcClient {
mpetrunic marked this conversation as resolved.
Show resolved Hide resolved

beacon: BeaconAPI;

//validator: ValidatorAPI

/**
* Initiates connection to rpc server.
*/
connect(): Promise<void>;

/**
* Destroys connection to rpc server.
*/
disconnect(): Promise<void>;

/**
* Invokes callback on new slot.
* Depending on implementation it will poll for new slot or getting notified(Websockets)
* @param cb
*/
onNewSlot(cb: (slot: Slot) => void);


/**
* Invokes callback on new head block.
* Depending on implementation it will poll for new head block or getting notified(Websockets)
* @param cb
*/
onNewBeaconState(cb: (state: BeaconState) => void);

/**
* Invokes callback on new attestation data.
* Depending on implementation it will poll for attestation data or getting notified(Websockets)
* @param cb
*/
onNewAttestation(cb: (attestation: AttestationData) => void);



}