# Deploying Smart Contracts

After preparing your development environment and testing your smart contracts, the subsequent step is deploying them on the Cosmos blockchain. This section will provide you with a guided walkthrough of the deployment process. For testing purposes, consider deploying on a dedicated testnet like Gaia Testnet.

## Prerequisites

Before deploying your smart contracts, ensure you have completed these steps:

* [Setting Up Your Environment](/nomos-1/readme/getting-started/setting-up-your-environment.md)
* Possessing a Cosmos wallet with an adequate balance on the chain intended for deployment

## Deployment Steps

Execute these steps to deploy your smart contracts:

1. **Compile Contracts (if not done already)**:

   If you haven't compiled your contracts yet, you can do so using the following command:

   ```sh
   cd contracts/factory && archway build --optimize
   ```
2. **Store the contracts bytecode on archway**:

   The blockchain doesn't creates instances at once. First, you need to store the contract byte code to do so.

   ```sh
   archway store
   ```
3. **Instantiate the factory contract:**

   You will need to instantiate the factory contract before starting working with our systems.

   ```sh
   archway instantiate --args '{"code_id": 123}'
   ```
4. **Deploy a multisig:**

   Once you've created a factory instance, you are ready to create multisig instances. Go to the multisig folder and deploy its byte code:

   ```
   cd contracts/factory && archway build --optimize
   ```

   Then store the byte code:

   ```
   archway store
   ```

   You should get a **code id** from the console, you will use this to deploy a multisig from the factory.


---

# Agent Instructions: 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:

```
GET https://nomos-docs.gitbook.io/nomos-1/readme/getting-started/deploying-smart-contracts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
