Commits on Source (51)
-
* Update README.md * Add Install instruction
-
Hugo Trentesaux authored
-
Moul authored
-
Hugo Trentesaux authored
-
Hugo Trentesaux authored
-
Hugo Trentesaux authored
-
Hugo Trentesaux authored
-
Hugo Trentesaux authored
closes #35
-
Hugo Trentesaux authored
-
Hugo Trentesaux authored
on runtime 802 changed crypto types
-
* CI : remove GET params at the end of assets URLs
-
Moul authored
This reverts commit 9460516b. Does not solve the issue, the links do not work anymore: They need `?job=$job_name` at the end in which the artifacts have been created https://git.duniter.org/clients/rust/gcli-v2s/-/releases/0.3.1
-
Moul authored
to speed up the process The runner is not overloaded with one build
-
* Fixing precision issue when converting the u64 cents amount into f32. Now composing the displayed value with integer part and fractional part separately (keeping left padding of 0 for the decimal part for the amount of decimals required)
-
Nicolas80 authored
* Added "/.idea" exclusion in .gitignore (for when using JetBrains IDEs) * Added dialoguer dependency for easier user input handling (see in inputs.rs) * Added sea-orm dependency to allow having DB entity mappings and use a local sqlite file database * Added rstest test dependency for parameterized tests support * Added derivation tests for each SecretFormat (including cesium v1 key derivation, using sp_core::ed25519::Pair) * Made a lot of changes to add vault_account and vault_derivation db tables to persist vault keys & derivations * Added support for KeyPair::Ed25519 linking to sp_core::ed25519::Pair which can be created from secret seed retrieved from nacl::sign::Keypair (which is created from cesium id + secret) ** This was necessary to allow deriving keys from "cesium v1" keys (to be reviewed - it might be a bad idea to permit that from a security point of view) * Only kept original (substrate) keyfiles support for migration (use "vault list-files" and "vault migrate") * Added possibility to give either "-a" Address or "-v" Vault Name as general option * Added extra commands in Vault ** list-files: (deprecated)List available key files (needs to be migrated with command "vault migrate" in order to use them) ** migrate: (deprecated)Migrate old key files into db (will have to provide password for each key) ** 'list' now has sub-commands 'all' or 'root' to show all keys or only root keys (without derivation path) ** use: "Use specific vault key (changes the config address)", which will have the same behaviour as `gcli <-a <Address>|-v <VaultName>> config save` (left a FIXME in there to review) ** derivation: Add a derivation to an existing (root) vault key ** rename: Give a meaningful vault name to a vault key or derivation ** remove: Remove a vault key (and potential derivations if it's a root key) * Had to bubble up "await" and "async" in a lot of places * ...
-
Nicolas80 authored
-
Nicolas80 authored
-
Nicolas80 authored
* Had to bump up the dependency since version 0.6.2 had a bug for the password confirmation - see https://github.com/mikaelmello/inquire/issues/149 * Removed `dialoguer` dependency * We may want to replace all `rpassword` usage with `inquire` in the future
-
Nicolas80 authored
* Adapted to have more coherent commands descriptions and added `long_about` more detailed description for `import` and `derivation` * Added the `vault list for` command * Added display of "format" of <Root> derivations in all `vault list` commands * Only allowing derivations for format "substrate" and "seed"
-
Nicolas80 authored
* Fixed small bug after switching from `dialoguer` to `inquire`: using `prompt_skippable()` only returns `None` if the user presses `Esc` (returned "" when user just pressed enter) * Now using `prompt()` and checking empty string again.
-
Nicolas80 authored
* Added a test to verify we don't need the nacl::sign::Keypair to handle cesium v1 (we can keep using scrypt to retrieve the seed and then sp_core::ed25519::Pair) ** This means we could remove some code linked to that and possibly the `nacl` dependency.
-
Nicolas80 authored
* Simply using "name" for the name given to an SS58 Address in the vault
-
Nicolas80 authored
-
Nicolas80 authored
* Cleaned-up code in several places * Now retrieving secret value in "substrate uri" format from the different prompt_xxx_and_compute_keypair methods
-
Nicolas80 authored
-
Nicolas80 authored
-
Nicolas80 authored
Made an extra check of derivation path to make sure it's not linking to the same SS58 Address as "root" suri when doing `vault import|migrate`
-
Nicolas80 authored
-
Nicolas80 authored
Small cleanup for data's db connection; adding method connect_db that returns a &DatabaseConnection (or panics with explanation message) Also changed some methods visibility so only connect_db is visible for usage.
-
Nicolas80 authored
-
Nicolas80 authored
-
Nicolas80 authored
* Started to investigate being able to make subkey command and trying to use sp_core::crypto::CryptoType instead of custom KeyPair * Big refactoring to have all in one vault_account db table; using recursion through `parent` property * Added AccountTreeNode object and related methods to be able to more easily handle whole tree of accounts * Removed now unused vault_derivation * Replaced remaining usages of `rpassword` and removed the dependency * Added `indoc` dependency to support cleaner display of multi-line strings in tests
-
Nicolas80 authored
* Relaxed "update" restrictions in vault_account.rs before_save checks
-
Nicolas80 authored
-
Nicolas80 authored
* Put back simple `address` and `name` arguments in main.rs (with conflicts_with statement to prevent their usage at the same time) * Declared conflicts between indexer <=> no-indexer, indexer <=> network, url <=> network * Kept AddressOrVaultNameGroup args for vault usage since it's the only way to define one required arg within a group cleanly
-
Nicolas80 authored
Co-authored-by:
Hugo Trentesaux <hugo.trentesaux@lilo.org>
-
Nicolas80 authored
Co-authored-by:
Hugo Trentesaux <hugo.trentesaux@lilo.org>
-
Nicolas80 authored
Co-authored-by:
Hugo Trentesaux <hugo.trentesaux@lilo.org>
-
Nicolas80 authored
-
Nicolas80 authored
-
Nicolas80 authored
* Added support to show g1v1 base58 public key from (ed25519) ss58 address, AccountId, ed25519::Public with tests for those * Renamed SecretFormat.Cesium to SecretFormat.G1v1 * Adapted `clap` display help to reflect the change * Still supporting using "cesium" as "-S" secret format argument and mapping it to SecretFormat.G1v1 * Adapted display of vault * Changed column "Format" into "Crypto", showing either "ed25519" or "sr25519" instead of "cesium" or "substrate" * Adapted 1st row header to "SS58 Address/G1v1 public key" * For "ed25519" account, showing a 2nd row just below containing "└ G1v1: <base58 public key value>" * Adapted test cases and added a G1v1 account example * Adapted (String) Display of vault_account to include "g1v1_pub_key" value when crypto_scheme is Ed25519
-
Nicolas80 authored
* Now checking if GcliError Input message was for doing "ctrl+c" or "Esc" key in a prompt; in wich case we terminate the execution with the message. * Small correction in vault_account::compute_suri_account_tree_node where it's better to return GcliError instead of panic using unwrap if the password was incorrect. * Renamed `clap` arguments "value_name" in different places where it wasn't clear what kind of value was expected. * Using "ADDRESS" everytime we expect an AccountId * Using "USERNAME" everytime we expect a Username (most were requesting "TARGET") * Small corrections in `clap` help messages for `vault derive` * Added print of selected Vault item when using vault::try_fetch_key_pair method; just before requesting it's associated password (whenever we will try to sign for an action mostly)
-
Nicolas80 authored
* Re-did the mapping of DbAccountId so that we don't have to rely on derive macro FromJsonQueryResult that resulted in using JSON_TEXT in database column instead of VARCHAR * Tricky part I missed the first time was in impl of sea_orm::TryGetable::try_get_by where we should return Err TryGetError::Null in case the value is not present * Was otherwise throwing an exception whenever `parent` field (Option<DbAccountId>) was None when trying to persist the case in DB.
-
Nicolas80 authored
* Added a CHANGELOG.md file * Adapted config.md example of vault usage * Adapted some of the command descriptions to be more consistent
-
Nicolas80 authored
* Adapted vault display to have a space before address value (for derivations); which fixes the incorrect selection when double-clicking an address in the terminal
-
Nicolas80 authored
-
Moul authored
Adapt linux build now depending on libssl-dev. Introduce tests job (#45, #46) (!42) * Adapt linux build now depending on libssl-dev (#45) native-tls transitive dependency introduced in !41 which requires libssl-dev package installed for the build to find ssl components Switching to non-slim Debian image which comes with libssl-dev pre-installed Introduce linux tests job: to run tests (#46) and prevent similar issue in the future Update changelog
-
* * Updated CHANGELOG.md * * Updated CHANGELOG.md with `vault inspect` changes * * Added extra data in `vault inspect` command * Secret seed/mini-secret (if no soft derivation is used) * Public key (hex) * SS58 Address * (potential G1v1 public key if inspecting a <Base> account with ed25519 crypto-scheme) * Does most changes mentioned in Issue #28 (except the network id) * * Small change to be in line with the adapted parameter descriptions * * Refactored method get_keypair_from_secret_provider into SecretProvider internal method get_keypair * Added long_about for `LinkAccount` and `ChangeOwnerKey` to explain the target identity/account is provided with the options of those commands. * Applied cargo fmt * * Renamed AccountLinkParams to SecretProvider and adapted descriptions to "target account" instead of "account to link" which makes it a bit more generic * Added generic method get_keypair_from_secret_provider that returns the keypair or an error * Adapted `LinkAccount` & `ChangeOwnerKey` to use those * Not sure the best place for the SecretProvider and new method - leaving in identity for now * * Small refactoring to move method to vault.rs * * Small change to show the linked `<Base>` account if different from the one we inspect. * * Updated CHANGELOG.md * Code review: * Adapted commands identity `LinkAccount` & `ChangeOwnerKey` * Added possibility to provide * `-a` address of vault account to link * `-v` name of vault account to link * `-S` (secret_format) doesn't have a default anymore since it conflicts with using `-a` or `-v` * Added an error message if none of the params are provided * * Small clippy cleanup * * Changed sorting of children account so that they are sorted by Path value (makes more sense when viewing derivations of one account) * Added display of "Crypto scheme" when making `vault inspect` so that it is more coherent * Code review: * Cleanup of keys.rs get_keypair method since it always gets a crypto_scheme. * Removed "default" values in the method * Relying on "default" value of `-c` / `--crypto-scheme` argument (present in several places) which is ed25519 * Code review: * Small comment cleanup * Code cleanup removed unnecessary empty cells in "g1v1" row * Added doc on prompt_secret_substrate_and_compute_keypair method to explain the values returned in the tuple. * * Updated version to 0.4.1 * Added Changelog entry for the new version * Adapted some of the examples in config.md to take into account the new `-c` argument ** Did a simple addition of "-c sr25519" so that current examples still make sense and link to the same SS58 addresses * Added extra message when the DB parsing of DbAccountId fails, so we know for which string it failed. * * reverted most of the commit e9cd6a99: "Add secret format in database and display" * * Adapted catch_known of predefined derivations to properly handle both sr25519 and ed25519 versions of those keys. * * Added some logic between arguments of `vault import`; can't provide both `password` and `no-password` ** Added extra validation of non-interactive `name` argument value (same validation as when interactive: no '<', '>', '/' characters) * Added possibility to make a non-interactive derivation (given proper arguments are given and there is no issue found during the process) ** Added same validation for non-interactive `derivation_path` argument as when interactive ** If the same resulting address is already in the vault; interaction is still mandatory to make a choice * Had to change the name of argument AddressOrVaultNameGroup.name => vault_name to avoid conflict in `vault derive` ** Not changing the `-v` shortcut so no impact on existing commands * Allowing to pass "" empty string as non-interactive `name` argument and considering it as None (does a trim before checking empty; so only spaces will be considered as None as well) * * Adding `-c` crypto scheme parameter (with default ed25519) in different places ** as global parameter (taken into account if `-S` parameter is given ** as extra parameter for identity.rs commands LinkAccount & ChangeOwnerKey *** Also added a simple display of "target" address and crypto-scheme when performing those commands * * Fix for `vault migrate` that should use sr25519 scheme to be consistent * * Small fix in doc of function * Applied `cargo fmt` * add non interactive mode * remove unused methods * Add secret format in database and display * apply nico review * feat: Can choose between ed25519 ans sr25519
-
Nicolas80 authored
- Extra command `completion` added which takes a `--shell` argument to generate a completions script for a specified shell. - Adapted the Linux (amd64) build to: - generate the `gcli-completion.bash`, `gcli-completion.zsh`, `gcli-completion.fish`, `gcli-completion.ps1` completion scripts - add the `bash`, `zsh` and `fish` completion scripts in the `.deb` package - Added the ARM64 build generating a binary and a `.deb` package that also include those completion scripts.
-
Nicolas80 authored
- Added detailed instructions for generating the completion script and registering it for your shell when calling `gcli completion --help` - Added that information in the CHANGELOG.md - Moved `indoc` crate dependency in Cargo.toml to make it explicit it's now also used outside of tests.
-
Nicolas80 authored
Small change to assign proper link_type to generated assets; so that all binary & packages are assigned to "package" and completion scripts stay in "other".
Showing
- .gitignore 1 addition, 0 deletions.gitignore
- .gitlab-ci.yml 93 additions, 7 deletions.gitlab-ci.yml
- CHANGELOG.md 129 additions, 0 deletionsCHANGELOG.md
- Cargo.lock 2156 additions, 792 deletionsCargo.lock
- Cargo.toml 35 additions, 11 deletionsCargo.toml
- README.md 15 additions, 1 deletionREADME.md
- doc/config.md 177 additions, 15 deletionsdoc/config.md
- res/README.md 1 addition, 1 deletionres/README.md
- res/indexer-queries.graphql 16 additions, 15 deletionsres/indexer-queries.graphql
- res/indexer-schema.json 17118 additions, 5391 deletionsres/indexer-schema.json
- res/metadata.scale 0 additions, 0 deletionsres/metadata.scale
- src/commands/account.rs 5 additions, 3 deletionssrc/commands/account.rs
- src/commands/certification.rs 2 additions, 2 deletionssrc/commands/certification.rs
- src/commands/cesium.rs 101 additions, 38 deletionssrc/commands/cesium.rs
- src/commands/collective.rs 7 additions, 12 deletionssrc/commands/collective.rs
- src/commands/distance.rs 2 additions, 2 deletionssrc/commands/distance.rs
- src/commands/expire.rs 6 additions, 2 deletionssrc/commands/expire.rs
- src/commands/identity.rs 211 additions, 133 deletionssrc/commands/identity.rs
- src/commands/net_test.rs 2 additions, 2 deletionssrc/commands/net_test.rs
- src/commands/oneshot.rs 4 additions, 4 deletionssrc/commands/oneshot.rs
CHANGELOG.md
0 → 100644
This diff is collapsed.
... | ... | @@ -10,48 +10,53 @@ license = "AGPL-3.0-only" |
name = "gcli" | ||
repository = "https://git.duniter.org/clients/rust/gcli-v2s" | ||
description = "A command-line interface for Duniter v2s uses" | ||
version = "0.2.12" | ||
version = "0.4.2" | ||
[dependencies] | ||
# subxt is main dependency | ||
subxt = { git = 'https://github.com/duniter/subxt', branch = 'subxt-v0.35.3-duniter-substrate-v1.11.0', default-features = false, features = [ | ||
subxt = { git = 'https://github.com/duniter/subxt', branch = 'subxt-v0.37.0-duniter-substrate-v1.14.0', default-features = false, features = [ | ||
"substrate-compat", | ||
"native", | ||
"jsonrpsee", | ||
] } | ||
# substrate primitives dependencies | ||
sp-core = { git = "https://github.com/duniter/duniter-polkadot-sdk.git", branch = "duniter-substrate-v1.11.0" } | ||
sp-runtime = { git = "https://github.com/duniter/duniter-polkadot-sdk.git", branch = "duniter-substrate-v1.11.0" } | ||
sp-core = { git = "https://github.com/duniter/duniter-polkadot-sdk.git", branch = "duniter-substrate-v1.14.0" } | ||
sp-runtime = { git = "https://github.com/duniter/duniter-polkadot-sdk.git", branch = "duniter-substrate-v1.14.0" } | ||
# crates.io dependencies | ||
anyhow = "^1.0" | ||
clap = { version = "^4.5.4", features = ["derive"] } | ||
clap = { version = "^4.5.19", features = ["derive"] } | ||
clap_complete = "^4.5.19" | ||
codec = { package = "parity-scale-codec", version = "^3.6.12" } | ||
env_logger = "^0.10" | ||
futures = "^0.3.30" | ||
graphql_client = { version = "^0.13.0", features = ["reqwest-rustls"] } | ||
hex = "^0.4.3" | ||
log = "^0.4.21" | ||
log = "^0.4.22" | ||
reqwest = { version = "^0.11.27", default-features = false, features = [ | ||
"rustls-tls", | ||
] } | ||
rpassword = "^7.3.1" | ||
inquire = "^0.7.5" | ||
serde = { version = "^1.0", features = ["derive"] } | ||
serde_json = "^1.0.117" | ||
tokio = { version = "^1.37.0", features = ["macros"] } | ||
serde_json = "^1.0.128" | ||
tokio = { version = "^1.40.0", features = ["macros"] } | ||
confy = "^0.5.1" | ||
bs58 = "^0.5.1" | ||
inquire = "^0.6.2" | ||
directories = "^5.0.1" | ||
comfy-table = "^7.1.1" | ||
sea-orm = { version = "1.1.0", features = [ "sqlx-sqlite", "runtime-tokio-native-tls", "macros" ] } | ||
indoc = "2.0.5" | ||
# crypto | ||
scrypt = { version = "^0.11", default-features = false } # for old-style key generation | ||
nacl = { version = "^0.5.3" } # for old-style key generation | ||
# this is beta crate for password-encrypted files | ||
age = { default-features = false, version = "^0.10.0", features = ["armor"] } | ||
bip39 = { version = "^2.0.0", features = ["rand"] } # mnemonic | ||
colored = "2.1.0" | ||
# Tests | ||
rstest = "0.23.0" | ||
# allows to build gcli for different runtimes and with different predefined networks | ||
[features] | ||
... | ... | @@ -64,3 +69,22 @@ g1 = [] |
name = "gcli" | ||
identifier = "com.axiomteam.gcli" | ||
icon = ["gcli.png"] | ||
# Used by gitlab ci to add extra assets in the .deb packages (both amd64 & arm64) | ||
# Those gcli-completion.* assets are created during gitlab ci "build_linux" | ||
#Documentation in https://github.com/kornelski/cargo-deb | ||
[package.metadata.deb] | ||
assets = [ | ||
# Examples | ||
#target/release path is special, and gets replaced by cargo-deb with the actual target dir path. | ||
#["target/release/cargo-deb", "usr/bin/", "755"], | ||
#both array and object syntaxes are equivalent: | ||
#{ source = "README.md", dest = "usr/share/doc/cargo-deb/README", mode = "644"}, | ||
# Bin has to be manually added since we override the default "assets" | ||
{ source = "target/release/gcli", dest = "usr/bin/", mode = "755" }, | ||
# The extra shell completion script assets | ||
{ source = "gcli-completion.bash", dest = "/etc/bash_completion.d/gcli", mode = "644" }, | ||
{ source = "gcli-completion.zsh", dest = "/usr/local/share/zsh/site-functions/_gcli", mode = "644" }, | ||
{ source = "gcli-completion.fish", dest = "/usr/share/fish/vendor_completions.d/gcli.fish", mode = "644" } | ||
] | ||
\ No newline at end of file |
This diff is collapsed.
No preview for this file type