News.EOS.WiKi Bilingual News & Info Of EOS

EOSIO™软件发布——适用于Swift和Java的本地化开发工具包/EOSIO™ Software Release: Native SDKsfor Swift and Java

E

译文/Translated:

EOSIO发布新的开源工具,创建EOSIO™上的一流的移动端体验

仅在很短的一段时间内,我们就见证了创新的EOSIO Web应用的爆炸式增长,其中很大一部分原因是诸如EOSJS这些库的增长。EOSJS每周有超过5000多次下载,它给JavaScript开发人员提供了他们和EOSIO区块链交互及向世界各地的区块链用户兑现承诺的工具。

然而,我们也知道,用户现在本地应用程序的移动端上花的时间更多。很大一个原因是,本地应用往往可以比网页端的应用能带来更多、更好的体验。今天,在面向消费者的产品策略上,本地移动应用是一个重要的组成部分。

正是基于上述因素,所以现在我们很高兴地宣布发布两个新的开源EOSIO工具的alpha版,它们将用以加强EOSIO上的本地移动应用发展,这两个工具是Swift的EOSIO SDK适用Java的EOSIO SDK

便利开发者、灵活的架构

这些软件开发工具包(SDK)提供了和EOSIO区块链交互的本地API;创建、签署和广播交易;处理密钥和获得签名;数据序列化/反序列化等。

因为我们的目标是Java和Swift两种编程语言,我们给最受欢迎的移动平台——安卓和IOS——带来了这些功能,我们希望这会给各地更多的用户带来有吸引力的、由EOSIO支持的本地化体验。

这些SDK采用的概念借鉴了EOSJS的想法,即要给大量的用例和环境带来极大的灵活性,这些用例和环境是插入到同一个核心库中的独立、可互换的签名提供程序

核心库

适用于Swift的EOSIO SDK和适用于Java的EOSIO SKD的核心库负责简化交易的生命周期。他们向开发者提供简单、常用的方法让他们向EOSIO节点创建和使用交易、收集必要的签名和准备及广播必要的交易。但是,大部分繁重的工作发生在插入的提供者身上。

The Signature Provider

签名提供程序

签名提供程序可以说是所有的服务提供抽象化中最灵活的。它负责a)找到哪些密钥可以用来签名;b)要求和获得交易必要的签名。

但是,它是如何执行的就完全依赖开发者选定的出来“插入”该交易的特定签名提供程序。只要切换出签名提供程序,签名请求就可以用好几个方式路由。

签名提供程序能够执行许多有用的功能。比如说,任何需要平台的密钥库或安全硬件签名中的密钥签名的人都可以用签名提供程序配置该动作。同样,如果想从用户设备中的钱包应用获得签名也是如此,因为签名提供程序也可以执行该操作。

对于应用开发者和用户这都是好事。对开发者来说,这个功能意味着根据他们选择的签名提供程序,他们不再会因为处理和保证用户密钥安全而上钩。对用户来说,这意味着他们可以喜欢的应用可以容易和钱包或选定的验证器一起工作,从而创造双赢的局面。除了核心库,alpha测试版中,我们还提供了以下签名提供程序。

和平时一样,我们鼓励社区其他人能够创建和开源其它签名提供程序。

获得更多关于签名提供程序概念的信息,请参考我们上期文章:EOSJS Major Update V20.0.0 Beta: Entrusting key management to signature providers for a more secure future of javascript development for EOSIO(EOSJS重大更新V20.0.0测试版:委托签名提供者进行密钥管理,为EOSIO提供更加安全的javascript开发未来

RPC, ABI和序列化提供服务程序

交易还配置了RPC, ABI, 和序列化提供服务程序

  • RPC提供程序负责向节点的所有RPC调用,以及一般的网络处理(可达性、重做和故障转移逻辑等)
  • 序列化提供程序处理ABI驱动的交易和动作序列化以及在JSON和二进制数据表示之间的反序列化。
  • ABI提供程序负责在序列化和反序列化时,获取和缓存ABI

尽管交换这些程序的需求比较少,但是抽象化还是非常有价值,尤其是涉及到SDK的其它价值主张的时候——支持非移动端的平台时。

移动端和其它平台

值得注意的是,Java和Swift都是通用编程语言,他们并不局限在移动平台使用。实际上,Java因为“一次编写、随时运行”的理念领跑安卓系统,乎无处不在。

考虑到这点,我们有意识地让核心SDK库通用、尽量不受平台限制,并将所有需要特定平台的代码放到单独的程序库中。

尽管我们旨在安卓平台和iOS平台上分别测试了Java以及Swift的EOSIO SDK的alpha版本,但是当使用正确的平台兼容提供程序进行实例化的时候,核心库没有产生多少额外的工作量。我们欢迎社区能够在其它平台测试核心库,提出问题和情况,最终提高平台的兼容性。

参与其中

如果您对使用和/或改进这些库感兴趣,我们还提供以下参考资料。

应用示例

为了帮助开发者开始使用这些新的SDK,我们创建了iOS安卓的示例应用。这些例子都能简单地展示如何利用EOSIO SDK和基于EOSIO的区块链集成。这些应用做两个事情:它们获取您账户的代币余额、发出转账动作。

文档

联系我们

如果您愿意给我们反馈并想和我们团队并肩让EOSIO软件更进一步,您给可以给我们的开发者关系小组发邮件:developers@block.one.

您还可以通过在EOSIO开发者入口订阅我们的更新。我们希望能够不断为EOSIO开发者提供更好用的软件,同时,我们也不断为区块链技术的大规模应用奠定基础。

. . .

所有标有商标™和®的产品和公司名皆为其所有者持有。使用这些名字并不代表我司与其存在任何从属关系,也不代表我司对其认可。

免责声明:Block.one是作为EOSIO社区的一员志愿对其做出贡献,但是并不能保证软件的整体性能和应用的性能。我们不代表、保证、确保或执行这里描述的任何版本、GitHub上发布的文件、EOSIO软件或者先前提到的,不管是明确说明或者暗示的,任何文件的发布,包括但不限于承诺书、商业性、为某个目的的实用性、不侵权性等。在任何情况下,我们都不对任何说法、损失或责任负责、不管是涉及合约、侵权或被侵权的情事件,不管这是因为软件或文件或使用或软件和文件中涉及的其它事宜导致,还是和这些情况相关,我们都不对此负责。测试结果或者性能数据都是有指示性的,不可能反应所有情况下的性能。任何关于第三方的引用、第三方产品、资源和服务都不是Block.one背书和支持的。第三方产品可能在任何时间被升级、改变或暂停,所以这里提供的信息可能会过时或不准确。任何使用本软件提供的关于第三放软件、产品和服务的个体应该建议这些第三方提供执照有效期、免责声明和免责条款。Block.one, EOSIO, EOSIO Labs, EOS, heptahedron和相应的图标都是Block.one的商标。这里提到的其它商标都是他们相应持有人的产权。

原文/Original:

New Open Source Tools to Create First-Class Mobile Experiences on EOSIO™

In a very short period of time, we’ve witnessed an explosion of innovative EOSIO web applications due in large part to libraries like EOSJS. EOSJS, with over 5,000 weekly downloads, provides JavaScript developers with the tools they need for interacting with EOSIO blockchains, and for realizing the promise of blockchain technology for users around the world.

As we all know, however, users are spending more of their time on mobile devices in native applications. This is largely because native apps are often able to provide richer, more engaging experiences than their browser-based counterparts. Today, native mobile applications are a crucial component of consumer-facing product strategies.

It is for this reason that we are excited to announce the alpha release of two new open source EOSIO tools to enhance native mobile application development on EOSIO, an EOSIO SDK for Swift and EOSIO SDK for Java.

Developer Convenience, Flexible Architecture

These Software Development Kits (SDKs) provide native APIs for interacting with EOSIO blockchains; creating, signing and broadcasting transactions; handling keys and obtaining signatures; data serialization/deserialization, and more.

And by targeting both the Java and Swift programming languages, we’re bringing these capabilities to the most popular mobile platforms — Android and iOS — contributing to what we hope will be a proliferation of compelling, native EOSIO-powered experiences for mobile users everywhere.

These SDKs employ a conceptborrowed from EOSJS that provide a great deal of flexibility for a variety ofuse cases and environments — that of independent,interchangeable providers that plug into one core library.

The Core Libraries

The core EOSIO SDK for Swift and EOSIO SDK for Java libraries are responsible for facilitating the transaction lifecycle. They provide developers with easy and idiomatic ways of creating and working with transactions, collecting the necessary signatures, and preparing and broadcasting those transactions to EOSIO nodes. Much of the heavy lifting, however, takes place in the providers that are plugged into it.

The Signature Provider

The Signature Provider is arguably the most flexible of all of the provider abstractions. It is responsible for a) finding out what keys are available for signing and b) requesting and obtaining the signatures required for the transaction.

How it goes about executing that, though, is entirely up to the particular signature provider the developer has chosen to “plug in” for that transaction. By simply switching out the signature provider, signature requests can be routed in any number of ways.

A signature provider is able to carry out a number of useful functions. For example, anyone who needed a signature from keys in the platform’s key store or secure hardware signing element can simply configure the transaction with a signature provider that does it. The same goes for needing signatures from a wallet app running on a user’s device, which a signature provider can also perform.

This is great news for both app developers and users. For developers, this feature means that depending on their selection of signature providers, they no longer have to be on the hook for handling and securing a user’s private keys. For users, it means that the apps they love can easily work with the wallet or authenticator of their choice, creating a win-win situation.

Along with the core libraries, we are releasing the following signatures providers, in alpha.

As always, we encourage others in the community to create and open source other signature providers.

For more information about the signature provider concept, check out our previous article: EOSJS Major Update V20.0.0 Beta: Entrusting key management to signature providers for a more secure future of javascript development for EOSIO

The RPC, ABI, and Serialization Providers

Transactions are also configured with RPC, ABI, and Serialization providers.

  • RPC Providers are responsible for all RPC calls to nodeos, as well as general network handling (reachability, retry and failover logic, etc.)
  • Serialization providers handle ABI-driven transaction and action serialization and deserialization between JSON and binary data representations
  • ABI providers are responsible for fetching and caching ABIs for use during serialization and deserialization

While the need to swap these providers is less frequent, the abstraction is still quite valuable, especially when it comes to one of these SDKs’ other value propositions — support for platforms other than mobile.

Mobile and Beyond

It is important to note that both Java and Swift are general purpose programming languages, and that they are not restricted to running on mobile platforms. In fact, Java, with its “write once, run anywhere” philosophy, precedes Android and is virtually ubiquitous.

With that in mind, we have purposefully set out to make the core SDK libraries as generic and platform agnostic as possible, relegating any platform-specific code to the individual provider libraries.

While we have only tested the alpha versions of EOSIO SDK for Java on the Android platform and EOSIO SDK for Swift on iOS, when instantiated with the right platform-compatible providers, the core library should run with little additional effort. We welcome the community to contribute by testing the core libraries on other platforms and creating issues and pull requests that improve compatibility with those platforms.

Get Started and Get Involved

We have several resources for those interested in using these libraries and/or contributing.

Example Apps

To help developers get started using these new SDKs, we have created both iOS and Android example applications. These examples are simple demonstrations of how to integrate with EOSIO-based blockchains using the EOSIO SDKs. The applications do two things: they fetch your account token balance and push a transfer action.

Documentation

Stay Connected

If you are interested in providing feedback and working more closely with our team to improve the EOSIO for developers, you can send our developer relations team an email at developers@block.one.

You can also keep up to date with future updates by subscribing to our mailing list on the EOSIO Developer Portal. We are excited to be regularly improving the usability of the software for EOSIO developers as we continue to lay a foundation for the mass adoption of blockchain technology.

. . .

All product and company names are trademarks™ or registered® trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them.

Disclaimer: Block.one makes itscontribution on a voluntary basis as a member of the EOSIO community and is notresponsible for ensuring the overall performance of the software or any relatedapplications. We make no representation, warranty, guarantee or undertaking inrespect of the releases described here, the related GitHub release, the EOSIOsoftware or any related documentation, whether expressed or implied, includingbut not limited to the warranties or merchantability, fitness for a particularpurpose and noninfringement. In no event shall we be liable for any claim,damages or other liability, whether in an action of contract, tort orotherwise, arising from, out of or in connection with the software ordocumentation or the use or other dealings in the software or documentation.Any test results or performance figures are indicative and will not reflectperformance under all conditions. Any reference to any third party orthird-party product, resource or service is not an endorsement orrecommendation by Block.one. We are not responsible, and disclaim any and all responsibilityand liability, for your use of or reliance on any of these resources.Third-party resources may be updated, changed or terminated at any time, so theinformation here may be out of date or inaccurate. Any person using or offeringthis software in connection with providing software, goods or services to thirdparties shall advise such third parties of these license terms, disclaimers andexclusions of liability. Block.one, EOSIO, EOSIO Labs, EOS, the heptahedron andassociated logos are trademarks of Block.one. All other trademarks referencedherein are the property of their respective owners.

原文链接/Original URL:

https://medium.com/eosio/eosio-software-release-native-sdks-for-swift-and-java-e6086ddd37b8

About the author

By user
News.EOS.WiKi Bilingual News & Info Of EOS

Recent Posts