trxi铭文脚本mint
2023.11.25
jinance
学习
 热度
℃
早起看到有人在推trx链上的第一个铭文trxi,本着不错过的原则了解了下,总量210万张,按照手续费每张0.14$,打完市值约30w$,性价比极高,果断动手。
按照网上的教程,官方给的文档需要单次点击,无法批量操作,网上看到有人做好的脚本,本地部署,没看到什么安全问题,直接复制过来用了。
Mint TRXI with nodejs
Install Node.js
Create a directory,such as TRC20Mint
Open TRC20Mint
, execute command:npm init
Execute command:npm install tronweb
Create an index.js file,copy the code below
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 ); const unSignedTxnWithNote = await tronWeb.transactionBuilder .addUpdateData (unSignedTxn, memo, 'utf8' );const signedTxn = await tronWeb.trx .sign (unSignedTxnWithNote);const ret = await tronWeb.trx .sendRawTransaction (signedTxn);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 :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,按照官方的部署环境后,直接运行就可以了。