11. 静态元空间
静态元空间
申请静态元空间
POST chain_tvm (申请静态元空间)
参数
name type data type description sliceno required int 元空间编号(0 为主元空间)
响应
http code content-type response 0application/json{"txhash":"..."}
响应字段说明:
- txhash - 交易哈希
示例 cURL
{"jsonrpc": "3.0","method": "chain_tvm","params": ["opcode=slice&subcode=applyStaticSlice&sliceno=0", "encryp=none"],"id": "aa80aa0c6bb0c7d81ac7e5b3"}
响应示例
{"jsonrpc": "3.0","id": "1726b2be8fef1ec6fa30ada2","result": {"ret": "0","err": "","content": {"txhash": "0x6885997ca51fa08ffded573088b0c5c294652ec842ac7f3182d32e30ce261025"}}}
获取元空间创世块
POST chain_tvm (获取创世块内容)
参数
name type data type description sliceno required int 元空间编号
响应
http code content-type response 0application/json创世块信息
示例 cURL
{"jsonrpc": "3.0","method": "chain_tvm","params": ["opcode=slice&subcode=getGenesisBlock&sliceno=0", "encryp=none"],"id": "aa80aa0c6bb0c7d81ac7e5b3"}
响应示例
{"jsonrpc": "3.0","id": "1726b2be8fef1ec6fa30ada2","result": {"ret": "0","err": "","content": {"block_number": 0,"block_hash": "0x..."}}}
添加节点
POST chain_tvm (添加节点)
参数
name type data type description file1 required string 完整路径,文档中每行保存一个节点信息 sliceno required int 目标元空间编号
响应
http code content-type response 0application/json操作结果
示例 cURL
{"jsonrpc": "3.0","method": "chain_tvm","params": ["opcode=static&subcode=addnodes&file1=&sliceno=10000", "encryp=none"],"id": "aa80aa0c6bb0c7d81ac7e5b3"}
删除节点
POST chain_tvm (删除节点)
参数
name type data type description file1 required string 完整路径,文档中每行保存一个节点信息 begin required int 起始位置 len required int 条目数量 sliceno required int 目标元空间编号
响应
http code content-type response 0application/json操作结果
示例 cURL
{"jsonrpc": "3.0","method": "chain_tvm","params": ["opcode=static&subcode=delnodes&file1=&begin=&len=&sliceno=10000", "encryp=none"],"id": "aa80aa0c6bb0c7d81ac7e5b3"}
查询节点
POST chain_tvm (查询节点信息)
参数
name type data type description begin required int 起始序号 len required int 条目数量 sliceno required int 目标元空间编号
响应
http code content-type response 0application/json节点列表
示例 cURL
{"jsonrpc": "3.0","method": "chain_tvm","params": ["opcode=static&subcode=nodeinfo&begin=&len=&sliceno=10001", "encryp=none"],"id": "aa80aa0c6bb0c7d81ac7e5b3"}