Ethereum:   , -   
 


     -  - Ethereum    Solidity    Windows.          -    (DApps).  ,        -.               .









      (-)      .          .         .  ,    Ethereum      -.

 Ethereum      EVM (Ethereum Virtual Machine).           - Ethereum.    -    ,          (),   -.

,   EVM,  -.     -       Solidity.     Solidity    Java Script.       ,  Java Script, Java  ++,   Solidity     .

     -  - Ethereum    Solidity    Windows.          -    (DApps).  ,        -.

     .     ,     -.     .         -.

    -.

   1.    ()     -    Solidity.

   2.     -.

   3.       .

   4.   -.

   5.  -.

   6. ,    -.

     .

1.      .   . 3.5.1       .

2.        .

3.     ,   .       ,      .

4.       .

5.          . , [4].



  -       ().

1. Visual Studio Code        Solidity (https://code.visualstudio.com/ (https://code.visualstudio.com/)).

2. Node.js   JavaScript    (https://Node.js.org/ru/ (https://node.js.org/ru/)).

3.  Truffle (https://www.trufflesuite.com/truffle (https://www.trufflesuite.com/truffle)).

4.  Ganache (https://www.trufflesuite.com/ganache (https://www.trufflesuite.com/ganache)).

5.  MetaMask (https://MetaMask.io/ (https://metamask.io/)).

6. - MyEtherWallet (https://github.com/kvhnuke/etherwallet/releases (https://github.com/kvhnuke/etherwallet/releases)).

7.   - Geth (https://geth.ethereum.org/downloads/ (https://geth.ethereum.org/downloads/)).

         .

    ,    -    Solidity.    ,     -      (Dapp).

   ,   ,         ( ),         ,  Java, Java Script  ++.



.           ,      -   Ethereum    Windows.             Stepik  : https://stepik.org/54926 (https://stepik.org/54926).

           .      https://stepik.org/57910 (https://stepik.org/57910).

         Stepik   https://stepik.org/course/60331/syllabus?auth=registration (https://stepik.org/course/60331/syllabus?auth=registration).          ,           . ,         ,     -    (DApps)  - Ethereum    Windows.


,     -   Ethereum    Solidity.




  1.    ()     -    Solidity








            -   Ethereum.         - Solidity,       Visual Studio Code (VS Code).       Truffle,      -    Ethereum Ganache,         MetaMask  - MyEtherWallet.

    .           -   Truffle.




 1.  Visual Studio Code





  (IDE) Visual Studio Code        -.      ,     .

       VS Code.       Visual Studio Code,    https://code.visualstudio.com/ (https://code.visualstudio.com/).






. 1.1.1



      Windows    Download for Windows (. 1.1.1).

    ,      VS Code,     (. 1.1.2).






. 1.1.2



   .      (. 1.1.3).






. 1.1.3



        .       (. 1.1.4).






. 1.1.4



         ,   .    .        (. 1.1.5).






. 1.1.5



      .       (. 1.1.6).






. 1.1.6



     . 1.1.6    .   (. 1.1.7).






. 1.1.7



  ,   .      (. 1.1.8).






. 1.1.8



   Visual Studio Code   .  !    VS Code .        Solidity.




 2.   Visual Studio Code    Solidity





 VS Code     -,      .

 Visual Studio Code,            (. 1.2.1).






. 1.2.1



  VS Code,        EXTENSIONS: MARKETPLACE ( ),    (. 1.2.2).






. 1.2.2



    EXTENSIONS: MARKETPLACE   Solidity      Enter.       solidity Juan Blanco (   ).    Extension: solidity    Install (. 1.2.3).






. 1.2.3



  .     Extension: solidity     . 1.2.4.






. 1.2.4



      VS Code    Solidity      Node.js.  VS Code!




 3.   Node.js





    -    Solidity,   JavaScript.   Ethereum   JavaScript.     -  Solidity   () .       Node.js.

       https://Node.js.org/ru/ (https://node.js.org/ru/) (. 1.3.1).






. 1.3.1



  Node.js   10.16.3 LTS        12.11.1      .        .     (. 1.3.2).






. 1.3.2



   Next      (. 1.3.3).






. 1.3.3



  I agree the terms   Next.        (. 1.3.4).






. 1.3.4



   ,   Change.    Next.       (. 1.3.5).






. 1.3.5



        Next.     (. 1.3.6).






. 1.3.6



     Install.    .       (. 1.3.7).






. 1.3.7



    Node.js   Finish.




 4.  Node.js    Truffle





   .  VS Code   .                Visual Studio Code           (. 4.1).






. 1.4.1



   VS Code  .        . ,      .



.      VC Code    Windows PowerShell (,     VC Code   ).


        VS Code,   Terminal / New Terminal (. 1.4.2).






. 1.4.2



       VS Code.        EXPLORER,        (. 1.4.2).    VS Code     . 1.4.3.






. 1.4.3



    ,   ^      (. 1.4.3).  VS Code     . 1.4.4.






. 1.4.4



     VS Code.       npm   Enter (. 1.4.5).

  ,       npm,   . 1.4.5.






. 1.4.5



   Truffle. Truffle         -    Solidity.



. ,     Truffle    .      .     -     Truffle.


       npm install g truffle   Enter (. 1.4.6).

  ,      . 1.4.6.






. 1.4.6



     Node.js    Truffle     Solidity   .

    .     EXPLORER     VS Code    Open Folder (. 1.4.6).   Open Folder    .   MetaCoin,        (. 1.4.7).






. 1.4.7



            Truffle.        truffle unbox metacoin,   . 1.4.8,    Enter.     MetaCoin  VS Code     . 1.4.8.






. 4.8



      EXPLORER  (. 1.4.8).    MetaCoin,   contracts, migrations  test.   contracts   -.     sol.   migrations    -.     js.   test     -.     js  sol.      truffle-config.js,      -,       -,            .

      Node.js    MetaCoin.          truffle compile   Enter.  VS Code     . 1.4.9.






. 1.4.9



   ,    MetaCoin   EXPLORER   build.          contracts,    json.   ,        .    -   json    Node.js.

       Ganache.




 5.   Ganache





   - Ethereum  Ganache.        -.      .      ,    http://trufflesuite.com/ganache (http://trufflesuite.com/ganache) (. 1.5.1).






. 1.5.1



    Ganache  Windows     DOWNLOAD (WINDOWS) (. 1.5.1).      (. 1.5.2).






. 1.5.2



   (. 1.5.2).      .    ,      (. 1.5.3).






. 1.5.3



          .      CONTINUE (. 1.5.4).






. 1.5.4



    .     QUICKSTART.    .    NEW WORKSPACE,     .    ,    .       QUICKSTART (. 1.5.5).



.         QUICKSTART.             .     .   ,    .





. 1.5.5



   Ganache.    . ,    ,   ACCOUNTS.         100 ETH   (. 1.5.7).     .  ,    ADDRESS   ,                  (. 1.5.6).






. 1.5.6



                 ,  ,  ,   . . (. 1.5.7).






. 1.5.7



  .  BLOCKS    (. 1.5.8), . .      ,    .      -   .






. 1.5.8



   TRANSACTIONS.        .          ,     (. 1.5.9).






. 1.5.9



 CONTRACTS       -,     (. 1.5.10).        .






. 1.5.10



  EVENTS   ,     - (. 1.5.11).






. 1.5.11



  ,   LOGS.           -.    ,   CLEAR LOGS,       (. 1.5.12).






. 1.5.12



    ,      (. 1.5.12),      (. 1.5.13).






. 1.5.13



        Server.          Solidity  VS Code    -  Ganache.       HOSTNAME, PORT NUMBER  NETWORK ID (. 1.5.13).




 6.     VS Code   Ganache    





      ,     VS Code.   Ganache,    !  VS Code    EXPLORER     METACOIN   truffle-config.js,       (. 1.6.1).






. 1.6.1



 truffle-config.js      -.    ,         .    //,  .    .   //    812, 18, 19  21,   . 1.6.2.






. 1.6.2



  ,      host  port    HOSTNAME  PORT NUMBER    Ganache ( 5, . . 1.5.13).  network_id    * (),        NETWORK ID    Ganache, . . 5777.      ,     VS Code  File/Save (. 1.6.3).






. 1.6.3



           , . .    ,      .        Ganache   CONTRACTS.  ,       -.      LINK TRUFFLE PROJECTS    CONTRACTS (. 1.6.4).






. 1.6.4



        WORKSPACE (. 1.6.5).






. 1.6.5



   ADD PROJECT (. 1.6.5),        truffle-config.js   METACOIN     (. 1.6.6).



.     VS Code      / VS Code.





. 1.6.6



  Ganache     . 1.6.7.   TRUFFLE PROJECTS       MetaCoin (. 1.6.7).






. 1.6.7



     SAVE AND RESTART (. 1.6.7),       .    Ganache    CONTRACTS.      . 1.6.8.






. 1.6.8



,      .   CONTRACTS  -   : ConvertLib, MetaCoin  Migrations.     -   VS Code   EXPLORER (. 1.6.2).     ,   -   Not Deployed (. 1.6.8).

           -.              - truffle migrate.  VS Code     . 1.6.9.






. 1.6.9



  ,    -         .  ,     CONTRACTS ,   ,   , . .    DEPLOYED     (. 1.6.10).






. 1.6.10





.    CONTRACTS    DEPLOYED,    -,      .


   TRANSACTIONS,     ,     - (. 1.6.11).






. 1.6.11



  BLOCKS  ,             (. 1.6.12).






. 1.6.12



 ,   ACCOUNTS  ,        0,02 ETH     , . .     - (. 1.6.13).






. 1.6.13



      -   MetaCoin.        - TestMetaCoin.sol,    test  .        truffle test (. 1.6.14).






. 1.6.14



    - TestMetaCoin.sol,    EVENTS    (. 1.6.15).






. 1.6.15






 7.   MetaMask    





          MetaMask,           -.      -,    https://MetaMask.io/ (https://metamask.io/) (. 1.7.1).






. 1.7.1



        Chrome.     MetaMask    GET CHROME EXTENSION (. 1.7.1).      MetaMask,   - Chrome.    (. 1.7.2).



.    ,   Chrome,         ,    GET CHROME EXTENSION (. . 1.7.1)





. 1.7.2



       .     (. 1.7.3).






. 1.7.3



       MetaMask,       (. 1.7.4).



.               Chrome (. 1.7.4).





. 1.7.4



  ,            .    ,     (. 1.7.5).



.          Ethereum.       Ganache,        ,        .      MetaMask       .





. 1.7.5



         .     I agree (. 1.7.6).






. 1.7.6



      ,          (. 1.7.7).






. 1.7.7



        .               ,    .   ,       .        Ganache,    .     (. 1.7.8).






. 1.7.8



      Account 1 (. 1.7.9).  ,     0 ETH.         ,  ,       Ethereum.        ,    Ganache.         RPC (. 1.7.9).






. 1.7.9



        .         ,   MyNet.           RPC URL.          Ganache (. 1.7.10).






. 1.7.10



 (    ) (. 1.7.11).






. 1.7.11



     .                      (. 1.7.12).






. 7.12



     (. 1.7.13).






. 1.7.13



          .       Ganache       (. 1.7.10)     ACCOUNT INFORMATION      Private key (. 1.7.14),              :   MetaMask (. 1.7.13).






. 1.7.14



    MetaMask    (. 1.7.13). ,       .      Account 2.        MetaMask.        . 1.7.12.   Private key   ,  .          MetaMask       . 1.7.15.






. 1.7.15



   ,      . , Account 1,     Ethereum,   , Account 2  Account 3,    Ganache       100 ETH.    !



.     ,       100 ETH,   ,       .


    MetaMask     Ganache.    ,    10 ETH   Account 3   Account 2.         MetaMask (. 1.7.16).






. 1.7.16



   .      , ,  . 1.7.14.      ,         (. 1.7.17).






. 1.7.17



   ,   Account 2 (. 1.7.18).






. 1.7.18



    (. 1.7.19).     10 ETH       (  ,   ).   .






. 1.7.19



     (. 1.7.20).     ,    10 ETH   Account 3   Account 2.      0,000034 ETH.       (. 1.7.20).






. 1.7.20



    .      ,    ,    Account 2  110 ETH,    Account 3  89,999966 ETH (. 1.7.21).






. 1.7.21



   ,     .         10 ETH (. 1.7.22).






. 1.7.22






 8.  - MyEtherWallet





  ETH           MetaMask.      -   -   MyEtherWallet.      ETH,   ,   -.



.   MyEtherWallet    MetaMask,      .


  MyEtherWallet    https://github.com/kvhnuke/etherwallet/releases (https://github.com/kvhnuke/etherwallet/releases)     -  etherwallet-v.3.40.0.zip (   ) (. 1.8.1).






. 1.8.1



       .   MyEtherWallet      index.htm (. 1.8.2).






. 1.8.2



   -         -  (. 1.8.3).






. 1.8.3



    ,    X    .      .

     Ganache.         ,      ,       Add Custom Network / Node (. 1.8.4).






. 1.8.4



      Ganache         Ganache.    Ganache,       QUICKSTART.         RPC SERVER.      HTTP://127.0.0.1:7545.  ,     http://127.0.0.1 (http://127.0.0.1/),    7545 (. 1.8.5).






. 1.8.5





:     Ganache.        .


     MyEtherWallet.    Add Custom Network / Node (. 1.8.4)        - (. 1.8.6).






. 1.8.6



     : Node Name      (  MyNode), URL  http://127.0.0.1 (http://127.0.0.1/), Port  7545 (. 1.8.6).      Ganache (. 1.8.5).      Save & Use Custom Node.  MyEtherWallet     . 1.8.7.






. 1.8.7



  ,   ETH        Ganache.   MyEtherWallet   View Wallet Info (. 1.8.8).






. 1.8.8



  Ganache        (. 1.8.9).






. 1.8.9



   MyEtherWallet        View w / Address Only.   Your Address  ,    Ganache (. 1.8.9).






. 1.8.10



        View Balance (. 1.8.10).         Ganache,   ,     100 ETH (. 1.8.11).






. 1.8.11



,    MyEtherWallet   Ganache    .     MyEtherWallet   -.







       .         󻠖     -  - Ethereum.         -     Solidity.



.          Stepik   https://stepik.org/60331 (https://stepik.org/60331).          ,           . ,         ,     -    (DApps)  - Ethereum    Windows.





  2.     -








         - Solidity [8], [9],    ,      Solidity   -,        -.




 1.   Solidity  VS Code





           - Solidity.

   Solidity      -. -        ,  - ,     - Ethereum.

    -,      Truffle.       ,   ,    -.     MetaCoin,      .

 VS Code    MetaCoin.     VS Code   Explorer   Open Folder (. 2.1.1).






. 2.1.1



      (. 2.1.2).






. 2.1.2



  MetaCoin    .



.   VS Code      / VS Code.


   MetaCoin  VS Code     . 2.1.3.






. 2.1.3



  EXPLORER      MetaCoin.    .    : build, contracts, migrations  test.    .

    contracts.     ,        -.     sol.      MetaCoin       : ConvertLib.sol, MetaCoin.sol  Migrations.sol.     Migrations.sol (. 2.1.4).






. 2.1.4



      -    Ethereum.   Migrations.sol  .      .

    build.   build     json      json -.       .     -,    Ethereum,      ,    - (. 2.1.5).






. 2.1.5



 migrations  js- (   JavaScript).     -    Ethereum.     migrations    .      1_initial_migrations.js (. 2.1.6).






. 2.1.6



      Migration.json,     - .  js-      - (. 2.1.7).






. 2.1.7.





.    . 2.1.6      -.          js-   -.         .


,   test.   test  -    .   -      ,         .       -.         sol-  js-. -   sol     Solidity,     (. 2.1.8).






. 2.1.8



   js   ,      JavaScript.      -  Truffle (. 2.1.9).






. 2.1.9



                truffle-config.js  LICENSE.  truffle-config.js     .         Ethereum    ,  Ganache.  LICENSE          Truffle (. 2.1.10).






. 2.1.10





.         .placeholder.        Git.    .


        Solidity          -.  MetaCoin  ,     VS Code  File / Close Folder.




 2.    Solidity





      Solidity    Truffle.      ,     .        / VS Code.     SimpleContracts,      -.     (. 2.2.1).






. 2.2.1



   SimpleContracts,    MetaCoin   .  ,    (. 2.2.2).






. 2.2.2



,   Truffle,         Solidity.  ,      Terminal / New Terminal.         truffle init   Enter (. 2.2.3).






. 2.2.3



     . 2.2.4.






. 2.2.4



  EXPLORER         (. 2.2.5).






. 2.2.5



   ,        : Migrations.sol, 1_initial_migration.js  truffle-config.js.  Migrations.sol, 1_initial_migration.js  ,     .  truffle-config.js      -.      ,  ,   -.

 test .            -.      .

 ,          build.    .        - .     - Migrations.sol.    -       truffle compile (. 2.2.6).






. 2.2.6



     . 2.2.7.






. 2.2.7



     truffle compile   EXPLORER   build    Migrations.json (. 2.2.8).






. 2.2.8



    ,       - Solidity.        -   Solidity.




 3.    - Hello World





     -,       .

   - HelloWorld     truffle create contract HelloWorld   Enter (. 2.3.1).






. 2.3.1



         - HelloWorld.sol.    .  -,      EXPLORER.  VS Code     . 2.3.2.






. 2.3.2



      -.    .



.   Solidity       ,  JavaScript  Java.       ,       -.


      -?   pragma solidity ^0.5.0;     Solidity,   .      0.5.0.     Solidity  ,          .

    contract HelloWorld {    - HelloWorld (. 2.3.3).



.  {    ,   }   7    ,      - HelloWorld.   Solidity    ,      .    4  6       .





. 2.3.3



 -   sayHello.    function sayHello() public pure returns (string memory).

 function      :

 sayHello()   ,      ,      ().      ;

 public     , ,           -;

 pure  ,     -   ;

 returns (string memory)  ,      (HelloWorld   string).     ,    ,    memory.

  ,     sayHello.       return Hello World!!!;.  return    .      Hello World!!!.    .   Solidity     ; (. 2.3.3).



.    ,   - Solidity        JavaScript  Java.


    -.  ,         (. 2.3.3).    ,         .         truffle compile (. 2.3.4).






. 2.3.4



    ,    EXPLORER   build   - HelloWorld.json (. 2.3.5).






. 2.3.5



         -        .




 4.  - HelloWorld   - Ganache





      - MetaCoin   - Ganache.  - MetaCoin   ,       truffle      js-   (   ).

    SimpleContracts - HelloWorld             js-   .       js- 1_initial_migration.js,   - Migrations.sol,     .   1_initial_migration.js   (. 2.4.1).






. 2.4.1



  1_initial_migration.js   EXPLORER,     (. 2.4.1).     const Migrations = artifacts.require(Migrations);  ,    -.    .       Migrations (  ),   - Migrations,    sol (  ).   ,   ,  module.exports = function(deployer) {.      ,    };  5.     deployer.deploy(Migrations);.      Migrations     - Migrations.sol.

 js-    -.     js-,    1_initial_migration.js.      1_initial_migration.js         Copy (. 2.4.2).






. 2.4.2



    migrations         Paste (. 2.4.3).






. 2.4.3



  migrations   1_initial_migration copy.js (. 2.4.4).






. 2.4.4



    js-   2_HelloWorld_migration.js. ,  js-   -    .             Rename (. 2.4.5).






. 2.4.5



   2_HelloWorld_migration    Enter.  migrations     . 2.4.6.






. 2.4.6



 js-,   .      js- 1_initial_migration.js.   Migrations  HelloWorld (    ).   2_HelloWorld_migration.js    . 2.4.7.






. 2.4.7



  2_HelloWorld_migration.js    - Ganache.   Ganache   QUICKSTART.




  .


   .

   ,     (https://www.litres.ru/pages/biblio_book/?art=61906766)  .

      Visa, MasterCard, Maestro,    ,   ,     ,  PayPal, WebMoney, ., QIWI ,       .


