generateGroup

根据群组ID及创世块参数创建新的群组,本接口仅在兼容性版本为2.2.0及以后的版本有效

参数

  • groupID: unsigned int - 群组ID
  • params: object - 创世块参数,其字段如下:
    • timestamp: unsigned int - 创世块时间戳
    • sealers: array - 共识节点列表,要求所有所列共识节点间存在有效的P2P连接
    • enable_free_storage: bool - 可选,是否启用”free storage”模式,启用后节点将减少STORAGE相关指令的gas耗费

返回值

  • object: - 接口调用结果,其字段如下:
  • 示例
  1. // Request
  2. curl -X POST --data '{"jsonrpc":"2.0","method":"generateGroup","params":[2, {"timestamp":"1585214879000","sealers":["70f18c055d366615e86df99f91b6d3f16f07d66293b203b73498442c0366d2c8ff7a21bb56923d9d81b1c2916251888e47adf66c350738c898defac50aead5ab","dde37f534885f08db914566efeb03183d59363a4be972bbcdde25c37f0b350e1980a7de4fdc4aaf956b931aab00b739a8af475ed2461b8591d8c734b27285f57","d41672b29b3b1bfe6cad563d0f0b2a2735865b27918307b85085f892043a63f681ac8799243e920f7bb144b111d854d0592ba5f28aa7a4e0f9f533f9fdf76ead","7ba2717f81f38e7371ccdbe173751f051b86819f709e940957664dbde028698fd31ba3042f7dd9accd73741ba42afc35a8ef67fe7abbdeb76344169773aa0eca"],"enable_free_storage":true}],"id":1}' http://127.0.0.1:8545 | jq
  3. // Result
  4. {
  5. "id": 1,
  6. "jsonrpc": "2.0",
  7. "result": {
  8. "code": "0x0",
  9. "message": "Group 2 generated successfully"
  10. }
  11. }