Pour cette question, c’est possible via les arguments globaux:
Pour voir les arguments globaux:
gcli --help
A command-line interface for Duniter v2s uses
Usage: gcli [OPTIONS] <COMMAND>
Commands:
account Account (balance, transfer...)
identity Identity (get, create, confirm, revoke...)
smith Smith (certify, go-online, go-offline...)
tech Tech (list members, proposals, vote...)
ud Universal Dividend (claim...)
oneshot Oneshot account (balance, create, consume...)
blockchain Blockchain (current block, runtime info...)
indexer Indexer (check, latest block)
config Config (show, save...)
vault Key management (import, generate, list...)
completion Generate a completions script for a specified shell (use `completion --help` for more info)
help Print this message or the help of the given subcommand(s)
Options:
-i, --indexer <INDEXER> Overwrite indexer endpoint
--no-indexer Do not use indexer
-S, --secret-format <SECRET_FORMAT> Secret key format (seed, substrate, g1v1)
-s, --secret <SECRET> Secret key or BIP39 mnemonic (only used when secret format is compatible) (eventually followed by derivation path)
-c, --crypto-scheme <CRYPTO_SCHEME> Crypto scheme to use (sr25519, ed25519) [default: ed25519]
-a <ADDRESS> SS58 Address
-v <NAME> Name of an SS58 Address in the vault
-u, --url <URL> Overwrite duniter websocket RPC endpoint
-n, --network <NETWORK> Target network (local, gdev, gtest...)
--no-wait prevent waiting for extrinsic completion
-o, --output-format <OUTPUT_FORMAT> Output format (human, json, ...) [default: human]
-h, --help Print help
-V, --version Print version
Config avant changement
gcli -o json config show | jq
{
"duniter_endpoint": "wss://archive-rpc.gdev.de.brussels.ovh",
"indexer_endpoint": "https://squid-hasura.gdev.de.brussels.ovh/v1/graphql",
"address": "5C8PhJPLE54x23RjmqBcEEnALryCDWdTJM5xLaoL9W8XEpnt",
"vault_account": "Derivation[address:5C8PhJPLE54x23RjmqBcEEnALryCDWdTJM5xLaoL9W8XEpnt, name:None, path:Some(\"/soft\"), parent:Some(\"5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY\")]"
}
Tester l’impact des arguments -u
et -i
(ils peuvent également être utilisé pour changer les valeurs uniquement pour une commande)
gcli -o json -u wss://gdev.coinduf.eu -i https://squid.gdev.coinduf.eu/v1/graphql config show | jq
{
"duniter_endpoint": "wss://gdev.coinduf.eu",
"indexer_endpoint": "https://squid.gdev.coinduf.eu/v1/graphql",
"address": "5C8PhJPLE54x23RjmqBcEEnALryCDWdTJM5xLaoL9W8XEpnt",
"vault_account": "Derivation[address:5C8PhJPLE54x23RjmqBcEEnALryCDWdTJM5xLaoL9W8XEpnt, name:None, path:Some(\"/soft\"), parent:Some(\"5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY\")]"
}
Sauvegarder le changement dans la config (cette commande n’est pas encore adaptée pour renvoyer du json
- à voir ce que l’on voudrait renvoyer ?)
gcli -o json -u wss://gdev.coinduf.eu -i https://squid.gdev.coinduf.eu/v1/graphql config save
Configuration updated!
Vérification de la config adaptée
gcli -o json config show | jq
{
"duniter_endpoint": "wss://gdev.coinduf.eu",
"indexer_endpoint": "https://squid.gdev.coinduf.eu/v1/graphql",
"address": "5C8PhJPLE54x23RjmqBcEEnALryCDWdTJM5xLaoL9W8XEpnt",
"vault_account": "Derivation[address:5C8PhJPLE54x23RjmqBcEEnALryCDWdTJM5xLaoL9W8XEpnt, name:None, path:Some(\"/soft\"), parent:Some(\"5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY\")]"
}