Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

fix: cleanup cli commands #352

Merged
merged 40 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
d808986
fix: cleanup cli commands
gruberb Oct 26, 2023
e8ac80e
fix: clean up cli flags
gruberb Oct 27, 2023
27915ee
fix: cleanup feature flags
gruberb Oct 27, 2023
2a42858
fix: revert some flags
gruberb Oct 27, 2023
8c420ec
feat: add push cert command to node
JDawg287 Oct 30, 2023
1d23b28
fix: usage message tce -> node
JDawg287 Oct 30, 2023
be5b42f
fix: lint
gruberb Nov 6, 2023
69d6893
fix: debugging
gruberb Nov 7, 2023
c4ec770
Revert "fix: usage message tce -> node"
JDawg287 Nov 6, 2023
891cc47
Revert "feat: add push cert command to node"
JDawg287 Nov 6, 2023
6e28344
feat: move tce status -> node status
JDawg287 Nov 7, 2023
b021324
chore: add regtest command and subcommands
JDawg287 Nov 8, 2023
7b293d3
chore: remove peer-id flag
JDawg287 Nov 8, 2023
278d9ba
fix: cleanup
JDawg287 Nov 8, 2023
6ae6e14
fix: fix/reinstate tests
JDawg287 Nov 8, 2023
9ac4b21
chore: add test for regtest spam
JDawg287 Nov 8, 2023
5c00f29
feat: add opentelemetry to node up
JDawg287 Nov 8, 2023
f63dbd3
fix: format
JDawg287 Nov 8, 2023
9b43ce5
fix: clippy/format
JDawg287 Nov 8, 2023
adb4edc
fix: update config trait impl
gruberb Nov 9, 2023
f3edc36
fix: update docker compose
gruberb Nov 9, 2023
331cb45
fix: update ci cert_delivery test
gruberb Nov 9, 2023
08a3a23
fix: docker
gruberb Nov 9, 2023
d62003c
fix: features
gruberb Nov 9, 2023
02f5b3c
fix: remove feature flags
gruberb Nov 9, 2023
a9ea306
fix: cert-delivery ci run
gruberb Nov 9, 2023
012f167
fix: reading from up command
gruberb Nov 10, 2023
a4b4738
chore: reinstate e2e tests
JDawg287 Nov 10, 2023
80327a4
fix: adjust tracing
gruberb Nov 13, 2023
1ad804c
fix: adjust config trait
gruberb Nov 13, 2023
b0732ba
Merge branch 'feat/TP-715' of github.com:topos-protocol/topos into fe…
gruberb Nov 13, 2023
7a6d232
fix: added verbose back, adjusted parsing of commands
gruberb Nov 14, 2023
d8aa85a
Merge branch 'main' into feat/TP-715
gruberb Nov 14, 2023
f95faa0
fix: lint
gruberb Nov 14, 2023
edc92fd
fix: add test for node up
gruberb Nov 14, 2023
e415bf0
fix: remove dummy test
gruberb Nov 14, 2023
c3af9ef
fix: lint
gruberb Nov 14, 2023
bff4bbe
fix: remove tags
gruberb Nov 14, 2023
5d060e7
fix: tracing and features bugfix
gruberb Nov 14, 2023
3853fc5
fix: pr review
gruberb Nov 14, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .github/workflows/docker_build_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ jobs:
network:
uses: ./.github/workflows/docker_utils.yml
secrets: inherit
with:
features: "network"

docker_e2e:
runs-on: ubuntu-latest-16-core
Expand Down Expand Up @@ -84,8 +82,7 @@ jobs:
frontend-erc20-e2e:
runs-on: ubuntu-latest
needs: docker
# if: ${{ github.event_name == 'pull_request' }}
if: ${{ false }} # disable for now because of: TP-768
if: ${{ github.event_name == 'pull_request' }}
steps:
- name: Set environment
run: |
Expand Down
19 changes: 0 additions & 19 deletions .github/workflows/docker_utils.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: template - docker

env:
DEFAULT_FEATURES: tce,sequencer,network,node,subnet
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
AWS_SHARED_CREDENTIALS_FILE: "${{ github.workspace }}/.aws/credentials"
Expand All @@ -19,10 +18,6 @@ on:
required: false
type: string
default: stable
features:
gruberb marked this conversation as resolved.
Show resolved Hide resolved
required: false
type: string
default: tce,sequencer,network,node,subnet
outputs:
tags:
description: "Docker tags"
Expand All @@ -32,8 +27,6 @@ jobs:
docker:
name: Build and push docker image to GitHub Container Registry
runs-on: ubuntu-latest-16-core
outputs:
tags: ${{ steps.meta.outputs.tags }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -73,17 +66,6 @@ jobs:
aws configure set aws_secret_access_key ${{ env.AWS_SECRET_ACCESS_KEY }} --profile default
aws configure set aws_session_token ${{ env.AWS_SESSION_TOKEN }} --profile default

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch,suffix=${{ inputs.features != env.DEFAULT_FEATURES && format('-{0}', inputs.features) || '' }}
type=ref,event=pr,suffix=${{ inputs.features != env.DEFAULT_FEATURES && format('-{0}', inputs.features) || '' }}
type=semver,suffix=${{ inputs.features != env.DEFAULT_FEATURES && format('-{0}', inputs.features) || '' }},pattern={{version}}
type=semver,suffix=${{ inputs.features != env.DEFAULT_FEATURES && format('-{0}', inputs.features) || '' }},pattern={{major}}.{{minor}}

- name: Push to GitHub Container Registry
uses: docker/build-push-action@v3
with:
Expand All @@ -92,7 +74,6 @@ jobs:
# push only images targeting topos (e.g.: exclude test, lint, etc.)
push: ${{ inputs.target == 'topos' }}
target: ${{ inputs.target }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
secret-files: |
"aws=${{ github.workspace }}/.aws/credentials"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@ jobs:
with:
AWS_ACCESS_KEY_ID: ${{ secrets.ROBOT_AWS_ACCESS_KEY_ID}}
AWS_SECRET_ACCESS_KEY: ${{ secrets.ROBOT_AWS_SECRET_ACCESS_KEY}}
- run: cargo nextest run cert_delivery --locked --no-default-features -F tce
- run: cargo nextest run cert_delivery --locked --no-default-features
env:
RUST_LOG: topos=warn
2 changes: 1 addition & 1 deletion crates/topos-p2p/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@ test-log.workspace = true
env_logger.workspace = true
rstest = { workspace = true, features = ["async-timeout"] }
tracing-subscriber.workspace = true
topos-test-sdk = { path = "../topos-test-sdk/", features = ["tce"] }
topos-test-sdk = { path = "../topos-test-sdk/" }
rand.workspace = true
2 changes: 1 addition & 1 deletion crates/topos-tce-proxy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ serial_test.workspace = true
byteorder = "1.4.3"
dockertest = "0.3.1"
topos-tce-storage = { path = "../topos-tce-storage" }
topos-test-sdk = { path = "../topos-test-sdk/", features=["tce"] }
topos-test-sdk = { path = "../topos-test-sdk/" }
24 changes: 6 additions & 18 deletions crates/topos-test-sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ workspace = true
topos-core = { workspace = true, features = ["uci", "api"] }
topos-crypto = { path = "../topos-crypto/" }
topos-p2p = { path = "../topos-p2p/" }
topos-tce = { path = "../topos-tce/", optional = true }
topos-tce-api = { path = "../topos-tce-api/", optional = true }
topos-tce-broadcast = { path = "../topos-tce-broadcast/", optional = true }
topos-tce-gatekeeper = { path = "../topos-tce-gatekeeper/", optional = true }
topos-tce = { path = "../topos-tce/" }
topos-tce-api = { path = "../topos-tce-api/" }
topos-tce-broadcast = { path = "../topos-tce-broadcast/" }
topos-tce-gatekeeper = { path = "../topos-tce-gatekeeper/" }
topos-tce-storage = { path = "../topos-tce-storage/" }
topos-tce-synchronizer = { path = "../topos-tce-synchronizer/", optional = true }
topos-tce-transport = { path = "../topos-tce-transport/", optional = true }
topos-tce-synchronizer = { path = "../topos-tce-synchronizer/" }
topos-tce-transport = { path = "../topos-tce-transport/" }

hex.workspace = true
ethers.workspace = true
Expand All @@ -42,17 +42,5 @@ tokio.workspace = true
tracing.workspace = true
async-stream.workspace = true

[features]
default = []
tce = [
"topos-core/api",
"topos-tce",
"topos-tce-api",
"topos-tce-broadcast",
"topos-tce-gatekeeper",
"topos-tce-synchronizer",
"topos-tce-transport",
]

[build-dependencies]
tonic-build.workspace = true
1 change: 0 additions & 1 deletion crates/topos-test-sdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ pub mod networking;
pub mod p2p;
pub mod sequencer;
pub mod storage;
#[cfg(feature = "tce")]
pub mod tce;

use std::{collections::HashSet, net::SocketAddr, sync::Mutex};
Expand Down
1 change: 1 addition & 0 deletions crates/topos-wallet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ impl SecretManager {
}

pub fn from_aws(_secrets_config: &str) -> Self {
println!("loading from aws-sm");
todo!()
}

Expand Down
18 changes: 6 additions & 12 deletions crates/topos/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ edition = "2021"
workspace = true

[dependencies]
topos-tce = { path = "../topos-tce/", optional = true }
topos-tce = { path = "../topos-tce/" }
topos-p2p = { path = "../topos-p2p" }
topos-tce-transport = { path = "../topos-tce-transport", optional = true }
topos-sequencer = { path = "../topos-sequencer", optional = true }
topos-tce-transport = { path = "../topos-tce-transport" }
topos-sequencer = { path = "../topos-sequencer" }
topos-core = { workspace = true, features = ["api"] }
topos-certificate-spammer = { path = "../topos-certificate-spammer", optional = true }
topos-certificate-spammer = { path = "../topos-certificate-spammer" }
topos-tce-broadcast = { path = "../topos-tce-broadcast", optional = true }
topos-wallet = { path = "../topos-wallet" }

Expand Down Expand Up @@ -54,7 +54,7 @@ topos-tce-synchronizer = { path = "../topos-tce-synchronizer" }
topos-tce-gatekeeper = { path = "../topos-tce-gatekeeper" }
topos-tce-api = { path = "../topos-tce-api" }
topos-tce-storage = { path = "../topos-tce-storage" }
topos-test-sdk = { path = "../topos-test-sdk", features = ["tce"] }
topos-test-sdk = { path = "../topos-test-sdk" }
serde.workspace = true
serde_json.workspace = true
test-log.workspace = true
Expand All @@ -68,11 +68,5 @@ rstest = { workspace = true, features = ["async-timeout"] }
tempfile = "3.8.0"

[features]
default = ["tce", "sequencer", "network", "node", "setup", "subnet"]
default = []
broadcast_via_channels = ["default", "topos-tce-broadcast/task-manager-channels"]
tce = ["topos-tce", "topos-tce-transport"]
sequencer = ["topos-sequencer"]
network = ["topos-certificate-spammer"]
node = ["tce", "sequencer"]
setup = []
subnet = []
5 changes: 0 additions & 5 deletions crates/topos/src/components/doctor.rs

This file was deleted.

12 changes: 1 addition & 11 deletions crates/topos/src/components/mod.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
pub(crate) mod doctor;
#[cfg(feature = "network")]
pub(crate) mod network;
#[cfg(feature = "node")]
pub(crate) mod node;
#[cfg(feature = "sequencer")]
pub(crate) mod sequencer;
#[cfg(feature = "setup")]
pub(crate) mod regtest;
pub(crate) mod setup;
gruberb marked this conversation as resolved.
Show resolved Hide resolved
#[cfg(feature = "subnet")]
pub(crate) mod subnet;
#[cfg(feature = "tce")]
pub(crate) mod tce;
30 changes: 0 additions & 30 deletions crates/topos/src/components/network/commands.rs

This file was deleted.

12 changes: 11 additions & 1 deletion crates/topos/src/components/node/commands.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
use std::path::PathBuf;

use clap::{Args, Subcommand};
use serde::Serialize;

mod init;
mod status;
mod up;

pub(crate) use init::Init;
pub(crate) use status::Status;
pub(crate) use up::Up;

#[derive(Args, Debug, Serialize)]
pub(crate) struct NodeArgument {
#[clap(short, long, default_value = "http://[::1]:1340")]
pub(crate) node: String,
}

/// Utility to manage your nodes in the Topos network
#[derive(Args, Debug)]
pub(crate) struct NodeCommand {
Expand All @@ -25,10 +34,11 @@ pub(crate) struct NodeCommand {
pub(crate) subcommands: Option<NodeCommands>,
}

#[derive(Subcommand, Debug)]
#[derive(Subcommand, Debug, Serialize)]
pub(crate) enum NodeCommands {
Up(Box<Up>),
Init(Box<Init>),
Status(Status),
}

#[cfg(test)]
Expand Down
2 changes: 1 addition & 1 deletion crates/topos/src/components/node/commands/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use clap::Args;
use serde::Serialize;

#[derive(Args, Debug, Serialize)]
#[command(about = "Setup your node!", trailing_var_arg = true)]
#[command(about = "Setup your node", trailing_var_arg = true)]
#[serde(rename_all = "kebab-case")]
pub struct Init {
/// Name to identify your node
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
use super::NodeArgument;
use clap::Args;
use serde::Serialize;

#[derive(Args, Debug)]
#[derive(Args, Debug, Serialize)]
#[command(about = "Get node status")]
pub(crate) struct Status {
#[command(flatten)]
pub(crate) node_args: NodeArgument,
Expand Down
12 changes: 10 additions & 2 deletions crates/topos/src/components/node/commands/up.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use clap::Args;
use serde::Serialize;

#[derive(Args, Debug, Serialize)]
#[command(about = "Spawn your node!")]
#[derive(Args, Clone, Debug, Serialize)]
#[command(about = "Spawn your node")]
#[serde(rename_all = "kebab-case")]
pub struct Up {
/// Name to identify your node
Expand All @@ -18,4 +18,12 @@ pub struct Up {
/// Usable for cases where edge endpoint is available as infura (or similar cloud provider) endpoint
#[arg(long, env = "TOPOS_NO_EDGE_PROCESS", action)]
pub no_edge_process: bool,
/// Socket of the opentelemetry agent endpoint.
gruberb marked this conversation as resolved.
Show resolved Hide resolved
/// If not provided open telemetry will not be used
#[arg(long, env = "TOPOS_OTLP_AGENT")]
pub otlp_agent: Option<String>,
/// Otlp service name.
/// If not provided open telemetry will not be used
#[arg(long, env = "TOPOS_OTLP_SERVICE_NAME")]
pub otlp_service_name: Option<String>,
}
Loading
Loading