II. Cài đặt Mithril signer relay node

Relay node Mithril đóng vai trò là proxy chuyển tiếp, truyền tải lưu lượng giữa Mithril signer và Mithril aggregator. Khi được cấu hình đúng cách, nó hỗ trợ tăng cường bảo mật block-producing node. Bạn có thể sử dụng squid để vận hành proxy chuyển tiếp này.

I. Cài đặt Squid và thiết lập dịch vụ.
sudo apt-get install squid
sudo systemctl enable squid
sudo systemctl daemon-reload
sudo systemctl start squid

Tạo backup cấu hình squid.

sudo cp /etc/squid/squid.conf /etc/squid/squid.conf.bak
Tạo cấu hình Squid

Tạo một tệp cấu hình Squid mới cho Mithril.

sudo nano squid.conf 

Cấu hình IP của Relay và của Block Producer.

# Listening port (port 3132 is recommended)
http_port <YOUR RELAY LISTENING IP>:3132

# ACL for internal IP of your block producer node
acl block_producer_internal_ip src <YOUR BP MITHRIL SIGNER IP>

# ACL for aggregator endpoint
acl aggregator_domain dstdomain .mithril.network

# ACL for SSL port only
acl SSL_port port 443

# Allowed traffic
http_access allow block_producer_internal_ip aggregator_domain SSL_port

# Do not disclose block producer internal IP
forwarded_for delete

# Turn off via header
via off
 
# Deny request for original source of a request
follow_x_forwarded_for deny all
 
# Anonymize request headers
request_header_access Authorization allow all
request_header_access Proxy-Authorization allow all
request_header_access Cache-Control allow all
request_header_access Content-Length allow all
request_header_access Content-Type allow all
request_header_access Date allow all
request_header_access Host allow all
request_header_access If-Modified-Since allow all
request_header_access Pragma allow all
request_header_access Accept allow all
request_header_access Accept-Charset allow all
request_header_access Accept-Encoding allow all
request_header_access Accept-Language allow all
request_header_access Connection allow all
request_header_access All deny all

# Disable cache
cache deny all

# Deny everything else
http_access deny all

Move tệp squid.conf mới.

sudo mv -f squid.conf /etc/squid/squid.conf
Cấu hình tường lửa UFW.
sudo ufw allow from <YOUR BP MITHRIL SIGNER IP> to <YOUR RELAY IP> port 3132 proto tcp
Restart Squid
sudo systemctl restart squid

Để lại một bình luận

Email của bạn sẽ không được hiển thị công khai. Các trường bắt buộc được đánh dấu *

Nội dung