Room-House.com Russia
  • SkyPirl (Pirl)
    • О SkyPirl
    • Создать кошелек SkyPirl 2.0
    • Как стать номинатором (Stake)
    • Запустить валидатор
    • как вывести средства со стейка
    • Как работает выплата
    • Как проголосовать за Совет
    • Как установить личность
    • косая черта
    • Refund of slashed
    • ХАРАКТЕРИСТИКИ МОНЕТ
    • Правительство и казначейство
    • Telemetry
    • Source Code
  • PIRLmeet
    • О PIRLmeet.com
    • Бесплатная пробная версия
    • CINEMA
    • Microphone On-Off
    • Демонстрация экрана
      • Поделитесь или не делитесь своим аудио
      • Учебное пособие по записи видео + камера + загрузка видео в формате mp4
    • Руки вверх
    • Изменить мелодию звонка при поднятии руки
    • Потоковое видео в формате MP4
    • Потоковое видео mp4 в браузере Firefox
    • Замок шкафа
      • Учетная запись блокировки кабинета
      • Как я могу «запереть шкаф» и не дать посторонним войти в комнату?
      • Как я могу добавить людей в комнату, когда комната заблокирована?
    • Подключить кошелек SkyPirl к PIRLmeet
    • Изменить обложку
    • Название видео
    • Настройка собственного PIRLmeet
    • Как скачать видео на ютуб, фейсбук и конвертировать в мп4 файлы
    • Используйте приложение для улучшения камеры во время прямой трансляции
    • PIRLmeet может организовывать встречи, которые длятся 24/7 и 365 дней в году.
    • Как PIRLmeet защищает продукты?
    • Получите монету Pirl при воспроизведении видео на PIRLmeet
    • Source Code
  • SkyPirl Light Wallet
  • Сообщество SkyPirl
  • Бизнес-парадигма R-H
  • Дорожная карта
  • Команда SkyPirl
  • хТер . Технологии
    • О xTER SafeContainer
    • xTer Экосистема
    • xTer SkyPirl
    • xTer Room-House
      • Как Room-House
    • xTer Room-House Plus
      • Как xTer room-House plus
    • xTer TrueAD
    • xTer SmartFilter
  • Белая бумага
  • Блог
    • Новости
      • ------ Что такое Web 1.0, 2.0, 3.0?------
      • Первый в мире децентрализованный аудиочат Room-House
      • Что такого особенного в децентрализованных аудиочатах?
      • Особенности, которые делают децентрализованные чаты Room-House.com конкурентоспособными с гигантами
      • Вы когда-нибудь слышали о децентрализованном благотворительном фонде?
      • Что такое онлайн-встреча? 4 самых эффективных решения для онлайн-конференций
      • Что такое онлайн-встреча? Легко или сложно организовать?
      • Каков стандарт профессиональной онлайн-комнаты для совещаний?
      • История первого в мире программного обеспечения для онлайн-конференций
      • Децентрализованное приложение Room-House.com (Daap)
      • В каком году родился интернет? И рождение проекта SkyPirl
      • Сотрудничество между Room-House и Российским государственным социальным университетом
    • Технические
      • Что такое биткойн? Как создаются биткойны?
      • Export Your Private Key from Third-Party Wallets
      • Что такое стейблкоин?
      • Что такое обернутый биткойн?
      • 7 способов получения пассивного дохода с помощью криптовалюты
      • Что такое децентрализованная социальная сеть?
      • Сколько биткойнов можно добыть за день?
      • Сколько биткойнов в мире?
      • Что такое децентрализованная биржа? отличается от централизованного этажа?
      • Что такое стейкинг? 5 вещей, которые следует учитывать при инвестировании в стейкинг
      • Что такое блокчейн-мосты?
      • Сравните горячий кошелек и холодный кошелек, какой из них вам следует использовать?
      • Что такое НФТ?
      • Создание децентрализованного интернета в космосе
      • Веб 3.0 Парадокс
      • Споры о будущем Интернета
      • Виртуальная вселенная метавселенной может произвести революцию в Интернете
      • «Блокчейн — самая влиятельная технология со времен Интернета»
      • Web3 - Ожидания от децентрализованного Интернета
      • Что такое дапп? Понятие Dapp и их классификация
      • Как децентрализованные веб-браузеры обеспечивают непревзойденную конфиденциальность
      • Web 3.0 раскручен?
      • Что такое узлы? Типы узлов в блокчейне
      • Блокчейн можно взломать или нет?
      • Что такое закрытый ключ и открытый ключ в биткойнах?
      • Что такое одноразовый номер в блокчейне?
      • Что такое децентрализованный автономный кооператив (DAC)?
      • Что такое Генезис Блок?
      • Что такое Веб3? Объяснение децентрализованного Интернета будущего
  • FAQ?
    • General
      • Getting Started
      • Claims
      • Redenomination of DOT
      • Grants
      • Polkadot Ambassador Programme
      • Research Pages
      • Community
      • Contributing
      • Contributors
      • Glossary
      • Adding accounts to an ENS domain
      • Ledger Application
      • How to Protect Yourself from Scams
      • How to Do Your Own Research
      • Thousand Validators Programme
      • Frequently Asked Questions (FAQs)
      • Miscellaneous
      • Programmes
        • Grants
        • Bug Bounty
        • Substrate Builders Program
        • Thousand Validators Programme
        • Thousand Contributors Programme
    • Learn
      • Basics
        • Token and Assets
          • Assets
          • DOT
          • NFTs
          • Statemint
          • Teleporting Assets
        • Components
          • Architecture
          • Collator
          • Consensus
          • Governance
          • Identity
          • Network Security
          • Nominator
          • Polkadot Host
          • PolkadotJS
          • W3F Registrar
          • Runtime Upgrades
          • Transaction Fees
          • Treasury
          • Validator
        • Staking
          • Staking Concepts
          • Staking FAQ
          • Nomination Pools
        • Account
          • Account Generation
          • Backing up and Restoring Accounts
          • Balance Transfers
      • Advanced
        • Availability and Validity
        • Cross-Consensus Message Format (XCM)
        • Sequential Phragmén Method
        • Proxy Accounts
        • Randomness
        • Simple Payouts
        • SPREE
        • WebAssembly (Wasm)
      • Cryptography
        • Cryptography Explainer
        • Keys
      • Paraobjects
        • Parachains
          • Common Good Parachains
          • Parachain Slots Auction
          • Parachain Crowdloans
          • Teleporting Assets
        • Parathreads
        • Bridges
      • Polkadot Comparisons
        • Polkadot and Kusama
        • Other Comparisons
        • Ethereum 2.0
        • Cosmos
      • Polkadot Lauch Phased
      • Video Tutorials
    • Build
      • Builder's Guides
      • Development Guide
        • Builders Starter's Guide
        • Parachain Development
        • Decentralized Storage Systems
        • Smart Contracts
        • Oracles
        • Data Analytics
        • Wallets
        • Substrate Connect
        • SS58 Registry
        • Opening HRMP Channels
      • Integration Guide
        • Polkadot Integration Guide
        • Polkadot Protocol Information
        • Integration Assets
        • Node Management
        • Node Interaction
        • Transaction Construction and Signing
      • Tool
      • Resources
    • Maintain
      • Network Maintainers
      • Parameters
      • Node Endpoints
      • Node And Dapps
        • Set up a Full Node
        • Networks
        • Set up Secure WebSocket for Remote Connections
        • Resolving Errors
      • Nominated Guides
        • Nominate
        • Unbonding and Rebonding
      • Validator Guides
        • How to run a Validator on Polkadot
        • Validator Payout Overview
        • Using systemd for a Validator Node
        • Secure Validator
        • How to use Polkadot Validator setup
        • Set Up a Validator with NGINX Reverse Proxy
        • How to Upgrade Your Validator
        • Monitor your node
        • How to Chill
        • How to Stop Validating
        • Validator Community Overview
      • Governance Guides
        • Participate in Democracy
        • Join the Council
        • Voting for Councillors
  • Agency policy
    • Information privacy policy
Powered by GitBook
On this page
  1. FAQ?
  2. Maintain
  3. Validator Guides

Set Up a Validator with NGINX Reverse Proxy

PreviousHow to use Polkadot Validator setupNextHow to Upgrade Your Validator

Last updated 2 years ago

This guide assumes that you have already configured your hardware with the appropriate specs. It has the same configuration as the .

INFO

Because validators of parachains need to have publicly accessible IP addresses and ports to receive connections from parachain collators, adding a proxy may potentially reduce connectivity and result in lower era points or the inability to validate parachain blocks. If using a proxy, it's recommended to keep an eye out on networking metrics.

We will walk you through how to configure a reverse proxy using NGINX in front of your validator node. The validator uses the reverse proxy to filter traffic, whereby additional adjustments can be made to respond to a DDoS attack.

1. Firewall configuration

We will configure the firewall with . There needs to be three main ports for this setup.

  • An SSH port, commonly ssh/tcp port 22.

  • A proxy port

  • p2p port: must be denied at the firewall level.

In this example, we will assign the port number 2435 to the proxy port and the port number 30333 to the p2p port. To enable the firewall and the use of the ports, allow SSH access.

FOR PARACHAINS, YOU WILL NEED TO ALLOW FOR BOTH INBOUND AND OUTBOUND TRAFFIC ON THE P2P PORT

Since the proxy port is the public-facing port, this will need to have inbound and outbound traffic open, with the normal p2p port closed.

ufw enable# ssh portufw allow 22/tcp# proxy portufw allow 2435/tcp# libp2p portufw deny 30333/tcp# default port for HTTPufw deny 9933# default port for WSufw deny 9944ufw reload# double check the firewall rulesufw verbose

The verbose option shows some extra information about the firewall's behavior.

2. Basic log viewing

We use logs for basic log viewing. Create a file called journald.conf file inside the /etc/systemd/ directory with the following content:

[Journal]Storage=persistentRateLimitIntervalSec=30sRateLimitBurst=20000SystemMaxUse=50GSystemMaxFileSize=512MSystemMaxFiles=100

Finally, run the following command to restart the journald service:

systemctl restart systemd-journald

First, install NGINX with the following command:

sudo apt-get install nginx

Next, create an NGINX configuration file called nginx.conf inside the /etc/nginx/ directory with the following content:

user www-data www-data;load_module /usr/lib/nginx/modules/ngx_stream_module.so;stream {  include streams-enabled/*;}http {  include sites-enabled/*;}events{}

Next, create a folder called /streams-enabled/ inside the /etc/nginx/ directory and remove the default NGINX site.

# Create the streams-enabled foldermkdir /etc/nginx/streams-enabled# Delete the default configuration/etc/nginx/sites-enabled/default

Now, inside the newly created directory /etc/nginx/streams-enabled/, create the proxy service file called polkadot-proxy.conf with the following content:

USE THE PREVIOUSLY DEFINED PORTS: PORT 2435 FOR THE PROXY PORT & PORT NUMBER 30333 FOR THE P2P PORT

server {  listen 0.0.0.0:2435;  location / {    proxy_pass http://localhost:30333;  }}

Change the permissions of the file polkadot-proxy.conf accordingly:

chmod 0600 polkadot-proxy.conf

Finally, restart NGINX with the following command:

service nginx restart

These are some of the flags you are going to use when executing the command.

--public-addr <VALIDATOR_IP>, <PROXY_PORT> - This flag defines the validator's IP and the proxy port that all other nodes in the network will connect to.

--listen-addr <LOCALHOST>, <P2P_PORT> - This flag defines the p2p port that the polkadot application will use to connect to the NGINX reverse proxy.

public-addr - a flexible encoding of multiple layers of protocols into a human-readable addressing scheme. In our example, /ip4/<VALIDATOR_IP>/tcp/<PROXY_PORT> is a valid public-addr that specifies wanting the network to reach the validator IPv4 address with TCP packets on the pre-defined proxy port.

  • IP_ADDRESS - the public IP address of the validator.

  • PROXY_PORT - the port that nodes will send p2p messages over the network and are read by the NGINX reverse proxy.

listen-addr - the specification of what port the polkadot application will connect to the reverse proxy. In our example, /ip4/0.0.0.0/tcp/<P2P_PORT> specifies that you want to listen to NGINX on the localhost address (0.0.0.0, or all interfaces), with TCP packets on the pre-defined p2p port.

  • P2P_PORT - the port that the polkadot application connects to NGINX.

After retrieving the appropriate IP_ADDRESS, PROXY_PORT and P2P_PORT of the validator node, we can start the validator.

Start your validator with the --validator flag:

# Validator Nodepolkadot \  --name My_Validator_Name \  --validator \  --public-addr=/ip4/IP_ADDRESS/tcp/2435 \  --listen-addr=/ip4/0.0.0.0/tcp/30333 \  --rpc-methods=Unsafe \  --chain=polkadot

You should see your validator's peers, as well as the p2p port you are using to connect to NGINX.

2020-12-17 19:04:36  __ Imported #2940151 (0x14c5_f472)2020-12-17 19:04:39  __ Idle (35 peers), best: #2940151 (0x14c5_f472), finalized #2940149 (0x6014_7806), _ 1.1MiB/s _ 1.1MiB/s2020-12-17 19:04:43  __ Imported #2940152 (0xcce7_c192)2020-12-17 19:04:44  __ Idle (35 peers), best: #2940152 (0xcce7_c192), finalized #2940150 (0x8e24_8e72), _ 1.4MiB/s _ 1.2MiB/s2020-12-17 19:04:48  __ Imported #2940153 (0xc79b_0ae3)2020-12-17 19:04:49  __ Idle (35 peers), best: #2940153 (0xc79b_0ae3), finalized #2940151 (0xc4b8_8fa1), _ 1.2MiB/s _ 1.2MiB/s2020-12-17 19:04:54  __ Imported #2940154 (0x1419_56db)2020-12-17 19:04:54  __ Idle (35 peers), best: #2940154 (0x1419_56db), finalized #2940151 (0xc4b8_8fa1), _ 1.2MiB/s _ 1002.5kiB/s

Congratulations! You have successfully set up a validator with NGINX and now have a more secure way of running your validator.

Check out the for more available options.

3. NGINX reverse proxy setup

This will import and make use of the . In a nutshell, this module allows for continuous streaming of data in or out of the validator machine with all the benefits of having an optimized reverse proxy.

4. Defining your proxy port and p2p port in the polkadot command

P2P Networking

Nodes will use as the networking layer to establish peers and gossip messages, but uses NGINX as a load balancer which acts as a first listener of the streaming data to help balance the load.

public-addr

listen-addr

Starting the validator with the NGINX proxy

polkadot validator setup
​
ufw
​
journald
example journald configuration file
​
NGINX stream module
​
​
libp2p
​
​
​