Getting vault Public Id?

I couldn’t find anything on this with a forum search, so I hope this hasn’t been asked before

Anyway, I’ve been toying around with the local vaults and was wondering if there is a a convenient way to get the Public Id of vaults started via safe-cli and the safe vault run-baby-fleming command? The vault log file show the ID in truncated format unfortunately, so I hacked the debug format function to print the whole key, and rebuilt the vault binary This seems like a roundabout of doing it though, and was wondering if there’s a better way.

Thanks in advance :slight_smile:

2 Likes

I don’t know of any way to get this other than as you did recompiling with reformatted log messages.

You may be interested in this vault rpc document, seems like this info would belong well in the getinfo call.

1 Like

That service plus a vault client api within safe-api should allow any app (including the safe-cli) to query info from the running vault, as well as change settings/properties so they can be applied immediately without restarting the vault, e.g. changing the reward’s wallet address or changing the amount of storage space the user wants to share.

E.g.:

$ safe wallet create
Wallet created at: "safe://hyryynbxuaram7mq7oc87941efrp58pmymkrkrz7dm4kymxgz43gkbsk3crb6o"
New SafeKey created at: "safe://hyryyyyr8mgx56thnax6dtm13guqojeonas1t9oj591eeae8espzncgi6cr"
Key pair generated:
Public Key = 87599fbf4782c3fc38ae5934dd04a202c5a51fc13bfc908c20e8b36e261abe6124a645a4256fffb271035316448ed488
Secret Key = 82eb6ae9faad559bae3f2bb812986c7df86b3a98c8a29ff7f888126a46721c64

$ safe vault set-wallet safe://hyryynbxuaram7mq7oc87941efrp58pmymkrkrz7dm4kymxgz43gkbsk3crb6o
Farming rewards will now be sent to: safe://hyryynbxuaram7mq7oc87941efrp58pmymkrkrz7dm4kymxgz43gkbsk3crb6o

…and the same for just public keys instead of Wallet’s XOR-URLs.

2 Likes

Might need to be able to resolve multiple vaults, eg maybe

safe vault set-wallet <old-wallet> <new-wallet>
or
safe vault set-wallet <vault-id> <new-wallet>

Brings up a general point of how to refer to any particular vault, maybe could be a bit like git with firstbits (ie first N unique hex chars of any commit, I think github uses 8 chars ie 32 bits)? This style of name resolution would only be used at the local level (bitcoin firstbits has more info).

2 Likes

…how about also something like this if CLI can sign the request with old wallet sk and send it using SAFE instead of local connection to vault:

$ safe vault set-wallet <vault XOR-URL> <new-wallet>
2 Likes

Wasn’t aware of this one, thanks for pointing it out :slight_smile:

From a usability standpoint, might also be handy to be able to locally set up wallet alias’s like git does for remotes (e.g. origin, upstream, etc.).

1 Like