user1051: Let's say I have a Plutus contract written up. How do I actually submit it to the blockchain and start interacting with it?

user1231: As Fermat said, you can follow the lobster example.
Another option is the Exercise 4 of Alonzo-testnet.
Exercise 4 - Solution
There you can find:

Compile hs file
Build script address
Build transactions to interact with the validator script
Sign transactions
Submit transactions


user2335: The plutus contract that you have written is in template haskell. Now to convert this to something that can be used on chain one needs to compiled it to plutus core.
From an educational point of view I'll explain how this is done with a concrete example. Take for example the lobster smart contract's used in naming the lobster [1]. Note that this project folder structure contains at least the following 3 files,

A .cabal file in ./
A main.hs residing in ./app/
A smart contract residing in ./src/Cardano/PlutusLobster/

Now what are those files? The .cabal file is a configuration file that tells the compiler how to build the general haskell program at hand. If you look in it you will see all the dependencies listed for building something to plutus core. Also in the end of this file there are three executable defines, that of the 3 yet to build contracts. Now in this file is also a reference to the smart contact in the ./src/... path. Lastly the .cabal file also references the main.hs files for each of those 3 to build contract. If we look into that main.hs file it is some general format that tells the compiler exactly how to compile the plutus script to plutus core (and the serialization of that).
So now you can test it out! Git clone this repo and type cabal run all to build all 3 contracts or cabal run "a name of a executable" as defined at the end of the .cabal file. This will result in 3 contracts in the /scripts/ directory. Note that building this has to be done with ghc version 8.10.4.
Hopes this helps.

1051: <p>Let's say I have a Plutus contract written up. How do I actually submit it to the blockchain and start interacting with it?</p>
 1231: <p>As Fermat said, you can follow the lobster example.</p>
<p>Another option is the Exercise 4 of Alonzo-testnet.
<a href="https://github.com/input-output-hk/Alonzo-testnet/blob/main/Alonzo-solutions/exercise4/Exercise4-solution.md" rel="noreferrer">Exercise 4 - Solution</a></p>
<p>There you can find:</p>
<ol>
<li>Compile hs file</li>
<li>Build script address</li>
<li>Build transactions to interact with the validator script</li>
<li>Sign transactions</li>
<li>Submit transactions</li>
</ol>
 2335: <p>The plutus contract that you have written is in template haskell. Now to convert this to something that can be used on chain one needs to compiled it to plutus core.</p>
<p>From an educational point of view I'll explain how this is done with a concrete example. Take for example the lobster smart contract's used in naming the lobster [<a href="https://github.com/input-output-hk/lobster-challenge" rel="nofollow noreferrer">1</a>]. Note that this project folder structure contains at least the following 3 files,</p>
<ol>
<li>A <code>.cabal</code> file in <code>./</code></li>
<li>A main.hs residing in <code>./app/</code></li>
<li>A smart contract residing in <code>./src/Cardano/PlutusLobster/</code></li>
</ol>
<p>Now what are those files? The <code>.cabal</code> file is a configuration file that tells the compiler how to build the general haskell program at hand. If you look in it you will see all the dependencies listed for building something to plutus core. Also in the end of this file there are three executable defines, that of the 3 yet to build contracts. Now in this file is also a reference to the smart contact in the <code>./src/...</code> path. Lastly the <code>.cabal</code> file also references the <code>main.hs</code> files for each of those 3 to build contract. If we look into that <code>main.hs</code> file it is some general format that tells the compiler exactly how to compile the plutus script to plutus core (and the serialization of that).</p>
<p>So now you can test it out! Git clone this repo and type <code>cabal run all</code> to build all 3 contracts or <code>cabal run &quot;a name of a executable&quot;</code> as defined at the end of the .cabal file. This will result in 3 contracts in the /scripts/ directory. Note that building this has to be done with ghc version 8.10.4.</p>
<p>Hopes this helps.</p>
