Skip to content

Commit

Permalink
Merge pull request #86 from amazingdatamachine/avichalp/object-head
Browse files Browse the repository at this point in the history
Replace Proxy with Object API
  • Loading branch information
sanderpick authored Jun 11, 2024
2 parents 0e62386 + ab89dc5 commit d6dcc55
Show file tree
Hide file tree
Showing 22 changed files with 255 additions and 1,315 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock

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

6 changes: 5 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,11 @@ tokio-tungstenite = { version = "0.18.0", features = ["native-tls"] }
toml = "0.8"
tower-http = { version = "0.4.0", features = ["cors"] }
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter", "json", "registry"] }
tracing-subscriber = { version = "0.3", features = [
"env-filter",
"json",
"registry",
] }
tracing-appender = "0.2.3"
url = { version = "2.4.1", features = ["serde"] }
zeroize = "1.6"
Expand Down
6 changes: 3 additions & 3 deletions fendermint/app/config/default.toml
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,10 @@ allowed_methods = []
# Suggested headers if allowing origins: "Accept", "Authorization", "Content-Type", "Origin"
allowed_headers = []

# Proxy API facade
[proxy]
# Object API facade
[objects]

[proxy.listen]
[objects.listen]
# Only accept local connections by default.
host = "127.0.0.1"
port = 8001
Expand Down
8 changes: 4 additions & 4 deletions fendermint/app/options/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use tracing_subscriber::EnvFilter;

use self::{
eth::EthArgs, genesis::GenesisArgs, key::KeyArgs, materializer::MaterializerArgs,
proxy::ProxyArgs, rpc::RpcArgs, run::RunArgs,
objects::ObjectsArgs, rpc::RpcArgs, run::RunArgs,
};

pub mod config;
Expand All @@ -21,7 +21,7 @@ pub mod eth;
pub mod genesis;
pub mod key;
pub mod materializer;
pub mod proxy;
pub mod objects;
pub mod rpc;
pub mod run;

Expand Down Expand Up @@ -199,8 +199,8 @@ pub enum Commands {
/// Subcommands related to the Testnet Materializer.
#[clap(aliases = &["mat", "matr", "mate"])]
Materializer(MaterializerArgs),
/// Proxy for data repos
Proxy(ProxyArgs),
/// Object API for data repos
Objects(ObjectsArgs),
}

#[cfg(test)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ use clap::{Args, Subcommand};
use tendermint_rpc::Url;

#[derive(Args, Debug)]
pub struct ProxyArgs {
pub struct ObjectsArgs {
#[command(subcommand)]
pub command: ProxyCommands,
pub command: ObjectsCommands,
}

#[derive(Subcommand, Debug, Clone)]
pub enum ProxyCommands {
pub enum ObjectsCommands {
Run {
/// The URL of the Tendermint node's RPC endpoint.
#[arg(
Expand Down
6 changes: 3 additions & 3 deletions fendermint/app/settings/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ use fendermint_vm_topdown::BlockHeight;

use self::eth::EthSettings;
use self::fvm::FvmSettings;
use self::proxy::ProxySettings;
use self::objects::ObjectsSettings;
use self::resolver::ResolverSettings;
use ipc_provider::config::deserialize::deserialize_eth_address_from_str;

pub mod eth;
pub mod fvm;
pub mod proxy;
pub mod objects;
pub mod resolver;
pub mod testing;
pub mod utils;
Expand Down Expand Up @@ -288,7 +288,7 @@ pub struct Settings {
pub broadcast: BroadcastSettings,
pub ipc: IpcSettings,
pub testing: Option<TestingSettings>,
pub proxy: ProxySettings,
pub objects: ObjectsSettings,
}

impl Settings {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ use serde_with::serde_as;

use crate::SocketAddress;

/// Proxy API facade settings.
/// Object API facade settings.
#[serde_as]
#[derive(Debug, Deserialize, Clone)]
pub struct ProxySettings {
pub struct ObjectsSettings {
pub listen: SocketAddress,
}
4 changes: 2 additions & 2 deletions fendermint/app/src/cmd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub mod eth;
pub mod genesis;
pub mod key;
pub mod materializer;
pub mod proxy;
pub mod objects;
pub mod rpc;
pub mod run;

Expand Down Expand Up @@ -71,7 +71,7 @@ pub async fn exec(opts: &Options) -> anyhow::Result<()> {
Commands::Rpc(args) => args.exec(()).await,
Commands::Eth(args) => args.exec(settings(opts)?.eth).await,
Commands::Materializer(args) => args.exec(()).await,
Commands::Proxy(args) => args.exec(settings(opts)?.proxy).await,
Commands::Objects(args) => args.exec(settings(opts)?.objects).await,
}
}

Expand Down
Loading

0 comments on commit d6dcc55

Please sign in to comment.