A consensus transaction visualization method, device, equipment and storage medium
By acquiring block files and transaction log data in the Hyperledger Fabric network, determining the node-edge relationships between nodes and visualizing them in a graph database, the problem of existing tools being unable to trace the consensus process is solved, achieving non-intrusive visual tracing and improving the applicability and scalability of the method.
Patent Information
- Application Number
- CN202211361006.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-02
- Publication Date
- 2026-11-20
- Estimated Expiration
- 2042-11-02
AI Technical Summary
Existing blockchain analytics tools are unable to effectively track the consensus process, and embedding custom logs or gRPC interceptors in Hyperledger Fabric can impact code scalability and performance.
By acquiring the block files and transaction log data of the target consensus transaction, the node-edge relationships between nodes are determined and stored in a graph database for visualization, thus avoiding modification of the Hyperledger Fabric source code.
This method enables visual tracking of node consensus transactions in the Hyperledger Fabric network, improving the applicability and scalability of the approach without affecting the integrity of the source code.
Smart Images

Figure CN115619559B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of blockchain technology, and in particular to a consensus transaction visualization method, apparatus, device, and storage medium. Background Technology
[0002] Blockchain is an emerging digital industry with advantages such as decentralization, transparency, traceability, and immutability. Consensus is crucial for ensuring the consistency of blockchain ledger data. Tracking the transaction trajectories where consensus is reached among blockchain nodes helps regulators identify the consensus topology information of different transactions, thereby effectively managing the participants in different transactions. However, the decentralized nature of blockchain technology results in dispersed nodes to be regulated, and the anonymity of blockchain makes it difficult to implement on-chain data content supervision, making it difficult for blockchain regulators to gain access to the underlying raw data and the relationships between nodes. In addition, existing blockchain analysis tools are insufficient in functionality; their visualization capabilities are inadequate to support the needs of regulators, and most can only analyze data before and after consensus, lacking tracking of the consensus process.
[0003] Because there is currently no concrete technical solution for blockchain node tracking, and similarly, no research literature has been produced on tracking blockchain node consensus transactions, two approaches may be applicable. One approach is to embed custom logs into the Hyperledger Fabric consensus transaction source code: Since the raw log information provided by Hyperledger Fabric is limited—that is, the log output for key consensus transaction methods only prints basic service information, such as service response time and status code, but cannot identify which transaction it belongs to—and because different nodes are deployed in different Docker containers, the consensus transaction process flows between different nodes, making it impossible to correlate the raw log information of multiple nodes, this approach embeds custom logs into the Hyperledger Fabric consensus transaction source code. This identifies which transaction the log belongs to, the time the transaction occurred, and the current stage of the transaction, thus correlating the logs of different nodes. By collecting and analyzing these custom logs, the topology information of the Hyperledger Fabric consensus transactions can be reconstructed, enabling the tracking of the consensus process. Another approach is to use gRPC interceptors to obtain gRPC request and response information initiated by the consensus transaction client and server. Since key methods in Hyperledger Fabric consensus transactions all use gRPC services, gRPC interceptor code can be embedded in these methods. Before the gRPC service is sent, the server, client, and transaction information are identified and stored. Distributed tracing technology can be utilized here, employing components like Jaeger and Zipkin to capture the data. Information intercepted by the gRPC interceptor is sent to the distributed tracing component for storage and indexing. Finally, the built-in display modules of components like Jaeger and Zipkin can be used to demonstrate the consensus process of the transaction.
[0004] However, both of the above approaches have a problem: they are somewhat intrusive to Hyperledger Fabric's code. For example, approach one requires adding custom logs to key methods in the consensus process, while approach two requires adding gRPC interceptor code to key methods in the consensus process. Both of these will affect the code's scalability and even the blockchain's performance. Summary of the Invention
[0005] This invention provides a consensus transaction visualization method, apparatus, device, and storage medium to enable the visualization and tracking of the call flow of node consensus transactions in a Hyperledger Fabric network.
[0006] According to one aspect of the present invention, a consensus transaction visualization method is provided, comprising:
[0007] Obtain the target block file and transaction log data corresponding to the target consensus transaction;
[0008] The corresponding node-edge relationships between nodes in the target consensus transaction are determined based on the target block file and the transaction log data.
[0009] The nodes and their corresponding edge relationships are stored in a graph database, and the graph database visualization component is used to display the nodes and their corresponding edge relationships.
[0010] According to another aspect of the present invention, a consensus transaction visualization device is provided, the device comprising:
[0011] The acquisition module is used to acquire the target block file and transaction log data corresponding to the target consensus transaction;
[0012] The determination module is used to determine the corresponding node-edge relationships between nodes in the target consensus transaction based on the target block file and the transaction log data.
[0013] The storage and display module is used to store the nodes and the corresponding point-edge relationships between the nodes into a graph database, and to display the nodes and the corresponding point-edge relationships between the nodes through a graph database visualization component.
[0014] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0015] At least one processor; and
[0016] A memory communicatively connected to the at least one processor; wherein,
[0017] The memory stores a computer program that can be executed by the at least one processor, which enables the at least one processor to perform the consensus transaction visualization method according to any embodiment of the present invention.
[0018] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the consensus transaction visualization method according to any embodiment of the present invention.
[0019] This invention, through its embodiments, acquires the target block file and transaction log data corresponding to the target consensus transaction. Based on these data, it determines the corresponding node-edge relationships between nodes in the target consensus transaction, stores these relationships in a graph database, and displays them using a graph database visualization component. This invention enables the visual tracking of the call flow of node consensus transactions in a Hyperledger Fabric network without modifying the Hyperledger Fabric source code, thus avoiding intrusion and improving the applicability and scalability of the method.
[0020] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0021] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 This is a flowchart of a consensus transaction visualization method according to an embodiment of the present invention;
[0023] Figure 2 This is a schematic diagram of the structure of a consensus transaction visualization device according to an embodiment of the present invention;
[0024] Figure 3 This is a schematic diagram of the structure of an electronic device that implements the consensus transaction visualization method of this invention. Detailed Implementation
[0025] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0026] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0027] Example 1
[0028] In this embodiment of the invention, the term "Client node" is simply referred to as a client node, which refers to a client node that interacts with the Hyperledger Fabric network. Specifically, a Client node can interact with the Hyperledger Fabric network by calling the API (Application Programming Interface) or SDK (Software Development Kit) provided by Hyperledger Fabric, or it can interact with the Hyperledger Fabric network directly through a CLI (command-line interface) command-line terminal.
[0029] In this embodiment of the invention, the term "Endorser Peer node" is abbreviated as "endorsing node" and refers to the Peer node that acts as an endorser in the Hyperledger Fabric network.
[0030] In this embodiment of the invention, the term "Orderer node" is simply referred to as the sorting node, which refers to the Orderer node in the Hyperledger Fabric network that acts as the sorting node.
[0031] In this embodiment of the invention, the term "Committer Peer node" is abbreviated as "committer node" and refers to the peer node in the Hyperledger Fabric network used for ledger recording. The Committer Peer node parses block data from Gossip messages, verifies the validity of the block data, and commits the block to the local ledger after the verification is successful.
[0032] In this invention, the term "consortium" specifically refers to the concept of a consortium within a consortium blockchain. Specifically, a consortium is formed by one or more organizations after Hyperledger Fabric starts the network according to configuration files or other methods. An organization contains one or more nodes, and multiple organizations are brought together through a consortium to communicate data.
[0033] In this embodiment of the invention, the term "node container" refers to the Peer, Orderer, and other node containers that are started in a Hyperledger Fabric network using Docker.
[0034] In this embodiment of the invention, the term "chaincode" refers to a smart contract, also known as chaincode in Hyperledger Fabric, which is code deployed on the blockchain.
[0035] In this embodiment of the invention, the term "transaction proposal" refers to the general term for an endorsement request sent by a client node to an endorser node. The Hyperledger Fabric official website defines it as a transaction proposal, which includes request information, chaincode function call information, function parameter information, and signature information.
[0036] In this embodiment of the invention, the term "CLI" refers to the command line. Hyperledger Fabric provides a variety of ways to communicate with clients. Clients can communicate with the Hyperledger Fabric network through the CLI command line, the SDK or API provided by Hyperledger Fabric.
[0037] In this embodiment of the invention, the term "endorsement policy" refers to the endorsement policy specified when the chaincode is installed and deployed to Hyperledger Fabric. Specifically, it requires that a transaction be endorsed by a specified number of nodes in a specified organization in order to be considered a valid transaction. For example, an endorsement policy of AND(org1, org2) means that the transaction requires endorsement from any node in organization org1 and any node in organization org2.
[0038] In this embodiment of the invention, the term "Gossip" refers to a common consensus protocol in distributed systems, where a message from a node in a network is randomly forwarded to multiple peer nodes associated with that node until all nodes in the network have received the message. Hyperledger Fabric uses the Goosip protocol to synchronize ledger data between nodes.
[0039] In this invention, the term "gRPC" refers to a high-performance, open-source RPC (Remote Procedure Call Protocol) framework. It is designed and developed based on the HTTP / 2 (Hypertext Transfer Protocol 2) standard, uses Protocol Buffers for data serialization by default, and supports development in multiple languages such as Java, Golang, and Python. The internal services involved in the consensus process between different nodes in Hyperledger Fabric are implemented using gRPC.
[0040] In this embodiment of the invention, the term "gRPC interceptor" refers to a gRPC request or response initiated by a client or server. That is, before sending the request or response data, it performs data processing such as logging and authentication, and then hands it over to the executing service for processing and response.
[0041] In this embodiment of the invention, the term "univariate RPC service" refers to the univariate RPC service provided by gRPC. Specifically, it means that the service ends when the client sends a single request and receives a response from the server.
[0042] In this embodiment of the invention, the term "streaming RPC service" refers to the streaming RPC service provided by gRPC. Specifically, this includes client-side streaming services, server-side streaming services, and bidirectional streaming services. When a corresponding streaming service is selected, the client or server needs to wait until all messages have been received before responding. The broadcast service and block distribution service involved in the Hyperledger Fabric consensus process both use bidirectional streaming services for communication.
[0043] In this embodiment of the invention, the term "endorsement service" refers to the endorsement service provided by Hyperledger Fabric. Specifically, it refers to the "ProcessProposal" gRPC service under the peer / peer.proto path in the fabric-proto project. The client of this service is the Client node, and the server is the Peer node. When a Peer node starts up, it registers the endorsement service with its local gRPC server. The endorsement service receives endorsement requests sent by the Client node, then starts the user's chaincode to simulate the execution of the transaction, and finally signs the result of the simulated execution and returns it to the Client node.
[0044] In this embodiment of the invention, the term "broadcast service" refers to the broadcast service provided by Hyperledger Fabric. Specifically, it refers to the "Broadcast" gRPC service located at ` / orderer / ab.proto` in the `fabric-proto` project. The client for this service is the Client node, and the server is the Orderer node. The Orderer node registers the broadcast service with its local gRPC server upon startup. The broadcast service receives transaction ordering requests from Client nodes, which are then used by the Orderer node to order and generate blocks.
[0045] In this embodiment of the invention, the term "block distribution service" refers to the block distribution service provided by Hyperledger Fabric. Specifically, it refers to the "Deliver" gRPC service located at / orderer / ab.proto in the fabric-proto project. The client of this service is the Leader Peer node, and the server is the Orderer node. The Orderer node registers the block distribution service with its local gRPC server upon startup. Through the block distribution service, the Orderer node can distribute newly generated blocks to committing nodes, which then commit the blocks to their local ledger.
[0046] The term "distributed tracing" used in this embodiment of the invention refers to a technique used in distributed systems to trace the process from a user initiating a request to receiving a response. Specifically, it involves reconstructing a distributed request into a call chain and displaying it centrally, such as the time consumption of each service node, where the request originated and where it went, the status of the service nodes, and the parameters carried in the request or response.
[0047] In this embodiment of the invention, the term "graph database" refers to a non-relational database that uses a graph structure for semantic queries. It stores data using nodes and edges, making it highly suitable for displaying relationships between highly interconnected data. Exemplary graph databases include Neo4j, FlockDB, and GraphDB.
[0048] Figure 1 This is a flowchart of a consensus transaction visualization method according to an embodiment of the present invention. This embodiment is applicable to the situation of consensus transaction visualization. The method can be executed by the consensus transaction visualization device in this embodiment of the present invention. The device can be implemented in software and / or hardware, such as... Figure 1 As shown, the method specifically includes the following steps:
[0049] S101. Obtain the target block file and transaction log data corresponding to the target consensus transaction.
[0050] It should be noted that the technical solution of this invention is applicable to Hyperledger Fabric networks. In this embodiment, the target consensus transaction can be a consensus transaction between nodes during the Hyperledger Fabric network consensus process.
[0051] In implementation, custodian nodes can be launched as Hyperledger Fabric node containers to participate in the Hyperledger Fabric transaction process. The consensus transaction process between nodes in Hyperledger Fabric can include the following operations: Client nodes initiate endorsement requests with designated endorser peers within the organization via the official Hyperledger Fabric SDK, API, or command-line CLI. The endorser peers parse the transaction proposal and launch chaincode containers to simulate transaction execution. The endorser peers encapsulate the results of the chaincode container's simulated execution into an endorsement response, which includes read / write sets, signatures, and other information. This response is then sent back to the client nodes. The client nodes compare the read / write set content of different endorsement responses to ensure consistency and wait for sufficient endorsements to be collected according to the endorsement policy. Once sufficient endorsement responses have been collected, the client nodes encapsulate the transaction content into a transaction message, which includes the transaction proposal, endorsement responses, client signatures, etc., and then send the transaction message to the orderer to request transaction ordering. After receiving transaction information, the sorting node sorts the transactions according to the block packaging rules (such as the maximum number of transactions a block can contain), according to the consensus components, and packages them into blocks. The blocks are then temporarily written to the sorting node's temporary ledger. The sorting node sends the blocks to the commit nodes of each organization. After receiving the blocks, the commit nodes verify the block content, including read-write set verification, endorsement policy verification, and signature verification. Once verification is successful, the block is written to the local ledger, until all peer nodes have completed ledger data synchronization.
[0052] The above operations represent the complete process of a Hyperledger Fabric transaction from request to writing it into the ledger. In summary, the operations mainly involve endorsement services, broadcast services, and block distribution services. This illustrates that consensus is not a single step, but rather an organic combination of multiple processes, integrating endorsement, ordering, and signature verification to ensure data consistency and security. Therefore, tracking the entire transaction consensus process helps regulators to comprehensively control the effective status of transactions, anomaly handling points, and node event processing.
[0053] It should be explained that the target block file can be a block file containing block data formed after the target consensus transactions are completed. Specifically, the target block file may include a block header, at least one block body, and metadata, wherein the number of block bodies is the same as the number of target consensus transactions.
[0054] The transaction log data can be log data that records the running process of the target consensus transaction. Preferably, the transaction log data can be the INFO log output information of Hyperledger Fabric.
[0055] To obtain the Hyperledger Fabric consensus transaction process without modifying the source code, analysis can be performed from the perspective of Hyperledger Fabric's native logs, combining log data. Hyperledger Fabric's native logs can be divided into two categories in the Hyperledger Fabric network: one is ordinary log information, i.e., logs printed by non-gRPC services, with the printed fields shown in Table 1; the other is logs printed by the gRPC service, which, in addition to ordinary log information, adds gRPC service log content, such as the gRPC service name and client address information, as shown in Table 2. Because the output volume of Hyperledger Fabric logs in Debug mode is too large and often accompanied by frequent heartbeat logs, it increases the burden of log collection and analysis, and is also detrimental to the production environment. Therefore, this embodiment of the invention chooses to analyze the INFO log output information of Hyperledger Fabric.
[0056] Table 1
[0057] Field Description Example level Log levels info ts Timestamp 1,643,037,956.564 name Caller method name committer.txvalidator caller Specific files and locations for the method v20 / validator.go:262 msg Log output content [mychannel]Validated block[6]in 1ms
[0058] Table 2
[0059]
[0060] At the INFO log level, Hyperledger Fabric logs related to the transaction consensus process include the following: Endorser Peers print gRPC logs of their endorsement responses; Orderers print gRPC logs of their broadcast responses, as well as regular logs of block creation; Peer nodes within the organization print regular logs of receiving blocks, validating blocks, and committing blocks.
[0061] To reconstruct Hyperledger Fabric transactions based on existing INFO log information, it is necessary to know the request and response log information of each service. The logs should include basic information such as the sender and receiver. However, existing INFO logs have the following problems: Client node logs belong to the client scope and are not printed on the Hyperledger Fabric server. Furthermore, the server does not print request logs when receiving requests. Therefore, client-initiated request logs, including endorsement request logs and broadcast request logs, are not obtained. Endorsement nodes only print endorsement response gRPC logs, and these logs only contain grpc.peer_address client information, not server node information. Therefore, it is unclear which nodes processed the requests. The orderer and committer nodes... A bidirectional gRPC service is established between peers, and this flow will not be interrupted. This is because the block number requested by the peer is within the range of [current ledger height, math.MaxUint64]. The block number cutoff is converted to (2^64)-1. Theoretically, the peer node will continuously wait for the block sent by the sorting node. The uninterrupted flow means that the service is uninterrupted, which means that gRPC response logs will not be printed. Because it is always responding, only ordinary log information printed by the peer node is found in the INFO log. Ordinary log information does not contain request and response information, so the block synchronization process is unknown. The log information does not completely contain transaction ID and channel ID, and cannot accurately correlate the log information printed by different nodes.
[0062] Therefore, this embodiment of the invention obtains the target block file and transaction log data corresponding to the target consensus transaction, and performs comprehensive analysis on multiple data to sort out the relationship between the nodes in the Hyperledger Fabric consensus transaction process.
[0063] S102. Determine the corresponding node-edge relationships between nodes in the target consensus transaction based on the target block file and transaction log data.
[0064] In this embodiment, a node can be any node involved in the target consensus transaction, such as an endorsement node, an ordering node, a commit node, and a client node. In a point-edge relationship, a point can be any node involved in the target consensus transaction, and an edge can be the interaction relationship between the nodes involved in the target consensus transaction.
[0065] Specifically, the nodes involved in the target consensus transaction and the interaction relationships between them are determined based on the target block file and transaction log data.
[0066] S103. Store the corresponding point-edge relationships between nodes in the graph database, and display the corresponding point-edge relationships between nodes through the graph database visualization component.
[0067] The graph database visualization component can be any component in a graph database that can display the topological structure information of the relationship between points and edges. This embodiment does not limit the specific graph database used; any graph database that can store both point and edge data is acceptable.
[0068] Specifically, the node-to-node relationships are stored in a graph database, and the topology information of the node consensus transaction is displayed using the graph database visualization component. The data on node-to-node relationships and other information stored in the graph database during the target consensus transaction process facilitates subsequent research work such as upper-level data analysis using graph algorithms.
[0069] This invention, through its embodiments, acquires the target block file and transaction log data corresponding to the target consensus transaction. Based on these data, it determines the corresponding node-edge relationships within the target consensus transaction, stores these relationships in a graph database, and displays them using a graph database visualization component. This invention enables the visual tracking of the call flow of node consensus transactions in a Hyperledger Fabric network without modifying the Hyperledger Fabric source code, thus avoiding intrusion and improving the applicability and scalability of the method.
[0070] Optionally, the corresponding node-edge relationships between nodes in the target consensus transaction are determined based on the target block file and transaction log data, including:
[0071] Parse the target block file to obtain the target block data.
[0072] The target block data can be block data from the target consensus transaction execution process included in the target block file. Optionally, the target block data includes: channel ID, transaction ID, creator certificate, endorser node identity group certificate, message creator certificate, block commit hash, and block number.
[0073] Specifically, the operations for parsing the target block file may include: parsing the channel ID in the block body, parsing the transaction ID in the block body, parsing the creator (client) certificate in the block body, parsing the endorser node identity group certificate in the block body, parsing the message creator (sorting node) certificate in the block metadata, parsing the block commit hash in the block metadata, and parsing the block number in the block header.
[0074] In the implementation process, since the blocks are transmitted as content through the gRPC service, the data in the blocks can be parsed one by one using the protobuf source files defining the block object, the certificate source files, and the files provided by the Golang official website, such as github.com / golang / protobuf / proto. The Hyperledger Fabric official website provides the hyperledger / fabric / protoutil package, which introduces methods for parsing block source files. For example, to obtain the channel ID of a transaction in a block, first, the block object is parsed using proto.Unmarshal(block file byte array, protobuf defined block object), and then the channel ID is parsed using the GetChannelIDFromBlock(block object) method in the protoutil package. Therefore, the block structure content can be parsed one by one in the same way.
[0075] In practice, the specific process of parsing the channel ID in the block body can be as follows: The block body contains one or more consensus transactions, where the source file describing the structure of the consensus transaction (proto) is located in HyperledgerGitHub, specifically in the file hyperledger / fabric-protos / common.proto. In this implementation, the channel ID is specifically located at the position BlockData.Envelope.Payload.Header.ChannelHeader.ChannelId in the block body. The block structure is obtained from the block file, the transaction (Envelope) structure is obtained from the block structure, and then the channel header (ChannelHeader) structure is obtained from the transaction structure. The channel ID is located in the channel header.
[0076] In practice, the specific process of parsing the transaction ID in the block body can be as follows: The transaction ID is located at the common.Envelope.Payload.Header.ChannelHeader.TxId position in the block body. The block structure is obtained from the block file. The transaction (Envelope) structure can be obtained from the block structure. Then, the channel header (ChannelHeader) structure is obtained from the transaction structure. The transaction ID is located in the channel header.
[0077] In practice, the specific process of parsing the creator (client) certificate in the block body can be as follows: the creator (client) certificate in the block body can identify the identity of the client node. In this embodiment, the specific location of the creator (client) certificate can be the BlockData.Envelope.Payload.Header.SignatureHeader.Creator.IdBytes position. What is obtained is an X.509 certificate encrypted with crypto. The certificate can be decrypted, and more specific identity information can be obtained through the pem.Decode() and x509.ParseCertificate() methods in the Golang official library encoding / pem.
[0078] In practice, the specific process of parsing the endorser node identity group certificate in the block body can be as follows: the endorser node identity group certificate in the block body can identify the identity of the endorser node. In this embodiment, the specific location of the endorser node identity group certificate can be BlockData.Envelope.Payload.Transaction.ChaincodeAction.Endorses. What is obtained is an X.509 certificate encrypted with crypto. The certificate can be decrypted, and more specific identity information, such as the endorser node identity name peer0.org1.example.com, can be obtained through the pem.Decode() and x509.ParseCertificate() methods in the Golang official library encoding / pem.
[0079] In practice, the specific process of parsing the message creator (ordering node) certificate in the block metadata can be as follows: the message creator (ordering node) certificate in the block metadata can identify the ordering node's identity. In this embodiment, the specific location of the ordering node identity group certificate can be the BlockMetadata.SignatureHeader.Creator.IdBytes position. What is obtained is an X.509 certificate encrypted with crypto. The certificate can be decrypted, and more specific identity information, such as the ordering node identity name orderer.example.com, can be obtained through the pem.Decode() and x509.ParseCertificate() methods in the Golang official library encoding / pem.
[0080] In practice, the specific process of parsing the block commit hash in the block metadata can be as follows: The block commit hash in the block metadata represents the time hash of the block being committed to the temporary local ledger of the Orderer node after the Orderer node creates the block. In this embodiment, the specific location can be BlockMetadata.Meta data[BlockMetadataIndex_COMMIT_HASH]. The obtained value is the base64 encoded content, which can be decoded using the base64.StdEncoding.EncodeToString() method in the Golang official library encoding / base64.
[0081] In practice, the specific process of parsing the block number in the block header can be as follows: the block number in the block header can identify which block the transaction is packaged into, and the block number is specifically located at the BlockHeader.Number position.
[0082] Parse the transaction log data to obtain the target log information corresponding to the transaction log data.
[0083] The target log information can be the log information corresponding to the nodes in the target consensus transaction, such as the log information corresponding to the endorsing nodes, the sorting nodes, and the committing nodes.
[0084] Specifically, the transaction log data is parsed to obtain the target log information corresponding to the nodes in the target consensus transaction.
[0085] The corresponding node-edge relationships between nodes in the target consensus transaction are determined based on the target block data and target log information.
[0086] Specifically, the nodes involved in the target consensus transaction and the interaction relationships between them are determined based on the target block data and target log information.
[0087] Optionally, the nodes in the target consensus transaction include: endorsement nodes, sorting nodes, and commit nodes; correspondingly, the transaction log data is parsed to obtain the target log information corresponding to the transaction log data, including:
[0088] Parse the transaction log data to obtain the endorsement service log information corresponding to the endorsement node, the broadcast service log information corresponding to the sorting node, and the block commit log information corresponding to the commit node.
[0089] In this embodiment, the endorsement service log information can be the INFO log output information of the Hyperledger Fabric corresponding to the endorsement node, the broadcast service log information can be the INFO log output information of the Hyperledger Fabric corresponding to the sorting node, and the block commit log information can be the INFO log output information of the Hyperledger Fabric corresponding to the commit node.
[0090] Specifically, parsing the transaction log data yields the endorsement service log information corresponding to the endorsement node, the broadcast service log information corresponding to the sorting node, and the block commit log information corresponding to the commit node.
[0091] Optionally, the endorsement service log information corresponding to the endorsement node includes: endorsement node chaincode call success log information and endorsement service response log information.
[0092] It should be noted that the successful chaincode call log information of the endorsement node can be the ordinary log information in the native Hyperledger Fabric logs of the endorsement node, that is, the logs printed by the non-gRPC service. The endorsement service response log information can be the logs printed by the gRPC service in the native Hyperledger Fabric logs of the endorsement node, which is the ordinary log information with the addition of gRPC service log content.
[0093] The broadcast service log information corresponding to the sorting node includes: block generation log information and broadcast service response log information.
[0094] It should be explained that block generation log information can be ordinary log information from the native Hyperledger Fabric logs corresponding to the sorting node, i.e., logs printed by non-gRPC services. Broadcast service response log information can be logs printed by the gRPC service from the native Hyperledger Fabric logs corresponding to the sorting node, which is ordinary log information with added gRPC service log content.
[0095] In practice, the specific process of parsing the successful chaincode call log information of the endorsing node can be as follows: The successful chaincode call log information of the endorsing node is a normal log message, for example, it can be in the form of {"level":"info","ts":1643186825.2183998,"name":"endorser","caller":"endorser / endorser.go:137",channel":"mychannel","txID":"c22793eb""ms g":"finishedchaincode:basic duration:19ms","}, where the channel value (channel ID) and txID value (transaction ID) need to correspond to the channel ID and transaction ID parsed from the block. Because consensus only occurs when the ledger data changes, such as modifying the ledger data, querying data will not generate a block, but will call the chaincode. Therefore, the logs of successful chaincode calls will be printed, but consensus only needs to parse the logs that cause changes to the ledger data. Once this data is found, the labels attached to all nodes in the target consensus transaction can be obtained, and it can be identified which node output this log information.
[0096] In practice, the specific process of parsing the endorsement service response log information can be as follows: The endorsement service response log information is a gRPC log message. For example, an endorsement service response log message can be in the form of: {"level":"info","ts":1643099363.119682,"name":"comm.grpc.server","caller":"go-grpc-middleware / chain.go:25","msg":"unary call completed","grpc.service":"protos.Endorser","grpc.method":"ProcessPro posal","grpc.peer_address":"172.25.0.1:34426","grpc.code":"OK","grpc.call_duration":0.003334704}. After obtaining the log information of the endorsement node chaincode call success, the matching gRPC log is searched in the node logs identified by labels in ascending order of time. The `grcp.peer_address` value in the gRPC log information of the endorsement service response represents the initiator information of the endorsement service, i.e., the client. The relationship between the client and the endorsement node can be linked through the endorsement node chaincode call success log information, endorsement service response log information, and target block file.
[0097] In actual operation, the specific process of parsing block generation log information can be as follows: the block generation log information is a normal log information. For example, a block generation log information can be in the form of: {"level":"info","ts":1643186827.2335174,"name":"orderer.consensus.et cdraft","caller":"etcdraft / chain.go:898","msg":"Created block[7],there are 0blocks in flight","channel":"mychannel","node":1}. The channel ID and transaction ID can uniquely identify the transaction. When parsing the target block file, not only the channel ID and transaction ID are parsed from the block file, but also the block number is parsed. The block number must be consistent with the block number in "Created block[block number]" in msg in the block generation log information.
[0098] In practice, the specific process of parsing broadcast service response log information can be as follows: A broadcast service response log is a gRPC log entry. For example, a broadcast service response log entry might look like this: {"level":"info","ts":1643102426.5319328,"name":"comm.grpc.server","caller":"go-grpc-middleware / chain.go:49","msg":"streaming call completed","grpc.method":"Broadcast","grpc.service":"orderer.Ato After obtaining the block generation log information, the system sorts the logs of the nodes identified by these labels by time and searches for the previous matching broadcast service response log. The `grcp.peer_address` value in the broadcast service response gRPC log information represents the initiator information of the broadcast service, i.e., the client. The relationship between the client and the sorted nodes can be linked through the block generation log information, broadcast service response log information, and block number.
[0099] In actual operation, the specific process of parsing block commit log information can be as follows: The block commit log information is a normal log information. For example, a block commit log information can be in the form of: {"level":"info","ts":1643186827.2587912,"name":"kvledger","caller":"kv ledger / kv_ledger.go:669","msg":"[mychannel]Committed block[7]with1transaction(s)in 9ms(state_validation=0ms block_and_pvtdata_commit=4ms The block commit hash, defined as `state_commit = 1ms)commitHash = [59ec842de457eee48f947d7909aee85e92a0fd949fcdffee95fedca31c0048de]"}`, is parsed from the target block file and needs to correspond to the "commitHash" value in the block commit log information. The relationship between the sorting node and the commit node can be established through the block commit log information and the block commit hash.
[0100] Optionally, the nodes in the target consensus transaction also include: client nodes; correspondingly, the node-edge relationships between nodes in the target consensus transaction are determined based on the target block data and target log information, including:
[0101] The corresponding node-edge relationship between the endorser node and the client node is determined based on the successful call log information of the endorser node chaincode and the endorsement service response log information.
[0102] In its implementation, the Hyperledger Fabric consensus process can be understood as the interaction between different nodes. Existing native transaction logs lack sufficient information to reconstruct the interaction relationships between nodes. Therefore, this embodiment of the invention utilizes target block files to supplement this information. In Hyperledger Fabric, any transaction can be uniquely identified by its channel ID and transaction ID. Since transactions are packaged into blocks, the channel ID + transaction ID also corresponds one-to-one with the block number. Once the data is complete, the interaction relationships between nodes can be analyzed. For example, when a sorting node sends a block to a committing node, it signifies a relationship between the sorting and committing nodes. The sorting node can be considered as point A, and the committing node as point B. The block sending action is seen as an edge connecting point A and point B, thus transforming the data into a point-edge relationship.
[0103] Specifically, since the channel ID and transaction ID are parsed from the target block file, a transaction is uniquely identified. The successful chaincode invocation log of the endorsing node will print the channel ID and transaction ID. The successful chaincode invocation log and the endorsement response log are printed in chronological order and can be correlated. In the endorsement response log, `grpc.peer_address` is the requester's IP address and port. Taking the IP address value represents the client node, and the newly added labels value is the container node identifier, which can represent the endorsing node, thus converting it into two nodes. The client node information includes `grpc.peer_address`, and the creator certificate information parsed from the block is used as the node's attribute. The endorsing node information includes the labels value, and the endorsing node certificate information parsed from the block is used as the node's attribute. Although only endorsement response log information is available, the gRPC service is bidirectional; there is a request and a response. Therefore, two edges can be established: one where the client node sends an endorsement request to the endorsing node, and the other where the endorsing node sends an endorsement response back to the client node.
[0104] The corresponding point-edge relationship between the sorting node and the client node is determined based on the block generation log information and the broadcast service response log information.
[0105] Specifically, since the block number is parsed from the target block file, a block is uniquely identified. A transaction is packaged into a block, so the channel ID and transaction ID also correspond to a block number. The block generation log information prints the block number. The broadcast service response log information and the block generation log information are printed in chronological order and can also be correlated. In the broadcast service response log information, grpc.peer_address is the requester's IP address:port. Taking the IP address value represents the client node. The newly added labels value is the container node identifier, which can represent the sorting node, thus it can be converted into two nodes. The client node information includes grpc.peer_address, and the creator certificate information parsed from the block is used as the node's attribute. The sorting node information includes the labels value, and the sorting node certificate information parsed from the block is used as the node's attribute. Although there is only broadcast service response log information, the gRPC service is bidirectional, with a response only for a request. Therefore, two edges can be established: one where the client node sends a broadcast request to the sorting node, and the other where the sorting node sends a broadcast response back to the client node.
[0106] The corresponding node-edge relationship between the sorting node and the commit node is determined based on the block commit log information.
[0107] Specifically, the block commit log information contains a commitHash value, which corresponds to the block commit hash parsed from the target block file. Each block has only one commit hash. Blocks are distributed by the sorting nodes and received by the commit nodes, thus representing two points. The sorting node information includes labels, where the sorting node certificate information parsed from the block serves as an attribute of the node. The newly added labels in the block commit log information are container node identifiers, representing the commit nodes. Because the sorting nodes and commit nodes use a bidirectional stream service, and the stream is continuous, there is only one edge: the sorting node sends blocks to the commit node.
[0108] Optionally, obtain the target block file and transaction log data corresponding to the target consensus transaction, including:
[0109] All nodes in the target consensus transaction are assigned unique label information.
[0110] Among them, the unique label information can be a unique label attached to all nodes in the target consensus transaction. The label can be represented by labels, and the labels of each node must be set differently.
[0111] Specifically, in the target consensus transaction, add label information to the docker-compose.yaml of all Peer and Orderer node containers. Since each node of Hyperledger Fabric is started as a Docker container, labels are used to mark the container to identify the node information of the container, such as labels.services.peer0.org1.example.com, and the labels of each node need to be set differently.
[0112] Obtain the target block file corresponding to the target consensus transaction.
[0113] Obtain the transaction log data corresponding to the target consensus transaction.
[0114] The transaction log data includes unique tag information carried by all nodes in the target consensus transaction.
[0115] Specifically, when collecting Hyperledger Fabric node container logs, i.e., transaction log data, the values of the container's labels are obtained and included as part of the transaction log data, representing the basic information of the corresponding node. This addresses the deficiency in gRPC service logs that lack information about the responder itself. It should be noted that various components can collect container logs for Hyperledger Fabric nodes, and these components must support obtaining information about the Docker container to retrieve its labels, such as the Filebeat component. It is also important to note that when collecting Hyperledger Fabric node container logs, i.e., transaction log data, the unique label information carried by all nodes in the target consensus transaction must also be collected as part of the transaction log data.
[0116] This invention, starting from the research direction of blockchain node tracking and visualization supervision technology, selects the widely used consortium blockchain framework Hyperledger Fabric as the research object and proposes a method for tracking Hyperledger Fabric node consensus transactions. This method integrates multiple data information, including the target block file and transaction log data corresponding to the target consensus transaction, analyzes various types of data, organizes the relationships between nodes in the Hyperledger Fabric consensus process, converts these relationships into vertex-edge data, and stores them using a graph database. The visualization components of the graph database display the topological relationship information between nodes, thus filling a gap in current blockchain node tracking and visualization supervision technology to a certain extent. This invention, on the one hand, proposes a method for tracking the blockchain node consensus process; on the other hand, the consensus transaction process data stored in the graph database facilitates subsequent research work such as upper-level data analysis using graph algorithms.
[0117] Example 2
[0118] Figure 2 This is a schematic diagram of a consensus transaction visualization device according to an embodiment of the present invention. This embodiment is applicable to consensus transaction visualization applications. The device can be implemented using software and / or hardware, and can be integrated into any device that provides consensus transaction visualization functionality, such as… Figure 2 As shown, the consensus transaction visualization device specifically includes: an acquisition module 201, a determination module 202, and a storage and display module 203.
[0119] Among them, the acquisition module 201 is used to acquire the target block file and transaction log data corresponding to the target consensus transaction;
[0120] The determination module 202 is used to determine the corresponding node-edge relationships between nodes in the target consensus transaction based on the target block file and the transaction log data.
[0121] The storage and display module 203 is used to store the nodes and the corresponding point-edge relationships between the nodes into a graph database, and to display the nodes and the corresponding point-edge relationships between the nodes through a graph database visualization component.
[0122] Optionally, the determining module 202 includes:
[0123] The first parsing unit is used to parse the target block file to obtain the target block data in the target block file;
[0124] The second parsing unit is used to parse the transaction log data to obtain the target log information corresponding to the transaction log data;
[0125] The determining unit is used to determine the corresponding point-edge relationships between nodes in the target consensus transaction based on the target block data and the target log information.
[0126] Optionally, the nodes in the target consensus transaction include: endorsement nodes, ordering nodes, and commit nodes; correspondingly, the second parsing unit includes:
[0127] The parsing subunit is used to parse the transaction log data to obtain the endorsement service log information corresponding to the endorsement node, the broadcast service log information corresponding to the sorting node, and the block commit log information corresponding to the commit node.
[0128] Optionally, the endorsement service log information corresponding to the endorsement node includes: endorsement node chaincode call success log information and endorsement service response log information; the broadcast service log information corresponding to the sorting node includes: block generation log information and broadcast service response log information.
[0129] Optionally, the nodes in the target consensus transaction further include: client nodes; correspondingly, the determining unit includes:
[0130] The first determining subunit is used to determine the corresponding point-edge relationship between the endorsement node and the client node based on the successful call log information of the endorsement node chaincode and the endorsement service response log information.
[0131] The second determining subunit is used to determine the corresponding point-edge relationship between the sorting node and the client node based on the block generation log information and the broadcast service response log information.
[0132] The third determining subunit is used to determine the corresponding point-edge relationship between the sorting node and the submitting node based on the block submit log information.
[0133] Optionally, the acquisition module 201 includes:
[0134] The assignment unit is used to assign unique label information to all nodes in the target consensus transaction;
[0135] The first acquisition unit is used to acquire the target block file corresponding to the target consensus transaction;
[0136] The second acquisition unit is used to acquire transaction log data corresponding to the target consensus transaction, wherein the transaction log data includes unique tag information carried by all nodes in the target consensus transaction.
[0137] Optionally, the target block data includes: channel ID, transaction ID, creator certificate, endorser node identity group certificate, message creator certificate, block commit hash, and block number.
[0138] The above-mentioned products can execute the consensus transaction visualization method provided in any embodiment of the present invention, and have the corresponding functional modules and beneficial effects of executing the consensus transaction visualization method.
[0139] Example 3
[0140] Figure 3 A schematic diagram of an electronic device 30 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0141] like Figure 3As shown, the electronic device 30 includes at least one processor 31 and a memory, such as a read-only memory (ROM) 32 or a random access memory (RAM) 33, communicatively connected to the at least one processor 31. The memory stores computer programs executable by the at least one processor. The processor 31 can perform various appropriate actions and processes based on the computer program stored in the ROM 32 or loaded from storage unit 38 into the RAM 33. The RAM 33 can also store various programs and data required for the operation of the electronic device 30. The processor 31, ROM 32, and RAM 33 are interconnected via a bus 34. An input / output (I / O) interface 35 is also connected to the bus 34.
[0142] Multiple components in electronic device 30 are connected to I / O interface 35, including: input unit 36, such as keyboard, mouse, etc.; output unit 37, such as various types of monitors, speakers, etc.; storage unit 38, such as disk, optical disk, etc.; and communication unit 39, such as network card, modem, wireless transceiver, etc. Communication unit 39 allows electronic device 30 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0143] Processor 31 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 31 include, but are not limited to, central processing units (CPUs), graphics processing units (GPUs), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any suitable processor, controller, microcontroller, etc. Processor 31 performs the various methods and processes described above, such as consensus transaction visualization methods:
[0144] Obtain the target block file and transaction log data corresponding to the target consensus transaction;
[0145] The corresponding node-edge relationships between nodes in the target consensus transaction are determined based on the target block file and the transaction log data.
[0146] The nodes and their corresponding edge relationships are stored in a graph database, and the graph database visualization component is used to display the nodes and their corresponding edge relationships.
[0147] In some embodiments, the consensus transaction visualization method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 38. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 30 via ROM 32 and / or communication unit 39. When the computer program is loaded into RAM 33 and executed by processor 31, one or more steps of the consensus transaction visualization method described above may be performed. Alternatively, in other embodiments, processor 31 may be configured to execute the consensus transaction visualization method by any other suitable means (e.g., by means of firmware).
[0148] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0149] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0150] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0151] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0152] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0153] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0154] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0155] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A consensus transaction visualization method, characterized in that, include: Obtain the target block file and transaction log data corresponding to the target consensus transaction; the target consensus transaction is a consensus transaction between nodes during the Hyperledger Fabric network consensus process; the transaction log data includes unique tag information carried by all nodes in the target consensus transaction. The corresponding node-edge relationships between nodes in the target consensus transaction are determined based on the target block file and the transaction log data. The nodes and the corresponding point-edge relationships between them are stored in a graph database, and the nodes and the corresponding point-edge relationships between them are displayed through a graph database visualization component. The process of determining the corresponding node-edge relationships between nodes in the target consensus transaction based on the target block file and the transaction log data includes: Parse the target block file to obtain the target block data in the target block file; Parse the transaction log data to obtain the target log information corresponding to the transaction log data; Determine the corresponding node-edge relationships between nodes in the target consensus transaction based on the target block data and the target log information; The nodes in the target consensus transaction also include: client nodes; Accordingly, the point-edge relationships between nodes in the target consensus transaction are determined based on the target block data and the target log information, including: The point-edge relationship between the endorsement node and the client node is determined based on the successful call log information of the endorsement node chaincode and the endorsement service response log information. The corresponding point-edge relationship between the sorting node and the client node is determined based on the block generation log information and the broadcast service response log information. The corresponding node-edge relationship between the sorting node and the commit node is determined based on the block commit log information.
2. The method according to claim 1, characterized in that, The nodes in the target consensus transaction include: endorsement nodes, sorting nodes, and submission nodes; Accordingly, the transaction log data is parsed to obtain the target log information corresponding to the transaction log data, including: The transaction log data is parsed to obtain the endorsement service log information corresponding to the endorsement node, the broadcast service log information corresponding to the sorting node, and the block commit log information corresponding to the commit node.
3. The method according to claim 2, characterized in that, The endorsement service log information corresponding to the endorsement node includes: endorsement node chaincode call success log information and endorsement service response log information; the broadcast service log information corresponding to the sorting node includes: block generation log information and broadcast service response log information.
4. The method according to claim 1, characterized in that, Obtain the target block file and transaction log data corresponding to the target consensus transaction, including: All nodes in the target consensus transaction are assigned unique label information; Obtain the target block file corresponding to the target consensus transaction; Obtain the transaction log data corresponding to the target consensus transaction.
5. The method according to claim 1, characterized in that, The target block data includes: channel ID, transaction ID, creator certificate, endorser node identity group certificate, message creator certificate, block commit hash, and block number.
6. A consensus transaction visualization device, characterized in that, include: The acquisition module is used to acquire the target block file and transaction log data corresponding to the target consensus transaction; the target consensus transaction is a consensus transaction between nodes in the Hyperledger Fabric network consensus process; the transaction log data includes unique tag information carried by all nodes in the target consensus transaction. The determination module is used to determine the corresponding node-edge relationships between nodes in the target consensus transaction based on the target block file and the transaction log data. The storage and display module is used to store the nodes and the corresponding point-edge relationships between the nodes into the graph database, and to display the nodes and the corresponding point-edge relationships between the nodes through the graph database visualization component; The determining module includes: The first parsing unit is used to parse the target block file to obtain the target block data in the target block file; The second parsing unit is used to parse the transaction log data to obtain the target log information corresponding to the transaction log data; The determining unit is used to determine the corresponding node-edge relationships between nodes in the target consensus transaction based on the target block data and the target log information. The nodes in the target consensus transaction further include: client nodes; correspondingly, the determining unit includes: The first determining subunit is used to determine the corresponding point-edge relationship between the endorsement node and the client node based on the endorsement node chaincode call success log information and the endorsement service response log information; The second determining subunit is used to determine the corresponding point-edge relationship between the sorting node and the client node based on the block generation log information and the broadcast service response log information. The third determining subunit is used to determine the corresponding point-edge relationship between the sorting node and the commit node based on the block commit log information.
7. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the consensus transaction visualization method according to any one of claims 1-5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the consensus transaction visualization method according to any one of claims 1-5.
Citation Information
Patent Citations
Consensus transaction track visual tracking method, system and equipment
CN114296964A
