Skip to content

Commit

Permalink
去除reth项目相关代码
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason committed Dec 29, 2023
1 parent 946c019 commit 76a654d
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 42 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ evm生态铭文脚本
![示例](/example.jpg)

# 功能
1. 理论上目前支持所有evm生态相关公链的铭文mint,目前我只测试了`https://evm.ink/` 中的三条公链`ethereum、bnb、马蹄`,一次性mint千八百张没什么问题,只要你gas足够多
2. 支持[reth](https://reth.cc/list) 的mint,貌似进度已经90%多,还剩不到1万张。这个需要cpu计算,然后才能mint,这整个过程我也整合了。
1. 理论上目前支持所有evm生态相关公链的铭文mint,目前我测试了`https://evm.ink/` 中的三条公链`ethereum、bnb、马蹄`,包括AVAX也测试通过,一次性mint千八百张没什么问题,只要你gas足够多

# 编译
需要有golang环境,`1.21.5`及以上的版本
Expand Down
15 changes: 3 additions & 12 deletions app/app.go
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
package app

import (
"encoding/hex"
"evm-inscriptions/utils/config"
"evm-inscriptions/utils/log"
"fmt"
"github.com/bitxx/ethutil"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/crypto"
"math/rand"
"runtime"
"strings"
"time"
)

type App struct {
Expand Down Expand Up @@ -55,11 +46,11 @@ func (a *App) Mint(data string) (hash string, err error) {

// RethCalc
//
// @Description: reth计算难度结果
// @Description: reth计算难度结果。这个是以前reth项目计算难度的方法,该项目已mint结束,注销此方法
// @receiver a
// @param difficulty
// @return string
func (a *App) RethCalc(difficulty string) string {
/*func (a *App) RethCalc(difficulty string) string {
type Result struct {
TotalTime int
Expand Down Expand Up @@ -101,4 +92,4 @@ func (a *App) RethCalc(difficulty string) string {
return result
}
}
}
}*/
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ require (
github.com/bitxx/ethutil v1.1.2
github.com/bitxx/load-config v1.6.0
github.com/bitxx/logger v1.6.2
github.com/ethereum/go-ethereum v1.10.22
github.com/shopspring/decimal v1.3.1
)

Expand All @@ -20,6 +19,7 @@ require (
github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce // indirect
github.com/deckarep/golang-set v1.8.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect
github.com/ethereum/go-ethereum v1.10.22 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/go-ole/go-ole v1.2.1 // indirect
github.com/go-stack/stack v1.8.0 // indirect
Expand Down
15 changes: 3 additions & 12 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,8 @@ import (
)

const (
//configPath = "settings.dev.yml" //测试专用
configPath = "settings.yml" //正式专用
)

const (
EvmTypeReth = "reth"
configPath = "settings.dev.yml" //测试专用
//configPath = "settings.yml" //正式专用
)

func init() {
Expand Down Expand Up @@ -73,12 +69,7 @@ func main() {
}
log.Infof("当前账户余额:%s", balance.DivRound(accuracyEth, 4))

data := config.MintConfig.Data
if config.ChainConfig.ChainType == EvmTypeReth {
data = evmApp.RethCalc(config.RethConfig.Difficulty)
}

hash, er := evmApp.Mint(data)
hash, er := evmApp.Mint(config.MintConfig.Data)
err = er
if err != nil {
log.Errorf("第%d张mint异常,原因:%s", i, err)
Expand Down
8 changes: 2 additions & 6 deletions settings.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
## *** 下方各项配置,确保输入配置格式正确,配置信息首尾注意不要留有空格等,当前版本暂不支持trimspace ***
application:
# 项目名称,无需修改
name: evm-inscriptions
chain:
# evm 通用evm的基本方式打mint,一般情况下,每个平台的mint都是支付手续费,data输入内容,即可mint
# reth 算力计算,获取结果,然后再去mint,此时不需要配置下方mint中的data
# evm:evm通用mint类型,当前只支持该类型,无需修改
chainType: "evm"
# 链结点地址
# 备注:可前往此处 https://publicnode.com/ 查找满足你需要的免费evm结点url,比如下方配置里使用了马蹄链
Expand All @@ -22,8 +22,4 @@ mint:
# 配置gasLimit
gasLimit: "根据实际情况设置"
# 铭文16进制字符串,比如mint马蹄链的anteater,则使用下面铭文(仅限示例,该铭文很有可能已经被mint完了)
# 如果上面chainType配置了reth,则该data参数无需配置(配置了也没任何用处),内部会自动算出提交
data: "0x646174613a2c7b2261223a224e657874496e736372697074696f6e222c2270223a226f7072632d3230222c226f70223a226d696e74222c227469636b223a22616e746561746572222c22616d74223a22313030303030303030227d"
reth:
# 根据官方最新难度,自行进行调整,我目前这里默认给的是2023-12-14最新难度
difficulty: "0x000077777777"
2 changes: 0 additions & 2 deletions utils/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ type Config struct {
Logger *Logger `yaml:"logger"`
Chain *Chain `yaml:"chain"`
Mint *Mint `yaml:"mint"`
Reth *Reth `yaml:"reth"`
callbacks []func()
}

Expand Down Expand Up @@ -45,7 +44,6 @@ func Setup(s source.Source,
Chain: ChainConfig,
Mint: MintConfig,
Logger: LoggerConfig,
Reth: RethConfig,
callbacks: fs,
}
var err error
Expand Down
7 changes: 0 additions & 7 deletions utils/config/reth.go

This file was deleted.

0 comments on commit 76a654d

Please sign in to comment.