Skip to content

Commit

Permalink
Merge branch 'fraccaman/moniker' (#1057) into maint-0.13
Browse files Browse the repository at this point in the history
* fraccaman/moniker:
  changelog: add #1057
  ledger: append version to moniker
  • Loading branch information
juped committed Jan 23, 2023
2 parents 26ee42b + cc65641 commit 4afe047
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .changelog/unreleased/improvements/1057-moniker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Append Namada version number to tendermint moniker.
([#1057](https://github.com/anoma/namada/pull/1057))
9 changes: 9 additions & 0 deletions apps/src/lib/node/ledger/tendermint_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,16 @@ use namada::types::chain::ChainId;
use namada::types::key::*;
use namada::types::time::DateTimeUtc;
use serde_json::json;
#[cfg(feature = "abciplus")]
use tendermint::Moniker;
#[cfg(feature = "abcipp")]
use tendermint_abcipp::Moniker;
use thiserror::Error;
use tokio::fs::{self, File, OpenOptions};
use tokio::io::{AsyncReadExt, AsyncWriteExt};
use tokio::process::Command;

use crate::cli::namada_version;
use crate::config;
use crate::facade::tendermint::{block, Genesis};
use crate::facade::tendermint_config::net::Address as TendermintAddress;
Expand Down Expand Up @@ -305,6 +310,10 @@ async fn update_tendermint_config(
let mut config =
TendermintConfig::load_toml_file(&path).map_err(Error::LoadConfig)?;

config.moniker =
Moniker::from_str(&format!("{}-{}", config.moniker, namada_version()))
.expect("Invalid moniker");

config.p2p.laddr =
TendermintAddress::from_str(&tendermint_config.p2p_address.to_string())
.unwrap();
Expand Down

0 comments on commit 4afe047

Please sign in to comment.