Example #1
0
        private void addPeerBtn_Click(object sender, EventArgs e)
        {
            var peerUrl = peerTxt.Text;

            NodeApiClient.AddPeer(peerUrl);
            peersLst.Items.Add(peerUrl);
        }
Example #2
0
        private void ChainOnConsensusValidateRequest(object sender, EventArgs eventArgs)
        {
            Log("A consensus update is request has been received");
            var validateResult = NodeApiClient.ValidateConsensus();

            Log(validateResult);
        }
Example #3
0
        private void autoMineTimer_Tick(object sender, EventArgs e)
        {
            Log("Start mining a new Block");
            NodeApiClient.MineBlock();

            //var message = NodeApiClient.ValidateConsensus();
            //logTxt.AppendText($"-------------------{DateTime.Now}------------------\n");
            //logTxt.AppendText($"Consensus Validate Result : {message}\n");
            //logTxt.AppendText("------------------------------------------------------\n");
        }
Example #4
0
        private void sendBtn_Click(object sender, EventArgs e)
        {
            var result = NodeApiClient.SendTransaction(new Transaction()
            {
                Amount    = (int)amountTxt.Value,
                Sender    = senderTxt.Text,
                Recipient = receiverTxt.Text
            });

            MessageBox.Show(result);
        }
Example #5
0
        private void loadChainBtn_Click(object sender, EventArgs e)
        {
            _data = NodeApiClient.LoadBlockChain();
            blocksGrid.DataSource = _data.chain;

            //set autosize mode
            blocksGrid.Columns[0].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;
            blocksGrid.Columns[1].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;
            blocksGrid.Columns[2].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;
            blocksGrid.Columns[3].AutoSizeMode = DataGridViewAutoSizeColumnMode.ColumnHeader;
            blocksGrid.Columns[4].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;
            blocksGrid.Columns[5].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;
        }
Example #6
0
 private void MineANewBlock()
 {
     Log("Start mining a new Block");
     NodeApiClient.MineBlock();
 }
Example #7
0
        private void validateBtn_Click(object sender, EventArgs e)
        {
            var message = NodeApiClient.ValidateConsensus();

            MessageBox.Show(message);
        }