js-ipfs 0.37.0上线

[复制链接]
7699 |0
发表于 2019-8-7 18:06:16 | 显示全部楼层 |阅读模式
新构造函数,更好的DNSLink支持和委派路由!




亮点

全新的构造函数
我们正在将IPFS、libp2p和IPLD模块转换为使用async/ wait和async迭代器而不是回调。这最终会出现在JS IPFS编程API中,其中可能会有一些影响应用程序的更改。为了在这种情况下简化转换,我们鼓励新开发人员和现有开发人员不要使用基于回调的api,而是使用基于承诺的api。您很快就会看到我们的API文档中反映的变化。目前,还没有中断的更改,所有现有的api仍然像往常一样使用回调工作。(本文由IPFS中国社区编译)
在这个版本中,有一种新的方式来构建一个IPFS节点使用的承诺:
constIPFS = require('ipfs')
const node = await IPFS.create()
// Done, ready to use!
您通常传递给构造函数的所有常用选项都可以传递给create。我们提到过它是完全向后兼容的吗?嗯,是的。这里没有重大变化——你仍然可以使用new IPFS()和等待ready事件。或者,您也可以使用构造函数,等待新的“ready”承诺,如下所示:
constIPFS = require('ipfs')
const node = new IPFS()
await node.ready
// Done, ready to use!
支持DNSLinkIPNS名称解析
JS IPFS最终可以解析一个DNSLink IPNS路径。这意味着jsipfs name resolve /ipns/ipfs.io现在将查询dnslink TXT记录的DNS,并返回/ipfs/QmRq5rhjnfFHYFYbYXoqPpcJQHKu3SUuHADzSzX9ECN5eM(例如)。
它还可以递归地工作,所以您的DNSLink TXT记录可以返回另一个IPNS路径来解析,并且它会继续下去。慢慢地一路下来。
奖金这也适用于网关,所以http://127.0.0.1:8080/ipns/ipfs.io将解析并显示ipfs.io的网站。
委托对等点和内容路由
JS IPFS现在支持将对等点和内容路由委托给网络上的另一个节点。
这是什么意思呢?当你委派任务时,你会让别人去做。在委托的对等点和内容路由中,我们得到一个不同的IPFS节点来查找网络上的一个内容块或另一个对等点。
授权允许JS IPFS利用其他节点的路由能力。通常,我们将任务委托给对DHT具有无限制访问权的IPFS节点。这对于在浏览器中运行的IPFS节点很有用,甚至对于在资源受限环境中运行的节点也很有用。
运行在Node.js中的IPFS节点位于NATs之后,或者不运行DHT,也将受益于使用委托路由器。如果您正在运行DHT,则该委托将用作备用路由器。
我们已经设置了2个委托节点,您可以使用它们进行开发和测试,查看有关在JS IPFS中配置委托路由器的文档和libp2p委托路由示例,以获得更多信息!
Web UI修订文件&对等点
Web UI在2.5版中获得了全新的生命力!
我们介绍了一个为新用户设计的帮助系统,每个部分都有解释。
对等点页面现在允许您通过“添加连接”连接到特定的对等点。我们还修改了对等点表,包括排序、每个对等点的标识符、简化的位置、新的协议和传输列以及延迟!
在文件方面,您现在可以查看任何站外文件。但这意味着什么呢?您现在可以看到您的引脚,删除引脚,添加新的引脚,导航到任何/ipfs/QmHash或/ipns/domain.com路径,并探索您从未做过的ipfs世界。
API的变化
新构造函数。现在推荐的以编程方式创建IPFS节点的方法是等待IPFS.create()。这种变化是向后兼容。
当访问目录/而不是重定向到/index.html时,网关现在隐式地响应/index.html的内容
支持在HTTP网关上添加/ipns/路径
例如:http://127.0.0.1:9090/ipns/tr.wikipedia-on-ipfs.org/wiki/Anasayfa.html
支持添加ipfs name resolve /ipns/
(BREAKING)ipfs name resolve现在默认是递归的,将recursive选项设置false为禁用
非常感谢大家让这个版本成为可能
按字母顺序排列,以下是对这个版本做出了2091次贡献的126个贡献者名单:

Abraham Elmahrek (1 PR, 1 issue, 2 comments)Adam Uhlíř (4 PRs, 1 issue, 5 reviews, 5 comments)AkshitV (1 issue, 1 comment)Alan Shaw (77 PRs, 18 issues, 125 reviews, 219 comments)Alessandro Ricottone (2 PRs, 1 issue, 2 comments)Alex Potsides (18 PRs, 6 issues, 59 reviews, 43 comments)Anarkrypto (3 issues)André Cruz (1 PR, 3 issues, 10 comments)AndrewH (1 issue, 1 comment)Andy Hin (1 issue, 1 comment)antemortem (1 issue)area (1 comment)arminsal1 (4 comments)Arve Knudsen (5 PRs, 1 issue, 3 reviews, 17 comments)Asutosh (1 comment)b-rohit (2 comments)Barnyard (2 issues, 1 comment)Bora M. Alper (1 PR)Carson Farmer (1 issue, 3 comments)Carsten Munk (1 comment)Chirag Shinde (2 PRs, 5 comments)Christopher Joel (1 PR, 1 comment)Clemens Brunner (1 PR, 3 comments)Codecov (1 comment)Cody Eilar (2 issues, 4 comments)Dan Shields (2 PRs)Daniel Constantin (1 comment)David Dias (1 PR, 12 issues, 14 reviews, 42 comments)dependabot-preview (59 PRs, 38 comments)Dietrich Ayala (1 issue, 3 comments)Diogo Silva (1 PR, 2 reviews)dirkmc (16 PRs, 7 issues, 117 reviews, 73 comments)Dominic Della Valle (1 PR)Dzmitry Afanasenka (1 issue)Dzmitry Bachko (1 PR)Filip Š (2 PRs, 1 issue, 4 comments)Florian (1 issue)Frederik Batuna (1 issue)Friedel Ziegelmayer (1 PR, 2 comments)ghbjklhv (1 issue)Glenn Vandeuren (1 issue)Gopalakrishna Palem (2 issues, 7 comments)Gorka Ludlow (1 comment)Gregg Altschul (1 comment)Guilherme Cunha (1 issue)hapsody (1 PR, 2 issues, 5 comments)Harris Levine (4 comments)Henrique Dias (3 PRs, 1 issue, 1 comment)hhfeng (2 issues, 3 comments)Hugo Dias (17 PRs, 3 issues, 47 reviews, 45 comments)Irakli Gozalishvili (10 comments)Isaac Jacobs (1 issue, 3 comments)Jacob Heun (23 PRs, 6 issues, 59 reviews, 141 comments)Jakub (1 PR)Jesho Carmel (1 comment)Jim Pick (1 comment)João Antunes (1 comment)John Hiesey (4 comments)John Wehr (1 issue, 8 comments)John_Suu (5 comments)Jonybang (1 PR, 1 issue, 4 comments)Jordan Last (2 comments)Jorropo (3 PRs, 3 comments)Joseph Krug (1 comment)Juan Benet (1 comment)Justin Maier (1 PR, 1 issue, 8 comments)Kia (1 issue, 3 comments)ksvirsky (1 issue, 1 comment)KuhnChris (1 PR, 2 issues, 4 comments)kumavis (3 PRs, 11 reviews, 16 comments)Lennart Grahl (2 comments)Leo (1 issue, 1 comment)LeonFangCN (1 issue, 1 comment)lin onetwo (2 comments)Lukasz Juraszek (1 comment)Maciej Krüger (2 PRs, 3 issues, 2 reviews, 23 comments)Mahipatsinh Jadav (1 comment)Mapiac (1 comment)Marcin Rataj (12 PRs, 7 issues, 25 reviews, 32 comments)Marnee Dearman (KG7SIO) (1 issue)Mars Robertson (1 comment)Matt Ober (2 PRs, 1 review, 11 comments)Matteo Collina (3 comments)Max Graey (6 comments)Michael Avila (1 review, 3 comments)Michael Bradley (1 comment)Michael Burns (3 comments)Michael FIG (1 PR)Michiel De Backker (1 comment)Mikeal Rogers (1 PR, 3 issues, 15 comments)Mikerah (1 comment)Mikhail Ivantsov (1 issue, 2 comments)Mitra Ardron (3 issues)MollyM (1 comment)Nate Foss (1 PR, 5 issues, 5 comments)Nick Popeka (1 comment)Nick Poulden (1 PR, 2 comments)ohager (2 comments)Oli Evans (1 PR, 3 issues, 1 review, 6 comments)Pat White (1 comment)Pedro Teixeira (2 comments)Péter Huba (1 comment)Peter Occil (1 comment)pldespaigne (2 comments)Prabhakar Poudel (9 PRs, 4 reviews, 22 comments)Qmstream (3 PRs, 1 issue, 2 comments)Raul (1 comment)rayj00 (2 issues)Richard Schneider (1 comment)Robert Kiel (1 comment)Robert Misiorowski (1 issue, 1 comment)Rod Vagg (9 reviews, 1 comment)Saquib ul hassan (1 issue, 1 comment)shamb0t (1 issue, 1 comment)sigmatics (1 comment)Steven Allen (1 PR, 1 issue, 1 review, 5 comments)Tapasweni Pathak (2 PRs, 7 comments)Teri Chadbourne (5 PRs, 4 comments)thanusreemohan (1 issue, 3 comments)Topper Bowers (1 issue)Vasco Santos (20 PRs, 4 issues, 75 reviews, 45 comments)Volker Mische (22 PRs, 2 issues, 9 reviews, 40 comments)warlockD (1 issue)Whymarrh Whitby (1 comment)yuwiggin (1 comment)zthomas (1 issue)

你也想做贡献吗?
您是否愿意为IPFS项目做出贡献却不知道如何做呢?你可以从以下几个地方开始:
使用js-ipfs repo中的help wanted标签检查问题
加入IPFS All Hands,介绍您自己,并让我们知道您想在哪里做出贡献—https://github.com/ipfs/teammgmt/# weekly-ipfs-all-hands
测验IPFS,让我们看看你做了什么!All Hands call也是演示的完美场所,加入并向我们展示您所构建什么。
请访问http://discuss.ipfs加入讨论。并帮助用户找到他们的答案。
加入ipfs核心实现每周同步并成为行动的一部分!

作者:Alan Shaw
本文由IPFS中国社区编译,原文链接:https://blog.ipfs.io/2019-08-06-js-ipfs-0-37/

0fcuu52uzyu.jpg

0fcuu52uzyu.jpg
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

热门版块
快速回复 返回顶部 返回列表