Skip to content

Commit

Permalink
feat(docs): add how to run doc
Browse files Browse the repository at this point in the history
  • Loading branch information
imsk17 committed Dec 30, 2024
1 parent c147375 commit 7861a97
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 34 deletions.
68 changes: 68 additions & 0 deletions HOW_TO_RUN.md
Original file line number Diff line number Diff line change
@@ -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
```
36 changes: 2 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7861a97

Please sign in to comment.