# Keep node "running" when I disconnect

**URL:** <https://forum.cardano.org/t/keep-node-running-when-i-disconnect/49061>\
**Category:** Operate a Stake Pool\
**Created:** [20 February 2021 18:58 UTC](https://forum.cardano.org/t/keep-node-running-when-i-disconnect/49061 "2021-02-20T18:58:36Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![LoudCloudDragon](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/loudclouddragon/32/27882_2.png) [@LoudCloudDragon](https://forum.cardano.org/u/LoudCloudDragon)\
**Post date:** [20 February 2021 18:58 UTC](https://forum.cardano.org/t/keep-node-running-when-i-disconnect/49061/1 "2021-02-20T18:58:36Z")

</div>

I am asking around a few forums and look for the info to but I am a boob with Linux. My infrastructure is in Azure and it is doing well but every time I end my ssh connect the cardano-node stops. I have to input the command again when logging back on at a later time. 💔

Is that because I am using a poor tool **Windows Terminal Preview?** I use that tool, or VS Code because I can control literally everything from one tool; PowerShell Core, Java, Azure CLI, BASH, Git, etc… 💻

I think my answer has something to do with **nhup**. I will be researching this meow but any senior guidance would save me some time and clicking about the internet like a mad man.

---

<div class="post-metadata">

**Author:** ![Freja](https://avatars.discourse-cdn.com/v4/letter/f/8e7dd6/32.png) [@Freja](https://forum.cardano.org/u/Freja)\
**Post date:** [20 February 2021 19:24 UTC](https://forum.cardano.org/t/keep-node-running-when-i-disconnect/49061/2 "2021-02-20T19:24:45Z")

</div>

Hi!  
One easy way to keep it running is to add startup-scripts for the nodes and put it in systemd, there is a [coin cashew guide](https://www.coincashew.com/coins/overview-ada/guide-how-to-build-a-haskell-stakepool-node#7-create-startup-scripts) for this if you want to read more.

---

<div class="post-metadata">

**Author:** ![\_cxh\_x](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/_cxh_x/32/29630_2.png) [@\_cxh\_x](https://forum.cardano.org/u/_cxh_x)\
**Post date:** [20 February 2021 19:25 UTC](https://forum.cardano.org/t/keep-node-running-when-i-disconnect/49061/3 "2021-02-20T19:25:01Z")

</div>

What type of system are you running? I found this site to be super helpful [Startup scripts.](https://www.coincashew.com/coins/overview-ada/guide-how-to-build-a-haskell-stakepool-node#7-create-startup-scripts)

---

<div class="post-metadata">

**Author:** ![laplasz](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/laplasz/32/15238_2.png) [@laplasz](https://forum.cardano.org/u/laplasz)\
**Post date:** [20 February 2021 21:59 UTC](https://forum.cardano.org/t/keep-node-running-when-i-disconnect/49061/4 "2021-02-20T21:59:42Z")

</div>

Hi There! I think your are looking for the `nohup` command:

```auto
nohup cardano-node run --topology configs/mainnet-topology_new.json --database-path storage/ --socket-path storage/node.socket --host-addr 127.0.0.1 --port 3001 --config ../config.json > nohup.out 2>&1 &

```

this will preserve the cardano-node process to run even the terminal session ended.  
the console log will be stored in `nohup.out` file. And the process id will be printed out right after you executed the command. But this id can be get by `ps -ef` command anytime.

---

<div class="post-metadata">

**Author:** ![godofrefuse](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/godofrefuse/32/26979_2.png) [@godofrefuse](https://forum.cardano.org/u/godofrefuse)\
**Post date:** [22 February 2021 11:32 UTC](https://forum.cardano.org/t/keep-node-running-when-i-disconnect/49061/5 "2021-02-22T11:32:10Z")

</div>

My systemd scripts arent working for some reason.

---

<div class="post-metadata">

**Author:** ![Alexd1985](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/alexd1985/32/23759_2.png) [@Alexd1985](https://forum.cardano.org/u/Alexd1985)\
**Post date:** [22 February 2021 12:02 UTC](https://forum.cardano.org/t/keep-node-running-when-i-disconnect/49061/6 "2021-02-22T12:02:50Z")

</div>

Hello,

You can start your node in a tmux session:

- create a tmux session (tmux new-session -s session\_name)
- start your node
- to exit from tmux session (press Ctrl + b d)
- to list tmux sessions (tmux ls)
- attach to tmux session (tmux attach -t session\_name)

Cheers,

---

<div class="post-metadata">

**Author:** ![godofrefuse](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/godofrefuse/32/26979_2.png) [@godofrefuse](https://forum.cardano.org/u/godofrefuse)\
**Post date:** [22 February 2021 12:29 UTC](https://forum.cardano.org/t/keep-node-running-when-i-disconnect/49061/7 "2021-02-22T12:29:43Z")

</div>

Hey Alex, thanks for the tmux tip.

Do you know why this is giving me this error?

cardano-cli query protocol-parameters  
–mainnet  
–allegra-era  
–out-file params.json

Shelley command failed: query protocol-parameters Error: A query from a certai n era was applied to a ledger from a different era: EraMismatch {ledgerEraName = “Byron”, otherEraName = “Allegra”}

What leads to this problem?

> [@Cardano-cli query protocol-parameters (query from a certain era was applied to a ledger)](https://forum.cardano.org/t/cardano-cli-query-protocol-parameters-query-from-a-certain-era-was-applied-to-a-ledger/49402):
>
> cardano-cli query protocol-parameters –mainnet –allegra-era –out-file params.json Shelley command failed: query protocol-parameters Error: A query from a certai n era was applied to a ledger from a different era: EraMismatch {ledgerEraName = “Byron”, otherEraName = “Allegra”} What leads to this problem?

---

<div class="post-metadata">

**Author:** ![Alexd1985](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/alexd1985/32/23759_2.png) [@Alexd1985](https://forum.cardano.org/u/Alexd1985)\
**Post date:** [22 February 2021 12:33 UTC](https://forum.cardano.org/t/keep-node-running-when-i-disconnect/49061/8 "2021-02-22T12:33:40Z")

</div>

The node is synced?

---

<div class="post-metadata">

**Author:** ![godofrefuse](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/godofrefuse/32/26979_2.png) [@godofrefuse](https://forum.cardano.org/u/godofrefuse)\
**Post date:** [22 February 2021 12:34 UTC](https://forum.cardano.org/t/keep-node-running-when-i-disconnect/49061/9 "2021-02-22T12:34:49Z")

</div>

yes node is synced. How do I check? It seems to be talking and running both block producer and relay.

---

<div class="post-metadata">

**Author:** ![Alexd1985](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/alexd1985/32/23759_2.png) [@Alexd1985](https://forum.cardano.org/u/Alexd1985)\
**Post date:** [22 February 2021 12:37 UTC](https://forum.cardano.org/t/keep-node-running-when-i-disconnect/49061/10 "2021-02-22T12:37:24Z")

</div>

Download this and run

> **[Crypto2099/simpleLiveView](https://github.com/Crypto2099/simpleLiveView)**
>
> Create a "Live View" for Cardano Node when running in "Simple View"

---

<div class="post-metadata">

**Author:** ![godofrefuse](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/godofrefuse/32/26979_2.png) [@godofrefuse](https://forum.cardano.org/u/godofrefuse)\
**Post date:** [22 February 2021 12:48 UTC](https://forum.cardano.org/t/keep-node-running-when-i-disconnect/49061/11 "2021-02-22T12:48:11Z")

</div>

I have it in there. But its grayed out. How do I make it green? I also have the script gLiveView.sh

---

<div class="post-metadata">

**Author:** ![Alexd1985](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/alexd1985/32/23759_2.png) [@Alexd1985](https://forum.cardano.org/u/Alexd1985)\
**Post date:** [22 February 2021 12:50 UTC](https://forum.cardano.org/t/keep-node-running-when-i-disconnect/49061/12 "2021-02-22T12:50:08Z")

</div>

Ok, start glive then, what is the output?

---

<div class="post-metadata">

**Author:** ![godofrefuse](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/godofrefuse/32/26979_2.png) [@godofrefuse](https://forum.cardano.org/u/godofrefuse)\
**Post date:** [22 February 2021 13:06 UTC](https://forum.cardano.org/t/keep-node-running-when-i-disconnect/49061/13 "2021-02-22T13:06:14Z")

</div>

> Cardano Node - (Relay - Mainnet) : 1.25.1 [9a7331cc] \<  
> ┌────────────────────────┬────────────┬────────────────────────┐  
> │ Uptime: 00:30:15 │ Port: xxxx │ Guild LiveView v1.19.4 │  
> │------------------------└────────────┴────────────────────────┤  
> │ Epoch 215 [100.0%] (node) │  
> │ 2d 08:38:51 until epoch boundary (chain) │  
> │ ▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌▌ │  
> │ │  
> │ Block : 4662244 Tip (ref) : 22432869 │  
> │ Slot : 431972 Tip (node) : 7948772 │  
> │ Density : 5.023 Status : syncing (35.4%) │  
> │--------------------------------------------------------------│  
> │ Processed TX : 0 Out / In │  
> │ Mempool TX/Bytes : 0 / 0 Peers : 1 1 │  
> └──────────────────────────────────────────────────────────────┘

---

<div class="post-metadata">

**Author:** ![Alexd1985](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/alexd1985/32/23759_2.png) [@Alexd1985](https://forum.cardano.org/u/Alexd1985)\
**Post date:** [22 February 2021 13:41 UTC](https://forum.cardano.org/t/keep-node-running-when-i-disconnect/49061/14 "2021-02-22T13:41:31Z")

</div>

your nodes are not synced, they should be in epoch 249; wait to sync

---

<div class="post-metadata">

**Author:** ![godofrefuse](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/godofrefuse/32/26979_2.png) [@godofrefuse](https://forum.cardano.org/u/godofrefuse)\
**Post date:** [22 February 2021 13:50 UTC](https://forum.cardano.org/t/keep-node-running-when-i-disconnect/49061/15 "2021-02-22T13:50:34Z")

</div>

How far away is epoch 249?

---

<div class="post-metadata">

**Author:** ![Alexd1985](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/alexd1985/32/23759_2.png) [@Alexd1985](https://forum.cardano.org/u/Alexd1985)\
**Post date:** [22 February 2021 13:53 UTC](https://forum.cardano.org/t/keep-node-running-when-i-disconnect/49061/16 "2021-02-22T13:53:17Z")

</div>

I don’t know, depends (could take more hours)… how is ur topology file? did u already modified it?  
can you show me?  
maybe will be a good idea to add the IOHK nodes back till your nodes will be synced

---

<div class="post-metadata">

**Author:** ![godofrefuse](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/godofrefuse/32/26979_2.png) [@godofrefuse](https://forum.cardano.org/u/godofrefuse)\
**Post date:** [22 February 2021 13:55 UTC](https://forum.cardano.org/t/keep-node-running-when-i-disconnect/49061/17 "2021-02-22T13:55:39Z")

</div>

{  
“Producers”: [  
{  
“addr”: “x.x.x.x”,  
“port”: xxxx,  
“valency”: 1  
}  
]  
}

---

<div class="post-metadata">

**Author:** ![Alexd1985](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/alexd1985/32/23759_2.png) [@Alexd1985](https://forum.cardano.org/u/Alexd1985)\
**Post date:** [22 February 2021 13:57 UTC](https://forum.cardano.org/t/keep-node-running-when-i-disconnect/49061/18 "2021-02-22T13:57:33Z")

</div>

{  
“Producers”: [  
{  
“addr”: “x.x.x.x”,  
“port”: xxxx,  
“valency”: 1  
},  
{  
“addr”: “[relays-new.cardano-mainnet.iohk.io](http://relays-new.cardano-mainnet.iohk.io)”,  
“port”: 3001,  
“valency”: 2  
}  
]  
}

save the file and restart your node… check if now is syncing faster

---

<div class="post-metadata">

**Author:** ![godofrefuse](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/godofrefuse/32/26979_2.png) [@godofrefuse](https://forum.cardano.org/u/godofrefuse)\
**Post date:** [22 February 2021 14:00 UTC](https://forum.cardano.org/t/keep-node-running-when-i-disconnect/49061/19 "2021-02-22T14:00:51Z")

</div>

> [@Alexd1985](#):
>
> },  
> {  
> “addr”: “[relays-new.cardano-mainnet.iohk.io](http://relays-new.cardano-mainnet.iohk.io)”,  
> “port”: 3001,  
> “valency”: 2  
> }  
> ]  
> }

How do you stop a node in tmux?

---

<div class="post-metadata">

**Author:** ![Alexd1985](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/alexd1985/32/23759_2.png) [@Alexd1985](https://forum.cardano.org/u/Alexd1985)\
**Post date:** [22 February 2021 14:02 UTC](https://forum.cardano.org/t/keep-node-running-when-i-disconnect/49061/20 "2021-02-22T14:02:05Z")

</div>

connect to tmux and press Ctrl + c to stope the node

[Next page](https://forum.cardano.org/t/keep-node-running-when-i-disconnect/49061.md?page=2)
