<p>This is my understanding.
the runEmulatorTraceIO was executing transactions on an &quot;Emulated chain&quot; and &quot;Emulated Wallet&quot; and had did not interact with the outside world or real Cardano Blockchain in testnet or mainnet (did not interact with outside endpoint).</p>
<p>The contract application containing business logic is written in Haskell has to run on a user computer and only the validator script written in Plutus runs is executed by the Cardano nodes. As per the blog <a href="https://iohk.io/en/blog/posts/2021/10/28/plutus-application-backend-pab-supporting-dapp-development-on-cardano/" rel="nofollow noreferrer">PAB : Supporting dApp</a></p>
<p>The PAB helps with building the UTXO transactions in two ways:</p>
<ul>
<li>Read path - That is, getting information from the chain, and reacting to events that happen on the blockchain.</li>
<li>Write path - This is where we actually construct the transactions that run the Plutus scripts</li>
</ul>
<p>PAB thus provides means to interact with blockchain as if it is a file using the Haskell program and also helps to interact with the wallet.</p>

CC BY-SA 4.0
2021-12-01T09:22:04.757Z
Ok, so the emulator trace can be setup with a predefined set of transactions and then run. But it cannot be started and then execute transactions on the go.
Jey
CC BY-SA 4.0
2021-12-01T06:44:22.830Z
2021-12-01T06:44:22.830Z
raghu
<p>We can test Plutus smart contracts using <code>runEmulatorTraceIO</code> which emulates a blockchain and serves as an entry point to post transactions on it (or did I get this wrong?).</p>
<p>So if I can fully test my smart contracts only using <code>runEmulatorTraceIO</code> why do I need the PAB ? If the PAB is necessary to interact with the blockchain, why can I test my contracts without it ?</p>
<p>The purpose of the PAB has not been explained in a clear way, I think. I have tried to get information from the Plutus Pioneer Programm, IOHK and other sources but I'm still confused.</p>

<plutus><pab>
Why do we need the PAB and how does it work?
# Why do we need the PAB and how does it work?

(Asked by: username_0 on 2021-11-30)

We can test Plutus smart contracts using `runEmulatorTraceIO` which emulates a blockchain and serves as an entry point to post transactions on it (or did I get this wrong?).

So if I can fully test my smart contracts only using `runEmulatorTraceIO` why do I need the PAB ? If the PAB is necessary to interact with the blockchain, why can I test my contracts without it ?

The purpose of the PAB has not been explained in a clear way, I think. I have tried to get information from the Plutus Pioneer Programm, IOHK and other sources but I'm still confused.

**Tags:** plutus, pab

---

## 1 answers

### Answer by username_1 on 2021-12-01. Score: 4

This is my understanding.
the runEmulatorTraceIO was executing transactions on an "Emulated chain" and "Emulated Wallet" and had did not interact with the outside world or real Cardano Blockchain in testnet or mainnet (did not interact with outside endpoint).

The contract application containing business logic is written in Haskell has to run on a user computer and only the validator script written in Plutus runs is executed by the Cardano nodes. As per the blog [PAB : Supporting dApp](https://iohk.io/en/blog/posts/2021/10/28/plutus-application-backend-pab-supporting-dapp-development-on-cardano/)

The PAB helps with building the UTXO transactions in two ways:

* Read path - That is, getting information from the chain, and reacting to events that happen on the blockchain.
* Write path - This is where we actually construct the transactions that run the Plutus scripts

PAB thus provides means to interact with blockchain as if it is a file using the Haskell program and also helps to interact with the wallet.

> **Comments:**
> **username_0**: Ok, so the emulator trace can be setup with a predefined set of transactions and then run. But it cannot be started and then execute transactions on the go.  

---

