Skip to content
This repository has been archived by the owner on Aug 16, 2021. It is now read-only.

Feature/xmldoc stratis.bitcoin.configuration #261

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 71 additions & 45 deletions Stratis.Bitcoin/Configuration/DataFolder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,56 +6,82 @@

namespace Stratis.Bitcoin.Configuration
{
/// <summary>
/// Contains path locations to folders and files on disk.
/// Used by various components of the full node.
/// </summary>
/// <summary>
/// Contains path locations to folders and files on disk.
/// Used by various components of the full node.
/// </summary>
/// <remarks>
/// Location name should describe if its a file or a folder.
/// File location names end with "File" (i.e AddrMan[File]).
/// Folder location names end with "Path" (i.e CoinView[Path]).
/// </remarks>
public class DataFolder
{
// Note: a location name should described if its a file or a folder
// File - location name end with "File" (i.e AddrMan[File])
// Folder - location name end with "Path" (i.e CoinView[Path])
public DataFolder(NodeSettings settings)
{
string path = settings.DataDir;
this.CoinViewPath = Path.Combine(path, "coinview");
this.AddrManFile = Path.Combine(path, "addrman.dat");
this.ChainPath = Path.Combine(path, "chain");
this.BlockPath = Path.Combine(path, "blocks");
this.RPCCookieFile = Path.Combine(path, ".cookie");
this.WalletPath = Path.Combine(path);
this.LogPath = Path.Combine(path, "Logs");
/// <summary>
/// Initializes the path locations.
/// </summary>
/// <param name="settings">Node configuration.</param>
public DataFolder(NodeSettings settings)
{
string path = settings.DataDir;
this.CoinViewPath = Path.Combine(path, "coinview");
this.AddrManFile = Path.Combine(path, "addrman.dat");
this.ChainPath = Path.Combine(path, "chain");
this.BlockPath = Path.Combine(path, "blocks");
this.RPCCookieFile = Path.Combine(path, ".cookie");
this.WalletPath = Path.Combine(path);
this.LogPath = Path.Combine(path, "Logs");
}

/// <summary>Address manager's database of peers.</summary>
/// <seealso cref="NBitcoin.Protocol.AddressManager.LoadPeerFile"/>
public string AddrManFile
{
get;
set;
}

/// <summary>Path to the folder with coin view database files.</summary>
/// <seealso cref="Features.Consensus.CoinViews.DBreezeCoinView.DBreezeCoinView"/>
public string CoinViewPath
{
get; set;
}

public string AddrManFile
{
get;
set;
}
public string CoinViewPath
{
get; set;
}
public string ChainPath
{
get;
internal set;
}
public string BlockPath
{
get;
internal set;
}
public string RPCCookieFile
{
get;
internal set;
}
public string WalletPath
/// <summary>Path to the folder with node's chain repository database files.</summary>
/// <seealso cref="Base.BaseFeature.StartChain"/>
public string ChainPath
{
get;
internal set;
}
get;
internal set;
}

/// <summary>Path to the folder with block repository database files.</summary>
/// <seealso cref="Features.BlockStore.BlockRepository.BlockRepository"/>
public string BlockPath
{
get;
internal set;
}

/// <summary>File to store RPC authorization cookie.</summary>
/// <seealso cref="Features.RPC.Startup.Configure"/>
public string RPCCookieFile
{
get;
internal set;
}

/// <summary>Path to wallet files.</summary>
/// <seealso cref="Features.Wallet.WalletManager.LoadWallet"/>
public string WalletPath
{
get;
internal set;
}

/// <summary>Path to log files.</summary>
/// <seealso cref="Logging.LogsExtension"/>
public string LogPath
{
get;
Expand Down
48 changes: 31 additions & 17 deletions Stratis.Bitcoin/Configuration/NodeServerEndpoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,38 @@

namespace Stratis.Bitcoin.Configuration
{
public class NodeServerEndpoint
{
public NodeServerEndpoint()
{
/// <summary>
/// Description of network interface on which the node listens.
/// </summary>
public class NodeServerEndpoint
{
/// <summary>Empty constructor.</summary>
/// <remarks>TODO: This does not seem to be used anywhere, can we remove it?</remarks>
public NodeServerEndpoint()
{
}

}
public NodeServerEndpoint(IPEndPoint endpoint, bool whitelisted)
{
/// <summary>
/// Initializes an instance of the object.
/// </summary>
/// <param name="endpoint">IP address and port number on which the node server listens.</param>
/// <param name="whitelisted">If <c>true</c>, peers that connect to this interface are whitelisted.</param>
public NodeServerEndpoint(IPEndPoint endpoint, bool whitelisted)
{
this.Endpoint = endpoint;
this.Whitelisted = whitelisted;
}
public IPEndPoint Endpoint
{
get; set;
}
public bool Whitelisted
{
get; set;
}
}
}

/// <summary>IP address and port number on which the node server listens.</summary>
public IPEndPoint Endpoint
{
get; set;
}

/// <summary>If <c>true</c>, peers that connect to this interface are whitelisted.</summary>
public bool Whitelisted
{
get; set;
}
}
}
Loading