├── Extention-Version-v0.1 ├── proxy.txt ├── package.json ├── configuration.js └── main.js ├── SCRIPT-V0.2 └── getGrass_Desktop.zip ├── SCRIPT-V0.3 └── Update-getgrass-V0.3.zip ├── SCRIPT-V0.3.1-Minor └── Minor-Update-getgrass-bot-v0.3.1.zip └── README.md /Extention-Version-v0.1/proxy.txt: -------------------------------------------------------------------------------- 1 | // format proxies is => socks5://username:pass@ip:port -------------------------------------------------------------------------------- /SCRIPT-V0.2/getGrass_Desktop.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmalf/getgrass-bot-js/HEAD/SCRIPT-V0.2/getGrass_Desktop.zip -------------------------------------------------------------------------------- /SCRIPT-V0.3/Update-getgrass-V0.3.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmalf/getgrass-bot-js/HEAD/SCRIPT-V0.3/Update-getgrass-V0.3.zip -------------------------------------------------------------------------------- /SCRIPT-V0.3.1-Minor/Minor-Update-getgrass-bot-v0.3.1.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cmalf/getgrass-bot-js/HEAD/SCRIPT-V0.3.1-Minor/Minor-Update-getgrass-bot-v0.3.1.zip -------------------------------------------------------------------------------- /Extention-Version-v0.1/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "crypto": "^1.0.1", 4 | "fs": "^0.0.1-security", 5 | "pino": "^9.5.0", 6 | "pino-pretty": "^13.0.0", 7 | "socks-proxy-agent": "^8.0.4", 8 | "uuid": "^11.0.3", 9 | "ws": "^8.18.0" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Extention-Version-v0.1/configuration.js: -------------------------------------------------------------------------------- 1 | // configuration 2 | const config = { 3 | "User-Agent": "xxxxxxx", // Replace with Your useragent 4 | "Origin": "chrome-extension://xxxxxxx", // Replace with Your chrome-extension ID HERE 5 | extension_id: "xxxxxxx", // Replace with Your chrome-extension ID HERE 6 | userId: 'xxxxx-xxx-xxxxx-xxxx-xxxxxxxx', // Replace with Your User ID HERE 7 | proxyFile: 'proxy.txt' // your Path to Proxy.txt file 8 | // format proxies is => socks5://username:pass@ip:port 9 | }; 10 | 11 | module.exports = config; -------------------------------------------------------------------------------- /Extention-Version-v0.1/main.js: -------------------------------------------------------------------------------- 1 | const WebSocket = require('ws'); 2 | const fs = require('fs'); 3 | const crypto = require('crypto'); 4 | const { SocksProxyAgent } = require('socks-proxy-agent'); 5 | const { v4: uuidv4, v3: uuidv3 } = require('uuid'); 6 | const pino = require('pino'); 7 | const logger = pino({ level: 'info', transport: { target: 'pino-pretty' } }); 8 | const config = require('./configuration'); 9 | 10 | let CoderMarkPrinted = false; 11 | 12 | const cl = { 13 | gr: '\x1b[32m', 14 | br: '\x1b[34m', 15 | red: '\x1b[31m', 16 | yl: '\x1b[33m', 17 | gb: '\x1b[4m', 18 | rt: '\x1b[0m' 19 | }; 20 | 21 | function CoderMark() { 22 | if (!CoderMarkPrinted) { 23 | console.log(` 24 | ╭━━━╮╱╱╱╱╱╱╱╱╱╱╱╱╱╭━━━┳╮ 25 | ┃╭━━╯╱╱╱╱╱╱╱╱╱╱╱╱╱┃╭━━┫┃${cl.gr} 26 | ┃╰━━┳╮╭┳━┳━━┳━━┳━╮┃╰━━┫┃╭╮╱╭┳━╮╭━╮ 27 | ┃╭━━┫┃┃┃╭┫╭╮┃╭╮┃╭╮┫╭━━┫┃┃┃╱┃┃╭╮┫╭╮╮${cl.br} 28 | ┃┃╱╱┃╰╯┃┃┃╰╯┃╰╯┃┃┃┃┃╱╱┃╰┫╰━╯┃┃┃┃┃┃┃ 29 | ╰╯╱╱╰━━┻╯╰━╮┣━━┻╯╰┻╯╱╱╰━┻━╮╭┻╯╰┻╯╰╯${cl.rt} 30 | ╱╱╱╱╱╱╱╱╱╱╱┃┃╱╱╱╱╱╱╱╱╱╱╱╭━╯┃ 31 | ╱╱╱╱╱╱╱╱╱╱╱╰╯╱╱╱╱╱╱╱╱╱╱╱╰━━╯ 32 | \n${cl.gb}${cl.yl}getGrass Minner Bot ${cl.rt}${cl.gb}v0.2${cl.rt} 33 | `); 34 | CoderMarkPrinted = true; 35 | } 36 | } 37 | 38 | async function connectToWss(socks5Proxy, userId) { 39 | const deviceId = uuidv3(socks5Proxy, uuidv3.DNS); 40 | logger.info(deviceId); 41 | while (true) { 42 | try { 43 | await new Promise(resolve => setTimeout(resolve, Math.random() * 900 + 100)); 44 | const customHeaders = { "User-Agent": config.UserAgent }; 45 | const uriList = ["wss://proxy2.wynd.network:4444/", "wss://proxy2.wynd.network:4650/"]; 46 | const uri = uriList[Math.floor(Math.random() * uriList.length)]; 47 | const agent = new SocksProxyAgent(socks5Proxy); 48 | const ws = new WebSocket(uri, { 49 | agent: agent, 50 | headers: { 51 | "Origin": config["Origin"], 52 | "User-Agent": customHeaders["User-Agent"] 53 | }, 54 | rejectUnauthorized: false 55 | }); 56 | ws.on('open', () => { 57 | const sendPing = () => { 58 | const sendMessage = JSON.stringify({ id: uuidv4(), version: "1.0.0", action: "PING", data: {} }); 59 | logger.debug(sendMessage); 60 | ws.send(sendMessage); 61 | setTimeout(sendPing, 110000); 62 | }; 63 | sendPing(); 64 | }); 65 | 66 | ws.on('message', (data) => { 67 | const message = JSON.parse(data); 68 | logger.info(message); 69 | if (message.action === "AUTH") { 70 | const authResponse = { 71 | id: message.id, 72 | origin_action: "AUTH", 73 | result: { 74 | browser_id: deviceId, 75 | user_id: userId, 76 | user_agent: customHeaders['User-Agent'], 77 | timestamp: Math.floor(Date.now() / 1000), 78 | device_type: "extension", 79 | version: "4.26.2", 80 | extension_id: config.extension_id 81 | } 82 | }; 83 | logger.debug(authResponse); 84 | ws.send(JSON.stringify(authResponse)); 85 | } else if (message.action === "PONG") { 86 | const pongResponse = { id: message.id, origin_action: "PONG" }; 87 | logger.debug(pongResponse); 88 | ws.send(JSON.stringify(pongResponse)); 89 | } 90 | }); 91 | 92 | await new Promise((resolve, reject) => { 93 | ws.on('close', () => reject(new Error('WebSocket closed'))); 94 | ws.on('error', (error) => reject(error)); 95 | }); 96 | } catch (e) { 97 | logger.error(`Error with proxy ${socks5Proxy}: ${e.message}`); 98 | if (["Host unreachable", "[SSL: WRONG_VERSION_NUMBER]", "invalid length of packed IP address string", "Empty connect reply", "Device creation limit exceeded", "sent 1011 (internal error) keepalive ping timeout; no close frame received"].some(msg => e.message.includes(msg))) { 99 | logger.info(`Removing error proxy from the list: ${socks5Proxy}`); 100 | removeProxyFromList(socks5Proxy); 101 | return null; 102 | } 103 | } 104 | } 105 | } 106 | 107 | async function main() { 108 | const proxyFile = config.proxyFile; 109 | const userId = config.userId; 110 | const allProxies = fs.readFileSync(proxyFile, 'utf-8').split('\n').filter(Boolean); 111 | let activeProxies = allProxies.sort(() => 0.5 - Math.random()).slice(0, 100); 112 | let tasks = new Map(activeProxies.map(proxy => [connectToWss(proxy, userId), proxy])); 113 | 114 | while (true) { 115 | const [done] = await Promise.race([...tasks.keys()].map(p => p.then(() => [p]))); 116 | const failedProxy = tasks.get(done); 117 | tasks.delete(done); 118 | 119 | if (await done === null) { 120 | logger.info(`Removing and replacing failed proxy: ${failedProxy}`); 121 | activeProxies = activeProxies.filter(p => p !== failedProxy); 122 | const newProxy = allProxies[Math.floor(Math.random() * allProxies.length)]; 123 | activeProxies.push(newProxy); 124 | tasks.set(connectToWss(newProxy, userId), newProxy); 125 | } 126 | 127 | for (const proxy of activeProxies) { 128 | if (![...tasks.values()].includes(proxy)) { 129 | tasks.set(connectToWss(proxy, userId), proxy); 130 | } 131 | } 132 | } 133 | } 134 | 135 | function removeProxyFromList(proxy) { 136 | const proxyFile = config.proxyFile; 137 | const proxyList = fs.readFileSync(proxyFile, "utf-8").split('\n'); 138 | const updatedList = proxyList.filter(line => line.trim() !== proxy); 139 | fs.writeFileSync(proxyFile, updatedList.join('\n')); 140 | } 141 | CoderMark(); 142 | main().catch(console.error); 143 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 🌱 getgrass-miner-bot-js 2 | 3 | ## GetGrass Season 2 mining 4 | 5 | - A Node.js bot script to automate grass Season 2 mining. 6 | 7 | [tg-clk]: https://t.me/+1C6KHwq4HWE4OThl 8 | [tg-c]: https://img.shields.io/badge/Telegram_Channel:-The_Digital_Alchemist_(CMALF)-B22222.svg?&style=for-the-badge&logo=Telegram&logoColor=blue&color=blue 9 | [tg-g]: https://img.shields.io/badge/Telegram_Group:-TDA_(CMALF)_Chat-B22222.svg?&style=for-the-badge&logo=Telegram&logoColor=blue&color=gold 10 | [tg-glk]: https://t.me/+O_0eLwojWD03MDU1 11 | 12 | [![tg-clk][tg-c]][tg-clk]
[![tg-glk][tg-g]][tg-glk] 13 | 14 | ## ⛩ Release Table 15 | 16 | | Bot Version | Status(Work/Not/(N/A) ) | 17 | |---|---| 18 | | [grass-desktop-v0.2](https://github.com/cmalf/getgrass-bot-js/releases/tag/grass-desktop-v0.2) | Not | 19 | | [getgrass-bot-v0.3](https://github.com/cmalf/getgrass-bot-js/releases/tag/getgrass-bot-v0.3) | Not | 20 | | [getgrass-bot-v0.3.1-minor-update](https://github.com/cmalf/getgrass-bot-js/releases/tag/getgrass-bot-v0.3.1-minor) | Not | 21 | | [getgrass-bot-v0.4](https://github.com/cmalf/getgrass-bot-js/releases/tag/getgrass-script-v0.4-Freemium) | Not ( New Authentication Method ) | 22 | | [getgrass-bot-v0.4.1-Beta](https://github.com/cmalf/getgrass-bot-js/releases/tag/getgrass-script-v0.4.1-Freemium-mu) | Not ( the bot is dead ) | 23 | | [getgrass-bot-v0.4.1-Extension-GM](https://github.com/cmalf/getgrass-bot-js/releases/tag/getgrass-bot-v0.4.1-Extension-GM) | Not ( #Grass Update "Airdrop Terms" ) ( the bot is dead ) | 24 | | [getgrass-bot-v0.4.1-Ext-Multi](https://github.com/cmalf/getgrass-bot-js/releases/tag/getgrass-bot-v0.4.1-Extension-GM) | Not ( #Grass Update "Airdrop Terms" ) ( the bot is dead ) | 25 | | [getgrass-bot-v0.4.1-Comunity-Extension-1.25x ](https://github.com/cmalf/getgrass-bot-js/releases/tag/getgrass-bot-v0.4.1-Extension-GM) | Not ( #Grass Update "Airdrop Terms" ) ( the bot is dead ) | 26 | | [getgrass-bot-v0.4.2-Community-Extension-GM-All](https://github.com/cmalf/getgrass-bot-js/releases/tag/getgrass-bot-v0.4.2-GM-ALL) | Not ( #Grass Update "Airdrop Terms" ) ( the bot is dead ) | 27 | | [getgrass-bot-v0.4.3-Extended-V2](https://github.com/cmalf/getgrass-bot-js/releases/tag/ggb-v0.4.3-ExtendedV2) | Not ( #Grass Update "Airdrop Terms" ) ( the bot is dead ) | 28 | | [ggb-freemium-v1.1.5](https://github.com/cmalf/getgrass-bot-js/releases/tag/ggb-premium-v1.1.5) | Not [extension version is closed!](Wait for the mobile version to be released!) | 29 | | [ggb-premium-bundle-autoref](https://github.com/cmalf/getgrass-bot-js/releases/tag/ggb-auto-reff-combo) | Not [extension version is closed!](Wait for the mobile version to be released!) | 30 | 31 | ## 🗣 Discussions 32 | 33 | | Discussions | Status(Open/Close/Announcement) | 34 | |---|---| 35 | | [Welcome to getgrass-bot-js Discussions!](https://github.com/cmalf/getgrass-bot-js/discussions/3) | Announcement | 36 | | [Release getgrass-bot-v0.3](https://github.com/cmalf/getgrass-bot-js/discussions/4) | Close | 37 | | [Release getgrass-bot-v0.4-Freemium](https://github.com/cmalf/getgrass-bot-js/discussions/9)| Close | 38 | | [getgrass desktop version (script) 📢❗🚨](https://github.com/cmalf/getgrass-bot-js/discussions/16) | Close ‧₊˚🎄✩ ₊˚🦌⊹♡ | 39 | | [Release ggb-v0.4.2-Community-Extension-GM-All](https://github.com/cmalf/getgrass-bot-js/discussions/18) | Close | 40 | | [New Release ggb-v0.4.3-Extended-V2 #20](https://github.com/cmalf/getgrass-bot-js/discussions/20) | Close | 41 | | [General Discussion!](https://github.com/cmalf/getgrass-bot-js/discussions/26) | Open | 42 | 43 | > [!WARNING] 44 | > I am not responsible for any loss or damage caused by this bot. Use it at your own risk. 45 | 46 | 47 | ## 📝 Description 48 | 49 | ### 🖇️ "Maximize Your Grass Node Mining Profits with This Automated Scripting Bot" 50 | 51 | ### 🖇️ This Node.js-based JavaScript script automates Grass Node mining, optimizing your earnings by: 52 | 53 | - Managing Multiple IP Addresses: Rotates through multiple IP addresses (via proxy) to bypass rate limits and maximize uptime. 54 | 55 | - Efficient WebSocket Management: Seamlessly handles WebSocket connections using HTTP/SOCKS protocols for reliable and efficient for mining. 56 | 57 | ### 🖇️ Ideal for: 58 | 59 | - Grass Node miners seeking to streamline their Mining operations 60 | - Users wanting to optimize WebSocket connections, especialy for getgrass node 61 | 62 | ### 💰 "Take Your Mining to the Next Level: Boost Your Profits Today!" 💸 63 | 64 | 65 | ## 🔓 Register 66 | 67 | - if you don't have a grass account yet, SignUp Here [getgrass.io](https://app.getgrass.io/register/?referralCode=276JtwamaXly4nM) 68 | 69 | ## 🤔 How To Do 70 | 71 | ## Check [⛩ Release Table](https://github.com/cmalf/getgrass-bot-js/edit/main/README.md#-table-release) (To downloads The latest version of the bot script ) 72 | 73 | - Install Dependencies 74 | - ```bash 75 | npm i 76 | ``` 77 | - Run The Script 78 | 79 | - ```bash 80 | npm start 81 | ``` 82 | 83 | ## ⚙️ Configuration 84 | 85 | - Get UserId 86 | 87 | - Login to your grass account 88 | - Go to Dashboard 89 | - Right Click Open New Tab [get-UserId](https://api.grass.io/retrieveUser) 90 | - format proxies is: `'Protocol://username:password@host:port'` 91 | 92 | ## 📸 ScreenShoot 93 | 94 | - Dahsboard 95 | 97 |
98 | Click to see image 99 | Grass Dahsboard 100 |
101 |
102 | 103 | - Script 104 | 106 |
107 | Click to see image 108 | Grass Script 109 |
110 |
111 | 136 | --------------------------------------------------------------------------------