Updated Testnet and Parallel Networks information

- Rename "XRP Test Net" to "XRP Ledger Testnet"
- Add XRP Ledger Devnet to tooling
- Update "Parallel Networks" page to describe Testnet & Devnet,
  and fix typos.
- Add "Mainnet" as a name for the production XRP Ledger network (in
  context of testnets)
This commit is contained in:
Ryan Young
2019-08-15 21:36:36 -07:00
committed by mDuo13
parent 95d793cae3
commit 6261eb1672
7 changed files with 94 additions and 48 deletions

View File

@@ -1,39 +1,52 @@
function rippleTestNetCredentials() {
function rippleTestNetCredentials(url, altnet_name) {
var credentials = $('#your-credentials');
var address = $('#address');
var secret = $('#secret');
var balance = $('#balance');
var loader = $('#loader');
const credentials = $('#your-credentials')
const address = $('#address')
const secret = $('#secret')
const balance = $('#balance')
const loader = $('#loader')
//reset the fields initially and for re-generation
credentials.hide();
address.html('');
secret.html('');
balance.html('');
loader.css('display', 'inline');
credentials.hide()
address.html('')
secret.html('')
balance.html('')
loader.css('display', 'inline')
//call the alt-net and get key generations
$.ajax({
url: "https://faucet.altnet.rippletest.net/accounts",
url: url,
type: 'POST',
dataType: 'json',
success: function(data) {
//hide the loader and show results
loader.hide();
credentials.hide().html('<h2>Your Credentials</h2>').fadeIn('fast');
address.hide().html('<h3>Address</h3> ' + data.account.address).fadeIn('fast');
secret.hide().html('<h3>Secret</h3> ' + data.account.secret).fadeIn('fast');
balance.hide().html('<h3>Balance</h3> ' + Number(data.balance).toLocaleString('en') + ' XRP').fadeIn('fast');
credentials.hide().html('<h2>Your Credentials</h2>').fadeIn('fast')
address.hide().html('<h3>Address</h3> ' +
data.account.address).fadeIn('fast')
secret.hide().html('<h3>Secret</h3> ' +
data.account.secret).fadeIn('fast')
balance.hide().html('<h3>Balance</h3> ' +
Number(data.balance).toLocaleString('en') + ' XRP').fadeIn('fast')
},
error: function() {
loader.hide();
alert("There was an error with the Ripple Test Net, please try again.");
alert("There was an error with the "+altnet_name+" faucet. Please try again.");
}
});
})
}
$(document).ready(function() {
$('#generate-creds-button').click(rippleTestNetCredentials);
});
function testnet_click(evt) {
rippleTestNetCredentials("https://faucet.altnet.rippletest.net/accounts",
"Testnet")
}
function devnet_click(evt) {
rippleTestNetCredentials("https://faucet.devnet.rippletest.net/accounts",
"Devnet")
}
$('#testnet-creds-button').click(testnet_click)
$('#devnet-creds-button').click(devnet_click)
})