<?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>youlaiwuqu空间</title>
        <link>https://paragraph.com/@youlaiwuqu</link>
        <description>undefined</description>
        <lastBuildDate>Mon, 20 Jul 2026 00:05:31 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>en</language>
        <image>
            <title>youlaiwuqu空间</title>
            <url>https://storage.googleapis.com/papyrus_images/dd8546a77976e6ea961e45115cea55085788a4d37d4954bce2852e5fe0c011a7.png</url>
            <link>https://paragraph.com/@youlaiwuqu</link>
        </image>
        <copyright>All rights reserved</copyright>
        <item>
            <title><![CDATA[Alchemy第五周 创建动态NFT]]></title>
            <link>https://paragraph.com/@youlaiwuqu/alchemy-nft</link>
            <guid>XjwF870g2x9jvrgeqh25</guid>
            <pubDate>Sun, 11 Sep 2022 16:24:08 GMT</pubDate>
            <description><![CDATA[准备工作本次操作都在Rinkeby测试网络完成，所以先把metamask切换到以太坊的Rinkeby测试网。然后进入 https://faucets.chain.link/ 连接你的钱包，点击Send Request获取测试以太坊和link 代币。获取测试代币结束以后，进入 https://vrf.chain.link/rinkeby 连接你的钱包，点击Create Subscription，来获取一个Link 预言机的订阅，订阅需要消耗少量gas费。订阅成功以后，可以回到主页 https://vrf.chain.link/ ，可以看到自己的订阅，记住这个ID号，后面会用到。然后点击ID号进入，点击Add Funds添加一些LInk来给随机数预言机一些link，后面每次调用都需要消耗这边的link。然后点击Confirm来确认。初始化项目进入 https://remix.ethereum.org/ 新建工作区name随意然后把Contracts和Test文件夹里的文件全部删除 然后在Contracts下面新建文件，名字为 bull&bear（也可以是别的），注意名字最好和work...]]></description>
            <content:encoded><![CDATA[<h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">准备工作</h2><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/0c1d64d453e484bac1d1a691e295f63096f775ad6120164bfd69698309cac9aa.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>本次操作都在Rinkeby测试网络完成，所以先把metamask切换到以太坊的Rinkeby测试网。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/9c52ad4a3e71ca0d9388332f300817e21a37eb97d8921d941f36d70cb1ce388a.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>然后进入 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://faucets.chain.link/">https://faucets.chain.link/</a> 连接你的钱包，点击Send Request获取测试以太坊和link 代币。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/de5bf5fcffefd3748e96260631ec0273cd46d0f69ba35dc409a766b3421ce388.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><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/c9747f69427ee07f90227249eb43d808e4d4102da34dfd92f105018512ee2915.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>获取测试代币结束以后，进入 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://vrf.chain.link/rinkeby">https://vrf.chain.link/rinkeby</a> 连接你的钱包，点击Create Subscription，来获取一个Link 预言机的订阅，订阅需要消耗少量gas费。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/7b962b910c6b362dc9bfebb018a96559c30cb084cc3c1dd6705663fe662100d7.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>订阅成功以后，可以回到主页 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://vrf.chain.link/">https://vrf.chain.link/</a> ，可以看到自己的订阅，记住这个ID号，后面会用到。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/33969ed90d51334a1b5fa93a730616afb4503e4c86a03866117c6f9e675bbd3c.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><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/c4a681478af5d561b4848a52710a58b24ae132e8170c96d5c1efc711f4870409.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>然后点击ID号进入，点击Add Funds添加一些LInk来给随机数预言机一些link，后面每次调用都需要消耗这边的link。然后点击Confirm来确认。</p><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">初始化项目</h2><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/cc86e210bda3b8442576b0e471885de500960cdd224e899e0ab63523ef1648f3.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>进入 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://remix.ethereum.org/">https://remix.ethereum.org/</a> 新建工作区name随意</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/829f125994a78b03824d64bc4c728f1ed4c66f623ff2d453baa6ed68231f71b6.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>然后把Contracts和Test文件夹里的文件全部删除</p><p>然后在Contracts下面新建文件，名字为 bull&amp;bear（也可以是别的），注意名字最好和workspaces不一样，不然可能冲突，然后贴入下面的代码</p><p><code>// SPDX-License-Identifier: GPL-3.0</code></p><p><code>pragma solidity ^0.8.4;</code></p><p><code>import &quot;@openzeppelin/contracts/token/ERC721/ERC721.sol&quot;;</code></p><p><code>import &quot;@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol&quot;;</code></p><p><code>import &quot;@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol&quot;;</code></p><p><code>import &quot;@openzeppelin/contracts/access/Ownable.sol&quot;;</code></p><p><code>import &quot;@openzeppelin/contracts/utils/Counters.sol&quot;;</code></p><p><code>import &quot;@openzeppelin/contracts/utils/Strings.sol&quot;;</code></p><p><code>// Chainlink Imports</code></p><p><code>import &quot;@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol&quot;;</code></p><p><code>// This import includes functions from both ./KeeperBase.sol and</code></p><p><code>// ./interfaces/KeeperCompatibleInterface.sol</code></p><p><code>import &quot;@chainlink/contracts/src/v0.8/KeeperCompatible.sol&quot;;</code></p><p><code>import &quot;@chainlink/contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol&quot;;</code></p><p><code>import &quot;@chainlink/contracts/src/v0.8/VRFConsumerBaseV2.sol&quot;;</code></p><p><code>// Dev imports. This only works on a local dev network</code></p><p><code>// and will not work on any test or main livenets.</code></p><p><code>import &quot;hardhat/console.sol&quot;;</code></p><p><code>contract BullBear is ERC721, ERC721Enumerable, ERC721URIStorage, Ownable, VRFConsumerBaseV2, KeeperCompatibleInterface {</code></p><p><code>using Counters for Counters.Counter;</code></p><p><code>Counters.Counter private _tokenIdCounter;</code></p><p><code>uint public interval;</code></p><p><code>uint public lastTimeStamp;</code></p><p><code>AggregatorV3Interface public priceFeed;</code></p><p><code>int256 public currentPrice;</code></p><p><code>// IPFS URIs for the dynamic nft graphics/metadata.</code></p><p><code>// NOTE: These connect to my IPFS Companion node.</code></p><p><code>// You should upload the contents of the /ipfs folder to your own node for development.</code></p><p><code>string[] bullUrisIpfs = [</code></p><p><code>&quot;https://ipfs.io/ipfs/QmRXyfi3oNZCubDxiVFre3kLZ8XeGt6pQsnAQRZ7akhSNs?filename=gamer_bull.json&quot;,</code></p><p><code>&quot;https://ipfs.io/ipfs/QmRJVFeMrtYS2CUVUM2cHJpBV5aX2xurpnsfZxLTTQbiD3?filename=party_bull.json&quot;,</code></p><p><code>&quot;https://ipfs.io/ipfs/QmdcURmN1kEEtKgnbkVJJ8hrmsSWHpZvLkRgsKKoiWvW9g?filename=simple_bull.json&quot;</code></p><p><code>];</code></p><p><code>string[] bearUrisIpfs = [</code></p><p><code>&quot;https://ipfs.io/ipfs/Qmdx9Hx7FCDZGExyjLR6vYcnutUR8KhBZBnZfAPHiUommN?filename=beanie_bear.json&quot;,</code></p><p><code>&quot;https://ipfs.io/ipfs/QmTVLyTSuiKGUEmb88BgXG3qNC8YgpHZiFbjHrXKH3QHEu?filename=coolio_bear.json&quot;,</code></p><p><code>&quot;https://ipfs.io/ipfs/QmbKhBXVWmwrYsTPFYfroR2N7NAekAMxHUVg2CWks7i9qj?filename=simple_bear.json&quot;</code></p><p><code>];</code></p><p><code>// random</code></p><p><code>VRFCoordinatorV2Interface COORDINATOR;</code></p><p><code>// Your subscription ID.</code></p><p><code>uint64 s_subscriptionId;</code></p><p><code>// Goerli coordinator. For other networks,</code></p><p><code>// see https://docs.chain.link/docs/vrf-contracts/#configurations</code></p><p><code>address vrfCoordinator = 0x6168499c0cFfCaCD319c818142124B7A15E857ab;</code></p><p><code>// The gas lane to use, which specifies the maximum gas price to bump to.</code></p><p><code>// For a list of available gas lanes on each network,</code></p><p><code>// see https://docs.chain.link/docs/vrf-contracts/#configurations</code></p><p><code>bytes32 keyHash = 0xd89b2bf150e3b9e13446986e571fb9cab24b13cea0a43ea20a6049a85cc807cc;</code></p><p><code>// Depends on the number of requested values that you want sent to the</code></p><p><code>// fulfillRandomWords() function. Storing each word costs about 20,000 gas,</code></p><p><code>// so 100,000 is a safe default for this example contract. Test and adjust</code></p><p><code>// this limit based on the network that you select, the size of the request,</code></p><p><code>// and the processing of the callback request in the fulfillRandomWords()</code></p><p><code>// function.</code></p><p><code>uint32 callbackGasLimit = 100000;</code></p><p><code>// The default is 3, but you can set this higher.</code></p><p><code>uint16 requestConfirmations = 3;</code></p><p><code>// For this example, retrieve 2 random values in one request.</code></p><p><code>// Cannot exceed VRFCoordinatorV2.MAX_NUM_WORDS.</code></p><p><code>uint32 numWords = 2;</code></p><p><code>uint256[] public s_randomWords;</code></p><p><code>uint256 public s_requestId;</code></p><p><code>event TokensUpdated(string marketTrend);</code></p><p><code>constructor(uint updateInterval, address _priceFeed, uint64 subscriptionId) ERC721(&quot;Bull&amp;Bear&quot;, &quot;BBTK&quot;) VRFConsumerBaseV2(vrfCoordinator) {</code></p><p><code>interval = updateInterval;</code></p><p><code>lastTimeStamp = block.timestamp;</code></p><p><code>// https://rinkeby.etherscan.io/address/0xECe365B379E1dD183B20fc5f022230C044d51404</code></p><p><code>priceFeed = AggregatorV3Interface(_priceFeed);</code></p><p><code>currentPrice = getLatestPrice();</code></p><p><code>COORDINATOR = VRFCoordinatorV2Interface(vrfCoordinator);</code></p><p><code>s_subscriptionId = subscriptionId;</code></p><p><code>}</code></p><p><code>function safeMint(address to) public {</code></p><p><code>// Current counter value will be the minted token&apos;s token ID.</code></p><p><code>uint256 tokenId = _tokenIdCounter.current();</code></p><p><code>// Increment it so next time it&apos;s correct when we call .current()</code></p><p><code>_tokenIdCounter.increment();</code></p><p><code>// Mint the token</code></p><p><code>_safeMint(to, tokenId);</code></p><p><code>// Default to a bull NFT</code></p><p><code>string memory defaultUri = bullUrisIpfs[s_randomWords[0]%3];</code></p><p><code>_setTokenURI(tokenId, defaultUri);</code></p><p><code>console.log(</code></p><p><code>&quot;DONE!!! minted token &quot;,</code></p><p><code>tokenId,</code></p><p><code>&quot; and assigned token url: &quot;,</code></p><p><code>defaultUri</code></p><p><code>);</code></p><p><code>}</code></p><p><code>function checkUpkeep(bytes calldata) external view override returns (bool upkeepNeeded, bytes memory /*performData*/){</code></p><p><code>upkeepNeeded = (block.timestamp - lastTimeStamp) &gt; interval;</code></p><p><code>}</code></p><p><code>function performUpkeep(bytes calldata) external override{</code></p><p><code>if((block.timestamp - lastTimeStamp) &gt; interval){</code></p><p><code>lastTimeStamp = block.timestamp;</code></p><p><code>int latestPrice = getLatestPrice();</code></p><p><code>if(latestPrice == currentPrice){</code></p><p><code>return;</code></p><p><code>}else if(latestPrice &lt; currentPrice){</code></p><p><code>updateAllTokenUris(&quot;bears&quot;);</code></p><p><code>}else{</code></p><p><code>updateAllTokenUris(&quot;bull&quot;);</code></p><p><code>}</code></p><p><code>currentPrice = latestPrice;</code></p><p><code>}</code></p><p><code>}</code></p><p><code>function getLatestPrice() public view returns(int256){</code></p><p><code>(,</code></p><p><code>int price,</code></p><p><code>,</code></p><p><code>,) = priceFeed.latestRoundData();</code></p><p><code>return price;</code></p><p><code>}</code></p><p><code>function updateAllTokenUris(string memory trend) internal{</code></p><p><code>if(compareStrings(&quot;bears&quot;, trend)){</code></p><p><code>for(uint i=0; i&lt; _tokenIdCounter.current(); i++){</code></p><p><code>_setTokenURI(i,bearUrisIpfs[s_randomWords[0]%3]);</code></p><p><code>}</code></p><p><code>}else {</code></p><p><code>for(uint i=0; i&lt; _tokenIdCounter.current(); i++){</code></p><p><code>_setTokenURI(i,bullUrisIpfs[s_randomWords[0]%3]);</code></p><p><code>}</code></p><p><code>}</code></p><p><code>emit TokensUpdated(trend);</code></p><p><code>}</code></p><p><code>function setInterval(uint256 newInterval) public onlyOwner{</code></p><p><code>interval = newInterval;</code></p><p><code>}</code></p><p><code>function setPriceFeed(address newFeed) public onlyOwner{</code></p><p><code>priceFeed = AggregatorV3Interface(newFeed);</code></p><p><code>}</code></p><p><code>function compareStrings(string memory a, string memory b) internal pure returns (bool){</code></p><p><code>return keccak256(abi.encodePacked(a)) == keccak256(abi.encodePacked(b));</code></p><p><code>}</code></p><p><code>// The following functions are overrides required by Solidity.</code></p><p><code>function _beforeTokenTransfer(</code></p><p><code>address from,</code></p><p><code>address to,</code></p><p><code>uint256 tokenId</code></p><p><code>) internal override(ERC721, ERC721Enumerable) {</code></p><p><code>super._beforeTokenTransfer(from, to, tokenId);</code></p><p><code>}</code></p><p><code>function _burn(uint256 tokenId)</code></p><p><code>internal</code></p><p><code>override(ERC721, ERC721URIStorage)</code></p><p><code>{</code></p><p><code>super._burn(tokenId);</code></p><p><code>}</code></p><p><code>function tokenURI(uint256 tokenId)</code></p><p><code>public</code></p><p><code>view</code></p><p><code>override(ERC721, ERC721URIStorage)</code></p><p><code>returns (string memory)</code></p><p><code>{</code></p><p><code>return super.tokenURI(tokenId);</code></p><p><code>}</code></p><p><code>function supportsInterface(bytes4 interfaceId)</code></p><p><code>public</code></p><p><code>view</code></p><p><code>override(ERC721, ERC721Enumerable)</code></p><p><code>returns (bool)</code></p><p><code>{</code></p><p><code>return super.supportsInterface(interfaceId);</code></p><p><code>}</code></p><p><code>// Assumes the subscription is funded sufficiently.</code></p><p><code>function requestRandomWords() external onlyOwner {</code></p><p><code>// Will revert if subscription is not set and funded.</code></p><p><code>s_requestId = COORDINATOR.requestRandomWords(</code></p><p><code>keyHash,</code></p><p><code>s_subscriptionId,</code></p><p><code>requestConfirmations,</code></p><p><code>callbackGasLimit,</code></p><p><code>numWords</code></p><p><code>);</code></p><p><code>}</code></p><p><code>function fulfillRandomWords(</code></p><p><code>uint256, /* requestId */</code></p><p><code>uint256[] memory randomWords</code></p><p><code>) internal override {</code></p><p><code>s_randomWords = randomWords;</code></p><p><code>}</code></p><p><code>}</code></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/b5793b89841e6c6562466da0c171d1b3397ea7e0610379582a1f69d45843910d.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>然后点击编译，编译完以后会有一个warning，可以忽略</p><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">部署合约</h2><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/c0f44bab3dbc76dd4935480ca592585f159f63459a0d96fd548bb029b480bf57.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>部署的参数 ENVIRONMENT 选择 Metamask，账号选择你Metamask里面有测试以太坊的账号，Contract选择我们写的 Bull&amp;Bear 合约</p><p>部署的参数UPDATEINTERVAL填写 10，_PRICEFEED 为 Link 上面测试BTC合约的预言机地址 0xECe365B379E1dD183B20fc5f022230C044d51404（合约地址来源<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.chain.link/docs/ethereum-addresses/">https://docs.chain.link/docs/ethereum-addresses/</a>），SUBSCRIPTIONID 为你自己申请的Link预言机订阅号。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/6c5f4da160f0ee287bed169bc2197c277a489eae082735107847cb1bbecf9ff6.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>部署成功以后，复制你的合约地址。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/c536dbdc17b12b9fc0b50f035fed3abd6e82ca97801be79ee0988a4c6b8ba509.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>然后进入第一部分的 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://vrf.chain.link/rinkeby/">https://vrf.chain.link/rinkeby/</a> ，把你的合约地址添加到Link预言机的订阅里，如果不添加，那么通过Link预言机获取随机数的方法就会执行失败。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/0c0ab93edb320f4e00a888fe66c59b956053f1f11fa0c80943f4b7e5002ddf9b.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>然后我们点击 requestRandomWords 方法来获取随机数，然后等Metamask确定交易完成。因为获取随机数然后赋值的时间会比较长，所以交易成功以后也大概需要等2分钟。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/92cb3bba1686298eefe65e4203cb6e0c70f7dfa84f26dbcd41573c54d17feb7d.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><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/d966b963ef6e1e76f33cb814344eb9cfb72b478b1af76a1bf915e82a321c58ed.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>然后我们在s_randomWords后面输入0（0是因为我们随机数获取了2个数字，我们这边取第一个数字），点开以后，点击call，我们会得到link预言机给的随机数，我们可以把这个随机数先记录好，等下次重新获取随机数以后对比一下。</p><p>然后我们重复上面的操作，点击requestRandomWords方法重新获取随机数。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/7fc98bdfeb02d6e84d2dd72e3a232e37baa3ba623badb15a835685288986bb23.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>等交易成功以后再继续等待2分钟左右，我们在s_randomWords后面输入0，再次获取数据，可以看到数字已经改变。随机数更新的速度会比较慢一点，着急的话可以待会再过来看。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/27d4a8fcde0c28c89b6ce22ca541314a5b364a96fcf003a5fa4a4771859976bb.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>然后我们在safemint里面填写自己的ETH地址，给自己mint一个NFT。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/6657e973c547ce8496576c1a443dd5cb4dac1d2c27532eabe6b0d7743ea9c4f2.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>等NFT mint成功以后，我们在tokenURI 这边输入0，点击call，来获取我们mint的NFT的元数据信息。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/37fc2e0ee1919cdd35d516e400e3549fa065b57a6ec5b6d2c705753697624c10.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><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/9a42950a62ef3eda4bac98c0b697c778e382bc9da33d73cdd394850e225d9a93.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>因为我们是通过获取的随机数来mint NFT的，所以这边大家的得到的filename=party_bull.json应该不一样。结果会是我们代码里写的三个数据filename=gamer_bull.json，filename=party_bull.json，filename=simple_bull.json这三个中的一个。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/4525699a80543d7e443ea0030054bc94d30d7311f1e39b39f7dcd0353da80b94.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>然后我们在setPriceFeed方法里输入Link预言机以太坊价格的合约地址 0x8A753747A1Fa494EC906cE90E9f37563A8AF630e，点击call来把原来的比特币价格的预言机改成以太坊的，因为测试版的预言机价格更新太慢，所以通过这样的取巧操作。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/51cff7b48a761b29ee9e94583256a4c3768a86f06f134d79323ab278e746840f.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><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/6393341d341c20de83d6d26be911a619390c7c9e17b754766a7619075efbfa92.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>价格更新以后，我们可以点击一下 getLatestPrice方法，可以看到int256后面就是最新的以太坊价格，其中前4位是个位数，后面8位为小数，这是因为以太坊不支持小数所以价格就不包含小数点。而点击currentPrice，价格还是之前btc的价格，因为这时候预言机还没有触发还没有更新价格。（测试网btc价格1天更新一次，eth1小时更新一次）</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/aad8b8452f99bec822d02168400ab97583d520e87f9a6f9c986314f3b9c717d1.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>然后我们在performUpkeep方法的参数里输入“[]”，点击call，手动来触发价格更新方法，这一步方法里也会更新我们的NFT元数据。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/3ccd84bea77c2ea2dee0cf0c632cddcddc340523df4f28261c33802e94671377.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><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/45d2cb5c344503e84cdc27e4ad603a03536229ba1bb89ffd1cbb55b5c092f213.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>然后你再点击获取Token Id 为0的NFT的元数据，可以看到元数据会变成这三个中的一个。因为我们预言机从btc的价格变到了ETH价格，我们代码里设置如果价格降低，元数据就是三个bear中的一个，反之如果预言机价格变高了，则是bull中的一个。</p><p>另外附上Link预言机BNB 价格合于地址 0xcf0f51ca2cDAecb464eeE4227f5295F2384F84ED，各位可以用这三个预言机合约多试几次，看看NFT的动态改变。</p><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">填表</h2><p>填表地址 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.google.com/forms/d/e/1FAIpQLSdNNLXMYZmIhjcWoT-UedS3AoGpRiPDRaNARUPGXLbX1TVvSg/viewform">https://docs.google.com/forms/d/e/1FAIpQLSdNNLXMYZmIhjcWoT-UedS3AoGpRiPDRaNARUPGXLbX1TVvSg/viewform</a></p><p>填表最后一个可以填你合约的部署地址 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://rinkeby.etherscan.io/address/%E4%BD%A0%E7%9A%84%E5%90%88%E7%BA%A6%E5%9C%B0%E5%9D%80">https://rinkeby.etherscan.io/address/你的合约地址</a></p><p>有兴趣的可以自己去 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://testnets.opensea.io/">https://testnets.opensea.io/</a> 看自己mint的nft，刷新几下元数据看看</p><p>NFT领取地址待更新</p>]]></content:encoded>
            <author>youlaiwuqu@newsletter.paragraph.com (youlaiwuqu空间)</author>
        </item>
        <item>
            <title><![CDATA[Alchemy第四周 创建NFT相册
官方资料 https://docs.alchemy.com/docs/how-to-create-an-nft-gallery]]></title>
            <link>https://paragraph.com/@youlaiwuqu/alchemy-nft-https-docs-alchemy-com-docs-how-to-create-an-nft-gallery</link>
            <guid>LQu7VsKPGJUUMmSGOBqp</guid>
            <pubDate>Sat, 10 Sep 2022 03:25:43 GMT</pubDate>
            <description><![CDATA[初始化项目进入https://replit.com/，如果没有账号，可以注册一个点击创建一个Node.js的项目 创建成功以后在shell里输入如下代码，其中jaygallery为你的项目名字，可以随意 npx create-next-app -e with-tailwindcss jaygallery输入成功以后，提示 &apos;Ok to processed&apos;，输入y下载项目所需的安装包并创建项目修改代码在你创建成功的项目下面，找到pages文件夹下的_app.tsx和index.tsx文件，修改后缀为.jsx 修改_app.jsx文件里的内容为 import &apos;../styles/globals.css&apos; function MyApp({ Component, pageProps }) { return <Component {...pageProps} /> } export default MyApp 修改index.jsx文件里的内容为 import { NFTCard } from "./nftCard" import { useSt...]]></description>
            <content:encoded><![CDATA[<h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">初始化项目</h2><p>进入<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://replit.com/">https://replit.com/</a>，如果没有账号，可以注册一个</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/d68f7293631db0efa248f12f67cf2db06d63b80060c96b5353c30ca673d5a5e8.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>点击创建一个Node.js的项目</p><p>创建成功以后在shell里输入如下代码，其中jaygallery为你的项目名字，可以随意</p><p>npx create-next-app -e with-tailwindcss jaygallery</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/95137c5ec868d29d65a506d03c66a2a9b29e63251316188454e3d1b8a06a4256.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>输入成功以后，提示 &apos;Ok to processed&apos;，输入y下载项目所需的安装包并创建项目</p><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">修改代码</h2><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/7c7a4cecb4d2a56605a6c094c6ea0b3be58911c435ac91e445b8d0ce86bba20f.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>在你创建成功的项目下面，找到pages文件夹下的_app.tsx和index.tsx文件，修改后缀为.jsx</p><p>修改_app.jsx文件里的内容为</p><p><code>import &apos;../styles/globals.css&apos;</code></p><p><code>function MyApp({ Component, pageProps }) {</code></p><p><code>return &lt;Component {...pageProps} /&gt;</code></p><p><code>}</code></p><p><code>export default MyApp</code></p><p>修改index.jsx文件里的内容为</p><p><code>import { NFTCard } from &quot;./nftCard&quot;</code></p><p><code>import { useState } from &apos;react&apos;</code></p><p><code>import Head from &apos;next/head&apos;</code></p><p><code>import Image from &apos;next/image&apos;</code></p><p><code>const Home = () =&gt; {</code></p><p><code>const [wallet, setWalletAddress] = useState(&quot;&quot;);</code></p><p><code>const [collection, setCollectionAddress] = useState(&quot;&quot;);</code></p><p><code>const [NFTs, setNFTs] = useState([])</code></p><p><code>const [fetchForCollection, setFetchForCollection]=useState(false)</code></p><p><code>const fetchNFTs = async() =&gt; {</code></p><p><code>let nfts;</code></p><p><code>console.log(&quot;fetching nfts&quot;);</code></p><p><code>const api_key = &quot;1111&quot;</code></p><p><code>const baseURL = `https://eth-mainnet.alchemyapi.io/v2/${api_key}/getNFTs/`;</code></p><p><code>var requestOptions = {</code></p><p><code>method: &apos;GET&apos;</code></p><p><code>};</code></p><p><code>if (!collection.length) {</code></p><p><code>const fetchURL = `${baseURL}?owner=${wallet}`;</code></p><p><code>nfts = await fetch(fetchURL, requestOptions).then(data =&gt; data.json())</code></p><p><code>} else {</code></p><p><code>console.log(&quot;fetching nfts for collection owned by address&quot;)</code></p><p><code>const fetchURL = `${baseURL}?owner=${wallet}&amp;contractAddresses%5B%5D=${collection}`;</code></p><p><code>nfts= await fetch(fetchURL, requestOptions).then(data =&gt; data.json())</code></p><p><code>}</code></p><p><code>if (nfts) {</code></p><p><code>console.log(&quot;nfts:&quot;, nfts)</code></p><p><code>setNFTs(nfts.ownedNfts)</code></p><p><code>}</code></p><p><code>}</code></p><p><code>const fetchNFTsForCollection = async () =&gt; {</code></p><p><code>if (collection.length) {</code></p><p><code>var requestOptions = {</code></p><p><code>method: &apos;GET&apos;</code></p><p><code>};</code></p><p><code>const api_key = &quot;1111&quot;</code></p><p><code>const baseURL = `https://eth-mainnet.alchemyapi.io/v2/${api_key}/getNFTsForCollection/`;</code></p><p><code>const fetchURL = `${baseURL}?contractAddress=${collection}&amp;withMetadata=${&quot;true&quot;}`;</code></p><p><code>const nfts = await fetch(fetchURL, requestOptions).then(data =&gt; data.json())</code></p><p><code>if (nfts) {</code></p><p><code>console.log(&quot;NFTs in collection:&quot;, nfts)</code></p><p><code>setNFTs(nfts.nfts)</code></p><p><code>}</code></p><p><code>}</code></p><p><code>}</code></p><p><code>return (</code></p><p><code>&lt;div className=&quot;flex flex-col items-center justify-center py-8 gap-y-3&quot;&gt;</code></p><p><code>&lt;div className=&quot;flex flex-col w-full justify-center items-center gap-y-2&quot;&gt;</code></p><p><code>&lt;input disabled={fetchForCollection} onChange={(e)=&gt;{setWalletAddress(e.target.value)}} value={wallet} type={&quot;text&quot;} placeholder=&quot;Add your wallet address&quot;&gt;&lt;/input&gt;</code></p><p><code>&lt;input type={&quot;text&quot;} onChange={(e)=&gt;{setCollectionAddress(e.target.value)}} value={collection} placeholder=&quot;Add the collection address&quot;&gt;&lt;/input&gt;</code></p><p><code>&lt;label className=&quot;text-gray-600 &quot;&gt;&lt;input onChange={(e)=&gt;{setFetchForCollection(e.target.checked)}} type={&quot;checkbox&quot;} className=&quot;mr-2&quot;&gt;&lt;/input&gt;Fetch for collection&lt;/label&gt;</code></p><p><code>&lt;button className={&quot;disabled:bg-slate-500 text-white bg-blue-400 px-4 py-2 mt-3 rounded-sm w-1/5&quot;} onClick={</code></p><p><code>() =&gt; {</code></p><p><code>if (fetchForCollection) {</code></p><p><code>fetchNFTsForCollection()</code></p><p><code>}else fetchNFTs()</code></p><p><code>}</code></p><p><code>}&gt;Let&apos;s go! &lt;/button&gt;</code></p><p><code>&lt;/div&gt;</code></p><p><code>&lt;div className=&apos;flex flex-wrap gap-y-12 mt-4 w-5/6 gap-x-2 justify-center&apos;&gt;</code></p><p><code>{</code></p><p><code>NFTs.length &amp;&amp; NFTs.map(nft =&gt; {</code></p><p><code>return (</code></p><p><code>&lt;NFTCard nft={nft}&gt;&lt;/NFTCard&gt;</code></p><p><code>)</code></p><p><code>})</code></p><p><code>}</code></p><p><code>&lt;/div&gt;</code></p><p><code>&lt;/div&gt;</code></p><p><code>)</code></p><p><code>}</code></p><p><code>export default Home</code></p><p>index.jsx里有两个地方有const api_key = &quot;1111&quot;，需要把这个api_key的值修改为你的alchemy账号的ETH主网的api key，具体如图所示</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/8e45848cac4e94253035fd41072358656dbdad7d534244e01f867cb3d3dc486c.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>在pages文件夹下新增nftCard.jsx文件，内容如下</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/fbca44a754d348a80c0ecc697afdd9c91a9db148c844e4068a468577bba1c331.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><code>export const NFTCard = ({ nft }) =&gt; {</code></p><p><code>return (</code></p><p><code>&lt;div className=&quot;w-1/4 flex flex-col &quot;&gt;</code></p><p><code>&lt;div className=&quot;rounded-md&quot;&gt;</code></p><p><code>&lt;img className=&quot;object-cover h-128 w-full rounded-t-md&quot; src={nft.media[0].gateway} &gt;&lt;/img&gt;</code></p><p><code>&lt;/div&gt;</code></p><p><code>&lt;div className=&quot;flex flex-col y-gap-2 px-2 py-3 bg-slate-100 rounded-b-md h-110 &quot;&gt;</code></p><p><code>&lt;div className=&quot;&quot;&gt;</code></p><p><code>&lt;h2 className=&quot;text-xl text-gray-800&quot;&gt;{nft.title}&lt;/h2&gt;</code></p><p><code>&lt;p className=&quot;text-gray-600&quot;&gt;Id: {nft.id.tokenId}&lt;/p&gt;</code></p><p><code>&lt;p className=&quot;text-gray-600&quot; &gt;{nft.contract.address}&lt;/p&gt;</code></p><p><code>&lt;/div&gt;</code></p><p><code>&lt;div className=&quot;flex-grow mt-2&quot;&gt;</code></p><p><code>&lt;p className=&quot;text-gray-600&quot;&gt;{nft.description}&lt;/p&gt;</code></p><p><code>&lt;/div&gt;</code></p><p><code>&lt;/div&gt;</code></p><p><code>&lt;/div&gt;</code></p><p><code>)</code></p><p><code>}</code></p><h2 id="h-" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">发布</h2><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/659df6ede75c7d892f9988cd121f41ad863f2cb7ead06e3bdd36e659c3de4825.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>因为我们的项目是在一个子文件夹下面的，所以我们需要修改启动首先显示隐藏文件</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/02847b23d3f973731cfd10f308b7ab51e0003cbfd6c29438da54109eb21d6f50.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>首先显示隐藏文件</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/82ba6b5084cdd53f7209230927b4c2cf684d1176f826bffc883eccedba0545db.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>然后我们打开.replit文件，删除原有内容，然后添加下面的两行内容，其中jaygallery为你创建项目的名称</p><p><code>run = &apos;npm --prefix ./jaygallery run dev&apos;</code></p><p><code>entrypoint = &apos;./jaygallery/pages/index.jsx&apos;</code></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/bdb5053134740dead63b724149946d772d26025ca92838c3032a47f4b1b58972.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>然后我们点击“Run” 按钮，最终出现如上界面就是项目编译成功</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/df1a89dfb7c088cd1f48a2675145aab39bfd1ae21c34350be670b7306340e4e2.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>然后你可以输入你的自己的以太坊地址或者ens域名来看一下效果</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/2a499df71c8f1ef6c2818df807688bf52c32236f4009f02baaa1ed4685f97edb.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>然后你可以点击publish来把项目发布出去</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/83500e19d25e59550e100e62a7cbfaf3916208086e6e6504cc71ad9a6bf9d447.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><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/e7ac9c8394a6af7b64df93400ab7861078b8ded054392d9bbc186d291d0a3480.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>点击链接，然后Open website，里面的链接就可以在填表的最后一步填写，最后填表地址如下</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://docs.google.com/forms/d/e/1FAIpQLSdNNLXMYZmIhjcWoT-UedS3AoGpRiPDRaNARUPGXLbX1TVvSg/viewform">https://docs.google.com/forms/d/e/1FAIpQLSdNNLXMYZmIhjcWoT-UedS3AoGpRiPDRaNARUPGXLbX1TVvSg/viewform</a></p><p>项目的UI会有点小问题，没时间仔细研究。</p><p>另外NFT领取地址待更新</p>]]></content:encoded>
            <author>youlaiwuqu@newsletter.paragraph.com (youlaiwuqu空间)</author>
        </item>
        <item>
            <title><![CDATA[Stake Wars: Episode III. Challenge 004----by youlaiwuqu
]]></title>
            <link>https://paragraph.com/@youlaiwuqu/stake-wars-episode-iii-challenge-004-by-youlaiwuqu</link>
            <guid>xVOW3S2ozw0rUuhXoeod</guid>
            <pubDate>Sun, 24 Jul 2022 16:20:31 GMT</pubDate>
            <description><![CDATA[本篇为near stakewar3 challenge4的攻略 对节点进行监控的一些命令。保证节点在线率在95%，良好运行。 查询日志文件（在作为系统service运行情形下） journalctl -n 100 -f -u neard | ccze -A 日志样板： INFO stats: #85079829 H1GUabkB7TW2K2yhZqZ7G47gnpS7ESqicDMNyb9EE6tf Validator 73 validators 30 peers ⬇ 506.1kiB/s ⬆ 428.3kiB/s 1.20 bps 62.08 Tgas/s CPU: 23%, Mem: 7.4 GiB Validator 代表已经成为活跃的验证者 73 validators: near网络上一共有73个验证者 30 peers: 你当前有30个peers #85079829 区块高度。正常情况下应该不断增大 RPC查询验证者状态： 先安装jq： sudo apt install curl jq 检查节点版本： curl -s http://127.0.0.1:3030/stat...]]></description>
            <content:encoded><![CDATA[<p>本篇为near stakewar3 challenge4的攻略</p><p>对节点进行监控的一些命令。保证节点在线率在95%，良好运行。</p><p>查询日志文件（在作为系统service运行情形下）</p><p>journalctl -n 100 -f -u neard | ccze -A</p><p>日志样板：</p><p>INFO stats: #85079829 H1GUabkB7TW2K2yhZqZ7G47gnpS7ESqicDMNyb9EE6tf Validator 73 validators 30 peers ⬇ 506.1kiB/s ⬆ 428.3kiB/s 1.20 bps 62.08 Tgas/s CPU: 23%, Mem: 7.4 GiB</p><p><strong>Validator</strong> 代表已经成为活跃的验证者</p><p><strong>73 validators</strong>: near网络上一共有73个验证者</p><p><strong>30 peers</strong>: 你当前有30个peers</p><p><strong>#85079829</strong> 区块高度。正常情况下应该不断增大</p><p>RPC查询验证者状态：</p><p>先安装jq：</p><p>sudo apt install curl jq</p><p>检查节点版本：</p><p>curl -s <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="http://127.0.0.1:3030/status">http://127.0.0.1:3030/status</a> | jq .version</p><p>检查委托者和质押：</p><p>near view .factory.shardnet.near get_accounts &apos;{&quot;from_index&quot;: 0, &quot;limit&quot;: 10}&apos; --accountId .shardnet.near 检查是否被踢出： curl -s -d &apos;{&quot;jsonrpc&quot;: &quot;2.0&quot;, &quot;method&quot;: &quot;validators&quot;, &quot;id&quot;: &quot;dontcare&quot;, &quot;params&quot;: [null]}&apos; -H &apos;Content-Type: application/json&apos; 127.0.0.1:3030 | jq -c &apos;.result.prev_epoch_kickout[] | select(.account_id | contains (&quot;&quot;))&apos; | jq .reason 检查已生产的区块和预期产生的区块： curl -s -d &apos;{&quot;jsonrpc&quot;: &quot;2.0&quot;, &quot;method&quot;: &quot;validators&quot;, &quot;id&quot;: &quot;dontcare&quot;, &quot;params&quot;: [null]}&apos; -H &apos;Content-Type: application/json&apos; 127.0.0.1:3030 | jq -c &apos;.result.current_validators[] | select(.account_id | contains (&quot;POOL_ID&quot;))&apos;</p>]]></content:encoded>
            <author>youlaiwuqu@newsletter.paragraph.com (youlaiwuqu空间)</author>
        </item>
        <item>
            <title><![CDATA[Stake Wars: Episode III. Challenge 003----by youlaiwuqu]]></title>
            <link>https://paragraph.com/@youlaiwuqu/stake-wars-episode-iii-challenge-003-by-youlaiwuqu</link>
            <guid>DjMaAB2AcZguD8bOAQ0r</guid>
            <pubDate>Sun, 24 Jul 2022 15:59:19 GMT</pubDate>
            <description><![CDATA[现在写challenge3的内容。 创建质押池： near call factory.shardnet.near create_staking_pool &apos;{"staking_pool_id": "", "owner_id": "", "stake_public_key": "", "reward_fee_fraction": {"numerator": 5, "denominator": 100}, "code_hash":"DD428g9eqLL8fWUxv8QSpVFzyHi1Qd16P8ephYCTmMSZ"}&apos; --accountId="" --amount=30 --gas=300000000000000 Pool ID:你创建的质押池的名字，如果质押池是stakewars.factory.shardnet.near，就只写stakewars，不要加上.factory.shardnet.near，否则要报错。 Owner ID： 你作为质押池的owner，你的near账户名称，比如stakewars.shardnet.near Public Key...]]></description>
            <content:encoded><![CDATA[<p>现在写challenge3的内容。</p><p>创建质押池：</p><p>near call factory.shardnet.near create_staking_pool &apos;{&quot;staking_pool_id&quot;: &quot;&quot;, &quot;owner_id&quot;: &quot;&quot;, &quot;stake_public_key&quot;: &quot;&quot;, &quot;reward_fee_fraction&quot;: {&quot;numerator&quot;: 5, &quot;denominator&quot;: 100}, &quot;code_hash&quot;:&quot;DD428g9eqLL8fWUxv8QSpVFzyHi1Qd16P8ephYCTmMSZ&quot;}&apos; --accountId=&quot;&quot; --amount=30 --gas=300000000000000 <strong>Pool ID</strong>:你创建的质押池的名字，如果质押池是stakewars.factory.shardnet.near，就只写stakewars，不要加上.factory.shardnet.near，否则要报错。 <strong>Owner ID：</strong> 你作为质押池的owner，你的near账户名称，比如stakewars.shardnet.near <strong>Public Key</strong>: 公钥，在<strong>validator_key.json</strong> 文件中查看 <strong>5</strong>: 费率，收利息的百分之五作为费用 <strong>Account Id</strong>: 用来签名交易的账户，通常与Owner ID一样 改变参数，比如费率的命令： near call update_reward_fee_fraction &apos;{&quot;reward_fee_fraction&quot;: {&quot;numerator&quot;: 1, &quot;denominator&quot;: 100}}&apos; --accountId --gas=300000000000000 如果返回结果最后有一个True，则说明池子被成功创建 在 <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://explorer.shardnet.near.org/nodes/validators">https://explorer.shardnet.near.org/nodes/validators</a>查询你的池子是否创建成功。 存入并质押near: near call deposit_and_stake --amount --accountId --gas=300000000000000 部分取消质押near: near call unstake &apos;{&quot;amount&quot;: &quot;&quot;}&apos; --accountId --gas=300000000000000 全部取消质押near: near call unstake_all --accountId --gas=300000000000000 取款 取消质押2-3epochs后，就可以取款了 部分取款： near call withdraw &apos;{&quot;amount&quot;: &quot;&quot;}&apos; --accountId --gas=300000000000000 全部取款： near call withdraw_all --accountId --gas=300000000000000 <strong>ping</strong> ping用于重新提名验证者并且刷新质押余额 near call ping &apos;{}&apos; --accountId --gas=300000000000000 查询池子总共余额 near view get_account_total_balance &apos;{&quot;account_id&quot;: &quot;&quot;}&apos; 查询池子已质押余额 near view get_account_staked_balance &apos;{&quot;account_id&quot;: &quot;&quot;}&apos; 查询池子未质押余额 near view get_account_unstaked_balance &apos;{&quot;account_id&quot;: &quot;&quot;}&apos; 暂停质押 near call pause_staking &apos;{}&apos; --accountId 暂停后恢复质押： near call resume_staking &apos;{}&apos; --accountId</p>]]></content:encoded>
            <author>youlaiwuqu@newsletter.paragraph.com (youlaiwuqu空间)</author>
        </item>
        <item>
            <title><![CDATA[Stake Wars: Episode III. Challenge 002----by youlaiwuqu
]]></title>
            <link>https://paragraph.com/@youlaiwuqu/stake-wars-episode-iii-challenge-002-by-youlaiwuqu</link>
            <guid>WSCKRNnN1jgWcevxSL7B</guid>
            <pubDate>Sun, 24 Jul 2022 13:59:55 GMT</pubDate>
            <description><![CDATA[接下来开始部署near 验证者节点，硬件要求：4核8G，500G SSD 准备工作：检测自己的机器/云服务器是否满足硬件条件： lscpu | grep -P &apos;(?=.*avx )(?=.*sse4.2 )(?=.*cx16 )(?=.*popcnt )&apos; > /dev/null && echo "Supported" || echo "Not supported" 如果满足，会输出Supported，否则会输出Not supported 安装开发工具： sudo apt install -y git binutils-dev libcurl4-openssl-dev zlib1g-dev libdw-dev libiberty-dev cmake gcc g++ python docker.io protobuf-compiler libssl-dev pkg-config clang llvm cargo 安装Python pip： sudo apt install python3-pip 配置环境变量： .bashrc末尾编辑粘贴： USER_BASE...]]></description>
            <content:encoded><![CDATA[<p>接下来开始部署near 验证者节点，硬件要求：4核8G，500G SSD</p><p>准备工作：检测自己的机器/云服务器是否满足硬件条件：</p><p>lscpu | grep -P &apos;(?=.*avx )(?=.*sse4.2 )(?=.*cx16 )(?=.*popcnt )&apos; &gt; /dev/null &amp;&amp; echo &quot;Supported&quot; || echo &quot;Not supported&quot;</p><p>如果满足，会输出Supported，否则会输出Not supported</p><p>安装开发工具：</p><p>sudo apt install -y git binutils-dev libcurl4-openssl-dev zlib1g-dev libdw-dev libiberty-dev cmake gcc g++ python <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="http://docker.io">docker.io</a> protobuf-compiler libssl-dev pkg-config clang llvm cargo</p><p>安装Python pip：</p><p>sudo apt install python3-pip</p><p>配置环境变量：</p><p>.bashrc末尾编辑粘贴：</p><p>USER_BASE_BIN=$(python3 -m site --user-base)/bin export PATH=&quot;$USER_BASE_BIN:$PATH&quot;</p><p>然后保存退出</p><p>source .bashrc刷新</p><p>安装Building env</p><p>sudo apt install clang build-essential make</p><p>安装Rust &amp; Cargo</p><p>curl --proto &apos;=https&apos; --tlsv1.2 -sSf <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://sh.rustup.rs">https://sh.rustup.rs</a> | sh</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/183cbd29488763d603f2b647114d691befec34d7a9119d9d39b8ba0aea46bf17.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>选1，回车</p><p>安装好后，</p><p>source $HOME/.cargo/env</p><p>从github clone nearcore项目</p><p>git clone <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/near/nearcore">https://github.com/near/nearcore</a> cd nearcore git fetch</p><p>然后</p><p>git checkout 0f81dca95a55f975b6e54fe6f311a71792e21698</p><p>编译nearcore binary</p><p>cargo build -p neard --release --features shardnet</p><p>编译好的二进制文件在 ~/nearcore/target/release 中</p><p>初始化工作目录：</p><p>./target/release/neard --home ~/.near init --chain-id shardnet --download-genesis</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/1ef59c616077a86b8def95a8bdcd33d0ca36bfd7811d44e5297b62aea4afa798.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>该命令会创建<code>config.json</code>, <code>node_key.json</code>, 和 <code>genesis.json</code> ，在.near文件夹中。config.json 是节点的配置参数文件。genesis.json是创世文件，包括网络最初的所有状态。node_key.json包含节点的公钥和私钥。data/ 是储存了节点状态的文件夹。</p><p>新产生的config.json有两个参数需要修改，分别是boot_nodes和tracked_shards。删除并且重新下载一个已经改好了的：</p><p>rm ~/.near/config.json wget -O ~/.near/config.json <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://s3-us-west-1.amazonaws.com/build.nearprotocol.com/nearcore-deploy/shardnet/config.json">https://s3-us-west-1.amazonaws.com/build.nearprotocol.com/nearcore-deploy/shardnet/config.json</a></p><p>下载最新的genesis创世文件：</p><p>rm ~/.near/genesis.json wget -O ~/.near/genesis.json <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://s3-us-west-1.amazonaws.com/build.nearprotocol.com/nearcore-deploy/shardnet/genesis.json">https://s3-us-west-1.amazonaws.com/build.nearprotocol.com/nearcore-deploy/shardnet/genesis.json</a></p><p>安装最新的快照：（在7月18日shardnet上硬分叉后就不需要了）</p><p>运行节点。</p><p>cd ~/nearcore ./target/release/neard --home ~/.near run</p><p>CTRL+A+D退出</p><p>激活节点成为验证者validator</p><p>必须在本地安装具有完全权限的key，这样才能通过NEAR-CLI签名交易</p><p>在服务器上运行：</p><p>near login</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/2f0fade14b782092475fee3df173a0db9911d88c2c76a310d5968ef8362d6a19.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>在本地浏览器上输入please visit this URL下的一串URL。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/e4b1afab6f0d540a2885df1da61252f953a905ffac8bf1907bde0beb3227d37f.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>输入自己的near shardnet账号后授权确认。</p><p>确认后，会出现类似于该页无法显示的界面。</p><p>然后在服务器终端输入自己的near shardnet账号回车。会提示登录成功。</p><p>检查validator_key.json 用命令：</p><p>cat ~/.near/validator_key.json</p><p>如果没有，则用下面命令生成validator_key:</p><p>near generate-key ---&gt; xx.factory.shardnet.near xx是你的资金池名字 把刚才新产生的validator key复制粘贴到.near文件夹中： cp ~/.near-credentials/shardnet/YOUR_WALLET.json ~/.near/validator_key.json vim validator_key.json 把 <code>private_key</code> 改为 <code>secret_key</code> validator_key.json内容为如下格式： { &quot;account_id&quot;: &quot;xx.factory.shardnet.near&quot;, &quot;public_key&quot;: &quot;ed25519:HeaBJ3xLgvZacQWmEctTeUqyfSU4SDEnEwckWxd92W2G&quot;, &quot;secret_key&quot;: &quot;ed25519:****&quot; } 重启节点 target/release/neard run 为了方便运行，建议将节点作为系统service运行。 sudo vi /etc/systemd/system/neard.service 粘贴如下内容： [Unit] Description=NEARd Daemon Service [Service] Type=simple User= #Group=near WorkingDirectory=/home//.near ExecStart=/home//nearcore/target/release/neard run Restart=on-failure RestartSec=30 KillSignal=SIGINT TimeoutStopSec=45 KillMode=mixed [Install] WantedBy=multi-user.target 将上面内容的user部分改为你的用户名 sudo systemctl enable neard 设置下次开机时，自动启动neard sudo systemctl start neard 立刻启动neard sudo systemctl reload neard 不关闭 neard 的情况下，重新载入配置文件，让设置生效 查看near日志： journalctl -n 100 -f -u neard 如果想要日志有颜色，更好看， sudo apt install ccze journalctl -n 100 -f -u neard | ccze -A</p>]]></content:encoded>
            <author>youlaiwuqu@newsletter.paragraph.com (youlaiwuqu空间)</author>
        </item>
        <item>
            <title><![CDATA[Stake Wars: Episode III. Challenge 001----by youlaiwuqu]]></title>
            <link>https://paragraph.com/@youlaiwuqu/stake-wars-episode-iii-challenge-001-by-youlaiwuqu</link>
            <guid>ophN6RqfysuEV5GhNNk6</guid>
            <pubDate>Fri, 22 Jul 2022 09:15:40 GMT</pubDate>
            <description><![CDATA[我的discord: youlaiwuqu#1283 今天开始写near stakewar III激励测试网活动教程。以下是challenge 1的教程 near shard testnet网页版钱包地址： https://wallet.shardnet.near.org/点创建账户。 输入用户名----保留账户ID----恢复账户模式推荐选安全助记词，将助记词抄纸上备份----下一步验证助记词----注册账户成功。Near 采用的是账户名称的账户模式，对小白用户更加友好。接下来安装 NEAR-CLI，需要开通云服务器。推荐配置4核8G，500GB SSD NEAR-CLI 是一个命令行界面， 通过RPC 和NEAR区块链交互 打开云服务器ubuntu界面 sudo apt update && sudo apt upgrade -y 安装开发工具，Node.js, 和 npm curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash -sudo apt install build-essential nodejs ...]]></description>
            <content:encoded><![CDATA[<p>我的discord:</p><p>youlaiwuqu#1283</p><p>今天开始写near stakewar III激励测试网活动教程。以下是challenge 1的教程</p><p>near shard testnet网页版钱包地址：</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://wallet.shardnet.near.org/">https://wallet.shardnet.near.org/</a></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/977cccf69ef72251740066ca24a4951fa9e851a759cfae50ef90835d03401c31.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>点创建账户。</p><p>输入用户名----保留账户ID----恢复账户模式推荐选安全助记词，将助记词抄纸上备份----下一步验证助记词----注册账户成功。Near 采用的是账户名称的账户模式，对小白用户更加友好。</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/46c9279a5873715427c6e6994d30b909f7d97413cf684123df78ab603fd96a10.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>接下来安装 NEAR-CLI，需要开通云服务器。推荐配置4核8G，500GB SSD</p><p>NEAR-CLI 是一个命令行界面， 通过RPC 和NEAR区块链交互</p><p>打开云服务器ubuntu界面</p><p>sudo apt update &amp;&amp; sudo apt upgrade -y</p><p>安装开发工具，Node.js, 和 npm</p><p>curl -sL <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://deb.nodesource.com/setup_18.x">https://deb.nodesource.com/setup_18.x</a> | sudo -E bash -sudo apt install build-essential nodejs PATH=&quot;$PATH&quot;</p><p>安装好后，检查版本：</p><p>node -v 会出现类似于v18.6.0的版本号</p><p>npm -v 会出现类似于8.13.2的版本号</p><p>安装NEAR-CLI</p><p>sudo npm install -g near-cli</p><p>NEAR-CLI安装好后，用相关命令行测试一下。</p><p>环境说明：目前有四种network。</p><ul><li><p>GuildNet</p></li><li><p>TestNet</p></li><li><p>MainNet</p></li><li><p><strong>Shardnet</strong> (目前用来参加starkwar的)</p></li></ul><p>设置当前所在网络为shardnet：</p><p>export NEAR_ENV=shardnet</p><p>echo &apos;export NEAR_ENV=shardnet&apos; &gt;&gt; ~/.bashrc</p><p>source .bashrc</p><p>NEAR-CLI相关命令行：</p><p>near proposals</p><p>查看所有被提议的验证者validator。这些被提议的验证者有意愿加入验证者。当他们质押的最小金额满足席位门槛时，就会成为正式的验证者</p><p>near validators current</p><p>显示当前epoch的所有活跃的验证者,已经生产的区块，预计生产的区块和在线率。</p><p>near validators next</p><p>显示在一个epoch之前被接受提议的验证者，他们将在下一个epoch出现在验证者席位中</p>]]></content:encoded>
            <author>youlaiwuqu@newsletter.paragraph.com (youlaiwuqu空间)</author>
        </item>
        <item>
            <title><![CDATA[gitcoin13轮给banksea捐过款的可以填表加入discord成为OG]]></title>
            <link>https://paragraph.com/@youlaiwuqu/gitcoin13-banksea-discord-og</link>
            <guid>HT7EussNQHhbiS74lrLE</guid>
            <pubDate>Sat, 26 Mar 2022 15:08:20 GMT</pubDate>
            <description><![CDATA[gitcoin13轮给banksea捐过款的可以填表加入discord成为OG。表格地址： https://forms.gle/ryX2Vywpy9pZLWPN9 discord: https://discord.gg/uE9ZqxDT]]></description>
            <content:encoded><![CDATA[<p>gitcoin13轮给banksea捐过款的可以填表加入discord成为OG。表格地址：</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://forms.gle/ryX2Vywpy9pZLWPN9">https://forms.gle/ryX2Vywpy9pZLWPN9</a></p><p>discord:</p><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://discord.gg/uE9ZqxDT">https://discord.gg/uE9ZqxDT</a></p>]]></content:encoded>
            <author>youlaiwuqu@newsletter.paragraph.com (youlaiwuqu空间)</author>
            <enclosure url="https://storage.googleapis.com/papyrus_images/0ce1e64591874aae3dee6e305afb713a19eaf55578020ab9747e002098d77adf.png" length="0" type="image/png"/>
        </item>
    </channel>
</rss>