Skip to content

Instantly share code, notes, and snippets.

@Fi3
Created June 20, 2023 12:22
Show Gist options
  • Save Fi3/30112572ebf820d4a60ed68fa8a6111b to your computer and use it in GitHub Desktop.
Save Fi3/30112572ebf820d4a60ed68fa8a6111b to your computer and use it in GitHub Desktop.
{
"doc": [
"This test does",
"Runs a translator proxy",
"Runs /example/sv1-mining-device",
"Waits that receives SetupConnection message",
"Reply with .Success",
"Waits that the tproxy sends OpenExtendedMiningChannel",
"Responds with OpenExtendedMiningChannelSuccess",
"Sends NewExtendedMiningJob and SetNewPrevHash to the tproxy",
"Waits a SubmitsSolutionExtended",
"You can use any miner you want, by changing the execution command or by launching it separately"
],
"common_messages": [
],
"mining_messages": [
{
"message": {
"type": "OpenExtendedMiningChannelSuccess",
"request_id": 666666,
"channel_id": 1,
"target": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255],
"extranonce_size": 16,
"extranonce_prefix": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]
},
"replace_fields": [["target","variable_name"]],
"id": "open_extended_mining_channel_success"
},
{
"message": {
"type": "NewExtendedMiningJob",
"job_id": 1,
"channel_id": 0,
"min_ntime": [],
"version": 536870912,
"version_rolling_allowed": true,
"merkle_path": [],
"coinbase_tx_prefix": [2, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 36, 2, 3, 15, 0],
"coinbase_tx_suffix": [255, 255, 255, 255, 2, 149, 0, 0, 0, 0, 0, 0, 0, 67, 65, 4, 70, 109, 127, 202, 229, 99, 229, 203, 9, 160, 209, 135, 11, 181, 128, 52, 72, 4, 97, 120, 121, 161, 73, 73, 207, 34, 40, 95, 27, 174, 63, 39, 103, 40, 23, 108, 60, 100, 49, 248, 238, 218, 69, 56, 220, 55, 200, 101, 226, 120, 79, 58, 158, 119, 208, 68, 243, 62, 64, 119, 151, 225, 39, 138, 172, 0, 0, 0, 0, 0, 0, 0, 0, 38, 106, 36, 170, 33, 169, 237, 226, 246, 28, 63, 113, 209, 222, 253, 63, 169, 153, 223, 163, 105, 83, 117, 92, 105, 6, 137, 121, 153, 98, 180, 139, 235, 216, 54, 151, 78, 140, 249, 1, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
},
"id": "new_extended_mining_job"
},
{
"message":{
"type": "SetNewPrevHash",
"channel_id": 0,
"job_id": 1,
"prev_hash": [91, 30, 84, 205, 18, 124, 218, 102, 28, 163, 155, 204, 173, 55, 119, 61, 224, 199, 68, 229, 144, 22, 92, 0, 53, 44, 15, 204, 200, 245, 149, 0],
"min_ntime": 1679128496,
"nbits": 545259519
},
"id": "set_new_prev_hash"
}
],
"frame_builders": [
{
"type": "automatic",
"message_id": "test/message-generator/messages/common_messages.json::setup_connection_success_tproxy"
},
{
"type": "automatic",
"message_id": "open_extended_mining_channel_success"
},
{
"type": "automatic",
"message_id": "new_extended_mining_job"
},
{
"type": "automatic",
"message_id": "set_new_prev_hash"
}
],
"actions": [
{
"message_ids": [],
"role": "server",
"results": [
{
"type": "match_message_type",
"value": "0x00"
}
],
"actiondoc": "This action checks that a Setupconnection message is received"
},
{
"message_ids": ["setup_connection_success_tproxy"],
"role": "server",
"results": [
]
},
{
"message_ids": [],
"role": "server",
"results": [
{
"type": "get_message_field",
"value": [
"MiningProtocol",
"OpenExtendedMiningChannel",
[
[
"max_target",
"variable_name"
]
]
]
}
],
"actiondoc": "Checks that OpenExtendedMiningChannel is received"
},
{
"message_ids": ["open_extended_mining_channel_success"],
"role": "server",
"results": [],
"actiondoc": "This action responds with OpenExtendedMiningChannelSuccess"
},
{
"message_ids": ["new_extended_mining_job", "set_new_prev_hash"],
"role": "server",
"results": [
{
"type": "match_message_type",
"value": "0x1b"
}
],
"actiondoc": "Sends NewExtendedMiningJob and SetNewPrevHash and waits that a SubmitsShareExtended is submitted"
}
],
"setup_commands": [
],
"execution_commands": [
{
"command": "cargo",
"args": [
"run",
"-p",
"translator_sv2",
"--",
"-c",
"./test/config/tproxy-config-no-jd-sv1-cpu-md.toml"
],
"conditions": {
"WithConditions": {
"conditions": [
{
"output_string": "PROXY SERVER - ACCEPTING FROM UPSTREAM:",
"output_location": "StdOut",
"condition": true
}
],
"timer_secs": 60,
"warn_no_panic": false
}
}
},
{
"command": "cargo",
"args": [
"run",
"-p",
"sv1-mining-device"
],
"conditions": "None"
}
],
"cleanup_commands": [
],
"role": "server",
"upstream": {
"ip": "127.0.0.1",
"port": 34254,
"pub_key": "2di19GHYQnAZJmEpoUeP7C3Eg9TCcksHr23rZCC83dvUiZgiDL",
"secret_key": "2Z1FZug7mZNyM63ggkm37r4oKQ29khLjAvEx43rGkFN47RcJ2t"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment