# Deploy Tonomy ID

Deployment of the full Tonomy ID involves several integrated services and is **expected to take several hours for someone not familiar with the system**

Please [contact us](https://pangea.web4.world/contact-us) for assistance in your on-site deployment, or to help run a fully managed service with updates.

## Prerequisites

* Tonomy ID services run exclusively in `Linux`, we recommend Ubuntu 20.04 or 22.04.
* `npm` with `corepack enabled`, we recommend v18.12.1. Suggested to install with nvm v0.35+

## Services to run Tonomy ID

* Tonomy ID (React Native mobile wallet) - [Github source](https://github.com/Tonomy-Foundation/Tonomy-ID/tree/master)
* Tonomy Account Website (Reactjs) - [Github source](https://github.com/Tonomy-Foundation/Tonomy-App-Websites/tree/master)
* Blockchain and `tonomy` smart contracts (Antelope protocol) - [Github source](https://github.com/Tonomy-Foundation/Tonomy-Contracts/tree/master)
* Tonomy Communication (nestjs) - [Github source](https://github.com/Tonomy-Foundation/Tonomy-Communication/tree/master)

## Deployment

### Locally

The easiest way is to use the automated scripts with the [Tonomy-ID-Integration repository](https://github.com/Tonomy-Foundation/Tonomy-ID-Integration/tree/master)

Check the `README.md` for dependencies and instructions.

```bash
git clone https://github.com/Tonomy-Foundation/Tonomy-ID-Integration
cd Tonomy-ID-Integration
./app.sh gitinit
./app.sh install
./app.sh init
./app.sh start
```

### On-site / cloud

We suggest that you look at the `./app.sh` and `./scripts/helpers.sh` files in the [Tonomy-ID-Integration repository](https://github.com/Tonomy-Foundation/Tonomy-ID-Integration/tree/master) to get an idea of how to run and bootstrap the network.

Read the `README.md` for each of the services before you start!

Then you will need to deploy each service, with configuration so that they connect with each other:

1. Deploy an and initialize an Antelope blockchain - see the [official Antelope node guide](https://docs.eosnetwork.com/docs/latest/node-operation/getting-started/)
   * For a production grade network, we suggest 3 nodes if run by the same entity, or 5 nodes if run by separate entities
   * For maximum scaleability, run using bare-metal servers.
   * Please [contact us](https://pangea.web4.world/contact-us) for assistance running a production Antelope network or setting up governance.
2. Create the `eosio.token` account on the blockchain
3. Deploy the [eosio.token](https://github.com/Tonomy-Foundation/Tonomy-Contracts/tree/master/contracts/eosio.token) contract to the `eosio.token` account on the blockchain
4. Create a new currency with a total supply using the `create()` function
5. Issue a specific amount of the newly created currency to the 'eosio.token' account using the `issue()` function
6. Create the `id.tmy` account on the blockchain
7. Deploy the [id.tmy](https://github.com/Tonomy-Foundation/Tonomy-Contracts/tree/master/contracts/tonomy) contract to the `id.tmy` account on the blockchain
8. [Register your applications](https://docs.tonomy.io/build-web4-apps/register-app) that you wish to connect to Tonomy ID
9. Configure the software with the `config.json` file in the repository so that they are connected correctly using your domains, and to white-label the applications:
   * Copy the following files and use environment variables to change which configuration file is used
   * [Tonomy ID config.json](https://github.com/Tonomy-Foundation/Tonomy-ID/blob/master/src/config/config.production.json)
   * [Tonomy App Websites config.json](https://github.com/Tonomy-Foundation/Tonomy-App-Websites/blob/master/src/common/config/config.production.json)
   * [Tonomy Communication config.json](https://github.com/Tonomy-Foundation/Tonomy-Communication/blob/master/src/config/config.production.json)
10. Create a new Google Play store and Apple App store listing.
11. Use [Expo](https://expo.dev) or [Expo Application Services](https://expo.dev/eas) to build Tonomy ID and submit it to your app store listings.
12. Deploy [Tonomy App Websites](https://github.com/Tonomy-Foundation/Tonomy-App-Websites/tree/master)
    * You need to use the `accounts.` subdomain to run the Tonomy Accounts website
    * You need to use the `demo.` subdomain to run the Tonomy Demo website
13. Deploy [Tonomy Communication](https://github.com/Tonomy-Foundation/Tonomy-Communication/tree/master)

#### (Optional) Sign blockchain transactions in your apps

If you want to have your applications sign blockchain transactions, see[ Sign a blockchain transaction ](https://docs.tonomy.io/build-web4-apps/usage/usage)for how to configure your smart contracts.

#### (Optional) Run the [Demo website](https://docs.tonomy.io/run-tonomy-gov-os/broken-reference)

To run the [Demo website](https://github.com/Tonomy-Foundation/Tonomy-ID-SDK/blob/feature/339-migrate-docs/examples/README.md#tonomy-demo-integration-application)[ ](https://docs.tonomy.io/run-tonomy-gov-os/broken-reference)in your network follow these extra steps:

1. [Register the application](https://docs.tonomy.io/build-web4-apps/register-app) using the domain you wish to run the Demo website from
2. Deploy the [demo.tmy](https://github.com/Tonomy-Foundation/Tonomy-Contracts/tree/master/contracts/demo.tmy) contract to the `demo.tmy` account (or modify the Demo website to connect to a different account)
3. Call `addperm()` function with the account name of the registered Demo application (Step 1)
4. Create dummy accounts as shown in the [bootstrap script here](https://github.com/Tonomy-Foundation/Tonomy-ID-SDK/blob/9061250ffceeddbbbf183a6ea03dfe7d5e1685c0/src/cli/bootstrap/bootstrap.ts#L88)
