নাম সার্ভার প্রোটোকল
The protocol used by Jami to query and register a name is based on an HTTP REST API answering requests with JSON documents and regular HTTP status codes.
The public name server is hosted at ns.jami.net. Another implementation could use any other database
or directory service making the name server protocol reusable.
If you run your own name server, looking up a username in the form of
username@example.com will look up the name username with the
name server at example.com (there is no need to add @ns.jami.net
to use the default name server).
নাম ফরম্যাটিং সংক্রান্ত নিয়ম
ব্যবহারকারীর নামগুলি একটি রেজেক্স দ্বারা তাদের বিন্যাসের বিষয়ে কিছু নিয়ম নিশ্চিত করার জন্য পরীক্ষা করা হয়ঃ
দৈর্ঘ্য 3 থেকে 32 অক্ষরের মধ্যে হতে হবে
Those characters must be alphanumerical with dashes
-being also accepted.
নাম খোঁজা
এটি একটি নাম সার্ভার দ্বারা প্রদত্ত প্রধান পরিষেবা। এটি একটি ব্যবহারকারীর নামের সাথে সামঞ্জস্যপূর্ণ জামি আইডি পেতে সক্ষম করে।
Request name
A request for the name foobar is a GET request with /name/foobar* as the URI.
Response name (Success)
If the name is found, a response with status code 200 OK must be
sent to the client with a Content-type field set as
application/json.
The body is a JSON documents with 2 string attributes : name and
addr. name is equal to the one requested and addr is a
hexadecimal representation of the Jami ID prefixed with 0x.
আমাদের উদাহরণে, JSON উত্তর হবেঃ
{
"name":"foobar",
"addr":"0x29347542eb07159f316577e1ae16243d152f6b7b"
}
Response name (Not found)
If the name is not found, a response with status code 404 Not Found must be sent to the client with a Content-type field set as
application/json.
এই ফাইলটি একটি JSON ডকুমেন্ট যা 1 স্ট্রিং অ্যাট্রিবিউট রয়েছেঃ error। এই অ্যাট্রিবিউটটি একটি ত্রুটি বার্তার সাথে পূরণ করা হয় যা ত্রুটিটি ব্যাখ্যা করে (এবং ভবিষ্যতে ক্লায়েন্টটিতে প্রদর্শিত হতে পারে) ।
রেফারেন্স বাস্তবায়নের ক্ষেত্রে, প্রত্যাবর্তিত নথিটি হলঃ
{
"error":"name not registred"
}
ঠিকানা অনুসন্ধান করা
এই পরিষেবাটি একটি বিপরীত অনুসন্ধান। আপনি একটি ঠিকানা অনুসন্ধান করেন এবং নাম সার্ভারে নিবন্ধিত হলে একটি ব্যবহারকারীর নাম ফিরে আসে।
Request address
A request for the ID jami:29347542eb07159f316577e1ae16243d152f6b7b
is a GET request with
/addr/29347542eb07159f316577e1ae16243d152f6b7b as the URI.
Response address (Success)
If the address corresponds to a username, a response with status code
200 OK must be sent to the client with a Content-type field set
as application/json.
এই ফাইলটি একটি JSON ডকুমেন্ট যা 1 স্ট্রিং অ্যাট্রিবিউট রয়েছেঃ name. এই ক্ষেত্রের মান হল এই ঠিকানায় নিবন্ধিত নাম
আমাদের উদাহরণে, JSON উত্তর হবেঃ
{
"name":"foobar"
}
Response address (Not found)
If the address is not found, a response with status code 404 Not Found must be sent to the client with a Content-type field set as
application/json.
এই ফাইলটি একটি JSON ডকুমেন্ট যা 1 স্ট্রিং অ্যাট্রিবিউট রয়েছেঃ error। এই অ্যাট্রিবিউটটি একটি ত্রুটি বার্তার সাথে পূরণ করা হয় যা ত্রুটিটি ব্যাখ্যা করে (এবং ভবিষ্যতে ক্লায়েন্টটিতে প্রদর্শিত হতে পারে) ।
রেফারেন্স বাস্তবায়নের ক্ষেত্রে, প্রত্যাবর্তিত নথিটি হলঃ
{
"error":"address not registred"
}
নাম নিবন্ধন
প্রোটোকলের এই অংশটি একটি নতুন নাম/ঠিকানা জোড়া নিবন্ধনের জন্য ব্যবহৃত হয়। এটি মূল পাবলিক রেজিস্ট্রিতে ব্যবহৃত হয় তবে কাস্টম বাস্তবায়নে ঐচ্ছিক হতে পারে।
Request register
foobar নাম নিবন্ধনের জন্য একটি অনুরোধ POST /name/*foobar* URI হিসাবে। শিরোনাম বৈশিষ্ট্য Content-type application/json এ সেট করা উচিত।
অনুরোধের উপাদানটি একটি JSON ডকুমেন্ট যা দুটি স্ট্রিং অ্যাট্রিবিউট রয়েছেঃ addr এবং owner। addr এর মধ্যে রয়েছে Jami ID, যার আগে 0x এবং owner নামটি নিবন্ধিত করা হবে।
foobar এর উদাহরণ হতে পারেঃ
{
"addr":"0x29347542eb07159f316577e1ae16243d152f6b7b",
"owner":"foobar"
}
Response register (Success)
If the name/address pair is successfully registered, a response with
status code 200 OK must be sent to the client with a Content-type
field set as application/json.
এই ক্যাবিনেটে 1 বোলিয়ান অ্যাট্রিবিউট success true হিসাবে সেট করা একটি JSON ডকুমেন্ট রয়েছে।
উদাহরণস্বরূপঃ
{
"success":true
}
এরপর নাম বা ঠিকানা অনুসন্ধানের জন্য আরও চেষ্টা সফল হবে।
Response register (Bad request)
If the registration is unable to be achieved because of an error in the
request (formatting, missing attribute, etc.), a response with status
code 400 Bad Request must be sent to the client with a
Content-type field set as application/json.
শরীরটি 2 টি বৈশিষ্ট্যযুক্ত একটি JSON ডকুমেন্টঃ success যা একটি বুলিয়ান এবং error যা একটি স্ট্রিং। success falseএবংerror` এ সেট করা হয় ত্রুটি বার্তা দিয়ে ভরা যা ত্রুটি ব্যাখ্যা করে (এবং ভবিষ্যতে ক্লায়েন্টটিতে প্রদর্শিত হতে পারে) ।
ব্যবহারকারীর নামের অবৈধ ফরম্যাটিংয়ের জন্য, শরীরটি হতে পারেঃ
{
"success": false,
"error": "invalid name"
}
Response register (Forbidden)
If the registration cannot be achieved because the name is already
taken, a response with status code 403 Forbidden must be sent to
the client with a Content-type field set as application/json.
শরীরটি 3 টি বৈশিষ্ট্যযুক্ত একটি JSON ডকুমেন্টঃ success যা false, name এবং addr এর একটি বুলিয়ান সেট যা উভয় স্ট্রিং মূল অনুরোধ থেকে পুনরায় তৈরি করা হয়।
foobar নিবন্ধন করা, ইতিমধ্যে নিবন্ধিত হলে, নিম্নলিখিত প্রতিক্রিয়া দেখাবেঃ
{
"success": false,
"name":"foobar",
"addr":"0x29347542eb07159fdeadbeefae16243d152f6b7b"
}
কিছু লিঙ্ক
gitlab:jami-nameservice:
ns.jami.netদ্বারা ব্যবহৃত রেফারেন্স NodeJS বাস্তবায়ন এবং ইথেরিয়াম নোডের অনুসন্ধান।