Exemple #1
0
 private ProtocolSettings(IConfigurationSection section)
 {
     Magic                = uint.Parse(section.GetSection("Magic").Value);
     AddressVersion       = byte.Parse(section.GetSection("AddressVersion").Value);
     StandbyValidators    = section.GetSection("StandbyValidators").GetChildren().Select(p => p.Value).ToArray();
     SeedList             = section.GetSection("SeedList").GetChildren().Select(p => p.Value).ToArray();
     SystemFee            = section.GetSection("SystemFee").GetChildren().ToDictionary(p => (TransactionType)Enum.Parse(typeof(TransactionType), p.Key, true), p => Fixed8.Parse(p.Value));
     SecondsPerBlock      = GetValueOrDefault(section.GetSection("SecondsPerBlock"), 15u, p => uint.Parse(p));
     LowPriorityThreshold = GetValueOrDefault(section.GetSection("LowPriorityThreshold"), Fixed8.FromDecimal(0.001m), p => Fixed8.Parse(p));
 }
Exemple #2
0
 public void StartRpc(IPAddress bindAddress, int port, Wallet wallet = null, string sslCert = null, string password = null,
                      string[] trustedAuthorities = null, Fixed8 maxGasInvoke = default(Fixed8))
 {
     RpcServer = new RpcServer(this, wallet, maxGasInvoke);
     RpcServer.Start(bindAddress, port, sslCert, password, trustedAuthorities);
 }
Exemple #3
0
 public Settings(IConfigurationSection section)
 {
     this.Magic                   = uint.Parse(section.GetSection("Magic").Value);
     this.AddressVersion          = byte.Parse(section.GetSection("AddressVersion").Value);
     this.MaxTransactionsPerBlock = GetValueOrDefault(section.GetSection("MaxTransactionsPerBlock"), 500, p => int.Parse(p));
     this.StandbyValidators       = section.GetSection("StandbyValidators").GetChildren().Select(p => p.Value).ToArray();
     this.SeedList                = section.GetSection("SeedList").GetChildren().Select(p => p.Value).ToArray();
     this.SystemFee               = section.GetSection("SystemFee").GetChildren().ToDictionary(p => (TransactionType)Enum.Parse(typeof(TransactionType), p.Key, true), p => Fixed8.Parse(p.Value));
     this.SecondsPerBlock         = GetValueOrDefault(section.GetSection("SecondsPerBlock"), 15u, p => uint.Parse(p));
 }