Files
pages/2022/10/19/web3.html
2025-12-31 16:00:29 +00:00

327 lines
21 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- Begin Jekyll SEO tag v2.8.0 -->
<title>在Web3上搭建一个自己的博客 | Mayx的博客</title>
<meta name="generator" content="Jekyll v3.9.5" />
<meta property="og:title" content="在Web3上搭建一个自己的博客" />
<meta name="author" content="mayx" />
<meta property="og:locale" content="zh_CN" />
<meta name="description" content="感觉Web3可以真正的为现在的人们使用了呢。" />
<meta property="og:description" content="感觉Web3可以真正的为现在的人们使用了呢。" />
<meta property="og:site_name" content="Mayx的博客" />
<meta property="og:type" content="article" />
<meta property="article:published_time" content="2022-10-19T00:00:00+08:00" />
<meta name="twitter:card" content="summary" />
<meta property="twitter:title" content="在Web3上搭建一个自己的博客" />
<meta name="google-site-verification" content="huTYdEesm8NaFymixMNqflyCp6Jfvd615j5Wq1i2PHc" />
<meta name="msvalidate.01" content="0ADFCE64B3557DC4DC5F2DC224C5FDDD" />
<meta name="yandex-verification" content="fc0e535abed800be" />
<script type="application/ld+json">
{"@context":"https://schema.org","@type":"BlogPosting","author":{"@type":"Person","name":"mayx"},"dateModified":"2022-10-19T00:00:00+08:00","datePublished":"2022-10-19T00:00:00+08:00","description":"感觉Web3可以真正的为现在的人们使用了呢。","headline":"在Web3上搭建一个自己的博客","mainEntityOfPage":{"@type":"WebPage","@id":"/2022/10/19/web3.html"},"publisher":{"@type":"Organization","logo":{"@type":"ImageObject","url":"https://avatars0.githubusercontent.com/u/17966333"},"name":"mayx"},"url":"/2022/10/19/web3.html"}</script>
<!-- End Jekyll SEO tag -->
<link rel="canonical" href="https://mabbs.github.io/2022/10/19/web3.html" />
<link type="application/atom+xml" rel="alternate" href="/atom.xml" title="Mayx的博客" />
<link rel="alternate" type="application/rss+xml" title="Mayx的博客(RSS)" href="/rss.xml" />
<link rel="alternate" type="application/json" title="Mayx的博客(JSON Feed)" href="/feed.json" />
<link rel="stylesheet" href="/assets/css/style.css?v=1767196818" />
<!--[if !IE]> -->
<link rel="stylesheet" href="/Live2dHistoire/live2d/css/live2d.css" />
<!-- <![endif]-->
<link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="Mayx的博客" />
<link rel="webmention" href="https://webmention.io/mabbs.github.io/webmention" />
<link rel="pingback" href="https://webmention.io/mabbs.github.io/xmlrpc" />
<link rel="preconnect" href="https://summary.mayx.eu.org" crossorigin="anonymous" />
<link rel="prefetch" href="https://www.blogsclub.org/badge/mabbs.github.io" as="image" />
<link rel="blogroll" type="text/xml" href="/blogroll.opml" />
<link rel="me" href="https://github.com/Mabbs" />
<script src="/assets/js/jquery.min.js"></script>
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-ajaxtransport-xdomainrequest/1.0.3/jquery.xdomainrequest.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<script>
var lastUpdated = new Date("Thu, 01 Jan 2026 00:00:18 +0800");
var BlogAPI = "https://summary.mayx.eu.org";
</script>
<script src="/assets/js/main.js"></script>
<!--[if !IE]> -->
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async="async" src="https://www.googletagmanager.com/gtag/js?id=UA-137710294-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-137710294-1');
</script>
<script src="/assets/js/instant.page.js" type="module"></script>
<!-- <![endif]-->
</head>
<body>
<!--[if !IE]> --><noscript><marquee style="top: -15px; position: relative;"><small>发现当前浏览器没有启用JavaScript这不影响你的浏览但可能会有一些功能无法使用……</small></marquee></noscript><!-- <![endif]-->
<!--[if IE]><marquee style="top: -15px; position: relative;"><small>发现当前浏览器为Internet Explorer这不影响你的浏览但可能会有一些功能无法使用……</small></marquee><![endif]-->
<div class="wrapper">
<header class="h-card">
<h1><a class="u-url u-uid p-name" rel="me" href="/">Mayx的博客</a></h1>
<img src="https://avatars0.githubusercontent.com/u/17966333" fetchpriority="high" class="u-photo" alt="Logo" style="width: 90%; max-width: 300px; max-height: 300px;" />
<p class="p-note">Mayx's Home Page</p>
<form action="/search.html">
<input type="text" name="keyword" id="search-input-all" placeholder="Search blog posts.." />&#160;<input type="submit" value="搜索" />
</form>
<br />
<p class="view"><a class="u-url" href="/Mabbs/">About me</a></p>
<ul class="downloads">
<li style="width: 270px; border-right: none;"><a href="/MayxBlog.tgz">Download <strong>TGZ File</strong></a></li>
</ul>
</header>
<section class="h-entry">
<small><time class="date dt-published" datetime="2022-10-19T00:00:00+08:00">19 October 2022</time> - 字数统计1994 - 阅读大约需要6分钟 - Hits: <span id="/2022/10/19/web3.html" class="visitors">Loading...</span></small>
<h1 class="p-name">在Web3上搭建一个自己的博客</h1>
<p class="view">by <a class="p-author h-card" href="//github.com/Mabbs">mayx</a></p>
<div id="outdate" style="display:none;">
<hr /><p>
这是一篇创建于 <span id="outime"></span> 天前的文章,其中的信息可能已经有所发展或是发生改变。
</p>
</div>
<script>
daysold = Math.floor((new Date().getTime() - new Date("Wed, 19 Oct 2022 00:00:00 +0800").getTime()) / (24 * 60 * 60 * 1000));
if (daysold > 90) {
document.getElementById("outdate").style.display = "block";
document.getElementById("outime").innerHTML = daysold;
}
</script>
<hr />
<b>AI摘要</b>
<p id="ai-output">这篇文章介绍了作者在Web3上使用xLog搭建博客的经历提到xLog基于Crossbell区块链使用智能合约和IPFS存储内容强调了其去中心化和防止审查的优点。尽管作者认为IPFS不能提供永久存储除非结合Arweave或其他服务付费存储但他利用4EVERLAND实现了静态博客的Git同步和DNSlink访问提到了社交功能和成本问题。此外作者对零网ZeroNet的体验并不理想但也对Web3技术的发展和去中心化社区的建设表达了期待。</p>
<hr />
<ul><li><a href="#起因">起因</a></li><li><a href="#技术人员的方法">技术人员的方法</a></li><li><a href="#从ipfs直接访问">从IPFS直接访问</a></li><li><a href="#更好的永久存储">更好的永久存储</a></li><li><a href="#感想">感想</a></li></ul>
<hr />
<main class="post-content e-content" role="main"><p>感觉Web3可以真正的为现在的人们使用了呢。<!--more--></p>
<h1 id="起因">
<a href="#起因"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 起因
</h1>
<p>最近偶然看到了一个很有意思的东西,叫<a href="https://xlog.app/">xLog</a>大概试了试这是在一条叫Crossbell的区块链上使用智能合约操作和存储元数据并把实际数据存到IPFS上的项目。看了一眼还挺有意思就在上面搭了一个自己的<a href="https://mayx.xlog.app/">另一个博客</a>另外他们还使用这套方案写了一个类似Twitter的社交系统也叫Crossbell非常的人性化可以说是把Web3真正的带给了普通用户。至于怎么搭他们的项目成员写了篇教程<a href="https://song.xlog.app/5m-zh">5分钟就能搭好在Web3的博客</a></p><p>
不过使用xLog那就不是技术人员的事了而是让一个不怎么懂电脑的人来做的事情了。另外他们宣称数据是“Permanently stored on the blockchain”这一点我不太认同要是说存到了Web3成为了其他人无法修改的数据这倒是没什么问题但是存到IPFS上只要没有被Pin就有可能在节点GC的过程中永远消失。另外我其实对区块链接触不多不清楚能不能完整的同步他们的链如果不能那就是私链了那样元数据也不能永久保留了……所以我只能说这个平台是Web3可以保证不因为审查而404但是不能在时间的长河中保留信息。</p>
<h1 id="技术人员的方法">
<a href="#技术人员的方法"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 技术人员的方法
</h1>
<p>所以作为技术人员我的博客当然直接上IPFS那更好啦因为他们的平台毕竟可定制性不高而且好多组件不知道有没有可替代性比如以太坊JSON-RPC不过他们的服务好像是都开源了只要这个链可以被同步能搭属于自己的RPC那倒是问题不大。 </p><p>
直接用IPFS客户端直接上传是最原生的办法但是我不喜欢在自己电脑上安一堆莫名其妙的软件像我现在写博客都是直接在Github或者Gitlab上写好然后直接用<a href="/2022/02/14/move.html">之前提到的静态页面服务商</a>一次性部署好。所以我也希望能有一个类似的服务商能帮我把我的博客上传到IPFS上。最后我找到的服务商就是<a href="https://www.4everland.org/">4EVERLAND</a>。它可以绑定Git仓库并监听变化当有变化的时候就会自动部署到IPFS上并且他们提供免费的Gateway来直接访问在IPFS上的内容非常的不错。不过有个问题就是不知道什么原因它的部署模板里面没有Jekyll的语句然后前端还不能自定义……所以只能靠抓包的方式来修改成自己想要的部署语句。</p>
<h1 id="从ipfs直接访问">
<a href="#从ipfs直接访问"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 从IPFS直接访问
</h1>
<p>使用4everland部署完之后直接访问当然也很好但是总感觉和其他服务商差不多谁知道它读取网页到底是从自己服务器上还是IPFS网络上读取呢所以我还想整个更好的方式从IPFS上读取也能证明它确实在IPFS上了。 </p><p>
直接通过Gateway去访问我的博客当然也没问题但是每次部署的时候CID是会变化的那这样我想访问也不方便啊……后来我听说可以把CID用一种叫dnslink的方式记录到DNS里这样就能通过固定又好记的方式来访问。不过那时候我不知道怎么访问dnslink记录的网站……而且每次部署CID会变那部署完我还要更新我的DNS记录啊后来我查了查原来还有一种叫IPNS的东西看了一眼4everland的控制台原来每个网站它也会生成一个固定的IPNS然后用dnslink可以指向IPNS。那如何访问呢IPFS又没有一个IP地址光TXT记录肯定不够的吧后来我才知道原来要用CNAME解析到Gateway才能访问设置之后每次访问Gateway就会自动解析在TXT记录里的dnslink了。现在 <a href="https://ipfs.mayx.eu.org">https://ipfs.mayx.eu.org</a> 这个网站就可以直接访问我博客在IPFS上的数据了。这不比xLog自由度高不过我这个没办法存评论数据可能xLog的特色就是社交吧毕竟他们的主项目Crossbell就是主打的社交。希望可以整一个单独的插件专门用他们的网络来为我这种静态博客提供评论功能也是一个不错的选择毕竟ETH公链上的手续费太贵啦😂</p>
<h1 id="更好的永久存储">
<a href="#更好的永久存储"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 更好的永久存储
</h1>
<p>前面我说过IPFS只能防止篡改但不是作为永久存储的方案上公链当然是也一种永久存储的方案但是成本太高了我付不起。后来我了解到一种叫做Arweave的东西可以永久存储你的数据不过这不是免费的想存得要付AR币到链上才可以。还好4EVERLAND提供了一些免费上传到AR网络的额度非常的不错这样我以后每次上传我会把地址写到<a href="https://github.com/Mabbs/mabbs.github.io/releases">Github的Releases</a>里面,进一步的提高我博客永久存储的可能性。 </p><p>
另外我还听说似乎还有一种叫做ZeroNet的东西也是通过分布式的方式存储数据据群友所说也能在一定程度上永久存储。不过我试了试访问实在是太困难了😂而且现在程序也不在维护了所以也就放弃了。</p>
<h1 id="感想">
<a href="#感想"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 感想
</h1>
<p>Web3真是发展的越来越好了希望能有更多的人参与其中一起创建不受管束的网络吧。还有实现我的Mayx Forever计划😝 </p><p>
不过说来我也挺担心那个Crossbell的项目作为不受监管的平台只要知名度上来肯定会被滥用到死希望他们能活得更长一些吧。</p></main>
<small style="display: block">tags: <a rel="category tag" class="p-category" href="/search.html?keyword=Web3"><em>Web3</em></a> - <a rel="category tag" class="p-category" href="/search.html?keyword=%E5%8D%9A%E5%AE%A2"><em>博客</em></a> - <a rel="category tag" class="p-category" href="/search.html?keyword=%E6%90%AD%E5%BB%BA"><em>搭建</em></a> <span style="float: right;"><a href="https://gitlab.com/mayx/mayx.gitlab.io/tree/master/_posts/2022-10-19-web3.md">查看原始文件</a></span></small>
<h4 style="border-bottom: 1px solid #e5e5e5;margin: 2em 0 5px;">推荐文章</h4>
<p id="suggest-container">Loading...</p>
<script>
var suggest = $("#suggest-container");
$.get(BlogAPI + "/suggest?id=/2022/10/19/web3.html&update=" + lastUpdated.valueOf(), function (data) {
if (data.length) {
getSearchJSON(function (search) {
suggest.empty();
var searchMap = {};
for (var i = 0; i < search.length; i++) {
searchMap[search[i].url] = search[i];
}
var tooltip = $('<div class="content-tooltip"></div>').appendTo('body').hide();
for (var j = 0; j < data.length; j++) {
var item = searchMap[data[j].id];
if (item) {
var link = $('<a href="' + item.url + '">' + item.title + '</a>');
var contentPreview = item.content.substring(0, 100);
if (item.content.length > 100) {
contentPreview += "……";
}
link.hover(
function(e) {
tooltip.text($(this).data('content'))
.css({
top: e.pageY + 10,
left: e.pageX + 10
})
.show();
},
function() {
tooltip.hide();
}
).mousemove(function(e) {
tooltip.css({
top: e.pageY + 10,
left: e.pageX + 10
});
}).data('content', contentPreview);
suggest.append(link);
suggest.append(' - ' + item.date + '<br />');
}
}
});
} else {
suggest.html("暂无推荐文章……");
}
});
</script>
<br />
<div class="pagination">
<span class="prev">
<a href="/2022/10/14/crack-aes.html">
上一篇:如何破解我上次写的加密程序?
</a>
</span>
<br />
<span class="next">
<a href="/2022/11/08/cf-acc.html">
下一篇提高Cloudflare站点在中国的体验
</a>
</span>
</div>
<!--[if !IE]> -->
<link rel="stylesheet" href="/assets/css/gitalk.css">
<script src="/assets/js/gitalk.min.js"></script>
<div id="gitalk-container"></div>
<script>
var gitalk = new Gitalk({
clientID: '36557aec4c3cb04f7ac6',
clientSecret: 'ac32993299751cb5a9ba81cf2b171cca65879cdb',
repo: 'mabbs.github.io',
owner: 'Mabbs',
admin: ['Mabbs'],
id: '/2022/10/19/web3', // Ensure uniqueness and length less than 50
distractionFreeMode: false, // Facebook-like distraction free mode
proxy: "https://cors-anywhere.mayx.eu.org/?https://github.com/login/oauth/access_token"
})
gitalk.render('gitalk-container')
</script>
<!-- <![endif]-->
</section>
<!--[if !IE]> -->
<div id="landlord" style="left:5px;bottom:0px;">
<div class="message" style="opacity:0"></div>
<canvas id="live2d" width="500" height="560" class="live2d"></canvas>
<div class="live_talk_input_body">
<form id="live_talk_input_form">
<div class="live_talk_input_name_body" >
<input type="checkbox" id="load_this" />
<input type="hidden" id="post_id" value="/2022/10/19/web3.html" />
<label for="load_this">
<span style="font-size: 11px; color: #fff;">&#160;想问这篇文章</span>
</label>
</div>
<div class="live_talk_input_text_body">
<input name="talk" type="text" class="live_talk_talk white_input" id="AIuserText" autocomplete="off" placeholder="要和我聊什么呀?" />
<button type="submit" class="live_talk_send_btn" id="talk_send">发送</button>
</div>
</form>
</div>
<input name="live_talk" id="live_talk" value="1" type="hidden" />
<div class="live_ico_box" style="display:none;">
<div class="live_ico_item type_info" id="showInfoBtn"></div>
<div class="live_ico_item type_talk" id="showTalkBtn"></div>
<div class="live_ico_item type_music" id="musicButton"></div>
<div class="live_ico_item type_youdu" id="youduButton"></div>
<div class="live_ico_item type_quit" id="hideButton"></div>
<input name="live_statu_val" id="live_statu_val" value="0" type="hidden" />
<audio src="" style="display:none;" id="live2d_bgm" data-bgm="0" preload="none"></audio>
<input id="duType" value="douqilai" type="hidden" />
</div>
</div>
<div id="open_live2d">召唤伊斯特瓦尔</div>
<!-- <![endif]-->
<footer>
<p>
<small>Made with ❤ by Mayx<br />Last updated at 2026-01-01 00:00:18<br /> 总字数614622 - 文章数178 - <a href="/atom.xml" >Atom</a> - <a href="/README.html" >About</a></small>
</p>
</footer>
</div>
<script src="/assets/js/scale.fix.js"></script>
<!--[if !IE]> -->
<script src="/assets/js/main_new.js"></script>
<script src="/Live2dHistoire/live2d/js/live2d.js"></script>
<script src="/Live2dHistoire/live2d/js/message.js"></script>
<!-- <![endif]-->
</body>
</html>