Пример #1
0
        public static void Initialize()
        {
            var notify = new NotifyComponent();
            BlockchainComponent blockChainComponent = new BlockchainComponent();
            AccountComponent    accountComponent    = new AccountComponent();
            UtxoComponent       utxoComponent       = new UtxoComponent();

            //从配置文件中读取
            ConfigurationTool tool   = new ConfigurationTool();
            NodeConfig        config = tool.GetAppSettings <NodeConfig>("NodeConfig");

            notify.SetCallbackApp(config.WalletNotify);

            if (GlobalActions.TransactionNotifyAction == null)
            {
                GlobalActions.TransactionNotifyAction = NewTransactionNotify;
            }

            blockChainComponent.Initialize();
            var accounts = accountComponent.GetAllAccounts();

            if (accounts.Count == 0)
            {
                var account = accountComponent.GenerateNewAccount();
                accountComponent.SetDefaultAccount(account.Id);
            }

            BlockchainJob.Current = new BlockchainJob();
            utxoComponent.Initialize();
        }
Пример #2
0
        static void Main(string[] args)
        {
            bool testnet = false;

            if (args.Length == 1 && args[0].ToLower() == "-testnet")
            {
                testnet = true;
                LogHelper.Info("FiiiChain Testnet Engine is Started.");
            }
            else
            {
                LogHelper.Info("FiiiChain Engine is Started.");
            }

            try
            {
                GlobalParameters.IsTestnet = testnet;
                BlockchainJob.Initialize();
                BlockchainJob.Current.Start();
            }
            catch (Exception ex)
            {
                LogHelper.Error(ex.Message, ex);
            }

            //LogHelper.Debug("Press Enter to close");
            //Console.ReadLine();

            //BlockchainJob.Current.Stop();
        }
Пример #3
0
        public static void Initialize()
        {
            BlockchainComponent blockChainComponent = new BlockchainComponent();
            AccountComponent    accountComponent    = new AccountComponent();
            UtxoComponent       utxoComponent       = new UtxoComponent();

            blockChainComponent.Initialize();
            var accounts = accountComponent.GetAllAccounts();

            if (accounts.Count == 0)
            {
                var account = accountComponent.GenerateNewAccount();
                accountComponent.SetDefaultAccount(account.Id);
            }

            BlockchainJob.Current = new BlockchainJob();
            utxoComponent.Initialize();
        }