0

I have completed the pioneer program and am writing my own app. I've created my react front end and now am trying to serialize my smart contract in Haskell for a minting policy I wrote. The problem I am having is I believe I am unable to get the Plutus library installed correctly. I did a cabal update then cabal init to get cabal in my program. I then pretty much copied the cabal configuration from Week05 in the pioneer program with some slight modifications in to my project. See below

cabal-version:      2.4
name:               
version:            0.1.0.0
synopsis:           
license:            Apache-2.0
build-type:         Simple

extra-source-files:
   CHANGELOG.md
   README.md

common common-all
    build-depends:    base ^>=4.14.3.0
                , aeson
                , bytestring
                , containers
                , cardano-api
                , data-default
                , plutus-ledger-api
                , plutus-tx-plugin
                , plutus-tx
                , text
                , serialise
                , utilities
default-language: Haskell2010
ghc-options: -Wall -fobject-code -fno-ignore-interface-pragmas
             -fno-omit-interface-pragmas -fno-strictness 
             -fno-spec-constr -fno-specialise -fexpose-all-unfoldings
             -fplugin-opt PlutusTx.Plugin:defer-errors



library 
import:             common-all
hs-source-dirs:     app
exposed-modules:    TC_Contract

I have an app folder where I have TC_Contract.hs so I belivee I have everything I need setup correctly in the cabal configuration.

when I try to use the cabal repl command I get enter image description here

The error says it cannot find plutus-ledger-api which is in the cabal file. If I comment out plutus-ledger-api then it does to the next one on the list of build-depends. It is like I am missing a reference to something but I don't know where. I think I am missing some information on how I actually get Plutus in my project. I've built a cabal file for a standard haskell program without a problem and the cabal files in the pioneer program were already complete. Confused on what to do. Does anyone have any ideas? Thanks.

Oh also as I note I copied the Utilities folder into my dapp from the pioneer program code as there was a lot of useful functions in there. It is strange that file had its own cabal file as well. Not sure if that is creating a problem as well.

1 Answer 1

2

Someone mentioned something to me on the Cardano discord that I needed my cabal.project file. I guess for some reason using cabal init doesn't put it in there? Anyway, after I put that file in there and configured it everything built properly.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.