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 hace 3 años
ethermineapi 219c657c61 update_data code optimization, separate api related stuff to it's own module hace 3 años
.gitignore 65b4e3797e structure rework, implemented cascade deleting hace 3 años
README.md 483977ac44 Typo fix in README.md hace 3 años
connection.go 219c657c61 update_data code optimization, separate api related stuff to it's own module hace 3 años
go.mod 219c657c61 update_data code optimization, separate api related stuff to it's own module hace 3 años
go.sum 6ab6a99648 Initial commit hace 3 años
handlers.go 219c657c61 update_data code optimization, separate api related stuff to it's own module hace 3 años
logger.go 65b4e3797e structure rework, implemented cascade deleting hace 3 años
main.go 5a8cf51c68 Revert "args check could accept partly done args" hace 3 años
message_handler.go 65b4e3797e structure rework, implemented cascade deleting hace 3 años
models.go 65b4e3797e structure rework, implemented cascade deleting hace 3 años
settings.go 65b4e3797e structure rework, implemented cascade deleting hace 3 años
update_data.go 219c657c61 update_data code optimization, separate api related stuff to it's own module hace 3 años

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.