From 55061ae6fbece01b82d1c30ad650f1a4bfc3589e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Kripalani?= Date: Thu, 19 Nov 2020 15:02:12 +0000 Subject: [PATCH] fix blockstore directory not created automatically. --- node/repo/fsrepo.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/node/repo/fsrepo.go b/node/repo/fsrepo.go index 9bf2d5d4c40..e4d9b32391f 100644 --- a/node/repo/fsrepo.go +++ b/node/repo/fsrepo.go @@ -308,6 +308,11 @@ func (fsr *fsLockedRepo) Blockstore(domain BlockstoreDomain) (blockstore.Blockst path := fsr.join(filepath.Join(fsDatastore, "chain")) readonly := fsr.readonly + if err := os.MkdirAll(path, 0755); err != nil { + fsr.bsErr = err + return + } + opts, err := BadgerBlockstoreOptions(domain, path, readonly) if err != nil { fsr.bsErr = err @@ -317,6 +322,7 @@ func (fsr *fsLockedRepo) Blockstore(domain BlockstoreDomain) (blockstore.Blockst bs, err := badgerbs.Open(opts) if err != nil { fsr.bsErr = err + return } fsr.bs = lblockstore.WrapIDStore(bs) })