Error while creation of USDC token using local solana-test-validator

Hi. I’ve set up local solana-test-validator, solana-cli and spl-token cli, configured all that for the local validator. Now, when I want to create USDC spl-token account. I’m trying and I got the following error:

vig@b4mw:~$ spl-token create-account EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
Creating account 5PZZvFgtLBcuyK3r6aTLgcv9ghC9cM2NoEAHS2zuCB5
RPC response error -32002: Transaction simulation failed: Error processing Instruction 0: custom program error: 0x2 [18 log messages]
vig@b4mw:~$ spl-token create-account 5PZZvFgtLBcuyK3r6aTLgcv9ghC9cM2NoEAHS2zuCB5
Creating account D8aNRJpC6uX9NC71vmafHjMuR8dVJi3CUcWE2ZUqWzvf
RPC response error -32002: Transaction simulation failed: Error processing Instruction 0: custom program error: 0x2 [18 log messages]
vig@b4mw:~$ spl-token create-account BAh2cxYAvVQLk1U4BFXfW8BUiqvcaqDRDy5DJvGJznVj
Creating account 8aWuE5KnXHfT5JZ97mPcci7aDXraMufWfwieEG3twt7j
RPC response error -32002: Transaction simulation failed: Error processing Instruction 0: custom program error: 0x2 [18 log messages]

Could you help me?

Hi @vgindin it’s not working because the USDC token hasn’t been created on your local test validator.

If you open the Solana explorer and select your local test validator as the RPC endpoint you can paste in the address and it will show and empty account:

If you check the account on the Mainnet, though, it recognizes the address as the USDC token address.

1 Like

Thank you @zicklag. I understand.