erigon-pulse/interfaces/txpool/mining.proto

104 lines
3.0 KiB
Protocol Buffer
Raw Normal View History

syntax = "proto3";
import "google/protobuf/empty.proto";
More updates to downloader, new p2psentry protocol (#1559) * Initial commit * Add sentry gRPC interface * p2psentry directory * Update README.md * Update README.md * Update README.md * Add go package * Correct syntax * add external downloader interface (#2) * Add txpool (#3) * Add private API (#4) * Invert control.proto, add PeerMinBlock, Separare incoming Tx message into a separate stream (#5) Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local> * Separate upload messages into its own stream (#6) Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local> * Only send changed accounts to listeners (#7) * Txpool interface doc (#9) * More additions * More additions * Fix locking * Intermediate * Fix separation of phases * Intermediate * Fix test * More transformations * New simplified way of downloading headers * Fix hard-coded header sync * Fixed syncing near the tip of the chain * Add architecture diagram source and picture (#10) * More fixes * rename tip to link * Use preverified hashes instead of preverified headers * Fix preverified hashes generation * more parametrisation * Continue parametrisation * Fix grpc data limit, interruption of headers stage * Add ropsten preverified hashes * Typed hashes (#11) * Typed hashes * Fix PeerId * 64-bit tx nonce * Disable penalties * Add goerli settings, bootstrap nodes * Try to fix goerly sync * Remove interfaces * Add proper golang packages, max_block into p2p sentry Status * Prepare for proto overhaul * Squashed 'interfaces/' content from commit ce36053c2 git-subtree-dir: interfaces git-subtree-split: ce36053c24db2f56e48ac752808de60afa1dfb4b * Change EtherReply to address * Adaptations to new types * Switch to new types * Fixes * Fix formatting * Fix lint * Lint fixes, reverse order in types * Fix lint * Fix lint * Fix lint * Fix test * Not supporting eth/66 yet * Fix shutdown * Fix lint * Fix lint * Fix lint * return stopped check Co-authored-by: Artem Vorotnikov <artem@vorotnikov.me> Co-authored-by: b00ris <b00ris@mail.ru> Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local> Co-authored-by: lightclient <14004106+lightclient@users.noreply.github.com> Co-authored-by: canepat <16927169+canepat@users.noreply.github.com>
2021-03-19 21:24:49 +00:00
import "types/types.proto";
package txpool;
option go_package = "./txpool;txpool";
message OnPendingBlockRequest {}
message OnPendingBlockReply {
bytes rplBlock = 1;
}
message OnMinedBlockRequest {}
message OnMinedBlockReply {
bytes rplBlock = 1;
}
message OnPendingLogsRequest {}
message OnPendingLogsReply {
bytes rplLogs = 1;
}
2021-03-23 09:00:07 +00:00
message GetWorkRequest {}
message GetWorkReply {
string headerHash = 1; // 32 bytes hex encoded current block header pow-hash
string seedHash = 2; // 32 bytes hex encoded seed hash used for DAG
string target = 3; // 32 bytes hex encoded boundary condition ("target"), 2^256/difficulty
string blockNumber = 4; // hex encoded block number
}
message SubmitWorkRequest {
bytes blockNonce = 1;
bytes powHash = 2;
bytes digest = 3;
}
message SubmitWorkReply {
bool ok = 1;
}
message SubmitHashRateRequest {
uint64 rate = 1;
2021-03-23 09:00:07 +00:00
bytes id = 2;
}
message SubmitHashRateReply {
bool ok = 1;
}
message HashRateRequest {}
message HashRateReply {
2021-03-23 09:00:07 +00:00
uint64 hashRate = 1;
}
message MiningRequest {}
message MiningReply {
bool enabled = 1;
bool running = 2;
}
service Mining {
// Version returns the service version number
rpc Version(google.protobuf.Empty) returns (types.VersionReply);
// subscribe to pending blocks event
rpc OnPendingBlock(OnPendingBlockRequest) returns (stream OnPendingBlockReply);
// subscribe to mined blocks event
rpc OnMinedBlock(OnMinedBlockRequest) returns (stream OnMinedBlockReply);
// subscribe to pending blocks event
rpc OnPendingLogs(OnPendingLogsRequest) returns (stream OnPendingLogsReply);
// GetWork returns a work package for external miner.
//
// The work package consists of 3 strings:
// result[0] - 32 bytes hex encoded current block header pow-hash
// result[1] - 32 bytes hex encoded seed hash used for DAG
// result[2] - 32 bytes hex encoded boundary condition ("target"), 2^256/difficulty
// result[3] - hex encoded block number
rpc GetWork(GetWorkRequest) returns (GetWorkReply);
// SubmitWork can be used by external miner to submit their POW solution.
// It returns an indication if the work was accepted.
// Note either an invalid solution, a stale work a non-existent work will return false.
rpc SubmitWork(SubmitWorkRequest) returns (SubmitWorkReply);
// SubmitHashRate can be used for remote miners to submit their hash rate.
// This enables the node to report the combined hash rate of all miners
// which submit work through this node.
//
// It accepts the miner hash rate and an identifier which must be unique
// between nodes.
rpc SubmitHashRate(SubmitHashRateRequest) returns (SubmitHashRateReply);
// HashRate returns the current hashrate for local CPU miner and remote miner.
rpc HashRate(HashRateRequest) returns (HashRateReply);
// Mining returns an indication if this node is currently mining and it's mining configuration
rpc Mining(MiningRequest) returns (MiningReply);
}