Start with Solidity

Ethereum and Solidity环境配置

作者:孔令坤,转载请注明出处

由于Remix版本的更新,Metamask的更新已经Ethereum rinkeby network对Github账号申请eth的限制,我发现原来的配置教程其实并不太适用于当前的版本了,所以在这里我简单的介绍一下开发的一些基本配置。在接下来的配置内容中,我借鉴了许多来自IC3 Ethereum/Cornell Bootcamp的内容,主要对其中Github部分的内容做了更新。

Requirements:

Introduction of Things:

Ethereum

Ethereum is an open-source, public, blockchain-based distributed computing platform featuring smart contract (scripting) functionality.

Metamask

MetaMask is a bridge between Google Chrome and the Ethereum blockchain. It allows you to run Ethereum Dapps in your browser without running a full Ethereum node. MetaMask includes a secure identity vault, providing a user interface to manage your identities on different sites and sign blockchain transactions.

Solidity

Solidity is a programming language used to code smart contracts that are compatible with Ethereum. The documentation for Solidity is located here. We will be using Remix when developing our smart contracts. Remix is an online development environment that allows you to code, deploy, and test smart contracts on the public Ethereum networks and test Ethereum networks.

Rinkeby

Rinkeby is a public Ethereum test network that is used to deploy and test smart contracts for free. In order to receive Rinkeby ether coins, you will need to visit https://www.rinkeby.io/ once you have your Metamask client installed.

Start with Ethereum and Solidity:

a. Setting up Metamask

  1. Install the Metamask Chrome plugin.
  2. Open Metamask (there should be an orange fox icon in your browser toolbar).
  3. Click through the license agreements.
  4. Create a new “den” which will house your Ethereum account.
  5. COPY THE 12 WORDS SOMEWHERE SAFE.
  6. Click the network selection button on the top left part of the Metmask app. It should say “Ethereum Mainnet” or “Ropsten”. Change that to Rinkeby.
  7. Copy your Ethereum account address by clicking the “Copy” icon above the “Buy” and “Send” buttons. Mouse over the icons to reveal their label.

b. Get Rinkeby Testnet Ether

  1. Login into your Twitter account.
  2. Paste your Ethereum address you copied in step a.7 into the “What’s happening?” content boxs to make a new tweet. The Ethereum address should be a jumble of letters and numbers like this: 0x9bcd107A7De7C3cee1be15dFa06B5586672912e9
  3. Click “Tweet” to gennerate a new Tweet.
  4. Copy the URL of the Tweet. Click the button in the upper right of your tweet and select the option of “Copy link to Tweet”. The link should be similar to this:https://twitter.com/316980786Kong/status/946989538890588161
  5. Visit the Rinkeby website and click “Crypto Faucet”.
  6. Paste your Tweet URL in the box provided and click “Give me Ether - 3 ethers/8 hours”.
  7. A box should pop up with with your Twitter icon indicating that your request for testnet ether is being processed.
  8. Wait 10 seconds.
  9. Look at your Metamask client and verify that you received 3 Rinkeby testnet ether.

c. Writing your first smart contract.

  1. Go to the Learning Solidity Part 2: Commit-Reveal Voting.
  2. Walk through the blog and write your first smart contract.