本文介紹下如何經過快照啓動 FIBOS 節點。javascript
快照建立無需中止節點打包數據比備份數據更方便快捷。若是還不清楚如何啓動一個 fibos 節點請參考 啓動 fibo節點java
fibos 版本 v1.4.1+node
快照生成位置 config.data_dir 爲根目錄,能夠配置git
例1github
config.data_dir = "./blockData/data";
fibos.load("producer", {
"snapshots-dir": "snapshots"
});
複製代碼
那麼快照生成位置爲 ./blockData/data/snapshots
api
例2bash
config.data_dir = "./blockData/data";
fibos.load("producer", {
"snapshots-dir": "../snapshots"
});
複製代碼
那麼快照生成位置爲 ./blockData/snapshots
curl
fibos.load("producer_api");
複製代碼
curl http://127.0.0.1:8870/v1/producer/create_snapshot
url
例1 調用結果spa
{
"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
fibos.load("chain", {
"snapshot": "./blockData/data/snapshots/snapshot-00003070049e51276829f6d1020fa638e5428fc9f8b0532fc60f680d72359dbe.bin"
});
複製代碼
例2
fibos.load("chain", {
"snapshot": "./blockData/snapshots/snapshot-00003070049e51276829f6d1020fa638e5428fc9f8b0532fc60f680d72359dbe.bin"
});
複製代碼
fibos.start();
複製代碼