Skip to content

Commit b04d8b5

Browse files
authored
Add Op-reth component (#74)
1 parent f86bffe commit b04d8b5

File tree

3 files changed

+37
-1
lines changed

3 files changed

+37
-1
lines changed

internal/catalog.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ func init() {
1616
register(&ClProxy{})
1717
register(&MevBoostRelay{})
1818
register(&RollupBoost{})
19+
register(&OpReth{})
1920
}
2021

2122
func FindComponent(name string) Service {

internal/components.go

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,3 +440,33 @@ func (m *MevBoostRelay) Watchdog(out io.Writer, service *service, ctx context.Co
440440

441441
return watchGroup.wait()
442442
}
443+
444+
type OpReth struct {
445+
}
446+
447+
func (o *OpReth) Run(service *service, ctx *ExContext) {
448+
panic("BUG: op-reth is not implemented yet")
449+
}
450+
451+
func (o *OpReth) Name() string {
452+
return "op-reth"
453+
}
454+
455+
func (o *OpReth) ReleaseArtifact() *release {
456+
return &release{
457+
Name: "op-reth",
458+
Repo: "reth",
459+
Org: "paradigmxyz",
460+
Version: "v1.3.4",
461+
Arch: func(goos, goarch string) string {
462+
if goos == "linux" {
463+
return "x86_64-unknown-linux-gnu"
464+
} else if goos == "darwin" && goarch == "arm64" { // Apple M1
465+
return "aarch64-apple-darwin"
466+
} else if goos == "darwin" && goarch == "amd64" {
467+
return "x86_64-apple-darwin"
468+
}
469+
return ""
470+
},
471+
}
472+
}

internal/releases.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import (
1515

1616
type release struct {
1717
Name string
18+
Repo string
1819
Org string
1920
Version string
2021
Arch func(string, string) string
@@ -50,7 +51,11 @@ func DownloadRelease(outputFolder string, artifact *release) (string, error) {
5051
}
5152
} else {
5253
// Case 3. Download the binary from the release page
53-
releasesURL := fmt.Sprintf("https://github.com/%s/%s/releases/download/%s/%s-%s-%s.tar.gz", artifact.Org, artifact.Name, artifact.Version, artifact.Name, artifact.Version, archVersion)
54+
repo := artifact.Repo
55+
if repo == "" {
56+
repo = artifact.Name
57+
}
58+
releasesURL := fmt.Sprintf("https://github.com/%s/%s/releases/download/%s/%s-%s-%s.tar.gz", artifact.Org, repo, artifact.Version, artifact.Name, artifact.Version, archVersion)
5459
log.Printf("Downloading %s: %s\n", outPath, releasesURL)
5560

5661
if err := downloadArtifact(releasesURL, artifact.Name, outPath); err != nil {

0 commit comments

Comments
 (0)