mirror of https://github.com/voidlizard/hbs2
Initial commit of a consensus prototype
This commit is contained in:
parent
456cdd9e01
commit
8a0943f783
|
@ -69,8 +69,8 @@ outputs = { self, nixpkgs, haskell-flake-utils, ... }@inputs:
|
||||||
];
|
];
|
||||||
|
|
||||||
shellExtBuildInputs = {pkgs}: with pkgs; [
|
shellExtBuildInputs = {pkgs}: with pkgs; [
|
||||||
haskellPackages.haskell-language-server
|
# haskellPackages.haskell-language-server
|
||||||
haskellPackages.cbor-tool
|
# haskellPackages.cbor-tool
|
||||||
pkg-config
|
pkg-config
|
||||||
inputs.hspup.packages.${pkgs.system}.default
|
inputs.hspup.packages.${pkgs.system}.default
|
||||||
inputs.fixme.packages.${pkgs.system}.default
|
inputs.fixme.packages.${pkgs.system}.default
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
-- |Consensus.hs
|
||||||
|
--
|
||||||
|
-- A fact graph database consensus, Tendermint with a twist.
|
||||||
|
--
|
||||||
|
-- Copyright (C) Serguey Zefirov, 2023.
|
||||||
|
|
||||||
|
module Consensus where
|
||||||
|
|
||||||
|
main = do
|
||||||
|
putStrLn "consensus!"
|
||||||
|
return ()
|
|
@ -0,0 +1,30 @@
|
||||||
|
Copyright (c) 2023, Dmitry Zuikov
|
||||||
|
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
* Redistributions in binary form must reproduce the above
|
||||||
|
copyright notice, this list of conditions and the following
|
||||||
|
disclaimer in the documentation and/or other materials provided
|
||||||
|
with the distribution.
|
||||||
|
|
||||||
|
* Neither the name of Dmitry Zuikov nor the names of other
|
||||||
|
contributors may be used to endorse or promote products derived
|
||||||
|
from this software without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@ -0,0 +1,149 @@
|
||||||
|
cabal-version: 3.0
|
||||||
|
name: hbs2-git
|
||||||
|
version: 0.1.0.0
|
||||||
|
-- synopsis:
|
||||||
|
-- description:
|
||||||
|
license: BSD-3-Clause
|
||||||
|
license-file: LICENSE
|
||||||
|
author: Dmitry Zuikov
|
||||||
|
maintainer: dzuikov@gmail.com
|
||||||
|
-- copyright:
|
||||||
|
category: Development
|
||||||
|
build-type: Simple
|
||||||
|
extra-doc-files: CHANGELOG.md
|
||||||
|
-- extra-source-files:
|
||||||
|
|
||||||
|
common shared-properties
|
||||||
|
ghc-options:
|
||||||
|
-Wall
|
||||||
|
-Wno-type-defaults
|
||||||
|
-- -fno-warn-unused-matches
|
||||||
|
-- -fno-warn-unused-do-bind
|
||||||
|
-- -Werror=missing-methods
|
||||||
|
-- -Werror=incomplete-patterns
|
||||||
|
-- -fno-warn-unused-binds
|
||||||
|
|
||||||
|
|
||||||
|
default-language: Haskell2010
|
||||||
|
|
||||||
|
default-extensions:
|
||||||
|
ApplicativeDo
|
||||||
|
, BangPatterns
|
||||||
|
, BlockArguments
|
||||||
|
, ConstraintKinds
|
||||||
|
, DataKinds
|
||||||
|
, DeriveDataTypeable
|
||||||
|
, DeriveGeneric
|
||||||
|
, DerivingStrategies
|
||||||
|
, DerivingVia
|
||||||
|
, ExtendedDefaultRules
|
||||||
|
, FlexibleContexts
|
||||||
|
, FlexibleInstances
|
||||||
|
, GADTs
|
||||||
|
, GeneralizedNewtypeDeriving
|
||||||
|
, ImportQualifiedPost
|
||||||
|
, LambdaCase
|
||||||
|
, MultiParamTypeClasses
|
||||||
|
, OverloadedStrings
|
||||||
|
, QuasiQuotes
|
||||||
|
, RecordWildCards
|
||||||
|
, ScopedTypeVariables
|
||||||
|
, StandaloneDeriving
|
||||||
|
, TupleSections
|
||||||
|
, TypeApplications
|
||||||
|
, TypeFamilies
|
||||||
|
|
||||||
|
|
||||||
|
build-depends: hbs2-core
|
||||||
|
, aeson
|
||||||
|
, async
|
||||||
|
, base16-bytestring
|
||||||
|
, bytestring
|
||||||
|
, containers
|
||||||
|
, cryptonite
|
||||||
|
, directory
|
||||||
|
, filepath
|
||||||
|
, memory
|
||||||
|
, microlens-platform
|
||||||
|
, mtl
|
||||||
|
, prettyprinter
|
||||||
|
, prettyprinter-ansi-terminal
|
||||||
|
, safe
|
||||||
|
, serialise
|
||||||
|
, suckless-conf
|
||||||
|
, text
|
||||||
|
, transformers
|
||||||
|
, typed-process
|
||||||
|
, uniplate
|
||||||
|
, hashable
|
||||||
|
, sqlite-simple
|
||||||
|
, stm
|
||||||
|
, unordered-containers
|
||||||
|
, filelock
|
||||||
|
, http-conduit
|
||||||
|
, exceptions
|
||||||
|
|
||||||
|
library
|
||||||
|
import: shared-properties
|
||||||
|
|
||||||
|
exposed-modules:
|
||||||
|
HBS2.Consensus
|
||||||
|
|
||||||
|
-- other-modules:
|
||||||
|
-- other-extensions:
|
||||||
|
build-depends: base
|
||||||
|
, exceptions
|
||||||
|
, http-types
|
||||||
|
|
||||||
|
hs-source-dirs: lib
|
||||||
|
default-language: Haskell2010
|
||||||
|
|
||||||
|
executable consensus-kv
|
||||||
|
import: shared-properties
|
||||||
|
main-is: Consensus.hs
|
||||||
|
|
||||||
|
ghc-options:
|
||||||
|
-threaded
|
||||||
|
-rtsopts
|
||||||
|
"-with-rtsopts=-N4 -A64m -AL256m -I0"
|
||||||
|
|
||||||
|
other-modules:
|
||||||
|
RunShow
|
||||||
|
|
||||||
|
-- other-extensions:
|
||||||
|
build-depends:
|
||||||
|
base, hbs2-git
|
||||||
|
, optparse-applicative
|
||||||
|
, http-types
|
||||||
|
|
||||||
|
hs-source-dirs: git-hbs2
|
||||||
|
default-language: Haskell2010
|
||||||
|
|
||||||
|
|
||||||
|
executable git-remote-hbs2
|
||||||
|
import: shared-properties
|
||||||
|
main-is: GitRemoteMain.hs
|
||||||
|
|
||||||
|
ghc-options:
|
||||||
|
-threaded
|
||||||
|
-rtsopts
|
||||||
|
"-with-rtsopts=-N4 -A64m -AL256m -I0"
|
||||||
|
|
||||||
|
other-modules:
|
||||||
|
GitRemoteTypes
|
||||||
|
GitRemotePush
|
||||||
|
|
||||||
|
-- other-extensions:
|
||||||
|
build-depends:
|
||||||
|
base, hbs2-git
|
||||||
|
, async
|
||||||
|
, attoparsec
|
||||||
|
, optparse-applicative
|
||||||
|
, unix
|
||||||
|
, unliftio
|
||||||
|
, terminal-progress-bar
|
||||||
|
, http-types
|
||||||
|
|
||||||
|
hs-source-dirs: git-hbs2
|
||||||
|
default-language: Haskell2010
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
-- |HBS2.Consensus
|
||||||
|
--
|
||||||
|
-- A FSM and support routines for Tendermint with a twist.
|
||||||
|
--
|
||||||
|
-- Copyright (C) Serguey Zefirov, 2023.
|
||||||
|
|
||||||
|
module HBS2.Consensus where
|
||||||
|
|
Loading…
Reference in New Issue