> For the complete documentation index, see [llms.txt](https://docs.dotone.online/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.dotone.online/documentation/dat-wan-asmart-chyn-or-dotone-smart-chain-docs/aatbarsnj/run-validator-or-dotone-smart-chain-docs.md).

# Run Validator | Dotone Smart Chain Docs

## الزامات سخت‌افزاری

### Mainnet

| مؤلفه | مشخصات                                                                                                                      |
| ----- | --------------------------------------------------------------------------------------------------------------------------- |
| CPU   | پردازنده سروری پرقدرت و High-performance؛ توصیه می‌شود HyperThreading غیرفعال باشد؛ برای دستیابی به بیش از ۱۰٪ بهبود عملکرد |
| حافظه | ۱۲۸ گیگابایت RAM                                                                                                            |
| دیسک  | ۷ ترابایت NVMe SSD؛ با 40k IOPS، توان انتقال 500 MB/s و تأخیر خواندن کمتر از ۱ میلی‌ثانیه                                   |
| شبکه  | پهنای باند حداقل 512 Mbps                                                                                                   |

> عملکرد دیسک اهمیت بسیار بالایی دارد. NVMe را با SSD معمولی یا HDD جایگزین نکنید؛ چون این کار روی سرعت Sync شدن نود و تولید بلاک تأثیر منفی می‌گذارد.

### Testnet

| مؤلفه | مشخصات                                             |
| ----- | -------------------------------------------------- |
| CPU   | AMD نسل ۳ یا جدیدتر / Intel Ice Lake یا جدیدتر     |
| حافظه | ۱۶ گیگابایت RAM                                    |
| دیسک  | ۱.۵ ترابایت SSD؛ با 8k IOPS و توان انتقال 250 MB/s |
| شبکه  | پهنای باند حداقل 128 Mbps                          |

***

## مرحله ۱؛ نصب Full Node دات‌وان

پیش از اجرای اعتبارسنج، باید یک **Full Node دات‌وان** نصب و کاملاً Sync شده باشد. برای انجام این مرحله، ابتدا راهنمای نصب Full Node را در بخش Developer دنبال کنید.

***

## مرحله ۲؛ آماده‌سازی حساب‌ها

برای راه‌اندازی اعتبارسنج، به دو حساب نیاز دارید:

**Consensus Account** برای امضای بلاک‌ها و تولید بلاک استفاده می‌شود.

**BLS Vote Account** برای رأی‌دهی در فرایند Fast Finality استفاده می‌شود.

هنگام ثبت اعتبارسنج روی زنجیره، مطمئن شوید این حساب‌ها دقیقاً با اطلاعاتی که وارد می‌کنید مطابقت داشته باشند.

### ساخت Consensus Address

برای ساخت یک حساب جدید Consensus و تعیین رمز عبور، دستور زیر را اجرا کنید:

```bash
geth account new --datadir ${DATA_DIR}
```

`DATA_DIR` مسیری است که فایل‌های keystore شما در آن ذخیره می‌شوند.

اگر از قبل حساب Consensus دارید، این مرحله را رد کنید.

رمز عبور خود را در یک فایل ذخیره کنید:

```bash
echo {your-consensus-account-password} > password.txt
```

### ساخت BLS Vote Address

برای ساخت یک حساب جدید BLS، دستور زیر را اجرا کنید:

```bash
geth bls account new --datadir ${DATA_DIR}
```

اگر از قبل کلید BLS دارید، آن را با دستور زیر import کنید:

```bash
geth bls account import ${KEY_FILE} --datadir ${DATA_DIR}
```

برای بررسی آدرس BLS خود:

```bash
geth bls account list --datadir ${DATA_DIR}
```

رمز عبور BLS را در یک فایل ذخیره کنید:

```bash
echo {your-bls-wallet-password} > blspassword.txt
```

***

## مرحله ۳؛ اجرای نود اعتبارسنج

{% hint style="warning" %}
هرگز RPC endpointهای خود را در معرض شبکه عمومی قرار ندهید.
{% endhint %}

برای شروع اعتبارسنج، دستور زیر را اجرا کنید:

```bash
geth --config ./config.toml \
  --datadir ./node \
  -unlock {your-consensus-account-address} \
  --miner.etherbase {your-consensus-account-address} \
  --password password.txt \
  --blspassword blspassword.txt \
  --mine \
  --vote \
  --allow-insecure-unlock \
  --cache 18000 \
  --history.transactions 0 \
  --history.logs.disable
```

***

## عملیات پس از راه‌اندازی

### مانیتور وضعیت نود

توصیه می‌شود از همان لحظه‌ای که نود فعال می‌شود، وضعیت آن را مانیتور کنید. می‌توانید یک metrics exporter را از طریق Docker اجرا کنید:

```bash
docker run -it -d -p 9090:9090 \
  -e "GETH=http://your-node-address:8545" \
  hunterlong/gethexporter
```

داشبورد مرجع: **Grafana Dashboard #6976**

### توقف و ادامه اعتبارسنجی

برای توقف تولید بلاک، به کنسول نود خود متصل شوید:

```bash
geth attach ipc:path/to/geth.ipc
```

سپس اجرا کنید:

```bash
miner.stop()
```

برای ادامه اعتبارسنجی:

```bash
miner.start()
```

***

## نکات و بهترین روش‌ها

### اجرای نود پشتیبان

راه‌اندازی یک نود پشتیبان به‌شدت توصیه می‌شود. اگر اعتبارسنج اصلی شما با مشکل مواجه شود؛ مانند خرابی سخت‌افزار، قطع ارتباط یا خطای نرم‌افزاری؛ نود پشتیبان باعث می‌شود مشارکت شما در شبکه ادامه پیدا کند و ریسک جریمه ناشی از Downtime کاهش یابد.

### بررسی پایداری نود

تعداد slashهای اعتبارسنج خود را به‌صورت منظم بررسی کنید. برای این کار از ابزار slash status در ریپازیتوری نود استفاده کنید:

```bash
cd <dotone>/cmd/jsutils
```

بررسی slashها در آخرین بلاک:

```bash
node getslashcount.js --Rpc https://rpc.dotone.network
```

بررسی slashها در یک شماره بلاک مشخص:

```bash
node getslashcount.js --Rpc https://rpc.dotone.network --Num {block_number}
```

یک اعتبارسنج سالم باید روزانه صفر یا نزدیک به صفر slash داشته باشد. بیش از سه slash در یک روز، نشانه‌ای جدی است و باید فوراً بررسی شود.

### Maintenance Mode

اگر اعتبارسنج شما به ۵۰ slash برسد، به‌صورت خودکار وارد **Maintenance Mode** می‌شود.

در این وضعیت:

مشکل اصلی را سریع شناسایی و برطرف کنید. به‌محض پایدار شدن نود، از Maintenance Mode خارج شوید. اگر به‌موقع از این وضعیت خارج نشوید، ممکن است نود شما وارد وضعیت jail شود.

برای خروج از Maintenance Mode، تراکنش زیر را از آدرس Consensus اعتبارسنج خود ارسال کنید:

```bash
geth attach geth.ipc
```

```bash
web3.eth.sendTransaction({  from: "0x{your-consensus-address}",  to: "0x0000000000000000000000000000000000001000",  data: "0x04c4fec6"})
```

### فیلتر کردن Peerها بر اساس الگو

در شرایطی که یک نسخه مشخص از نود دارای باگ‌های بحرانی شناخته‌شده باشد و ارتقای فوری کل شبکه ممکن نباشد، می‌توانید با به‌روزرسانی فایل `config.toml`, اتصال به peerهایی که از آن نسخه استفاده می‌کنند را قطع کنید:

```toml
[Node.P2P]PeerFilterPatterns = ["Geth/v{problematic-version}.*"]
```

پس از اعمال تغییر، نود خود را ری‌استارت کنید.

این راهکار موقتی است و پس از ارتقای شبکه باید حذف شود.


---

# 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://docs.dotone.online/documentation/dat-wan-asmart-chyn-or-dotone-smart-chain-docs/aatbarsnj/run-validator-or-dotone-smart-chain-docs.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.
