Exemplo n.º 1
0
        public void GweiToWei_ShouldMatch()
        {
            var wei  = EthUnitConverter.ConvertGWeiToWei(TestGwei);
            var gWei = EthUnitConverter.Convert(TestWei, EthUnit.Wei, EthUnit.GWei);

            Assert.AreEqual(TestGwei, gWei);
            Assert.AreEqual(TestWei, wei);
        }
Exemplo n.º 2
0
        internal static void Main(string[] args)
        {
            Console.WriteLine("Starting up CryptoSql...");
            var info = new ServerInfo
            {
                Address        = IPAddress.Any,
                Port           = 3307,
                MaxConnections = 1,
                // MySQL ver
                VersionString = "5.0.0",
                ReportTimings = true
            };

            for (var i = 0; i < args.Length; i++)
            {
                if (i + 1 < args.Length)
                {
                    switch (args[i])
                    {
                    case "-p":
                        if (int.TryParse(args[i++], out var port))
                        {
                            info.Port = port;
                        }

                        break;

                    case "-m":
                        if (int.TryParse(args[i++], out var max))
                        {
                            info.MaxConnections = max;
                        }

                        break;
                    }
                }
            }

            var bridge = new Bridge(info);

            bridge.Providers[ProviderType.EthMonolithic] = new EthMonolithicProvider(ConfigManager.Config.GethHost,
                                                                                     ConfigManager.KeyStore, ConfigManager.Config.Password)
            {
                GasPrice = EthUnitConverter.ConvertGWeiToWei(5)
            };
            bridge.AddDaemon(new ServerDaemon());
            bridge.StartAllDaemons();

            Console.ReadKey();
        }