What is BTConfig? #5
IntroWhat is a btconfig to a peer? That's a good question. Briefly speaking, we used to design a test framework that separates peer and config, but soon we aborted that plan. However, by that time we had already implemented our reference code, so we did not change the framework. In short, it's just due to legacy reasons; it is not good but using it is fine. What's inside btconfigFrom @YanWQ-monad |
Answered by
YanWQ-monad
Dec 1, 2022
Replies: 2 comments 1 reply
|
Sorry for this bad design. |
0 replies
|
class BtConfig:
output_file: str # Not used
peer_list_file: str # Filename of peer list (including this peer)
has_chunk_file: str # Filename of serialized chunk dictionary
max_conn: int # Maximum concurrently connections
identity: int # This peer's ID
peers: list[tuple[str, str, str]] # List of tuple (ID, hostname, port). Peer list
haschunks: dict[str, bytes] # Chunks data (hash -> data)
verbose: int # Verbosity
timeout: int # Timeout value, default 0.
# If 0, you should estimate timeout value using estimated RTT.
# If not 0, you should always use the set value.
ip: str # This peer's IP
port: int # This peer's port |
1 reply
Answer selected by
TANSixu
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
这才是文档