Compare commits
No commits in common. "80f873cffdaf11e4fc99ee3d73a19b40af442a52" and "19ce971b96c2b5399ccd8639478627eec6834f58" have entirely different histories.
80f873cffd
...
19ce971b96
7 changed files with 31 additions and 63 deletions
|
@ -20,6 +20,8 @@ Zenith is a command-line interface for the Zcash Full Node (`zcashd`). It has th
|
|||
- Creating new Unified Addresses.
|
||||
- Sending transactions with shielded memo support.
|
||||
|
||||
Note: Zenith depends on a patched version of the `haskoin-core` Haskell package included in this repo. A pull request to the maintainers of `haskoin-core` has been submitted, if/when it is merged, Zenith will be updated to use the standard package.
|
||||
|
||||
## Installation
|
||||
|
||||
- Install dependencies:
|
||||
|
|
36
app/Main.hs
36
app/Main.hs
|
@ -2,7 +2,6 @@
|
|||
|
||||
module Main where
|
||||
|
||||
import Brick (simpleMain)
|
||||
import Control.Monad (void)
|
||||
import Control.Monad.IO.Class (liftIO)
|
||||
import qualified Data.ByteString as B
|
||||
|
@ -13,11 +12,9 @@ import qualified Data.Text as T
|
|||
import qualified Data.Text.IO as TIO
|
||||
import Data.Time.Clock.POSIX
|
||||
import System.Console.StructuredCLI
|
||||
import System.Environment (getArgs)
|
||||
import System.Exit
|
||||
import System.IO
|
||||
import Text.Read (readMaybe)
|
||||
import Zenith.CLI
|
||||
import Zenith.Types (ZcashAddress(..), ZcashPool(..), ZcashTx(..))
|
||||
import Zenith.Utils
|
||||
import Zenith.Zcashd
|
||||
|
@ -199,29 +196,14 @@ processUri user pwd =
|
|||
main :: IO ()
|
||||
main = do
|
||||
config <- load ["zenith.cfg"]
|
||||
args <- getArgs
|
||||
nodeUser <- require config "nodeUser"
|
||||
nodePwd <- require config "nodePwd"
|
||||
if not (null args)
|
||||
then do
|
||||
case head args of
|
||||
"legacy" -> do
|
||||
checkServer nodeUser nodePwd
|
||||
void $
|
||||
runCLI
|
||||
"Zenith"
|
||||
def
|
||||
{ getBanner =
|
||||
" ______ _ _ _ \n |___ / (_) | | | \n / / ___ _ __ _| |_| |__ \n / / / _ \\ '_ \\| | __| '_ \\ \n / /_| __/ | | | | |_| | | |\n /_____\\___|_| |_|_|\\__|_| |_|\n Zcash Full Node CLI v0.4.0"
|
||||
}
|
||||
(root nodeUser nodePwd)
|
||||
"cli" -> simpleMain ui
|
||||
_ -> printUsage
|
||||
else printUsage
|
||||
|
||||
printUsage :: IO ()
|
||||
printUsage = do
|
||||
putStrLn "zenith [command] [parameters]\n"
|
||||
putStrLn "Available commands:"
|
||||
putStrLn "legacy\tLegacy CLI for zcashd"
|
||||
putStrLn "cli\tCLI for zebrad"
|
||||
checkServer nodeUser nodePwd
|
||||
void $
|
||||
runCLI
|
||||
"Zenith"
|
||||
def
|
||||
{ getBanner =
|
||||
" ______ _ _ _ \n |___ / (_) | | | \n / / ___ _ __ _| |_| |__ \n / / / _ \\ '_ \\| | __| '_ \\ \n / /_| __/ | | | | |_| | | |\n /_____\\___|_| |_|_|\\__|_| |_|\n Zcash Full Node CLI v0.4.0"
|
||||
}
|
||||
(root nodeUser nodePwd)
|
||||
|
|
|
@ -40,10 +40,10 @@ library:
|
|||
- http-types
|
||||
- array
|
||||
- base64-bytestring
|
||||
- hexstring
|
||||
- persistent
|
||||
- persistent-sqlite
|
||||
- persistent-template
|
||||
- brick
|
||||
- zcash-haskell
|
||||
|
||||
executables:
|
||||
|
@ -65,7 +65,6 @@ executables:
|
|||
- text
|
||||
- time
|
||||
- sort
|
||||
- brick
|
||||
|
||||
tests:
|
||||
zenith-test:
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
module Zenith.CLI where
|
||||
|
||||
import Brick (Widget, (<+>), joinBorders, simpleMain, str, withBorderStyle)
|
||||
import Brick.Widgets.Border (borderWithLabel, vBorder)
|
||||
import Brick.Widgets.Border.Style (unicode)
|
||||
import Brick.Widgets.Center (center)
|
||||
|
||||
ui :: Widget ()
|
||||
ui =
|
||||
joinBorders $
|
||||
withBorderStyle unicode $
|
||||
borderWithLabel (str "Zenith") $
|
||||
(center (str "Addresses") <+> vBorder <+> center (str "Transactions"))
|
|
@ -44,11 +44,11 @@ packages:
|
|||
# extra-deps: []
|
||||
extra-deps:
|
||||
- git: https://git.vergara.tech/Vergara_Tech/zcash-haskell.git
|
||||
commit: 6ea8698ccb5e44f9900ba0e61c6ffe6cba900139
|
||||
- git: https://git.vergara.tech/Vergara_Tech/haskell-hexstring.git
|
||||
commit: fe2df6f7d63272ac147911c1573550bed1d38a37
|
||||
commit: 0858b805d066d0ce91dcc05594d929e63a99484e
|
||||
- git: https://git.vergara.tech/Vergara_Tech/haskell-foreign-rust.git
|
||||
commit: 787c2e813eb3a5d16c375d4b37dfefbd2adcdf05
|
||||
- git: https://github.com/reach-sh/haskell-hexstring.git
|
||||
commit: 085c16fb21b9f856a435a3faab980e7e0b319341
|
||||
- git: https://github.com/well-typed/borsh.git
|
||||
commit: d2fcfa159e0a844b1ec5e8ed3e232d4b380fa831
|
||||
- vector-0.13.0.0@sha256:fa5cac81a17a5af388716792e8b99c24b3b66770086756d0d8b23f8272a0244c,9112
|
||||
|
|
|
@ -5,27 +5,16 @@
|
|||
|
||||
packages:
|
||||
- completed:
|
||||
commit: 6ea8698ccb5e44f9900ba0e61c6ffe6cba900139
|
||||
commit: 0858b805d066d0ce91dcc05594d929e63a99484e
|
||||
git: https://git.vergara.tech/Vergara_Tech/zcash-haskell.git
|
||||
name: zcash-haskell
|
||||
pantry-tree:
|
||||
sha256: 0506f9f095dbb134a4e7b3ba73a60a21c6298cbea01409871141b31cd0cf9c46
|
||||
size: 1366
|
||||
sha256: 1f36dc81c65790bb090acc7b5337a149fe82dfeeea278c89033245cd85c462fc
|
||||
size: 1430
|
||||
version: 0.4.1
|
||||
original:
|
||||
commit: 6ea8698ccb5e44f9900ba0e61c6ffe6cba900139
|
||||
commit: 0858b805d066d0ce91dcc05594d929e63a99484e
|
||||
git: https://git.vergara.tech/Vergara_Tech/zcash-haskell.git
|
||||
- completed:
|
||||
commit: fe2df6f7d63272ac147911c1573550bed1d38a37
|
||||
git: https://git.vergara.tech/Vergara_Tech/haskell-hexstring.git
|
||||
name: hexstring
|
||||
pantry-tree:
|
||||
sha256: 71f12a60e85f7e1897b07bb2d4c77794faee50df250d68b0c47b3d343dd4625a
|
||||
size: 741
|
||||
version: 0.12.0
|
||||
original:
|
||||
commit: fe2df6f7d63272ac147911c1573550bed1d38a37
|
||||
git: https://git.vergara.tech/Vergara_Tech/haskell-hexstring.git
|
||||
- completed:
|
||||
commit: 787c2e813eb3a5d16c375d4b37dfefbd2adcdf05
|
||||
git: https://git.vergara.tech/Vergara_Tech/haskell-foreign-rust.git
|
||||
|
@ -37,6 +26,17 @@ packages:
|
|||
original:
|
||||
commit: 787c2e813eb3a5d16c375d4b37dfefbd2adcdf05
|
||||
git: https://git.vergara.tech/Vergara_Tech/haskell-foreign-rust.git
|
||||
- completed:
|
||||
commit: 085c16fb21b9f856a435a3faab980e7e0b319341
|
||||
git: https://github.com/reach-sh/haskell-hexstring.git
|
||||
name: hexstring
|
||||
pantry-tree:
|
||||
sha256: 9ecf67856f59dfb382b283eceb42e4fc1865935d1a7e59111556ed381c6a2ffd
|
||||
size: 687
|
||||
version: 0.11.1
|
||||
original:
|
||||
commit: 085c16fb21b9f856a435a3faab980e7e0b319341
|
||||
git: https://github.com/reach-sh/haskell-hexstring.git
|
||||
- completed:
|
||||
commit: d2fcfa159e0a844b1ec5e8ed3e232d4b380fa831
|
||||
git: https://github.com/well-typed/borsh.git
|
||||
|
|
|
@ -25,7 +25,6 @@ source-repository head
|
|||
|
||||
library
|
||||
exposed-modules:
|
||||
Zenith.CLI
|
||||
Zenith.DB
|
||||
Zenith.Types
|
||||
Zenith.Utils
|
||||
|
@ -40,8 +39,8 @@ library
|
|||
, array
|
||||
, base >=4.7 && <5
|
||||
, base64-bytestring
|
||||
, brick
|
||||
, bytestring
|
||||
, hexstring
|
||||
, http-conduit
|
||||
, http-types
|
||||
, persistent
|
||||
|
@ -66,7 +65,6 @@ executable zenith
|
|||
ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall -Wunused-imports
|
||||
build-depends:
|
||||
base >=4.7 && <5
|
||||
, brick
|
||||
, bytestring
|
||||
, configurator
|
||||
, data-default
|
||||
|
|
Loading…
Reference in a new issue