Skip to content

Conversation

@ProgramCpp
Copy link
Contributor

@ProgramCpp ProgramCpp commented Jun 25, 2022

read wallet secret from os keyring


@ProgramCpp ProgramCpp changed the title Ja read wallet secret from os keyring Jun 25, 2022
func (h *GitopiaHandler) initSecrets() (string, error) {
walletAddress := ""
var err error
if h.secType == UNKNOWN {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this check required? This will always be true right since initSecrets will be called only once in a git-remote-gitopia session?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it will be called everytime on Push. but we are loading secrets only once with this check

@faza
Copy link
Contributor

faza commented Jul 1, 2022

❯ git-gitopia-keys keys add gitopia --recover
> Enter your bip39 mnemonic
<mnemonic>

- name: gitopia
  type: local
  address: cosmos1afzaphqr6y2z9g4v59870wyc2k85zdc6g3sjmt
  pubkey: '{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"Atz54eg+xp21rKXOYFpiE7imtB8nYNfFQCkylNXsuiUj"}'
  mnemonic: ""

Done

The address generated are cosmos ones. Configure address prefix of gitopia.

@faza
Copy link
Contributor

faza commented Jul 6, 2022

While testing i'm getting this error. Is there anything else that needs to be done?

❯ git gitopia keys list
- name: gitopia
  type: local
  address: gitopia1afzaphqr6y2z9g4v59870wyc2k85zdc6kfh95g
  pubkey: '{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"Atz54eg+xp21rKXOYFpiE7imtB8nYNfFQCkylNXsuiUj"}'
  mnemonic: ""
- name: ledger
  type: ledger
  address: gitopia14t0ta8vvv2nrcx86g87z888s7pqat4svuyw7ae
  pubkey: '{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"A61FmJUOB2YlpBHOwcNYSSd/vcX3QIHASHUwKv2x11aU"}'
  mnemonic: ""

Done
❯ git push origin master
2022/07/06 16:41:18 fatal: Gitopia wallet is not configured! Set gitopia key or use Ledger

I have configured the key_name in git config also

❯ git config --global --get gitopia.key
gitopia

@ProgramCpp
Copy link
Contributor Author

  1. try deleting and adding key again. incase it was added before introducing servicename change.
  2. try returning err from h.initGitopiaKey() to figure out the issue

if it still doesnt work.. we can pair and debug?

@faza
Copy link
Contributor

faza commented Jul 6, 2022

Okay, i'll try

@ProgramCpp
Copy link
Contributor Author

also set export GITOPIA_ENV=testing and then make install

@faza
Copy link
Contributor

faza commented Jul 15, 2022

@ProgramCpp Tested ok

Just change the appname to "git-remote-gitopia" to seggregate the keys of "gitopia" and "git-remote-gitopia". I'll merge after that

@ProgramCpp
Copy link
Contributor Author

@ProgramCpp Tested ok

Just change the appname to "git-remote-gitopia" to seggregate the keys of "gitopia" and "git-remote-gitopia". I'll merge after that

this is already done

AppName = "git-remote-gitopia"

@faza faza merged commit 34123e0 into master Jul 16, 2022
faza pushed a commit that referenced this pull request Sep 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants