本文引见下怎样经由过程快照启动 FIBOS 节点。
快照建立无需住手节点打包数据比备份数据更方便快捷。假如还不清晰怎样启动一个 fibos 节点请参考 启动 fibo节点
fibos 版本 v1.4.1+
怎样建立快照
1.设置快照目次
快照天生位置 config.data_dir 为根目次,能够设置
例1
config.data_dir = "./blockData/data";
fibos.load("producer", {
"snapshots-dir": "snapshots"
});
那末快照天生位置为 ./blockData/data/snapshots
例2
config.data_dir = "./blockData/data";
fibos.load("producer", {
"snapshots-dir": "../snapshots"
});
那末快照天生位置为 ./blockData/snapshots
2. 载入producer_api
fibos.load("producer_api");
3.天生快照
curl http://127.0.0.1:8870/v1/producer/create_snapshot
例1 挪用效果
{
"head_block_id":"00003070049e51276829f6d1020fa638e5428fc9f8b0532fc60f680d72359dbe",
"snapshot_name":"./blockData/data/snapshots/snapshot- 00003070049e51276829f6d1020fa638e5428fc9f8b0532fc60f680d72359dbe.bin"
}
例2 挪用效果
{
"head_block_id":"000006a4529a21b72b58c70c262fd3a754930d68b30b0b166f72fc1dbbc376e8"
"snapshot_name":"./blockData/data/./snapshots/snapshot-000006a4529a21b72b58c70c262fd3a754930d68b30b0b166f72fc1dbbc376e8.bin"
}
怎样经由过程快照启动
1.设置快照文件途径
例1
fibos.load("chain", {
"snapshot": "./blockData/data/snapshots/snapshot-00003070049e51276829f6d1020fa638e5428fc9f8b0532fc60f680d72359dbe.bin"
});
例2
fibos.load("chain", {
"snapshot": "./blockData/snapshots/snapshot-00003070049e51276829f6d1020fa638e5428fc9f8b0532fc60f680d72359dbe.bin"
});
2.启动效劳
fibos.start();