public override void BuildNode()
        {
            var settings = new NodeSettings(this.Network, ProtocolVersion.ALT_PROTOCOL_VERSION, args: new string[] { "-conf=stratis.conf", "-datadir=" + this.DataFolder });

            var builder = new FullNodeBuilder()
                          .UseNodeSettings(settings)
                          .UseBlockStore()
                          .UsePosConsensus()
                          .UseMempool()
                          .UseWallet()
                          .AddPowPosMining()
                          .AddRPC()
                          .UseApi()
                          .MockIBD();

            if (this.OverrideDateTimeProvider)
            {
                builder.OverrideDateTimeProviderFor <MiningFeature>();
            }

            if (this.InterceptorDisconnect != null)
            {
                builder = builder.InterceptBlockDisconnected(this.InterceptorDisconnect);
            }

            if (this.InterceptorConnect != null)
            {
                builder = builder.InterceptBlockConnected(this.InterceptorConnect);
            }

            this.FullNode = (FullNode)builder.Build();
        }
Beispiel #2
0
        public override void BuildNode()
        {
            var settings = new NodeSettings(this.Network, ProtocolVersion.PROVEN_HEADER_VERSION, this.Agent, args: new string[] { "-conf=stratis.conf", "-datadir=" + this.DataFolder });

            var builder = new FullNodeBuilder()
                          .UseNodeSettings(settings)
                          .UseBlockStore()
                          .UsePosConsensus()
                          .UseMempool()
                          .UseWallet()
                          .AddPowPosMining()
                          .AddRPC()
                          .UseApi()
                          .UseTestChainedHeaderTree()
                          .MockIBD();

            if (this.OverrideDateTimeProvider)
            {
                builder.OverrideDateTimeProviderFor <MiningFeature>();
            }

            if (this.InterceptorDisconnect != null)
            {
                builder = builder.InterceptBlockDisconnected(this.InterceptorDisconnect);
            }

            if (this.InterceptorConnect != null)
            {
                builder = builder.InterceptBlockConnected(this.InterceptorConnect);
            }

            if (!this.EnablePeerDiscovery)
            {
                builder.RemoveImplementation <PeerConnectorDiscovery>();
                builder.ReplaceService <IPeerDiscovery>(new PeerDiscoveryDisabled());
            }

            this.FullNode = (FullNode)builder.Build();
        }