Skip to content

Commit

Permalink
Merge branch 'readme'
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenvinhlinh committed Jan 8, 2022
2 parents 1a0645b + b8bc341 commit 77adb1e
Showing 1 changed file with 47 additions and 14 deletions.
61 changes: 47 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,54 @@
# AlephiumMinerBot
# Alephium Miner Bot

**TODO: Add description**
**Alephium Miner Bot is a telegram bot that sends the following messages**
- Global network hashrate
- Current IP
- Balance & mining reward

## Installation
This bot is inspired by [Diomark](https://www.facebook.com/diomark/). His shell script about checking alph balance & mining time reward is really cool.

If [available in Hex](https://hex.pm/docs/publish), the package can be installed
by adding `alephium_miner_bot` to your list of dependencies in `mix.exs`:
## Dependencies
- Alephium Node: 1.2.0

```elixir
def deps do
[
{:alephium_miner_bot, "~> 0.1.0"}
]
end
## Release
Execute the following command, then project release will be generated at `/alephium_miner_bot/_build/prod/rel/alephium_miner_bot`
```sh
$ mix deps.get
$ MIX_ENV=prod mix release
```

Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)
and published on [HexDocs](https://hexdocs.pm). Once published, the docs can
be found at [https://hexdocs.pm/alephium_miner_bot](https://hexdocs.pm/alephium_miner_bot).
## Execute Release
Make a file named `release_run.sh` or copy it from `release_run.sh.sample`.

```sh
#!/bin/bash

ALPH_NODE_IP=127.0.0.1 \
ALPH_NODE_PORT=12973 \
ALPH_NODE_API_KEY=cf5062725e62d2096228cd6f7ab0f2a0 \
ALPH_NODE_WALLET_NAME=main \
ALPH_NODE_WALLET_PASSWORD="" \
WORKER_HASHRATE_INTERVAL=1800000 \
WORKER_IP_INTERVAL=60000 \
TELEGRAM_BOT_TOKEN=cf5062725e62d2096228cd6f7ab0f2a0 \
TELEGRAM_CHAT_ID=cf5062725e62d2096228cd6f7ab0f2a0 \
_build/prod/rel/alephium_miner_bot/bin/alephium_miner_bot start
```

To execute the release, it's important to provide the following parameters:
- ALPH_NODE_IP: self-explained
- ALPH_NODE_PORT: self-explained
- ALPH_NODE_API_KEY: self-explained
- ALPH_NODE_WALLET_NAME: self-explained
- ALPH_NODE_WALLET_PASSWORD: self-explained
- WORKER_HASHRATE_INTERVAL: interval in microsecond that fetching network hashrate.
- WORKER_IP_INTERVAL: interval in microsecond that fetching IP
- TELEGRAM_BOT_TOKEN: self-explained
- TELEGRAM_CHAT_ID: self-explained


Finally, make the file `release-run.sh` executable and run it
```sh
# Current directory: Project Root
$ ./release_run.sh
```

0 comments on commit 77adb1e

Please sign in to comment.