mirror of
https://git.hush.is/hush/hsc-creator.git
synced 2025-10-04 00:01:54 -04:00
144 lines
4.6 KiB
JavaScript
144 lines
4.6 KiB
JavaScript
new Vue({
|
|
el: '#app',
|
|
data: {
|
|
name: 'TUSH',
|
|
flavor: '',
|
|
path: '',
|
|
command: '',
|
|
peersList: [
|
|
],
|
|
optionz2z: 1,
|
|
optionServer: 1,
|
|
optionTor: 0,
|
|
optionGen: 0,
|
|
optionGenProcLimit: 2,
|
|
optionEquihashSolver: 'tromp',
|
|
optionAllowList: [],
|
|
tempAllowlist: '',
|
|
customPath: 0,
|
|
customMinerToAddress: 0,
|
|
optionName: 'COINNAME',
|
|
optionAlgo: ' -ac_algo=randomx ',
|
|
optionFoundersPerc: '',
|
|
optionFoundersSats: '',
|
|
optionPerc: '',
|
|
optionPubkey: '',
|
|
optionReward: '1250000000', // in puposhis
|
|
optionz2z: 1,
|
|
optionSupply: '0',
|
|
optionBlocktime: 60,
|
|
optionHalving: 210000,
|
|
optionRpcAllowIp: '127.0.0.1',
|
|
optionRpcUser: 'rpcuser',
|
|
optionRpcPassword: Math.random().toString(36).slice(2),
|
|
optionTestNode: 0,
|
|
optionShowMetrics: 0,
|
|
optionDataDir: '',
|
|
optionZIndex: 0,
|
|
optionAddrIndex: 0,
|
|
optionSpentIndex: 0,
|
|
optionTimestampIndex: 0
|
|
},
|
|
methods: {
|
|
setFlavor: function (option) {
|
|
this.flavor = option
|
|
if (this.flavor == 'Linux') {
|
|
this.path = '/home/user/.hush/HUSH3.conf'
|
|
} else if (this.flavor == "Mac OS") {
|
|
this.path = '~/Library/Application Support/Hush/HUSH3.conf'
|
|
} else {
|
|
this.path = 'C:\\Users\\your_username\\AppData\\Roaming\\Hush\\HUSH3.conf'
|
|
}
|
|
$('.flavor-banner').show()
|
|
$(document.body).animate({
|
|
'scrollTop': $('#build').offset().top
|
|
}, 1200);
|
|
},
|
|
showPathInput: function () {
|
|
$('#paths').toggle()
|
|
},
|
|
pickPath: function () {
|
|
|
|
},
|
|
showMinerInfo: function () {
|
|
$('#threads').toggle()
|
|
$('#minerAddress').toggle()
|
|
|
|
if (this.customMinerToAddress == 1) {
|
|
$('#minerInput').toggle()
|
|
}
|
|
},
|
|
showMinerAddress: function () {
|
|
$('#minerInput').toggle()
|
|
},
|
|
decreaseThreads: function () {
|
|
if (this.optionGenProcLimit != 0) {
|
|
this.optionGenProcLimit--
|
|
}
|
|
},
|
|
increaseThreads: function () {
|
|
this.optionGenProcLimit++
|
|
},
|
|
addAllowList: function (value) {
|
|
this.optionAllowList.push(value)
|
|
this.tempAllowlist = ''
|
|
},
|
|
removeAllowListItem: function (item) {
|
|
console.log(item)
|
|
var index = this.optionAllowList.indexOf(item)
|
|
this.optionAllowList.splice(index, 1)
|
|
},
|
|
compile: function () {
|
|
var currentdate = new Date();
|
|
var compileTime = currentdate.getDate() + "/"
|
|
+ (currentdate.getMonth()+1) + "/"
|
|
+ currentdate.getFullYear() + " @ "
|
|
+ currentdate.getHours() + ":"
|
|
+ currentdate.getMinutes() + ":"
|
|
+ currentdate.getSeconds()
|
|
this.command = "<p class='chain-command' id='commandOutput' >./hush-smart-chain -ac_name=" + this.optionName + this.optionAlgo
|
|
+ " -ac_supply=" + this.optionSupply + " -ac_blocktime=" + this.optionBlocktime + " -ac_private=" + this.optionz2z;
|
|
this.command += " -ac_reward=" + this.optionReward + " -ac_halving=" + this.optionHalving;
|
|
if(this.optionFoundersPerc != '')
|
|
this.command += " -ac_founders=" + this.optionFoundersPerc;
|
|
if(this.optionFoundersSats != '')
|
|
this.command += " -ac_founders_reward=" + this.optionFoundersSats;
|
|
if(this.optionPerc != '')
|
|
this.command += " -ac_perc=" + this.optionPerc;
|
|
if(this.optionPubkey != '')
|
|
this.command += " -ac_pubkey=" + this.optionPubkey;
|
|
if(this.optionTestNode)
|
|
this.command += " -testnode=1";
|
|
if(this.optionGen)
|
|
this.command += " -gen=1";
|
|
|
|
|
|
|
|
|
|
if (this.optionAllowList.length != 0) {
|
|
this.command += " -addnode=" + this.optionAllowList
|
|
}
|
|
for (var i = 0; i< this.peersList.length; i++) {
|
|
if (i == 0) {
|
|
this.command += this.conf + "<br />"
|
|
}
|
|
this.command += this.conf + "<br />addnode=" + this.peersList[i]
|
|
}
|
|
|
|
this.command += " <p/>";
|
|
|
|
$('#profile').show()
|
|
$('#clapping').show();
|
|
}
|
|
}
|
|
});
|
|
|
|
function copyText() {
|
|
var copyText = document.getElementById("commandOutput").innerText;
|
|
// copyText.select();
|
|
// copyText.setSelectionRange(0, 99999);
|
|
navigator.clipboard.writeText(copyText);
|
|
|
|
}
|
|
|