Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .github/workflows/build-container-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ on:
- cranker
- writer-service
- steward-writer-service
- bam-writer-service

env:
REGISTRY: ghcr.io
Expand Down Expand Up @@ -58,11 +57,6 @@ jobs:
echo "service=steward-writer-service" >> $GITHUB_OUTPUT
echo "image_name=${{ github.repository }}/kobe-steward-writer-service" >> $GITHUB_OUTPUT
;;
"bam-writer-service")
echo "target=bam-writer-service" >> $GITHUB_OUTPUT
echo "service=bam-writer-service" >> $GITHUB_OUTPUT
echo "image_name=${{ github.repository }}/kobe-bam-writer-service" >> $GITHUB_OUTPUT
;;
esac

- name: Extract metadata
Expand Down
36 changes: 6 additions & 30 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
resolver = "2"
members = [
"api",
"bam-writer-service",
"client",
"core",
"cranker",
Expand Down
7 changes: 0 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,3 @@ ENV APP="kobe-steward-writer-service"
WORKDIR /app
COPY --from=builder /home/root/app/${APP} ./
ENTRYPOINT ./$APP listen
Comment thread
aoikurokawa marked this conversation as resolved.

FROM debian:bookworm-slim as bam-writer-service
RUN apt-get update && apt-get install -y libssl3 ca-certificates procps && rm -rf /var/lib/apt/lists/*
ENV APP="kobe-bam-writer-service"
WORKDIR /app
COPY --from=builder /home/root/app/${APP} ./
ENTRYPOINT ./$APP run
57 changes: 8 additions & 49 deletions api/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,17 @@ use kobe_api::{
error::{handle_error, ApiError},
resolvers::query_resolver::{
daily_mev_rewards_cacheable_wrapper, get_bam_boost_claim_wrapper,
get_bam_boost_validators_wrapper, get_bam_delegation_blacklist_wrapper,
get_bam_epoch_metrics_wrapper, get_bam_validator_score_wrapper, get_bam_validators_wrapper,
get_coinbase_balance_wrapper, get_validator_histories_wrapper,
jito_stake_over_time_ratio_cacheable_wrapper, jitosol_ratio_cacheable_wrapper,
jitosol_validators_cacheable_wrapper, mev_commission_average_over_time_cacheable_wrapper,
mev_rewards_cacheable_wrapper, preferred_withdraw_validator_list_cacheable_wrapper,
stake_pool_stats_cacheable_wrapper, staker_rewards_cacheable_wrapper,
steward_events_cacheable_wrapper, validator_by_vote_account_cacheable_wrapper,
validator_rewards_cacheable_wrapper, validators_cacheable_wrapper, QueryResolver,
get_bam_boost_validators_wrapper, get_coinbase_balance_wrapper,
get_validator_histories_wrapper, jito_stake_over_time_ratio_cacheable_wrapper,
jitosol_ratio_cacheable_wrapper, jitosol_validators_cacheable_wrapper,
mev_commission_average_over_time_cacheable_wrapper, mev_rewards_cacheable_wrapper,
preferred_withdraw_validator_list_cacheable_wrapper, stake_pool_stats_cacheable_wrapper,
staker_rewards_cacheable_wrapper, steward_events_cacheable_wrapper,
validator_by_vote_account_cacheable_wrapper, validator_rewards_cacheable_wrapper,
validators_cacheable_wrapper, QueryResolver,
},
schemas::{
bam_boost_validator::BamBoostValidatorsRequest,
bam_epoch_metrics::BamEpochMetricsRequest,
bam_validator::{BamValidatorRequest, BamValidatorsRequest},
coinbase_balance::CoinbaseBalanceRequest,
jitosol_ratio::JitoSolRatioRequest,
mev_rewards::{MevRewardsRequest, StakerRewardsRequest, ValidatorRewardsRequest},
Expand Down Expand Up @@ -204,38 +201,13 @@ async fn get_validator_histories(
get_validator_histories_wrapper(resolver, vote_account, epoch_query).await
}

async fn get_bam_epoch_metrics_handler(
resolver: Extension<QueryResolver>,
Query(epoch_query): Query<BamEpochMetricsRequest>,
) -> impl IntoResponse {
get_bam_epoch_metrics_wrapper(resolver, epoch_query.epoch).await
}

async fn get_bam_validators_handler(
resolver: Extension<QueryResolver>,
Query(epoch_query): Query<BamValidatorsRequest>,
) -> impl IntoResponse {
get_bam_validators_wrapper(resolver, epoch_query.epoch).await
}

async fn get_bam_validator_score_handler(
resolver: Extension<QueryResolver>,
Query(query): Query<BamValidatorRequest>,
) -> impl IntoResponse {
get_bam_validator_score_wrapper(resolver, query.epoch, &query.vote_account).await
}

async fn preferred_withdraw_validator_list_handler(
resolver: Extension<QueryResolver>,
request: Query<PreferredWithdrawRequest>,
) -> impl IntoResponse {
preferred_withdraw_validator_list_cacheable_wrapper(resolver, request.0).await
}

async fn bam_delegation_blacklist_handler(resolver: Extension<QueryResolver>) -> impl IntoResponse {
get_bam_delegation_blacklist_wrapper(resolver).await
}

async fn bam_boost_claim_handler(
resolver: Extension<QueryResolver>,
Path((cluster, epoch, validator_id)): Path<(String, u64, String)>,
Expand Down Expand Up @@ -408,23 +380,10 @@ async fn run_server(args: &Args) {
"/api/v1/validator_history/:vote_account",
get(get_validator_histories),
)
.route(
"/api/v1/bam_epoch_metrics",
get(get_bam_epoch_metrics_handler),
)
.route("/api/v1/bam_validators", get(get_bam_validators_handler))
.route(
"/api/v1/bam_validator_score",
get(get_bam_validator_score_handler),
)
.route(
"/api/v1/preferred_withdraw_validator_list",
get(preferred_withdraw_validator_list_handler),
)
.route(
"/api/v1/bam_delegation_blacklist",
get(bam_delegation_blacklist_handler),
)
.route(
"/api/v1/claim/:network/:epoch/:validator_id",
get(bam_boost_claim_handler),
Expand Down
Loading
Loading