Aiming at the problems of the practical Byzantine fault-tolerant algorithm (PBFT), such as insufficient system dynamics, low consensus efficiency and poor system robustness caused by the random selection of master nodes, a consensus algorithm of CRPBFT based on consistent hash and random selection is proposed. Firstly, the nodes are grouped by consistent hash, and the dynamic change mechanism of nodes is added to provide a dynamic network structure for the system. Secondly, the reputation value of the node is dynamically calculated according to the performance of the node in the consensus. At the same time, this paper defines three node reputation levels, namely, the candidate list of primary nodes, common nodes and malicious nodes. The primary node that is reliable and whose identity is difficult to be maliciously predicted, is selected through the verifiable random function, and the nodes that satisfied the reputation value requirements are selected to form a relatively stable consensus cluster. Experimental results show that CRPBFT algorithm is more reliable than consensus node cluster in PBFT algorithm, and its performance in consensus delay, throughput and system robustness is better than PBFT algorithm. © 2024 Journal of Computer Engineering and Applications Beijing Co., Ltd.; Science Press. All rights reserved.