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

TooManySugar bde3a495b3 further decomposition of update_data 3 år sedan
botsettings a133afafef appsettings(botsettings now) separated to module 3 år sedan
ethermineapi 69f2512445 general UpdateWallet decomposition 3 år sedan
.gitignore 65b4e3797e structure rework, implemented cascade deleting 3 år sedan
README.md 483977ac44 Typo fix in README.md 3 år sedan
connection.go a133afafef appsettings(botsettings now) separated to module 3 år sedan
go.mod a133afafef appsettings(botsettings now) separated to module 3 år sedan
go.sum 6ab6a99648 Initial commit 3 år sedan
handlers.go a133afafef appsettings(botsettings now) separated to module 3 år sedan
logger.go a133afafef appsettings(botsettings now) separated to module 3 år sedan
main.go bde3a495b3 further decomposition of update_data 3 år sedan
message_handler.go bde3a495b3 further decomposition of update_data 3 år sedan
models.go 65b4e3797e structure rework, implemented cascade deleting 3 år sedan
update_data.go bde3a495b3 further decomposition of update_data 3 år sedan

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.