Beispiel #1
0
        public BlockChain(LyraSystem sys)
        {
            if (Singleton != null)
            {
                throw new Exception("Blockchain reinitialization");
            }

            _sys = sys;

            var nodeConfig = Neo.Settings.Default.LyraNode;

            _store      = new MongoAccountCollection();
            _log        = new SimpleLogger("BlockChain").Logger;
            _nodeConfig = nodeConfig;
            NetworkID   = nodeConfig.Lyra.NetworkId;

            Singleton = this;
        }
        public DagSystem(IHostEnv hostEnv, IAccountCollectionAsync store, IHubContext <LyraEventHub, ILyraEvent> hub, Wallet posWallet, IActorRef localNode)
        {
            _hostEnv    = hostEnv;
            _log        = new SimpleLogger("DagSystem").Logger;
            FullStarted = false;
            _hub        = hub;

            Storage   = new TracedStorage(store);
            PosWallet = posWallet;

            LocalNode = localNode;
            this.LocalNode.Tell(this);

            if (hostEnv != null)     // for unit test
            {
                TheBlockchain = ActorSystem.ActorOf(BlockChain.Props(this, Storage));
                TaskManager   = ActorSystem.ActorOf(Neo.Network.P2P.TaskManager.Props(this));

                //TradeEngine = new TradeMatchEngine(Storage);
            }

            Singleton = this;
        }