예제 #1
0
        public void Genesis()
        {
            int            x = 0;
            String         userInput;
            SignedUpMiners Miners = new SignedUpMiners();

            webServiceController = new REST.ServiceController();
            webServiceController.StartWebService();

            ChainedBlocks = new Block[0];
            //This is where the blockChain starts (for now :-P)

            do
            {
                userInput = Console.ReadLine();
                if (userInput == "Save")
                {
                    ObjectSerializerBlockChain.WriteBlockChainToBlob(this);
                    ObjectSerializerBlockChain.ReadBlobToBlockChain(); //Just for testing

                    Console.WriteLine("BlockChain stored correctly");
                }
                else
                {
                    GenerateBlock();
                    Console.WriteLine("Current Block Height:" + GetHeight());
                }
            } while (x < 100);  //Never ending for now :-P
        }
예제 #2
0
 public void AddSignedUpMiner(SignedUpMiners _SignedUpMiner)
 {
     //First check whether the miner already exists (cheaters!), else signup
     if (!signedUpMiners.Contains(_SignedUpMiner))
     {
         signedUpMiners.Add(_SignedUpMiner);
     }
 }