Skip to content

Commit

Permalink
Merge pull request #8 from BoredApe8461/renewal-period
Browse files Browse the repository at this point in the history
Renewal period
  • Loading branch information
BoredApe8461 authored Aug 19, 2024
2 parents 9350672 + 644db7d commit 1ba43f0
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 37 deletions.
74 changes: 37 additions & 37 deletions bin/server/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
// This file is part of RegionX.
//
// RegionX is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// RegionX is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with RegionX. If not, see <https://www.gnu.org/licenses/>.

/// Web API for interacting with the Consumption Tracker service.
///
/// This API exposes two main endpoints:
/// - `/consumption`: Used to query consumption data associated with a parachain.
/// - `/register`: Used to register a parachain for consumption tracking.
use rocket_cors::CorsOptions;
use routes::{
consumption::consumption, extend_subscription::extend_subscription, register::register_para,
registry::registry,
};

#[macro_use]
extern crate rocket;

#[launch]
fn rocket() -> _ {
rocket::build()
.attach(CorsOptions::default().to_cors().unwrap())

.mount("/", routes![consumption, register_para, registry, extend_subscription])

}
// This file is part of RegionX.
//
// RegionX is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// RegionX is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with RegionX. If not, see <https://www.gnu.org/licenses/>.

/// Web API for interacting with the Consumption Tracker service.
///
/// This API exposes two main endpoints:
/// - `/consumption`: Used to query consumption data associated with a parachain.
/// - `/register`: Used to register a parachain for consumption tracking.
use rocket_cors::CorsOptions;
use routes::{
consumption::consumption, extend_subscription::extend_subscription, register::register_para,
registry::registry,
};

#[macro_use]
extern crate rocket;

#[launch]
fn rocket() -> _ {
rocket::build()
.attach(CorsOptions::default().to_cors().unwrap())

.mount("/", routes![consumption, register_para, registry, extend_subscription])

}
1 change: 1 addition & 0 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ cost = "1000000000" #0.001 ROC
subscription_duration = 7890000
# 604800 is 1 week in seconds.
renewal_period=604800

1 change: 1 addition & 0 deletions registry.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
],
"para_id": 2000,
"relay_chain": "Polkadot",

"expiry_timestamp": 1709740246
},
{
Expand Down

0 comments on commit 1ba43f0

Please sign in to comment.