System and method for supporting SQL-based rich queries in hyperledger fabric blockchains
SQL-based rich queries in Hyperledger Fabric blockchain systems address the limitations of data filtering and performance issues, enabling efficient management and execution of smart contracts through concurrent data access.
Patent Information
- Application Number
- JP2024091408
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2019-01-29
- Filing Date
- 2024-06-05
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2039-02-01
AI Technical Summary
Existing Hyperledger Fabric blockchain systems face challenges in creating and managing complex smart contracts due to limited data filtering mechanisms and performance issues, particularly when concurrent read/write access is not supported, leading to inefficient transaction processing.
Implementing SQL-based rich queries within the Hyperledger Fabric blockchain to facilitate easier creation and management of smart contracts by moving data culling back to the storage engine, utilizing a relational engine that supports simultaneous read and write access.
Enhances the performance and manageability of smart contracts by allowing for complex queries and concurrent data access, improving transaction processing efficiency.
Smart Images

Figure 00000000_0000
Abstract
Description
[Technical field]
[0001] Copyright Notice A portion of the disclosure of this patent document contains material protected by copyright. As this patent document or patent disclosure resides in the Patent and Trademark Office patent file or records, the copyright holder has no objection to the copying by anyone, but otherwise reserves all copyright rights whatsoever.
[0002] Priority claim This application claims the benefit of priority to U.S. patent application Ser. No. 16 / 261,363, filed on January 29, 2019, entitled "SYSTEM AND METHOD FOR SUPPORTING SQL-BASED RICH QUERIES IN A HYPERLEGGIA FABRIC BLOCKCHAIN," and U.S. Provisional Patent Application Ser. No. 62 / 711,385, filed on July 27, 2018, entitled "SYSTEM AND METHOD FOR SUPPORTING SQL-BASED RICH QUERIES IN A HYPERLEGGIA FABRIC BLOCKCHAIN," each of which is incorporated by reference in its entirety herein.
[0003] Field The present disclosure relates generally to systems and methods for providing a distributed ledger, and more particularly, to systems and methods and components thereof for supporting SQL-based (or SQL-like) rich queries in a permissioned distributed ledger, such as the hyperledger fabric blockchain. [Background technology]
[0004] background A distributed ledger is loosely referred to as a digital record of asset ownership. The ledger has no central administrator and no central data store. Instead, the ledger is replicated across many participating nodes, which may be geographically distributed across multiple locations, multiple countries, or multiple facilities in a computing environment. A consensus protocol ensures identity of each node's copy of the ledger with every other node's copy. Similarly, the set of copies may be viewed as one shared ledger. Asset owners may use the distributed ledger to debit some asset owners' accounts and assess the creditworthiness of other asset owners' accounts, for example, based on cryptographic signature techniques.
[0005] A blockchain is a data structure that can be used to implement a tamper-proof distributed ledger. Multiple nodes follow a common protocol that packages transactions from clients into blocks, and the nodes use a consensus protocol to agree on the next block. Blocks have cumulative cryptographic hashes, making the ledger difficult to tamper with. Each block has a reference (hash value) of the block that preceded it in time. Each block also has its own hash value. A blockchain can be traversed backwards (e.g., up the chain). Summary of the Invention [Problem to be solved by the invention]
[0006] Permissionless distributed ledgers allow anonymous participants to manage the ledger, avoiding control by any single entity. However, anonymity does not guarantee identity. Identity, accountability and auditability are difficult. In contrast, permissioned distributed ledgers enable a level of trust and accountability by allowing explicitly authorized parties to manage the ledger. Permissioned ledgers support more flexible management and a wider choice of consensus mechanisms. Participants who favor some transactions over others can easily manipulate the two types of distributed ledgers. However, the accountability underlying permissioned ledgers provides the opportunity to constrain participants.
[0007] overview This specification describes a system and method for supporting SQL-based rich queries in a hyperledger fabric blockchain, according to one embodiment.
[0008] This specification describes a system and method for supporting SQL-based rich queries in a blockchain fabric. According to one embodiment, the system and method described herein can create complex smart contracts in an easier and more manageable way by executing SQL queries. Also, performance can be improved by pushing data sorting back to the storage engine (rather than performing it at the smart contract level) and relying on a relational engine that supports concurrent read and write access of data. Also, the world database state can provide concurrent read / write access.
[0009] These and other advantages of the present disclosure will become apparent to those skilled in the art from the following description of various embodiments, when read in conjunction with the accompanying drawings.
[0010] The Hyperledger Project is a Linux Foundation initiative to create an open source, enterprise-grade distributed ledger framework and codebase. Hyperledger Fabric is a joint effort achieved as part of a multi-cloud project. Hyperledger Fabric is an implementation of a distributed ledger platform for executing smart contracts. Hyperledger Fabric utilizes container technology to host smart contracts, called "chaincode," which contain the system's application logic.
[0011] According to one embodiment, Hyperledger participants replicate copies of the ledger. In addition to sharing ledger information, the process of updating the ledger is also shared. Unlike other systems that use participants' private programs to update related private ledgers, blockchain systems use shared programs to update the shared ledger. By coordinating participants' business networks through a shared ledger, blockchain networks can reduce the time, cost and risk associated with distributing private information to the ledger (while increasing trust), as well as processing time. Hyperledger Fabric is private and permissioned. Members of the Hyperledger Fabric network are registered. Hyperledger Fabric can also provide the ability to create channels. Each channel can contain a separate transaction ledger that is visible to a specific group of participants. This allows for transaction privacy.
[0012] According to one embodiment, Fabric's distributed ledger protocol is executed by peers. Fabric distinguishes between two types of peers: validating peers are nodes on the network that are involved in performing consensus, validating transactions, and managing the ledger. Non-validating peers, on the other hand, are nodes that act as proxies to connect clients (who issue transactions) to validating peers. Non-validating peers are nodes that do not issue transactions. Although Fabric does not execute the transaction, it can validate transactions. Some features of Fabric include a permissioned blockchain that has immediate finality and executes arbitrary smart contracts called chaincodes. User-defined chaincode smart contracts are encapsulated in containers, and the system chaincodes execute on similar processes as peers. The process of keeping ledger transactions synchronized across the network (e.g., updating the ledger only if the appropriate participants approve the transaction, and ensuring that when updating the ledger, the ledger is updated in the same order with similar transactions) may be referred to as consensus. Fabric implements consensus protocols and security by supporting TLS (Transport Layer Security) certificates, registration certificates, and Certificate Authorities (CAs) for authenticating transaction certificates.
[0013] According to one embodiment, the Hyperledger fabric includes a state of the world database, which is typically a key-value store. The state of the world database is stored in a fast key-value store. Particular labels (keys) are associated with values. For example, a key-value database can associate balances with keys, or photos with keys. The persistence engine is very fast.
[0014] According to one embodiment, smart contracts in the Hyperledger Fabric blockchain only have access to very basic value lookup and data filtering mechanisms, making them difficult to create and manage, and often underperforming.
[0015] According to one embodiment, the underlying persistence engine supported only works with systems like LevelDB and CouchDB that do not support concurrent R / W access, and therefore must forcefully lock the blockchain to write access (commit) while performing an endorsement operation (transaction), which has a direct negative impact on performance, especially when smart contract execution requires a large amount of computing power. [Brief description of the drawings]
[0016] [Figure 1A] FIG. 1 illustrates a transaction flow within the fabric of a blockchain cloud service system according to one embodiment. [Figure 1B] FIG. 1 illustrates a blockchain cloud service system according to one embodiment. [Figure 1C] FIG. 1 illustrates a BCS system, according to one embodiment. [Figure 1D] FIG. 1 illustrates a BCS system, according to one embodiment. [Diagram 2] FIG. 1 illustrates a gateway of a blockchain cloud service system according to one embodiment. [Diagram 3] FIG. 1 illustrates persistence in a blockchain cloud service system according to one embodiment. [Figure 4] FIG. 2 illustrates an exemplary arrangement of fabrics on a BCS. [Diagram 5] FIG. 1 illustrates a chaincode architecture according to one embodiment. [Figure 6] FIG. 1 illustrates a system for providing a management console according to one embodiment. [Figure 7A] FIG. 1 illustrates an example of a user interface within the BCS Console UI, according to one embodiment. [Figure 7B] FIG. 1 illustrates an example of a user interface within the BCS Console UI, according to one embodiment. [Figure 8]FIG. 1 illustrates a system for providing a REST proxy in a BCS instance, according to one embodiment. [Figure 9A] FIG. 1 illustrates a typical IDCS use case for single sign-on, according to one embodiment. [Figure 9B] FIG. 1 illustrates an IDCS use case for Fabric client authentication, according to one embodiment. [Figure 10] FIG. 1 illustrates a system for supporting a state of the world database in a Fabric blockchain according to one embodiment. [Figure 11] FIG. 1 illustrates a system for supporting SQL-based rich queries in a blockchain fabric, according to one embodiment. [Figure 12] 1 is a flowchart of a method for supporting SQL-based rich queries in a blockchain fabric according to one embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0017] Detailed Description According to one embodiment, the present specification describes a system and method for supporting SQL-based rich queries in a blockchain fabric. According to one embodiment, the system and method described herein can create complex smart contracts in an easier and more manageable way by executing SQL queries. Also, performance can be improved by pushing data sorting back to the storage engine (rather than performing it at the smart contract level) and relying on a relational engine that supports concurrent read and write access of data. Also, the world database state can provide concurrent read / write access.
[0018] According to one embodiment, an exemplary blockchain fabric supporting SQL-based rich queries in the blockchain fabric can be provided as a cloud service. According to one embodiment, the enterprise-grade framework includes scalability, management, configuration, persistence, and compatibility of various client applications using cloud technologies. In certain embodiments, the permissioned blockchain ledger and blockchain fabric are provided as a blockchain cloud service (BCS).
[0019] In the following description, the present disclosure is illustrated in the accompanying drawings by way of example and not limitation. Various embodiments referred to in the present disclosure do not necessarily refer to similar embodiments, and such references mean at least one. Although specific implementation examples are described, these implementation examples are provided for illustrative purposes. Those skilled in the art will recognize that other components and configurations can be used without departing from the scope and spirit of the present disclosure. The description of the present disclosure provides examples and embodiments that support and disclose the claimed method.
[0020] Also, in certain instances, numerous specific details are set forth to provide a thorough description of the present disclosure. However, those skilled in the art will appreciate that the results and advantages of the methods taught in the present disclosure can be achieved and the ideas taught in the present disclosure can be practiced without these specific details. In some instances, well-known features are not described in detail in order not to obscure the present disclosure.
[0021] The teachings of the present disclosure are described with functional building blocks illustrating the performance of certain functions and their relationships. The boundaries of these functional building blocks are often arbitrarily defined in this disclosure for the convenience of explanation. Thus, functions performed by similar elements may be performed by different elements in alternative embodiments. Each element that performs a function may be a single element. Elements may be combined into one element. Alternative boundaries may be defined so long as the specified functions and relationships thereof can be appropriately performed. Accordingly, any such alternative boundaries are within the scope and spirit of the present disclosure.
[0022] Like reference numbers are used throughout the drawings and detailed description to denote like elements, and thus a reference number used in a drawing may or may not be referenced in the detailed description associated with that drawing if the element is described elsewhere.
[0023] Blockchain technology can dramatically increase enterprise business value by enabling near real-time decentralized transactions and secure, tamper-proof data sharing across an ecosystem of users. The Hyperledger Fabric blockchain incorporates a modular architecture, horizontal / cross-industry technology support, and support for enterprise demand.
[0024] Introduction According to one embodiment, Hyperledger Fabric is a platform for distributed ledger solutions underpinned by a modular architecture that provides a high degree of confidentiality, resiliency, flexibility, and scalability. Hyperledger Fabric is designed to support pluggable implementations of different components and to adapt to the complexity and congestion present in the deployment ecosystem.
[0025] According to one embodiment, Hyperledger Fabric offers a flexible and scalable architecture unlike alternative blockchain solutions.
[0026] Blockchain - Distributed Ledger According to one embodiment, a blockchain network may include a distributed ledger that records all transactions taking place on the network.
[0027] Blockchain ledgers are often referred to as distributed ledgers because they are replicated by many network participants and managed by the collaboration of each network participant. Distribution and collaboration are attributes that reflect the way businesses exchange goods and services in the real world.
[0028] In addition to being distributed and collaborative, information recorded on a blockchain is only added using cryptography; that is, once a transaction is added to the ledger, it cannot be changed. This immutability allows participants to easily determine the origin of information, since it cannot be changed after the fact. Thus, a blockchain may be thought of as a proof system.
[0029] Blockchain - Smart Contracts According to one embodiment, to support consistent updates of information and specific ledger functions (transactions, queries, etc.), the blockchain network controls access to the ledger through the use of smart contracts.
[0030] According to one embodiment, smart contracts are not only an important mechanism for encapsulating information and easily maintaining that information across a network, but they may also be written to allow participants to execute certain parts of transactions automatically.
[0031] A smart contract may be written, for example, to vary shipping costs depending on the time of arrival of the goods, based on terms agreed upon by both parties and recorded in the ledger. Upon receipt of the item, the corresponding funds will be automatically transferred.
[0032] Blockchain - Consensus According to one embodiment, the process of keeping ledger transactions synchronized across the network (e.g., updating the ledger only if the appropriate participants approve the transaction, and ensuring that when the ledger is updated, it is updated in the same order with like transactions) may be referred to as consensus.
[0033] According to one embodiment, a blockchain may be thought of as a shared, replicated transaction system that is updated via smart contracts and kept consistently synchronized via a collaborative process called consensus.
[0034] Advantages of Blockchain According to one embodiment, the currently available transaction network is the version of the network that existed at the time of business record keeping. Members of the business network transact with one another, but each member maintains its own transaction records. Similarly, the provenance of each sale of the subject of a transaction can be verified to ensure that the business selling the item has a chain of title to verify ownership of that item.
[0035] Even though the current business network is modernized by computing systems, there is no unified system to manage the identities of network participants, it takes days to settle securities transactions (which amount to trillions of dollars on a global scale), contracts must be signed and executed manually, and verifying origin is difficult, as each database in the system contains unique information, which represents a drawback.
[0036] According to one embodiment, blockchain offers an alternative to many inefficient standard transaction systems by providing a standard way to establish identities, conduct transactions, and store data on a network.
[0037] According to one embodiment, each participant in a blockchain network has their own copy of the ledger. In addition to sharing the ledger information, the process of updating the ledger is also shared. Unlike other systems that use participants' private programs to update associated private ledgers, the blockchain system uses shared programs to update the shared ledger.
[0038] According to one embodiment, by coordinating a business network of participants through a shared ledger, a blockchain network can reduce the time, costs and risks associated with distributing private information, as well as processing times, while increasing trust and visibility.
[0039] Hyperledger Fabric Hyperledger Fabric, like other blockchain technologies, is a system that has a ledger, uses smart contracts, and allows participants to manage transactions.
[0040] Hyperledger Fabric differs from some other blockchain systems because it is private and permissioned. Some blockchain networks use identity instead of "proof of work" to authenticate (those who meet a criteria are allowed to join the network). Members of the Hyperledger Fabric network register through a membership service provider.
[0041] Hyperledger Fabric also offers several pluggable options: ledger data can be stored in multiple formats, consensus mechanisms can be switched in and out, and different MSPs (membership service providers) can be supported.
[0042] Additionally, Hyperledger Fabric allows groups of participants to create separate transaction ledgers by providing the ability to create channels. This allows some participants on the network to be competitors and not expose all transactions to all participants (e.g., offering special pricing to some participants and not others). When two participants create a channel, they each have a copy of the ledger for that channel, excluding the other participants.
[0043] shared ledger According to one embodiment, Hyperledger Fabric has a ledger subsystem that includes two components: the world state and the transaction log. Each participant has a copy of the ledger for every Hyperledger Fabric network it belongs to.
[0044] The world state component describes the state of the ledger at a given point in time. The world state is the ledger's database. The transaction log component records all transactions that have resulted in the current value of the world state. The transaction log is the history of updates to the world state. The ledger is thus a combination of the world state database and the transaction log history.
[0045] The shared ledger has a pluggable data store of the world state. By default, the shared ledger is a Level-DB key-value store database. The transaction log does not have to be pluggable. It simply records the values of the ledger database before and after it is used by the blockchain network.
[0046] Smart Contracts Hyperledger Fabric smart contracts are written in chaincode and are called by applications external to the blockchain when they need to interact with the ledger. In most cases, chaincode only interacts with the database component of the ledger, which is the world state, and not the transaction log (e.g., to query the database).
[0047] consensus According to one embodiment, transactions are written to the ledger in the order in which they are executed, even if they are executed among different sets of participants in the network, thus establishing the order of transactions and allowing bad transactions that are mistakenly (or maliciously) inserted into the ledger to be rejected.
[0048] Hyperledger Fabric allows network entities (e.g., network users, peers, starters) to choose the consensus mechanism that best represents the relationships between participants. As with privacy, the relationships between participants require a wide range of networks, from highly structured to more peer-to-peer.
[0049] Chaincode According to one embodiment, the chaincode includes one or more assets and a transaction for modifying the assets. A chaincode can include software that defines the transaction instructions (business logic) and the transaction rules. Chaincode executes rules for reading or modifying key-value pairs or other state database information. Chaincode functions are performed against the ledger's current state database and are acted upon by transaction proposals. Chaincode execution results in a set of key-value writes (write set) that are submitted to the network and applied to the ledger on all peers.
[0050] Ledger Features According to one embodiment, the ledger is a continuous, tamper-resistant record of all state transitions in the fabric. State transitions are the results of participants executing chaincode (transactions). Each transaction generates a set of asset key-value pairs that are committed to the ledger as a create, update, or delete.
[0051] The ledger consists of a blockchain, which stores an immutable sequence of records in blocks, and a state database to hold the current fabric state. Each channel contains a ledger, and each channel contains a separate ledger of transactions that are visible to a particular group of participants. Each peer keeps a copy of the ledger for each channel it is a member of.
[0052] Channel Privacy According to one embodiment, Hyperledger Fabric utilizes an immutable ledger for each channel and a chaincode that can transact and modify the current state of an asset (i.e., update key-value pairs). The ledger exists within the scope of the channel. The ledger may be shared across the network (if all participants are operating on one common channel) or may be privatized to include only a specific set of participants.
[0053] In the latter case, participants can separate / isolate transactions and the ledger by creating separate channels. To make it possible to bridge the gap between full transparency and privacy, the chaincode may be installed only on peers that need access to the asset state to perform reads and writes (i.e., if the chaincode is not installed on a peer, the peer cannot properly interface with the ledger). To further obscure the data, values in the chaincode are encrypted (partially or in whole) using regular cryptographic algorithms such as AES (Advanced Encryption Standard) before being added to the ledger.
[0054] According to one embodiment, privacy can be improved using a smaller concept than channel privacy: "private collections."
[0055] Security and Membership Services According to one embodiment, Hyperledger Fabric provides a transaction network where all participants have known identities. A public key infrastructure is used to create cryptographic certificates that associate with organizations, network components, and end users or client applications. Thus, access to data over the broader network and channels can be controlled and managed. This "permission" concept of Hyperledger Fabric, along with the existence and characteristics of channels, can address scenarios where privacy and confidentiality are important.
[0056] consensus According to one embodiment, in a distributed ledger, consensus can include more than simply agreeing on the order of transactions. This distinction is made between proposals and end This is highlighted by its fundamental role in the entire transaction flow of the Hyperledger fabric, from statement, to ordering, validation and commitment. Consensus is defined as the complete verification of the correctness of a set of transactions that comprise a block.
[0057] Consensus is finally achieved when the order and outcome of transaction blocks meet explicit policy criteria checks. These checks and balances are performed during the transaction and include the use of endorsement policies to determine the specific members that must sign a particular transaction, and system chaincode to ensure that these policies are executed and adhered to. Prior to commitment, peers can utilize these system chaincodes to ensure that endorsements are indeed present and from the appropriate entities. Also, before appending any block containing transactions to the ledger, a version check is performed while agreeing or consenting to the current state of the ledger. This final check provides protection against double-spend and other threats that can compromise data integrity, while allowing the execution of functions on non-static variables.
[0058] In addition to endorsements, validations and version checks, this includes continuous identity validation performed on the transaction flow. Access control lists are implemented at the network's hierarchy (from ordering services to channels) and payloads are iteratively signed, validated and authenticated as transaction proposals pass through different architectural components. Consensus is not limited to an agreed upon set of transaction orderings, but rather is a process achieved as a by-product of continuous validation performed on the transaction flow from proposal to commitment.
[0059] Blockchain Cloud Services - Architecture According to one embodiment, a system such as a cloud system (e.g., Blockchain Cloud Services (BCS)) can utilize the Hyperledger Fabric described above as a starting point. Such a system provides a highly advanced and unique enterprise-grade distributed ledger cloud platform, enabling the creation of new blockchain-based applications and / or the extension of existing SaaS, PaaS, and IaaS as well as on-premise applications.
[0060] According to one embodiment, the system can remove barriers to adoption and support of developing blockchain applications by supporting mission-critical enterprise demands such as scalability, security, robustness, uniformity, and performance. The system provides BCS as a cloud Platform as a Service (PaaS). By doing so, it allows users to deploy, configure, manage and monitor blockchain and reduces the cost of deploying blockchain in enterprises. The system also accelerates the development of blockchain applications and integration with other platforms. The system allows SaaS cloud users to securely share data of enterprise processes such as procurement, payment, trade finance, accounting, HR, CX, etc. and perform distributed transactions with third-party applications and external distributed ledger technology that use the blockchain cloud platform.
[0061] According to one embodiment, the system is a cloud service based on a PaaS manager (e.g., the Oracle® PaaS Service Manager (PSM) platform). Typically, such a system is a cloud management service that operates on a compute space (e.g., an external compute space). In one embodiment, the system uses Oracle Identity Cloud Services (IDCS), Oracle Load Balancer Service (LBaaS), Oracle Event Hub Cloud Services, and Oracle Cloud Storage. It leverages features of the PSM platform, including the layered Oracle Application Container Cloud Service (ACCS). Each client's blockchain can be created and run as a tenant. The system can support multiple blockchains, each created and run as its own tenant in the multi-tenant environment.
[0062] Thus, the system allows applications or client applications to implement distributed ledgers that include smart contracts. Clients and users of such systems may be internal or external to the cloud (blockchain trust). Some blockchain networks may include components external to the cloud environment or may be limited to a particular cloud.
[0063] According to one embodiment, the system is useful for a wide variety of applications, especially multi-party transactions where trust and identity must be resolved. Unlike other blockchain systems, the system services of the present disclosure are not anonymous. In fact, identity and auditability are fundamental integration elements. Thus, the BCS may be applied in, for example, capital markets, cross-border transactions, financial services, asset transactions, legal regulations, health care records, disclosure, logistics, change tracking, and anti-counterfeiting.
[0064] As mentioned above, each party on the blockchain has access to the entire database and all history (unless the ledger is created / privatized to a specific party). Each party has no control over the data or information. Also, all parties can directly verify the records of the other party of the transaction without an intermediary. Communication is directly between peers, not through a central node. Each node stores the information and forwards the information to all other nodes. Once a transaction is entered into the database and an account is updated, the record cannot be changed because it is linked to the records of all transactions entered before it (hence the name "chain"). If there is an error in a transaction, the error can be corrected with a new transaction. Both transactions are visible to the users to whom it was provided. To add a new valid transaction, participants can agree on the validity of the transaction through a consensus mechanism. Participants in a blockchain can verify the provenance of assets, and changes in asset ownership over time. Digital signatures can be used to authenticate documents and can be added to access control (changing permission levels) and programmability (executable business rules).
[0065] In many multi-party transactions, parties exchange money when they receive assets or services. Typically, one party must provide goods or money before the other, depending on the transaction time. In some environments, trust is resolved by an intermediary escrowing funds until the terms of the agreement are met. This method resolves trust between the parties. However, this method adds complexity and increases the cost of transactions, since it adds another central authority that must be trusted. By using smart contracts as part of the system of the present disclosure, the intermediary can be eliminated. This allows parties to make trusted transactions on the blockchain without the need for an intermediary.
[0066] According to one embodiment, advantages of the disclosed system such as BCS include decentralizing information within the system. Auditing capabilities are available, access can be controlled, and some privacy can be managed. Additionally, a blockchain ledger is inherently mutable. It cannot be modified and cannot be rejected. The ledger is composed of multiple blocks. Each transaction block contains a block ID, past hash, data hash, timestamp, transaction ID list, action (1 to n), chaincode ID, chaincode proposal, response (r / w set, event, success or failure), and endorser. Since each block contains past hashes and its own hash, once published / distributed, it is inherently ordered and immutable (note that the hash of the current block is a hash of the past block and other data in the current block, thus linking blocks in the chain). Consensus can resolve inconsistencies. There is no need to give excessive power to a centralized authority compared to a centralized database or middleman. Also, the distributed nature of the ledger reinforces the fundamental immutability of the blockchain recording technology, since it is difficult to change (even if algorithmically possible) by using distributed copies and consensus. Thus, hacking the ledger is nearly impossible if someone has a copy of the latest block of the chain, since the order of transactions is constant.
[0067] In a particular embodiment, as described below, the system of the present disclosure may be based on the Oracle PaaS Service Manager (PSM) platform and is enhanced by including a management console that simplifies / facilitates / automates the creation, monitoring and configuration of a fabric-based blockchain. Also, to simplify the contact between applications and the blockchain fabric, a REST proxy service including one REST API is provided. Developers can build smart contracts and deploy them using the management console, and then use applications to invoke the smart contracts on the blockchain asynchronously (default case) or synchronously (if an immediate response is required). The REST proxy service and API provide both synchronous and asynchronous capabilities depending on the demands of the platform.
[0068] According to one embodiment, the Fabric CA server can provide the membership service for the fabric. The Fabric CA server handles three parts: authentication of users, authorization to access the blockchain (groups of peers and orders), and certificates for application clients, peers, and orders. The Fabric CA may include a CA server that distributes certificates to Fabric users. The Fabric CA may utilize certificates to perform authentication and authorization. Certificates include two types: registration certificates for authentication and transaction certificates for authorization. According to one embodiment, an identity service such as IDCS may also provide authentication and authorization.
[0069] Hyperledger Fabric As mentioned above, in one embodiment, the disclosed system may implement Hyperledger Fabric, which provides a distributed ledger platform for executing smart contracts. Hyperledger Fabric utilizes container technology to host smart contracts, called "chaincode," which contain the application logic of the system. In an alternative embodiment, the blockchain cloud service implements an alternative distributed ledger platform, including, for example, the "Tendermint" ledger system described in U.S. Patent Application Serial No. 15 / 169,622, "Accountability and Trust in Distributed Ledger Systems," filed May 31, 2016, and incorporated herein by reference.
[0070] Hyperledger Fabric's distributed ledger protocol is run by peers. One drawback of traditional blockchain technology is that every peer must record every transaction. This creates substantial I / O and processor overhead and does not scale easily to enterprise-grade systems. No. Hyperledger Fabric identifies two types of peers. Committer peers are nodes on the network that verify endorsements, validate transaction outcomes before committing transactions to the blockchain, and manage the ledger. Non-validating peers, on the other hand, are nodes that act as proxies to connect clients (that issue transactions) to validating peers. Non-validating peers (or endorser peers) do not execute transactions, but can simulate and sign transactions. The separation of peer types / functions improves the scalability of the system. An ordering service can receive signed transactions, order them into blocks, and send the blocks to committer peers. In such a distributed ledger system, consensus is the process of forming an agreement on the next set of transactions to be added to the ledger. In Hyperledger Fabric, consensus involves three separate steps: transaction endorsement, ordering, and validation and commitment.
[0071] According to one embodiment, Hyperledger features a permissioned blockchain with immediate finality and executes arbitrary smart contracts called chaincode. User-defined chaincode smart contracts are encapsulated in containers and the system chaincode executes on peer-like processes. Chaincode execution is partitioned by transaction order, limiting the level of trust and validation required between nodes and reducing network overhead.
[0072] According to one embodiment, channels in the Hyperledger fabric allow multi-party transactions to take place with a high degree of privacy and confidentiality required by competing businesses and regulated industries exchanging assets over a common network. An immutable shared ledger encrypts all transaction history for each channel and includes query capabilities for auditing and efficient dispute resolution. Ledgers are created for the scope of a channel. Ledgers may be shared across the entire network (when all participants are operating on one common channel) or may be privatized to include only a specific set of participants.
[0073] According to one embodiment, Hyperledger Fabric implements security by supporting a Certificate Authority (CA) for authenticating TLS, registration and transaction certificates. A public key infrastructure is used to create cryptographic certificates that are associated with organizations, network components, and end users or client applications. Thus, access of data over the broader network and channels can be controlled and managed. This "authorization" feature of Hyperledger Fabric, along with the existence and capabilities of channels, meets the privacy and confidentiality requirements of multi-enterprise systems.
[0074] According to one embodiment, the Hyperledger Fabric can modify assets using chaincode transactions. As described above, chaincode is software that defines one or more assets and transaction instructions for modifying the assets.
[0075] The unified consensus mechanism plays a fundamental role in the transaction flow of the Hyperledger fabric, from proposal and endorsement to ordering, verification and commitment. Consensus is the verification of the validity of a set of transactions that comprise a block, as described above. Consensus is finally achieved when the ordering and outcome of transaction blocks meet explicit policy criteria checks.
[0076] Figure 1A shows the transactions that are made to the fabric of a system that provides blockchain services. 1A illustrates a transaction flow. More specifically, FIG. 1A illustrates a Blockchain Cloud Services (BCS) system according to one embodiment. At 1, a client 160 uses a Fabric SDK 162 to access and register with a Fabric Certificate Authority 170, 172, 174. At 1.1, the Fabric CA sends a registration certificate to the client 160. At 2, the client 160 uses a Fabric SDK 162 to access a peer container 180 to request a signature from an endorser 182. At 2.1, the endorser 182 replies with a signed RW set (read / write set). At 3, the Fabric SDK 162 of the client 160 submits a signed TX (transaction) including the RW set and the endorser's signature to the ordering service of the ordering container 190. At 4, the orderer 192 distributes the TX batch to the committer 184 in the peer container 180. An order is a predefined set of nodes that orders transactions into blocks. The ordering service exists independently of peer processes and orders transactions on all channels on the network on a first-come, first-served basis. Committers 184 modify the ledger 186 and world state 188 in 5 and 5.1. The Fabric Certificate Authority 170 can be used to verify signatures and authorizations of peer containers 180, smart contract containers 166 and smart contracts 168, as well as orders 192. Additionally, smart contracts 168 can communicate with endorsers 182.
[0077] In one embodiment, the system configures a Kafka cluster as an ordering service. Kafka can be used as an ordering service. Kafka is a distributed streaming service that supports publish and subscribe semantics. A Kafka cluster runs on multiple servers and stores a sequence of records in categories called topics. Each record includes a key, a value, and a timestamp. Thus, Kafka may be used as an ordering service that includes ordering service nodes (OSN-n) and a Kafka cluster. An ordering service client may be connected to multiple OSNs. OSNs do not communicate directly with each other. These ordering service nodes (OSNs) (1) perform client authentication, (2) allow clients to write to or read from chain 1 using a simple interface, and (3) filter and validate transactions against configuration transactions to reconfigure existing chains or create new chains. Messages (records) in Kafka are written to topic partitions. A Kafka cluster may have multiple topics, and each topic may have multiple partitions. Each partition is an ordered, immutable sequence of records that are continuously appended to. After performing client authentication and transaction screening, the OSN can relay incoming client transactions belonging to a particular chain to the partition of the corresponding chain. The client transactions can then be executed in that partition and return an ordered list of common transactions to all ordering service nodes.
[0078] According to one embodiment, each peer can be an endorser and a committer. A configuration item (e.g., CORE_PEER_ENDORSER_ENABLED) can make a peer an endorser. When a peer joins a channel, this peer becomes a committer for this channel. When a chaincode is installed on a peer, this peer becomes a candidate endorser for this chaincode. When a client proposes a transaction, the client can select a peer (from the candidate endorsers) to be an endorser.
[0079] According to one embodiment, the ordering mechanism by which the order distributes blocks to peers is as follows: First, a peer (e.g., a leader peer) requests a new block from the order by sending its version (last block number). Then, the order checks the version of the peer: a) If the peer's version is equal to the version of the order, If the peer's version is larger than the order's, it sends an error back to the peer indicating that the order's ledger is lost and cannot be recovered from the EventHub (in this scenario, the order cannot continue to operate properly). b) If the peer's version is smaller than the order's, the order takes the block from its local ledger in RAM or a local file and sends it back to the peer. c) If both have similar versions, the order aborts until a new block is available. When a new block is available from the EventHub, the order puts this block in its local block file or RAM and then sends a distribution thread back to the peer that reads this block from the ledger. The peer can then get this block, commit it to its local ledger, and broadcast the latest version of the block to other peers.
[0080] BCS System Architecture FIG. 1B illustrates transaction flows made to a fabric of a system that provides blockchain services. More specifically, FIG. 1B illustrates a Blockchain Cloud Services (BCS) system, according to one embodiment. As illustrated, blockchain cloud services components are created in a compute space 120 (e.g., an external compute space), for example, on an Oracle PaaS Service Manager (PSM) platform. Access to the system is mediated by a PSM API 122 and a blockchain REST API 124. The external compute space 120 utilizes a load balancing service (LBaaS) 126 to process incoming transactions. Appropriately distribute across available resources.
[0081] According to one embodiment, the BCS is an application container hierarchical service built using the PSM platform on the Application Container Cloud Service 128. Each BCS entity runs on a separate container. Each BCS entity has a one-to-one correspondence with an application container. The Blockchain Cloud Service implements the Hyperledger Fabric features described above. In addition to the components that build the basic Fabric network, several components have been developed to leverage the Hyperledger Fabric in the Blockchain Cloud Service. These components need to be deployed with separate behaviors and binaries. The Cloud Stack Manager can be used to automatically create all the services defined by the Blueprint as a single unit called a stack by authorizing the user.
[0082] In one embodiment, BCS provides a Hyperledger Fabric implementation for implementing a distributed ledger platform for executing smart contracts. BCS utilizes container technology to host smart contracts, called "chaincode," which contain the application logic for the system.
[0083] According to one embodiment, Fabric's distributed ledger protocol is executed by peers. Fabric distinguishes between two types of peers: validating peers are nodes on the network that are involved in performing consensus, validating transactions, and managing the ledger. Non-validating peers, on the other hand, are nodes that act as proxies to connect clients (that issue transactions) to validating peers. Non-validating peers do not execute transactions, but can validate them. Some key features of Fabric include a permissioned blockchain that has immediate finality and executes arbitrary smart contracts called chaincodes. User-defined chaincode smart contracts are encapsulated in containers, and the system chaincodes are executed in a similar process to peers. Fabric supports the concept by supporting Certificate Authorities (CAs) for authenticating TLS certificates, registration certificates, and transaction certificates. Implements the consensus protocol and security.
[0084] According to one embodiment, BCS entities operate on container instances layered with ACCS 128. Containers are created and / or activated by the create operation of PSM. Fabric CA container 130 is a container that provides the BCS Fabric CA (Certificate Authority) component. BCS Peer container 132 is a container that BCS peer network entities operate to manage ledger components and execute chaincode containers to perform read / write operations on ledger components. BCS Order container 134 is a container that BCS Order operates to order transactions into the blockchain of all channels. BCS Chaincode Execution container 139 is a container that is created and activated by peer entities. In the container, a chaincode execution unit communicates with the parent peer entity and executes the encoding of assets and transaction instructions to modify the assets in the blockchain.
[0085] According to one embodiment, the BCS chaincode builder container 140 is a container that is created and operated by peer entities. The chaincode build environment is installed and deployed in the container, and the chaincode execution unit is built in the container. The Fabric SDK client 106 provides functionality to access the BCS. The blockchain cloud service also utilizes an event hub cloud service 150, a cloud storage service 152, and an identity service 154. The Oracle® Storage Cloud Service is used as the storage service for the BCS.
[0086] According to one embodiment, Docker / Weave 141 is a container service. Containers are a way to package software in a format that can run independently on a shared operating system. Unlike VMs, containers do not bundle a complete operating system, but instead bundle the software with the libraries and configuration it needs to run. This allows the creation of efficient, lightweight, self-contained systems that ensure software always runs the same way regardless of where it is located.
[0087] According to one embodiment, each BCS instance is composed of different types of nodes. A BCS instance can include a few (e.g., 0 or more) to many peer nodes and a few (e.g., 0) to many order nodes. Each VM includes one BCS instance, and each BCS instance includes one to many Fabric CA nodes. For BCS gateways, a BCS instance can include a few (e.g., 0) to many BCS gateways. The BCS console is a component of a BCS instance. Each BCS instance includes only one BCS console.
[0088] According to one embodiment, as described in more detail below, the BCS Management Server (Console) 136 is a BCS component for providing many monitoring, management and viewing functions to a BCS stack instance. As described in more detail below, the BCS Gateway (REST Proxy) 138 is a new BCS component that provides a REST API interface to consumers / clients. Consumers / clients use the REST API interface to access the fabric to perform transactions.
[0089] According to one embodiment, the PSM console UI 102 of the public access client 100 allows for management of the Platform Service Manager. The BCS Console UI 104 allows for control of the BCS Management Server. A variety of different types of clients can access the BCS services, including Fabric SDK Clients 106, BCS REST Clients 108, and Fabric Membership Clients 110.
[0090] According to one embodiment, a blueprint can be defined for each type of container listed above as an independent service type. Oracle Cloud Stack Manager uses blueprints to automate the creation of all independent service types in a single stack unit. The advantage of defining each BCS entity as a service type is to easily update and manage various execution entities. Application container tier services support four types of operations: CREATE_SERVICE, DELETE_SERVICE, SCALE_SERVICE, and Start / Stop / Restart. These operations can be applied on a per-service basis.
[0091] According to one embodiment, in the Hyperregga Fabric network, the ordering service component uses Apache Kafka to provide the ordering service in a crash-fault tolerant manner and supports multiple chains. Thus, in the BCS Cloud Service, the ordering service component uses Oracle Event Hub Cloud Service (OEHCS), which distributes the power of Kafka as a processed streaming data platform and can be integrated with the rest of Oracle's cloud.
[0092] 1C illustrates a BCS system, and more specifically, a BCS runtime, in accordance with an embodiment.
[0093] According to one embodiment, clients such as gateway-based applications 103 and / or fabric-based applications 105 can communicate with AACS instances 128 through a network such as the Internet 107 and a front-end such as a load balancer LBaaS 126 including Cloud Gate (described below). Incoming calls can include REST communications (shown as thick dashed lines in the figure) or, in certain circumstances, incoming gRPC communications (shown as light dashed lines in the figure). Incoming REST communications can be forwarded to a gateway 138 (which may include a REST API / REST proxy), a console 136, or an agent fabric CA 130 (described above). The REST communications transformed / translated to internal calls (gRPC) can interface with an instance of a blockchain fabric / hyperledger (including agents / peers 132, agents / orders 134, chaincode 142, and chaincode builder 140). Meanwhile, incoming gRPC communications can be forwarded directly to, for example, agent / peer 132 and agent / order 134 to interface with the blockchain / Hyperledger.
[0094] According to one embodiment, when a transaction is made to an ACCS instance, the ACCS instance can, for example, persist the ledger to cloud storage via REST communications or can communicate with an event hub via REST communications.
[0095] According to one embodiment, the drawings show only one ACCS instance, but one skilled in the art will readily appreciate that there may be one or more ACCS instances with which a client (e.g., gateway-based application 103 and / or fabric-based application 105) can communicate via the BCS runtime described above.
[0096] 1D illustrates a BCS system according to one embodiment, and more specifically, illustrates the component concentrations within the BCS system, i.e., the ratio of components to each BCS instance.
[0097] According to one embodiment, for each BCS instance 100a, orders 101a may be provided in a 1:N ratio, Fabric CA membership 102a may be provided in a 1:N ratio, BCS REST proxies 103a may be provided in a 1:N ratio, BCS consoles 104a may be provided in a 1:1 ratio, and peer containers 105a may be provided in a 1:N ratio.
[0098] Each peer container can contain endorsers who can simulate transactions and committers who are formed in the same peer container and can apply changes to the ledger.
[0099] According to one embodiment, chaincode 109a may be provided with a 1:N ratio to peer containers. Storage 106a may also be provided with an N:1 ratio to peer containers and orders. Similarly, event hub 107a may also be provided with an N:1 ratio to peer containers and orders. IDCS 108a may also be provided with an N:1 ratio to Fabric CA membership.
[0100] Blockchain Cloud Service (BCS) Gateway According to one embodiment, a BCS Gateway (BCSGW) includes a network node that communicates with the Fabric network using the Fabric SDK. The BCS Gateway provides an HTTPS REST API to client-side consumers to enable client applications to interact with the BCS Fabric elements.
[0101] FIG. 2 illustrates a gateway of a blockchain cloud service system according to one embodiment. As shown in FIG. 2, an end user 200 authenticates and authorizes by interacting with an application adapter 202 using HTTPS. The application adapter 202 accesses a public cloud 210 using HTTPS to an LBaaS, such as Cloud Gate 212 (i.e., LBaaS). A load balancing service (LBaaS) is performed for incoming transactions. Cloud Gate 212 passes the transaction to a BCS Gateway 222 using HTTPS. The BCS Gateway provides an interface to the BCS Fabric 220. This interface communicates using the gRPC remote procedure call protocol.
[0102] According to one embodiment, Cloud Gate 212 is a reverse proxy "access enforcement module" or "policy enforcement point" that protects web browser and REST API resources using, for example, OAuth2 and OpenID Connect standards. IDCS uses Cloud Gate internally to protect its admin UI and REST APIs (referred to as the "IDCS web tier"). In another application, Cloud Gate OTD is deployed as an additional instance in a semi-supported / interim setup known as non-IDCS or standalone.
[0103] According to one embodiment, OAuth / OpenID based authentication supports a user browser flow (for UI clients) that is triggered when an HTTP request contains a "User-Agent" header, i.e. when the HTTP request is from a UI such as a browser or mobile app. Cloud Gate presents the user with credentials (username / password), validates the credentials, and then authenticates subsequent HTTP requests from the browser. It creates and sends back to the user an OAuth session cookie that can be used by the Cloud Gate. OAuth / OpenID based authentication also supports the Resource Server flow (for programmatic clients). This flow is triggered when an HTTP request contains an authentication "bearer" token header. Cloud Gate validates the token for authentication.
[0104] According to one embodiment, for HTTP Basic Authentication, credentials (username / password) must be included in the HTTP Authorization "Basic" header of each HTTP request. Cloud Gate validates the credentials with each HTTP request. This method applies to both UI and programmatic clients.
[0105] According to one embodiment, the multi-token flow is a self-adaptive method that covers a specific HTTP request. If the HTTP request includes an authentication "basic" header, Cloud Gate performs HTTP basic behavior. If the HTTP request includes an authentication "bearer" header, Cloud Gate performs behavior similar to the resource server flow.
[0106] In one embodiment, the BCS console browser client utilizes a user browser flow. In an embodiment, the system can use the Cloud Gate multi-token authentication method for the BCS console and gateway programmatic clients. Programmatic clients can call the BCS REST API via HTTP Basic authentication.
[0107] According to one embodiment, the BCS Gateway 222 communicates with peers 224, which are network entities that manage the ledger and execute chaincode containers, to perform read / write operations on the ledger. Peers are owned and managed by members. The BCS Gateway 222 and peers 224 communicate with an order 226. An order provides an ordering service. An order is a predefined collection of nodes that orders transactions into blocks. The ordering service exists independently of the peer process and orders transactions on all channels on the network on a first-come, first-served basis. The peers 224 and order 226 communicate with a fabric certificate authority 228. The BCS Gateway 222 also provides access to a BCS management server / console 230.
[0108] According to one embodiment, the BCS is deployed in a cloud system such as Oracle Cloud. The gateway can run in an ACCS container. The gateway is stateless. A gateway can be updated by killing the old gateway and launching a new one. The BCS gateway can allow client queries or can call Fabric chaincode via RESTful protocol. The BCS gateway allows clients to access the Fabric network in Oracle Cloud via HTTPS / RESTful services. The BCS gateway is a network node that communicates with the Fabric network using the Fabric SDK. Communication within Fabric uses gRPC as a communication protocol. The BCS gateway provides an HTTPS / RESTful API to the client on the client side. The REST API allows clients to call functions within Fabric using the Fabric SDK.
[0109] According to one embodiment, a gateway may be provided with a one-to-one relationship to a fabric user: every gateway user belongs to one organization, and every gateway user is mapped to one fabric user in one gateway. One gateway configures only one fabric user.
[0110] According to one embodiment, IDCS issues gateway and gateway user ("app adaptor") certificates. These certificates are signed by the Organizational CA. Because the gateway and gateway user are collocated with the Organizational CA, they can verify each other using HTTPS.
[0111] According to one embodiment, each end user accesses the BCSGW through an “app adapter.” Authentication is three-fold: the end user 200 is authenticated by the app adapter 202, which is authenticated by the BCS Gateway 222 using a client certificate, which is authenticated by the peers 224 and orders 226 in the Fabric network 220.
[0112] According to one embodiment, one container runs one tomcat server and deploys one BCS gateway that maps to one fabric user. Multiple app adapters can connect to one gateway.
[0113] According to one embodiment, different gateways may be associated with different Fabric users. An end user of an app adapter that connects to one gateway may be mapped to one Fabric user.
[0114] According to one embodiment, the BCSGW runs on Oracle Cloud and the configuration is configured through the BCS console using a JSON file. An admin user can expose peers, channels and pieces of chaincode to the gateway. An admin user starts the gateway through the console. The gateway does not refresh the configuration after starting. An admin user can set endorsers for the chaincode. End users do not know the policy and the gateway does not check the chaincode policy.
[0115] According to one embodiment, the BCSGW is started by the BCS console. The BCS console creates a BCSGW configuration file and starts a new gateway with the BCSGW package. At startup, the startup script checks the BCSGW configuration file, modifies the configuration file for Tomcat (e.g., Tomcat configuration file), and then starts Tomcat. Tomcat starts a thread for BCSGW, which creates channel objects by reading the configuration file for each channel and creates connections with orders, peers, and event hubs. Different channels have different connections to orders / peers / event hubs. The event hub is the second port of the peer. The gateway gets the transaction result by connecting to this port. The Tomcat servlet container can listen to client requests. For the chaincode query method, the BCSGW sends requests to all peers of the channel and uses only the first result. In the case of the chaincode invocation method, the BCSGW sends the request to all endors of the channel, and if one of all endors replies success, the BCSGW sends the transaction to all endors of the channel.
[0116] According to one embodiment, an asynchronous API can be supported. A peer can open two ports. One port is for exchanging events. A gateway can connect to the event port of a peer. A gateway only needs to connect to one event port for one channel. The normal client API is synchronous. Transactions can take several seconds and the client needs to wait for the response. Sending asynchronous events to clients is not included in the V1 plan. In addition to the synchronous transaction API, the gateway can support asynchronous transaction APs. I Provide "asynchronous invocation".
[0117] In one embodiment, the asynchronous API can operate as follows: After checking the parameters of the client request, the gateway returns a transaction ID to the client. Thus, the client can know that the initiated transaction has not finished. The gateway launches a background thread to continue processing the transaction. The client can keep track of the incomplete transaction. The gateway can provide a "transaction" API for the client to query the transaction status using the transaction ID.
[0118] According to one embodiment, client login can be supported. The BCSGW can support HTTPS protocol and can reject insecure HTTP access. The BCSGW authenticates the app adapter or SALT with a certificate. The app adapter can authenticate the end user. Tomcat must be configured to use HTTPS client certificate authentication. The keystore file contains the BCSGW certificate and CA certificate to validate that the client is provided by the BCS console. The BCS Gateway provides a BCS REST interface for the client to access.
[0119] Persistence - Storage Cloud According to one embodiment, the Hyperledger Fabric project code includes blocks for storing the ledger in a local file system, and other runtime data, such as the block index, world state, history, and the ledger provider database (which holds all ledger IDs and recovery status) in a Level DB stored in the same local file system. In the ACCS, the container file system is ephemeral. This means that if a container is stopped and a new container is restarted on a new VM due to some hardware failure, the file system contents may be lost. If all containers are lost, the ledger cannot be recovered. Therefore, the ledger data must be stored outside of the ACCS container. For this reason, a persistence solution is provided as an object store service used by the Hyperledger Fabric components described above.
[0120] According to one embodiment, in BCS, the persistence solution utilizes a storage cloud service, e.g., Oracle Storage Cloud Service. The ledger is backed up to an object store. The ledger is not written to the container file system, but is backed up to object storage. The index and world state are recorded with the container file system and can be restored from the storage cloud service if the container is restarted. Oracle Storage Cloud is an infrastructure as a service (IaaS) product that provides an enterprise-grade, large-scale object storage solution for storing files and unstructured data.
[0121] Figure 3 illustrates persistence of a blockchain cloud service system according to one embodiment. As shown in Figure 3, an ACCS instance 300 includes multiple containers. The containers include, for example, order containers 302, 304 with ledgers / blockchains 312, 314. The ledgers / blockchains 312 and 314 are backed up to object storage 320 via a REST interface. The object storage 320 may be, for example, a cloud storage service.
[0122] Object storage is used to persist each order's ledger. The current mechanism by which an order distributes blocks to peers is as follows: First, a peer requests a new block from the order by sending its version (last block number). Then, the order checks the peer's version. a) If the peer's version is greater than the order's, it replies to the peer with an error indicating that the order's ledger is lost and cannot be recovered from the EventHub (in this scenario, the order cannot continue to operate properly). b) If the peer's version is less than the order's, the order retrieves the block from its local ledger in RAM or a local file and replies to the peer. c) If both have similar versions, the order blocks until a new block is available. When a new block is available from the EventHub, the order puts this block in its local block file or RAM and then sends back to the peer a distribution thread that reads this block from the ledger. The peer can get this block, commit it to its local ledger, and broadcast the latest version of the block to other peers.
[0123] According to one embodiment, the above process allows either the order or the event hub to persist all blocks. As mentioned above, the event hub supports time-limited retention. If the event hub can perform block saving, the order can set the ledger type to RAM or file. If the order is restarted and the ledger is lost, the order can reconstruct the ledger by replaying the records from the event hub and cutting the batch messages into blocks. If the event hub only supports time-limited retention, once the order is restarted and the ledger is lost, the ledger cannot be correctly reconstructed because the first record in the event hub is not the true record of the ledger. In this case, the order cannot start the old channel because the first block containing the channel information is lost and the version number (last block number) is also incorrect.
[0124] According to one embodiment, each order can persist all channel IDs to object storage and store each block in oracle storage. Peers persist only the genesis block that contains the channel information. If a block of data is lost, the peer can read other block data from the order.
[0125] According to one embodiment, the ACCS instance 300 may include a peer container 306 that includes a ledger 316 and an index 326, and a peer container 308 that includes a ledger 318 and an index 328. Peers generate five types of runtime data: transaction log (block file), block file index (Level DB), ledger provider DB (Level DB), state database (Level DB or couch DB), and history (Level DB). All transaction data is stored in the transaction log as linked blocks in a local file and persisted to the Oracle Storage Cloud Service. The ledger provider DB persists all ledger IDs and statuses to the Level DB. The ledger ID is a unique ID to identify the channel to which the peer belongs and must be stored in the Oracle Storage Cloud Service. At runtime, peers can automatically recover and save other things to their local file systems.
[0126] According to one embodiment, the Oracle Storage Cloud service provides a REST API for uploading files to an object or downloading files from an object. To create a new block, first create the block as before. It writes to local block files, but differs by writing only one block per file. It then uploads this block file to Oracle storage as an object. If the upload fails, the changes in the local file are rolled back and an error is sent back to the originator.
[0127] According to one embodiment, when an order updates the latest checkpoint of the block file index, it persists the information to Oracle storage and then updates the local level DB. If this operation fails, an error can be sent back to the originator. This information is used to recover the block file index. In Oracle storage, each peer and order has a unique container name that consists of a combination of MSP ID and node ID. The object name is a combination of the channel name as a prefix and the block file name. For further details, see Oracle storage naming conventions.
[0128] According to one embodiment, the Ledger Provider DB can be optionally stored in Oracle Storage. When the Ledger Provider DB is updated, the whole Ledger DB can be replicated to Oracle Storage Cloud Service. Since this file is very small and updates are infrequent, the replication overhead can be neglected. When restarting a container, the container can be downloaded from Oracle Storage Cloud Service. When restarting an order from a new container, first, the order downloads the channel ID from the storage object, and then the order gets the latest checkpoint from the storage according to the channel ID. Then, the order recovers the block index from the first block to the last block. During this time, the block files are downloaded one by one. Then, the order recovers the state DB and history DB. When restarting a peer from a new container, first, the peer can download the Ledger Provider DB, and then get all the ledger IDs. Then, the peer gets the relevant genesis block from the storage according to the ledger ID. The peer starts with the settings in the genesis block and gets other block data by sending a quest to the orenda. After the peers get these blocks, they recover the block index, state DB and history DB.
[0129] According to one embodiment, the local block file acts as a read cache. Queries first read data locally and download data from object storage if the data is not present locally. In addition to the ledger, the chaincode source code needs to be persisted to oracle storage. After installing the chaincode into the current fabric, the source code is encoded and stored on the peer. The peer checks the chaincode container for each invocation or instance and reconstructs the container from the source code if it is not present. Thus, the source code can be uploaded to oracle storage after each chaincode installation and downloaded from oracle storage when restarting a peer from a disk failure.
[0130] BCS: Working with SDK base configuration files and deploying them after creation According to one embodiment, the configuration file and deployment functions deploy, generate, update, and retrieve configuration for applications when deploying or updating applications including peers, orders, CA servers, and chaincode. These functions are implemented in the BCS console (Node.js) and the Fabric container (peer / order / chaincode containers). When requested by the UI, these functions retrieve / update the configuration and modify it by calling SDK APIs as needed. As part of the BCS console backend, this component is responsible for the BCS console UI, IDCS backend, and It provides SDK to operate UI by interacting with back-end SDK and all BCS applications and gets / updates required configuration. This component also assists in creation of BCS applications. BCS creation component deploys BCS applications in docker containers of VMs created using PSM. This feature implements SDK APIs of BCS Console UI and BCS creation component gets / updates BCS application configuration and deploys in later creation phase. Creation system deploys BCS applications like CA server, orderer, peers in docker / swarm in later creation phase. VM is started at boot time. Then, it performs late creation tasks and VM initial tasks by calling the startup script.
[0131] According to one embodiment, the configuration file is provided to Fabric components, including peers, orders, Fabric CAs, and BCS gateways. The BCS application packages, configurations, and chaincodes are stored in the client's storage cloud service.
[0132] According to one embodiment, the production system is responsible for all resource allocation, including VMs, networks, and storage.
[0133] According to one embodiment, the production system stores all resource allocation information in the storage service, including VM numbers and associated network addresses / account credentials, the number and type of BCS applications in each VM, public IPs and internal IPs, and the production system has enough internal IP addresses for containers (accessible between VMs).
[0134] According to one embodiment, when the BCS creation component completes the creation operation, the VM startup script deploys the application container by starting and invoking the swarm, and the container startup shell script performs initial operations within the container.
[0135] According to one embodiment, when the BCS console runs, it retrieves settings from the storage service, saves user input from the UI to the storage service, and then sends a reboot command to the swarm.
[0136] According to one embodiment, the necessary security credentials may be stored in or obtained from the IDCS.
[0137] According to one embodiment, the BCS console backend can communicate with the BCS application using Swarm.
[0138] According to one embodiment, when a BCS application container is launched, the BCS application can determine the application type (peer, chaincode container, or other) by collecting configuration details and load the required configuration.
[0139] According to one embodiment, this component updates the configuration and provides the BCS application launch shellcode. The BCS configuration file retrieval / update operation involves several steps. First, when the BCS console is launched, it retrieves the configuration from storage and saves the configuration (shell and node.js) to storage if it needs updating. When a BCS application container is started, first the startup script (in each docker container) is started, then it gets the configuration for the application type and gets the app certificate from IDCS (shell). The BCS console UI displays a message to restart the application in the container if you want to restart the BCS application. Send to docker / swarm.
[0140] According to one embodiment, the BCS Console is stateless and when launched, it can collect all BCS instance configurations, connect to BCS applications, and monitor BCS applications. Configurations are retrieved from the storage service via backend APIs. When a configuration is changed, the BCS Console saves the configuration to the storage service by calling the backend APIs and restarts the associated application. When a client changes a configuration item via the BCS Console UI, the UI encodes the configuration into key / value data, and the backend code converts it to a file and saves it to the storage service. The BCS Console can monitor, start, and stop BCS applications. The start and stop commands use the docker / swarm APIs to achieve this functionality.
[0141] Fabric Network Deployment According to one embodiment, the Fabric network includes the following entities: peers, clients, ordering services, and a set of protocols to facilitate communication between these entities: An organization is a logical entity or business that constitutes the participants of the Fabric network. A Fabric network has multiple participating organizations. A member is a legally independent entity that owns a unique root certificate of the network. Network components such as peer nodes and application clients are linked to members. Each organization may have one or more members. An organization can configure both orders and peers, or it can configure only orders or only peers.
[0142] The first step to deploy a Fabric network is to define the participants. This step is done out of band of the Fabric network. All participating organizations in the Fabric network negotiate and decide the configuration of the network, e.g., which organizations will configure order nodes or which organizations will configure peer nodes. Each organization that configures order nodes publishes the root certificate of its order server. Each organization that configures peer nodes publishes the root certificate of its peer servers. Each organization that contains clients publishes the root certificate of its clients. Clients can be divided into different members from peers in one organization.
[0143] As an example, four banks (Bank 1, Bank 2, Bank 3, and Bank 4) deploy a blockchain network with an ordering service that includes order nodes owned by Bank 1 and Bank 2. Bank 1 constitutes only the order of this network. Each bank is an organization of the Fabric network. That is, Bank 1 has one member, the order (Root Certificate 1). Bank 2 has three members, namely, client (Root Certificate 21), peer (Root Certificate 22), and order (Root Certificate 23). Bank 3 has two members, namely, client (Root Certificate 31) and peer (Root Certificate 32). Bank 4 has two members, namely, client (Root Certificate 41) and peer (Root Certificate 42).
[0144] After defining the participants, create certificates for orders and peers. Each order or peer needs a (private key and signing certificate) pair to identify itself. Each member can configure and start its own Fabric CA server with a root certificate and create (private key and signing certificate) for each order / peer server of that member by making a request to the CA server using CLI or SDK. BCS provides a Fabric CA server that can create certificates. However, Fabric The CA server is not the only means for creating certificates. Users can use other CA systems to create certificates. Therefore, the Fabric CA server is not a required component of the Fabric network.
[0145] After creating the order and peer certificates, we start the Fabric network by creating a system channel. The system channel created (or more precisely started) is the first channel, since there is only one system channel for an ordering service (and therefore one Fabric network). The system channel defines the following configurations of the Fabric network: one ordering service and one or more consortia. An ordering service includes one or more ordering organizations (each organization includes an MSP ID and a certificate), ordering service attributes (e.g. type, such as Solo or Kafka, address of the order, batch size / timeout), and policies (for creating channels). Each consortium includes one or more peer organizations, and each peer organization that wants to join this Fabric network must be defined in one of the consortia. Each organization includes an MSP ID, a certificate, and an anchor peer.
[0146] After a system channel for a Fabric network is started, a genesis block (the first block in the chain) for the system channel is created. The ordering service administrator creates the genesis block for the system channel. The genesis block can also be created (as a file) by the configuration file generator (configtxgen) tool. It may be created at the time of order startup or temporarily. When creating a genesis block using the configuration file generation tool, the configuration file configtx.yaml as input is used. This file contains the following information: root certificates of all ordering organizations in the Fabric network, root certificates of all peer organizations, attributes of the ordering service including order type, address, batch timeout, batch size and Kafka, policies, channel readers for authenticating and validating channel delivery requests, channel writers for authenticating and validating channel broadcast requests, chain creators for evaluating chain creation requests, and administrators for authenticating and validating channel reconfiguration requests.
[0147] The ordering service administrator starts an order server with a configuration file and a genesis block. In other words, the genesis block is used to create a system channel. To start an order server, a configuration file orderer.yaml is required, which contains the listen address / port, ledger type, and local MSP (private key, signing certificate). Each organization that provides an ordering service starts its own order server (without specifying a genesis block).
[0148] Each organization configuring a peer node starts a peer server by preparing a local MSP (private key, signing certificate) to identify the peer, and a configuration file for each peer (default location / etc / hyperledger / fabric / core.yaml) to specify peer attributes such as listen address / port, bootstrap peer, and gossip attributes.
[0149] After initiating the order and peers, the channel administrator (with the right to create a channel) uses the Fabric CLI or SDK to request the order to create a channel with the following inputs: one consortium (already defined in the system channel) and one or more peer organizations in the consortium. Each participating organization uses the Fabric CLI or SDK to join some of its peers to the newly created channel.
[0150] Example: Deploying a Fabric network on BCS FIG. 4 shows an exemplary arrangement of fabrics on a BCS.
[0151] More specifically, the figures and description describe the steps for deploying a Fabric network over a BCS. In this example, four entities A, B, C, and D wish to create and join a Fabric network. The four entities discuss offline and determine the responsibilities of the various entities. Each entity creates one or more BCS instances over OPC.
[0152] According to one embodiment, Entity A provides both orders and peers. Entity A creates two instances: Order_Org1 401 for orders and Peer_Org1 421 for peers. Entity A is also responsible for creating the Fabric network (note that only orders can create Fabric networks). The ordering service 400 includes Order_Org1 401, Order_Org2 402, and Kafka cluster 410.
[0153] According to one embodiment, entity B provides both orders and peers. Entity B creates two instances: order_org2 402 for orders, and peer_org2 422 for peers.
[0154] According to one embodiment, entity C provides peers only. Entity C creates the instance peer_org3 423.
[0155] According to one embodiment, entity D provides peers only. Entity D creates the instance Peer_Organization4 424.
[0156] According to one embodiment, the administrator of each BCS instance collects the CA and admin certificates of the current organization from the BCS console. The administrator of each peer organization identifies the anchor peers of the current peer organization and collects the IP / ports of the anchor peers. The four entities exchange all collected information with each other offline.
[0157] According to one embodiment, the administrator of order_organization1 creates a Fabric network from the BCS console by creating a system channel with the information collected in the previous step, i.e., CA certificates and admin certificates of each organization, and anchor peers of each peer organization. The backend work includes creating a genesis block by invoking the Fabric tool, and creating a system channel by setting an order with the genesis block.
[0158] According to one embodiment, an administrator of each peer organization joins the Fabric network by updating the configuration of all peer nodes from the BCS console to add the collected CA / admin certificates of the other organizations and restarting all peer nodes.
[0159] According to one embodiment, a method is provided that allows new organizations to join existing Fabric networks in the system, and provides a simple user interface and facilitates communication between participants to create / join a Fabric network, e.g., to protect offline actions prior to forming the Fabric.
[0160] Chaincode (Smart Contract) Container According to one embodiment, as described above, chaincode may include software that defines one or more assets and transactional instructions (business logic) for modifying the assets. Chaincode may read key-value pairs or other state database information. Executes rules to take or modify a transaction. Chaincode functions are executed against the current state database of the ledger and are acted upon by transaction proposals. Chaincode execution results in the writing of a set of key-values (the write set) that are submitted to the network and applied to the ledger on all peers.
[0161] According to one embodiment, to support consistent updates of information and to enable certain ledger functions (transactions, queries, etc.), a blockchain network uses smart contracts to provide controlled ledger access. Smart contracts may be written to encapsulate information and easily replicate that information across the network, as well as to allow participants to automatically execute certain parts of transactions.
[0162] According to one embodiment, Hyperledger Fabric smart contracts are written in chaincode and are invoked by applications external to the blockchain when they need to interact with the ledger. In most cases, the chaincode only interacts with the database component of the ledger, which is the world state, and not the transaction log (e.g., to query the database).
[0163] According to one embodiment, Hyperledger Fabric uses the Docker engine to build chaincode, deploy chaincode, and execute chaincode. This section describes the architecture of the Fabric and how it integrates into the ACCS layered model of BCS.
[0164] According to one embodiment, Fabric deploys and manages user chaincode as follows: First, it builds the chaincode in an ephemeral CC environment container. Then, it transfers the chaincode as source code to a builder container, compiles it with statically linked required libraries ("Java build"), and sends it back as a binary to the peer. Static linking allows the actual chaincode container to be as small as possible. Then, it builds and starts the chaincode image and container. The chaincode container keeps running until the peer stops or the channel is terminated. If the chaincode container crashes or is killed, it is restarted at the next invocation if the image exists. With this design, one peer and channel has one chaincode docker container. The chaincode is explicitly installed on the peer, i.e., the chaincode does not necessarily have to be installed on all peers joining the channel.
[0165] According to one embodiment, users can deploy a fabric network in the ACCS hierarchical container that can easily distribute components such as peers, orders, and chaincode. Because local block storage is not a reliable recovery method and chaincode binaries for ACLS containers need to be stored in cloud storage, the chaincode runtime environment container (ccenv) is dynamically activated. Once built, the chaincode binary is uploaded to cloud storage for recovery in case of a container crash.
[0166] According to one embodiment, each chaincode interaction corresponds to a different function of the chaincode. The only constraint is that a chaincode cannot be called or queried until it is instantiated. Also, when called, any chaincode containers that are not running will be restarted.
[0167] FIG. 5 illustrates a chaincode architecture according to one embodiment. More specifically, 5 illustrates a chaincode architecture that allows a client 530 to install chaincode and execute transactions in an ACCS environment 500, according to one embodiment. In step 1, the client 530 installs the chaincode source code in peer 1 510. First, it builds the chaincode in a transient CC environment container. When the client 530 executes the "install", it starts the builder container, which automatically starts the builder agent, waits for the builder container to finish initialization, and sends the chaincode source code to the builder container via the peer (step 2). The builder agent builds the chaincode (Java build). It transfers the chaincode as source code to the builder container, compiles it with statically linked required libraries ("Java build"), and sends it back to the peer as a binary. The static linking allows the actual chaincode container to be as small as possible. Once built, the chaincode package (tgz file) is uploaded to the cloud storage 560 (step 3). The builder agent sends the cloud storage location to the peer for later reference (step 4.2).
[0168] According to one embodiment, the peer 510 then uses the PSM REST API to start the CC environment as an ACLS (Access Control List) container 520. The chaincode image and container are built and started. The chaincode container runs until the peer stops or the channel is terminated. The peer 510 starts by passing the chaincode ID, self IP (for chaincode registration) and cloud storage location to the ACLS container (step 4.1). The peer waits for the chaincode to start or a timeout after a configured period. The CC environment starts the chaincode. Once started, the chaincode registers itself with the peer (step 4.3). This allows the chaincode to be invoked in transactions using the connection established during registration (step 5).
[0169] According to one embodiment, the builder container 550 includes a simple REST-style server. The builder container 550 includes a builder agent 553. When the builder container 550 is started, it listens for requests to build the chaincode. When the builder container 550 receives a build list, e.g., a POST call with base64 encoded source code as a body, it base64 decodes the source code and saves the chaincode source code to the local file system. The builder agent 553 does a "Java build" on the source code. If the "Java build" is successful, the builder agent 553 packages the binaries and uploads them to cloud storage 560. The builder agent also sends the chaincode location to the peers. If the "Java build" fails, the agent sends the error and reason to the peers.
[0170] BCS Admin Console As described above, each instance of a BCS includes a management console that can be used to manage and monitor the BCS instance, including BCS gateways, BCS nodes, and BCS channels.
[0171] According to one embodiment, a system for providing a management console may include a web application running in a scripting runtime environment, such as Node.js. A web application can be built on a graphical user interface framework and a web framework and can contain multiple custom functions or APIs to communicate with various nodes or services in a BCS instance. A web application can load information from various nodes or services in a BCS instance into view objects and display them in a console user interface. The administration console may also provide administrators with the functionality to start, stop, and update one or more nodes in a BCS instance. A set of administrative REST APIs may be provided by or accessed by a scripting runtime environment to support functionality similar to that provided by the web application.
[0172] According to one embodiment, the system allows for easy monitoring and management of associated BCS instances via a web interface provided by a web application or via custom REST client applications written using a set of administrative REST APIs.
[0173] According to one embodiment, a BCS administrator can manage multiple components of a BCS instance via an administration console, including one or more peer nodes, one or more order nodes, one or more Fabric CA nodes, one or more BCS gateway nodes, channels, and one or more chaincodes.
[0174] According to one embodiment, managing BCS components may include performing one or more of the following operations: start a component, stop a component, add a component, remove a component, view / edit component attributes, view component performance metrics, and view component logs.
[0175] FIG. 6 illustrates a system for providing a management console according to one embodiment. As shown, the BCS Management Console 136 may be provided as a component of a BCS instance within the Application Container Cloud Service 128. The BCS Management Console is implemented using a scripting language that is a runtime environment provided by Node.js. The network may be a web application that runs in the real-time environment 605.
[0176] According to one embodiment, the management console can include a fabric node SDK 611, a number of fabric custom functions 613, and a number of ACCS APIs 615. The SDK, custom functions, and ACCS APIs can be used to communicate with a fabric network 601, which can include a distributed streaming service (e.g., Kafka) 603. The management console further includes a view object 623, which can include information that needs to be displayed in the BCS console UI 104 or a REST client 604, or can include information that needs to be passed from the BCS console UI or a REST client to the management console. The fabric node SDK 611 can operate to map information from the fabric network to information from the BCS console UI or a REST client.
[0177] According to one embodiment, the BCS Administration Console is implemented using a GUI framework (e.g., JET ) 617 and web frameworks (e.g., express) 619. The GUI framework can provide various user interface (UI) components and elements that can be used in the administration console web application. For example, the UI components and elements can be used to create forms, collect data, and visualize data. The web framework can be written in Java Script and can provide a web application framework that includes a robust set of features for developing web and mobile applications.
[0178] 7A-7B show a user interface within the BCS Console UI according to one embodiment. Here is an example of a chair.
[0179] According to one embodiment, a BCS overview 711 can be displayed in the dashboard, as shown in Figure 7A. The overview can include the number of organizations, the number of peers, the number of orders, the number of channels, and the number of chaincodes.
[0180] According to one embodiment, health information 713 for a BCS instance can be displayed. The health information is shown visually and numerically. The example UI can also display transaction execution 714 and ledger summary 715.
[0181] According to one embodiment, Figure 7B shows information for all nodes in a BCS instance. For example, the example UI shows a total of five nodes, including two peers, one order, one fabric CA, and one REST proxy (in a BCS gateway node). The overview UI 717 displays the name of the node 723, route information for node 725, type of node 729, and status information for node 731. The example UI includes a button 721 for an administrator to add a node and one or more drop-down lists 719 for selecting nodes.
[0182] Managing nodes According to one embodiment, two entities, namely, BCS Administrator and BCS User, can manage a BCS instance using the Management Console. There is only one BCS Administrator account for each BCS instance. The BCS Administrator account may be created when creating a BCS instance. The BCS Administrator may be bundled with the Fabric CA Administrator (i.e., the BCS Administrator uses the Fabric CA Administrator ID to perform all operations from the BCS Console or via the BCS Management REST API). There may be more than one BCS User account. The BCS User account may be created by the BCS Administrator by registering a Fabric CA identity.
[0183] According to one embodiment, the nodes in a BCS instance may be displayed on a single web page. The management console may support two modes: the first mode may present each node's name, type, access URL, and status as a list; the second mode may present the channels in which each peer participates as a diagram.
[0184] Furthermore, according to one embodiment, a BCS administrator can start and stop peer nodes, order nodes, Fabric CA nodes, and BCS Gateway nodes, and can add and remove peer nodes, order nodes, and BCS Gateway nodes through the administration console, but cannot add or remove Fabric CA nodes.
[0185] According to one embodiment, a BCS administrator can set node attributes when adding a node. A newly added node can be automatically started as part of the add operation. When a node is deleted, it is stopped and removed from the BCS instance.
[0186] According to one embodiment, the BCS console UI can list all channels that an active peer node participates in and all chaincodes installed on the active peer node.
[0187] According to one embodiment, when managing peer nodes, a BCS administrator can add active peer nodes to existing channels and view and edit the attributes of active order nodes. BCS users can view some attributes of active peer nodes.
[0188] Additionally, a snapshot of active peer node performance metrics, such as memory utilization, CPU utilization, network I / O, and disk I / O, may be displayed in the BCS console UI.
[0189] According to one embodiment, when managing order nodes, a BCS administrator can view the logs of active order nodes and can view and edit the attributes of active order nodes. BCS users can view some attributes of active order nodes. Similar to managing peer nodes, a BCS administrator can view snapshots of performance metrics of active order nodes, such as memory usage, CPU usage, network I / O, and disk I / O.
[0190] According to one embodiment, when managing fabric CA nodes, a BCS administrator can view and edit attributes of active fabric CA nodes, retrieve CA certificates from active fabric CA nodes, view logs of active fabric CA nodes, and view snapshots of performance metrics of active fabric nodes, such as memory utilization, CPU utilization, network I / O, and disk I / O.
[0191] As described above, management of BCS Gateway nodes may further include adding BCS Gateway nodes or removing BCS Gateway nodes. Because the maximum allowed number of BCS Gateway nodes is specified when instantiating a particular BCS instance, the number of BCS Gateway nodes that may be added to a BCS instance is limited by the configured maximum allowed number of BCS Gateway nodes.
[0192] According to one embodiment, each BCS Gateway Node can have a name that is a globally unique identification of the Gateway Node. This name is referenced when configuring the BCS Gateway Node. Also, when creating a BCS Gateway Node, a network address can be determined and displayed.
[0193] According to one embodiment, a BCS administrator can define a BCS Gateway configuration file and start a BCS Gateway node when configuring the BCS Gateway node. Creating a BCS instance does not require creating channels or deploying chaincodes. Thus, a BCS Gateway node will not function until one or more chaincodes are deployed and a valid BCS Gateway configuration is defined via the administration console.
[0194] Each BCS Gateway node has a settings page, in which the following items can be configured in a specific embodiment: 1) Channel: Select the channel to be published through the current gateway node. 2) Chaincode: From the list of all chaincodes instantiated on each channel, select the instantiated chaincode to publish. 3) Endorser: Define the endorsers for each chaincode. 4) Create a BCS Gateway configuration according to the above settings. Once a valid BCS Gateway configuration file is created, the Gateway can be started.
[0195] According to one embodiment, the BCS Console allows viewing of BCS Gateway properties using a List View feature. The List View provides the following information for each BCS Gateway: 1) Name: A globally unique name specified when creating the gateway. 2) Fabric Identifier: Each BCS Gateway can be associated with the identity of a Fabric Client that is registered when creating the BCS Gateway. This Fabric Client can perform all operations (e.g., calls, queries) performed by the BCS Gateway. 3) Network Address: The access point has a public internetwork address. 4) Status: Working or not working.
[0196] According to one embodiment, a BCS administrator can view the logs of active BCS Gateway nodes via the Administration Console to view the following BCS Gateway metrics: 1) Connected clients: client name, address, logon time, etc. 2) Current Transaction Information: Current transaction information is available along with state information, i.e., the state of the transaction. Current transaction information is useful when debugging frozen transactions. 3) Transaction Statistics: Transaction statistics are available via the Administration Console UI. For example, transaction statistics can include the number of completed transactions, the number of event notifications received, and the number of event notifications sent. 4) Memory usage. 5)CPU usage. 6) Network I / O. 7) Disk I / O.
[0197] Managing Channels According to one embodiment, a BCS user can list all channels that the current BCS instance participates in. A BCS administrator can create a channel using inputs: a channel name, a consortium name, and one or more organization names, and can display output to indicate the success or failure of the channel creation.
[0198] According to one embodiment, BCS users can view the nodes and organizations participating in a channel. The management console can support tow view modes including list mode and topology mode. In list mode, the participating local nodes and external organizations (as indicated by anchor peers) may be shown as a list. In topology mode, the participating local nodes and external organizations (as indicated by anchor peers) may be shown as a topology diagram.
[0199] According to one embodiment, the BCS administrator can query the ledger of peers in a channel. The ledger can contain multiple transaction blocks. Each transaction block can contain a block ID, past hash, data hash, timestamp, transaction ID list, operation (1 to n), chaincode ID, chaincode proposal, response (r / w set, event, success or failure), and one or more endorsers. The following statistics can also be displayed: number of blocks and number of invocations.
[0200] According to one embodiment, a BCS administrator can list all chaincodes instantiated on a channel. The listed items include the chaincode ID and the BCS administrators can also view the following information for an instantiated chaincode: the path specified by the instantiated transaction, and the instance arguments.
[0201] According to one embodiment, a BCS administrator can update a chaincode instantiated on a channel. The update operation can take the following inputs: a target endorser with a new version of the installed chaincode, one or more orders, a chaincode version, and an optional argument that can be a string argument specific to the chaincode. The output of the update operation can be success or failure with an error message.
[0202] Managing Chaincode According to one embodiment, a BCS administrator can list all chaincodes installed on any peer of the current BCS instance. The listed items include the chaincode ID and version. The BCS administrator can also view the following information for an installed chaincode: the local peer node that installed the chaincode, and the channel on which the chaincode was instantiated.
[0203] According to one embodiment, a BCS administrator can install chaincode on one or more local peer nodes via an administration console. Inputs for installation can include target peers, chaincode type, e.g., Go / Java, chaincode ID, which can be the name of the chaincode, chaincode version, chaincode path, which can be the location of the source code of the chaincode, and optional chaincode package. Output of the install operation can be success or failure with an error message.
[0204] According to one embodiment, a BCS administrator can instantiate an installed chaincode on a channel with the following information as input: channel name, target endorser with the new version of the installed chaincode, order, chaincode version, and an endorsement policy with optional arguments that can be string arguments specific to the chaincode, a specific format, or a default format in the absence of a specific format.
[0205] Membership Management According to one embodiment, the BCS Administrator can list all identities in the current BCS instance, register new users / identities in the current BCS instance, unregister registered identities, and remove users from the current BCS instance. The BCS Administrator can also view / edit the following attributes of the identity, as shown in Table 1:
[0206] [Table 1]
[0207] According to one embodiment, a BCS user can register or re-register itself via the administration console, which can create a private key and certificate for the user, a BCS administrator can also disable a previously registered ID via the administration console, and a BCS user can change their password via the administration console.
[0208] According to one embodiment, the BCS Administration Console can be started or stopped along with starting or stopping the associated BCS instance.
[0209] According to one embodiment, the log level can be set in the BCS Admin Console in two ways: The log level can be changed at runtime using the BCS Admin Console or the Admin REST API.
[0210] REST API As mentioned above, different components in a Fabric network communicate based on the gRPC protocol, so for a BCS instance based on a Fabric network, a client application needs to use the Fabric SDK to call the chaincode in the BCS instance.
[0211] Having client applications communicate with blockchain cloud services using the Fabric SDK partially negates the benefits of providing a blockchain framework as a cloud service, such as being able to access the cloud service from any location with an internet connection.
[0212] According to one embodiment, the systems and methods described herein can provide a REST proxy in a BCS instance. The REST proxy can provide multiple REST APIs for use by a REST client to query through chaincode, invoke transactions synchronously or asynchronously through chaincode, get transaction status, and get the version of the BCS proxy. The REST proxy can authenticate REST calls and translate REST calls into GRPC calls. The REST proxy can also provide REST APIs that support functionality similar to that provided by the BCS Admin Console.
[0213] According to one embodiment, the REST proxy provides a user interface for client applications to consume BCS instances.
[0214] FIG. 8 illustrates a system for providing a REST proxy in a BCS instance according to one embodiment.
[0215] 8, the REST proxy 138 may include a REST authentication tool 827 and a protocol conversion tool 829. When the BCS REST API client 808 sends a REST call 815 to the REST proxy, the LBaaS 126 connected to the Cloud Gate 811 may authenticate the REST call to determine whether the REST call contains a valid username and a valid password that allows the REST to access the BCS instance.
[0216] According to one embodiment, if the LBaaS authenticates the REST call, it forwards the REST call to a REST proxy, which forwards the REST call 835 to the IDCS 813, which can determine whether the client application is properly authorized by the BCS.
[0217] According to one embodiment, if the client application is properly authorized, the REST proxy can translate / convert the REST calls into gRPC calls 825 and send the gRPC calls to the Fabric network 601. Once the REST calls are translated / converted into internal calls (gRPC), they can interface with instances of blockchain Fabric / Hyperledger.
[0218] According to one embodiment, the REST calls may be translated by a protocol translation tool, which may be a Java application based on Fabric Java SDK 831 with gRPC library 833.
[0219] As further shown in FIG. 8, the REST proxy can expose one or more functions provided by the REST API 823 to the management console by communicating with the management console using REST 821, as described above.
[0220] Example REST API According to one embodiment, before calling the REST API of a BCS instance, the REST proxy must be started and running. You can check the status of the REST proxy through the administration console. If the REST proxy is not up and running, you must activate the REST proxy from the administration console.
[0221] According to one embodiment, one can interact with smart contracts (chaincodes) deployed to peer nodes in a BCS instance by invoking REST APIs. The deployment process can be accomplished via an administration console.
[0222] According to one embodiment, for illustrative purposes, an exemplary REST API is provided. The examples used herein assume that the following exemplary chaincode is deployed on the BCS network:
[0223] [Table 2]
[0224] According to one embodiment, an example includes an administration console, from which the REST proxy can be activated if it is not up and running.
[0225] According to one embodiment, one can interact with smart contracts (chaincodes) deployed to peer nodes in a BCS instance by invoking REST APIs. The deployment process can be accomplished via an administration console.
[0226] According to one embodiment, for illustrative purposes, an exemplary REST API is provided. The examples used herein assume that the following exemplary chaincode is deployed on the BCS network:
[0227] According to one embodiment, the REST API provides the following functions: query via chaincode, invoke a transaction via chaincode, invoke a transaction via chaincode asynchronously, get transaction status, get BCS Gateway version. To perform these functions, a client accesses the BCS Gateway using HTTPS and utilizes message formats according to the API.
[0228] According to one embodiment, the query via chaincode function executes a query operation by invoking the chaincode. The chaincode and the query arguments are defined in the REST The REST API Get Transaction Status gets the status of the transaction by querying the channel. The channel and transaction ID are specified through the REST API. The REST API Get BCS Gateway Version returns the gateway version information.
[0229] According to one embodiment, the REST API, Invoke Transaction via Chaincode, executes a transaction by invoking a chaincode. The chaincode and arguments for the invocation are specified via the REST API. This REST API executes the transaction in synchronous mode, which means that it returns either a response that the transaction is successful, a response that the transaction is unsuccessful, or a response that the transaction is timed out.
[0230] According to one embodiment, a REST API called Asynchronous Invocation of Transaction via Chaincode executes a transaction by invoking a chaincode. The chaincode and arguments of the invocation are specified via the REST API. This REST API executes a transaction in an asynchronous mode. This is because This means that the response / acknowledgement is returned immediately after submitting the transaction, without waiting for the transaction to finish or time out. The results are provided afterwards. The BCS Instance Management REST API supports similar functionality to that provided by the BCS Console (described below).
[0231] Fabric Certificate Authority (Fabric CA) integrated with Identity Cloud Service (IDCS) According to one embodiment, the Fabric CA server provides the Fabric membership service. The Fabric membership service includes three parts: authentication of users, authorization to access the blockchain (groups of peers and orders), and CA servers for delivering certificates to application clients, peers, and orders. The Fabric CA uses certificates to implement authentication and authorization. Certificates include two types: registration certificates for authentication and transaction certificates for authorization. IDCS also provides authentication and authorization. However, this authorization is implemented by OAuth. That is, when a peer wants to access an order, it obtains the user's access token from IDCS and uses this token to access the order.
[0232] According to one embodiment, the Fabric CA uses a database or LDAP to store information of registered users of the Fabric CA, such as the user's name / password, the user's certificate, and the user's affiliation. End users of the public cloud (OPC) use one centralized IDCS instance for managing employees to access all public cloud (OPC) instances used by the employees. The blockchain cloud service BCS is preferably integrated with the IDCS used for other cloud services. Thus, end users can use one centralized IDCS instance for managing employees to access all public cloud (OPC) instances (including BCS) used by the employees.
[0233] In one embodiment, Blockchain Cloud Service (BCS) uses Oracle Identity Cloud Service (IDCS) to centrally store user information. BCS stores Fabric CA user information in IDCS. This allows Oracle BCS to use IDCS to manage centralized BCS user information across multiple public cloud service instances. Thus, in one embodiment, BCS Fabric CA user information and certificates are stored in Oracle IDCS. The Fabric certificate authentication framework is a Fabric Membership Provider (MSP) that includes PKI private keys, signed certificates, and CA certificate chains, and is configured by the Fabric CA client / server.
[0234] According to one embodiment, BCS leverages OPC user management. First, a BCS user must be an OPC user (with an IDCS ID). When a BCS instance is created, several applications are created, including the BCS Console, CA, and REST Proxy. The Console has two app roles: Console Admin and Console User. The CA has four app roles: Fabric Admin, Fabric Client, Fabric Peer, and Fabric Order. The REST Proxy has two app roles: Gateway Admin and Gateway User.
[0235] According to one embodiment, to make an OPC user a BCS user, the OPC user must be granted a specific BCS app role in the OPC User Management Console.
[0236] When creating a BCS instance, the creator must provide an existing OPC user / password and this user will automatically be granted the BCS Console Admin and Fabric Admin roles, therefore making this user a BCS Administrator.
[0237] For BCS Console / CA / REST Proxy authentication, authentication is done at Cloud Gate. For Peer / Order, authentication is done based on signature. For BCS Console, after authentication, the console gets the app roles for the current user (by calling IDCS). If this user is not granted Console Administrator or Console User role, the connection is rejected. Else, the console does access control based on predefined rules. For example, a normal user can only read information, an administrator can do anything.
[0238] According to one embodiment, in the case of the CA, after authentication, the CA retrieves the app roles of the current user. If the user has not been granted a fabric role, the registration request is rejected.
[0239] According to one embodiment, in case of REST proxy, after authentication, the REST proxy gets the app role of the current user. If the user is not granted the gateway admin or gateway user role, the request is denied. Otherwise, the console performs access control based on predefined rules. For example, normal users can make calls / queries, administrators can change settings and get metrics.
[0240] According to one embodiment, the Fabric CA server provides the Fabric membership service, which includes three parts: authentication of users, authorization to access the blockchain (groups of peers and orders), and a CA server that can distribute certificates to application clients, peers, and orders.
[0241] According to one embodiment, the Fabric CA uses certificates to perform authentication and authorization. Certificates include two types: registration certificates for authentication purposes and transaction certificates for authorization purposes.
[0242] According to one embodiment, the IDCS also provides authentication and authorization, however this authorization is performed by OAuth, i.e. when a peer wants to access an order, it gets the user's access token from the IDCS and uses this token to access the order.
[0243] FIG. 9A illustrates a typical IDCS use case for single sign-on, according to one embodiment.
[0244] According to one embodiment, in an initial step, a web application 901 can be added to IDCS 902. A client, such as a web browser 900, can then request authentication (e.g., username and password) from the web application. Because the web application has already been added to the IDCS, the web browser can be instructed to send an authentication request to the IDCS. After the web browser receives a response from the web application, it can request authentication (e.g., username and password) from the IDCS.
[0245] IDCS can then authenticate the request and, if authentication is successful, send a token back to the web browser. Once authenticated and receiving the token, the web browser can then use the web app. The web browser can then send a request to the web application, which can then validate the token and inform the web browser that the authentication was successful.
[0246] In the case shown in Figure 9A, IDCS acts as an identity provider (IdP) providing services to identify applications. All communication between all participants is based on HTTP. This use case is configuration-driven, but applies only to HTTP-based applications.
[0247] FIG. 9B illustrates an IDCS use case for Fabric client authentication, according to one embodiment.
[0248] According to one embodiment, a Fabric client 904 associated with a Fabric user that is already registered and enrolled (the user's private key and certificate are already stored in the client-side state store) can request a new client and obtain the client's user information (username). The Fabric SDK 905 can load the user from the state store and return the user object to the Fabric client. Once the client receives the user object, it can send a transaction proposal to the Fabric SDK, which can sign the proposal with a similar private key. The signed proposal is then sent to a peer 906, which can verify the signature with a membership service 907. The membership service can obtain the user's certificate from the IDCS 902 and verify the user's signature with the certificate from the IDCS. The membership service can then return a proof to the peer that the signature has been verified.
[0249] Support for SQL-based rich queries on the Hyperledger Fabric blockchain According to one embodiment, the system and method can support a relational engine for storing the world state of the blockchain, utilizing SQL to compute a Merkle tree stored in the transaction payload. allows you to query key / value pairs and verify the results at commit time.
[0250] According to one embodiment, the systems and methods described herein can create complex smart contracts in an easier and more manageable manner by executing SQL queries, and can improve performance by pushing data sorting back to the storage engine (rather than performing it at the smart contract level) and relying on a relational engine that supports concurrent read and write access of data.
[0251] FIG. 10 illustrates a system for supporting a state of the world database in a Fabric blockchain according to one embodiment.
[0252] According to one embodiment, the state of the world database 1000 can include a versioned database provider 1005 and a versioned database 1010. In a typical Hyperledger blockchain fabric, as well as other blockchain fabrics, the state of the world database includes a database of key / value pairs, i.e., every "value" in the database is paired with a "key" that is used to look up this value.
[0253] According to one embodiment, the world state is updated with every transaction that modifies the blockchain. The process is controlled by the transaction manager 1015, i.e., the transaction manager adjusts the write / read rate depending on the state of the world database. The validator 1020 is an entity for verifying that the data is still consistent when, for example, a smart contract is about to commit a transaction. The execution of a transaction is divided between endorsement (e.g., execution) and verification (commitment). Execution (endorsement) is a simulation of what the transaction would be like if it were committed, which is the part of the transaction that accesses the state of the world database. Verification is performed after the commit. A transaction collects a number of endorsements by the execution of chaincode by multiple nodes. When a transaction collects enough endorsements to satisfy the policies on the ledger that the transaction is trying to update, it moves to the commit phase. Generally, there is a certain period between the two phases of a transaction. Verification takes information from the endorsements and verifies that the information is still valid. If all the information is still valid, the transaction is committed and the world state is updated.
[0254] According to one embodiment, several operations 1030 may be performed in relation to the state of the world database. These operations include, but are not limited to, getting a state (GetState), getting multiple keys for a state (GetStateMultipleKey), getting a state range (GetStateRange), executing a query (ExecuteQuery), getting the latest savepoint (GetLatestSavepoint), and applying updates (ApplyUpdates). Similarly, several operations 1035 may be performed in relation to the transaction manager. These operations include, but are not limited to, simulator (Simulator), query execution (QueryExecutor), validate and prepare (ValidateAndPrepare), and commit (Commit).
[0255] As an example, the state of the world database can represent the current balance of all users in Bitcoin, where the current balance is a snapshot that corresponds to the current state of the world database.
[0256] According to one embodiment, in Hyperledger, the state of the world database is captured in a persistence engine that is not accessible externally, but is accessible internally via the blockchain. Smart contracts (transactions) in the blockchain can access the state of the world database.
[0257] According to one embodiment, for example, a smart contract may be written to transfer a certain amount of money from party A to party B over a certain period of time. The smart contract may also be written to ensure that party B meets some condition, such as transferring rights to a property, to party A before transferring the money. Additionally, the smart contract may be written to ensure that party A has received the rights before transferring the funds from party A to party B.
[0258] According to one embodiment, the smart contract depends on the state of the world database. The smart contract can look up the current balance of account A, the current balance of account B, and the current title of the property being transferred. This information is obtained by checking the state of the world database. The smart contract is a stored procedure. The underlying data may be a set of underlying tables that are accessed.
[0259] According to one embodiment, the state of the world database is stored in a fast key-value store. Such a database stores a label (key) and associates a value with that key. For example, a balance can be associated with a key. Another example is a picture (a bitmap) can be associated with a key. In general, such a persistence engine is very fast.
[0260] However, according to one embodiment, such persistence engines are limited because the system only supports a search mechanism. Such persistence engines cannot provide rich queries, such as comparisons between multiple values. For example, a key-value persistence engine cannot process a query that requests the name of the account with the highest balance among 10,000 different accounts. Also, such persistence engines cannot perform functions on the internally stored values, such as maximum, minimum, or average values. For example, a key-value persistence engine cannot provide a user's average balance over a period of X months in response to a query. Instead, a script or smart contract must be written to pull each value from the key-value pair and then perform a query on each pulled value. These limitations of the key-value persistence engine make it very difficult to write smart contracts, as they must deal with the inherent limitations of key-value stores.
[0261] Additionally, according to one embodiment, the key-value persistence engine cannot perform read and write transactions simultaneously. Writes are appropriately locked during reads to prevent values from changing during a read transaction. Similarly, reads are appropriately locked during writes to prevent accidentally reading a value that is being written during a write operation. Such read and write locks are a further limitation of conventional key-value store persistence engines.
[0262] According to one embodiment, the system and method can provide a relational database or other persistence engine that allows for rich queries (eg, SQL) instead of a key-value persistence engine.
[0263] According to one embodiment, providing a blockchain fabric, such as the Hyperledger blockchain fabric, with access to a relational database allows users and smart contracts to go beyond the limitations of key-value stores. Such a database can support MVCC (multiple version concurrency control), snapshots (allowing users / operations to create snapshots of data without stopping writes to the database). This can increase performance and usability, and simplify the coding / writing of smart contracts and other transactional processes that need to query a persistence engine.
[0264] FIG. 11 illustrates a system for supporting SQL-based rich queries in a blockchain fabric according to one embodiment.
[0265] According to one embodiment, a system for supporting SQL-based rich queries in a blockchain fabric can include a state of a world database 1100, which can include a relational database interface 1102, a versioned database provider 1105, and a versioned database 1110. Also, a transaction manager 1115 and a validation tool 1120 can be provided. As with conventional systems, the state of the world interface, the transaction manager, and the validation engine are each updated.
[0266] According to one embodiment, the transaction manager and validation engine (e.g., validation tool 112) may use the same interfaces supported by the Hyperledger fabric. It is built against a single interface, but relies on creating and committing relational transactions internally. Similarly, a versioned database provider and a versioned database contain a transaction-aware versioned database, which is similar to a versioned database, but is saved per transaction. This allows you to create transactions in read / write mode, and the database can handle such situations internally without the need for read / write locking.
[0267] Also provided, according to one embodiment, is a relational database interface 1102. The interface may include an abstraction that allows a user (e.g., a smart contract) to plug in a desired relational engine. Examples include Oracle, SQL, or any other database that supports SQL and transactions (e.g., SQLite). In one embodiment, it supports Berkeley DB, which enables a relational layer that allows contracts to interact with versioned databases in a relational manner. According to one embodiment, Berkeley DB supports: It is an embedded database that can improve performance.
[0268] According to one embodiment, the transaction manager can be aware of database transactions, unlike the locking approach used for databases such as LevelDB and / or CouchDB.
[0269] According to one embodiment, each channel can share a similar versioned database (e.g., SQLite). Each database contains multiple tables, and each table is mapped to a versioned database (e.g., Berkeley DB). BDB can be configured to persist multiple databases as a single file on the file system.
[0270] According to one embodiment, channels can share one table (channel_height) that contains the current height / save point of all channels. The table has four columns containing key, value, block number, and transaction number. The key describes the channel name. The block number and transaction number describe the current height of the channel.
[0271] According to one embodiment, each channel is also associated with a "state" table for each (system and user) chaincode instantiated on that channel. The table name is <channel name>_<chaincode name>. The table has 5 columns including key, value, Json value, block number, and transaction number. "Key" is the name of the key to be set in the world state. "Value" is the value of the key if it cannot be parsed as a valid Json value. "Json value" is the value of the key if it can be parsed as a valid Json value. "Block number" and "Transaction number" represent the heights corresponding to the stored key.
[0272] According to one embodiment, the table is created as soon as the channel is created and the chaincode is in place.
[0273] According to one embodiment, executing rich queries against the BDB world state is performed by the chaincode using a shim API. The expression specified in the query result get function (GetQueryResult()) may be any valid SELECT SQL expression.
[0274] According to one embodiment, a specified SQL selection expression is not restricted, provided that the tables that may be accessed by the expression are tables that represent the state of the world database associated with the channel / chaincode combination to which the currently executing chaincode is bound.
[0275] According to one embodiment, users do not need to know the internal name used to represent the state of the world database associated with a particular channel / chaincode pair. Instead, users can use the placeholder "STATE" (case insensitive) to create a table For example, SELECT * FROM <state>The expression WHERE key = 'key1' (keywords in SQL expressions are case insensitive) searches for values associated with "key1".
[0276] According to one embodiment, any attempt to execute a rich query that is not a selection expression or to access tables other than those associated with the channel / chaincode bound to the currently executing chaincode will return an error.
[0277] According to one embodiment, similar to the Fabric supporting queries executed against CouchDB, results are returned by a get query result function (GetQueryResult()). The result is an iterator where each iteration executed contains a key and a Json payload. For BDB rich query results, the key name may be of the form "_sqlresult_X" where X is the zero-based index of the returned iteration. The Json payload is a Json expression version of the result set returned by the query iteration. In other words, it is a json map where each attribute name corresponds to each column name in the returned SQL result set and each attribute value corresponds to the returned value of the column in the current iteration.
[0278] According to one embodiment, below we provide an example (omitting error handling) of iterating through all returned marble IDs of a given color.
[0279]
number
[0280] According to one embodiment, the system and method can perform full validation of rich query results at commit time. At endorsement time, a Merkle tree is computed for all results consumed from the GetQueryresult() call and stored with all SQL expressions as part of the transaction payload. At commit time, the SQL expressions associated with the rich query executed at endorsement time are re-executed and their Merkle tree hashes are progressively checked against the Merkle tree hashes computed at endorsement time. The validator consumes the query results until it reaches an index similar to the index consumed at endorsement time or until the iterator is exhausted. If the Merkle tree hashes match, and if the exhaustion states of the iterators match at the end of the query, the rich query is valid. Otherwise, the transaction is flagged as invalid due to a phantom read error.
[0281] According to one embodiment, BDB supports MVCC (Multiple Version Concurrency Control) and transaction snapshot isolation levels, allowing the system and method to leverage this capability to perform concurrent read / write transactions.
[0282] FIG. 12 is a flow chart illustrating a method for supporting SQL-based rich queries in a blockchain fabric according to one embodiment.
[0283] In step 1201, the method can provide an enterprise-grade distributed ledger framework on one or more computers including a microprocessor.
[0284] In step 1202, the method can execute a distributed ledger fabric in a distributed ledger framework, the distributed ledger fabric including at least a transaction manager and a validator.
[0285] In step 1203, the method can associate a state of a world database with the distributed ledger fabric, the state of the world database including a versioned database and a relational database interface.
[0286] Although various embodiments have been described above, these embodiments are presented as examples and do not limit the present disclosure. These embodiments have been selected and described to illustrate the features and principles of the present disclosure and its practical application. The embodiments illustrate systems and methods. These embodiments use various features to improve the performance of the systems and methods by providing new and / or improved functionality and / or by providing performance advantages including, but not limited to, reduced resource utilization, increased capacity, increased throughput, improved efficiency, reduced latency, enhanced security, and / or improved ease of use.
[0287] Some embodiments are described herein with reference to flowcharts and / or block diagrams of methods, apparatus (systems) and computer program products illustrating architecture, functions, processes and / or operations. Each block of a flowchart or block diagram represents an element, function, process, module, segment or part of instructions that includes one or more executable instructions for implementing a specified function. In some alternative embodiments, functions shown in a block diagram or flowchart are executed in a different order than the order shown. For example, two blocks shown in succession may be executed substantially simultaneously or in the reverse order, depending on the functions involved. Each block of a flowchart and / or block diagram, or a flowchart and Combinations of blocks in the block diagrams may be implemented by computer program instructions and / or dedicated hardware and / or a combination of hardware and computer program instructions to perform the specified functions.
[0288] In some embodiments, the features are implemented in a computer that includes a processor, a computer readable medium, and a network card / interface for communicating with other computers.
[0289] In some embodiments, features are implemented in a network computing environment comprising computing systems including various types of computer configurations including personal computers, handheld devices, multiprocessor systems, microprocessor-based or programmable consumer electronics, network PCs, minicomputers, mainframe computers, etc. interconnected by a network. The network may be a local area network (LAN), a switched fabric network (e.g., InfiniBand), a wide area network (WAN), and / or the Internet. The network may include copper transmission cables, optical transmission fiber, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers.
[0290] In some embodiments, features are implemented in a computing system including a back-end component (e.g., a data server), or a middleware component (e.g., an application server), or a front-end component (e.g., a client computer having a graphical user interface or a web browser through which a user interacts with an implementation of the subject matter described herein), or a computing system including any combination of back-end, middleware, or front-end components interconnected by a network. The computing system may include clients and servers having a client-server relationship with each other. In some embodiments, features are implemented in a computing system comprising a distributed computing environment including one or more computer clusters connected via a network. All computers in the distributed computing environment may be located at a single location or may be located as computer clusters at different remote locations connected by a network.
[0291] In some embodiments, the features are implemented in the cloud as a part of a cloud computing system or as a service delivered to users in a self-service provisioning manner based on shared elastic resources using web technologies. Cloud characteristics may include, for example, on-demand self-service, broad network access, resource pooling, rapid elasticity, and counting services. Cloud deployment models include public, private, and hybrid. Cloud service models include Software as a Service (SaaS), Platform as a Service (PaaS), Database as a Service (DBaaS), and Infrastructure as a Service (IaaS). Cloud generally refers to a combination of hardware, software, network, and web technologies that deliver shared elastic resources to users. Cloud as used herein may include public cloud, private cloud, and / or hybrid cloud implementations and may include cloud SaaS, cloud DBaaS, cloud PaaS, and / or cloud IaaS deployment models.
[0292] In some embodiments, the features may be hardware, software, or firmware. , or a combination thereof. In some embodiments, the features are implemented using a processor configured or programmed to perform one or more functions of the taught approaches. In some embodiments, the processor is a single-chip or multi-chip processor, a digital signal processor (DSP), a system-on-a-chip (SOC), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, a state machine, discrete gate or transistor logic, discrete hardware components, or any combination thereof, designed to perform the functions described herein. In some implementations, the features are implemented by a circuit having a particular function. In other implementations, the features are implemented in a computer, computing system, processor, and / or network configured to perform a particular function, for example, using instructions stored in a computer-readable storage medium.
[0293] In some embodiments, the features are incorporated into software and / or firmware for controlling the hardware of a processing system and / or network system, or for enabling the processor and / or network to interact with other systems using the features of the present disclosure. Such software or firmware may include, but is not limited to, application code, device drivers, operating systems, virtual machines, hypervisors, application programming interfaces, programming languages, and execution environments / containers. Appropriate software encodings can be readily produced by skilled programmers based on the teachings of the present disclosure.
[0294] In some embodiments, the approaches taught in this disclosure include computer program products that are machine-readable or computer-readable media that store or carry instructions, including software and / or firmware. These instructions can be used to program or configure a system, such as a computer, to perform the processes or functions of the approaches taught in this disclosure. The machine-readable or computer-readable medium can include a storage medium, which can include any type of medium or device suitable for storing instructions and / or data, including, but not limited to, a floppy disk, a hard drive, a solid-state drive, an optical disk, a DVD, a CD-ROM, a microdrive, a magneto-optical disk, a ROM, a RAM, an EPROM, an EEPROM, a DRAM, a VRAM, a flash memory device, a magnetic or optical card, a molecular memory, a nanosystem, or variations and combinations thereof. In certain embodiments, the storage medium or computer-readable medium is a non-transitory machine-readable storage medium or a non-transitory computer-readable storage medium. The machine-readable medium or computer-readable medium can also include a transitory medium, such as a carrier wave or a transmission signal.
[0295] Thus, from one perspective, this specification describes a system and method for supporting SQL-based rich queries in a blockchain fabric. According to one embodiment, the system and method described herein can create complex smart contracts in an easier and more manageable manner by executing SQL queries. Also, performance can be improved by pushing data sorting back to the storage engine (rather than performing it at the smart contract level) and relying on a relational engine that supports concurrent read and write access of data. Also, the world database state can provide concurrent read / write access.
[0296] Further examples of the present disclosure are described in the following numbered paragraphs. Section 1 1. A system for supporting SQL-based rich queries in a blockchain fabric, comprising: An enterprise-grade distributed ledger framework, a distributed ledger fabric, the distributed ledger fabric including at least a transaction manager and a validator; A state of a world database is provided, the state of the world database including a versioned database and a relational database interface.
[0297] Section 2 2. The system of claim 1, wherein the relational database interface provides a relational database interface layer between the versioned database and one or more transactions executing on the distributed ledger fabric.
[0298] Section 3 3. The system of claim 2, wherein at least one of the one or more transactions includes at least one rich query.
[0299] Section 4 4. The system of claim 3, wherein at least one rich query accesses the versioned database via a relational database interface.
[0300] Section 5 4. The system of claim 2 or 3, wherein at least one rich query includes a chaincode.
[0301] Section 6 4. The system of claim 3, wherein the state of the world database provides concurrent read / write access.
[0302] Section 7 Distributed Ledger Fabric is provided as a blockchain cloud service, Blockchain cloud services include: A peer container; An ordering container; and a chaincode container.
[0303] Section 8 1. A method for supporting SQL-based rich queries in a blockchain fabric, comprising: providing an enterprise-grade distributed ledger framework on one or more computers, including a microprocessor; and executing a distributed ledger fabric in the distributed ledger framework, the distributed ledger fabric including at least a transaction manager and a validator; The method includes associating a state of a world database with a distributed ledger fabric, the state of the world database including a versioned database and a relational database interface.
[0304] Section 9 9. The method of claim 8, wherein the relational database interface provides a relational database interface layer between the versioned database and one or more transactions executing on the distributed ledger fabric.
[0305] Section 10 10. The method of claim 9, wherein at least one of the one or more transactions includes at least one rich query.
[0306] Section 11 11. The method of claim 10, wherein at least one rich query accesses the versioned database via a relational database interface.
[0307] Section 12 12. The method of claim 9, 10 or 11, wherein the state of the world database provides concurrent read / write access.
[0308] Section 13 11. The method of claim 10 or any claim dependent thereon, wherein at least one rich query includes a chaincode.
[0309] Section 14 Distributed Ledger Fabric is provided as a blockchain cloud service, Blockchain cloud services include: A peer container; An ordering container; and a chaincode container.
[0310] Section 15 A computer-readable medium bearing instructions for supporting SQL-based rich queries in a blockchain fabric, the instructions, when read and executed, causing one or more computers to perform steps including: providing an enterprise-grade distributed ledger framework on one or more computers, including a microprocessor; and executing a distributed ledger fabric in the distributed ledger framework, the distributed ledger fabric including at least a transaction manager and a validator; The method includes associating a state of a world database with a distributed ledger fabric, the state of the world database including a versioned database and a relational database interface.
[0311] Section 16 20. The computer-readable medium of claim 15, wherein the relational database interface provides a relational database interface layer between the versioned database and one or more transactions executing on the distributed ledger fabric.
[0312] Section 17 At least one of the one or more transactions contains at least one rich query. 20. The computer-readable medium of claim 16, further comprising:
[0313] Section 18 20. The computer-readable medium of clause 17, wherein at least one rich query accesses the versioned database via a relational database interface.
[0314] Section 19 20. The computer-readable medium of claim 16, 17 or 18, wherein the state of the world database provides simultaneous read / write access.
[0315] Section 20 Distributed Ledger Fabric is provided as a blockchain cloud service, Blockchain cloud services include: A peer container; An ordering container; 20. The computer-readable medium of any one of claims 15 to 19, further comprising a chaincode container.
[0316] The above description is not intended to be exhaustive or to limit the scope to the exact form disclosed. Also, while embodiments are described with a particular sequence of transactions and steps, it will be apparent to one skilled in the art that additional transactions and steps are not precluded from being performed unless expressly stated. Furthermore, while in various embodiments, particular combinations of features are described, it will be apparent to one skilled in the art that different combinations of features are within the scope of the disclosure. In particular, features (such as devices or methods) described in a particular embodiment, variant, or drawing may be combined or substituted with other features described in another embodiment, variant, or drawing without departing from the teachings and scope. Furthermore, it will be apparent to one skilled in the art that various additions, reductions, deletions, modifications, substitution of elements with equivalents, and other modifications and changes in form, details, implementation, and application may be made without departing from the spirit and scope of the disclosure. The broader spirit and scope of protection is defined by the following claims and their equivalents.< / state>
Claims
1. 1. A system for supporting SQL-based rich queries in a blockchain fabric, comprising: An enterprise-grade distributed ledger framework, a distributed ledger fabric, the distributed ledger fabric including at least a transaction manager and a validator; A system comprising a state of a world database, the state of the world database including a versioned database and a relational database interface.
2. 2. The system of claim 1, wherein the relational database interface provides a relational database interface layer between the versioned database and one or more transactions executing on the distributed ledger fabric.
3. The system of claim 2 , wherein at least one of the one or more transactions includes at least one rich query.
4. The system of claim 3 , wherein the at least one rich query accesses the versioned database via the relational database interface.
5. The system of claim 3 or 4, wherein the at least one rich query comprises a chaincode.
6. 2. A system according to any one of the preceding claims, wherein the state of the world database provides for concurrent read / write access.
7. The distributed ledger fabric is provided as a blockchain cloud service; The blockchain cloud service is A peer container; An ordering container; 4. The system of any one of the preceding claims, comprising:
8. 1. A method for supporting SQL-based rich queries in a blockchain fabric, comprising: providing an enterprise-grade distributed ledger framework on one or more computers including a microprocessor; and executing a distributed ledger fabric in the distributed ledger framework, the distributed ledger fabric including at least a transaction manager and a validator; 2. A method comprising: associating a state of a world database with the distributed ledger fabric, the state of the world database comprising a versioned database and a relational database interface.
9. 10. The method of claim 8, wherein the relational database interface provides a relational database interface layer between the versioned database and one or more transactions executing on a distributed ledger fabric.
10. The method of claim 9 , wherein at least one of the one or more transactions includes at least one rich query.
11. The method of claim 10 , wherein the at least one rich query accesses the versioned database via the relational database interface.
12. The method of claim 10 or 11, wherein the at least one rich query comprises a chaincode.
13. 13. The method of claim 8, wherein the state of the world database provides concurrent read / write access.
14. The distributed ledger fabric is provided as a blockchain cloud service; The blockchain cloud service is A peer container; An ordering container; and a chaincode container.
15. 15. A computer readable medium carrying instructions for supporting SQL-based rich queries in a blockchain fabric, the instructions, when read and executed, causing one or more computers to perform the method of any one of claims 8 to 14.
Citation Information
Patent Citations
Identifying join relationships based on transaction access patterns
JP2018506775A
Management Of Entitlements Using Blockchain
US20180089256A1
Method and system for processing of a blockchain transaction in a transaction processing network
WO2017079218A1
