<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>leeduckgo</title>
        <link>https://paragraph.com/@leeduckgo</link>
        <description>undefined</description>
        <lastBuildDate>Thu, 28 May 2026 06:27:12 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>en</language>
        <image>
            <title>leeduckgo</title>
            <url>https://storage.googleapis.com/papyrus_images/164ce1fbffe669ae310dcfa6d16a3b786f508f554cbcfd8a41047b3329d3fd0d.png</url>
            <link>https://paragraph.com/@leeduckgo</link>
        </image>
        <copyright>All rights reserved</copyright>
        <item>
            <title><![CDATA[Get & Set Value 1.0 |  Web3.0 dApp Dev 0x04]]></title>
            <link>https://paragraph.com/@leeduckgo/get-set-value-1-0-web3-0-dapp-dev-0x04</link>
            <guid>Y1OhRwiYjywcgNeuAqQG</guid>
            <pubDate>Mon, 08 Nov 2021 00:27:13 GMT</pubDate>
            <description><![CDATA[History articles:Eth.build Quickstart | Web3.0 dApp Dev 0x01 Web3.0 dApp Developer Growth Path | Web3.0 dApp Dev 0x02 Scaffold-Eth Quickstart | Web3.0 dApp Dev 0x031 Run 1.0 version locallyLet&apos;s try to run version 1.0 locally. The 1.0 version don&apos;t need us to do much. We just need to clone the repo and start it.1.1 Download the code, switch branch and initialize the submodulesFirst fork ithttps://github.com/leeduckgo/set-purposeimage-20211002001028548Then clone it.image-202110020011...]]></description>
            <content:encoded><![CDATA[<p>History articles:</p><blockquote><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://mirror.xyz/0x769699506f972A992fc8950C766F0C7256Df601f/xcUOEKghOqaBJ3jDv7Spec__NjMChsey2y37yQkDoNM">Eth.build Quickstart | Web3.0 dApp Dev 0x01</a></p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://mirror.xyz/0x769699506f972A992fc8950C766F0C7256Df601f/CsT6Zya3ucWwSxz0kK8wTJfHMWua_nNZlnDbgT9Chrs">Web3.0 dApp Developer Growth Path | Web3.0 dApp Dev 0x02</a></p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://mirror.xyz/0x769699506f972A992fc8950C766F0C7256Df601f">Scaffold-Eth Quickstart | Web3.0 dApp Dev 0x03</a></p></blockquote><h2 id="h-1-run-10-version-locally" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">1 Run 1.0 version locally</h2><p>Let&apos;s try to run version 1.0 locally.</p><p>The 1.0 version don&apos;t need us to do much. We just need to clone the repo and start it.</p><h3 id="h-11-download-the-code-switch-branch-and-initialize-the-submodules" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">1.1 Download the code, switch branch and initialize the submodules</h3><p>First fork it</p><blockquote><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/leeduckgo/set-purpose">https://github.com/leeduckgo/set-purpose</a></p></blockquote><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">image-20211002001028548</figcaption></figure><p>Then clone it.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">image-20211002001126440</figcaption></figure><pre data-type="codeBlock" text="# clone Repo
git clone [forked repo]
# example: git clone https://github.com/WeLightProject/set-purpose.git
cd set-purpose
# Checkout another branch
git checkout feat/v0x01
# Initialized submodules
git submodule update --init packages/hardhat/contracts
"><code><span class="hljs-comment"># clone Repo</span>
git <span class="hljs-built_in">clone</span> [forked repo]
<span class="hljs-comment"># example: git clone https://github.com/WeLightProject/set-purpose.git</span>
<span class="hljs-built_in">cd</span> set-purpose
<span class="hljs-comment"># Checkout another branch</span>
git checkout feat/v0x01
<span class="hljs-comment"># Initialized submodules</span>
git submodule update --init packages/hardhat/contracts
</code></pre><h3 id="h-12-install-dependencies" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">1.2 Install dependencies</h3><pre data-type="codeBlock" text="yarn
"><code></code></pre><h3 id="h-13-start-local-test-network" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">1.3 Start local test network</h3><pre data-type="codeBlock" text="yarn chain
"><code></code></pre><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">[image-20211001211834038]</figcaption></figure><h3 id="h-14-deploy-the-contracts" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">1.4 Deploy the contracts!</h3><pre data-type="codeBlock" text="yarn deploy
"><code></code></pre><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">image-20211001220413508</figcaption></figure><h3 id="h-15-start-the-application-in-another-terminal" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">1.5 Start the application in another terminal</h3><pre data-type="codeBlock" text="yarn start
"><code>yarn <span class="hljs-keyword">start</span>
</code></pre><h3 id="h-16-open-in-the-browser" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">1.6 Open in the browser!</h3><p>Access the app:</p><blockquote><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="http://localhost:3000">http://localhost:3000</a></p></blockquote><p>Now you see your application.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">image-20211001220814439</figcaption></figure><h2 id="h-2-debunk-contract-source-code" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">2 Debunk contract source code</h2><pre data-type="codeBlock" text="pragma solidity &gt;=0.8.0 &lt;0.9.0; // Solidity version
//SPDX-License-Identifier: MIT

import &quot;hardhat/console.sol&quot;;
// The reason why we import console.sol : https://hardhat.org/tutorial/debugging-with-hardhat-network.html, simply that we can do console.log in our contract.
//import &quot;@openzeppelin/contracts/access/Ownable.sol&quot;; //https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol

contract PurposeHandler { // Name of contract

  //event SetPurpose(address sender, string purpose);

  string public purpose = &quot;Building Unstoppable Apps!!!&quot;; // define and assign a variable purpose. This variable is directly stored on the blockchain. That is the unique feature of solidity: Assign is storing.

  constructor() {
    // what should we do on deploy?
  }

  function setPurpose(string memory newPurpose) public {
          // A function that pass newPurpose as parameter
          // You can learn more about memory/storage:
          // https://learnblockchain.cn/2017/12/21/solidity_reftype_datalocation
      purpose = newPurpose; // Update purpose to be newPurpose
      console.log(msg.sender,&quot;set purpose to&quot;,purpose);
      //emit SetPurpose(msg.sender, purpose);
  }
}
"><code><span class="hljs-meta"><span class="hljs-keyword">pragma</span> <span class="hljs-keyword">solidity</span> >=0.8.0 &#x3C;0.9.0;</span> <span class="hljs-comment">// Solidity version</span>
<span class="hljs-comment">//SPDX-License-Identifier: MIT</span>

<span class="hljs-keyword">import</span> <span class="hljs-string">"hardhat/console.sol"</span>;
<span class="hljs-comment">// The reason why we import console.sol : https://hardhat.org/tutorial/debugging-with-hardhat-network.html, simply that we can do console.log in our contract.</span>
<span class="hljs-comment">//import "@openzeppelin/contracts/access/Ownable.sol"; //https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol</span>

<span class="hljs-class"><span class="hljs-keyword">contract</span> <span class="hljs-title">PurposeHandler</span> </span>{ <span class="hljs-comment">// Name of contract</span>

  <span class="hljs-comment">//event SetPurpose(address sender, string purpose);</span>

  <span class="hljs-keyword">string</span> <span class="hljs-keyword">public</span> purpose <span class="hljs-operator">=</span> <span class="hljs-string">"Building Unstoppable Apps!!!"</span>; <span class="hljs-comment">// define and assign a variable purpose. This variable is directly stored on the blockchain. That is the unique feature of solidity: Assign is storing.</span>

  <span class="hljs-function"><span class="hljs-keyword">constructor</span>(<span class="hljs-params"></span>) </span>{
    <span class="hljs-comment">// what should we do on deploy?</span>
  }

  <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">setPurpose</span>(<span class="hljs-params"><span class="hljs-keyword">string</span> <span class="hljs-keyword">memory</span> newPurpose</span>) <span class="hljs-title"><span class="hljs-keyword">public</span></span> </span>{
          <span class="hljs-comment">// A function that pass newPurpose as parameter</span>
          <span class="hljs-comment">// You can learn more about memory/storage:</span>
          <span class="hljs-comment">// https://learnblockchain.cn/2017/12/21/solidity_reftype_datalocation</span>
      purpose <span class="hljs-operator">=</span> newPurpose; <span class="hljs-comment">// Update purpose to be newPurpose</span>
      console.log(<span class="hljs-built_in">msg</span>.<span class="hljs-built_in">sender</span>,<span class="hljs-string">"set purpose to"</span>,purpose);
      <span class="hljs-comment">//emit SetPurpose(msg.sender, purpose);</span>
  }
}
</code></pre><h2 id="h-3-deploy-your-app-on-github-pages" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">3 Deploy your app on Github-pages</h2><p>Becuase our web3.0 app is a pure front end application, we don&apos;t need to purchase or rent a server. We can just deploy the app on GitHub.</p><h3 id="h-31-switch-network-to-test-network-in-react-app" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">3.1 Switch network to test network in React app</h3><p>Aha! Here is the first part that we need to change our code. Locate the following code at <code>packages/react-app/src/App.jsx</code>:</p><pre data-type="codeBlock" text="const targetNetwork = NETWORKS.localhost; // &lt;------- select your target frontend network (localhost, rinkeby, xdai, mainnet)
"><code>const targetNetwork <span class="hljs-operator">=</span> NETWORKS.localhost; <span class="hljs-comment">// &#x3C;------- select your target frontend network (localhost, rinkeby, xdai, mainnet)</span>
</code></pre><p>Switch <code>localhost</code> to the test network that we want to deploy, like <code>ropsten</code>.</p><pre data-type="codeBlock" text="const targetNetwork = NETWORKS.ropsten;
"><code>const <span class="hljs-attr">targetNetwork</span> = NETWORKS.ropsten<span class="hljs-comment">;</span>
</code></pre><p>Then we refresh the page, and we can see that it pops an alert to connect the test network.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">image-20211001232356720</figcaption></figure><p>Use metamask to connect the test network. Before that, we need some ETH to call the contract:</p><blockquote><p>Ropsten faucet: <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://faucet.ropsten.be/">https://faucet.ropsten.be/</a></p></blockquote><h3 id="h-32-switch-network-to-ropsten-network-in-hardhat" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">3.2 Switch network to Ropsten network in Hardhat</h3><p>This determines which network we are connecting in Hardhat.</p><p>Go to <code>packages/hardhat/hardhat.config.js</code>:</p><pre data-type="codeBlock" text="const defaultNetwork = &quot;localhost&quot;;
"><code>const <span class="hljs-attr">defaultNetwork</span> = <span class="hljs-string">"localhost"</span><span class="hljs-comment">;</span>
</code></pre><p>Change <code>localhost</code> to <code>ropsten</code>。</p><pre data-type="codeBlock" text="const defaultNetwork = &quot;ropsten&quot;;
"><code>const <span class="hljs-attr">defaultNetwork</span> = <span class="hljs-string">"ropsten"</span><span class="hljs-comment">;</span>
</code></pre><h3 id="h-33-redeploy-the-contract" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">3.3 Redeploy the contract</h3><p>Since we changed the network, we need to redeploy our contract</p><p>We need to generate a new address in hardhat:</p><pre data-type="codeBlock" text="yarn run generate
"><code>yarn run generate
</code></pre><blockquote><p>Tips No.1：</p><p>You can see all the commands in package.json!</p></blockquote><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">image-20211001234607175</figcaption></figure><blockquote><p>Tips No.2:</p><p>git basic commands:</p><pre data-type="codeBlock" text="git add . # add all changes
git commit -m &quot;[msg]&quot; # commit all changes
git push
"><code>git <span class="hljs-keyword">add</span> . # <span class="hljs-keyword">add</span> <span class="hljs-keyword">all</span> changes
git <span class="hljs-keyword">commit</span> <span class="hljs-operator">-</span>m "[msg]" # <span class="hljs-keyword">commit</span> <span class="hljs-keyword">all</span> changes
git push
</code></pre></blockquote><p>Well, now we have a new ETH address of <code>0x1c95a91e74872ead0a4c726712cfdfab3292f284</code>. We will use this address to deploy contracts.</p><p>Let&apos;s get some test ETH for the address:</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">image-20211001234619304</figcaption></figure><p>Then run <code>yarn deploy</code>:</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">image-20211001234758890</figcaption></figure><p>Oh, now our contract is on Ropsten test network!</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://ethereum.stackexchange.com/questions/65589/return-a-mapping-in-a-getall-function">https://ethereum.stackexchange.com/questions/65589/return-a-mapping-in-a-getall-function</a></p><p>We can find it on Etherscan:</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">image-20211001234830483</figcaption></figure><h3 id="h-33-generate-static-websites" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">3.3 Generate static websites</h3><p>First we need to have a new branch to host all the static websites:</p><pre data-type="codeBlock" text="git checkout -b gh-pages
"><code>git checkout <span class="hljs-operator">-</span>b gh<span class="hljs-operator">-</span>pages
</code></pre><p>The best practice is to put this branch in another folder, so that our changes to <code>gh-pages</code> won&apos;t affect other files:</p><pre data-type="codeBlock" text="git checkout feat/v0x01
git worktree add ../set_purpose_gh_pages gh-pages
"><code>git checkout feat<span class="hljs-operator">/</span>v0x01
git worktree add ../set_purpose_gh_pages gh<span class="hljs-operator">-</span>pages
</code></pre><p>Run the following commands, and static pages that can be hosted on Github-pages are generated:</p><pre data-type="codeBlock" text="yarn build
"><code></code></pre><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">image-20211002000250805</figcaption></figure><p>Websites are generated at <code>packages/react-app/build</code>, then we copy the folder&apos;s files to docs folder:</p><pre data-type="codeBlock" text="mkdir docs
cp -r packages/react-app/build/* ../set_purpose_gh_pages/docs
"><code><span class="hljs-built_in">mkdir</span> docs
<span class="hljs-built_in">cp</span> -r packages/react-app/build/* ../set_purpose_gh_pages/docs
</code></pre><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">image-20211002000605549</figcaption></figure><p>Delete the rest of the folders:</p><pre data-type="codeBlock" text="rm -rf packages package.json yarn.lock node_modules
"><code>rm <span class="hljs-operator">-</span>rf packages package.json yarn.lock node_modules
</code></pre><p>Everything look great! Let&apos;s push this branch:</p><pre data-type="codeBlock" text="g add .
g commit -m &quot;feat/init gh-pages&quot;
git push --set-upstream origin gh-pages
"><code>g add .
g commit <span class="hljs-operator">-</span>m <span class="hljs-string">"feat/init gh-pages"</span>
git push <span class="hljs-operator">-</span><span class="hljs-operator">-</span>set<span class="hljs-operator">-</span>upstream origin gh<span class="hljs-operator">-</span>pages
</code></pre><h3 id="h-34-github-pages-settings" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">3.4 Github-pages settings</h3><p>We still need to set something in the Github repo pages. We go to <code>Settings</code>&gt;<code>Pages</code> to set <strong>Branches</strong> and <strong>Folder</strong>.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">image-20211002002301741</figcaption></figure><p>Click the link in the green box. Now we see the first web3 Dapp we created!</p><blockquote><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://leeduckgo.github.io/set-purpose">https://leeduckgo.github.io/set-purpose</a></p></blockquote><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">image-20211002005210633</figcaption></figure><h2 id="h-tips-no3-git-submodule" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Tips No.3: Git Submodule</h2><p>Sometimes our repo may rely on other repos. Then we need to use Git Submodule.</p><p>Other than that, we need to split the chunks of code to make the project structure better.</p><p>For example, we split the code of set-purpose and set-purpose-contracts in this tutorial.</p><p>Here is the cheatsheet for commands of <code>git submodule</code>:</p><pre data-type="codeBlock" text="# browse the help
git submodule -h
# add submodule
git submodule add https://github.com/leeduckgo/set-purpose-contracts.git
# clone all the submodules of repo
git clone --recurse-submodules https://github.com/leeduckgo/set-purpose.git
# only update selected submodule
# --init is the parameter required for the first update. The following is the path of submodule.
git submodule update --init packages/hardhat/contracts
"><code># browse the help
git submodule <span class="hljs-operator">-</span>h
# add submodule
git submodule add https:<span class="hljs-comment">//github.com/leeduckgo/set-purpose-contracts.git</span>
# clone all the submodules of repo
git clone <span class="hljs-operator">-</span><span class="hljs-operator">-</span>recurse<span class="hljs-operator">-</span>submodules https:<span class="hljs-comment">//github.com/leeduckgo/set-purpose.git</span>
# only update selected submodule
# <span class="hljs-operator">-</span><span class="hljs-operator">-</span>init <span class="hljs-keyword">is</span> the parameter required <span class="hljs-keyword">for</span> the first update. The following <span class="hljs-keyword">is</span> the path of submodule.
git submodule update <span class="hljs-operator">-</span><span class="hljs-operator">-</span>init packages<span class="hljs-operator">/</span>hardhat<span class="hljs-operator">/</span>contracts
</code></pre><p><strong>Authors：</strong></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">leeduckgo</figcaption></figure><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">msfew</figcaption></figure>]]></content:encoded>
            <author>leeduckgo@newsletter.paragraph.com (leeduckgo)</author>
            <enclosure url="https://storage.googleapis.com/papyrus_images/9cb5da88fe2456a589702ed1286542b7de436f147792069c1b1bcd03a106a1a6.png" length="0" type="image/png"/>
        </item>
        <item>
            <title><![CDATA[Scaffold-Eth Quickstart | Web3.0 dApp Dev 0x03]]></title>
            <link>https://paragraph.com/@leeduckgo/scaffold-eth-quickstart-web3-0-dapp-dev-0x03</link>
            <guid>9uILPNk0b6SYlTNdGJG3</guid>
            <pubDate>Wed, 27 Oct 2021 15:08:21 GMT</pubDate>
            <description><![CDATA[IntroductionScaffold-eth is a template for Ethereum dApp, and a combination of the best dApps. Scaffold-eth can help developers build app with efficiency and less bugs. It is a great resource for beginner developers of web3.0 dApp. Scaffold-eth has the following components:hardhat: run local Ethereum network to deploy and test smart contractReact: build front end with preset UI components and functional hooksAnt: build customized UI and use Bootstrap or other libraries for front endSurge: dep...]]></description>
            <content:encoded><![CDATA[<h2 id="h-introduction" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Introduction</h2><p>Scaffold-eth is a template for Ethereum dApp, and a combination of the best dApps. Scaffold-eth can help developers build app with efficiency and less bugs. It is a great resource for beginner developers of web3.0 dApp.</p><p>Scaffold-eth has the following components:</p><ul><li><p><strong>hardhat:</strong> run local Ethereum network to deploy and test smart contract</p></li><li><p><strong>React:</strong> build front end with preset UI components and functional hooks</p></li><li><p><strong>Ant:</strong> build customized UI and use Bootstrap or other libraries for front end</p></li><li><p><strong>Surge:</strong> deploy and publish projects</p></li><li><p>Tenderly / The Graph / Etherscan / Infura / Blocknative...</p></li><li><p>Supports for L2 / Sidechains</p></li></ul><h2 id="h-swift-deployment" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Swift deployment</h2><h3 id="h-environment" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Environment</h3><p>Scafford Eth is based on Node.js, so you need to install <code>node.js</code> and <code>yarn</code>.</p><h3 id="h-deploy-scaffold-eth-scaffold" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Deploy Scaffold-eth scaffold</h3><ol><li><p>Fetch scaffold source code</p></li></ol><pre data-type="codeBlock" text="git clone https://github.com/austintgriffith/scaffold-eth.git
"><code>git <span class="hljs-built_in">clone</span> https://github.com/austintgriffith/scaffold-eth.git
</code></pre><ol><li><p>Open up 3 terminals</p></li></ol><blockquote><p><strong>TIPS:</strong> Many Terminal app supports split screen feature.</p></blockquote><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">image-20210924203810255</figcaption></figure><ol><li><p>run 👷‍ Hardhat chain in the first terminal:</p></li></ol><pre data-type="codeBlock" text="cd scaffold-eth
yarn install
yarn chain
"><code><span class="hljs-built_in">cd</span> scaffold-eth
yarn install
yarn chain
</code></pre><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/f6eae9718eab81eea5c457f85642d57fd575652db23aefd4e38d18439cb30b36.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><ol><li><p>deploy the smart contract at <code>/scaffold-eth/packages/hardhat/contracts/</code> in the second terminal:</p></li></ol><pre data-type="codeBlock" text="cd scaffold-eth
yarn deploy
"><code><span class="hljs-built_in">cd</span> scaffold-eth
yarn deploy
</code></pre><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/759ec29951be8d77a84ce3390379bce7fb728b7b5e859cbd1a7d6d262a1a90ee.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><ol><li><p>run front end app in the third terminal:</p></li></ol><pre data-type="codeBlock" text="cd scaffold-eth
yarn start
"><code><span class="hljs-built_in">cd</span> scaffold-eth
yarn start
</code></pre><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/bbc45e0eb0dd9a0731684089d5e306778789a7bf370cbc396c3ff97e3e2b461f.png" alt="" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>The sample contract under main branch stores and read the values. You can find the contract at <code>/scaffold-eth/packages/hardhat/contracts/</code> and modify it then redeploy.</p><blockquote><p><strong>TIPS：</strong></p><p>If you are interested in other contracts, you can checkout other branch to deploy different Dapp services. <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/scaffold-eth/scaffold-eth/branches/active">switchable branches with different contracts</a> for example nft contract branch <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/scaffold-eth/scaffold-eth/tree/simple-nft-example">https://github.com/scaffold-eth/scaffold-eth/tree/simple-nft-example</a></p></blockquote><h2 id="h-play-with-the-application" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">play with the application</h2><p>Back to the previous process. Now we have our contract deployed and front end and local chain network running.</p><p>Below is the code of the deployed contract.</p><pre data-type="codeBlock" text="pragma solidity &gt;=0.8.0 &lt;0.9.0;
//SPDX-License-Identifier: MIT

import &quot;hardhat/console.sol&quot;;
//import &quot;@openzeppelin/contracts/access/Ownable.sol&quot;; //https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol

contract YourContract {

  //event SetPurpose(address sender, string purpose);

  string public purpose = &quot;Building Unstoppable Apps!!!&quot;;

  constructor() {
    // what should we do on deploy?
  }

  // Storing purpose varible
  function setPurpose(string memory newPurpose) public {
      purpose = newPurpose;
      console.log(msg.sender,&quot;set purpose to&quot;,purpose);
      //emit SetPurpose(msg.sender, purpose);
  }
}
"><code><span class="hljs-meta"><span class="hljs-keyword">pragma</span> <span class="hljs-keyword">solidity</span> >=0.8.0 &#x3C;0.9.0;</span>
<span class="hljs-comment">//SPDX-License-Identifier: MIT</span>

<span class="hljs-keyword">import</span> <span class="hljs-string">"hardhat/console.sol"</span>;
<span class="hljs-comment">//import "@openzeppelin/contracts/access/Ownable.sol"; //https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol</span>

<span class="hljs-class"><span class="hljs-keyword">contract</span> <span class="hljs-title">YourContract</span> </span>{

  <span class="hljs-comment">//event SetPurpose(address sender, string purpose);</span>

  <span class="hljs-keyword">string</span> <span class="hljs-keyword">public</span> purpose <span class="hljs-operator">=</span> <span class="hljs-string">"Building Unstoppable Apps!!!"</span>;

  <span class="hljs-function"><span class="hljs-keyword">constructor</span>(<span class="hljs-params"></span>) </span>{
    <span class="hljs-comment">// what should we do on deploy?</span>
  }

  <span class="hljs-comment">// Storing purpose varible</span>
  <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">setPurpose</span>(<span class="hljs-params"><span class="hljs-keyword">string</span> <span class="hljs-keyword">memory</span> newPurpose</span>) <span class="hljs-title"><span class="hljs-keyword">public</span></span> </span>{
      purpose <span class="hljs-operator">=</span> newPurpose;
      console.log(<span class="hljs-built_in">msg</span>.<span class="hljs-built_in">sender</span>,<span class="hljs-string">"set purpose to"</span>,purpose);
      <span class="hljs-comment">//emit SetPurpose(msg.sender, purpose);</span>
  }
}
</code></pre><p>The contract sets a public string variable purpose. The default value for purpose is &quot;Building...&quot; It also provides a setPurpose method to modify the purpose variable.</p><h2 id="h-conclusion" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Conclusion</h2><p>We built our Dapp with the scaffold scaffold-eth. Using hardhat, we can deploy local test network, switch networks and deploy your contracts in any networks. Here is the Quickstart for scaffold-eth.</p><h2 id="h-about-authors" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">About authors</h2><p><strong>Author:</strong> Core member of Nonce Geek Studio.</p><p><strong>Contact the author:</strong></p><p>WeChat: thf056 QQ: 1290017556 Email: <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="mailto:1290017556@qq.com">1290017556@qq.com</a></p><blockquote><p>Github: <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/99kies">https://github.com/99kies</a></p><p>CSDN: <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://blog.csdn.net/qq_19381989">https://blog.csdn.net/qq_19381989</a></p></blockquote><p><strong>Translater：</strong></p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://noncegeek.com/namecards/msfew.svg?display=iframe">msfew</a></p>]]></content:encoded>
            <author>leeduckgo@newsletter.paragraph.com (leeduckgo)</author>
        </item>
        <item>
            <title><![CDATA[Web3.0 dApp Developer Growth Path | Web3.0 dApp Dev 0x02]]></title>
            <link>https://paragraph.com/@leeduckgo/web3-0-dapp-developer-growth-path-web3-0-dapp-dev-0x02</link>
            <guid>AJa1LoMidcOdazN4gguQ</guid>
            <pubDate>Fri, 22 Oct 2021 11:24:22 GMT</pubDate>
            <description><![CDATA[web3_growth_pathAuthors’ Information:leeduckgo xiaoyue]]></description>
            <content:encoded><![CDATA[<p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://noncegeek.com/imgs_in_mirror/web3_growth_path.svg?display=iframe&amp;height=800&amp;width=1000&amp;size=large">web3_growth_path</a></p><blockquote><p>Authors’ Information:</p></blockquote><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://noncegeek.com/namecards/leeduckgo.svg?display=iframe">leeduckgo</a></p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://noncegeek.com/namecards/xiaoyue.svg?display=iframe">xiaoyue</a></p>]]></content:encoded>
            <author>leeduckgo@newsletter.paragraph.com (leeduckgo)</author>
        </item>
        <item>
            <title><![CDATA[Eth.build Quickstart | Web3.0 dApp Dev 0x01]]></title>
            <link>https://paragraph.com/@leeduckgo/eth-build-quickstart-web3-0-dapp-dev-0x01</link>
            <guid>tiyDiBpUaXIdg6h6NpkA</guid>
            <pubDate>Tue, 19 Oct 2021 23:59:54 GMT</pubDate>
            <description><![CDATA[Eth.build OverviewEth.build is a educational Web3.0 sandbox with following features:No-code drag and drop programmingFully open-sourceVisualized workflow of EthereumOfficial website: https://eth.build/ Youtube playlist: https://www.youtube.com/playlist?list=PLJz1HruEnenCXH7KW7wBCEBnBLOVkiqIi Repository: https://github.com/austintgriffith/eth.buildEth.build QuickstartLoading tutorial examplesClick "learn more". You will see a lot of tutorial examples. You can click the button to load and watch...]]></description>
            <content:encoded><![CDATA[<h2 id="h-ethbuild-overview" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Eth.build Overview</h2><p>Eth.build is a educational Web3.0 sandbox with following features:</p><ul><li><p>No-code drag and drop programming</p></li><li><p>Fully open-source</p></li><li><p>Visualized workflow of Ethereum</p></li></ul><blockquote><p><strong>Official website:</strong></p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://eth.build/">https://eth.build/</a></p><p><strong>Youtube playlist:</strong></p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.youtube.com/playlist?list=PLJz1HruEnenCXH7KW7wBCEBnBLOVkiqIi">https://www.youtube.com/playlist?list=PLJz1HruEnenCXH7KW7wBCEBnBLOVkiqIi</a></p><p><strong>Repository:</strong></p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/austintgriffith/eth.build">https://github.com/austintgriffith/eth.build</a></p></blockquote><h2 id="h-ethbuild-quickstart" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Eth.build Quickstart</h2><h3 id="h-loading-tutorial-examples" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Loading tutorial examples</h3><p>Click &quot;learn more&quot;. You will see a lot of tutorial examples. You can click the button to load and watch the tutorial!</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">image-20210917102528583</figcaption></figure><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">image-20210917102633107</figcaption></figure><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">image-20210917102938705</figcaption></figure><h3 id="h-basic-practices-getting-the-balance-of-eth-address" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Basic practices: getting the balance of ETH address</h3><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">image-20210917104531017</figcaption></figure><p>This is a simple demo that realize the feature that get the balance of ETH address.</p><p>We can learn the usage of <code>eth.build</code> from this example.</p><h4 id="h-step-0x01-create-text-block" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0">STEP 0x01. Create Text Block</h4><p>Click <code>INPUT</code>&gt;<code>TEXT</code> to create a text input box. <code>INPUT</code> has a set of input box components.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">image-20210917104858238</figcaption></figure><h4 id="h-step-0x02-create-balance-block" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0">STEP 0x02. Create Balance Block</h4><p>Click <code>WEB3</code>&gt;<code>BALANCE</code> to create a balance box，<code>WEB3</code> is a series of realization of ETH <code>Web3</code> features, which is similar to the realizations in <code>ether.js</code>.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">image-20210917113330225</figcaption></figure><p>Looking at this block, you can see it is composed of three parts: <code>INPUTS</code>, hidden operation, and <code>OUTPUTS</code>. So, from computer&apos;s POV, these blocks can be viewed as a visualization of functions.</p><h4 id="h-step-0x03-link-text-and-balance" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0">STEP 0x03. Link Text and Balance</h4><p>We connect Text&apos;s output to Balance input, then they are linked.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">image-20210917113718107</figcaption></figure><h4 id="h-step-0x04-enter-an-address" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0">STEP 0x04. Enter an address!</h4><p>Copy and paste an address into <code>Text</code>. Oops! Our input of <code>Balance</code> becomes an integer.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">image-20210917113848959</figcaption></figure><h4 id="h-step-0x05-wei-to-eth" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0">STEP 0x05. Wei to ETH</h4><p>Well, that&apos;s an integer, cause the unit of the number is <code>wei</code>. We can convert the unit to <code>ETH</code>, so we need to add two more blocks.</p><p>&quot;<code>Utils</code>&gt;<code>From Wei</code>&quot; and &quot;<code>DISPLAY</code>&gt;<code>WATCH</code>&quot;. Utils is the set of universal components. DISPLAY is the set of output components.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">image-20210917114243087</figcaption></figure><h4 id="h-step-0x06-show-it-to-ur-friends" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0">STEP 0x06. Show it to ur FRIENDS！</h4><p>That&apos;s all! You finished your first <code>eth.build</code> project, and you can show off in front of all your friends!</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">image-20210917114533319</figcaption></figure><p><code>SAVE</code> &gt; <code>Share</code>, then you can get a link, send that link to your friend so that they can see the project:</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">image-20210917114727200</figcaption></figure><h4 id="h-step-0x07-download-your-project" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0">STEP 0x07. Download your project</h4><p>Maybe you want to save the project in your computer for later work.</p><p>Click &quot;<code>Save</code>&gt;<code>Download</code>&quot; and &quot;<code>Load</code>&gt;<code>Load From File</code>&quot;.</p><h3 id="h-more" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">More!</h3><blockquote><p>No-code Ethereum blockchain browser:</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://eth.build/build#3c50b1af5fd2956e808ac4d3132a9d063b8e2f9eac3b44d3971fe83165d5d0b8">https://eth.build/build#3c50b1af5fd2956e808ac4d3132a9d063b8e2f9eac3b44d3971fe83165d5d0b8</a></p></blockquote><p>From this example, we can see some advanced development of <code>eth.build</code>.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">image-20210917122822025</figcaption></figure><h4 id="h-0x01-modify-the-property" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0">0x01. Modify the property</h4><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">image-20210917122804436</figcaption></figure><p>By modifying the <code>Properties</code>, we can modify blocks such as <code>BUTTON</code>, <code>WATCH</code> and etc. That will be nicer and customized. For example, I will have <code>0x01</code> as the number of click events for the buttons.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">image-20210917122956248</figcaption></figure><h4 id="h-0x02-title-and-qr-code" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0">0x02. Title and QR code</h4><p>By clicking &quot;<code>DISPLAY</code>&gt;<code>TITLE</code>&quot;, we can add title to our project.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">image-20210917123424682</figcaption></figure><p>Apart from that, we can add our contact QR code to the project!</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">image-20210917123505349</figcaption></figure><p>Download QR code from your social media, then convert the QR code to <code>URL</code> by using tools like this(<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.patrick-wied.at/static/qrgen/">https://www.patrick-wied.at/static/qrgen/</a>), then paste the url into <code>Text</code>. That&apos;s it!</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">image-20210917123708696</figcaption></figure><p>Here is the QuickStart of <code>eth.build</code>. It has many more tricks to learn🤩！</p><blockquote><p>Authors’ Information:</p></blockquote><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://noncegeek.com/namecards/leeduckgo.svg?display=iframe">Leeduckgo</a></p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://noncegeek.com/namecards/msfew.svg?display=iframe">Msfew</a></p>]]></content:encoded>
            <author>leeduckgo@newsletter.paragraph.com (leeduckgo)</author>
            <enclosure url="https://storage.googleapis.com/papyrus_images/9cb5da88fe2456a589702ed1286542b7de436f147792069c1b1bcd03a106a1a6.png" length="0" type="image/png"/>
        </item>
        <item>
            <title><![CDATA[区块链与共识机制演变史 | 登链社区 | 深入浅出区块链技术]]></title>
            <link>https://paragraph.com/@leeduckgo/65RrROUD8hyGosBRnXHI</link>
            <guid>65RrROUD8hyGosBRnXHI</guid>
            <pubDate>Sun, 17 Oct 2021 08:49:28 GMT</pubDate>
            <description><![CDATA[维基百科这样定义区块链：区块链（英语：blockchain[1][2][3]或block chain[4][5]）是借由密码学[1][6]串接并保护内容的串连文字记录（又称区块）。 每一个区块包含了前一个区块的加密散列、相应时间戳记以及交易资料（通常用默克尔树（Merkle tree）算法计算的散列值表示）[7]，这样的设计使得区块内容具有难以篡改的特性。用区块链技术所串接的分布式账本能让两方有效记录交易，且可永久查验此交易。 ——维基百科词条：区块链这样的定义固然很正确，但是，一方面，这样的定义依然难以被普通人所理解；另一方面，我们也难以通过这个定义去理解「区块链技术为什么是赛博世界的重要基石」这个命题。 所以，我打算通过一个关于 「王国、国王与黑暗国王」 的寓言故事，来聊聊「到底什么是区块链」。寓言故事中的对应关系说明： 王国——系统 外界——用户 国王——节点程序（国王和臣民共同构成节点服务器） 臣民——计算资源 黑暗国王——恶意节点程序角色间关系简述：外界向国王发送请求，请求包含「存储」和「计算」两个部分。「存储」的例子：帮我存储一个数字/帮我读取一个你之前存储的数字。「...]]></description>
            <content:encoded><![CDATA[<p>维基百科这样定义区块链：</p><blockquote><p><strong>区块链</strong>（英语：blockchain<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://zh.wikipedia.org/wiki/%E5%8C%BA%E5%9D%97%E9%93%BE#cite_note-te20151031-1">[1]</a><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://zh.wikipedia.org/wiki/%E5%8C%BA%E5%9D%97%E9%93%BE#cite_note-fortune20160515-2">[2]</a><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://zh.wikipedia.org/wiki/%E5%8C%BA%E5%9D%97%E9%93%BE#cite_note-nyt20160521-3">[3]</a>或block chain<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://zh.wikipedia.org/wiki/%E5%8C%BA%E5%9D%97%E9%93%BE#cite_note-primer-4">[4]</a><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://zh.wikipedia.org/wiki/%E5%8C%BA%E5%9D%97%E9%93%BE#cite_note-obmh-5">[5]</a>）是借由<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://zh.wikipedia.org/wiki/%E5%AF%86%E7%A2%BC%E5%AD%B8">密码学</a><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://zh.wikipedia.org/wiki/%E5%8C%BA%E5%9D%97%E9%93%BE#cite_note-te20151031-1">[1]</a><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://zh.wikipedia.org/wiki/%E5%8C%BA%E5%9D%97%E9%93%BE#cite_note-cryptocurrencytech-6">[6]</a>串接并保护内容的串连文字<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://zh.wikipedia.org/wiki/%E8%AE%B0%E5%BD%95">记录</a>（又称区块）。</p><p>每一个区块包含了前一个区块的<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://zh.wikipedia.org/wiki/%E5%AF%86%E7%A2%BC%E9%9B%9C%E6%B9%8A%E5%87%BD%E6%95%B8">加密散列</a>、相应时间戳记以及交易资料（通常用<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://zh.wikipedia.org/wiki/%E5%93%88%E5%B8%8C%E6%A0%91">默克尔树</a>（Merkle tree）算法计算的散列值表示）<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://zh.wikipedia.org/wiki/%E5%8C%BA%E5%9D%97%E9%93%BE#cite_note-IPblockchain-7">[7]</a>，这样的设计使得区块内容具有难以篡改的特性。用区块链技术所串接的分布式账本能让两方有效记录交易，且可永久查验此交易。</p><p>——<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://zh.wikipedia.org/wiki/%E5%8C%BA%E5%9D%97%E9%93%BE">维基百科词条：区块链</a></p></blockquote><p>这样的定义固然很正确，但是，一方面，这样的定义依然难以被普通人所理解；另一方面，我们也难以通过这个定义去理解「区块链技术为什么是赛博世界的重要基石」这个命题。</p><p>所以，我打算通过一个关于 <strong>「王国、国王与黑暗国王」</strong> 的寓言故事，来聊聊「到底什么是区块链」。</p><blockquote><p>寓言故事中的对应关系说明：</p><p>王国——系统</p><p>外界——用户</p><p>国王——节点程序（国王和臣民共同构成节点服务器）</p><p>臣民——计算资源</p><p>黑暗国王——恶意节点程序</p></blockquote><p><strong>角色间关系简述：</strong></p><ul><li><p>外界向国王发送请求，请求包含「存储」和「计算」两个部分。</p><ul><li><p>「存储」的例子：帮我存储一个数字/帮我读取一个你之前存储的数字。</p></li><li><p>「计算」的例子：告诉我 5 + 1 等于几。</p></li></ul></li><li><p>国王将任务拆解，统筹臣民去完成任务。 例如外界给国王的请求是国王你帮我计算1*2*3*4*……*100，国王将任务拆解成很多小任务，臣民A负责计算1*2、臣民B负责计算3*4…… 暗黑国王可能会实施多种破坏行为，如拦截国王的信使；如收到外界的请求后，故意给出错误的回答（外界问 5 + 1 等于几，故意回答等于 8）。</p></li></ul><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">角色关系图</figcaption></figure><h2 id="h-1" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">1 单体时代——独裁统治</h2><p>在很久很久以前，有一个王国，这个王国的国民秩序井然地从事着工作与生活，并向外界提供服务，这个王国仅有一个国王，国王负责给所有臣民下达指令，统筹完成一个个目标。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><p>一切看上去很Okay，直到有一天，国王吃了绿色的蘑菇，食物中毒了。国民失去了指挥，王国陷入瘫痪，提供给外界的服务中断。在上帝救活国王之前，整个国家是停止运作的。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><blockquote><p>在 1946 年，计算机最初诞生的时候，我们的计算机系统大部分为单体系统。单体系统的最大问题是只要因为各种原因出现单点故障，那么这个系统就会停止运行，直到程序员处理了问题为止。</p></blockquote><h2 id="h-2" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">2 分布式系统时代——共同决策</h2><p>为了解决这个问题，一个叫做 Lamport 的上帝发明了一种被称为 Paxos 的机制，让多个国王共同治理王国。</p><p>治理方式为：外界（用户）向身份为「提议人（Proposer）」的国王发出提案，例如提议调整税率。提议人国王将提案发送给其它的所有国王。其他的国王收到提案后，进行投票表决。多数一致的提案，则通过。因为所有国王都是可信的，所以臣民有疑问的时候，只要咨询任意状态正常的国王即可。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">分布式系统时代（正常）</figcaption></figure><p>这样的话，即使有一个或几个国王食物中毒，其他的国王依然能按照机制维持王国的运转，王国解决了单体时代存在的问题，迈入了被称为「分布式系统时代」的新时代。</p><p>但是，一些新的问题浮现了——</p><p><strong>黑暗国王问题：</strong></p><p>国王之中出现了「黑暗国王」（可能是原有的国王被邪恶势力劫持）。黑暗国王会恶意伪造信息，例如，即使判断提案合理，依然投出否决票。</p><p><strong>信使拦截问题：</strong></p><p>国王之间通过信使传递信息。即使没有「黑暗国王」，也可能出现信使被截杀，从而伪造信息的情况。</p><p>因此，制度需要进一步升级，可以在存在「黑暗国王」与「信使拦截」问题的情况下，也确保整个国家正常运行。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">分布式系统时代（异常）</figcaption></figure><blockquote><p><strong>专业术语版：</strong></p><p>1990年，Lamport 发表了一篇论文，提出了 Paxos 共识协议（Paxos Protocols），可以确保在分布式系统在<strong>存在非拜占庭错误</strong>的情况下，只有有超半数的节点正常运作，那么这个系统就能正常运作。</p><p>**非拜占庭错误：**出现故障( Crash Failures，即不响应）但不会伪造信息的情况称为「<strong>非拜占庭错误</strong>」( non-byzantine fault）或「<strong>故障错误</strong>」( Crash Fault）。</p><p><strong>拜占庭错误：伪造信息恶意响应的情况称为「拜占庭错误</strong>」( Byzantine Fault），对应节点为拜占庭节点。</p></blockquote><h2 id="h-3-20" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">3 分布式系统 2.0 时代——允许黑暗</h2><p>王国在进一步发展，上帝 Castro 和 Liskov 在 Paxos 机制的基础上，提出了新的机制，这种机制被称为 PBFT。这种机制依然是基于投票表决，但是和上一个时代的机制有如下差异：</p><ul><li><p>因为有「可能存在黑暗国王」这种前提假设，所以在投票过程中国王会相互通信。这样，假设有黑暗国王A，告诉国王B我同意提案α，但告诉国王C我不同意提案α。在上一个时代，这种行为无从被察觉。但是，现在在B和C收到了A的回答后，由于B和C会互相通信，那么他们核验之后，就会发现A给他们两个的回答不一致。</p></li><li><p>每个国王在收到 2/3*国王总数+1 个其它国王的相同的答复后，会告知提案请求人（Client）自己的答复。</p></li><li><p>当提案请求人接收到 1/3*国王总数+1 个相同的答复后，便确定自己的提案被正确处理了。</p></li></ul><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">分布式系统 2.0 时代（正常）</figcaption></figure><p>这种新的制度无疑是长足的进步，但是依然存在两方面的问题：</p><ol><li><p>国王间需要频繁通信，在国王很多的情况下效率急剧下降；</p></li><li><p>很难做到让国王随意地加入和退出。</p></li></ol><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure><blockquote><p><strong>专业术语版：</strong></p><p>1999年，Castro 和 Liskov 提出了 PBFT 实用拜占庭容错算法（Practical Byzantine Fault Tolerance Replication Algorithm），该算法可以容纳拜占庭错误和非拜占庭错误。在 PBFT 的假设中，恶意节点可能做出如下行为：</p><ul><li><p>可能做出随机的或错误的答复或请求；</p></li><li><p>可能延迟或拒绝应答；</p></li><li><p>可能通过拒绝服务攻击正常节点，使之不能正常提供服务。</p></li></ul><p>设总节点数为 N 个，在恶意节点 ＜ (N-1)/3 的情况下，PBFT 系统可以确保正常运算，不出现节点无法达成一致的问题，</p></blockquote><h2 id="h-4" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">4 区块链时代——自由世界</h2><p>最终，王国到达了「区块链时代」。一个叫 Satoshi 的上帝引入了一种新的机制，这种机制叫做基于工作量的证明（PoW：Proof Of Work）。然后，Satoshi 给这个王国设立了一个具体的目标——<strong>记账</strong>。</p><p>任何外界人人都可以到这个王国来开设自己的账户，他们所拥有的钱，以及他们的每一笔转账记录，都会被记录到同一个大账本上。国王们只有一个使命：<strong>维护账本的唯一性且无前后矛盾</strong>。</p><ul><li><p><strong>账本唯一</strong> —— 确保能存在一个账本被大家共同认可。</p></li><li><p><strong>无前后矛盾</strong> —— 不会有一笔钱花了两次，例如：小明不能拿五块钱买了冰棍，又拿同一笔钱买了辣条。</p></li></ul><p>需要注意的一点是，和传统的中心化的记账系统不同的是，国王无需关心用户的密码问题。通过被称为密码学的自然法则，国王可以在不知道用户密码的情况下，验证用户是不是花的自己的钱。</p><p>简单来说，他们是通过如下机制来达成他们的使命的：</p><ul><li><p>外界将他们的交易（交易举例：我要把10块钱转给小明）寄送给任意一个在线的国王。</p></li><li><p>收到交易的国王将这些交易寄送给其它的国王。</p></li></ul><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">区块链时代 (1)</figcaption></figure><ul><li><p>所有收到交易的国王要做出一道算术题，才可以将交易打包进一个区块里。区块是这个大账本中的基本单元，多笔交易包含在一个区块里。</p><p>这个算术题有两个特点：</p><p>1）算术题的难度是动态调整的，调整根据是最近2016个区块的叠加速度，如果过去区块叠加速度快了，那么就把算术题难度调大；如果过去区块叠加速度慢了，就把算术题难度调小。任意国王根据自己本地的账本就能计算出来。正是这个动态调整机制，确保了记账速度平均是 10 分钟出一个区块。也就是你发一笔交易，平均来说10分钟左右，你的交易会被记录到大账本里。</p><p>2）交易的「身份证号」和上一个区块的「身份证号」是这个算术题中的变量之一，这样确保没有人能「抢跑」，提前把算术题算好。</p><blockquote><p>**信息的「身份证号」：**通过一种被称为哈希的方法，任意信息都能生成一串固定长度的「身份证号」。一堆交易可以生成一个身份证号，一个区块也可以生成一个身份证号。每一块数据的身份证号都是独一无二的。如果别人同时给我们数据和身份证号，那么我们可以用数据算出身份证号，然后看下我们自己计算出的数据的身份证号和别人给的是否一样，从而判断数据是不是被篡改过。</p></blockquote></li><li><p>做出算术题的国王，把新的区块放到上一个区块的上面，也即给大账本添加了一些包含在区块中的新的交易，同时把新的区块寄送给其它国王。</p></li><li><p>其它国王收到区块后，验证区块的正确性——验证区块里面的交易是不是正确、算术题的答案是不是正确等等。如果验证通过，那么其它国王也会把这个区块放在他们本地的上一个区块上面。这时，他们再做算术题，就要依据新的区块的「身份证号」了。</p><blockquote><p>**区块链中的链式结构：**每一个区块中都包含了上一个区块的「身份证号」。</p><p>一方面，这种结构让我们可以从最后一个区块追溯到最开始的那个区块。</p><p>另一方面，这种结构也让过去的区块不能改动。因为一旦发生改动，这个区块的身份证号就变了，和已经保存在下一个区块里的这个块的身份证号就对不上了。</p></blockquote></li><li><p>在整个过程里，所有国王坚持一个原则：**始终把区块数量最多的账本视为唯一账本。**这样，一方面确保了有一个被所有国王都认同的唯一账本；另一方面，即使偶然出现了出现了两个具有相同区块数量的账本，那么就让各个国王在自己收到的账本上，继续叠加区块，那么最终一定会有一个账本「脱颖而出」，成为包含区块数量最多的账本。</p></li><li><p>做出算术题的国王是有奖励的。这个奖励作为一笔特殊的交易写在这个国王打包的区块里。这个交易的内容用大白话就是：「系统奖励给打包这个区块的国王 α N元」。国王们在最开始的时候已经商量好了，这个 N 每四年减半，所以，这个系统里的钱的总量是固定的。</p></li></ul><p>如果你是通过本文第一次接触区块链，那么上面的机制会有些复杂，<strong>可以先略过不看</strong>，仅领略这件事情达到的目标就行了，也就是——</p><p><strong>「实现了一个所有国王共同维护的大账本，记录所有用户的交易记录，这个大账本可以确保全世界只有唯一的一份」。</strong></p><p>在这个新的机制下，分布式系统 2.0 时代的问题被解决了。我们现在可以：</p><ol><li><p>**容纳无数个国王。**不管国王有多少个，1 个或 100000000 个，记账速度始终是平均 10 分钟一个块。</p></li><li><p>**国王可以随意上线或下线。**因为只要有 1 个国王能做出系统出的计算题，那么这个系统就能正常运行。</p></li></ol><blockquote><p><strong>专业术语版：</strong></p><p>中本聪（Satoshi Nakamoto）在 2008 年发布了题为《比特币：一种点对点式的电子现金系统》的论文，该论文中提出了一种和传统的 BFT 共识机制不同的思路，通过工作量证明（PoW），可以让系统在能容纳拜占庭错误与非拜占庭错误的前提下，将通信复杂度从 BFT系列共识算法 的<code>O(N^2)</code>降低到<code>O(N)</code>，确保无论节点有多少，全网打包出块的速度是平均 10 分钟一个块。</p><p>在该论文中，这种新的共识机制被用于一个被称之为「比特币」的分布式记账系统。记账系统中的货币被称之为比特币。同时，为了确保会有节点自愿加入系统，参与区块打包，该论文中还设计了货币发行机制兼出块奖励机制。</p><p>2009 年，比特币系统正式开始运行，这是历史上第一个区块链系统。</p></blockquote><h2 id="h-5" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">5 新区块链时代——群雄逐鹿</h2><p>在上一个时代，区块链这个概念正式登上了历史舞台。</p><p>但是，第一个区块链系统——比特币的目的非常纯粹，就是记账。此外，它还存在一个问题：因为国王们都在争做计算题，所以对计算资源与电力都会造成大量消耗。</p><p>因此，上帝们又有了新的想法：</p><p>1）区块链这种链式结构很好，我们不仅能用它来记账嘛，我们还可以用来做些别的什么，例如在交易里带上指令，在让所有的国王同时运行一个程序？——这个想法被付诸实践，也就成为了现在被人们所熟知的智能合约技术。</p><p>2）我们能不能在PBFT（分布式系统 2.0 时代）这类机制的基础上做改进，或者用另一种方式来确认哪个国王能出块？——这个想法被付诸实践，也就成为了现在五花八门的共识机制，除了 PoW、BFT 以外，还有 PoS（基于权益的证明）、PoC（基于容量的证明）等等等等。</p><p>3）系统中一定要有代币作为奖励吗？如果没有代币，只是做一个相较于传统的「分布式系统」具有更高自由度、开放度的「超级分布式系统」（我们依然称之为区块链），可以吗？——这个想法被付诸实践，也就成为了现在我国新基建的重要组成部分——「联盟链」。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">群雄逐鹿的新区块链时代</figcaption></figure><h2 id="h-6" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">6 总结</h2><p>笔者认为，放到分布式系统发展的整个历程中去看，我们会发现区块链实际上是计算机技术发展的必然产物，从而真正地理解「区块链是什么」这个命题。</p><p>而「区块链是什么」这个命题，正是「为什么我们需要区块链」、「区块链究竟有哪些落地应用」、「为什么我国将区块链视为新基建的重要组成部分」等等关于区块链的命题的基础与原点，就像是直角坐标系中的（0, 0）。</p><p>理解了原点，便可以说，我们已经迈入了「区块链世界」的大门，这个世界里有许多新的机会、可能与想象空间。</p><p>欢迎来到区块链世界：）。</p><blockquote><p><strong>本文作者：</strong> 李大狗</p><p><strong>简介：</strong> 李骜华（李大狗），上海对外经贸大学区块链技术与应用研究中心副主任，柏链教育CTO，首批FISCO BCOS（微众银行区块链框架）区块链认证讲师，Web3 dApp developer, 专注于区块链与函数式编程。</p><p><strong>个人二维码：</strong></p></blockquote><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="hide-figcaption"></figcaption></figure>]]></content:encoded>
            <author>leeduckgo@newsletter.paragraph.com (leeduckgo)</author>
            <enclosure url="https://storage.googleapis.com/papyrus_images/9cb5da88fe2456a589702ed1286542b7de436f147792069c1b1bcd03a106a1a6.png" length="0" type="image/png"/>
        </item>
        <item>
            <title><![CDATA[eth.build 快速上手 | Web3.0 dApp 开发（一）]]></title>
            <link>https://paragraph.com/@leeduckgo/eth-build-web3-0-dapp</link>
            <guid>YmDLw0ryXOV4TIrFi7pG</guid>
            <pubDate>Sun, 17 Oct 2021 08:24:51 GMT</pubDate>
            <description><![CDATA[Eth.build 是一个聚焦于 Web3.0 的教育型沙盒，具备如下特性——无代码拖拽式编程完全开源可视化地直观地理解以太坊的工作方式主页地址： https://eth.build/ Youtube 学习频道： https://www.youtube.com/playlist?list=PLJz1HruEnenCXH7KW7wBCEBnBLOVkiqIi Repo 地址： https://github.com/austintgriffith/eth.buildEth.build 极速上手加载现成的教学案例点击「learn more」，会弹出很多现成的教学案例，可点击按钮进行加载或查看教学视频！image-20210917102528583image-20210917102633107image-20210917102938705基础操作实践：以以太坊余额抓取为例image-20210917104531017这是一个简单的例子，实现了从以太坊抓取余额的功能。 我们可以通过这个例子来学习eth.build的使用。STEP 0x01. 创建 Text Block通过INPUT>TEX...]]></description>
            <content:encoded><![CDATA[<p>Eth.build 是一个聚焦于 Web3.0 的教育型沙盒，具备如下特性——</p><ul><li><p>无代码拖拽式编程</p></li><li><p>完全开源</p></li><li><p>可视化地直观地理解以太坊的工作方式</p></li></ul><blockquote><p><strong>主页地址：</strong></p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://eth.build/">https://eth.build/</a></p><p><strong>Youtube 学习频道：</strong></p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.youtube.com/playlist?list=PLJz1HruEnenCXH7KW7wBCEBnBLOVkiqIi">https://www.youtube.com/playlist?list=PLJz1HruEnenCXH7KW7wBCEBnBLOVkiqIi</a></p><p><strong>Repo 地址：</strong></p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/austintgriffith/eth.build">https://github.com/austintgriffith/eth.build</a></p></blockquote><h2 id="h-ethbuild" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Eth.build 极速上手</h2><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">加载现成的教学案例</h3><p>点击「learn more」，会弹出很多现成的教学案例，可点击按钮进行加载或查看教学视频！</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">image-20210917102528583</figcaption></figure><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">image-20210917102633107</figcaption></figure><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">image-20210917102938705</figcaption></figure><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">基础操作实践：以以太坊余额抓取为例</h3><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">image-20210917104531017</figcaption></figure><p>这是一个简单的例子，实现了从以太坊抓取余额的功能。</p><p>我们可以通过这个例子来学习<code>eth.build</code>的使用。</p><h4 id="h-step-0x01-text-block" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0">STEP 0x01. 创建 Text Block</h4><p>通过<code>INPUT</code>&gt;<code>TEXT</code>创建一个文本输入框。<code>INPUT</code>是输入组件的集合。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">image-20210917104858238</figcaption></figure><h4 id="h-step-0x02-balance-block" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0">STEP 0x02. 创建 Balance Block</h4><p>通过<code>WEB3</code>&gt;<code>BALANCE</code>创造一个余额查询块，<code>WEB3</code>是一系列以太坊<code>WEB3</code>功能的实现，和<code>ether.js</code>中的实现等价。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">image-20210917113330225</figcaption></figure><p>观察这个Block，会发现抽象来看它由三部分组成：输入<code>INPUTS</code>、处理（隐藏）和输出<code>OUTPUTS</code>，因此，这些 Blocks，从计算机的角度可以看做是函数<code>Functions</code>的可视化。</p><h4 id="h-step-0x03-text-balance" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0">STEP 0x03. 链接 Text 与 Balance</h4><p>我们将 Text 的输出连上 Balance 的输入，这两个 Block 就链接起来了。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">image-20210917113718107</figcaption></figure><h4 id="h-step-0x04" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0">STEP 0x04. 输入一个地址！</h4><p>随便找到一个地址，将其复制到<code>Text</code>中，我们会发现<code>Balance</code>的输入变成了数字。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">image-20210917113848959</figcaption></figure><h4 id="h-step-0x05-wei-to-eth" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0">STEP 0x05. Wei to ETH</h4><p>但这是一个整数，因为这个数字的单位是<code>wei</code>，我们可以将其转换为<code>ETH</code>，所以我们再添加两个Block——</p><p>「<code>Utils</code>&gt;<code>From Wei</code>」和「<code>DISPLAY</code>&gt;<code>WATCH</code>」。Utils 是通用组件的集合，DISPLAY 是输出组件的集合。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">image-20210917114243087</figcaption></figure><h4 id="h-step-0x06-show-it-to-ur-friends" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0">STEP 0x06. Show it to ur FRIENDS！</h4><p>好了，你已经完成了你的第一个<code>eth.build</code>作品，你可以把它 show 给你的朋友！</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">image-20210917114533319</figcaption></figure><p><code>SAVE</code> &gt; <code>Share</code>，你会获得一个网址，你可以把这个网址发给你的朋友，他打开就能见到你的作品：</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">image-20210917114727200</figcaption></figure><h4 id="h-step-0x07" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0">STEP 0x07. 本地保存</h4><p>也许你需要把它保存在本地，以便于之后的加载。</p><p>「<code>Save</code>&gt;<code>Download</code>」和「<code>Load</code>&gt;<code>Load From File</code>」可以满足你的需求。</p><h3 id="h-" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">进阶玩法</h3><blockquote><p>无代码以太坊区块链浏览器：</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://eth.build/build#3c50b1af5fd2956e808ac4d3132a9d063b8e2f9eac3b44d3971fe83165d5d0b8">https://eth.build/build#3c50b1af5fd2956e808ac4d3132a9d063b8e2f9eac3b44d3971fe83165d5d0b8</a></p></blockquote><p>这是一个无代码版本的以太坊区块链浏览器！</p><p>通过这个例子我们可以康康<code>eth.build</code>有哪些进阶玩法。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">image-20210917122822025</figcaption></figure><h4 id="h-0x01" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0">0x01. 修改属性值</h4><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">image-20210917122804436</figcaption></figure><p>通过<code>Properties</code>的修改，我们可以给<code>BUTTON</code>、<code>WATCH</code>等Block修改名称等属性值，这样就呈现更加友好。例如我会用<code>0x01</code>等标记上按钮的点击顺序。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">image-20210917122956248</figcaption></figure><h4 id="h-0x02" class="text-xl font-header !mt-6 !mb-3 first:!mt-0 first:!mb-0">0x02. 标题与个人二维码</h4><p>通过「<code>DISPLAY</code>&gt;<code>TITLE</code>」我们能给作品显眼地标记上自己的大名。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">image-20210917123424682</figcaption></figure><p>除此之外，我们还能通过<code>Text</code>和<code>QR</code>的组合在作品上加上个人二维码！</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">image-20210917123505349</figcaption></figure><p>从微信下载个人二维码后，通过草料二维码（<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://cli.im/deqr%EF%BC%89%E5%B0%86%E4%BA%8C%E7%BB%B4%E7%A0%81%E8%BD%AC%E6%8D%A2%E4%B8%BA%60URL%60%EF%BC%8C%E8%BE%93%E5%85%A5%60Text%60%E4%B8%AD%E5%8D%B3%E5%8F%AF">https://cli.im/deqr）将二维码转换为`URL`，输入`Text`中即可</a>。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><figcaption HTMLAttributes="[object Object]" class="">image-20210917123708696</figcaption></figure><p><code>eth.build</code>快速上手就到这里，这个「神器」还有很多玩法可以挖掘🤩。</p>]]></content:encoded>
            <author>leeduckgo@newsletter.paragraph.com (leeduckgo)</author>
        </item>
    </channel>
</rss>