public async Task <JObject> NodeIsForked()
        {
            var isForked = MainchainNodeService.IsForked();
            var response = new JObject
            {
                ["IsForked"] = isForked
            };

            return(JObject.FromObject(response));
        }
        public async Task <JObject> IsDPoSAlive()
        {
            var isAlive  = MainchainNodeService.IsDPoSAlive();
            var response = new JObject
            {
                ["IsAlive"] = isAlive
            };

            return(JObject.FromObject(response));
        }
Beispiel #3
0
        /// <summary>
        /// Starts the sync process with, optionally an initial sync mode. The
        /// synchronizer considers the initial sync finished when all the block
        /// below the sync target have been successfully executed by the node.
        /// </summary>
        /// <param name="node"></param>
        /// <param name="doInitialSync"></param>
        /// <returns></returns>
        // todo remove The node property : autofac circular dependency problem.
        public async Task Start(MainchainNodeService node, bool doInitialSync)
        {
            _mainChainNode = node;

            CurrentExecHeight = node.GetCurrentHeight() + 1;
            _logger?.Debug($"Initial chain height {CurrentExecHeight}.");

            ShouldDoInitialSync     = doInitialSync;
            IsInitialSyncInProgress = false; // started by first block

            if (doInitialSync)
            {
                _logger?.Trace("Initial sync started.");
            }
            else
            {
                Task.Run(() => DoSync());
            }
        }