Method, device, computer equipment and storage medium for automatically deploying blockchain nodes
Through the multi-level verification method, the problem of errors in deploying blockchain network nodes is solved, which leads to the system not being able to operate normally, improves deployment efficiency, and ensures the correct deployment and normal operation of nodes.
Patent Information
- Application Number
- CN202111250513.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-26
- Publication Date
- 2024-11-01
- Estimated Expiration
- 2041-10-26
AI Technical Summary
When deploying blockchain network nodes, errors will cause the system to fail to operate normally, and the existing technology will be difficult to complete the deployment quickly and accurately, reducing efficiency.
Using a multi-level verification method, including verifying the correctness of deployment requests and the correctness of configuration files, ensuring the accuracy of installation packages by obtaining modules, verifying modules, generating modules and deploying modules, thereby ensuring the correctness of blockchain network nodes. deploy.
Through multi-level verification, the accuracy of the installation package is ensured, problems during the deployment process are discovered in advance, unnecessary operations are avoided, the deployment efficiency of blockchain network nodes is improved, and the normal operation of nodes is ensured.
Smart Images

Figure CN113987534B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of blockchain technology, and in particular to a method, device, computer equipment and storage medium for automatically deploying blockchain nodes. Background Art
[0002] Blockchain technology, also known as distributed ledger technology, is a decentralized distributed database technology that is characterized by decentralization, openness, transparency and immutability. Specifically, every piece of data in the blockchain network will be broadcast to all blockchain nodes, and each blockchain node can store the same data through corresponding storage resources.
[0003] When deploying blockchain network nodes, if any error occurs in any part of the deployment process, the blockchain network system will not be able to operate normally. If the test operation effect is not achieved after the deployment is completed, the deployment efficiency of the blockchain network nodes will be greatly reduced. Therefore, a new technical solution is needed to complete the deployment of blockchain network nodes more quickly and accurately. Summary of the invention
[0004] The purpose of the present invention is to provide a method, device and cloud computing platform for automatically deploying blockchain nodes to overcome the shortcomings of the prior art;
[0005] To achieve the above purpose, the technical solution adopted by the present invention is:
[0006] A first aspect: A method for automatically deploying a blockchain node, comprising the following steps:
[0007] Step S1: Obtain a blockchain node deployment request, wherein the blockchain node deployment request includes node information and digital signature data; execute step S1;
[0008] Step S2: verify the correctness of the blockchain node deployment request, wherein the correctness of the blockchain node deployment request includes the correctness of the node information transmission and the correctness of the node information, and execute step S3;
[0009] Step S3: Generate a configuration file according to the correct blockchain node deployment request, wherein the configuration file includes a functional module, and execute step S4;
[0010] Step S4: verify the correctness of the configuration file, wherein the verification of the correctness of the configuration file includes the verification of the correctness of the functional module, and execute step S5;
[0011] Step S5: Generate an installation package according to the correct configuration file, and execute step S6;
[0012] Step S6: Deploy the blockchain network according to the installation package.
[0013] Preferably, the method for verifying the correctness of a deployment request comprises the following steps:
[0014] Step S21: Verify the correctness of node information transmission according to the node information and digital signature. If the node transmission information is correct, execute step S22; if the node transmission information is incorrect, execute step S23;
[0015] Step S22: verify the correctness of the node information according to the correctly transmitted node information. If the node information is correct, execute step S3; if the node information is incorrect, execute step S23;
[0016] Step S23: Reject the blockchain node deployment request.
[0017] Preferably, in step S22, the method for verifying the correctness of node information transmission according to the node information and the digital signature is:
[0018] Step S101: Decrypt the digital signature data using the blockchain public key to obtain a first hash value, and execute step S102;
[0019] Step S102: Perform hash processing on the node information to obtain a second hash value, and execute step S103;
[0020] Step S103: Determine whether the first hash value is consistent with the second hash value. If they are consistent, the node information is correctly transmitted, and step S22 is executed. If they are inconsistent, the node information is incorrectly transmitted, and step S23 is executed.
[0021] Preferably, in step S22, the method for verifying the correctness of the node information according to the correctly transmitted node information is:
[0022] Step S201: Obtain the target node category and target node level in the correct node information, and execute step S202;
[0023] Step S202: Search a database, wherein the database is preset with node categories, node levels corresponding to the node categories, node quantity thresholds corresponding to the node levels, and actual values of the node quantities corresponding to the node levels, and execute step S203;
[0024] Step S203: Determine whether the target node category is one of the preset node categories, if so, execute step S204, if not, execute step S23;
[0025] Step S204: Determine whether the target node level is one of the node levels corresponding to the preset node category. If so, execute step S205; if not, execute step S23:
[0026] Step S205: Determine whether the actual value of the number of nodes corresponding to the node level is less than the threshold value of the number of nodes corresponding to the node level. If so, execute step S3; if not, execute step S23.
[0027] Preferably, in step S4, the method for verifying the correctness of the configuration file is:
[0028] Step S51: Obtain the IP address in the node information and execute step S52;
[0029] Step S52: According to the IP address, determine the official language of the location of the IP address, and execute step S53;
[0030] Step S53: Determine whether the function module version is the version corresponding to the official voice; if so, execute step S54; if not, execute step S55;
[0031] Step S54: verify the integrity of the functional module;
[0032] Step S55: deleting the configuration file and generating an alarm, wherein the alarm information includes calibration parameters, and the calibration parameters include at least one of the numbers of the sub-function modules applicable to the official voice function module version and the sub-function modules existing in the database.
[0033] Preferably, the method for verifying the integrity of the functional module is:
[0034] Step S61: take the function module in the configuration file as the function module to be verified, the function module to be verified includes the target function module and the number corresponding to the target function module, and execute step S62;
[0035] Step S62: Search the database according to the number to obtain the sub-function module corresponding to the number in the database.
[0036] Step S63: Determine whether the sub-function module is consistent with the target function module. If so, confirm that the configuration file is the correct configuration file and execute step S5. If not, execute step S55.
[0037] A second aspect: A device for automatically deploying a blockchain node, comprising an acquisition module, a verification module, a generation module, and a deployment module, wherein the verification module comprises a first verification module and a second verification module, and the generation module comprises a first generation module and a second generation module, wherein:
[0038] The acquisition module is used to acquire a deployment request;
[0039] The first verification module is used to verify the correctness of the deployment request;
[0040] The first generating module is used to generate a configuration file according to a correct deployment request;
[0041] The second verification module is used to verify the correctness of the configuration file;
[0042] The second generating module is used to generate an installation package according to a correct configuration file;
[0043] The deployment module is used to deploy the blockchain according to the installation package.
[0044] Preferably, the verification module includes a first verification unit and a second verification unit, wherein:
[0045] The first verification unit is used to verify the correctness of node information transmission;
[0046] The second verification unit is used to verify the correctness of the node information.
[0047] A third aspect: A computing device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, a method for automatically deploying blockchain nodes as described in any embodiment of the present invention is implemented.
[0048] A fourth aspect: A computer storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, a method for automatically deploying a blockchain node according to any embodiment of the present invention is implemented
[0049] The beneficial effects of the present invention are:
[0050] The present invention adopts the idea of multi-level verification. When obtaining a deployment request, the correctness of the deployment request is verified for the first time. When obtaining a configuration file, the correctness of the configuration file is verified for the second time. The accuracy of the installation package can be ensured through multi-level verification, and then the blockchain network nodes that meet the requirements can be deployed according to the correct installation package. Problems in the deployment process can be discovered in advance, unnecessary calculations can be reduced, and the normal operation of the deployed blockchain network nodes can be avoided, thereby improving the deployment efficiency of the blockchain network nodes. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 A schematic diagram of the structure of a method for automatically deploying blockchain network nodes provided in Example 1 of the present invention;
[0052] Figure 2 A schematic diagram of the structure of a method for automatically deploying blockchain network nodes provided in Example 2 of the present invention;
[0053] Figure 3 A schematic diagram of the structure of a method for automatically deploying blockchain network nodes provided in Example 3 of the present invention;
[0054] Figure 4 A schematic diagram of the structure of an apparatus for automatically deploying blockchain nodes provided in Example 4 of the present invention;
[0055] Figure 5 A schematic diagram of the structure of a device provided in Example 5 of the present invention. DETAILED DESCRIPTION
[0056] Below in conjunction with the appended Figures 1 to 5 , clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other implementations obtained by ordinary technicians in this field without creative work.
[0057] In the description of the present invention, it should be understood that the terms "counterclockwise", "clockwise", "longitudinal", "lateral", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", etc., indicating directions or positional relationships, are based on the directions or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention, and do not indicate or imply that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore should not be understood as a limitation on the present invention.
[0058] Embodiment 1:
[0059] like Figure 1 As shown, a method for automatically deploying blockchain network nodes includes the following steps:
[0060] Step S1: Obtain a blockchain node deployment request, wherein the blockchain node deployment request includes node information and digital signature data; execute step S1;
[0061] Step S2: verify the correctness of the blockchain node deployment request, wherein the correctness of the blockchain node deployment request includes the correctness of the node information transmission and the correctness of the node information, and execute step S3;
[0062] Step S3: Generate a configuration file according to the correct blockchain node deployment request, wherein the configuration file includes a functional module, and execute step S4;
[0063] Step S4: verify the correctness of the configuration file, wherein the verification of the correctness of the configuration file includes the verification of the correctness of the functional module, and execute step S5;
[0064] Step S5: Generate an installation package according to the correct configuration file, and execute step S6;
[0065] Step S6: Deploy the blockchain network according to the installation package.
[0066] The present invention provides a method for automatically deploying blockchain network nodes. The method adopts the idea of multi-level verification. When obtaining a deployment request, the correctness of the deployment request is first verified. When obtaining a configuration file, the correctness of the configuration file is secondly verified. The accuracy of the installation package can be ensured through multi-level verification, and then the blockchain network nodes that meet the requirements can be deployed according to the correct installation package. Problems in the deployment process can be discovered in advance, unnecessary calculations can be reduced, and the normal operation of the deployed blockchain network nodes can be avoided, thereby improving the deployment efficiency of the blockchain network nodes.
[0067] Example 2
[0068] like Figure 2 As shown, in this embodiment, the method for verifying the correctness of the deployment request includes the following steps:
[0069] Step S21: Verify the correctness of node information transmission according to the node information and digital signature. If the node transmission information is correct, execute step S22; if the node transmission information is incorrect, execute step S23;
[0070] Step S22: verify the correctness of the node information according to the correctly transmitted node information. If the node information is correct, execute step S3; if the node information is incorrect, execute step S23;
[0071] Step S23: Reject the blockchain node deployment request.
[0072] In the process of a terminal device (including laptops, desktop computers, and mobile terminals, etc.) sending a blockchain node deployment request to a blockchain deployment device through the network, the node information in the blockchain deployment request may be incomplete or missing due to network instability. Therefore, it is necessary to verify the node information obtained by the blockchain node deployment device after transmission. In addition, even if the transmitted node information is correct, the blockchain node deployment request sent by the terminal device does not meet the requirements of blockchain node deployment, and the directly generated configuration file will be sent incorrectly, resulting in the inability of the deployed blockchain node to operate normally. Therefore, it is necessary to perform double verification on the blockchain deployment request.
[0073] It is worth noting that in step S22, the method for verifying the correctness of node information transmission based on the node information and the digital signature is:
[0074] Step S101: Decrypt the digital signature data using the blockchain public key to obtain a first hash value, and execute step S102;
[0075] Step S102: Perform hash processing on the node information to obtain a second hash value, and execute step S103;
[0076] Step S103: Determine whether the first hash value is consistent with the second hash value. If they are consistent, the node information is correctly transmitted, and step S22 is executed. If they are inconsistent, the node information is incorrectly transmitted, and step S23 is executed.
[0077] Before obtaining the blockchain and node deployment request, the terminal device also includes obtaining the node information of the blockchain, hashing the node information to obtain a first hash value, encrypting the blockchain node through the private key of the blockchain, and obtaining digital signature data. The terminal device packages the node information and the digital signature data to produce a blockchain deployment request, and sends the blockchain deployment request to the deployment device, wherein the hash processing algorithm can be determined according to demand, such as SHA-256.
[0078] It is worth noting that in step S22, the method for verifying the correctness of the node information according to the correctly transmitted node information is:
[0079] Step S201: Obtain the target node category, target node level, and target node quantity in the correct node information, and execute step S202;
[0080] Step S202: Search a database, wherein the database is preset with node categories, node levels corresponding to the node categories, node quantity thresholds corresponding to the node levels, and actual values of the node quantities corresponding to the node levels, and execute step S203;
[0081] Step S203: Determine whether the target node category is one of the preset node categories, if so, execute step S204, if not, execute step S23;
[0082] Step S204: Determine whether the target node level is one of the node levels corresponding to the preset node category. If so, execute step S205; if not, execute step S23:
[0083] Step S205: Determine whether the target node quantity is less than the node quantity threshold corresponding to the node level. If so, execute step S3; if not, execute step S23.
[0084] In this embodiment, the node information includes node category, node level, and node quantity information. The node categories include sorting nodes, peer nodes, and server nodes. The node levels include first-level sorting nodes, second-level sorting nodes, and third-level sorting nodes, first-level peer nodes, second-level peer nodes, and third-level peer nodes, first-level server nodes, second-level server nodes, and third-level server nodes. The number of nodes at each level under each category needs to be less than any value of the preset threshold of the number of nodes at each level under each category. Only in this way can the normal operation of the blockchain nodes be guaranteed, and too many blockchain nodes can be avoided, which will cause conflicts and cause the blockchain network system to fail to operate normally.
[0085] Example 3
[0086] like Figure 3 As shown, in this embodiment, the method for verifying the correctness of the configuration file is:
[0087] Step S51: Obtain the IP address in the node information and execute step S52;
[0088] Step S52: According to the IP address, determine the official language of the location of the IP address, and execute step S53;
[0089] Step S53: Determine whether the function module version is the version corresponding to the official voice; if so, execute step S54; if not, execute step S55;
[0090] Step S54: verify the integrity of the functional module;
[0091] Step S55: deleting the configuration file and generating an alarm, wherein the alarm information includes calibration parameters, and the calibration parameters include at least one of the numbers of the sub-function modules applicable to the official voice function module version and the sub-function modules existing in the database.
[0092] The official languages (including Chinese, English, Japanese, French, etc.) of different regions are different, so different versions of functional modules need to be set to meet the blockchain node operation requirements of different regions. This embodiment can obtain geographic location information through IP addresses, determine the official language of the region based on the geographic location information, and then verify the correctness of the functional module version, which is conducive to improving the applicability of blockchain nodes.
[0093] It is worth noting that the method for verifying the integrity of the functional module is:
[0094] Step S61: take the function module in the configuration file as the function module to be verified, the function module to be verified includes the target function module and the number corresponding to the target function module, and execute step S62;
[0095] Step S62: Search the database according to the number to obtain the sub-function module corresponding to the number in the database.
[0096] Step S63: Determine whether the sub-function module is consistent with the target function module. If so, confirm that the configuration file is the correct configuration file and execute step S5. If not, execute step S55.
[0097] There are many sub-function modules and numbers corresponding to the sub-function modules preset in the database. For example, 1-function module, 2-wallet module, 3-smart contract module, 4-identity authentication module, and 5-side chain module are preset in the database. The number of the target function modules can be one or more. For example, the target function module in the configuration file and the number 2-smart contract module, according to 2, search the sub-function module numbered 2 in the database to obtain 2-wallet module. If the wallet module is inconsistent with the smart contract module, it is confirmed that the configuration file is an incorrect configuration file and the deployment needs to be stopped, which is conducive to verifying the type of function modules in the configuration file and avoiding data transmission errors during the configuration file generation process.
[0098] Example 4
[0099] like Figure 4 As shown, this embodiment can be applied to the case of remote batch deployment of blockchain nodes, and the device can implement the blockchain node deployment method described in any embodiment of the present invention. The device specifically includes an acquisition module, a verification module, a generation module, and a deployment module, the verification module includes a first verification module and a second verification module, and the generation module includes a first generation module and a second generation module, wherein: the acquisition module is used to obtain a deployment request; the first verification module is used to verify the correctness of the deployment request; the first generation module is used to generate a configuration file according to the correct deployment request; the second verification module is used to verify the correctness of the configuration file; the second generation module is used to generate an installation package according to the correct configuration file; the deployment module is used to deploy blockchain network nodes according to the installation package.
[0100] It is worth noting that the first verification module includes a first verification unit and a second verification unit, wherein: the first verification unit is used to verify the correctness of node information transmission; the second verification unit is used to verify the correctness of node information.
[0101] It is worth noting that the second verification module includes a verification unit and an alarm unit. The verification unit is used to verify the correctness of the configuration file, and the alarm unit is used to alarm if the configuration file is incorrect and output correction parameters.
[0102] Example 5
[0103] like Figure 5As shown, the device specifically includes: a memory and a processor, the memory stores a computer program, and the processor implements a method for automatically deploying blockchain network nodes as described in any embodiment of the present invention when executing the computer program. The processor and the memory can be connected through a bus or other means. Figure 5 The example of connecting through bus is taken in the following.
[0104] Example 6
[0105] A computer storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, a method for automatically deploying a blockchain node in any embodiment is implemented.
[0106] Any reference to memory, storage, database or other medium used in the embodiments provided herein may be volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
Claims
1. A method for automatically deploying blockchain nodes, It is characterized in that The following steps are involved: Step S1: Obtain a blockchain node deployment request, wherein the blockchain node deployment request includes node information and digital signature data; execute step S1; Step S2: verify the correctness of the blockchain node deployment request, wherein the correctness of the blockchain node deployment request includes the correctness of the node information transmission and the correctness of the node information, and execute step S3; Step S3: Generate a configuration file according to the correct blockchain node deployment request, wherein the configuration file includes an IP address and a functional module, and execute step S4; Step S4: verify the correctness of the configuration file, wherein the correctness of the configuration file includes the correctness of the function module version and the correctness of the function module content, and then execute step S5; Step S5: Generate an installation package according to the correct configuration file, and execute step S6; Step S6: deploying the blockchain network according to the installation package; The method for verifying the correctness of a deployment request includes the following steps: Step S21: Verify the correctness of node information transmission according to the node information and digital signature. If the node information transmission is correct, execute step S22; if the node information transmission is incorrect, execute step S23; Step S22: verifying the correctness of the node information according to the correctly transmitted node information. If the node information is correct, confirming that the deployment request is a correct deployment request; if the node information is incorrect, executing step S23; Step S23: rejecting the blockchain node deployment request; In step S22, the method for verifying the correctness of the node information according to the correctly transmitted node information is: Step S201: Obtain the target node category, target node level, and target node quantity in the correctly transmitted node information, and execute step S202; Step S202: Search a database, wherein the database is preset with node categories, node levels corresponding to the node categories, and node quantity thresholds corresponding to the node levels, and execute step S203; Step S203: Determine whether the target node category is one of the preset node categories, if so, execute step S204, if not, execute step S23; Step S204: Determine whether the target node level is one of the node levels corresponding to the preset node category, if so, execute step S205, if not, execute step S23; Step S205: Determine whether the target node quantity is less than the node quantity threshold corresponding to the node level. If so, confirm that the node information is correct node information and execute step S3. If not, execute step S23.
2. A method for automatically deploying blockchain nodes according to claim 1, It is characterized in that In step S21, the method for verifying the correctness of node information transmission based on the node information and the digital signature is: Step S101: Decrypt the digital signature data using the blockchain public key to obtain a first hash value, and execute step S102; Step S102: Perform hash processing on the node information to obtain a second hash value, and execute step S103; Step S103: Determine whether the first hash value and the second hash value are consistent. If they are consistent, the node information is correctly transmitted, confirm that the node information is correctly transmitted, and execute step S22. If they are inconsistent, the node information is incorrectly transmitted, and execute step S23. In step S4, the method for verifying the correctness of the configuration file is: Step S51: Obtain the IP address in the configuration file and execute step S52; Step S52: According to the IP address, determine the official language of the location of the IP address, and execute step S53; Step S53: Determine whether the functional module version is a version corresponding to the official language; if so, execute step S54; if not, execute step S55; Step S54: verify the integrity of the functional module; Step S55: deleting the configuration file and generating an alarm, wherein the alarm information includes calibration parameters, and the calibration parameters include at least one of the numbers of the sub-function modules applicable to the official language function module version and the sub-function modules existing in the database.
3. A method for automatically deploying blockchain nodes according to claim 1, It is characterized in that The method to verify the integrity of the functional module is: Step S61: take the function module in the configuration file as the function module to be verified, the function module to be verified includes the target function module and the number corresponding to the target function module, and execute step S62; Step S62: Search the database according to the number to obtain the sub-function module corresponding to the number in the database. Step S63: Determine whether the sub-function module is consistent with the target function module. If so, confirm that the configuration file is the correct configuration file and execute step S5. If not, execute step S55.
4. A device for automatically deploying blockchain nodes, It is characterized in that It includes an acquisition module, a verification module, a generation module, and a deployment module. The verification module includes a first verification module and a second verification module. The generation module includes a first generation module and a second generation module. In particular: The acquisition module is used to acquire a deployment request; The first verification module is used to verify the correctness of the deployment request; The first generating module is used to generate a configuration file according to a correct deployment request; The second verification module is used to verify the correctness of the configuration file; The second generating module is used to generate an installation package according to a correct configuration file; The deployment module is used to deploy the blockchain according to the installation package; The verification module includes a first verification unit and a second verification unit, wherein: The first verification unit is used to verify the correctness of node information transmission; The second verification unit is used to verify the correctness of the node information; The method for verifying the correctness of a deployment request includes the following steps: Step S21: Verify the correctness of node information transmission according to the node information and digital signature. If the node information transmission is correct, execute step S22; if the node information transmission is incorrect, execute step S23; Step S22: verifying the correctness of the node information according to the correctly transmitted node information. If the node information is correct, confirming that the deployment request is a correct deployment request; if the node information is incorrect, executing step S23; Step S23: rejecting the blockchain node deployment request; In step S22, the method for verifying the correctness of the node information according to the correctly transmitted node information is: Step S201: Obtain the target node category, target node level, and target node quantity in the correctly transmitted node information, and execute step S202; Step S202: Search a database, wherein the database is preset with node categories, node levels corresponding to the node categories, and node quantity thresholds corresponding to the node levels, and execute step S203; Step S203: Determine whether the target node category is one of the preset node categories, if so, execute step S204, if not, execute step S23; Step S204: Determine whether the target node level is one of the node levels corresponding to the preset node category, if so, execute step S205, if not, execute step S23; Step S205: Determine whether the target node quantity is less than the node quantity threshold corresponding to the node level. If so, confirm that the node information is correct node information and execute step S3. If not, execute step S23.
5. A computing device comprising a memory and a processor, wherein the memory stores a computer program, It is characterized in that When the processor executes the computer program, a method for automatically deploying blockchain nodes according to any one of claims 1 to 3 is implemented.
6. A computer storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, a method for automatically deploying blockchain nodes according to any one of claims 1 to 3 is implemented.
