时空云|如何在IPFS桌面上托管网站

这篇文章主要介绍了时空云|如何在IPFS桌面上托管网站 ,文中通过代码以及文档配合进行讲解,很详细,它对在座的每个人的研究和工作具有很经典的参考价值。 如果需要,让我们与区块链资料网一起学习。

https://www.interchains.cc/18966.html

时空云|如何在IPFS桌面上托管网站是很好的区块链资料,他说明了区块链当中的经典原理,可以给我们提供资料,时空云|如何在IPFS桌面上托管网站学习起来其实是很简单的,

不多的几个较为抽象的概念也很容易理解,之所以很多人感觉时空云|如何在IPFS桌面上托管网站比较复杂,一方面是因为大多数的文档没有做到由浅入深地讲解,概念上没有注意先后顺序,给读者的理解带来困难

时空云|如何在IPFS桌面上托管网站

  • IPFS
  • IPFS挖矿
  • FileCoin
  • Filecoin 挖矿

时空云|如何在IPFS桌面上托管网站。

时空云|如何在IPFS桌面上托管网站

我们将要托管的这个网站叫做随机…

时空云|如何在IPFS桌面上托管网站。

时空云|如何在IPFS桌面上托管网站

我们将要托管的这个网站叫做随机星球事实(Random Planet Facts),为什么要叫做“随机”呢?因为每刷新一次,就会有新的一句话出现,因此具有“随机性”。

首先,我们先构建一个名为“index.html”的文档,构建这个文件就跟构建word文档一样简单,我们可以先创建一个txt文档(又称为文本文档),然后,我们将下面的内容复制到txt文档中,选择将文档另存为,另存为的文件名为“index.html”。

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Random Planet Facts</title>
<meta
name="description"
content="Get a random fact about a planet in our solar system."
/>

<meta name="author" content="The IPFS Docs team." />
<style>
body {
margin: 15px auto;
max-width: 650px;
line-height: 1.2;
font-family: sans-serif;
font-size: 2em;
color: #fff;
background: #444;
}
</style>
</head>
<body onload="main()">
<h1>Random Planet Facts</h1>
<p id="output_p"></p>
<script>
function main() {
const facts = [
'Mars is home to the tallest mountain in our solar system.',
'Only 18 out of 40 missions to Mars have been successful.',
'Pieces of Mars have fallen to Earth.',
'One year on Mars is 687 Earth days.',
'The temperature on Mars ranges from -153 to 20 °C.',
'One year on Mercury is about 88 Earth days.',
'The surface temperature of Mercury ranges from -173 to 427°C.',
'Mercury was first discovered in 14th century by Assyrian astronomers.',
'Your weight on Mercury would be 38% of your weight on Earth.',
'A day on the surface of Mercury lasts 176 Earth days.',
'The surface temperature of Venus is about 462 °C.',
'It takes Venus 225 days to orbit the sun.',
'Venus was first discovered by 17th century Babylonian astronomers.',
'Venus is nearly as big as the Earth with a diameter of 12,104 km.',
'The Earth's rotation is gradually slowing.',
'There is only one natural satellite of the planet Earth, the moon.',
'Earth is the only planet in our solar system not named after a god.',
'The Earth is the densest planet in the solar system.',
'A year on Jupiter lasts around 4333 earth days.',
'The surface temperature of Jupiter is around -108°C.',
'Jupiter was first discovered by 7th or 8th century Babylonian astronomers.',
'Jupiter has 4 rings.',
'A day on Jupiter lasts 9 hours and 55 minutes.',
'Saturn was first discovered by 8th century Assyrians.',
'Saturn takes 10756 days to orbit the Sun.',
'Saturn can be seen with the naked eye.',
'Saturn is the flattest planet.',
'Saturn is made mostly of hydrogen.',
'Four spacecraft have visited Saturn.',
'Uranus was discovered by William Herschel in 1781.',
'A year on Uranus takes 30687 earth days.',
'Uranus turns on its axis once every 17 hours, 14 minutes.',
'With minimum atmospheric temperature of -224°C Uranus is nearly coldest planet in the solar system.',
'Only one spacecraft has flown by Uranus, the Voyager 2.',
'Neptune was discovered in 1846 by Urbain Le Verrier and Johann Galle.',
'Neptune has 14 moons.',
'The average temperatue of Neptune is about -201 °C.',
'There is a 1:20 million scale model of the solar system in Sweden.',
'The gap between the Earth and our moon is bigger than the diameters of all the planets combined.',
'The first accurate calculation of the speed of light was using Jupiter's moons',
'Jupiter's magnetic field is believed to be a result of rapidly spinning metallic hydrogen at the core, and is ~10x stronger than the Earth's.',
'Venus spins backwards.',
'Uranus spins sideways, relative to the ecliptic plane of the solar system.',
'It is easier to reach Pluto or escape the solar system from Earth than being able to <i>land</i> on the Sun.'
]
document.querySelector('#output_p').innerHTML =
facts[Math.floor(Math.random() * facts.length)]
}
</script>
</body>
</html>

将上述内容复制并且存储为“index.html”文档之后,我们可以看到,原本的文本文档变成了一个网页索引文件。

时空云|如何在IPFS桌面上托管网站

接下来,我们将index.html文件添加到IPFS桌面中。

时空云|如何在IPFS桌面上托管网站

文件添加成功后,点击index.html旁边的“三点”,单击复制将文件的URL复制到剪贴板。

时空云|如何在IPFS桌面上托管网站

最后,我们只需要将链接复制到浏览器上, 然后以"ipfs.io”为开头的网站就展现在我们眼前啦!

时空云|如何在IPFS桌面上托管网站

想要了解更多IPFS和Filecoin资讯的投资者,可关注IPFS中国社区官网:http://ipfs.cn 和时空云科技官网:http://yunos.io

部分转自网络,侵权联系删除www.interchains.cchttps://www.interchains.cc/18966.html

区块链毕设网(www.interchains.cc)全网最靠谱的原创区块链毕设代做网站 部分资料来自网络,侵权联系删除! 最全最大的区块链源码站 ! QQ3039046426
区块链知识分享网, 以太坊dapp资源网, 区块链教程, fabric教程下载, 区块链书籍下载, 区块链资料下载, 区块链视频教程下载, 区块链基础教程, 区块链入门教程, 区块链资源 » 时空云|如何在IPFS桌面上托管网站

提供最优质的资源集合

立即查看 了解详情