Skip to content
Open
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
3 changes: 3 additions & 0 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions crates/indexer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ serde_json.workspace = true
price-provider.workspace = true
avnu-pricing = { path = "../avnu-pricing" }
moka = { version = "0.12", features = ["future"] }
uuid.workspace = true
chaindata-models = { path = "../chaindata/models" }

[lints]
workspace = true
15 changes: 11 additions & 4 deletions crates/indexer/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,18 @@ use axum::{
Json, Router,
};
use chaindata_repository::{
AuctionRepository, LandHistoricalRepository, LandRepository, PriceFeedRepository,
WalletActivityRepository,
AuctionRepository, ChatRepository, LandHistoricalRepository, LandRepository,
PriceFeedRepository, WalletActivityRepository,
};
use chaindata_service::{ChainDataService, ChainDataServiceConfiguration};
use config::Conf;
use confique::Config;
use migrations::MIGRATOR;
use monitoring::listen_monitoring;
use routes::{
auctions::AuctionsRoute, drops::DropsRoute, land_historical::LandHistoricalRoute,
lands::LandsRoute, price::PriceRoute, tokens::TokenRoute, wallets::WalletsRoute,
auctions::AuctionsRoute, chat::ChatRoute, drops::DropsRoute,
land_historical::LandHistoricalRoute, lands::LandsRoute, price::PriceRoute, tokens::TokenRoute,
wallets::WalletsRoute,
};
use serde::{Deserialize, Serialize};
use service::{
Expand Down Expand Up @@ -122,6 +123,7 @@ async fn main() -> Result<()> {
let wallet_activity_repository = Arc::new(WalletActivityRepository::new(pool.clone()));
let price_feed_repository = Arc::new(PriceFeedRepository::new(pool.clone()));
let auction_repository = Arc::new(AuctionRepository::new(pool.clone()));
let chat_repository = Arc::new(ChatRepository::new(pool.clone()));

// Start price feed service to record prices every minute
let _price_feed_service = PriceFeedService::new(
Expand All @@ -143,6 +145,7 @@ async fn main() -> Result<()> {
price_feed_repository,
auction_repository,
drop_emitter_wallets: Arc::new(config.drop_emitter_wallets.clone()),
chat_repository,
};

let cors = CorsLayer::new()
Expand Down Expand Up @@ -192,6 +195,10 @@ async fn main() -> Result<()> {
"/auctions",
AuctionsRoute::new().router().with_state(app_state.clone()),
)
.nest(
"/chat",
ChatRoute::new().router().with_state(app_state.clone()),
)
// `GET /` goes to `root`
.route("/", get(root))
.layer(cors)
Expand Down
Loading
Loading