Skip to content

Commit 59458bb

Browse files
authored
Merge pull request #51 from eosnetworkfoundation/yarkin/version_1
Update README and bump version
2 parents c0dc910 + 0a112ca commit 59458bb

File tree

5 files changed

+22
-14
lines changed

5 files changed

+22
-14
lines changed

.env.example

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@ PORT=50305
1919
# MINER_FEE_MODE and MINER_FEE_PARAMETER will have no effect. Fees will be collected as before.
2020
#
2121
# EOS-EVM version: 1
22-
# MINER_FEE_MODE: cpu|proportion|fixed. Priority fee will be default to 0 if unrecognized mode is set.
22+
# MINER_FEE_MODE: cpu|fixed. Priority fee will be default to 0 if unrecognized mode is set.
2323
MINER_FEE_MODE="cpu"
2424

2525
# MINER_FEE_MODE: cpu
26-
# GAS_PER_CPU: Default: 74.
26+
# GAS_PER_US: Default: 74.
2727
# MINER_MARKUP_PERCENTAGE: Default 0.
2828
# GAS_TOKEN_EXCHANGE_RATE: The rate for EOS-Gas Token, default 1.
29-
# priority_fee = cpu_per_us / GAS_PER_CPU * (1 + MINER_MARKUP_PERCENTAGE/100) * GAS_TOKEN_EXCHANGE_RATE
29+
# priority_fee = cpu_per_us / GAS_PER_US * (1 + MINER_MARKUP_PERCENTAGE/100) * GAS_TOKEN_EXCHANGE_RATE
3030
# cpu_per_us will be estimated automatically.
31-
GAS_PER_CPU=74
31+
GAS_PER_US=74
3232
MINER_MARKUP_PERCENTAGE=10
3333
GAS_TOKEN_EXCHANGE_RATE=1
3434

README.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,19 @@ For every transaction that you relay you will receive a reward in the form of EO
88

99
| Name | Description | Default |
1010
| --- |-------------------------------------------------------------------------------------------------------------------|---------|
11-
| `PRIVATE_KEY` | The private key of the miner account | |
12-
| `MINER_ACCOUNT` | The name of the miner account on the EOS Network | |
13-
| `RPC_ENDPOINTS` | A list of EOS RPC endpoints to connect to, comma-delimited | |
14-
| `PORT` | The port to listen on for incoming Ethereum transactions | `50305` |
15-
| `LOCK_GAS_PRICE` | If set to `true`, one a gas price is set, this miner will not hit the EOS API node again to fetch a new gas price | `true` |
11+
| `PRIVATE_KEY` | The private key of the miner account. | |
12+
| `MINER_ACCOUNT` | The name of the miner account on the EOS Network. | |
13+
| `RPC_ENDPOINTS` | A list of EOS RPC endpoints to connect to, comma-delimited. The list is a failover. list. | |
14+
| `PORT` | The port to listen on for incoming Ethereum transactions. | `50305` |
15+
| `EVM_ACCOUNT` | | `eosio.evm` |
16+
| `EVM_SCOPE` | | |
17+
| `MINER_FEE_MODE` | Set how the miner collect fees after EOS-EVM upgrading to version 1. Can be `CPU` or `FIXED`. | `FIXED` |
18+
| `GAS_PER_CPU` | priority_fee = cpu_per_us / GAS_PER_CPU * (1 + MINER_MARKUP_PERCENTAGE/100) * GAS_TOKEN_EXCHANGE_RATE if MINER_FEE_MODE=`CPU` | 74 |
19+
| `MINER_MARKUP_PERCENTAGE` | priority_fee = cpu_per_us / GAS_PER_CPU * (1 + MINER_MARKUP_PERCENTAGE/100) * GAS_TOKEN_EXCHANGE_RATE if MINER_FEE_MODE=`CPU` | 0 |
20+
| `GAS_TOKEN_EXCHANGE_RATE` | priority_fee = cpu_per_us / GAS_PER_CPU * (1 + MINER_MARKUP_PERCENTAGE/100) * GAS_TOKEN_EXCHANGE_RATE if MINER_FEE_MODE=`CPU` | 1 |
21+
| `FIXED_MINER_FEE` | Fixed priority_fee in wei if MINER_FEE_MODE=`FIXED`. | 0 |
22+
| `EXPIRE_SEC` | Expiration time when broadcasting EOS transaction. | 60 |
23+
| `RETRY_TX` | Whether local Leap node should retry when broadcasting failed. | true |
1624

1725
## Usage
1826

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@enf/eos-evm-miner",
3-
"version": "0.1.1",
3+
"version": "1.0.0",
44
"description": "",
55
"main": "index.js",
66
"scripts": {

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const {
1313
EVM_ACCOUNT = "eosio.evm",
1414
EVM_SCOPE = "eosio.evm",
1515
MINER_PERMISSION = "active",
16-
GAS_PER_CPU = 74,
16+
GAS_PER_US = 74,
1717
EXPIRE_SEC = 60,
1818
MINER_FEE_MODE = "fixed", // default to fixed 0 fee
1919
FIXED_MINER_FEE = 0,
@@ -44,7 +44,7 @@ const eosEvmMiner = new EosEvmMiner({
4444
expireSec: +EXPIRE_SEC,
4545
minerFeeMode: MINER_FEE_MODE,
4646
fixedMinerFee: +FIXED_MINER_FEE,
47-
gasPerCpu: +GAS_PER_CPU,
47+
gasPerUs: +GAS_PER_US,
4848
minerMarkupPercentage: +MINER_MARKUP_PERCENTAGE,
4949
gasTokenExchangeRate: +GAS_TOKEN_EXCHANGE_RATE,
5050
evmAccount: EVM_ACCOUNT,

src/miner.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export interface MinerConfig {
1414
expireSec: number;
1515
minerFeeMode: string;
1616
fixedMinerFee: number;
17-
gasPerCpu: number;
17+
gasPerUs: number;
1818
minerMarkupPercentage: number;
1919
gasTokenExchangeRate: number;
2020
evmAccount: string;
@@ -79,7 +79,7 @@ export default class EosEvmMiner {
7979
// Refresh cpu price first
8080
await this.queryCpuPrice();
8181
// Default to ~74.12 estimated from our benchmarks without OC
82-
let gas_per_us = this.config.gasPerCpu;
82+
let gas_per_us = this.config.gasPerUs;
8383
if (gas_per_us == 0) {
8484
gas_per_us = 1;
8585
}

0 commit comments

Comments
 (0)