src/Stratis.FederatedPeg.IntegrationTests.Tools/FederatedNetworkScripts/NodeSetup.cs
/// <summary>
/// Generates the command arguments to use when starting up the node.
/// </summary>
/// <returns>The command arguments to use when starting up the node</returns>
Generates the command arguments to use when starting up the node.
Generates the command arguments to use when starting up the node .
public string GenerateCommandArguments()
        {
            StringBuilder sb = new StringBuilder(this.GenerateNetworkTypeArg());
            if (!string.IsNullOrWhiteSpace(this.AgentPrefix))
                sb.Append($"-agentprefix={this.AgentPrefix} ");
            if (!string.IsNullOrWhiteSpace(this.DataDir))
                sb.Append($"-datadir={this.DataDir} ");
            if (this.Port != null)
                sb.Append($"-port={this.Port} ");
            if (this.ApiPort != null)
                sb.Append($"-apiport={this.ApiPort} ");
            if (this.CounterChainApiPort != null)
                sb.Append($"-counterchainapiport={this.CounterChainApiPort} ");
            if (this.FederationIps.Count > 0)
                sb.Append($"-federationips={string.Join(",", this.FederationIps)} ");
            if (!string.IsNullOrWhiteSpace(this.RedeemScript))
                sb.Append($"-redeemscript=\"\"{this.RedeemScript}\"\" ");
            if (!string.IsNullOrWhiteSpace(this.PublicKey))
                sb.Append($"-publickey={this.PublicKey} ");
            if (this.NodesAdded.Count > 0)
                sb.Append(string.Join("", this.NodesAdded.Select(address => $"-addnode={address} ")));
            if (this.NodesConnetedTo.Count > 0)
                sb.Append(string.Join("", this.NodesConnetedTo.Select(address => $"-connect={address} ")));
            sb.Append(this.CustomArguments ?? string.Empty);
            return sb.ToString();
        }
public string GenerateCommandArguments ( ) { StringBuilder sb = new StringBuilder ( this . GenerateNetworkTypeArg ( ) ) ; if ( ! string . IsNullOrWhiteSpace ( this . AgentPrefix ) ) sb . Append ( $" -agentprefix= { this . AgentPrefix } " ) ; if ( ! string . IsNullOrWhiteSpace ( this . DataDir ) ) sb . Append ( $" -datadir= { this . DataDir } " ) ; if ( this . Port != null ) sb . Append ( $" -port= { this . Port } " ) ; if ( this . ApiPort != null ) sb . Append ( $" -apiport= { this . ApiPort } " ) ; if ( this . CounterChainApiPort != null ) sb . Append ( $" -counterchainapiport= { this . CounterChainApiPort } " ) ; if ( this . FederationIps . Count > 0 ) sb . Append ( $" -federationips= { string . Join ( " " , this . FederationIps ) } " ) ; if ( ! string . IsNullOrWhiteSpace ( this . RedeemScript ) ) sb . Append ( $" -redeemscript= \" \" { this . RedeemScript } \" \" " ) ; if ( ! string . IsNullOrWhiteSpace ( this . PublicKey ) ) sb . Append ( $" -publickey= { this . PublicKey } " ) ; if ( this . NodesAdded . Count > 0 ) sb . Append ( string . Join ( " " , this . NodesAdded . Select ( address => $" -addnode= { address } " ) ) ) ; if ( this . NodesConnetedTo . Count > 0 ) sb . Append ( string . Join ( " " , this . NodesConnetedTo . Select ( address => $" -connect= { address } " ) ) ) ; sb . Append ( this . CustomArguments ?? string . Empty ) ; return sb . ToString ( ) ; }
Generates the command arguments to use when starting up the node.
Generates the command arguments to use when starting up the node .
The command arguments to use when starting up the node
The command arguments to use when starting up the node