Skip to content

Comments

add signet support#8

Open
futurepaul wants to merge 2 commits intoleishman:masterfrom
futurepaul:signet
Open

add signet support#8
futurepaul wants to merge 2 commits intoleishman:masterfrom
futurepaul:signet

Conversation

@futurepaul
Copy link
Contributor

this moves the default port and network magic to global vars that are initialized on startup. it might be more elegant in the future to thread those values through the program but I wanted to optimize for minimal changes to existing logic

tested the basics of discover, connecting, and mempool with mainnet, default signet, and a custom signet

src/network.zig Outdated
Comment on lines 146 to 152
fn isCommandArg(arg: []const u8) bool {
return std.mem.eql(u8, arg, "broadcast") or
std.mem.eql(u8, arg, "explore") or
std.mem.eql(u8, arg, "help") or
std.mem.eql(u8, arg, "--help") or
std.mem.eql(u8, arg, "-h");
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing discover command. Running yam --signet discover will incorrectly treat "discover" as a custom challenge hex, fail to parse it, and return an error.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch thank you. This also demonstrated how invasive adding signet as a flag is. I changed it to an environment variable so it's less disruptive to overall logic / usage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants