Skip to content

Latest commit

 

History

History
74 lines (46 loc) · 3.58 KB

README.md

File metadata and controls

74 lines (46 loc) · 3.58 KB

GovTool Backend

This is a backend application of GovTool project.

Prerequisites

In order to run backend your host machine will need access to the cardano-db-sync postgres database. To have this database running locally you'll need:

  • cardano-node
  • cardano-db-sync
  • PostgreSQL database

You will need your cardano-node and cardano-db-sync to be compatible with Sancho testnet. Until these features will be merged to the master branch the new Sancho compatible versions are available as releases on github. You will also need a correct cardano-node version. The release notes for cardano-db-sync usualy specify that.

cardano-db-sync documentation

cardano-db-sync documentation (with docker)

cardano-node documentation

sancho testnet config files

You can utilize the docker-compose.node+dbsync.yml file to setup the required services.

Using Nix and Direnv

Due to problems with openapi3 package it's hard to build this project with plain ghc and cabal-install. Until the prolem is solved we reccomend using nix - this problem is fixed when you build your project from inside of the nix shell.

  1. Get Nix.

  2. Get direnv.

  3. Enter govtool/backend directory:

    cd govtool/backend
  4. Allow direnv to setup your environment:

    direnv allow
  5. Update cabal & build project

    cabal update
    cabal build all
  6. Create a config file. You can use example-config.json as a template.

  7. Run project

    cabal run vva-be -- --config <YOUR CONFIG FILE> start-app

Warning

In the context of our ongoing project enhancements, it is assumed that the executable previously known as 'vva-be' should be now officially renamed to 'govtool-backend'. This change is necessary for aligning with the updated branding and functional scope of the application and it has to be implemented in the near future as a chore and refactoring ticket. Make sure that the documentation matches the actual name of the executable.

Development

Linter

In the development environment in Nix, the hlint tool is readily available to verify Haskell files.

By using hlint, developers can ensure that their code adheres to best practices and follows appropriate guidelines. By incorporating hlint into the development process, developers can catch potential errors and make necessary improvements early on, ultimately leading to more efficient and robust software development.

Formatter

To easily format Haskell code, ensuring consistency and readability across the codebase the stylish-haskell formatter has been introduced into the nix configuration.

Developers can streamline the process of formatting their code, reducing the time and effort required for manual formatting.

HLS

Developers can use the IDE integrations for Language Server Protocol (LSP) by utilising the Haskell-Language-Server that include support for GHC 9.2.7. Using such integration, developers can ensure a seamless and efficient experience with Haskell code in their IDE.