public async void Run()
        {
            await Task.Delay(2000);

            var httpRpc = Entity.Root.Find("HttpRpc")?.GetComponent <HttpRpc>();

            if (httpRpc == null)
            {
                return;
            }
            var consensus = Entity.Root.GetComponent <Consensus>();
            var luaVMEnv  = Entity.Root.GetComponent <LuaVMEnv>();

            HttpMessage httpMessage = new HttpMessage();
            string      address     = Wallet.GetWallet().GetCurWallet().ToAddress();

            //string consAddress = "";

            while (true)
            {
                await Task.Delay(60000);

                if (DateTime.Now.Hour >= 12)
                {
                    var      dayAccount = "account" + DateTime.Now.ToString("yyyyMMdd");
                    FileInfo fi         = new FileInfo("./" + dayAccount + ".csv");
                    bool     exists     = fi.Exists;
                    if (exists == false)
                    {
                        var height = consensus.transferHeight;
                        LevelDBStore.test_ergodic2(height, dayAccount);
                        Console.WriteLine("导出完成");
                    }
                }
            }
        }
Exemple #2
0
        private void OutLeveldb(HttpMessage httpMessage)
        {
            if (!GetParam(httpMessage, "1", "passwords", out string password))
            {
                httpMessage.result = "command error! \nexample: wallet password";
                return;
            }

            if (Wallet.GetWallet().IsPassword(password))
            {
                if (!GetParam(httpMessage, "2", "height", out string height))
                {
                    httpMessage.result = "command error! \nexample: outleveldb password height filename";
                    return;
                }
                if (!GetParam(httpMessage, "3", "filename", out string filename))
                {
                    httpMessage.result = "command error! \nexample: outleveldb password height filename";
                    return;
                }
                LevelDBStore.test_ergodic2(long.Parse(height), filename);
                httpMessage.result = "导出完成";
            }
        }