<p>A local testnet can easily be deployed in the babbage era via the following script in the node repository <a href="https://github.com/input-output-hk/cardano-node/blob/master/scripts/babbage/mkfiles.sh" rel="nofollow noreferrer">(1)</a>. This method requires you to quickly sequence some commands. This is due to <a href="https://github.com/input-output-hk/cardano-node/blob/edbef89ddced36b622423bed25281d12b0c116b7/scripts/babbage/mkfiles.sh#L38" rel="nofollow noreferrer">this</a> and failing to launch the stake pools within the 30 seconds will result in not correctly deploying the testnet. I think you can change the 30 <code>start_time</code> yourself to overcome this. The scripts also assumes that the <code>cardano-node</code> and <code>cardano-cli</code> binaries are in your path. Personally, I just enter a nix-shell in the node repository to have these available.</p>
<p>To use this script, you must run it from the <code>cardano-node/</code> directory via the command</p>
<pre><code>./scripts/babbage/mkfiles.sh
</code></pre>
<p>This will create the directory <code>cardano-node/example</code>. In this folder, there are three other scripts that each deploy a stake pool for the testnet (<code>node-spo*.sh</code>). These need to be deployed before the <code>start_time</code> (30 seconds from the <code>mkfiles.sh</code> script execution), so it is good practice to have 3 terminals ready. These <code>node-spo*.sh</code> scripts also need to be executed from the <code>cardano-node/</code> directory, not the <code>cardano-node/example/</code> directory. This is because there are some file structures hard-coded in the scripts. To launch the first stake pool, execute the command,</p>
<pre><code>./example/node-spo1.sh
</code></pre>
<p>Do the same for <code>node-spo2.sh</code> and <code>node-spo3.sh</code>. The testnet is now running!</p>
<p>The example folder contains the following files. Most notably, you have geneses UTxO keys in the <code>example/utxo-keys/</code> folder, where the address can be derived via the command,</p>
<pre><code>cardano-cli genesis initial-addr --verification-key-file utxo-keys/utxo1.vkey --testnet-magic 42
</code></pre>
<pre><code>.
├── byron-gen-command
│   ├── genesis-keys.000.key
│   ├── genesis-keys.001.key
│   └── genesis-keys.002.key
├── byron.genesis.spec.json
├── configuration.yaml
├── delegate-keys
│   ├── delegate1.counter
│   ├── delegate1.kes.skey
│   ├── delegate1.kes.vkey
│   ├── delegate1.skey
│   ├── delegate1.vkey
│   ├── delegate1.vrf.skey
│   ├── delegate1.vrf.vkey
│   ├── delegate2.counter
│   ├── delegate2.kes.skey
│   ├── delegate2.kes.vkey
│   ├── delegate2.skey
│   ├── delegate2.vkey
│   ├── delegate2.vrf.skey
│   ├── delegate2.vrf.vkey
│   ├── delegate3.counter
│   ├── delegate3.kes.skey
│   ├── delegate3.kes.vkey
│   ├── delegate3.skey
│   ├── delegate3.vkey
│   ├── delegate3.vrf.skey
│   ├── delegate3.vrf.vkey
│   ├── opcert1.cert
│   ├── opcert2.cert
│   └── opcert3.cert
├── genesis
│   ├── byron
│   │   └── genesis.json
│   └── shelley
│       ├── genesis.alonzo.json
│       └── genesis.json
├── genesis.alonzo.spec.json
├── genesis-keys
│   ├── genesis1.skey
│   ├── genesis1.vkey
│   ├── genesis2.skey
│   ├── genesis2.vkey
│   ├── genesis3.skey
│   └── genesis3.vkey
├── genesis.spec.json
├── main.sock -&gt; node-spo1/node.sock
├── node-spo1
│   ├── byron-delegate.key
│   ├── byron-delegation.cert
│   ├── db
│   │   ├── immutable
│   │   │   ├── 00000.chunk
│   │   │   ├── 00000.primary
│   │   │   └── 00000.secondary
│   │   ├── ledger
│   │   ├── lock
│   │   ├── protocolMagicId
│   │   └── volatile
│   │       └── blocks-0.dat
│   ├── kes.skey
│   ├── node.log
│   ├── node.sock
│   ├── opcert.cert
│   ├── port
│   ├── topology.json
│   └── vrf.skey
├── node-spo1.sh
├── node-spo2
│   ├── byron-delegate.key
│   ├── byron-delegation.cert
│   ├── db
│   │   ├── immutable
│   │   │   ├── 00000.chunk
│   │   │   ├── 00000.primary
│   │   │   └── 00000.secondary
│   │   ├── ledger
│   │   ├── lock
│   │   ├── protocolMagicId
│   │   └── volatile
│   │       └── blocks-0.dat
│   ├── kes.skey
│   ├── node.log
│   ├── node.sock
│   ├── opcert.cert
│   ├── port
│   ├── topology.json
│   └── vrf.skey
├── node-spo2.sh
├── node-spo3
│   ├── byron-delegate.key
│   ├── byron-delegation.cert
│   ├── db
│   │   ├── immutable
│   │   │   ├── 00000.chunk
│   │   │   ├── 00000.primary
│   │   │   └── 00000.secondary
│   │   ├── ledger
│   │   ├── lock
│   │   ├── protocolMagicId
│   │   └── volatile
│   │       └── blocks-0.dat
│   ├── kes.skey
│   ├── node.log
│   ├── node.sock
│   ├── opcert.cert
│   ├── port
│   ├── topology.json
│   └── vrf.skey
├── node-spo3.sh
├── pools
│   ├── cold1.skey
│   ├── cold1.vkey
│   ├── cold2.skey
│   ├── cold2.vkey
│   ├── cold3.skey
│   ├── cold3.vkey
│   ├── kes1.vkey
│   ├── kes2.vkey
│   ├── kes3.vkey
│   ├── opcert1.counter
│   ├── opcert2.counter
│   ├── opcert3.counter
│   ├── staking-reward1.skey
│   ├── staking-reward1.vkey
│   ├── staking-reward2.skey
│   ├── staking-reward2.vkey
│   ├── staking-reward3.skey
│   ├── staking-reward3.vkey
│   ├── vrf1.vkey
│   ├── vrf2.vkey
│   └── vrf3.vkey
├── run
│   └── all.sh
├── stake-delegator-keys
│   ├── payment1.skey
│   ├── payment1.vkey
│   ├── payment2.skey
│   ├── payment2.vkey
│   ├── payment3.skey
│   ├── payment3.vkey
│   ├── staking1.skey
│   ├── staking1.vkey
│   ├── staking2.skey
│   ├── staking2.vkey
│   ├── staking3.skey
│   └── staking3.vkey
└── utxo-keys
    ├── utxo1.skey
    ├── utxo1.vkey
    ├── utxo2.skey
    ├── utxo2.vkey
    ├── utxo3.skey
    └── utxo3.vkey
</code></pre>
<hr />
<p><strong>EDIT:</strong> Recently the <code>example/run/all.sh</code> has been added to the repo, this lets you run all three <code>example/node-spo*.sh</code> all at once.</p>

CC BY-SA 4.0
2022-08-09T14:14:27.637Z
2022-08-25T06:28:16.313Z
2022-08-25T06:28:16.313Z
Fermat
<p>To test plutus scripts and transactions, I want to have a lightweight environment which I can use when I have no internet. So, how can I deploy a local testnet in the Babbage era for testing?</p>

<plutus><stake-pool><testnet>
Deploy a local testnet
# Deploy a local testnet

(Asked by: username_0 on 2022-08-09)

To test plutus scripts and transactions, I want to have a lightweight environment which I can use when I have no internet. So, how can I deploy a local testnet in the Babbage era for testing?

**Tags:** plutus, stake-pool, testnet

---

## 1 answers

### Answer by username_0 on 2022-08-09. Score: 1 | Accepted answer

A local testnet can easily be deployed in the babbage era via the following script in the node repository (1). This method requires you to quickly sequence some commands. This is due to this and failing to launch the stake pools within the 30 seconds will result in not correctly deploying the testnet. I think you can change the 30 start_time yourself to overcome this. The scripts also assumes that the cardano-node and cardano-cli binaries are in your path. Personally, I just enter a nix-shell in the node repository to have these available.
To use this script, you must run it from the cardano-node/ directory via the command
./scripts/babbage/mkfiles.sh

This will create the directory cardano-node/example. In this folder, there are three other scripts that each deploy a stake pool for the testnet (node-spo*.sh). These need to be deployed before the start_time (30 seconds from the mkfiles.sh script execution), so it is good practice to have 3 terminals ready. These node-spo*.sh scripts also need to be executed from the cardano-node/ directory, not the cardano-node/example/ directory. This is because there are some file structures hard-coded in the scripts. To launch the first stake pool, execute the command,
./example/node-spo1.sh

Do the same for node-spo2.sh and node-spo3.sh. The testnet is now running!
The example folder contains the following files. Most notably, you have geneses UTxO keys in the example/utxo-keys/ folder, where the address can be derived via the command,
cardano-cli genesis initial-addr --verification-key-file utxo-keys/utxo1.vkey --testnet-magic 42

.
├── byron-gen-command
│   ├── genesis-keys.000.key
│   ├── genesis-keys.001.key
│   └── genesis-keys.002.key
├── byron.genesis.spec.json
├── configuration.yaml
├── delegate-keys
│   ├── delegate1.counter
│   ├── delegate1.kes.skey
│   ├── delegate1.kes.vkey
│   ├── delegate1.skey
│   ├── delegate1.vkey
│   ├── delegate1.vrf.skey
│   ├── delegate1.vrf.vkey
│   ├── delegate2.counter
│   ├── delegate2.kes.skey
│   ├── delegate2.kes.vkey
│   ├── delegate2.skey
│   ├── delegate2.vkey
│   ├── delegate2.vrf.skey
│   ├── delegate2.vrf.vkey
│   ├── delegate3.counter
│   ├── delegate3.kes.skey
│   ├── delegate3.kes.vkey
│   ├── delegate3.skey
│   ├── delegate3.vkey
│   ├── delegate3.vrf.skey
│   ├── delegate3.vrf.vkey
│   ├── opcert1.cert
│   ├── opcert2.cert
│   └── opcert3.cert
├── genesis
│   ├── byron
│   │   └── genesis.json
│   └── shelley
│       ├── genesis.alonzo.json
│       └── genesis.json
├── genesis.alonzo.spec.json
├── genesis-keys
│   ├── genesis1.skey
│   ├── genesis1.vkey
│   ├── genesis2.skey
│   ├── genesis2.vkey
│   ├── genesis3.skey
│   └── genesis3.vkey
├── genesis.spec.json
├── main.sock -> node-spo1/node.sock
├── node-spo1
│   ├── byron-delegate.key
│   ├── byron-delegation.cert
│   ├── db
│   │   ├── immutable
│   │   │   ├── 00000.chunk
│   │   │   ├── 00000.primary
│   │   │   └── 00000.secondary
│   │   ├── ledger
│   │   ├── lock
│   │   ├── protocolMagicId
│   │   └── volatile
│   │       └── blocks-0.dat
│   ├── kes.skey
│   ├── node.log
│   ├── node.sock
│   ├── opcert.cert
│   ├── port
│   ├── topology.json
│   └── vrf.skey
├── node-spo1.sh
├── node-spo2
│   ├── byron-delegate.key
│   ├── byron-delegation.cert
│   ├── db
│   │   ├── immutable
│   │   │   ├── 00000.chunk
│   │   │   ├── 00000.primary
│   │   │   └── 00000.secondary
│   │   ├── ledger
│   │   ├── lock
│   │   ├── protocolMagicId
│   │   └── volatile
│   │       └── blocks-0.dat
│   ├── kes.skey
│   ├── node.log
│   ├── node.sock
│   ├── opcert.cert
│   ├── port
│   ├── topology.json
│   └── vrf.skey
├── node-spo2.sh
├── node-spo3
│   ├── byron-delegate.key
│   ├── byron-delegation.cert
│   ├── db
│   │   ├── immutable
│   │   │   ├── 00000.chunk
│   │   │   ├── 00000.primary
│   │   │   └── 00000.secondary
│   │   ├── ledger
│   │   ├── lock
│   │   ├── protocolMagicId
│   │   └── volatile
│   │       └── blocks-0.dat
│   ├── kes.skey
│   ├── node.log
│   ├── node.sock
│   ├── opcert.cert
│   ├── port
│   ├── topology.json
│   └── vrf.skey
├── node-spo3.sh
├── pools
│   ├── cold1.skey
│   ├── cold1.vkey
│   ├── cold2.skey
│   ├── cold2.vkey
│   ├── cold3.skey
│   ├── cold3.vkey
│   ├── kes1.vkey
│   ├── kes2.vkey
│   ├── kes3.vkey
│   ├── opcert1.counter
│   ├── opcert2.counter
│   ├── opcert3.counter
│   ├── staking-reward1.skey
│   ├── staking-reward1.vkey
│   ├── staking-reward2.skey
│   ├── staking-reward2.vkey
│   ├── staking-reward3.skey
│   ├── staking-reward3.vkey
│   ├── vrf1.vkey
│   ├── vrf2.vkey
│   └── vrf3.vkey
├── run
│   └── all.sh
├── stake-delegator-keys
│   ├── payment1.skey
│   ├── payment1.vkey
│   ├── payment2.skey
│   ├── payment2.vkey
│   ├── payment3.skey
│   ├── payment3.vkey
│   ├── staking1.skey
│   ├── staking1.vkey
│   ├── staking2.skey
│   ├── staking2.vkey
│   ├── staking3.skey
│   └── staking3.vkey
└── utxo-keys
    ├── utxo1.skey
    ├── utxo1.vkey
    ├── utxo2.skey
    ├── utxo2.vkey
    ├── utxo3.skey
    └── utxo3.vkey


EDIT: Recently the example/run/all.sh has been added to the repo, this lets you run all three example/node-spo*.sh all at once.


---

