public ZoroChainSystem(Store store, string relativePath) { Singleton = this; this.relativePath = relativePath; ActorSystem = ActorSystem.Create(nameof(ZoroChainSystem), $"akka {{ log-dead-letters = off }}" + $"blockchain-mailbox {{ mailbox-type: \"{typeof(BlockchainMailbox).AssemblyQualifiedName}\" }}" + $"task-manager-mailbox {{ mailbox-type: \"{typeof(TaskManagerMailbox).AssemblyQualifiedName}\" }}" + $"remote-node-mailbox {{ mailbox-type: \"{typeof(RemoteNodeMailbox).AssemblyQualifiedName}\" }}" + $"protocol-handler-mailbox {{ mailbox-type: \"{typeof(ProtocolHandlerMailbox).AssemblyQualifiedName}\" }}" + $"consensus-service-mailbox {{ mailbox-type: \"{typeof(ConsensusServiceMailbox).AssemblyQualifiedName}\" }}"); // 加载插件 pluginmgr = new PluginManager(); pluginmgr.LoadPlugins(); // 获取IP地址 string networkType = ProtocolSettings.Default.NetworkType; MyIPAddress = GetMyIPAddress(networkType); // 打印调试信息 string str = "NetworkType:" + networkType + ", MyIPAddress:"; str += MyIPAddress?.ToString() ?? "null"; Log(str); // 创建根链Actor对象 CreateZoroSystem(UInt160.Zero, store); eventHandler = new AppChainEventHandler(MyIPAddress); }
void FindMyIP() { MyIPAddress my = new MyIPAddress(); myip = my.Find(); localEp = new IPEndPoint(myip, 3001); }
// Constructor public MainPage() { InitializeComponent(); MyIPAddress finder = new MyIPAddress(); finder.Find((address) => { MyIp = address; }); }