Beispiel #1
0
        static void Main(string[] args)
        {
            var miner  = new Miner();
            var wallet = new Wallet(miner);

            var satoshiddress = Criptografy.GenerateSHA256String("satoshi");
            var fabioAddress  = wallet.AddWalletAddress("fabio");
            var leneAddress   = wallet.AddWalletAddress("lene");

            //wallet.TransferValue(satoshiddress, 25, fabioAddress);
            miner.MinerTransactions();
            miner.MinerTransactions();

            Console.WriteLine(miner.Bitcoin.Chain.ToJson());
            Console.ReadKey();
        }
Beispiel #2
0
        public Miner(bool createNewBlockchain = true)
        {
            AddressMiner = Criptografy.GenerateSHA256String("satoshi");
            rewardMiner  = 50;

            if (createNewBlockchain)
            {
                Bitcoin = new Blockchain();
                UtxoSet = new List <Utxo>();
                MinerGenesisBlock();
            }
            else
            {
                //aqui deve constar código de sincronização com a rede
            }
        }