> For the complete documentation index, see [llms.txt](https://learn.onpop.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learn.onpop.io/chains/guides/launch-a-chain/running-a-post-startup-command.md).

# Running a post-startup command

Often there is a use case to run a command (or script) upon network initialization.

Say you want to fund accounts on your appchain or run a command to check account balances, Pop CLI allows you to do this via the `--cmd` option that is included in the `pop up network` command:

```
pop up network --help
```

To run a command post-initialization of the network, you can use the `--cmd` flag:

```bash
pop up ./tests/networks/pop.toml --cmd path/to/command
```

Here is an example of a simple script to update account balances on the Polkadot Relay chain:

[https://github.com/brunopgalvao/set-balance](https://github.com/brunopgalvao/set-balance/blob/main/src/main.rs)

Clone and compile the script:

```bash
git clone https://github.com/brunopgalvao/set-balance
cd set-balance
cargo build
```

Create a simple zombienet network.toml file to spin up the Polkadot Relay chain:

```bash
touch network.toml
```

```toml
[relaychain]
chain = "paseo-local"

[[relaychain.nodes]]
name = "alice"
rpc_port = 8833
validator = true

[[relaychain.nodes]]
name = "bob"
validator = true
```

Spin up the Polkadot Relay chain with Pop CLI:

```
pop up network ./network.toml -r v1.8.0 --cmd ./target/debug/set-balance
```

```
┌   Pop CLI : Launch a local network
│
◓  Spinning up network & running command: ../set-balance/target/debug/set-balance                                                                                                             Connecting to the Relay chain...
Preparing to set Alice's balance...
New balance to be set for Alice: 3000000000000000000000
Creating SUDO call to set Alice's balance...
Submitting the transaction to set Alice's balance...
◓  Spinning up network & running command: ../set-balance/target/debug/set-balance                                                                                                             Alice's balance has been successfully set to: 3000000000000000000000
◇  🚀 Network launched successfully - ctrl-c to terminate
│  ⛓️ paseo-local
│       alice:
│         portal: https://polkadot.js.org/apps/?rpc=ws://127.0.0.1:8833#/explorer
│         logs: tail -f /var/folders/vl/txnq6gdj22s9rn296z0md27w0000gn/T/zombie-4299a032-01d0-4704-9c80-64f09b387aec/alice/alice.log
│       bob:
│         portal: https://polkadot.js.org/apps/?rpc=ws://127.0.0.1:53017#/explorer
│         logs: tail -f /var/folders/vl/txnq6gdj22s9rn296z0md27w0000gn/T/zombie-4299a032-01d0-4704-9c80-64f09b387aec/bob/bob.log
│
```

Pop CLI has spun up the Polkadot network and executed the post-startup script.

Alice's account has not been funded!

<figure><img src="/files/01HuOSYP5z32ZlZjUua0" alt="" width="375"><figcaption><p>Alice Dev Account</p></figcaption></figure>

Congrats!

**Need help?**

Ask on [Polkadot Stack Exchange](https://polkadot.stackexchange.com/) (tag it [`pop`](https://substrate.stackexchange.com/tags/pop/info)) or drop by [our Telegram](https://t.me/onpopio). We're here to help!


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://learn.onpop.io/chains/guides/launch-a-chain/running-a-post-startup-command.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
