Skip to content

Commit 28ebe1c

Browse files
authored
rbuilder-rebalancer deb packaging (#784)
1 parent 332b00c commit 28ebe1c

File tree

5 files changed

+65
-1
lines changed

5 files changed

+65
-1
lines changed

.github/workflows/release.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,12 @@ jobs:
127127
name: bid-scraper-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.configs.target }}${{ matrix.features && '-' }}${{ matrix.features }}
128128
path: target/${{ matrix.configs.target }}/${{ matrix.configs.profile }}/bid-scraper
129129

130+
- name: Upload rbuilder-rebalancer artifact
131+
uses: actions/upload-artifact@v4
132+
with:
133+
name: rbuilder-rebalancer-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.configs.target }}${{ matrix.features && '-' }}${{ matrix.features }}
134+
path: target/${{ matrix.configs.target }}/${{ matrix.configs.profile }}/rbuilder-rebalancer
135+
130136
- name: Upload *.deb packages
131137
uses: actions/upload-artifact@v4
132138
with:

Makefile

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ build-bid-scraper: ## Build the bid-scraper binary (release version)
8282
build-rbuilder-operator: ## Build the rbuilder-operator binary (release version)
8383
$(BUILD_ENV) cargo build --features "$(FEATURES)" --locked $(if $(BUILD_TARGET),--target $(BUILD_TARGET)) --bin rbuilder-operator --profile $(BUILD_PROFILE)
8484

85+
.PHONY: build-rbuilder-rebalancer
86+
build-rbuilder-rebalancer: ## Build the rbuilder-rebalancer binary (release version)
87+
$(BUILD_ENV) cargo build --features "$(FEATURES)" --locked $(if $(BUILD_TARGET),--target $(BUILD_TARGET)) --bin rbuilder-rebalancer --profile $(BUILD_PROFILE)
88+
8589
.PHONY: build-dev
8690
build-dev: ## Build (debug version)
8791
cargo build --features "$(FEATURES)"
@@ -117,8 +121,15 @@ build-deb-rbuilder-operator: install-cargo-deb build-rbuilder-operator ## Build
117121
$(if $(BUILD_TARGET),--target $(BUILD_TARGET)) \
118122
$(if $(VERSION),--deb-version "1~$(VERSION)")
119123

124+
.PHONY: build-deb-rbuilder-rebalancer
125+
build-deb-rbuilder-rebalancer: install-cargo-deb build-rbuilder-rebalancer ## Build rbuilder-rebalancer Debian package
126+
cargo deb --profile $(BUILD_PROFILE) --no-build --no-dbgsym --no-strip \
127+
-p rbuilder-rebalancer \
128+
$(if $(BUILD_TARGET),--target $(BUILD_TARGET)) \
129+
$(if $(VERSION),--deb-version "1~$(VERSION)")
130+
120131
.PHONY: build-deb
121-
build-deb: build-deb-bid-scraper build-deb-rbuilder-operator ## Build all Debian packages
132+
build-deb: build-deb-bid-scraper build-deb-rbuilder-operator build-deb-rbuilder-rebalancer ## Build all Debian packages
122133

123134
##@ Dev
124135

crates/rbuilder-rebalancer/Cargo.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,20 @@ license.workspace = true
77
homepage.workspace = true
88
repository.workspace = true
99

10+
[package.metadata.deb]
11+
maintainer = "Flashbots Team <[email protected]>"
12+
depends = "$auto"
13+
section = "network"
14+
priority = "optional"
15+
maintainer-scripts = "pkg/debian"
16+
assets = [
17+
["target/release/**/rbuilder-rebalancer", "usr/bin/", "755"],
18+
["pkg/etc/config.toml", "etc/rbuilder-rebalancer/", "644"],
19+
["../../LICENSE-APACHE", "usr/share/doc/rbuilder-rebalancer/", "644"],
20+
["../../LICENSE-MIT", "usr/share/doc/rbuilder-rebalancer/", "644"],
21+
]
22+
systemd-units = { enable = false, start = false, unit-name = "rbuilder-rebalancer" }
23+
1024
[dependencies]
1125
rbuilder-config.workspace = true
1226

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[Unit]
2+
Description=A small, standalone service that moves funds between BuilderNet accounts to keep operational wallets topped up and tidy.
3+
Documentation=https://github.com/flashbots/rbuilder
4+
Wants=network-online.target
5+
After=network.target network-online.target rbuilder-operator.service
6+
7+
[Service]
8+
Type=exec
9+
DynamicUser=yes
10+
ConfigurationDirectory=rbuilder-rebalancer
11+
ExecStart=/usr/bin/rbuilder-rebalancer /etc/rbuilder-rebalancer/config.toml
12+
13+
[Install]
14+
WantedBy=multi-user.target
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
rpc_url = "http://127.0.0.1:8545"
2+
builder_url = "http://127.0.0.1:8645"
3+
transfer_max_priority_fee_per_gas = "1000000000"
4+
5+
env_filter = "info"
6+
log_color = false
7+
log_json = true
8+
9+
[[account]]
10+
id = "builder-eoa"
11+
secret = "0x0000000000000000000000000000000000000000000000000000000000000000"
12+
min_balance = "20000000000000000000"
13+
14+
[[rule]]
15+
description = ""
16+
source_id = "builder-eoa"
17+
destination = "0x0000000000000000000000000000000000000000"
18+
destination_min_balance = "2500000000000000000"
19+
destination_target_balance = "5000000000000000000"

0 commit comments

Comments
 (0)