@@ -39,7 +39,7 @@ const MAX_PEERS: u8 = 15;
3939/// let builder = NodeBuilder::new(Network::Regtest);
4040/// let (node, client) = builder
4141/// .add_peers(vec![host.into()])
42- /// .build_node ()
42+ /// .build ()
4343/// .unwrap();
4444/// ```
4545///
@@ -68,8 +68,8 @@ const MAX_PEERS: u8 = 15;
6868/// // Only scan blocks strictly after an anchor checkpoint
6969/// .anchor_checkpoint(checkpoint)
7070/// // The number of connections we would like to maintain
71- /// .num_required_peers (2)
72- /// .build_node ()
71+ /// .required_peers (2)
72+ /// .build ()
7373/// .unwrap();
7474/// ```
7575pub struct NodeBuilder {
@@ -110,7 +110,7 @@ impl NodeBuilder {
110110
111111 /// Add a path to the directory where data should be stored. If none is provided, the current
112112 /// working directory will be used.
113- pub fn add_data_dir ( mut self , path : impl Into < PathBuf > ) -> Self {
113+ pub fn data_dir ( mut self , path : impl Into < PathBuf > ) -> Self {
114114 self . config . data_path = Some ( path. into ( ) ) ;
115115 self
116116 }
@@ -119,7 +119,7 @@ impl NodeBuilder {
119119 /// Adding more connections increases the node's anonymity, but requires waiting for more responses,
120120 /// higher bandwidth, and higher memory requirements. If none is provided, a single connection will be maintained.
121121 /// The number of connections will be clamped to a range of 1 to 15.
122- pub fn num_required_peers ( mut self , num_peers : u8 ) -> Self {
122+ pub fn required_peers ( mut self , num_peers : u8 ) -> Self {
123123 self . config . required_peers = num_peers. clamp ( MIN_PEERS , MAX_PEERS ) ;
124124 self
125125 }
@@ -150,7 +150,7 @@ impl NodeBuilder {
150150 }
151151
152152 /// Set the desired communication channel. Either directly over TCP or over the Tor network.
153- pub fn set_connection_type ( mut self , connection_type : ConnectionType ) -> Self {
153+ pub fn connection_type ( mut self , connection_type : ConnectionType ) -> Self {
154154 self . config . connection_type = connection_type;
155155 self
156156 }
@@ -164,7 +164,7 @@ impl NodeBuilder {
164164 /// nodes may be slower to respond while processing blocks and transactions.
165165 ///
166166 /// If none is provided, a timeout of 5 seconds will be used.
167- pub fn set_response_timeout ( mut self , response_timeout : Duration ) -> Self {
167+ pub fn response_timeout ( mut self , response_timeout : Duration ) -> Self {
168168 self . config . response_timeout = response_timeout;
169169 self
170170 }
@@ -176,10 +176,10 @@ impl NodeBuilder {
176176 ///
177177 /// This value is configurable as some developers may be satisfied with a peer
178178 /// as long as the peer responds promptly. Other implementations may value finding
179- /// new a reliable peers faster, so the maximum connection time may be shorter.
179+ /// new and reliable peers faster, so the maximum connection time may be shorter.
180180 ///
181181 /// If none is provided, a maximum connection time of two hours will be used.
182- pub fn set_maximum_connection_time ( mut self , max_connection_time : Duration ) -> Self {
182+ pub fn maximum_connection_time ( mut self , max_connection_time : Duration ) -> Self {
183183 self . config . max_connection_time = max_connection_time;
184184 self
185185 }
@@ -207,7 +207,7 @@ impl NodeBuilder {
207207 ///
208208 /// Building a node and client will error if a database connection is denied or cannot be found.
209209 #[ cfg( feature = "database" ) ]
210- pub fn build_node ( & mut self ) -> Result < ( NodeDefault , Client ) , SqlInitializationError > {
210+ pub fn build ( & mut self ) -> Result < ( NodeDefault , Client ) , SqlInitializationError > {
211211 let peer_store = SqlitePeerDb :: new ( self . network , self . config . data_path . clone ( ) ) ?;
212212 let header_store = SqliteHeaderDb :: new ( self . network , self . config . data_path . clone ( ) ) ?;
213213 Ok ( Node :: new (
0 commit comments