Skip to content

Commit

Permalink
A number of changes are reverted
Browse files Browse the repository at this point in the history
  • Loading branch information
litch committed May 7, 2022
1 parent 54b4628 commit d8e1a33
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 33 deletions.
13 changes: 0 additions & 13 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -584,19 +584,6 @@ pub struct NodeConfig {
pub token: String,
}

// impl Default for NodeConfig {
// fn default() -> Self {

// NodeConfig {
// data_dir: ".".into(),
// pubkey: "".into(),
// macaroon: "".into(),
// role: Role::Admin.to_integer(),
// token: "satoshi".into(),
// }
// }
// }

impl NodeConfig {
pub fn path(&self) -> String {
format!("{}/data/{}", self.data_dir, self.pubkey)
Expand Down
9 changes: 1 addition & 8 deletions src/grpc/admin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
// licenses.

use std::sync::Arc;
use tracing::{instrument, info, error, debug};

pub use super::sensei::admin_server::{Admin, AdminServer};
use super::{
Expand Down Expand Up @@ -414,27 +413,21 @@ impl Admin for AdminService {
Err(_err) => Err(tonic::Status::unknown("error")),
}
}
#[instrument(skip(self, request), fields())]
async fn create_admin(
&self,
request: tonic::Request<CreateAdminRequest>,
) -> Result<tonic::Response<CreateAdminResponse>, tonic::Status> {
let request: AdminRequest = request.into_inner().into();
match self.request_context.admin_service.call(request).await {
Ok(response) => {
debug!("Admin creation successful");
let response: Result<CreateAdminResponse, String> = response.try_into();
response
.map(Response::new)
.map_err(|_err| tonic::Status::unknown("err"))
}
Err(_err) => {
error!("Admin creation failed {:?}", _err);
Err(tonic::Status::unknown("error"))
}
Err(_err) => Err(tonic::Status::unknown("error")),
}
}
#[instrument(skip(self, request), fields())]
async fn start_admin(
&self,
request: tonic::Request<StartAdminRequest>,
Expand Down
9 changes: 1 addition & 8 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ mod services;
mod utils;
mod version;

use tracing::{info, debug, error, Level};
use tracing_subscriber::FmtSubscriber;

use crate::chain::bitcoind_client::BitcoindClient;
use crate::http::admin::add_routes as add_admin_routes;
use crate::http::node::add_routes as add_node_routes;
Expand Down Expand Up @@ -195,7 +192,6 @@ async fn main() {
.await
.expect("invalid bitcoind rpc config"),
);
info!("Bitcoind connected successfully");

let chain_manager = Arc::new(
SenseiChainManager::new(
Expand Down Expand Up @@ -230,7 +226,6 @@ async fn main() {

let router = add_admin_routes(router);
let router = add_node_routes(router);
info!("Router initialized successfully");

let router = match args.development_mode {
Some(_development_mode) => router.layer(
Expand Down Expand Up @@ -280,11 +275,9 @@ async fn main() {
"manage your sensei node at http://localhost:{}/admin/nodes",
port
);

info!("Initialization complete");

if let Err(e) = server.await {
error!("Uncaught error: {:?}", e);
dbg!("Uncaught error: {:?}", e);
}

}
Expand Down
4 changes: 0 additions & 4 deletions src/services/admin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
// You may not use this file except in accordance with one or both of these
// licenses.

use tracing::{error};
use super::{PaginationRequest, PaginationResponse};
use crate::chain::manager::SenseiChainManager;
use crate::error::Error as SenseiError;
Expand Down Expand Up @@ -311,12 +310,9 @@ impl AdminService {

let macaroon = macaroon.serialize(macaroon::Format::V2)?;

let macaroon = lightning_node.macaroon.serialize(macaroon::Format::V2)?;

if start {
self.start_node(node.clone(), passphrase).await?;
}

Ok(AdminResponse::CreateNode {
pubkey: node.pubkey,
macaroon: hex_utils::hex_str(macaroon.as_slice()),
Expand Down

0 comments on commit d8e1a33

Please sign in to comment.