Publish Zenith beta version #80

Merged
pitmutt merged 90 commits from dev041 into master 2024-05-09 19:15:41 +00:00
2 changed files with 23 additions and 0 deletions
Showing only changes of commit 826ed5b697 - Show all commits

22
src/Zenith/Scanner.hs Normal file
View file

@ -0,0 +1,22 @@
module Zenith.Scanner where
import Control.Monad (when)
import qualified Data.Text as T
import Zenith.Core (checkBlockChain)
-- | Function to scan the Zcash blockchain through the Zebra node and populate the Zenith database
scanZebra ::
Int -- ^ Starting block
-> T.Text -- ^ Host
-> Int -- ^ Port
-> T.Text -- ^ Path to database file
-> IO ()
scanZebra b host port dbFilePath = do
bc <- checkBlockChain host port
case bc of
Nothing -> throwIO $ userError "Failed to determine blockchain status"
Just bStatus -> do
if b > zgb_blocks bStatus
then throwIO $ userError "Invalid starting block for scan"
else do
let bList = [b .. (zgb_blocks bStatus)]

View file

@ -32,6 +32,7 @@ library
Zenith.Types Zenith.Types
Zenith.Utils Zenith.Utils
Zenith.Zcashd Zenith.Zcashd
Zenith.Scanner
hs-source-dirs: hs-source-dirs:
src src
build-depends: build-depends: