Hyperledger Fabric v1.4(LTS) 系列(5.1):Developing Applications 应用开发

区块链 专栏收录该内容
33 篇文章 0 订阅

Hyperledger Fabric v1.4(LTS) 系列(5.1):Developing Applications 应用开发

官方手册原文
https://hyperledger-fabric.readthedocs.io/en/release-1.4/developapps/developing_applications.html

https://hyperledger-fabric.readthedocs.io/en/release-1.4/tutorial/commercial_paper.html

Developing Applications

This topic covers how to develop a client application and smart contract to solve a business problem using Hyperledger Fabric. In a real world Commercial Paper scenario, involving multiple organizations, you’ll learn about all the concepts and tasks required to accomplish this goal. We assume that the blockchain network is already available.

本主题介绍如何开发客户端应用和智能合约,以使用Hyperledger Fabric 解决业务问题。在一个涉及多个组织的现实世界商业票据场景中,您将了解实现此目标所需的所有概念和任务。我们假设区块链网络已经可用。

The topic is designed for multiple audiences:

  • Solution and application architect
  • Client application developer
  • Smart contract developer
  • Business professional

该主题面向多种受众:

  • 解决方案和应用架构师
  • 客户端应用开发人员
  • 智能合约开发者
  • 商务专业人士

You can chose to read the topic in order, or you can select individual sections as appropriate. Individual topic sections are marked according to reader relevance, so whether you’re looking for business or technical information it’ll be clear when a topic is for you.
您可以选择按顺序阅读主题,也可以根据需要选择。每个主题部分都根据读者的相关性进行标记,您无论是查找业务信息还是技术信息,都会很清楚主题是否适合。

The topic follows a typical software development lifecycle. It starts with business requirements, and then covers all the major technical activities required to develop an application and smart contract to meet these requirements.
本主题遵循典型的软件开发生命周期。它从业务需求开始,涵盖为满足需求而开发应用程序和智能合约所需的所有主要技术活动。

If you’d prefer, you can try out the commercial paper scenario immediately, following an abbreviated explanation, by running the commercial paper tutorial. You can return to this topic when you need fuller explanations of the concepts introduced in the tutorial.
您还可以现在就试试这个场景。按照概要介绍,运行商业票据[教程](https://hyperledger fabric.readthedocs.io/en/release-1.4/tutorial/commercial_paper.html)。当需要对本教程中介绍的概念进行更全面的解释时,可以回到本主题。

场景分析

PaperNet is a commercial paper network that allows suitably authorized participants to issue, trade, redeem and rate commercial paper.
PaperNet是一个商业票据网络,允许合适的被授权的参与者发行、交易、兑换商业票据及评级。

[外链图片转存失败(img-8936Ra5s-1562856515816)(https://hyperledger-fabric.readthedocs.io/en/release-1.4/_images/develop.diagram.1.png)]

The PaperNet commercial paper network. Six organizations currently use PaperNet network to issue, buy, sell, redeem and rate commercial paper. MagentoCorp issues and redeems commercial paper. DigiBank, BigFund, BrokerHouse and HedgeMatic all trade commercial paper with each other. RateM provides various measures of risk for commercial paper.
PaperNet商业票据网络。目前有六家机构使用PaperNet网络发行、购买、销售、兑换和评级商业票据。MagentCorp发行和赎回商业票据。DigiBank、BigFund、BrokerHouse和HedgeMatic相互交易商业票据。RateM为商业票据提供各种风险度量。

Let’s see how MagnetoCorp uses PaperNet and commercial paper to help its business.
让我们看看MagnetoCorp是如何使用票据网络和商业票据来帮助其业务的。

Introducing the actors

MagnetoCorp is a well-respected company that makes self-driving electric vehicles. In early April 2020, MagnetoCorp won a large order to manufacture 10,000 Model D cars for Daintree, a new entrant in the personal transport market. Although the order represents a significant win for MagnetoCorp, Daintree will not have to pay for the vehicles until they start to be delivered on November 1, six months after the deal was formally agreed between MagnetoCorp and Daintree.
MagnetoCorp是一家生产自动驾驶电动汽车的著名公司。2020年4月初,MagnetoCorp赢得了一个大订单,为个人运输市场的新进入者Daintree生产10000辆D型车。尽管该订单对MagnetoCorp来说是一个重大胜利,但在Daintree和MagnetoCorp正式达成协议6个月后的11月1日交付之前,Daintree不必支付车辆费用。

To manufacture the vehicles, MagnetoCorp will need to hire 1000 workers for at least 6 months. This puts a short term strain on its finances – it will require an extra 5M USD each month to pay these new employees. Commercial paper is designed to help MagnetoCorp overcome its short term financing needs – to meet payroll every month based on the expectation that it will be cash rich when Daintree starts to pay for its new Model D cars.

为了生产汽车,MagnetoCorp需要至少雇佣1000名工人达6个月。这给它的财务带来了短期压力—每月需要额外500万美元支付给这些新员工。商业票据旨在帮助MagnetoCorp克服其用以支付每月工资的短期融资需求,这基于当Daintree开始支付D型车款时,MagnetoCorp将现金充裕的预期。

At the end of May, MagnetoCorp needs 5M USD to meet payroll for the extra workers it hired on May 1. To do this, it issues a commercial paper with a face value of 5M USD with a maturity date 6 months in the future – when it expects to see cash flow from Daintree. DigiBank thinks that MagnetoCorp is creditworthy, and therefore doesn’t require much of a premium above the central bank base rate of 2%, which would value 4.95M USD today at 5M USD in 6 months time. It therefore purchases the MagnetoCorp 6 month commercial paper for 4.94M USD – a slight discount compared to the 4.95M USD it is worth. DigiBank fully expects that it will be able to redeem 5M USD from MagnetoCorp in 6 months time, making it a profit of 10K USD for bearing the increased risk associated with this commercial paper. This extra 10K means it receives a 2.4% return on investment – significantly better than the risk free return of 2%.

5月底,MagnetoCorp需要500万美元来支付5月1日额外雇佣的工人工资。为此,它发行了面值为500万美元、到期日为6个月的商业票据,预计六个月后将看到来自Daintree的现金流。Digibank认为MagnetoCorp值得信赖,因此不需要比中央银行基准利率2%高出很多溢价,后者6个月后500万美元的价格在今天价值495万美元。因此,它以494万美元的价格购买了MagnetoCorp的6个月期的商业票据,与价值495万美元相比,略有折扣。Digibank完全预计,它将能够在6个月内从Magnetorp赎回500万美元,使其在承担与本商业票据相关的风险增加时获得1万美元的利润。额外的1万美元意味着它获得了2.4%的投资回报,远远好于2%的无风险回报。

At the end of June, when MagnetoCorp issues a new commercial paper for 5M USD to meet June’s payroll, it is purchased by BigFund for 4.94M USD. That’s because the commercial conditions are roughly the same in June as they are in May, resulting in BigFund valuing MagnetoCorp commercial paper at the same price that DigiBank did in May.
6月底,当MagnetoCorp发行新的500万美元商业票据来支付6月的工资时,BigFund以494万美元收购了它。这是因为6月份的商业条件与5月份大致相同,导致BigFund以与Digibank 5月份相同的价格对MagnetoCorp商业票据进行估值。

Each subsequent month, MagnetoCorp can issue new commercial paper to meet its payroll obligations, and these may be purchased by DigiBank, or any other participant in the PaperNet commercial paper network – BigFund, HedgeMatic or BrokerHouse. These organizations may pay more or less for the commercial paper depending on two factors – the central bank base rate, and the risk associated with MagnetoCorp. This latter figure depends on a variety of factors such as the production of Model D cars, and the creditworthiness of MagnetoCorp as assessed by RateM, a ratings agency.
随后的每个月,MagnetoCorp都可以发行新的商业票据来履行其工资义务,这些票据可以由Digibank或PaperNet商业票据网络的任何其他参与者—BigFund、Hedgematic或BrokerHouse购买。这些机构可能会根据中央银行基准利率和MagnetoCorp相关风险这两个因素,或多或少地支付商业票据的费用。风险取决于多种因素,如D型汽车的生产,以及评级机构Ratem评估的MagnetoCorp的信誉。

The organizations in PaperNet have different roles, MagnetoCorp issues paper, DigiBank, BigFund, HedgeMatic and BrokerHouse trade paper and RateM rates paper. Organizations of the same role, such as DigiBank, Bigfund, HedgeMatic and BrokerHouse are competitors. Organizations of different roles are not necessarily competitors, yet might still have opposing business interest, for example MagentoCorp will desire a high rating for its papers to sell them at a high price, while DigiBank would benefit from a low rating, such that it can buy them at a low price. As can be seen, even a seemingly simple network such as PaperNet can have complex trust relationships. A blockchain can help establish trust among organizations that are competitors or have opposing business interests that might lead to disputes. Fabric in particular has the means to capture even fine-grained trust relationships.
PaperNet中的组织具有不同的角色,MagnetoCorp发行票据、DigiBank、BigFund、Hedgematic和BrokerHouse交易商业票据,Ratem对票据评级。同样角色的组织,如Digibank、BigFund、Hedgematic和BrokerHouse都是竞争对手。不同角色的组织不一定是竞争对手,但仍可能有相抵触的商业利益,例如,MagentoCorp希望其票据获得高评级而得以高价出售,而DigiBank将从低评级中获益,这样它就可以低价购买。可以看出,即使是像商业票据这样看似简单的网络,也可能有复杂的信任关系。区块链可以帮助在竞争对手或具有可能导致争议的对立商业利益的组织之间建立信任。Fabric尤其擅长捕获细粒度信任关系的方法。

Let’s pause the MagnetoCorp story for a moment, and develop the client applications and smart contracts that PaperNet uses to issue, buy, sell and redeem commercial paper as well as capture the trust relationships between the organizations. We’ll come back to the role of the rating agency, RateM, a little later.

让我们暂停一下MagnetoCorp的故事,以开发Papernet用于发行、购买、销售和赎回商业票据,并捕获组织之间的信任关系的客户端应用和智能合约。稍后我们将回到评级机构RateM的角色。

  • 0
    点赞
  • 0
    评论
  • 0
    收藏
  • 打赏
    打赏
  • 扫一扫,分享海报

参与评论
请先登录 后发表评论~
©️2021 CSDN 皮肤主题: 精致技术 设计师:CSDN官方博客 返回首页

打赏作者

yyri

你的鼓励将是我创作的最大动力

¥2 ¥4 ¥6 ¥10 ¥20
输入1-500的整数
余额支付 (余额:-- )
扫码支付
扫码支付:¥2
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值