mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-25 06:05:51 +00:00
Terminology update & functional change
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -37,20 +37,20 @@ function fetchFile(domain) {
|
|||||||
parseXrplToml(data)
|
parseXrplToml(data)
|
||||||
} else {
|
} else {
|
||||||
makeLogEntry('TOML FILE: Not found')
|
makeLogEntry('TOML FILE: Not found')
|
||||||
makeLogEntry('WALLET CAN NOT BE VERIFIED: TOML file was not found.')
|
makeLogEntry('ACCOUNT CAN NOT BE VERIFIED: TOML file was not found.')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}).on("error", (err) => {
|
}).on("error", (err) => {
|
||||||
if (err.code == 'ENOTFOUND') {
|
if (err.code == 'ENOTFOUND') {
|
||||||
makeLogEntry('WALLET CAN NOT BE VERIFIED: Network error while fetching TOML file.')
|
makeLogEntry('ACCOUNT CAN NOT BE VERIFIED: Network error while fetching TOML file.')
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function fetchWallet() {
|
function fetchWallet() {
|
||||||
makeLogEntry('\nCHECKING DOMAIN OF WALLET...')
|
makeLogEntry('\nCHECKING DOMAIN OF ACCOUNT...')
|
||||||
const url = "wss://xrplcluster.com"
|
const url = "wss://xrplcluster.com"
|
||||||
if (typeof socket !== "undefined" && socket.readyState < 2) {
|
if (typeof socket !== "undefined" && socket.readyState < 2) {
|
||||||
socket.close()
|
socket.close()
|
||||||
@@ -67,25 +67,25 @@ function fetchWallet() {
|
|||||||
if (data.status === 'success') {
|
if (data.status === 'success') {
|
||||||
if (data.result.account_data.Domain) {
|
if (data.result.account_data.Domain) {
|
||||||
try {
|
try {
|
||||||
makeLogEntry('WALLET ADDRESS: Valid')
|
makeLogEntry('ACCOUNT ADDRESS: Valid')
|
||||||
decodeHex(data.result.account_data.Domain)
|
decodeHex(data.result.account_data.Domain)
|
||||||
} catch {
|
} catch {
|
||||||
makeLogEntry('error decoding domain field: ' + data.result.account_data.Domain)
|
makeLogEntry('error decoding domain field: ' + data.result.account_data.Domain)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
makeLogEntry('WALLET ADDRESS: Valid')
|
makeLogEntry('ACCOUNT ADDRESS: Valid')
|
||||||
makeLogEntry('DOMAIN DECODED: Domain field not found')
|
makeLogEntry('DOMAIN DECODED: Domain field not found')
|
||||||
makeLogEntry('CHECKING DOMAIN: Error')
|
makeLogEntry('CHECKING DOMAIN: Error')
|
||||||
makeLogEntry('TOML FILE: Not found')
|
makeLogEntry('TOML FILE: Not found')
|
||||||
makeLogEntry('WALLET CAN NOT BE VERIFIED: Wallet has no domain field.')
|
makeLogEntry('ACCOUNT CAN NOT BE VERIFIED: Account has no domain field.')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
makeLogEntry('WALLET ADDRESS: Invalid')
|
makeLogEntry('ACCOUNT ADDRESS: Invalid')
|
||||||
makeLogEntry('DOMAIN DECODED: Domain field not found')
|
makeLogEntry('DOMAIN DECODED: Domain field not found')
|
||||||
makeLogEntry('CHECKING DOMAIN: Error')
|
makeLogEntry('CHECKING DOMAIN: Error')
|
||||||
makeLogEntry('TOML FILE: Not found')
|
makeLogEntry('TOML FILE: Not found')
|
||||||
makeLogEntry('WALLET CAN NOT BE VERIFIED: Wallet address is not valid.')
|
makeLogEntry('ACCOUNT CAN NOT BE VERIFIED: Account address is not valid.')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@@ -104,7 +104,7 @@ async function parseXrplToml(data) {
|
|||||||
try {
|
try {
|
||||||
parsed = TOML(data)
|
parsed = TOML(data)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
makeLogEntry('WALLET CAN NOT BE VERIFIED: TOML file can not be read.')
|
makeLogEntry('ACCOUNT CAN NOT BE VERIFIED: TOML file can not be read.')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -126,9 +126,9 @@ async function parseXrplToml(data) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (found) {
|
if (found) {
|
||||||
makeLogEntry('WALLET IS PRESENT: Wallet domain verified')
|
makeLogEntry('ACCOUNT IS PRESENT: Account domain verified')
|
||||||
} else {
|
} else {
|
||||||
makeLogEntry('WALLET IS NOT PRESENT: Wallet domain can not be verified')
|
makeLogEntry('ACCOUNT IS NOT PRESENT: Account domain can not be verified')
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
const TOML_PATH = "/.well-known/xrp-ledger.toml"
|
const TOML_PATH = "/.well-known/xrp-ledger.toml"
|
||||||
const TIPS = '<p>Check if the file is actually hosted at the URL above, check your server\'s HTTPS settings and certificate, and make sure your server provides the required <a href="xrp-ledger-toml.html#cors-setup">CORS header.</a></p>'
|
const TIPS = '<p>Check if the file is actually hosted at the URL above, check your server\'s HTTPS settings and certificate, and make sure your server provides the required <a href="xrp-ledger-toml.html#cors-setup">CORS header.</a></p>'
|
||||||
const TIPS_1 = '<p>Make sure you are entering a valid XRP address.</p>'
|
const TIPS_1 = '<p>Make sure you are entering a valid XRP Ledger address.</p>'
|
||||||
const TIPS_2 = '<p>Make sure the wallet address has the domain field.</p>'
|
const TIPS_2 = '<p>Make sure the account has the Domain field set.</p>'
|
||||||
const CLASS_GOOD = "badge badge-success"
|
const CLASS_GOOD = "badge badge-success"
|
||||||
const CLASS_BAD = "badge badge-danger"
|
const CLASS_BAD = "badge badge-danger"
|
||||||
|
|
||||||
@@ -284,7 +284,7 @@ function makeLogEntryWallet(text, raw) {
|
|||||||
|
|
||||||
function fetchWallet() {
|
function fetchWallet() {
|
||||||
wallet = $('#verify-domain').val()
|
wallet = $('#verify-domain').val()
|
||||||
const checkingLog = makeLogEntryWallet('Checking domain of wallet')
|
const checkingLog = makeLogEntryWallet('Checking domain of account')
|
||||||
const url = "wss://xrplcluster.com"
|
const url = "wss://xrplcluster.com"
|
||||||
if (typeof socket !== "undefined" && socket.readyState < 2) {
|
if (typeof socket !== "undefined" && socket.readyState < 2) {
|
||||||
socket.close()
|
socket.close()
|
||||||
@@ -356,34 +356,35 @@ async function parseXRPLTomlWallet(data) {
|
|||||||
let list_wrap = $("<p>"+name+"</p>")
|
let list_wrap = $("<p>"+name+"</p>")
|
||||||
let list_ol = $("<ol>").appendTo(list_wrap)
|
let list_ol = $("<ol>").appendTo(list_wrap)
|
||||||
for (i=0; i<list.length; i++) {
|
for (i=0; i<list.length; i++) {
|
||||||
let entry_wrap = $("<li>").appendTo(list_ol)
|
let entry_def = $("<ul>").appendTo(list_ol)
|
||||||
let entry_def = $("<ul class='mb-3'>").appendTo(entry_wrap)
|
|
||||||
let entry = list[i]
|
let entry = list[i]
|
||||||
for (j=0; j<fields.length; j++) {
|
for (j=0; j<fields.length; j++) {
|
||||||
let fieldname = fields[j]
|
let fieldname = fields[j]
|
||||||
if (entry[fieldname] !== undefined) {
|
if (entry['address'] === wallet) {
|
||||||
let field_def = $("<li><strong>"+fieldname+": </strong>").appendTo(entry_def)
|
let field_def = $("<li><strong>"+fieldname+": </strong>").appendTo(entry_def)
|
||||||
$(" <span class='"+fieldname+"'>").text(entry[fieldname]).appendTo(field_def)
|
$(" <span class='"+fieldname+"'>").text(entry[fieldname]).appendTo(field_def)
|
||||||
|
found=true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (entry['address'] === wallet) {
|
|
||||||
entry_def.append('<li class="badge badge-success">Domain Validated <i class="fa fa-check-circle"></i></li>')
|
|
||||||
found=true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
makeLogEntryWallet(list_wrap, true)
|
|
||||||
if(found) {
|
if(found) {
|
||||||
|
makeLogEntryWallet(list_wrap, true)
|
||||||
makeLogEntryWallet('Account has been found in TOML file and validated.').resolve('DOMAIN VALIDATED <i class="fa fa-check-circle"></i>').addClass(CLASS_GOOD)
|
makeLogEntryWallet('Account has been found in TOML file and validated.').resolve('DOMAIN VALIDATED <i class="fa fa-check-circle"></i>').addClass(CLASS_GOOD)
|
||||||
} else {
|
} else {
|
||||||
makeLogEntryWallet('Account not found in TOML file. Domain can not be verified.').resolve('ERROR').addClass(CLASS_BAD)
|
let entry_def = $("<ul>").appendTo(list_ol)
|
||||||
|
let field_def = $("<li><strong>address: </strong>").appendTo(entry_def)
|
||||||
|
$(" <span class='address'>").text('Not found ').appendTo(field_def).append(' <li class="badge badge-danger">ERROR</li>')
|
||||||
|
|
||||||
|
makeLogEntryWallet(list_wrap, true)
|
||||||
|
makeLogEntryWallet('Account not found in TOML file. Domain can not be verified.').resolve('VALIDATION FAILED').addClass(CLASS_BAD)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (parsed.ACCOUNTS) {
|
if (parsed.ACCOUNTS) {
|
||||||
if (!Array.isArray(parsed.ACCOUNTS)) {
|
if (!Array.isArray(parsed.ACCOUNTS)) {
|
||||||
makeLogEntryWallet("Accounts:").resolve("Wrong type - should be table-array").addClass(CLASS_BAD)
|
makeLogEntryWallet("Account:").resolve("Wrong type - should be table-array").addClass(CLASS_BAD)
|
||||||
} else {
|
} else {
|
||||||
listEntriesWallet("Accounts:", parsed.ACCOUNTS, ACCOUNT_FIELDS)
|
listEntriesWallet("Account:", parsed.ACCOUNTS, ACCOUNT_FIELDS)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,21 @@
|
|||||||
{% extends "base.html.jinja" %}
|
{% extends "base.html.jinja" %}
|
||||||
|
|
||||||
|
{% block bodyclasses %}toml-checker{% endblock %}
|
||||||
|
|
||||||
{% block main %}
|
{% block main %}
|
||||||
<section class="container-fluid">
|
<section class="container-fluid">
|
||||||
<div class="p-3 pb-5">
|
<div class="p-3">
|
||||||
<h1>xrp-ledger.toml Checker</h1>
|
<h1>xrp-ledger.toml Checker</h1>
|
||||||
|
|
||||||
<p>If you run an XRP Ledger validator or use the XRP Ledger for your business, you can provide information about your usage of the XRP Ledger to the world in a machine-readable <a href="https://developers.ripple.com/xrp-ledger-toml.html"><code>xrp-ledger.toml</code> file</a>.</p>
|
<p>If you run an XRP Ledger validator or use the XRP Ledger for your business, you can provide information about your usage of the XRP Ledger to the world in a machine-readable <a href="https://xrpl.org/xrp-ledger-toml.html"><code>xrp-ledger.toml</code> file</a>.</p>
|
||||||
|
|
||||||
<p>This tool allows you to verify that your <code>xrp-ledger.toml</code> file is syntactically
|
</div>
|
||||||
correct and deployed properly.</p><br/>
|
|
||||||
|
<div class="p-3 pb-5">
|
||||||
<form id="domain-entry">
|
<form id="domain-entry">
|
||||||
|
<h4>Look Up By Domain</h4>
|
||||||
|
<p>This tool allows you to verify that your <code>xrp-ledger.toml</code> file is syntactically
|
||||||
|
correct and deployed properly.</p>
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<input id="domain" type="text" class="form-control" required
|
<input id="domain" type="text" class="form-control" required
|
||||||
placeholder="example.com (Domain name to check)"
|
placeholder="example.com (Domain name to check)"
|
||||||
@@ -24,8 +30,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="p-3 pt-5">
|
<div class="p-3 pt-5">
|
||||||
<h4>xrp-ledger domain verification</h4>
|
<h4>Look Up By Account</h4>
|
||||||
<p>This tool checks if an accounts domain is actually owned by them.</p>
|
<p>Enter an XRP Ledger address to see if that account is claimed by the domain it says owns it.</p>
|
||||||
<form id="domain-verification">
|
<form id="domain-verification">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<input id="verify-domain" type="text" class="form-control" required
|
<input id="verify-domain" type="text" class="form-control" required
|
||||||
|
|||||||
Reference in New Issue
Block a user