首页
首页
文章目录
  1. Mint TRXI with nodejs

trxi铭文脚本mint

​ 早起看到有人在推trx链上的第一个铭文trxi,本着不错过的原则了解了下,总量210万张,按照手续费每张0.14$,打完市值约30w$,性价比极高,果断动手。

​ 按照网上的教程,官方给的文档需要单次点击,无法批量操作,网上看到有人做好的脚本,本地部署,没看到什么安全问题,直接复制过来用了。

Mint TRXI with nodejs

  1. Install Node.js
  2. Create a directory,such as TRC20Mint
  3. Open TRC20Mint, execute command:npm init
  4. Execute command:npm install tronweb
  5. Create an index.js file,copy the code below
  6. Run index.js:node index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
const TronWeb = require('tronweb');
const readline = require('readline');

const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});

function askQuestion(query) {
return new Promise(resolve => {
rl.question(query, resolve);
});
}

async function main() {
const privateKey = await askQuestion('Enter your private key: ');
const targetSuccessCountInput = await askQuestion('Enter the number of successful transactions you want to achieve: ');
const targetSuccessCount = parseInt(targetSuccessCountInput, 10);

if (isNaN(targetSuccessCount)) {
console.error('Invalid number of transactions. Exiting...');
process.exit(1);
}

const HttpProvider = TronWeb.providers.HttpProvider;
const fullNode = new HttpProvider("https://api.trongrid.io");
const solidityNode = new HttpProvider("https://api.trongrid.io");
const eventServer = new HttpProvider("https://api.trongrid.io");
const tronWeb = new TronWeb(fullNode, solidityNode, eventServer, privateKey);

const blackHole = "T9yD14Nj9j7xAB4dbGeiX9h8unkKHxuWwb";
const memo = 'data:,{"p":"trc-20","op":"mint","tick":"trxi","amt":"1000"}';

async function mint() {
const unSignedTxn = await tronWeb.transactionBuilder.sendTrx(blackHole, 1); //0.000001 TRX is the minimum transfer amount.
const unSignedTxnWithNote = await tronWeb.transactionBuilder.addUpdateData(unSignedTxn, memo, 'utf8');
const signedTxn = await tronWeb.trx.sign(unSignedTxnWithNote);
// console.log("signed =>", signedTxn);
const ret = await tronWeb.trx.sendRawTransaction(signedTxn);
// console.log("broadcast =>", ret);
return ret;
}

let successCount = 0;

while (true) {
try {
const ret = await mint();
if (ret && ret.transaction && ret.transaction.txID) {
successCount++;
console.log(Transaction Success ${successCount}: ${ret.transaction.txID});
console.log(Tronscan URL: https://tronscan.org/#/transaction/${ret.transaction.txID});
if (successCount >= targetSuccessCount) {
console.log(Reached target of ${targetSuccessCount} successful transactions.);
break;
}
} else {

}
await require('timers/promises').setTimeout(300);
} catch (error) {

}
}
}

main().then(() => {
rl.close();
});

​ 很好的一个教学模板,以后可以用来套用其他的*RC20铭文mint,按照官方的部署环境后,直接运行就可以了。

🌹
加油,越来越好