One-click expansion of new nodes(No tars console)

1. Script function introduction

The ‘build _ chain.sh’ script is used to quickly generate a configuration file for a node in a chain. The following describes the function of the pro / max script option for tarless versions:

‘C ‘Options [Optional]

Script command, which supports’ deploy ‘. The default value is’ deploy’:

  • deploy: For deploying new nodes。

  • expand_node: Used to expand the node

  • expand_group: Used to expand the group

  • expand_service: For scaling RPC / Gateway services

‘V ‘Options [Optional]

Specifies the chain version (air, pro, max). The default value is air。

‘c ‘option [Optional]

Specifies the path of the service configuration file. This path must include config.toml. The default value is. / BcosBuilder / pro / config.toml。

‘o ‘option [Optional]

Specifies the directory where the generated node artifacts are located. The default directory is’. / expand’。

2. Expand node service

2.1 Setting Block Chain Node Expansion Configuration

Specific steps are as follows:

1. Copy the config.toml during deployment, keep only the agency configuration of the node you want to expand, and delete the configuration files of other agencies;
2. tars _ pkg _ dir in [tars] specifies the binary location of the service;
3. [group] genesis _ config _ path, which specifies the path of the genesis block configuration file of the existing node;
4. [agency.group] option in [[agency]], modify node _ name, tars _ listen _ port;
Note that the difference between the last deployed port and the tars _ listen _ port must be greater than 5. For example, if the tars _ listen _ port of the last deployed node is 40423, the minimum value of the tars _ listen _ port is 40428。

The capacity expansion configuration ‘config.toml’ is as follows (for example, node1 of node A of the capacity expansion organization):

[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 Deploy build nodes

# Expand node service
bash build_chain.sh -C expand_node -V pro -o expand_node -c ./config.toml

After executing the above command, the products generated during the expansion process are as follows

$ 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 Add the new expansion node to the group

Note

When you scale out a new node, first add the node as an observation node, and only when the block height of the scale-out node is the same as the highest block height of the existing node on the chain, can it be added as a consensus node。

Step 1: Obtain the NodeID of the scaling node

After the new node is successfully scaled out, you can view the list of new nodes through the ‘getGroupPeers’ command in the console:

[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
[]

As can be seen from the console output, the nodeID is 58d2f067916dd514e570561e12b42cd07e42729317ea95217065c423055252a534dd7ab9490f97febf61868b4271a3b29776cd4d23b1b9f93e006d257c is not in the group, use the console ‘addObserver’ command to add it to the observation node as follows:

Step 2: Add an expansion node as an observation node

[group0]: /apps> addObserver 58d2f067916dd514e570561e12b42cd07e42729317ea95217065c423055252a534dd7ab9490f97febf61868b4271a3b29776cd4d23b1b9f93e006d257c01cf81
{
    "code":0,
    "msg":"Success"
}

[group0]: /apps> getObserverList
[  58d2f067916dd514e570561e12b42cd07e42729317ea95217065c423055252a534dd7ab9490f97febf61868b4271a3b29776cd4d23b1b9f93e006d257c01cf81
]

Step 3: After the scaling node is synchronized to the highest block, add the scaling node as a consensus node

[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. Expand RPC / Gateway service

3.1 Setting RPC / Gateway Service Expansion Configuration

Major modifications:

1. Specify the ca path in [chain] rpc _ ca _ cert _ path and gateway _ ca _ cert _ path;
2. tars _ pkg _ dir in [tars] specifies the binary location of the service;
3. Set the institution name in [[agency]]
4. Set the deploy _ ip, listen _ port, tars _ listen _ port service ip and corresponding port of [agency.rpc];
5. Set the deploy _ ip, listen _ port, tars _ listen _ port service ip and corresponding port of [agency.gateway], and modify the peers (you need to write the IP: port of the deployed gateway, and other deployed gateways do not need to modify the corresponding nodes.json;
Note that the difference between tars _ listen _ port and the last deployed port must be greater than 5. For example, if the tars _ listen _ port of the last deployed node is 40423, the minimum value of tars _ listen _ port in this instance is 40428, and the minimum value of tars _ listen _ port in gateway is 44429

The configuration of the new RPC / Gateway service ‘config.toml’ is as follows:

[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 Generate RPC / Gateway

# Scale out and deploy RPC services
bash build_chain.sh -C expand_service -V pro -o expand_service -c ./config.toml

The RPC / Gateway service-related configuration generated during the expansion process is located at expand _ service / ${deploy_ip}’Directory, as follows:

$ 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 Obtain the newly expanded service information through the console

Place the generated product on the corresponding ip machine and start the service, start the console, and enter the ‘getPeers’ command. The number of Gateway service nodes displayed on the console is increased from 4 to 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. Expansion group

4.1 Setting Group Configuration

Specific steps are as follows:

1. Copy the configuration file during deployment and modify the group _ id in [[group]];
2. tars _ pkg _ dir in [tars] specifies the binary location of the service;
3. Set the group _ id of [[agency.group]] in [[agency]];
4. Set tars _ listen _ port in [[agency.group.node]]. The difference between tars _ listen _ port and the last deployed port must be greater than 5;

Configure config.toml for the new group as follows:

[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 Generate a new group

# Expand new group
bash build_chain.sh -C expand_group -V pro -o expand_group -c ./config.toml

The group-related configurations generated during the scaling process are located in the expand _ group directory, as follows:

$ 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 Obtain newly expanded service information through the console

Place the generated product in the corresponding ip machine and start the service, start the console, and enter the ‘getPeers’ command. The console shows that the added group1 has two nodes;

[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
                    ]
                }
            ]
        }
    ]
}