From afdf1a6b6e7dc383176cc89fde785c5c8bd0db1b Mon Sep 17 00:00:00 2001 From: Chris Hager Date: Thu, 13 Jun 2024 18:19:48 +0200 Subject: [PATCH] minor cleanup --- Makefile | 7 +++- cmd/service/bidcollect.go | 7 ++-- docs/2024-06_bidcollect.md | 42 +++++++++---------- .../bids-combine-and-upload-yesterday.sh | 2 +- 4 files changed, 31 insertions(+), 27 deletions(-) diff --git a/Makefile b/Makefile index cf02b7d..e239df3 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/cmd/service/bidcollect.go b/cmd/service/bidcollect.go index 094194d..b444423 100644 --- a/cmd/service/bidcollect.go +++ b/cmd/service/bidcollect.go @@ -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 @@ -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") @@ -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 } @@ -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{ diff --git a/docs/2024-06_bidcollect.md b/docs/2024-06_bidcollect.md index 81cfc37..1afcc58 100644 --- a/docs/2024-06_bidcollect.md +++ b/docs/2024-06_bidcollect.md @@ -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** --- @@ -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 diff --git a/scripts/bidcollect/bids-combine-and-upload-yesterday.sh b/scripts/bidcollect/bids-combine-and-upload-yesterday.sh index 97c264a..aa7fae1 100755 --- a/scripts/bidcollect/bids-combine-and-upload-yesterday.sh +++ b/scripts/bidcollect/bids-combine-and-upload-yesterday.sh @@ -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