public RpcServer(NeoSystem system, RpcServerSettings settings) { this.system = system; this.settings = settings; localNode = system.LocalNode.Ask <LocalNode>(new LocalNode.GetInstance()).Result; RegisterMethods(this); }
public void UpdateSettings(RpcServerSettings settings) { this.RpcUser = settings.RpcUser; this.RpcPass = settings.RpcPass; this.MaxGasInvoke = settings.MaxGasInvoke; this.MaxFee = settings.MaxFee; this.DisabledMethods = settings.DisabledMethods; }
protected override void Configure() { var loadedSettings = new RpcServerSettings(GetConfiguration()); if (this.settings == null) { this.settings = loadedSettings; } else { this.settings.UpdateSettings(loadedSettings); } }
protected override void OnSystemLoaded(NeoSystem system) { RpcServerSettings s = settings.Servers.FirstOrDefault(p => p.Network == system.Settings.Magic); if (s is null) { return; } RpcServer server = new RpcServer(system, s); if (handlers.Remove(s.Network, out var list)) { foreach (var handler in list) { server.RegisterMethods(handler); } } server.StartRpcServer(); servers.TryAdd(s.Network, server); }
public RpcServer(NeoSystem system, RpcServerSettings settings) { this.system = system; this.settings = settings; RegisterMethods(this); }
public Settings(IConfigurationSection section) { Servers = section.GetSection(nameof(Servers)).GetChildren().Select(p => RpcServerSettings.Load(p)).ToArray(); }