الأدلة الفنية¶
Dash Wallet Integration¶
This documentation is also available as a PDF.
Dash Core is a fork of Bitcoin and the majority of functionality included in the Dash Core Daemon can be integrated in a similar manner. Key differences relate to customizations to existing JSON-RPC commands to support unique functionalities such as InstantSend. These differences, as well as more general information, are summarized below.
General Information: Dash is a “Proof of Work” blockchain with attributes similar to that of Bitcoin.
- Block Time: ~2.6 Minutes per Block
- Blockchain Confirmations: 6 Confirmations (or 1 in the case of InstantSend)
- Github Source: https://github.com/dashpay/dash
- Release Link: https://github.com/dashpay/dash/releases
JSON-RPC Interface: The majority of Bitcoin JSON-RPC commands are unchanged making integration into existing systems relatively straightforward. For a complete listing of RPC commands see the Developer Guide.
It’s worth noting that several key Transaction-related JSON-RPC commands have been modified to support InstantSend through the addition of an “InstantLock” field and are listed below:
Block Hashing Algorithm: Dash uses the “X11” algorithm in place of SHA256 used in Bitcoin. It’s important to note, however, that this only affects the hashing of the Block itself. All other internals utilize SHA256 hashes (transactions, merkle root, etc) which allows for most existing libraries to work in the Dash ecosystem.
Supporting Libraries: Due to the aforementioned differences in Hashing Algorithm only minor adjustments are required before using Bitcoin libraries on the Dash network. The most popular libraries have already been ported to Dash which has enabled support for most major programming languages. These resources are outlined in the SDK Resources section of this document.
v0.13.0 Integration Notes¶
This documentation is also available as a PDF.
Dash 0.13.0 implements DIP002 Special Transactions, which form a basis for new transaction types that will provide on-chain metadata to assist various consensus mechanisms. The following special transaction types exist:
Release | Version | Type | Payload Size | Payload | Payload JSON | Transaction Purpose |
---|---|---|---|---|---|---|
v0.13.0 | 3 | 0 | n/a | n/a | n/a | Standard Transaction |
v0.13.0 | 3 | 1 | <variable int> | <hex> | proRegTx | Masternode Registration |
v0.13.0 | 3 | 2 | <variable int> | <hex> | proUpServTx | Update Masternode Service |
v0.13.0 | 3 | 3 | <variable int> | <hex> | proUpRegTx | Update Masternode Operator |
v0.13.0 | 3 | 4 | <variable int> | <hex> | proUpRevTx | Masternode Revocation |
v0.13.0 | 3 | 5 | <variable int> | <hex> | cbTx | Masternode List Merkle Proof |
v0.13.0 | 3 | 6 | <variable int> | <hex> | qcTx | Quorum Commitment |
Integration notes:
- DIP002 Special Transactions are a foundational component of Dash Core v0.13.0 and introduce a new Transaction Version and related “Payload” to the network.
- Integrated Systems must be able to serialize and deserialize these new Transaction Types in order to accurately encode and decode Raw Transaction data.
- From a backwards compatibility
perspective, the 4 byte (32-bit)
version
field included in Legacy Transactions has been split into two fields:version
andtype
(each consisting of 2 bytes). - InstantSend
status and Payload JSON (e.g.
proRegTx
) is included in the JSON-RPC response, please note that this data is not part of the calculated hash and is provided for convenience.
Legacy transaction structure:
{
"txid": <string>,
"size": <int>,
"version": 2,
"locktime": 0,
"vin": [],
"vout": [ … ]
}
Updated transaction structure:
{
"txid": <string>,
"size": <int>,
"version": 3,
"type": <int>,
"locktime": 0,
"vin": [ … ],
"vout": [ … ],
"extraPayloadSize": <variable int>,
"extraPayload": …
}
See the Special Transactions developer documentation
for additional detail on these data types, e.g. <variable int>
. See
the v0.13.0 transaction types integration documentation (PDF)
for worked examples of each transaction type.
خدمات API¶
هذه الوتيقة متاحة هنا.
توجد عدة خدمات API لتسهيل التكامل السريع والسهل مع شبكة داش للخدمات بما في ذلك:
- بث المعاملات
- معدل التحويل
- تحويل العملة
- جيل الفاتورة
يتم استخدام خدمات API بشكل نموذجي للتخلص من متطلبات تشغيل البنية الأساسية الخاصة بك لدعم تفاعلات بلوكشين. يتضمن ذلك آليات مثل:
- تشكيل ونقل المعاملات إلى الشبكة.
- توليد العناوين باستخدام HD محافظ.
- معالجة الدفع باستخدام WebHooks.
هناك مجموعة متنوعة من الخيارات لدعم هذه الطرق ، مع الاختلاف الرئيسي في كون نموذج التسعير مضمنًا وميزات مدعومة. تحاول القائمة التالية لمقدمي واجهة برمجة التطبيقات تحديد هذه الميزات / الاختلافات الرئيسية كما تتضمن أيضًا رابطًا للوثائق ذات الصلة.
نظرة¶
https://github.com/dashevo/insight-api
The open-source Insight REST API provides you with a convenient, powerful and simple way to read data from the Dash network and build your own services with it. A practical guide to getting started with the Insight API and Insight UI block explorer is available here.
- الميزات: بث المعاملات ، إخطارات WebSocket.
- نموذج التسعير: مجاني / مفتوح المصدر
- الوتيقة:https://github.com/dashevo/insight-api
BlockCypher¶
BlockCypher هو واجهة برمجة تطبيقات بسيطة ومعظمها RESTful JSON للتفاعل مع بلوكشين ، يمكن الوصول إليها عبر HTTP أو HTTPS من نطاق api.blockcypher.com.
- الميزات: بث المعاملات ، HD محفظة / توليد عناوين ، WebSocket و WebHook Callbacks بالإضافة إلى إعادة توجيه الدفع. BlockCypher لا يتعامل مع مفاتيح خاصة.
- نموذج التسعير: لكل استدعاء API ، طلبات 5000 -> 85.00 دولار في الشهر (https://accounts.blockcypher.com/plans)
- الوتيقة:https://www.blockcypher.com/dev/dash/
ChainRider¶
ChainRider هي خدمة سحابة توفر مجموعة من واجهات برمجة التطبيقات REST لإدارة واستكشاف العملة الرقمية.
- الميزات: استعلامات بلوكشين ، إخطارات الأحداث ، بث المعاملات ، معالجة الدفع ، إلخ.
- نموذج التسعير: إصدار تجريبي مجاني والدفع لكل مكالمة API
- الوتيقة:https://www.chainrider.io/docs/dash
GoCoin¶
تجعل منصة GoCoin من اتخاذ داش أمرًا سهلاً مثل تثبيت مكون إضافي. يتم تنفيذ معالجة الدفع بالفعل لكل منصة تسوق رئيسية. تركز GoCoin على مساعدة التجار في منافذ الخصوصية وصناعات محددة ، وتتعامل مع جميع مخاطر المعاملات لجميع المدفوعات من عملائك.
- الميزات: الفواتير ، أسعار الصرف ، WebHook Callbacks. تحتفظ GoCoin بالمفاتيح الخاصة على خادمها مما يسمح للتاجر بسحب الأموال في العملات الرقمية أو تحويلها إلى Fiat.
- التكامل: WooCommerce ، Magento ، Prestashop ، VirtueMart ، ZenCart ، OpenCart ، OSCommerce ، UberCart ، nopCommerce ، WHMCS ، NATS4 ، Shopify.
- نموذج التسعير: رسوم المعالجة بنسبة 1٪ (https://gocoin.com/fees)
- الوتيقة:https://gocoin.com/docs
CoinPayments¶
CoinPayments هو عبارة عن بوابة دفع متكاملة لعمليات العملات الرقمية مثل داش. تتوفر المكونات الإضافية لسلة التسوق لجميع كاميرات الويب الشائعة المستخدمة اليوم. يمكن أن تساعدك CoinPayments في إعداد عملية دفع جديدة ، أو تتكامل مع عملية الدفع السابقة.
- الميزات: الفواتير ، أسعار الصرف ، WebHook Callbacks. تحتفظ CoinPayments بمفاتيح خاصة على خادمها تسمح للتاجر بسحب الأموال في العملات الرقمية أو تحويلها إلى Fiat.
- التكاملات: aMember Pro، Arastta، Blesta، BoxBilling، Drupal، Ecwid، Hikashop، Magento، OpenCart، OSCommerce، PrestaShop، Tomato Cart، WooCommerce، Ubercart، XCart، ZenCart
- نموذج التسعير: 0.5٪ رسوم المعالجة (https://www.coinpayments.net/help-fees)
- الوتيقة:https://www.coinpayments.net/apidoc
موارد SDK¶
هذه الوتيقة متاحة هنا.
SDKs (Software Development Kits) are used to accelerate the design and development of a product for the Dash Network. These resources can either be used to interface with an API provider or for the creation of standalone applications by forming transactions and/or performing various wallet services.
دليل مطورين داش¶
https://dash-docs.github.io/en/developer-guide
يهدف دليل مطور داش إلى توفير المعلومات التي تحتاجها لفهم داش والبدء في إنشاء تطبيقات تستند إلى داش. لتحقيق الاستفادة المثلى من هذا المستند ، قد تحتاج إلى تثبيت الإصدار الحالي من داش كور ، إما من المصدر أو من ملف قابل للتنفيذ تم ترجمته مسبقًا.
NodeJS/JavaScript: Bitcore (Dashcore)¶
Dashcore is a fork of Bitcore and operates as a full Dash node — your apps run directly on the peer-to-peer network. For wallet application development, additional indexes have been added into Dash for querying address balances, transaction history, and unspent outputs.
- النظام الأساسي: NodeJS / Javascript
- الوتيقة:https://bitcore.io/api/lib
- مستودع: https://github.com/dashevo/dashcore-lib
- مستودع نود؛ https://github.com/dashevo/dashcore-node
PHP: Bitcoin-PHP¶
https://github.com/Bit-Wasp/bitcoin-php
Bitcoin-PHP is an implementation of Bitcoin with support for Dash using mostly pure PHP.
- Platform: PHP
- Documentation: https://github.com/Bit-Wasp/bitcoin-php/blob/master/doc/Introduction.md
- Repository: https://github.com/Bit-Wasp/bitcoin-php
Python: PyCoin¶
https://github.com/richardkiss/pycoin
PyCoin is an implementation of a bunch of utility routines that may be useful when dealing with Bitcoin and Dash. It has been tested with Python 2.7, 3.6 and 3.7.
- Platform: Python
- Documentation: https://pycoin.readthedocs.io/en/latest/
- Repository: https://github.com/richardkiss/pycoin
Java: DashJ¶
https://github.com/HashEngineering/dashj
داش ج هي مكتبة للعمل مع بروتوكول داش. يمكنه الاحتفاظ بمحفظة ، إرسال / استقبال المعاملات (بما في ذلك الإرسال الفوري) دون الحاجة إلى نسخة محلية من داش كور ، ولديه العديد من الميزات المتقدمة الأخرى. يتم تنفيذه في Java ولكن يمكن استخدامه من أي لغة متوافقة مع JVM: يتم تضمين أمثلة في Python و JavaScript.
- النظام الأساسي: Java
- الوتيقة:https://bitcoinj.github.io/getting-started
- متال التطبيق: https://github.com/tomasz-ludek/pocket-of-dash
.NET: NBitcoin¶
https://github.com/MetacoSA/NBitcoin
NBitcoin هي مكتبة بيتكوين الأكثر اكتمالا لمنصة .NET ، وقد تم تصحيحها لتتضمن دعم داش. وتنفذ جميع مقترحات تحسين بيتكوين الأكثر ملاءمة (BIPs) و داش تحسين الإقتراحات (DIPs). كما يوفر وصولاً منخفض المستوى إلى البدايات الأولية بحيث يمكنك بسهولة إنشاء التطبيق الخاص بك فوقه.
- النظام الأساسي:. NET
- الوتيقة: https://programmingblockchain.gitbooks.io/programmingblockchain/content/
- مستودع: https://github.com/MetacoSA/NBitcoin
BlockCypher¶
يوفر BlockCypher أيضًا SDKs للعميل.
- النظام الأساسي: روبي ، Python ، Java ، PHP ، Go ، NodeJS
- المستودعات: https://www.blockcypher.com/dev/dash/#blockcypher-supported-language-sdks
GoCoin¶
- النظام الأساسي: JavaScript ، PHP ، Java ، Ruby ، .NET ، Python
- المستودعات: https://gocoin.com/docs
إرسال فوري¶
هذه الوتيقة متاحة هنا.
الإرسال الفوري هي ميزة تقدمها شبكة داش التي تسمح للمعاملات 0-تأكيد أن يكون مقبولا بأمان من قبل التجار ومقدمي الخدمات الآخرين. تؤمن هذه الآلية ، المضمونة بشبكة ماسترنود ، خطر حدوث "إنفاق مزدوج" من خلال تأمين مدخلات المعاملة لمعاملة معينة على مستوى البروتوكول.
الإرسال الفوري المعاملات مقابل المعاملات القياسية¶
من منظور التكامل هناك اختلافات طفيفة فقط بين معاملات الإرسال الفوري ومعاملات قياسية. يتم تكوين نوعي المعاملة بنفس الطريقة ويتم توقيعهما باستخدام نفس العملية ؛ الاختلاف الرئيسي هو هيكل الرسوم ومتطلبات الإدخال لـ الإرسال الفوري.
- هيكل الرسوم: يستخدم الإرسال الفوري رسم "لكل إدخال" بقيمة 0.0001 داش لكل إدخال.
- متطلبات الإدخال: يجب أن تحتوي جميع المدخلات الخاصة بمعاملات الإرسال الفوري على 6 تأكيدات على الأقل.
في حالة عدم استيفاء المعاملة المعينة لكلا المعيارين ، فستعود إلى معاملة قياسية.
تلقي معاملات الإرسال الفوري¶
تتم معالجة معاملات الإرسال الفوري بنفس طريقة التعامل مع المعاملات القياسية ، عادةً من خلال JSON-RPC ، أو واجهة برمجة تطبيقات Insight ، أو برنامج نصي / خدمة إشعار داخلي تم تكوينه على مستوى الخادم.
JSON-RPC: ستتضمن أوامر RPC التالية المعلومات المتعلقة بـ الإرسال الفوري. ضمن الرد ستجد حقل "InstantLock" حالة معاملة معينة. ستشير هذه القيمة صحيح / خطأ (boolean) إلى ما إذا تم ملاحظة الإرسال الفوري.
- الحصول على المعاملة: https://dash-docs.github.io/en/developer-reference#gettransaction
- قائمة المعاملات: https://dash-docs.github.io/en/developer-reference#listtransactions
- قائمة منذ الحظر: https://dash-docs.github.io/en/developer-reference#listsinceblock
واجهة برمجة التطبيقات Insight: يمكن استخدام واجهة برمجة التطبيقات Insight للكشف عن معاملات الإرسال الفوري ولإرسال الإشعارات إلى العملاء الذين يستخدمون WebSockets. يمكن أيضًا استقصاء API يدوياً لاسترداد معلومات المعاملة بما في ذلك حالة الإرسال الفوري.
- Web Socket: https://github.com/dashevo/insight-api#web-socket-api
- Transaction API: https://github.com/dashevo/insight-api#instantsend-transactions
إخطارات البرنامج النصي: يمكن تهيئة داش كوى لتنفيذ برنامج نصي خارجي كلما تمت ملاحظة معاملة الإرسال الفوري ذات الصلة بتلك المحفظة. يتم تكوين هذا عن طريق إضافة السطر التالي إلى ملف dash.conf:
instantsendnotify=/path/to/concurrent/safe/handler %s
لاحظ أنه سيتم مراقبة العناوين التي تم استيرادها إلى المحفظة فقط من أجل معاملات الإرسال الفوري
البث المعاملات للإرسال الفوري¶
يمكن بناء المعاملات الفورية والبث باستخدام نهج مماثل للمعاملات القياسية. بشرط استيفاء هيكل رسوم الإرسال الفوري ومتطلبات الإدخال ، يمكن بث الإرسال الفوري باستخدام JSON-RPC أو Insight API كمعاملة أولية
JSON-RPC: يمكن استخدام أمر RPC "SendRawTransaction" لبث معاملة أولية باستخدام الإرسال الفوري. عند استخدام هذا الأمر ، تأكد من تعيين المعلمات الاختيارية على أنها "true"
sendrawtransaction "hexstring" ( allowhighfees instantsend )
sendrawtransaction "hexstring" true true
مزيد من المعلومات: https://dash-docs.github.io/en/developer-reference#sendrawtransaction
واجهة برمجة تطبيقات الإحصاءات: يمكن أيضًا بث المعاملات الأولية باعتبارها الإرسال الفوري باستخدام واجهة برمجة التطبيقات Insight. في هذه الحالة ، كل ما هو مطلوب هو إدخال المعاملة الأولية باستخدام مسار
/tx/sendix
.مزيد من المعلومات: https://github.com/dashevo/insight-api#instantsend-transaction
موارد إضافية¶
توفر الموارد التالية معلومات إضافية حول الإرسال الفوري وتهدف إلى المساعدة على توفير فهم أكثر اكتمالاً للتكنولوجيات الأساسية.
آلات البيع¶
أصدر عضو المنتدى moocowmoo تعليمات برمجية لمساعدة التجار في إنشاء آلة البيع الخاصة بهم وإعدادها لتلقي دفعات الإرسال الفوري في داش. يمكن أيضًا استخدام برنامج Dashvend لإنشاء أي نوع من أنظمة الدفع ، بما في ذلك أنظمة نقاط البيع ، التي يمكنها قبول دفعات الإرسال الفوري.
مؤشرات السعر¶
يمكنك إضافة أداة أسعار تذاكر بسيطة إلى موقعك باستخدام مُنتِج كود الشفرة من CoinGecko.
تتوفر أدوات مماثلة مع تصاميم مختلفة من CoinLib, WorldCoinIndex و Cryptonator, بينما تتوفر واجهة برمجة التطبيقات التي توفر معلومات مماثلة من داش سنترال.
الماسح الضوئي¶
العديد من المحافظ قادرة على توليد رموز QR التي يمكن مسحها ضوئيا لتبسيط دخول عنوان داش. يؤدي طباعة هذه الرموز أو نشرها على موقع الويب إلى تسهيل تلقي الدفعات والنصائح في داش ، سواء عبر الإنترنت أو في وضع عدم الاتصال.
- في داش كور ، انتقل إلى علامة استقبال ، ثم أنشئ عنوانًا إذا لزم الأمر ، وانقر عليه نقرًا مزدوجًا لعرض رمز الاستجابة السريعة. انقر بزر الماوس الأيمن على رمز الاستجابة السريعة وحدد حفظ الصورة لحفظ ملف PNG.
- في داش في الأندرويد ، انقر على طلب عملات ثم انقر على رمز QR لعرض صورة أكبر. يمكنك قطة الشاشة هذه لحفظ الصورة.
- في داش في الأبفون ، مرّر سريعًا إلى اليسار لعرض شاشة استقبال داش. سيظهر رمز الاستجابة السريعة والعنوان. يمكنك قطة الشاشة هذه لحفظ الصورة.
- لإنشاء رمز الاستجابة السريعة من أي عنوان داش ، تفضل بزيارة هنا وببساطة قم بلصق عنوان الشرطة خاصتك لإنشاء صورة.