diff --git a/HOW_TO_RUN.md b/HOW_TO_RUN.md new file mode 100644 index 0000000..762f1b2 --- /dev/null +++ b/HOW_TO_RUN.md @@ -0,0 +1,68 @@ +# How to run the validator + +#### There are two ways about it - + +1. **Using Docker** + To Deploy the validator using docker, you need to have docker installed on your machine. If you don't have docker installed, you can download it from [here](https://docs.docker.com/get-docker/). + + Follow these steps to deploy the validator using docker: + + - pull the docker image from ghcr.io + + ```bash + docker pull ghcr.io/xp-network/decentralized-bridge-validator:main + ``` + + - initialize the database and the secrets.json file + + ```bash + touch validator.db + touch secrets.json + ``` + + - create a .env file and add the environment variables + + ```bash + cp .env.example .env + ``` + + - run the docker container + + ```bash + docker run -d -v $(pwd)/secrets.json:/app/secrets.json -v $(pwd)/.env:/app/.env -v $(pwd)/validator.db:/app/validator.db ghcr.io/xp-network/decentralized-bridge-validator:main + ``` + +2. **Local Deployment** + To deploy the validator locally, you need to have nodejs installed on your machine. If you don't have nodejs installed, you can download it from [here](https://nodejs.org/en/download/). + + Follow these steps to deploy the validator locally: + + - clone the repository + + ```bash + git clone https://github.com/XP-NETWORK/decentralized-bridge-validator -b main validator + ``` + + - enter the directory + + ```bash + cd validator + ``` + + - install the dependencies + + ```bash + yarn + ``` + + - create a .env file and add the environment variables + + ```bash + cp .env.example .env + ``` + + - start the validator + + ```bash + yarn dev + ``` diff --git a/README.md b/README.md index 3bd609d..18d7f03 100644 --- a/README.md +++ b/README.md @@ -10,41 +10,9 @@ This project aims to create a decentralized bridge that facilitates the transfer - **Configurable Chain Support**: Easily add support for new blockchain networks through configurable chain implementations. - **Automated Build and Formatting**: Streamlined development process with automated build and code formatting scripts. -## Getting Started - -Follow these steps to get the project up and running on your local machine: - -1. **Clone the Repository**: -```shell -git clone https://github.com/XP-NETWORK/decentralized-bridge-validator.git -``` -2. **Install Dependencies**: -```shell -cd decentralized-bridge-validator -yarn -``` -3. **Build the Project**: -```shell -yarn build -``` -4. **Configure Secrets**: -Update the `secrets.example.json` file with your private keys, addresses, and other sensitive information, then rename it to `secrets.json`. -5. **Running the project**: - - *for dev enviroment* - ```shell - yarn dev - ``` - *for prod enviroment* - ```shell - node dist/index.js - ``` - Use the --testnet flag to run the project on the testnet environment. - - - - +## How to run +Follow these steps mentioned in the [HOW_TO_RUN.md](HOW_TO_RUN.md) file to run the project. ## Project Structure