Giter Site home page Giter Site logo

olgaklimenko / donat-pool-offchain Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fullstack-development/donat-pool-offchain

0.0 0.0 0.0 2.79 MB

Shell 0.68% JavaScript 2.38% TypeScript 3.27% PureScript 85.00% Nix 3.22% Makefile 0.25% HTML 0.12% Dhall 5.08%

donat-pool-offchain's Introduction

DonatPool Offchain project based on Cardano-Transaction-Lib

The repo contains the offchain part for the DonatPool onchain project. Here you may find transaction builders (including all the offchain checks), simplified frontend (buttons to call the endpoints) and a bunch of unit tests and e2e plutip tests.

You may find the current project working in the PreProduction testnet on the DonatPool website.

To start working clone the repository, go to the project root and run nix develop (make sure to use Nix v2.8 or later) and then build the project with spago build.

DonatPool Project environment

DonationPool is dependent on the services listed below, so for working in blockchain you need them all installed and run on you host-machine. The services you need:

  • Cardano node
  • Ogmios
  • Kupo

Also before starting make sure to have files with plutus scripts in the scripts/ folder.

Running in Pre-Production testnet

  1. The project runtime dependencies are settled in the docker-compose file, so to run Cardano node, Ogmios and Kupo just type
docker-compose up -d

in terminal opened from the project root

  1. Create new dist for frontend:

Run sh build.sh from project root

  1. Run server

First make sure to run the runtime dependencies. Than open terminal from the project root and type npm install to create node modules (make sure to do it not under nix develop). Than build the project with spago build (under nix develop) and then create new dists (sh build.sh under nix develop). You may run the server on port 4008 with npm run serve command (under nix develop as well). Then go to localhost:4008 with the Chrome browser and explore.

Note that the current PreProduction testnet offchain version functionality is available for Chrome browser with installed Nami, Lode, Eternl or Flint light wallet extensions. To test it make sure to switch on the PreProduction testnet network in light wallet extension (i.e. for Nami: Nami -> Settings -> Network -> Preprod), you also have to lock 5 Ada as collateral (i.e. for Nami: Nami -> Collateral -> Confirm).

Tests

To run Unit tests type npm run unit-tests from the project root (under nix develop) To run Plutip tests type npm run plutip-tests from the project root (under nix develop)

Code formatting

make format

TO run from CLI:

  1. Start ogmios + cardano node docker container and kupo.

  2. Enter cardano-node-ogmios container and make payment and stake keys:

cardano-cli address key-gen  --verification-key-file payment.vkey --signing-key-file payment.skey
cardano-cli stake-address key-gen --verification-key-file stake.vkey --signing-key-file stake.skey
  1. Copy private keys to wallet directory in the project. On the first start contract will fail, because no utxo on the new wallet. Use wallet address from logs to receive TADA from faucet or another wallet.

  2. Deploy automatic scripts:

  • Remove old node-modules and run npm i
  • Run nix develop
  • Run sh bundle-apps.sh, it will create .js files in dist directory
  • To start Protocol run: npm run start-protocol. In result of this script, protocol token will be written to the dist/protocol.local.conf file.
  • To update Protocol edit conf/config.local.conf with new values, then run: npm run update-protocol.
  • To close Protocol run: npm run close-protocol

donat-pool-offchain's People

Contributors

katebushueva avatar olgaklimenko avatar olegromashin avatar alagunoff avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.