Segun-Ogundipe / solana-mail-web

2 stars 2 forks source link

Cann't redirect into dashboard #1

Open xuanlongvts opened 2 years ago

xuanlongvts commented 2 years ago

When i login, the screen login is not redirect int the dashboard screen.

i thought, there is a problem with version @project-serum/sol-wallet-adapter.

Can you investigate it?

it Show error:

Transaction simulation failed: Attempt to debit an account but found no record of a prior credit.

Thanks!

Segun-Ogundipe commented 2 years ago

Hi @xuanlongvts, did you credit the account with some sol? This error means that your account has no sol. You can credit the account with:

solana airdrop 100 <account_address>
xuanlongvts commented 2 years ago

i'm sure the account had airdrop SOL (10 SOL), i tried two times, but it's not ok. I tried on localhost and devnet, i still not work.

Segun-Ogundipe commented 2 years ago

What network did you select in the sol-wallet UI? Make sure the selected network is the same you requested airdrop from

xuanlongvts commented 2 years ago

I will describe step by step.

  1. solana-keygen new (will genegrate in ~/.config/solana/id.json
  2. solana config set --url localhost (to setup infor at local)
  3. solana airdrop 10 pubkey (public key genegrate from step 1)
  4. solana balance pubke (will show 10 SOL just airdrop)
  5. run yarn start from UI
  6. copy seed words and click Signin
  7. A popup of sollet show and enter infor, i choose network http://localhost:8899. as image attached
  8. Approve from popup, and show log in console is: transaction simulation failed: Attempt to debit an account but found no record of a prior credit.
Screen Shot 2021-10-23 at 3 10 37 PM

After i change net work.

  1. solana config set --url https://api.devnet.solana.com
  2. solana airdrop 10 pubkey (public key genegrate from step 1)
  3. solana balance pubke (will show 10 SOL just airdrop)
  4. copy seed words and click Signin
  5. A popup of sollet show and enter infor, i choose network https://api.devnet.solana.com
  6. Approve from popup, and show log in console is: transaction simulation failed: Attempt to debit an account but found no record of a prior credit.
Screen Shot 2021-10-23 at 3 18 35 PM
xuanlongvts commented 2 years ago

you can see this is a way connect to the wallet https://github.com/jsoneaday/solana-send-money/blob/main/src/helpers/wallet.ts

Segun-Ogundipe commented 2 years ago

Hi @xuanlongvts, the sollet wallet has its own wallet address, it doesn't use the address you generated with solana-keygen new. You need to credit that address too. Look for your sollet address, it is listed under Main account in the ACCOUNT menu. Once you get it run solana airdrop 10 <sollet_address>. Make sure the address has 10 sol or more.

If you still run into any errors, you can schedule a video call with me so we can look at it together.

Segun-Ogundipe commented 2 years ago

Hi @xuanlongvts, did the above comment help in fixing this issue?