Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bat/pre genesis wallet #1782

Closed
wants to merge 10 commits into from
7 changes: 7 additions & 0 deletions .changelog/unreleased/features/1782-pre-genesis-wallet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- Added `--pre-genesis` argument to the wallet commands to allow to generate
keys, implicit addresses and shielded keys without having a chain setup. If
no chain is setup yet (i.e. there's no base-dir or it's empty), the wallet
defaults to use the pre-genesis wallet even without the `--pre-genesis`
flag. The pre-genesis wallet is located inside base-dir in
`pre-genesis/wallet.toml`.
([#1782](https://github.com/anoma/namada/pull/1782))
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Added bech32m string encoding for `common::PublicKey` and `DkgPublicKey`.
([#849](https://github.com/anoma/namada/pull/849))
33 changes: 19 additions & 14 deletions apps/src/bin/namada-node/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,31 @@ pub fn main() -> Result<()> {
match cmd {
cmds::NamadaNode::Ledger(sub) => match sub {
cmds::Ledger::Run(cmds::LedgerRun(args)) => {
let wasm_dir = ctx.wasm_dir();
let chain_ctx = ctx.take_chain_or_exit();
let wasm_dir = chain_ctx.wasm_dir();
sleep_until(args.start_time);
ledger::run(ctx.config.ledger, wasm_dir);
ledger::run(chain_ctx.config.ledger, wasm_dir);
}
cmds::Ledger::RunUntil(cmds::LedgerRunUntil(args)) => {
let wasm_dir = ctx.wasm_dir();
let mut chain_ctx = ctx.take_chain_or_exit();
let wasm_dir = chain_ctx.wasm_dir();
sleep_until(args.time);
ctx.config.ledger.shell.action_at_height =
chain_ctx.config.ledger.shell.action_at_height =
Some(args.action_at_height);
ledger::run(ctx.config.ledger, wasm_dir);
ledger::run(chain_ctx.config.ledger, wasm_dir);
}
cmds::Ledger::Reset(_) => {
ledger::reset(ctx.config.ledger)
let chain_ctx = ctx.take_chain_or_exit();
ledger::reset(chain_ctx.config.ledger)
.wrap_err("Failed to reset Namada node")?;
}
cmds::Ledger::DumpDb(cmds::LedgerDumpDb(args)) => {
ledger::dump_db(ctx.config.ledger, args);
let chain_ctx = ctx.take_chain_or_exit();
ledger::dump_db(chain_ctx.config.ledger, args);
}
cmds::Ledger::RollBack(_) => {
ledger::rollback(ctx.config.ledger)
let chain_ctx = ctx.take_chain_or_exit();
ledger::rollback(chain_ctx.config.ledger)
.wrap_err("Failed to rollback the Namada node")?;
}
},
Expand All @@ -39,18 +44,18 @@ pub fn main() -> Result<()> {
// In here, we just need to overwrite the default chain ID, in
// case it's been already set to a different value
if let Some(chain_id) = ctx.global_args.chain_id.as_ref() {
ctx.global_config.default_chain_id = chain_id.clone();
ctx.global_config.default_chain_id = Some(chain_id.clone());
ctx.global_config
.write(&ctx.global_args.base_dir)
.unwrap_or_else(|err| {
eprintln!("Error writing global config: {}", err);
eprintln!("Error writing global config: {err}");
cli::safe_exit(1)
});
tracing::debug!(
"Generated config and set default chain ID to \
{chain_id}"
);
}
tracing::debug!(
"Generated config and set default chain ID to {}",
&ctx.global_config.default_chain_id
);
}
},
}
Expand Down
Loading
Loading