Skip to content

Instantly share code, notes, and snippets.

View lobarrel's full-sized avatar
🚀

Lorenzo Bottelli lobarrel

🚀
  • Politecnico di Milano
  • Milan, Italy
View GitHub Profile
@lobarrel
lobarrel / sv1-messages.md
Last active July 6, 2023 10:16
sv1-messages

SV1 Messages

/client-to-server

High-level message format: StandardRequest and Response

mining.subscribe

Request struct definition:

pub  struct  Subscribe<'a> {
    pub  id: u64,
    pub  agent_signature: String,

pub extranonce1: Option>,

@lobarrel
lobarrel / message-generator-code-description.md
Last active July 6, 2023 19:57
message-generator-code-description

Message Generator code description

The purpose of this document is to provide a detailed explanation of the code related to the message-generator and it serves as a tool for developers to quickly understand the code structure and the main steps the message-generator does for test execution. The following code analysis is divided into sections that represent the different source files of the message-generator, making it easier to find references in the code.

main.rs

  1. The code defines two enums: Sv2Type, which contains all data types used in SV2, and ActionResult, which contains the possible values representing the results of an action defined inside the test file.
  2. The code defines the structs Upstream and Downstream, which represent the connection settings of the tested SV2 role.
  3. The code defines a struct Action, which represents an action that has to be execute and the result of which has to be checked as defined inside the test file.
  4. The code defines a struct Command that r