Think through the API, make it more consistent
Opened this issue · 0 comments
Kagami commented
-
var_int.value
vsvar_str.str
vsvar_list.list
-
net_addr.addrs
vsinv.inventory
vserror.vector
-
pubkey.needed
vsmsg.identities
vsbroadcast.subscriptions
-
bootstrap
/connect
/listen
API: it's better to always use objects instead of positional arguments. (E.g.{host: "1.2.3.4", port: 8444}
) -
connection
pass 3 positional arguments (should it passtransport, {host, port}
instead?) - error message
fatal
field is nonintuitive (better to use something liketype
) - version message
version
field is nonintuitive (better to use something likeprotoVersion
) - version message
streamNumbers
field is awkward - High-level checkings (like connection to self detection) probably should lie in transport code
- Exceptions in transport callbacks propogated further: do we want to auto-catch and warn about them?
- Somehow make it clear that methods like
tryDecode
andvalidate
don't throw exceptions