Skip to content

Commit

Permalink
minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
metachris committed Jun 13, 2024
1 parent ba3261f commit afdf1a6
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 27 deletions.
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,11 @@ generate-ssz:
rm -f common/ultrasoundbid_encoding.go
sszgen --path common --objs UltrasoundStreamBid

bids-website:
update-bids-website:
go run . service bidcollect --build-website --build-website-upload

bids-website-dev:
dev-website:
go run . service website --dev

dev-bids-website:
go run . service bidcollect --devserver
7 changes: 4 additions & 3 deletions cmd/service/bidcollect.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var (
outputTSV bool // by default: CSV, but can be changed to TSV with this setting

runDevServerOnly bool // used to play with file listing website
devServerListenAddr = ":8095"
devServerListenAddr string

buildWebsite bool
buildWebsiteUpload bool
Expand All @@ -44,6 +44,7 @@ func init() {

// for dev purposes
bidCollectCmd.Flags().BoolVar(&runDevServerOnly, "devserver", false, "only run devserver to play with file listing website")
bidCollectCmd.Flags().StringVar(&devServerListenAddr, "devserver-addr", "localhost:8095", "listen address for devserver")

// building the S3 website
bidCollectCmd.Flags().BoolVar(&buildWebsite, "build-website", false, "build file listing website")
Expand All @@ -56,7 +57,7 @@ var bidCollectCmd = &cobra.Command{
Short: "Collect bids",
Run: func(cmd *cobra.Command, args []string) {
if runDevServerOnly {
log.Infof("Bidcollect (%s) devserver starting on %s ...", vars.Version, devServerListenAddr)
log.Infof("Bidcollect %s devserver starting on %s ...", vars.Version, devServerListenAddr)
fileListingDevServer()
return
}
Expand All @@ -67,7 +68,7 @@ var bidCollectCmd = &cobra.Command{
return
}

log.Infof("Bidcollect starting (%s) ...", vars.Version)
log.Infof("Bidcollect %s starting ...", vars.Version)

// Prepare relays
relays := []common.RelayEntry{
Expand Down
42 changes: 21 additions & 21 deletions docs/2024-06_bidcollect.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Relayscan Bid Archive
# Relayscan Bid Archive 📚

Relayscan can run in a special bid-collection mode to build an archive of bids across [relays](../vars/relays.go).
Relayscan.io collects a full, public archive of bids across [relays](../vars/relays.go).

Public bid archive: https://bidarchive.relayscan.io
**https://bidarchive.relayscan.io**

---

Expand All @@ -14,30 +14,30 @@ Public bid archive: https://bidarchive.relayscan.io

### Output

The output is (daily) CSV files:
For every day, there are two CSV files:
1. All bids
2. Top bids only


### Collected fields

| Field | Description | Source Types |
| ---------------------- | ------------------------------------------------------ | ------------ |
| source_type | 0: getHeader, 1: Data API, 2: Ultrasound stream | all |
| received_at_ms | Timestamp when the bid was first seen at the collector | all |
| timestamp_ms | Timestamp when the bid was received by the relay | 1 + 2 |
| slot | Slot the bid was submitted for | all |
| slot_t_ms | Slot timestamp | all |
| value | Bid value in wei | all |
| block_hash | Block hash | all |
| parent_hash | Parent hash | all |
| builder_pubkey | Builder pubkey | 1 + 2 |
| block_number | Block number | all |
| block_fee_recipient | Block fee recipient | all |
| relay | Relay name | all |
| proposer_pubkey | Proposer pubkey | 1 + 2 |
| proposer_fee_recipient | Proposer fee recipient | 1 + 2 |
| optimistic_submission | Optimistic submission flag | 0 + 1 |
| Field | Description | Source Types |
| ------------------------ | ------------------------------------------------------ | ----------------------------------------- |
| `source_type` | 0: getHeader, 1: Data API, 2: Ultrasound stream | all |
| `received_at_ms` | Timestamp when the bid was first seen at the collector | all |
| `timestamp_ms` | Timestamp when the bid was received by the relay | 1 + 2 (for 0 it's using `received_at_ms`) |
| `slot` | Slot the bid was submitted for | all |
| `slot_t_ms` | Slot timestamp | all |
| `value` | Bid value in wei | all |
| `block_hash` | Block hash | all |
| `parent_hash` | Parent hash | all |
| `builder_pubkey` | Builder pubkey | 1 + 2 |
| `block_number` | Block number | all |
| `block_fee_recipient` | Block fee recipient | all |
| `relay` | Relay name | all |
| `proposer_pubkey` | Proposer pubkey | 1 + 2 |
| `proposer_fee_recipient` | Proposer fee recipient | 1 + 2 |
| `optimistic_submission` | Optimistic submission flag | 0 + 1 |

### See also

Expand Down
2 changes: 1 addition & 1 deletion scripts/bidcollect/bids-combine-and-upload-yesterday.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ source .env.prod
./scripts/bidcollect/bids-combine-and-upload.sh "/mnt/data/relayscan-bids/$d/"

# update website
make bids-website
make update-bids-website

0 comments on commit afdf1a6

Please sign in to comment.