<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" version="2.0"><channel><title>拾起行</title><link>http://lipyun.com/</link><atom:link href="http://lipyun.com/rss.xml" rel="self" type="application/rss+xml"/><description>拾起行</description><generator>Halo v2.21.6</generator><language>zh-cn</language><image><url>http://lipyun.com/upload/%E5%8F%91%E7%94%B5%E6%9C%BA.png</url><title>拾起行</title><link>http://lipyun.com/</link></image><lastBuildDate>Fri, 10 Apr 2026 09:13:40 GMT</lastBuildDate><item><title><![CDATA[python爬虫脚本]]></title><link>http://lipyun.com/archives/pythongo</link><description><![CDATA[<img src="http://lipyun.com/plugins/feed/assets/telemetry.gif?title=python%E7%88%AC%E8%99%AB%E8%84%9A%E6%9C%AC&amp;url=/archives/pythongo" width="1" height="1" alt="" style="opacity:0;">
<pre><code>#用于发送HTTP请求，获取网页内容
import requests
#用于解析HTML文档，提取网页中的数据
from bs4 import BeautifulSoup
#用于将数据保存到Excel
import pandas as pd

headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36'
}

# 获取所有页面的书籍信息
def get_all_books():
    page_num = 1
    books_data = []
    
    while True:
        # 构造每一页的URL
        url = f'http://books.toscrape.com/catalogue/category/books/fantasy_19/page-{page_num}.html'
        
        # 发送HTTP GET请求获取页面内容
        response = requests.get(url, headers=headers)
        
        # 如果页面不存在，跳出循环
        if not response.ok:
            print(f"页面 {page_num} 不存在，停止抓取")
            break
            
        print(f'正在处理第 {page_num} 页')
        
        # 使用BeautifulSoup解析HTML文档
        soup = BeautifulSoup(response.text, 'html.parser')
        
        # 查找所有书籍标题元素
        all_books = soup.find_all('h3')
        
        # 如果当前页面没有书籍，说明已经到最后一页
        if len(all_books) == 0:
            print(f"第 {page_num} 页没有书籍，停止抓取")
            break
            
        print(f'第 {page_num} 页找到 {len(all_books)} 本书籍')
        
        # 遍历并收集每个书籍标题
        for book in all_books:
            title_link = book.find('a')
            if title_link and title_link.get('title'):
                book_title = title_link.get('title')
                books_data.append({
                    '页码': page_num,
                    '书籍名称': book_title
                })
                print(f"  {book_title}")
        
        # 处理下一页
        page_num += 1
        
        # 为了不给服务器造成太大压力，可以添加延时
        # import time
        # time.sleep(1)
    
    return books_data

# 将数据保存到Excel文件
def save_to_excel(books_data, filename='books.xlsx'):
    # 创建DataFrame
    df = pd.DataFrame(books_data)
    
    # 保存到Excel文件
    df.to_excel(filename, index=False, engine='openpyxl')
    print(f"\n数据已保存到 {filename} 文件中")
    print(f"总共保存了 {len(books_data)} 本书籍信息")

# 调用函数获取所有书籍并保存到Excel
if __name__ == "__main__":
    books = get_all_books()
    save_to_excel(books)</code></pre>
<p style=""></p>]]></description><guid isPermaLink="false">/archives/pythongo</guid><dc:creator>栋栋拐</dc:creator><enclosure url="http://lipyun.com/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=https%3A%2F%2Fci-1331418327.cos.ap-shanghai.myqcloud.com%2Fci-1331418327%2Fcomic_13.jpg&amp;size=m" type="image/jpeg" length="0"/><category>杂七杂八</category><pubDate>Wed, 17 Sep 2025 17:30:56 GMT</pubDate></item><item><title><![CDATA[ERC721标准的实现]]></title><link>http://lipyun.com/archives/ERC20</link><description><![CDATA[<img src="http://lipyun.com/plugins/feed/assets/telemetry.gif?title=ERC721%E6%A0%87%E5%87%86%E7%9A%84%E5%AE%9E%E7%8E%B0&amp;url=/archives/ERC20" width="1" height="1" alt="" style="opacity:0;">
<h1 style="" id="%E5%88%9B%E5%BB%BA%E9%A1%B9%E7%9B%AE">创建项目</h1>
<p style="">创建nft项目，初始化 默认值创建node项目</p>
<p style="line-height: inherit"><code>npm init -y </code></p>
<p style="line-height: inherit">安装hardhat</p>
<p style="line-height: inherit"><code>npm install hardhat -D </code></p>
<p style="line-height: inherit">创建hardhat项目 全部默认创建即可</p>
<p style="line-height: inherit"><code>npx hardhat init </code></p>
<p style="line-height: inherit">安装openzeppelin</p>
<p style="line-height: inherit"><code>npm install -D @openzeppelin/contracts</code></p>
<h1 style="" id="%E4%BB%A3%E7%A0%81%E5%AE%9E%E7%8E%B0">代码实现</h1>
<p style="">可以先在openzeppelin官网中去获取ERC721标准代码</p>
<p style=""><a href="https://www.openzeppelin.com/solidity-contracts" target="_blank">https://www.openzeppelin.com/solidity-contracts</a></p>
<pre collapsed="true"><code>// SPDX-License-Identifier: MIT
// Compatible with OpenZeppelin Contracts ^5.0.0
pragma solidity ^0.8.27;

import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import {ERC721Burnable} from "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol";
import {ERC721Enumerable} from "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import {ERC721URIStorage} from "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";

contract MyToken is ERC721, ERC721Enumerable, ERC721URIStorage, ERC721Burnable, Ownable {
    uint256 private _nextTokenId;

    constructor(address initialOwner)
        ERC721("MyToken", "MTK")
        Ownable(initialOwner)
    {}

    function safeMint(address to, string memory uri)
        public
        onlyOwner
        returns (uint256)
    {
        uint256 tokenId = _nextTokenId++;
        _safeMint(to, tokenId);
        _setTokenURI(tokenId, uri);
        return tokenId;
    }

    // The following functions are overrides required by Solidity.

    function _update(address to, uint256 tokenId, address auth)
        internal
        override(ERC721, ERC721Enumerable)
        returns (address)
    {
        return super._update(to, tokenId, auth);
    }

    function _increaseBalance(address account, uint128 value)
        internal
        override(ERC721, ERC721Enumerable)
    {
        super._increaseBalance(account, value);
    }

    function tokenURI(uint256 tokenId)
        public
        view
        override(ERC721, ERC721URIStorage)
        returns (string memory)
    {
        return super.tokenURI(tokenId);
    }

    function supportsInterface(bytes4 interfaceId)
        public
        view
        override(ERC721, ERC721Enumerable, ERC721URIStorage)
        returns (bool)
    {
        return super.supportsInterface(interfaceId);
    }
}</code></pre>
<p style="">最大的NFT交易平台：opensea</p>
<p style=""><a href="https://opensea.io/zh-CN" target="_blank">https://opensea.io/zh-CN</a></p>
<p style="">使用Metadata 定义NFT的信息</p>
<p style=""><a href="https://docs.opensea.io/docs/metadata-standards" target="_self">https://docs.opensea.io/docs/metadata-standards</a></p>
<p style=""><img src="http://lipyun.com/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=https%3A%2F%2Fci-1331418327.cos.ap-shanghai.myqcloud.com%2Fci-1331418327%2Fimage-bwba.png&amp;size=m" width="100%" height="100%" style="display: inline-block"></p>
<p style="">将数据信息存储在去中心化网络上，目前最大的去中心化存储网络IPFS：</p>
<h2 style="text-align: center" id="why-ipfs%3F"><strong>Why IPFS?</strong></h2>
<h3 style="text-align: center" id="our-peer-to-peer-content-delivery-network-is-built-around-the-innovation-of-content-addressing%3A-store%2C-retrieve%2C-and-locate-data-based-on-the-fingerprint-of-its-actual-content-rather-than-its-name-or-location.">Our peer-to-peer content delivery network is built around the innovation of content addressing: store, retrieve, and locate data based on the fingerprint of its actual content rather than its name or location.</h3>
<p style="text-align: center"></p>
<p style="">IPFS的第三方服务应用filebase</p>
<p style="">获取到<span style="font-size: 14px; color: rgb(107, 114, 128)"><strong>IPFS Gateway URL</strong></span></p>
<p style="">在代码中添加参数</p>
<pre collapsed="true"><code class="language-solidity">string constant META_DATA = "https://grotesque-beige-dormouse.myfilebase.com/ipfs/xxxxx";
function safeMint(address to) public onlyOwner returns (uint256)
    {
        uint256 tokenId = _nextTokenId++;
        _safeMint(to, tokenId);
        _setTokenURI(tokenId, META_DATA);
        return tokenId;
    }</code></pre>
<p style="">在remix中可进行测试，铸造完成后在opensen测试网中查看NFT</p>
<h1 style="" id="ccip%E8%B7%A8%E9%93%BE">CCIP跨链</h1>
<p style="">使用ChainLink的CCIP服务</p>
<p style=""><a href="https://docs.chain.link/ccip/tutorials/evm/send-arbitrary-data" target="_blank" rel="">https://docs.chain.link/ccip/tutorials/evm/send-arbitrary-data</a></p>
<p style=""><img src="http://lipyun.com/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=https%3A%2F%2Fci-1331418327.cos.ap-shanghai.myqcloud.com%2Fci-1331418327%2Fimage-spth.png&amp;size=m" width="100%" height="100%" style="display: inline-block"></p>
<p style="">可获取到相关的代码实现，复制粘贴</p>
<p style="">安装CCIP插件</p>
<p style=""><code>npm install -D @chainlink/contracts-ccip</code></p>
<p style="">NFT跨链示意图</p>
<p style=""><img src="http://lipyun.com/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=https%3A%2F%2Fci-1331418327.cos.ap-shanghai.myqcloud.com%2Fci-1331418327%2Fimage-mesu.png&amp;size=m" width="100%" height="100%" style="display: inline-block"></p>
<p style="">编写NFT跨链代码</p>
<p style="">安装hardhat-deploy插件,完成单元测试</p>
<p style=""><code>npm install --save-dev @nomicfoundation/hardhat-ethers ethers hardhat-deploy hardhat-deploy-ethers</code></p>
<p style="">引入hardhat-deploy所需要的插件</p>
<pre><code class="language-javascript">require("@nomicfoundation/hardhat-ethers");
require("hardhat-deploy");
require("hardhat-deploy-ethers");</code></pre>
<p style=""></p>
<p style=""></p>
<p style=""></p>
<p style=""></p>
<p style=""></p>
<p style=""></p>
<p style=""></p>
<p style=""></p>
<p style=""></p>
<p style=""></p>
<p style=""></p>
<p style=""></p>]]></description><guid isPermaLink="false">/archives/ERC20</guid><dc:creator>栋栋拐</dc:creator><enclosure url="http://lipyun.com/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=https%3A%2F%2Fci-1331418327.cos.ap-shanghai.myqcloud.com%2Fci-1331418327%2Fcomic_23.jpg&amp;size=m" type="image/jpeg" length="0"/><category>Solitidy</category><pubDate>Thu, 12 Jun 2025 16:07:09 GMT</pubDate></item><item><title><![CDATA[创建Harthad项目命令步骤]]></title><link>http://lipyun.com/archives/creathardhat</link><description><![CDATA[<img src="http://lipyun.com/plugins/feed/assets/telemetry.gif?title=%E5%88%9B%E5%BB%BAHarthad%E9%A1%B9%E7%9B%AE%E5%91%BD%E4%BB%A4%E6%AD%A5%E9%AA%A4&amp;url=/archives/creathardhat" width="1" height="1" alt="" style="opacity:0;">
<p style="">1、npm init //初始化npm项目</p>
<p style="">2、npm hardhat --save-dev //创建hardhat项目</p>
<p style="">3、当需要引入第三方包时，比如chainlink 命令：npm install @chainlink/contracts --save-dev</p>
<p style="">4、编译智能合约：npx hardhat compile</p>
<p style=""></p>
<h1 style="" id="%E6%B5%8B%E8%AF%95%E6%8F%92%E4%BB%B6%E7%9A%84%E5%AE%89%E8%A3%85%E4%B8%8B%E8%BD%BD%EF%BC%8C%E5%AE%98%E7%BD%91%E6%9F%A5%E7%9C%8B%E5%AE%89%E8%A3%85%E5%91%BD%E4%BB%A4">测试插件的安装下载，官网查看安装命令<img src="http://lipyun.com/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=https%3A%2F%2Fci-1331418327.cos.ap-shanghai.myqcloud.com%2Fci-1331418327%2Fimage.png&amp;size=m" width="241px" height="157px" style="display: inline-block"></h1>
<p style=""><img src="http://lipyun.com/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=https%3A%2F%2Fci-1331418327.cos.ap-shanghai.myqcloud.com%2Fci-1331418327%2Fimage-fart.png&amp;size=m" width="239px" height="156px" style="display: inline-block"></p>
<p style=""><img src="http://lipyun.com/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=https%3A%2F%2Fci-1331418327.cos.ap-shanghai.myqcloud.com%2Fci-1331418327%2Fimage-oz6l.png&amp;size=m" width="235px" height="123px" style="display: inline-block"></p>
<h1 style="" id="%E6%8C%89%E9%A1%BA%E5%BA%8F%E6%89%A7%E8%A1%8Cdeploy%E4%B8%8B%E7%9A%84%E6%96%87%E4%BB%B6%E5%A4%B9%E4%B8%8B%E7%9A%84js%E6%96%87%E4%BB%B6">按顺序执行deploy下的文件夹下的js文件</h1>
<p style=""><img src="http://lipyun.com/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=https%3A%2F%2Fci-1331418327.cos.ap-shanghai.myqcloud.com%2Fci-1331418327%2Fimage-r54d.png&amp;size=m" width="318px" height="54px" style="display: inline-block"></p>
<p style=""></p>
<p style="">npx hardhat text //执行测试用例会按顺序自动执行deploy下的js文件</p>
<p style="">注意：js文件内容需要导出后会自动执行的</p>
<p style=""></p>
<p style=""></p>]]></description><guid isPermaLink="false">/archives/creathardhat</guid><dc:creator>栋栋拐</dc:creator><enclosure url="http://lipyun.com/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=https%3A%2F%2Fci-1331418327.cos.ap-shanghai.myqcloud.com%2Fci-1331418327%2Fcomic_40.jpg&amp;size=m" type="image/jpeg" length="0"/><category>Solitidy</category><pubDate>Wed, 14 May 2025 13:36:25 GMT</pubDate></item><item><title><![CDATA[Docker安装与基础命令]]></title><link>http://lipyun.com/archives/dockerinstall</link><description><![CDATA[<img src="http://lipyun.com/plugins/feed/assets/telemetry.gif?title=Docker%E5%AE%89%E8%A3%85%E4%B8%8E%E5%9F%BA%E7%A1%80%E5%91%BD%E4%BB%A4&amp;url=/archives/dockerinstall" width="1" height="1" alt="" style="opacity:0;">
<p style="">Docker 是一种开源的容器化平台，旨在简化应用程序的开发、部署和运行过程。它提供了一种 轻量级、可移植和自包含的容器化环境，使开发人员能够在不同的计算机上以一致的方式构建、打包和分发应用程序。</p>
<h1 style="" id="docker%E5%AE%89%E8%A3%85"><span style="font-size: 36px"><strong><u>Docker安装</u></strong></span></h1>
<h2 style="" id="1.%E9%85%8D%E7%BD%AEdocker-yum%E6%BA%90%E3%80%82">1.配置docker yum源。</h2>
<p style=""><code>sudo yum install -yyum-utilssudo yum-config-manager--add-repohttp://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo</code></p>
<h2 style="" id="2.%E5%AE%89%E8%A3%85docker">2.安装docker</h2>
<p style=""><code>sudo yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin</code></p>
<p style=""></p>
<h2 style="" id="3.%E5%90%AF%E5%8A%A8docker">3.启动docker</h2>
<p style=""><code>sudo systemctl start docker</code></p>
<h2 style="" id="4.%E5%BC%80%E6%9C%BA%E5%90%AF%E5%8A%A8">4.开机启动</h2>
<p style=""><code>docker：systemctl enable docker</code></p>
<h2 style="" id="6.%E9%85%8D%E7%BD%AE%E5%8A%A0%E9%80%9F">6.配置加速</h2>
<p style=""><code>sudo mkdir -p /etc/docker</code></p>
<p style=""><code>sudo tee /etc/docker/daemon.json &lt;&lt;-'EOF</code></p>
<p style=""><code>{</code></p>
<p style=""><code> "registry-mirrors":["https://mirror.ccs.tencentyun.com"]</code></p>
<p style=""><code>}</code></p>
<p style=""><code>EOF</code></p>
<p style=""><code>sudo systemctl daemon-reloadsudo systemctl restart docker</code></p>
<p style=""></p>
<p style=""></p>
<h1 style="" id="docker%E5%91%BD%E4%BB%A4"><span style="font-size: 36px"><strong><u>docker命令</u></strong></span></h1>
<blockquote>
 <p style="">例子：启动一个nginx，并将它的首页改为自己的页面，发布出去，让所有人都能使用</p>
 <p style="">1.下载镜像——&gt;2.启动容器——&gt;3.修改页面——&gt;4.保存镜像——&gt;5.分享社区</p>
</blockquote>
<h2 style="" id="1.%E9%95%9C%E5%83%8F%E6%93%8D%E4%BD%9C">1.镜像操作</h2>
<p style="">检索镜像：</p>
<p style=""><code>docker search </code></p>
<p style="">检索dockerhub库中的nginx</p>
<p style=""></p>
<p style="">下载镜像：docker pull</p>
<p style="text-align: justify">taps：镜像的完整名称 镜像名:标签（版本号）</p>
<p style="">如下载特点版本镜像 <code>docker pull nginx:1.26.0</code></p>
<p style="">查看镜像列表：<code>docker images</code></p>
<p style="">查看系统中的镜像</p>
<p style="text-align: justify"></p>
<p style="">删除镜像：docker rmi</p>
<p style=""></p>
<p style=""></p>
<p style="">可使用完整镜像名称或者镜像ID</p>
<p style=""></p>
<h2 style="" id="2.%E5%AE%B9%E5%99%A8%E6%93%8D%E4%BD%9C">2.容器操作</h2>
<p style="">运行容器命令<code>docker run -d --name mynginx nginx</code></p>
<p style="">-d：后台启动容器</p>
<p style="">-- name：给容器起个名字</p>
<p style="">nginx：使用的镜像名字</p>
<p style=""></p>
<p style="">查看正在运行的容器 <code>docker ps</code></p>
<p style="">查看所有的容器 <code>docker ps -a</code></p>
<p style="">启动容器 <code>docker start</code></p>
<p style="">可填写容器的名称或者容器ID</p>
<p style=""></p>
<p style="">以下同理</p>
<p style="">停止运行的容器 docker stop []</p>
<p style="">重启容器 docker restart []</p>
<p style="">容器状态 docker stats []</p>
<p style="">删除容器 docker rm []</p>
<p style="">强制删除容器 docker rm -f []</p>
<p style="">容器日志 docker logs</p>
<p style=""></p>
<h2 style="" id="3.%E4%BF%AE%E6%94%B9%E9%A1%B5%E9%9D%A2">3.修改页面</h2>
<p style="">进入容器内部进行修改：docker exec</p>
<p style=""><code>dokcer exec -it mynginx /bin/bash</code></p>
<p style=""></p>
<p style=""></p>
<p style="">端口映射</p>
<p style="">代表外部主机上的任意IP通过88端口可以访问到容器的80端口</p>
<p style="">保存镜像</p>
<p style="">提交镜像相当于把已有的镜像给做成另外一个版本的镜像</p>
<p style=""></p>
<p style="">save相当于把指定的镜像打成tar包</p>
<p style=""></p>
<p style="">当另外一个主机获得这个tar包后可以得到这个镜像并去运行</p>
<p style=""></p>
<p style=""></p>
<h2 style="" id="4.%E5%88%86%E4%BA%AB%E7%A4%BE%E5%8C%BA">4.分享社区</h2>
<p style="">登陆到dockerhub</p>
<p style=""></p>
<p style="">将镜像改名成dockerhub官网所需要的</p>
<p style=""></p>
<p style=""></p>
<p style=""></p>
<p style=""></p>
<p style=""></p>
<p style=""></p>]]></description><guid isPermaLink="false">/archives/dockerinstall</guid><dc:creator>栋栋拐</dc:creator><enclosure url="http://lipyun.com/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri?uri=https%3A%2F%2Fci-1331418327.cos.ap-shanghai.myqcloud.com%2Fci-1331418327%2Fcomic_12.jpg&amp;size=m" type="image/jpeg" length="0"/><category>Docker</category><pubDate>Wed, 11 Dec 2024 05:09:44 GMT</pubDate></item></channel></rss>