diff --git a/3.x/zh_CN/docs/tutorial/pro/expand_pro_withoutTars.md b/3.x/zh_CN/docs/tutorial/pro/expand_pro_withoutTars.md new file mode 100644 index 000000000..a1f50f41b --- /dev/null +++ b/3.x/zh_CN/docs/tutorial/pro/expand_pro_withoutTars.md @@ -0,0 +1,735 @@ +# 一键扩容无tars pro链 + +## 1. 脚本功能介绍 + +`build_chain.sh`脚本用于快速生成一条链中节点的配置文件,以下为用于无tars版pro/max 脚本选项功能介绍: + +**`C`选项[Optional]** + +脚本的命令,支持 `deploy` ,默认为`deploy`: + +- deploy: 用于部署新节点。 +- expand_node: 用于扩容节点 +- expand_group: 用于扩容群组 +- expand_service: 用于扩容RPC/Gateway服务 + +**`V`选项[Optional]** + +指定链版本(air、pro、max),默认为air。 + +**`c`选项[Optional]** + +用于指定服务的配置文件路径,此路径须包括config.toml,默认为./BcosBuilder/pro/config.toml。 + +**`o`选项[Optional]** + +指定生成的节点产物所在的目录,默认目录为 `./expand` 。 + +## 2、扩容node service + +### 2.1设置区块链节点扩容配置 + +具体步骤如下: + +``` +1、复制部署时的config.toml,仅保留想要扩容节点的agency配置,将其他agency的配置文件删除; +2、[tars]中的tars_pkg_dir指定服务的二进制位置; +3、[group] genesis_config_path,指定已有节点的创世块配置文件路径; +4、[[agency]] 中的[agency.group]选项,修改node_name、tars_listen_port; + +注意,tars_listen_port需要比之前部署的最后一个端口相差大于5,例如之前部署的最后一个节点的tars_listen_port=40423,那么此次的tars_listen_port最小为40428。 +``` + +扩容配置`config.toml`如下(例如扩容机构A节点node1): + +``` +[tars] +tars_pkg_dir = "binary/" + +[chain] +chain_id="chain0" +# the rpc-service enable sm-ssl or not, default disable sm-ssl +rpc_sm_ssl=false +# the gateway-service enable sm-ssl or not, default disable sm-ssm +gateway_sm_ssl=false +# the existed rpc service ca path, will generate new ca if not configured +#rpc_ca_cert_path="" +# the existed gateway service ca path, will generate new ca if not configured +#gateway_ca_cert_path=" + +[[group]] +group_id="group0" +# the genesis configuration path of the group, will generate new genesis configuration if not configured +genesis_config_path = "./group0/chain0/group0/config.genesis" +# VM type, now only support evm/wasm +vm_type="evm" +# use sm-crypto or not +sm_crypto=false +# enable auth-check or not +auth_check=false +init_auth_address="1" + +# the genesis config +# the number of blocks generated by each leader +leader_period = 1 +# the max number of transactions of a block +block_tx_count_limit = 1000 +# consensus algorithm now support PBFT(consensus_type=pbft) +consensus_type = "pbft" +# transaction gas limit +gas_limit = "3000000000" +# compatible version, can be dynamically upgraded through setSystemConfig +compatibility_version="3.4.0" + +[[agency]] +name = "agencyA" +# enable data disk encryption for rpc/gateway or not, default is false +enable_storage_security = false +# url of the key center, in format of ip:port, please refer to https://github.com/FISCO-BCOS/key-manager for details +# key_center_url = +# cipher_data_key = + + [agency.rpc] + deploy_ip=["172.31.184.189"] + # rpc listen ip + listen_ip="0.0.0.0" + # rpc listen port + listen_port=20000 + thread_count=4 + # rpc tars server listen ip + tars_listen_ip="0.0.0.0" + # rpc tars server listen port + tars_listen_port=40407 + + [agency.gateway] + deploy_ip=["172.31.184.189"] + # gateway listen ip + listen_ip="0.0.0.0" + # gateway listen port + listen_port=30000 + # gateway connected peers, should be all of the gateway peers info + peers=["172.31.184.189:30000", "172.31.184.246:30000", "172.31.184.13:30000", "172.31.184.213:30000"] + # gateway tars server listen ip + tars_listen_ip="0.0.0.0" + # gateway tars server listen port + tars_listen_port=40401 + + [[agency.group]] + group_id = "group0" + [[agency.group.node]] + # node name, Notice: node_name in the same agency and group must be unique + node_name = "node1" + deploy_ip = "172.31.184.189" + # node tars server listen ip + tars_listen_ip="0.0.0.0" + # node tars server listen port, Notice: the tars server of the node will cost five ports, then the port tars_listen_port ~ tars_listen_port + 4 should be in free + tars_listen_port=40428 + # enable data disk encryption for bcos node or not, default is false + enable_storage_security = false + # url of the key center, in format of ip:port, please refer to https://github.com/FISCO-BCOS/key-manager for details + # key_center_url = + # cipher_data_key = + monitor_listen_port = "3902" + # monitor log path example:"/home/fisco/tars/framework/app_log/" + monitor_log_path = "" +``` + +### 2.2 部署生成节点 + +```shell + +# 扩容node service +bash build_chain.sh -C expand_node -V pro -o expand_node -c ./config.toml + +``` + +执行上述命令后,扩容过程中生成的产物具体如下 + +``` +$ tree expand_node/172.31.184.227/ +expand_node/172.31.184.227/ +├── group0_node_44428 +│ ├── BcosNodeService +│ ├── conf +│ │ ├── config.genesis +│ │ ├── config.ini +│ │ ├── node.nodeid +│ │ ├── node.pem +│ │ ├── tars.conf +│ │ └── tars_proxy.ini +│ ├── start.sh +│ └── stop.sh +├── start_all.sh +└── stop_all.sh +``` + + + +### 2.3 将新扩容节点加入到群组 + +```eval_rst +.. note:: + 扩容新节点时,先将节点添加为观察节点,当扩容节点的块高与链上已有节点最高块高一致时候,才可将其加入为共识节点。 +``` + +**步骤1:获取扩容节点的NodeID** + +新节点扩容成功后,可通过控制台的`getGroupPeers`命令查看新增的节点列表: + +```shell +[group0]: /apps> getGroupPeers +peer0: 2300e14703675333d947154d8f01bb9d9f814c23a89980872404f368b301d45be2d3acebe306fa6d5a2859fd67f6ba2515eba0b263c940a5f67977ca440f806d +peer1: 582a3bc29ca8088ce63124c7b13d8627f931579bc3d896a983209a3b302be3f69cbd653f4bcd8ea3cdbf34d008960ee263644011af5826a7297c732b4ef4a1be +peer2: 58d2f067916dd514e570561e12b42cd07e42729317ea95217065c423055252a534dd7ab9490f97febf61868b4271a3b29776cd4d23b1b9f93e006d257c01cf81 +peer3: 6ca18750f51e9f748e653aa88d4f275659aecfc7c0062a105863b9415e75f0189e8c931f0d13e1254bb776c29da7e90f8316467e5bbf50663a1866c0c6fca46c +peer4: f760b1ef241faa35f2cc68cdb370bfc6b27f9b94b4c79a3d24d4fee41021d87d858a486b611c8ec8213c666faf9e6eec41115cb289bb0249d233e8866f22a94a + +[group0]: /apps> getSealerList +[ + Sealer{ + nodeID='2300e14703675333d947154d8f01bb9d9f814c23a89980872404f368b301d45be2d3acebe306fa6d5a2859fd67f6ba2515eba0b263c940a5f67977ca440f806d', + weight=1 + }, + Sealer{ + nodeID='582a3bc29ca8088ce63124c7b13d8627f931579bc3d896a983209a3b302be3f69cbd653f4bcd8ea3cdbf34d008960ee263644011af5826a7297c732b4ef4a1be', + weight=1 + }, + Sealer{ + nodeID='6ca18750f51e9f748e653aa88d4f275659aecfc7c0062a105863b9415e75f0189e8c931f0d13e1254bb776c29da7e90f8316467e5bbf50663a1866c0c6fca46c', + weight=1 + }, + Sealer{ + nodeID='f760b1ef241faa35f2cc68cdb370bfc6b27f9b94b4c79a3d24d4fee41021d87d858a486b611c8ec8213c666faf9e6eec41115cb289bb0249d233e8866f22a94a', + weight=1 + } +] +[group0]: /> getObserverList +[] +``` + +从控制台输出可看出,nodeID为58d2f067916dd514e570561e12b42cd07e42729317ea95217065c423055252a534dd7ab9490f97febf61868b4271a3b29776cd4d23b1b9f93e006d257c01cf81 的节点不在群组内,使用控制台`addObserver`命令将其加入到观察节点如下: + + +**步骤2: 将扩容节点加入为观察节点** + +```shell +[group0]: /apps> addObserver 58d2f067916dd514e570561e12b42cd07e42729317ea95217065c423055252a534dd7ab9490f97febf61868b4271a3b29776cd4d23b1b9f93e006d257c01cf81 +{ + "code":0, + "msg":"Success" +} + +[group0]: /apps> getObserverList +[ 58d2f067916dd514e570561e12b42cd07e42729317ea95217065c423055252a534dd7ab9490f97febf61868b4271a3b29776cd4d23b1b9f93e006d257c01cf81 +] +``` + +**步骤3:扩容节点同步到最高块后,将扩容节点加入为共识节点** + +```shell +[group0]: /apps> addSealer 58d2f067916dd514e570561e12b42cd07e42729317ea95217065c423055252a534dd7ab9490f97febf61868b4271a3b29776cd4d23b1b9f93e006d257c01cf81 1 +{ + "code":0, + "msg":"Success" +} + +[group0]: /apps> getSealerList +[ + Sealer{ + nodeID='2300e14703675333d947154d8f01bb9d9f814c23a89980872404f368b301d45be2d3acebe306fa6d5a2859fd67f6ba2515eba0b263c940a5f67977ca440f806d', + weight=1 + }, + Sealer{ + nodeID='582a3bc29ca8088ce63124c7b13d8627f931579bc3d896a983209a3b302be3f69cbd653f4bcd8ea3cdbf34d008960ee263644011af5826a7297c732b4ef4a1be', + weight=1 + }, + Sealer{ + nodeID='6ca18750f51e9f748e653aa88d4f275659aecfc7c0062a105863b9415e75f0189e8c931f0d13e1254bb776c29da7e90f8316467e5bbf50663a1866c0c6fca46c', + weight=1 + }, + Sealer{ + nodeID='f760b1ef241faa35f2cc68cdb370bfc6b27f9b94b4c79a3d24d4fee41021d87d858a486b611c8ec8213c666faf9e6eec41115cb289bb0249d233e8866f22a94a', + weight=1 + }, + Sealer{ + nodeID='58d2f067916dd514e570561e12b42cd07e42729317ea95217065c423055252a534dd7ab9490f97febf61868b4271a3b29776cd4d23b1b9f93e006d257c01cf81', + weight=1 + } +] +``` + +## 3、扩容RPC/Gateway service + +### 3.1 设置RPC/Gateway服务扩容配置 + +主要修改: + +``` +1、指定[chain] rpc_ca_cert_path、gateway_ca_cert_path中的ca路径; +2、[tars]中的tars_pkg_dir指定服务的二进制位置; +3、设置[[agency]]中的机构 name +4、设置[agency.rpc]的deploy_ip、listen_port、tars_listen_port 服务ip 和相应的端口; +5、设置[agency.gateway]的deploy_ip、listen_port、tars_listen_port服务ip 和相应的端口,同时修改peers (需要将已经部署完成的gateway的IP:port写上,其他已经部署的gateway不需要修改相应的nodes.json; + +注意,tars_listen_port需要比之前部署的最后一个端口相差大于5,例如之前部署的最后一个节点的tars_listen_port=40423,那么此次的rpc中tars_listen_port最小为40428,gateway中tars_listen_port最小为44429 +``` + +新RPC/Gateway服务的配置`config.toml`如下: + +``` +[tars] +tars_pkg_dir = "/data/yongmi/task/BcosBuilder/pro/binary" + +[chain] +chain_id="chain0" +# the rpc-service enable sm-ssl or not, default disable sm-ssl +rpc_sm_ssl=false +# the gateway-service enable sm-ssl or not, default disable sm-ssm +gateway_sm_ssl=false +# the existed rpc service ca path, will generate new ca if not configured +rpc_ca_cert_path="/data/yongmi/task/generate/rpc/chain0/ca" +# the existed gateway service ca path, will generate new ca if not configured +gateway_ca_cert_path="/data/yongmi/task/generate/gateway/chain0/ca" + +[[group]] +group_id="group0" +# the genesis configuration path of the group, will generate new genesis configuration if not configured +# genesis_config_path = "" +genesis_config_path = "/data/yongmi/task/generate/172.31.184.227/group0_node_44402/conf/config.genesis" + +# VM type, now only support evm/wasm +vm_type="evm" +# use sm-crypto or not +sm_crypto=false +# enable auth-check or not +auth_check=false +init_auth_address="0xff2c2db03e58da828e89c12f94bec03eecb0d309" + +# the genesis config +# the number of blocks generated by each leader +leader_period = 1 +# the max number of transactions of a block +block_tx_count_limit = 1000 +# consensus algorithm now support PBFT(consensus_type=pbft) +consensus_type = "pbft" +# transaction gas limit +gas_limit = "3000000000" +# compatible version, can be dynamically upgraded through setSystemConfig +compatibility_version="3.4.0" + +[[agency]] +name = "agencyE" +# enable data disk encryption for rpc/gateway or not, default is false +enable_storage_security = false +# url of the key center, in format of ip:port, please refer to https://github.com/FISCO-BCOS/key-manager for details +# key_center_url = +# cipher_data_key = + + [agency.rpc] + deploy_ip=["172.30.32.99"] + # rpc listen ip + listen_ip="0.0.0.0" + # rpc listen port + listen_port=22200 + thread_count=4 + # rpc tars server listen ip + tars_listen_ip="0.0.0.0" + # rpc tars server listen port + tars_listen_port=44428 + + [agency.gateway] + deploy_ip=["172.30.32.99"] + # gateway listen ip + listen_ip="0.0.0.0" + # gateway listen port + listen_port=33300 + # gateway connected peers, should be all of the gateway peers info + peers=["172.31.184.227:33300", "172.30.32.85:33300", "172.30.35.60:33300", "172.30.93.111:33300", "172.30.32.99:33300"] + tars_listen_port=44429 + +``` + +### 3.2 生成RPC/Gateway + +``` + +# 扩容并部署RPC服务 +bash build_chain.sh -C expand_service -V pro -o expand_service -c ./config.toml +``` + +扩容过程中生成的RPC/Gateway服务相关的配置位于expand_service/${deploy_ip}`目录,具体如下: + +```shell +$ tree expand_service/172.30.32.99/ +expand_service/172.30.32.99/ +├── gateway_33300 +│ ├── BcosGatewayService +│ ├── conf +│ │ ├── ca.crt +│ │ ├── cert.cnf +│ │ ├── config.ini +│ │ ├── nodes.json +│ │ ├── ssl.crt +│ │ ├── ssl.key +│ │ ├── ssl.nodeid +│ │ ├── tars.conf +│ │ └── tars_proxy.ini +│ ├── start.sh +│ └── stop.sh +├── rpc_22200 +│ ├── BcosRpcService +│ ├── conf +│ │ ├── ca.crt +│ │ ├── cert.cnf +│ │ ├── config.ini +│ │ ├── sdk +│ │ │ ├── ca.crt +│ │ │ ├── cert.cnf +│ │ │ ├── sdk.crt +│ │ │ ├── sdk.key +│ │ │ └── sdk.nodeid +│ │ ├── ssl.crt +│ │ ├── ssl.key +│ │ ├── ssl.nodeid +│ │ ├── tars.conf +│ │ └── tars_proxy.ini +│ ├── start.sh +│ └── stop.sh +├── start_all.sh +└── stop_all.sh +``` + +### 3.3通过控制台获取新扩容的服务信息 + +将生成的产物放置到对应ip机器中并启动服务,启动控制台,输入`getPeers`命令,控制台显示的Gateway服务节点数目由4个增加为5个。 + +``` +[group0]: /apps> getPeers +PeersInfo{ + p2pNodeID='3082010a0282010100bd8417a6197cac386e2223d81aad70fdefad4967f1e5dcf8af6b8322f06e1065b8684eb89ac3f948bcdd490940cf1620c14d23a56e466deb34c52805b486919893d4ddafcb2ee061f5e80195fa954ae1d95ba9a835659294fb61415c6d0214da8504e6e3c530369f4cc21bab8dad34dab46367df6bfbe7f3c806cf3f084891a242eeec560c00a6d2bc227af5e9e7cf1311b4bc28a51b3fae6604fbd0ca8d1a9c969d1e20eb67d6255536dc29e87d70b6beb2afff4ddc52421b81e3ef0fd7ada7706045ff5928aff7cb2aed5c6845523baf753e1ba4191e5b35278b5388f92ffeaf85ed131db5839f5ffbd7741e4c5dee473d59c424a7ff67868d753f75a3a9d50203010001', + endPoint='0.0.0.0:33300', + groupNodeIDInfo=[ + NodeIDInfo{ + group='group0', + nodeIDList=[ + 2300e14703675333d947154d8f01bb9d9f814c23a89980872404f368b301d45be2d3acebe306fa6d5a2859fd67f6ba2515eba0b263c940a5f67977ca440f806d + ] + } + ], + peers=[ + PeerInfo{ + p2pNodeID='3082010a0282010100e40cc1ede22791a4650a812d81e50c8f8a7ecc6bee39ef75241d5a762f5ace499625198af3b541c828e246b7ab3172c4f9ec157d05b44279acc48b72873fb8e646434713bb8a74c8f0aa66f727a30f22c028faefd11dd686dcf23dfc9c56eec913aaebf5d223cb908ed50cbf99b63e9b95ca11f1fe14157aca83cc0b1f26b4e79a97510ea06723b7d5adf9a743af5cd43ffcde5700ed9e1f9f7cdd4bc96559473e80a97d51083120e60e56d3b01ad6dfe02191bcddc15cd95804519c07df929fbe4a44d9f92145db828e15c7b4b8cdb1f26e3c84b992fcad2005132b178609464ec0980ca61b34e0d0d7d3f739aabf02dcba8850960e0a73f191a5117ce27f0b0203010001', + endPoint='172.30.32.99:53638', + groupNodeIDInfo=[ + + ] + }, + PeerInfo{ + p2pNodeID='3082010a0282010100c9234db7916d84645cd555e7290df98f393dfa3c7beb4181220effee59c912ba2b8e5bbc984effd42aa035f2208700e7c648b3e4227da3b01d4a386fbc9098f4647c2a87e153273bf8c1d10a5dc50140c6220b28a0a7ae1740bb6f7a38546cfa053a35b3420af80d1172f65ac7b678b7dd4881e4c112b5fa47cd45b6a6fa248a37941c9508c85a446ea8d381f135250b5bfc8cf83c07aade88c0a523ea3591065f72b7130bb6685741cce72ed33953ab353fd0297bf383cd2d0757f31a9db4266b6a75aa784a0421f1b853c9c08f9f862cc6ec7bc0e2ea7ae0fdf7db48f772f7f97b6052c1a097e1244d7bad9205591232a028f147054e31fa648c9e31bc776b0203010001', + endPoint='172.30.35.60:44374', + groupNodeIDInfo=[ + NodeIDInfo{ + group='group0', + nodeIDList=[ + 6ca18750f51e9f748e653aa88d4f275659aecfc7c0062a105863b9415e75f0189e8c931f0d13e1254bb776c29da7e90f8316467e5bbf50663a1866c0c6fca46c + ] + } + ] + }, + PeerInfo{ + p2pNodeID='3082010a0282010100cae0ec076d0e2c9ab16751eb162d45dc2f0c5c2262fc6e71f3bd3ce73dc307b9a8ed0a45d4badc44f7b940369c731f7c027a04445702e86e09fdb530e9afa63e5ff5593c0c0738ca80fb9d589956daec439293e64685e941a753349f81c1d8be6bfa309541e93f8e7367fc9f26c3681c750348696652472a888f5bf2d5d32e6fbc2ed3cd914684a79b804616efaf01601d37f8428295a5f321c514662c849d614c56bbd64c7872a94117ffcc89517cf9d08c690b44a63775146a5ade93b665f2c3451ec73047ac9031648f0e89d9048ff41990f67c28f69438482b1a68b9a55cb11f87adb83d4aff152f12fb50a166591e56e777409d55e30f2b222deb665def0203010001', + endPoint='172.30.32.85:34372', + groupNodeIDInfo=[ + NodeIDInfo{ + group='group0', + nodeIDList=[ + f760b1ef241faa35f2cc68cdb370bfc6b27f9b94b4c79a3d24d4fee41021d87d858a486b611c8ec8213c666faf9e6eec41115cb289bb0249d233e8866f22a94a + ] + } + ] + }, + PeerInfo{ + p2pNodeID='3082010a0282010100c3c2095e5da5ce1b57c69a8bd2a47936fa14acc87e2b2aed726da8e278d23f99c17ffbeb9e78c584019e28c2ab5bbeeb9b19f120d233728c60d179c240b974d6d2ed1fee1e1885f644710399687c932e06419c06c590becbfe6f3dabd5f60e867bf8e068eb5e296d58d54e1bbd2062b05870cf869322544e8929c1cec68a684f496319ad1e8818e801f59b4e2a7ca446c5aebfd8c1b15b9d98e07a0a9302ec23b309d301fec989e81a03b685a5013c52e58b5b9fdede13390fdb69d6bfd91a2bd76506a90981f0f084fd459435d85b55064c72a060acd56ee30441a7d83aa5914d535741951b1a6630806b74a4d4fafcf9cad622972989e7b3799d3ae0f1f5430203010001', + endPoint='172.30.93.111:40340', + groupNodeIDInfo=[ + NodeIDInfo{ + group='group0', + nodeIDList=[ + 582a3bc29ca8088ce63124c7b13d8627f931579bc3d896a983209a3b302be3f69cbd653f4bcd8ea3cdbf34d008960ee263644011af5826a7297c732b4ef4a1be + ] + } + ] + } + ] +} +``` + + + +## 4、扩容群组 + +### 4.1 设置群组配置 + +具体步骤如下: + +``` +1、拷贝部署时的配置文件,修改[[group]] 中的group_id; +2、[tars]中的tars_pkg_dir指定服务的二进制位置; +3、设置[[agency]] 中 [[agency.group]] 的group_id; +4、设置[[agency.group.node]] 中的tars_listen_port,tars_listen_port需要比之前部署的最后一个端口相差大于5; +``` + +配置新群组的config.toml 如下: + +``` +[tars] +tars_pkg_dir = "./binary" + +[chain] +chain_id="chain0" +# the rpc-service enable sm-ssl or not, default disable sm-ssl +rpc_sm_ssl=false +# the gateway-service enable sm-ssl or not, default disable sm-ssm +gateway_sm_ssl=false +# the existed rpc service ca path, will generate new ca if not configured +#rpc_ca_cert_path="" +# the existed gateway service ca path, will generate new ca if not configured +#gateway_ca_cert_path="" + +[[group]] +group_id="group1" +# the genesis configuration path of the group, will generate new genesis configuration if not configured +# genesis_config_path = "" +# VM type, now only support evm/wasm +vm_type="evm" +# use sm-crypto or not +sm_crypto=false +# enable auth-check or not +auth_check=false +init_auth_address="0xff2c2db03e58da828e89c12f94bec03eecb0d309" + +# the genesis config +# the number of blocks generated by each leader +leader_period = 1 +# the max number of transactions of a block +block_tx_count_limit = 1000 +# consensus algorithm now support PBFT(consensus_type=pbft) +consensus_type = "pbft" +# transaction gas limit +gas_limit = "3000000000" +# compatible version, can be dynamically upgraded through setSystemConfig +compatibility_version="3.4.0" + +[[agency]] +name = "agencyA" +# enable data disk encryption for rpc/gateway or not, default is false +enable_storage_security = false +# url of the key center, in format of ip:port, please refer to https://github.com/FISCO-BCOS/key-manager for details +# key_center_url = +# cipher_data_key = + + [agency.rpc] + deploy_ip=["172.31.184.227"] + # rpc listen ip + listen_ip="0.0.0.0" + # rpc listen port + listen_port=22200 + thread_count=4 + # rpc tars server listen ip + tars_listen_ip="0.0.0.0" + # rpc tars server listen port + tars_listen_port=44400 + + [agency.gateway] + deploy_ip=["172.31.184.227"] + # gateway listen ip + listen_ip="0.0.0.0" + # gateway listen port + listen_port=33300 + # gateway connected peers, should be all of the gateway peers info + peers=["172.31.184.227:33300", "172.30.32.85:33300", "172.30.35.60:33300", "172.30.93.111:33300"] + tars_listen_port=44401 + + [[agency.group]] + group_id = "group1" + + [[agency.group.node]] + # node name, Notice: node_name in the same agency and group must be unique + node_name = "node0" + deploy_ip = "172.31.184.227" + # node tars server listen ip + tars_listen_ip="0.0.0.0" + # node tars server listen port, Notice: the tars server of the node will cost five ports, then the port tars_listen_port ~ tars_listen_port + 4 should be in free + tars_listen_port=44428 + # enable data disk encryption for bcos node or not, default is false + enable_storage_security = false + # url of the key center, in format of ip:port, please refer to https://github.com/FISCO-BCOS/key-manager for details + # key_center_url = + # cipher_data_key = + monitor_listen_port = "3901" + # monitor log path example:"/home/fisco/tars/framework/app_log/" + monitor_log_path = "" + +[[agency]] +name = "agencyB" +# enable data disk encryption for rpc/gateway or not, default is false +enable_storage_security = false +# url of the key center, in format of ip:port, please refer to https://github.com/FISCO-BCOS/key-manager for details +# key_center_url = +# cipher_data_key = + + [agency.rpc] + deploy_ip=["172.30.32.85"] + # rpc listen ip + listen_ip="0.0.0.0" + # rpc listen port + listen_port=22200 + thread_count=4 + # rpc tars server listen ip + tars_listen_ip="0.0.0.0" + # rpc tars server listen port + tars_listen_port=44407 + + [agency.gateway] + deploy_ip=["172.30.32.85"] + # gateway listen ip + listen_ip="0.0.0.0" + # gateway listen port + listen_port=33300 + # gateway connected peers, should be all of the gateway peers info + peers=["172.31.184.227:33300", "172.30.32.85:33300", "172.30.35.60:33300", "172.30.93.111:33300"] + tars_listen_port=44408 + + [[agency.group]] + group_id = "group1" + + [[agency.group.node]] + # node name, Notice: node_name in the same agency and group must be unique + node_name = "node0" + deploy_ip = "172.30.32.85" + # node tars server listen ip + tars_listen_ip="0.0.0.0" + # node tars server listen port, Notice: the tars server of the node will cost five ports, then the port tars_listen_port ~ tars_listen_port + 4 should be in free + tars_listen_port=44433 + # enable data disk encryption for bcos node or not, default is false + enable_storage_security = false + # url of the key center, in format of ip:port, please refer to https://github.com/FISCO-BCOS/key-manager for details + # key_center_url = + # cipher_data_key = + monitor_listen_port = "3901" + # monitor log path example:"/home/fisco/tars/framework/app_log/" + monitor_log_path = "" +``` + +### 4.2生成新群组 + +``` +# 扩容新群组 +bash build_chain.sh -C expand_group -V pro -o expand_group -c ./config.toml +``` + +扩容过程中生成的群组相关的配置位于expand_group目录,具体如下: + +``` +$ tree expand_group +expand_group +├── 172.30.32.85 +│ ├── group1_node_44433 +│ │ ├── BcosNodeService +│ │ ├── conf +│ │ │ ├── config.genesis +│ │ │ ├── config.ini +│ │ │ ├── node.nodeid +│ │ │ ├── node.pem +│ │ │ ├── tars.conf +│ │ │ └── tars_proxy.ini +│ │ ├── start.sh +│ │ └── stop.sh +│ ├── start_all.sh +│ └── stop_all.sh +└── 172.31.184.227 + ├── group1_node_44428 + │ ├── BcosNodeService + │ ├── conf + │ │ ├── config.genesis + │ │ ├── config.ini + │ │ ├── node.nodeid + │ │ ├── node.pem + │ │ ├── tars.conf + │ │ └── tars_proxy.ini + │ ├── start.sh + │ └── stop.sh + ├── start_all.sh + └── stop_all.sh +``` + +### 4.2 通过控制台获取新扩容的服务信息 + +将生成的产物放置到对应ip机器中并启动服务,启动控制台,输入`getPeers`命令,控制台显示增加的group1 有两个node; + +``` +[group1]: /apps> getPeers +PeersInfo{ + p2pNodeID='3082010a0282010100bd8417a6197cac386e2223d81aad70fdefad4967f1e5dcf8af6b8322f06e1065b8684eb89ac3f948bcdd490940cf1620c14d23a56e466deb34c52805b486919893d4ddafcb2ee061f5e80195fa954ae1d95ba9a835659294fb61415c6d0214da8504e6e3c530369f4cc21bab8dad34dab46367df6bfbe7f3c806cf3f084891a242eeec560c00a6d2bc227af5e9e7cf1311b4bc28a51b3fae6604fbd0ca8d1a9c969d1e20eb67d6255536dc29e87d70b6beb2afff4ddc52421b81e3ef0fd7ada7706045ff5928aff7cb2aed5c6845523baf753e1ba4191e5b35278b5388f92ffeaf85ed131db5839f5ffbd7741e4c5dee473d59c424a7ff67868d753f75a3a9d50203010001', + endPoint='0.0.0.0:33300', + groupNodeIDInfo=[ + NodeIDInfo{ + group='group0', + nodeIDList=[ + 2300e14703675333d947154d8f01bb9d9f814c23a89980872404f368b301d45be2d3acebe306fa6d5a2859fd67f6ba2515eba0b263c940a5f67977ca440f806d + ] + }, + NodeIDInfo{ + group='group1', + nodeIDList=[ + 68ab51bcabeddf62eebbb23af731a4c6ba43a9724e2d264e081be811b39542f8ac1acf490dfe837f416b32c7c3d86e4c917f0a0b559c350146ba10f21b0c961b + ] + } + ], + peers=[ + PeerInfo{ + p2pNodeID='3082010a0282010100c9234db7916d84645cd555e7290df98f393dfa3c7beb4181220effee59c912ba2b8e5bbc984effd42aa035f2208700e7c648b3e4227da3b01d4a386fbc9098f4647c2a87e153273bf8c1d10a5dc50140c6220b28a0a7ae1740bb6f7a38546cfa053a35b3420af80d1172f65ac7b678b7dd4881e4c112b5fa47cd45b6a6fa248a37941c9508c85a446ea8d381f135250b5bfc8cf83c07aade88c0a523ea3591065f72b7130bb6685741cce72ed33953ab353fd0297bf383cd2d0757f31a9db4266b6a75aa784a0421f1b853c9c08f9f862cc6ec7bc0e2ea7ae0fdf7db48f772f7f97b6052c1a097e1244d7bad9205591232a028f147054e31fa648c9e31bc776b0203010001', + endPoint='172.30.35.60:44374', + groupNodeIDInfo=[ + NodeIDInfo{ + group='group0', + nodeIDList=[ + 6ca18750f51e9f748e653aa88d4f275659aecfc7c0062a105863b9415e75f0189e8c931f0d13e1254bb776c29da7e90f8316467e5bbf50663a1866c0c6fca46c + ] + } + ] + }, + PeerInfo{ + p2pNodeID='3082010a0282010100cae0ec076d0e2c9ab16751eb162d45dc2f0c5c2262fc6e71f3bd3ce73dc307b9a8ed0a45d4badc44f7b940369c731f7c027a04445702e86e09fdb530e9afa63e5ff5593c0c0738ca80fb9d589956daec439293e64685e941a753349f81c1d8be6bfa309541e93f8e7367fc9f26c3681c750348696652472a888f5bf2d5d32e6fbc2ed3cd914684a79b804616efaf01601d37f8428295a5f321c514662c849d614c56bbd64c7872a94117ffcc89517cf9d08c690b44a63775146a5ade93b665f2c3451ec73047ac9031648f0e89d9048ff41990f67c28f69438482b1a68b9a55cb11f87adb83d4aff152f12fb50a166591e56e777409d55e30f2b222deb665def0203010001', + endPoint='172.30.32.85:34372', + groupNodeIDInfo=[ + NodeIDInfo{ + group='group0', + nodeIDList=[ + f760b1ef241faa35f2cc68cdb370bfc6b27f9b94b4c79a3d24d4fee41021d87d858a486b611c8ec8213c666faf9e6eec41115cb289bb0249d233e8866f22a94a + ] + }, + NodeIDInfo{ + group='group1', + nodeIDList=[ + 920f69840c1a2d4bdbda160992582cf4b3baacd6000c4cf259078a7188a7490470c90ad3f7250f64e5f84f38745ccce07a928469ca7608d7d875bbfcdaaf739d + ] + } + ] + }, + PeerInfo{ + p2pNodeID='3082010a0282010100c3c2095e5da5ce1b57c69a8bd2a47936fa14acc87e2b2aed726da8e278d23f99c17ffbeb9e78c584019e28c2ab5bbeeb9b19f120d233728c60d179c240b974d6d2ed1fee1e1885f644710399687c932e06419c06c590becbfe6f3dabd5f60e867bf8e068eb5e296d58d54e1bbd2062b05870cf869322544e8929c1cec68a684f496319ad1e8818e801f59b4e2a7ca446c5aebfd8c1b15b9d98e07a0a9302ec23b309d301fec989e81a03b685a5013c52e58b5b9fdede13390fdb69d6bfd91a2bd76506a90981f0f084fd459435d85b55064c72a060acd56ee30441a7d83aa5914d535741951b1a6630806b74a4d4fafcf9cad622972989e7b3799d3ae0f1f5430203010001', + endPoint='172.30.93.111:40340', + groupNodeIDInfo=[ + NodeIDInfo{ + group='group0', + nodeIDList=[ + 582a3bc29ca8088ce63124c7b13d8627f931579bc3d896a983209a3b302be3f69cbd653f4bcd8ea3cdbf34d008960ee263644011af5826a7297c732b4ef4a1be + ] + } + ] + } + ] +} +``` +