Exemplo n.º 1
0
        public Server Build(
            NodeConnectionInfo myConnectionInfo,
            KnownNodeStore knownNodeStore,
            NodeClientFactory nodeClientFactory,
            NodeClientStore nodeClientStore,
            VoteMemoryPool voteMemoryPool,
            Blockchain blockchain,
            Miner miner,
            VoteValidator voteValidator,
            BlockValidator blockValidator,
            BlockchainAdder blockchainAdder,
            IConsole console)
        {
            var handshakeService = new NodeService(
                knownNodeStore,
                nodeClientFactory,
                nodeClientStore,
                voteMemoryPool,
                blockchain,
                miner,
                voteValidator,
                blockValidator,
                blockchainAdder,
                console);
            var server = new Server
            {
                Services = { Node.BindService(handshakeService) },
                Ports    = { new ServerPort(myConnectionInfo.Ip, myConnectionInfo.Port, ServerCredentials.Insecure) }
            };

            return(server);
        }
Exemplo n.º 2
0
 public NodeService(
     KnownNodeStore knownNodeStore,
     NodeClientFactory nodeClientFactory,
     NodeClientStore nodeClientStore,
     VoteMemoryPool voteMemoryPool,
     Blockchain blockchain,
     Miner miner,
     VoteValidator voteValidator,
     BlockValidator blockValidator,
     BlockchainAdder blockchainAdder)
 {
     this.knownNodeStore    = knownNodeStore;
     this.nodeClientFactory = nodeClientFactory;
     this.nodeClientStore   = nodeClientStore;
     this.voteMemoryPool    = voteMemoryPool;
     this.blockchain        = blockchain;
     this.miner             = miner;
     this.voteValidator     = voteValidator;
     this.blockValidator    = blockValidator;
     this.blockchainAdder   = blockchainAdder;
 }