Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

159
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda