Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

156
Visualizações
Best way to save a secretKey

I'm learning Solana API on ReactJS. After generating a keypair you can recreate the same keypair with the secretKey. How can I save this keypair? I'm using react and I want to recreate always the same keypair unless I generate another.

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

The question of "best" is a matter of opinion, but in your case, since you're just learning and using this keypair for development, your best bet is to save it to your local disk.

If you're developing in a browser environment, you can just hardcode the bytes of your secret key in the code.

Later on, once you're deployed to mainnet and want to work safely, a hardware wallet is likely your best option.

You can find more information on wallets in the docs: https://docs.solana.com/wallet-guide

about 4 years ago · Juan Pablo Isaza Relatório

0

I write it to a file. Create generateKeypair.js in src directory and add this

const fs=require('fs')
const anchor=require("@project-serum/anchor")
const account=anchor.web3.Keypair.generate()
fs.writeFileSync('./keypair.json',JSON.stringify(account))

then execute this script once:

node src/generateKeypair.js
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda