Since PoW Ethereum mining is over deprecated.
Just like https://gogs.veloe.link/Veloe/EthemineTelegramBotCore but in Golang!

TooManySugar 483977ac44 Typo fix in README.md 3 lat temu
ethermineapi 219c657c61 update_data code optimization, separate api related stuff to it's own module 3 lat temu
.gitignore 65b4e3797e structure rework, implemented cascade deleting 3 lat temu
README.md 483977ac44 Typo fix in README.md 3 lat temu
connection.go 219c657c61 update_data code optimization, separate api related stuff to it's own module 3 lat temu
go.mod 219c657c61 update_data code optimization, separate api related stuff to it's own module 3 lat temu
go.sum 6ab6a99648 Initial commit 3 lat temu
handlers.go 219c657c61 update_data code optimization, separate api related stuff to it's own module 3 lat temu
logger.go 65b4e3797e structure rework, implemented cascade deleting 3 lat temu
main.go 5a8cf51c68 Revert "args check could accept partly done args" 3 lat temu
message_handler.go 65b4e3797e structure rework, implemented cascade deleting 3 lat temu
models.go 65b4e3797e structure rework, implemented cascade deleting 3 lat temu
settings.go 65b4e3797e structure rework, implemented cascade deleting 3 lat temu
update_data.go 219c657c61 update_data code optimization, separate api related stuff to it's own module 3 lat temu

README.md

About

GoEthemineTelegramBot is attempt to port EthemineTelegramBotCore into Golang.

Why?

  • For ease of maintain project further with backward compatibility with EthemineTelegramBotCore to use the same MySQL database.
  • Creating simple and easy to use docker or potman container for fast deployment
  • Practice in work with Go

Progress

Face to face porting

  • AppSettings.cs - settings.go
  • DataUpdater.cs Updater in main.go
  • EFDatabase.cs - Not needed: analog - models.go
  • JsonDownloader.cs - unmasrshal_url.go
    • JsonCurrentStats.cs - in api_structs.go
    • JsonNetworkStats.cs - in api_structs.go
    • JsonPayouts.cs - in api_structs.go
    • JsonWorker.cs - in api_structs.go
    • Logger.cs
    • Program.cs
  • Main - Fully ported needs testing
    • BotOnMessage
    • GetActualRate
    • GetActualData
    • GetActualDataFromDatabase
    • AddUser
    • SetWallet
    • DeleteUser
    • SendHelp
    • GetLastPayout
    • UpdateData.cs - Fully ported needs testing

Usage

As for now where are no releases for GoEthemineTelegramBot, so to run it you need to compile it by yourself. It's easy you will see.

Compiling from source

Simply run following commands depending on your OS in project's root directory:

Linux/Mac

# go build -o GoEthemineTelegramBot .

Windows

> go build -o GoEthemineTelegramBot.exe .

First launch

As for first launch you dont need to specify anything, just start the bot:

Linux/Mac

# ./GoEthemineTelegramBot

Windows

> GoEthemineTelegramBot.exe

GoEthemineTelegramBot will generate config template config.json in its working directory. With this stucture:

{
  "Token": "",
  "ApiUrl": "",
  "DbHost": "",
  "DbName": "",
  "FullLogPath": "",
  "ErrorLogPath": "",
  "Currency": ""
}

Fill the brackets with settings suitable for you. Example:

{
  "Token": "idontsayyoumytopsecrettelegrambottokennever",
  "ApiUrl": "https://api.ethermine.org",
  "DbHost": "127.0.0.1",
  "DbName": "telegrambotdb",
  "FullLogPath": "logs\full.log",
  "ErrorLogPath": "logs\error.log",
  "Currency": "ETH"
}
Note

Make sure to create schema with right* tables at your server: GoEthemineTelegramBot can't create or check if tables structure right or not on it's own ... for now!

*I will not say you what is right

Normal launch

After launch GoEthemineTelegramBot will ask you for username and password for specified database. You can skip it by launching it with arguments like this:

Linux/Mac

# ./GoEthemineTelegramBot username password

Windows

> GoEthemineTelegramBot.exe username password

Stopping bot

I will not stop you from stopping bot with Ctrl+C. But I should say that you could stop bot by pressing Enter. I never stop the bot this way thou.