P2Pool Node Setup#

يصف هذا الدليل كيفية إعداد عقدة داش P2Pool لإدارة مجموعة من عمال المناجم. على عكس حمامات التعدين المركزية ، يعتمد P2Pool على نفس نموذج النظير -2 النبض (P2P) كـ داش ، مما يجعل المجموعة ككل مقاومة للغاية للهجمات الضارة ، والحفاظ على الطبيعة اللامركزية لل داش وحمايتها. عندما تقوم بتشغيل عقدة P2Pool ، فإنها تبحث عن البيانات وتتصل بها وتشاركها بشبكة لا مركزية لعقد P2Pool الأخرى (المعروفة أيضًا باسم الأقران). تتشارك عقد P2Pool سلسلة تشفير للبيانات تمثل القيمة ، على غرار بلوكشين في داش. يسمى الإصدار P2Pool في sharechain. الطبيعة اللامركزية والعادلة لنموذج التعدين هذا يعني أن التعدين مع P2Pool يتم تشجيعه بقوة. P2Pool لداش يستخدم p2pool-dash البرنامج على GitHub ، وهو عبارة عن شوكة من p2pool لبيتكوين. لمزيد من المعلومات، راجع هنا.

وبسبب الطريقة التي يدير بها P2Pool صعوبة عمليات الضبط على sharechain ، من المهم الحفاظ على الكمون المنخفض بين عمال المناجم والعقدة P2Pool لتجنب عمال المناجم الذين يقدمون الأسهم متأخرة لدخول المشاركة. عند إعداد العقدة ، تحتاج إلى النظر في موقعه الفعلي وموقع الشبكة بالنسبة إلى عمال المناجم الذين تنوي توصيلهم بالعقدة. إذا كنت تدير مزرعة تعدين ، فمن المحتمل أن تكون عقدة P2Pool الخاصة بك جهازًا ماديًا على نفس الشبكة المحلية التي يستخدمها عمال المناجم. إذا كنت تخطط لتشغيل عقدة عمومية ، فقد يكون من الأفضل إعداد عقدة P2Pool كجهاز ظاهري في مركز بيانات ذي اتصال عالي السرعة بحيث يمكن لعمال المناجم الذين يعملون جغرافيًا أن يقوموا بالتعدين إلى مجموعتك بوقت استجابة منخفض نسبياً.

This following section describes the steps to setup an Ubuntu Server running P2Pool for Dash. It has been tested with Ubuntu 20.04 LTS and Dash 0.16. While a reasonable effort will be made to keep it up to date, it should be possible to modify the instructions slightly to support different versions or operating systems as necessary.

إعداد الخادم المضيف#

Download a copy of Ubuntu Server LTS from https://ubuntu.com/download/server and install it on your system according to the steps described here. If you are using a VPS such as Vultr or AWS, your provider will most likely provide an option to install this system during provisioning. Ensure you enable OpenSSH server during setup so you can control your server from a remote console. Once you have access to your server, create a new non-root user if you have not already done so using the following command, replacing <username> with a username of your choice:

adduser <username>

ستتم مطالبتك بكلمة مرور. أدخل وتأكد باستخدام كلمة مرور جديدة (مختلفة عن كلمة مرور الجذر) وقم بتخزينها في مكان آمن. سترى أيضًا مطالبات بمعلومات المستخدم ، ولكن يمكن ترك هذا فارغًا. بمجرد أن يتم إنشاء المستخدم ، سنقوم بإضافتهم إلى المجموعة sudo حتى يتمكنوا من تنفيذ الأوامر كجذر

usermod -aG sudo <username>

أعد تشغيل الخادم وسجّل الدخول باسم المستخدم الجديد. في هذه المرحلة ، من المستحسن الاتصال عن بعد باستخدام PuTTY (لـ ويندوز) أو ssh (لنظام التشغيل لينكس و ماك) إذا لم تكن قد قمت بذلك بالفعل.

إعداد ميناء الشحن#

If you are on a private network behind a router, you will need to set up port forwarding for at least port 8999 (UDP/TCP) for access to the sharechain, as well as port 7903 (UDP/TCP) if you want your node to be accessible to the public. How this is done depends on your particular network router and is therefore beyond the scope of this documentation. An example from the popular DD-WRT open source router distribution is shown below. Guides to setting up port forwarding can be found here and here.

قم بتدوين عنوان IP الخاص بك إما من خلال واجهة إدارة جهاز التوجيه أو من خلال زيارة https://www.whatismyip.com

../../../_images/p2pool-ddwrt.png

إعداد توجيه المنفذ تحت DD-WRT#

Manual setup#

أولاً قم بتحديث نظام التشغيل الخاص بك كما يلي

sudo apt update
sudo apt upgrade

إعداد dashd#

P2Pool requires a full Dash node to be running to get block and transaction data. To download and install Dash, visit https://www.dash.org/downloads/ on your computer to find the link to the latest Dash Core wallet. Click Linux, then right-click on Download TGZ for Dash Core x64 and select Copy link address. Go back to your terminal window and enter the following command, pasting in the address to the latest version of Dash Core by right clicking or pressing Ctrl + V:

cd ~
wget https://github.com/dashpay/dash/releases/download/v20.0.4/dashcore-20.0.4-x86_64-linux-gnu.tar.gz

Verify the authenticity of your download by checking its detached signature against the public key published by the Dash Core development team. All releases of Dash are signed using GPG with one of the following keys:

curl https://keybase.io/codablock/pgp_keys.asc | gpg --import
curl https://keybase.io/pasta/pgp_keys.asc | gpg --import
wget https://github.com/dashpay/dash/releases/download/v20.0.4/dashcore-20.0.4-x86_64-linux-gnu.tar.gz.asc
gpg --verify dashcore-20.0.4-x86_64-linux-gnu.tar.gz.asc

قم بإنشاء دليل عمل لـ داش واستخرج الأرشيف المضغوط ونسخ الملفات الضرورية إلى الدليل وتعيينها كملف قابل للتنفيذ:

mkdir ~/.dashcore
tar xfvz dashcore-20.0.4-x86_64-linux-gnu.tar.gz
cp dashcore-20.0.4/bin/dashd .dashcore/
cp dashcore-20.0.4/bin/dash-cli .dashcore/

تنظيف الملفات غير الضرورية

rm dashcore-20.0.4-x86_64-linux-gnu.tar.gz
rm -r dashcore-20.0.4/

قم بإنشاء ملف تكوين باستخدام الأمر التالي:

nano ~/.dashcore/dash.conf

سوف تظهر نافذة المحرر. نحتاج الآن إلى إنشاء ملف تكوين يحدد عدة متغيرات. قم بنسخ النص التالي ولصقه للبدء ، ثم استبدل المتغيرات الخاصة بالتكوين كما يلي:

#----
rpcuser=XXXXXXXXXXXXX
rpcpassword=XXXXXXXXXXXXXXXXXXXXXXXXXXXX
rpcallowip=127.0.0.1
#----
listen=1
server=1
daemon=1
maxconnections=64
#----

استبدل الحقول التي تحمل علامة XXXXXXX كما يلي:

  • rpcuser: أدخل أي سلسلة من الأرقام أو الحروف ، لا يسمح بالحروف الخاصة

  • rpcpassword: أدخل أي سلسلة من الأرقام أو الحروف ، لا يسمح بالحروف الخاصة

يجب أن تبدو النتيجة شيء من هذا القبيل:

../../../_images/p2pool-dash-conf.png

إدخال بيانات المفتاح في dash.conf على عقدة P2Pool#

اضغط على Ctrl + X لإغلاق المحرر و Y و ادخل احفظ الملف. يمكنك الآن بدء تشغيل داش على ماسترنود لتبدأ التزامن مع بلوكشين

~/.dashcore/dashd

سترى رسالة تقرأ خوادم داش كور تبدأ. يمكنك متابعة الخطوات التالية والتحقق من المزامنة بشكل دوري باستخدام الأمر التالي. اكتمال المزامنة عندما يكون عدد الكتلة مساويًا للعدد الحالي للكتل في بلوكشين داش ، كما يمكن رؤيته من أي محفظة داش متزامنة أو مستكشف الكتلة:

~/.dashcore/dash-cli getblockcount

إعداد P2Pool#

سنقوم الآن بإعداد برنامج P2Pool واعتمادياته. تبدأ مع الاعتماديات

sudo apt install python2 python2-dev gcc g++ git
curl https://bootstrap.pypa.io/get-pip.py --output get-pip.py
sudo python2 get-pip.py
pip install twisted

إنشاء أدلة العمل وإعداد p2pool- داش

git clone https://github.com/dashpay/p2pool-dash
cd p2pool-dash
git submodule update --init
cd dash_hash
python2 setup.py install --user

سنقوم بإضافة بعض الواجهات الإضافية الاختيارية إلى لوحة التحكم

cd ..
mv web-static web-static.old
git clone https://github.com/justino/p2pool-ui-punchy web-static
mv web-static.old web-static/legacy
cd web-static
git clone https://github.com/hardcpp/P2PoolExtendedFrontEnd ext
cd ..

يمكنك الآن البدء في p2pool وتحديديا عنوان العائد ، IP الخارجي (إذا لزم الأمر) ، والرسوم والتبرعات على النحو التالي:

python2 ~/p2pool-dash/run_p2pool.py --external-ip <public_ip> -w <port> -f <fee> -a <payout_address> --give-author <donation>

يمكنك بعد ذلك مراقبة العقدة عن طريق التصفح إلى العناوين التالية ، واستبدالها <ip_address> مع عنوان IP لعقدة P2Pool الخاصة بك:

../../../_images/p2pool-antminer.png
../../../_images/p2pool-running.png

مثال على التهيئة التي تعرض Bitmain Antminer D3 الموصول بعقدة p2pool-داش على الشبكة المحلية#