Skip to content

Commit 002a648

Browse files
author
Jason
committed
可手动配置reth难度(省的官方每更新一次难度,我也得跟着发个版本-_-)
1 parent 143382e commit 002a648

File tree

5 files changed

+16
-4
lines changed

5 files changed

+16
-4
lines changed

app/app.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ func (a *App) RethCalc(difficulty string) string {
6565
TotalTime int
6666
Result string
6767
}
68-
log.Info("reth难度计算中,请稍后...")
68+
log.Info(fmt.Sprintf("reth当前难度:%s,计算中,请稍后...", config.RethConfig.Difficulty))
6969
begin := time.Now()
7070
find := make(chan Result)
7171
temp := `data:application/json,{"p":"rerc-20","op":"mint","tick":"rETH","id":"%s","amt":"10000"}`

main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import (
1010
)
1111

1212
const (
13-
//configPath = "settings.dev.yml" //测试专用
14-
configPath = "settings.yml" //测试专用
13+
configPath = "settings.dev.yml" //测试专用
14+
//configPath = "settings.yml" //正式专用
1515
)
1616

1717
const (
@@ -77,7 +77,7 @@ func main() {
7777

7878
data := config.MintConfig.Data
7979
if config.ChainConfig.ChainType == EvmTypeReth {
80-
data = evmApp.RethCalc(RethDifficulty)
80+
data = evmApp.RethCalc(config.RethConfig.Difficulty)
8181
}
8282

8383
hash, er := evmApp.Mint(data)

settings.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,6 @@ mint:
2424
# 铭文16进制字符串,比如mint马蹄链的anteater,则使用下面铭文(仅限示例,该铭文很有可能已经被mint完了)
2525
# 如果上面chainType配置了reth,则该data参数无需配置(配置了也没任何用处),内部会自动算出提交
2626
data: "0x646174613a2c7b2261223a224e657874496e736372697074696f6e222c2270223a226f7072632d3230222c226f70223a226d696e74222c227469636b223a22616e746561746572222c22616d74223a22313030303030303030227d"
27+
reth:
28+
# 根据官方最新难度,自行进行调整,我目前这里默认给的是2023-12-14最新难度
29+
difficulty: "0x000077777777"

utils/config/config.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ type Config struct {
1212
Logger *Logger `yaml:"logger"`
1313
Chain *Chain `yaml:"chain"`
1414
Mint *Mint `yaml:"mint"`
15+
Reth *Reth `yaml:"reth"`
1516
callbacks []func()
1617
}
1718

@@ -44,6 +45,7 @@ func Setup(s source.Source,
4445
Chain: ChainConfig,
4546
Mint: MintConfig,
4647
Logger: LoggerConfig,
48+
Reth: RethConfig,
4749
callbacks: fs,
4850
}
4951
var err error

utils/config/reth.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package config
2+
3+
type Reth struct {
4+
Difficulty string //难度,根据官方调整
5+
}
6+
7+
var RethConfig = new(Reth)

0 commit comments

Comments
 (0)