Ejemplo n.º 1
0
        public void RemoveResource(BlockchainNode node, NodeResourceType resourceType, ResponseHandler.DispatherCallback dispatherCallback)
        {
            ActionRequest action = new ActionRequest(ActionType.DeleteFile);

            action.FullNodeName = node.NodeEndpoint.FullNodeName;
            NodeResource nodeResource = NodeResourceLocator.NodeResources[resourceType];

            action.Parameters.Add(ActionParameters.Path, ClientConfigReader.Evaluate(nodeResource.ResourceLocation, node.NodeConfig));
            actionQueue.Enqueue(action);
        }
Ejemplo n.º 2
0
        public CoinMasterForm()
        {
            InitializeComponent();
            buttonEditNodeProfile_Click(null, EventArgs.Empty);
            ReadNodeProfiles();

            //Create pop-up
            notifier        = new Tulpep.NotificationWindow.PopupNotifier();
            notifier.Delay  = 10000;
            notifier.Click += (sender, eventArgs) =>
            {
                Visible = true;
                BringToFront();
            };

            //Create workers
            cryptoIdWorker              = new CryptoIdWorker(60000, new NodeEndpointName("Stratis", "StratisTest"));
            cryptoIdWorker.StateChange += DashboardWorkerStateChanged;
            cryptoIdWorker.DataUpdate  += (source, args) => Invoke(new Action <object, CryptoIdDataUpdateEventArgs>(CryptoIdUpdated), source, args);
            _workers.Add(cryptoIdWorker);

            //Start all workers
            foreach (BaseWorker worker in _workers)
            {
                worker.Start();
            }


            ClientConfigReader reader = new ClientConfigReader();

            clientConfig = reader.ReadConfig();
            List <String> agentList = clientConfig.GetAgentList();

            this.managedNodes = new NodeNetwork();
            foreach (string fullNodeName in clientConfig.NodeItems.Keys)
            {
                BlockchainNode blockchainNode = new BlockchainNode(clientConfig.NodeItems[fullNodeName]);
                this.managedNodes.Nodes.Add(fullNodeName, blockchainNode);
            }

            clientConnectionManager = new AgentConnectionManager(managedNodes);

            clientConnectionManager.Session.AgentHealthcheckStatsUpdated += (agentConnection, state, message) => Invoke(new Action <AgentConnection, AgentHealthState, String>(AgentDataTableUpdated), agentConnection, state, message);
            clientConnectionManager.Session.NodesUpdated             += (agentConnection, updatedNodes) => Invoke(new Action <AgentConnection, NodeNetwork>(NodeDataUpdated), agentConnection, updatedNodes);
            clientConnectionManager.Session.AgentRegistrationUpdated += (agentConnection, agentRegistration) => Invoke(new Action <AgentConnection, AgentRegistration>(AgentRegistrationUpdated), agentConnection, agentRegistration);

            clientConnectionManager.ConnectToAgents(agentList);
        }