Skip to content

Commit

Permalink
Fix dev ticker and update zksync js
Browse files Browse the repository at this point in the history
Signed-off-by: deniallugo <[email protected]>
  • Loading branch information
Deniallugo committed Jul 29, 2022
1 parent 1efce85 commit d3fd18e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 22 deletions.
37 changes: 18 additions & 19 deletions core/bin/zksync_api/src/bin/dev-ticker-server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,15 @@ fn main_scope(sloppy_mode: bool) -> actix_web::Scope {
let localhost_tokens = load_tokens(&"etc/tokens/localhost.json");
let rinkeby_tokens = load_tokens(&"etc/tokens/rinkeby.json");
let ropsten_tokens = load_tokens(&"etc/tokens/ropsten.json");
let goerli_tokens = load_tokens(&"etc/tokens/goerli.json");
let data: Vec<TokenData> = localhost_tokens
.into_iter()
.chain(rinkeby_tokens.into_iter())
.chain(ropsten_tokens.into_iter())
.chain(goerli_tokens.into_iter())
.collect();
if sloppy_mode {
web::scope("/")
web::scope("")
.app_data(web::Data::new(data))
.route(
"/cryptocurrency/quotes/latest",
Expand All @@ -192,7 +194,7 @@ fn main_scope(sloppy_mode: bool) -> actix_web::Scope {
web::get().to(make_sloppy!(handle_coingecko_token_price_query)),
)
} else {
web::scope("/")
web::scope("")
.app_data(web::Data::new(data))
.route(
"/cryptocurrency/quotes/latest",
Expand Down Expand Up @@ -224,27 +226,24 @@ struct FeeTickerOpts {
sloppy: bool,
}

fn main() {
vlog::init();
#[actix_web::main]
async fn main() -> std::io::Result<()> {
let _vlog_guard = vlog::init();

let opts = FeeTickerOpts::from_args();
if opts.sloppy {
vlog::info!("Fee ticker server will run in a sloppy mode.");
}

let runtime = actix_rt::System::new();
runtime.block_on(async move {
HttpServer::new(move || {
App::new()
.wrap(Cors::default().allow_any_origin().max_age(3600))
.wrap(middleware::Logger::default())
.service(main_scope(opts.sloppy))
})
.bind("0.0.0.0:9876")
.unwrap()
.shutdown_timeout(1)
.run()
.await
.expect("Server crashed");
});
HttpServer::new(move || {
App::new()
.wrap(Cors::default().allow_any_origin().max_age(3600))
.wrap(middleware::Logger::default())
.service(main_scope(opts.sloppy))
})
.bind("0.0.0.0:9876")
.unwrap()
.shutdown_timeout(1)
.run()
.await
}
4 changes: 2 additions & 2 deletions docker/dev-ticker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# syntax=docker/dockerfile:experimental
FROM rust:1.55 as builder
FROM rust:1.59 as builder
RUN --mount=type=cache,target=/usr/local/cargo/registry \
cargo install sccache
WORKDIR /usr/src/zksync
COPY . .
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/root/.cache/sccache \
RUSTC_WRAPPER=/usr/local/cargo/bin/sccache \
cargo build --release
cargo build --bin dev-ticker-server --release

FROM debian:bullseye
RUN apt update
Expand Down
2 changes: 1 addition & 1 deletion sdk/zksync.js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zksync",
"version": "0.12.1",
"version": "0.12.2",
"license": "MIT",
"main": "build/index.js",
"types": "build/index.d.ts",
Expand Down

0 comments on commit d3fd18e

Please sign in to comment.