mirror of
https://github.com/uqbar-dao/nectar.git
synced 2025-01-05 00:10:23 +03:00
updated contract addrs and /current-chain endpoint for register FE
This commit is contained in:
parent
497774161a
commit
cf26769ba8
@ -49,6 +49,7 @@ async fn serve_register_fe(
|
|||||||
our_ip: String,
|
our_ip: String,
|
||||||
http_server_port: u16,
|
http_server_port: u16,
|
||||||
rpc_url: String,
|
rpc_url: String,
|
||||||
|
testnet: bool,
|
||||||
) -> (Identity, Vec<u8>, Keyfile) {
|
) -> (Identity, Vec<u8>, Keyfile) {
|
||||||
// check if we have keys saved on disk, encrypted
|
// check if we have keys saved on disk, encrypted
|
||||||
// if so, prompt user for "password" to decrypt with
|
// if so, prompt user for "password" to decrypt with
|
||||||
@ -69,7 +70,7 @@ async fn serve_register_fe(
|
|||||||
|
|
||||||
let (tx, mut rx) = mpsc::channel::<(Identity, Keyfile, Vec<u8>)>(1);
|
let (tx, mut rx) = mpsc::channel::<(Identity, Keyfile, Vec<u8>)>(1);
|
||||||
let (our, decoded_keyfile, encoded_keyfile) = tokio::select! {
|
let (our, decoded_keyfile, encoded_keyfile) = tokio::select! {
|
||||||
_ = register::register(tx, kill_rx, our_ip, http_server_port, rpc_url, disk_keyfile) => {
|
_ = register::register(tx, kill_rx, our_ip, http_server_port, rpc_url, disk_keyfile, testnet) => {
|
||||||
panic!("registration failed")
|
panic!("registration failed")
|
||||||
}
|
}
|
||||||
Some((our, decoded_keyfile, encoded_keyfile)) = rx.recv() => {
|
Some((our, decoded_keyfile, encoded_keyfile)) = rx.recv() => {
|
||||||
@ -224,6 +225,7 @@ async fn main() {
|
|||||||
our_ip.to_string(),
|
our_ip.to_string(),
|
||||||
http_server_port,
|
http_server_port,
|
||||||
rpc_url.clone(),
|
rpc_url.clone(),
|
||||||
|
*matches.get_one::<bool>("testnet").unwrap(), // true if testnet mode
|
||||||
)
|
)
|
||||||
.await;
|
.await;
|
||||||
#[cfg(feature = "simulation-mode")]
|
#[cfg(feature = "simulation-mode")]
|
||||||
@ -238,6 +240,7 @@ async fn main() {
|
|||||||
our_ip.to_string(),
|
our_ip.to_string(),
|
||||||
http_server_port.clone(),
|
http_server_port.clone(),
|
||||||
rpc_url.clone(),
|
rpc_url.clone(),
|
||||||
|
*matches.get_one::<bool>("testnet").unwrap(), // true if testnet mode
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"files": {
|
"files": {
|
||||||
"main.css": "/static/css/main.005a7f66.css",
|
"main.css": "/static/css/main.005a7f66.css",
|
||||||
"main.js": "/static/js/main.40ea1170.js",
|
"main.js": "/static/js/main.85e3d839.js",
|
||||||
"static/media/unknown.png": "/static/media/unknown.880d04d4611a45ab1001.png",
|
"static/media/unknown.png": "/static/media/unknown.880d04d4611a45ab1001.png",
|
||||||
"index.html": "/index.html"
|
"index.html": "/index.html"
|
||||||
},
|
},
|
||||||
"entrypoints": [
|
"entrypoints": [
|
||||||
"static/css/main.005a7f66.css",
|
"static/css/main.005a7f66.css",
|
||||||
"static/js/main.40ea1170.js"
|
"static/js/main.85e3d839.js"
|
||||||
]
|
]
|
||||||
}
|
}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -31,8 +31,8 @@ abigen!(
|
|||||||
|
|
||||||
type RegistrationSender = mpsc::Sender<(Identity, Keyfile, Vec<u8>)>;
|
type RegistrationSender = mpsc::Sender<(Identity, Keyfile, Vec<u8>)>;
|
||||||
|
|
||||||
pub const NDNS_SEPOLIA_ADDRESS: &str = "0x6e22E7b9f5a99D5921c14A88Aaf954502aC17B90";
|
pub const NDNS_SEPOLIA_ADDRESS: &str = "0xa11e3794e701565aD37f84DD364d581f5e9518c9";
|
||||||
pub const NDNS_OPTIMISM_ADDRESS: &str = "0x4C8D8d4A71cE21B4A16dAbf4593cDF30d79728F1"; // TODO
|
pub const NDNS_OPTIMISM_ADDRESS: &str = "0x942A69Cc3dd5d9a87c35f13ebA444adc00934B0F";
|
||||||
|
|
||||||
pub fn _ip_to_number(ip: &str) -> Result<u32, &'static str> {
|
pub fn _ip_to_number(ip: &str) -> Result<u32, &'static str> {
|
||||||
let octets: Vec<&str> = ip.split('.').collect();
|
let octets: Vec<&str> = ip.split('.').collect();
|
||||||
@ -102,6 +102,7 @@ pub async fn register(
|
|||||||
port: u16,
|
port: u16,
|
||||||
rpc_url: String,
|
rpc_url: String,
|
||||||
keyfile: Option<Vec<u8>>,
|
keyfile: Option<Vec<u8>>,
|
||||||
|
testnet: bool,
|
||||||
) {
|
) {
|
||||||
// Networking info is generated and passed to the UI, but not used until confirmed
|
// Networking info is generated and passed to the UI, but not used until confirmed
|
||||||
let (public_key, serialized_networking_keypair) = keygen::generate_networking_key();
|
let (public_key, serialized_networking_keypair) = keygen::generate_networking_key();
|
||||||
@ -153,7 +154,14 @@ pub async fn register(
|
|||||||
.map(move || warp::reply::html(include_str!("register-ui/build/index.html"))))
|
.map(move || warp::reply::html(include_str!("register-ui/build/index.html"))))
|
||||||
.or(warp::path("set-password")
|
.or(warp::path("set-password")
|
||||||
.and(warp::get())
|
.and(warp::get())
|
||||||
.map(move || warp::reply::html(include_str!("register-ui/build/index.html"))));
|
.map(move || warp::reply::html(include_str!("register-ui/build/index.html"))))
|
||||||
|
.or(warp::path("current-chain").and(warp::get()).map(move || {
|
||||||
|
if testnet {
|
||||||
|
warp::reply::json(&"0xAA36A7")
|
||||||
|
} else {
|
||||||
|
warp::reply::json(&"0xA")
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
|
||||||
let api = warp::path("info")
|
let api = warp::path("info")
|
||||||
.and(
|
.and(
|
||||||
|
@ -48,7 +48,7 @@ pub async fn terminal(
|
|||||||
⠁⠶⣤⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⠔⠋⠀⠀⠀
|
⠁⠶⣤⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⠔⠋⠀⠀⠀
|
||||||
⠀⠀⠈⢛⠿⣷⣦⣤⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⡤⠤⣴⡞⠁⠀⠀⠀⠀⠀ 888
|
⠀⠀⠈⢛⠿⣷⣦⣤⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⡤⠤⣴⡞⠁⠀⠀⠀⠀⠀ 888
|
||||||
⠀⠀⠀⠀⠙⠳⢾⣿⣟⣻⠷⣦⣤⣀⠀⠀⠀⠀⠀⠀⣾⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀ 888
|
⠀⠀⠀⠀⠙⠳⢾⣿⣟⣻⠷⣦⣤⣀⠀⠀⠀⠀⠀⠀⣾⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀ 888
|
||||||
⠀⠀⠀⠀⠀⠀⠙⠲⣯⣿⣿⣿⣿⠽⢿⣷⣦⣤⣀⠀⢿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀88888bo od88bo od8888b 8888888 8888bo 888d888
|
⠀⠀⠀⠀⠀⠀⠙⠲⣯⣿⣿⣿⣿⠽⢿⣷⣦⣤⣀⠀⢿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀88888bo od88bo od8888b 88888888 8888bo 888d888
|
||||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠲⠾⠿⣿⣿⣿⣿⣿⣿⣿⣷⣿⣿⣿⣿⣿⡀⠀⠀⠀⠀⠀⠀888 "88b d8P Y8b d88P" 888 "88b 888P"
|
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠲⠾⠿⣿⣿⣿⣿⣿⣿⣿⣷⣿⣿⣿⣿⣿⡀⠀⠀⠀⠀⠀⠀888 "88b d8P Y8b d88P" 888 "88b 888P"
|
||||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⠛⣛⣯⣿⣿⣿⣿⣿⢿⣿⣿⣿⣿⡇⠀⠀⠀⠀⠀⠀888 888 88888888 888 888 .d888888 888
|
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⠛⣛⣯⣿⣿⣿⣿⣿⢿⣿⣿⣿⣿⡇⠀⠀⠀⠀⠀⠀888 888 88888888 888 888 .d888888 888
|
||||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠐⠛⡵⣿⣿⣿⣿⣿⣿⣿⣿⡇⠀⠀⠀⠀⠀⠀888 888 Y8b. Y88b. Y88b. 888 888 888
|
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠐⠛⡵⣿⣿⣿⣿⣿⣿⣿⣿⡇⠀⠀⠀⠀⠀⠀888 888 Y8b. Y88b. Y88b. 888 888 888
|
||||||
|
Loading…
Reference in New Issue
Block a user