public RemoteNode(ZoroSystem system, object connection, IPEndPoint remote, IPEndPoint local, Blockchain blockchain, LocalNode localNode) : base(connection, remote, local) { this.system = system; this.localNode = localNode; this.blockchain = blockchain; this.protocol = Context.ActorOf(ProtocolHandler.Props(system, localNode, blockchain, this), "RemoteNode"); localNode.RemoteNodes.TryAdd(Self, this); SendMessage(Message.Create(MessageType.Version, VersionPayload.Create(localNode.ChainHash, localNode.ListenerPort, LocalNode.NodeId, LocalNode.UserAgent, blockchain.Height))); Log($"Connected to RemoteNode {blockchain.Name} {remote}"); }
internal static Props Props(ZoroSystem system, object connection, IPEndPoint remote, IPEndPoint local, Blockchain blockchain, LocalNode localNode) { return(Akka.Actor.Props.Create(() => new RemoteNode(system, connection, remote, local, blockchain, localNode)).WithMailbox("remote-node-mailbox")); }
public static Props Props(ZoroSystem system, LocalNode localNode, Blockchain blockchain, RemoteNode remoteNode) { return(Akka.Actor.Props.Create(() => new ProtocolHandler(system, localNode, blockchain, remoteNode)).WithMailbox("protocol-handler-mailbox")); }
public RemoteNode(ZoroSystem system, object connection, IPEndPoint remote, IPEndPoint local, LocalNode localNode) : base(connection, remote, local) { this.system = system; this.localNode = localNode; this.protocol = Context.ActorOf(ProtocolHandler.Props(system, localNode, localNode.Blockchain)); localNode.RemoteNodes.TryAdd(Self, this); SendMessage(Message.Create("version", VersionPayload.Create(localNode.ListenerPort, LocalNode.Nonce, LocalNode.UserAgent, localNode.Blockchain.Height))); }
public ProtocolHandler(ZoroSystem system, LocalNode localNode, Blockchain blockchain) { this.system = system; this.localNode = localNode; this.blockchain = blockchain; }