보스아고라
  • Agora
    • What is BOSagora
      • Why BOSagora
      • BOSagora Chain
      • Consensus mechanism (POS)
      • Agora staking economics
  • BOSagora Chain info
  • Upgrades
    • The withdrawals upgrade for Mainnet
      • Withdraw your validator
    • The withdrawals upgrade for Testnet
  • Validator Start
    • Check list to be Validator
    • Running an Agora node and Validator
      • Agora Testnet
      • Agora Mainnet
  • VOTERA
    • Introduction
    • How to Vote
    • Business Proposal
    • System Proposal
  • Getting Started
    • Deploy Smart Contract
      • Using Remix
      • Using Hardhat
      • Using Truffle
    • ERC-20 Tokens
    • Deploy NFTs
      • NFT Metadata Standard
  • Tools
    • Wallets
      • Key Management
    • Block explorer
    • SDK
    • IDE
  • dAPPs
    • Get started
    • BOASwap
    • Bridge (BOASwap)
      • How to use a Bridge
Powered by GitBook
On this page
  • Web3 설정하기
  • BizNet에 연결하기
  • 계정 설정하기
  • 계정 복구하기
  • 전체코드
  1. Tools
  2. Wallets

Key Management

키 관리

PreviousWalletsNextBlock explorer

Last updated 2 years ago

이 문서는 Agora(BizNet)에서 분산된 애플리케이션의 클라이언트측 키 관리 전략에 대한 가이드입니다.

Web3 설정하기

web3.js는 클라이언트 측 애플리케이션이 블록체인과 대화할 수 있도록 하는 자바스크립트 라이브러리입니다. 메타마스크를 통해 통신할 수 있도록 web3를 구성하여야 합니다.

web3.js 에 대한 자세한 설명은 을 참조해 주십시오.

BizNet에 연결하기

// mainnet 
const web3 = new Web3('https://mainnet.bosagora.org');
// testnet
const web3 = new Web3('https://testnet.bosagora.org');

계정 설정하기

web3의 설치 및 인스턴스화에 성공하였다면, 아래 코드는 임의의 계정을 리턴하는 것입니다.

const account = web3.eth.accounts.create();

계정 복구하기

계정의 개인 키를 백업한 경우 그 개인키를 사용하여 계정을 복원할 수 있습니다.

const account = web3.eth.accounts.privateKeyToAccount("$private-key")

전체코드

const Web3 = require('web3');
async function main() {

	const web3 = new Web3('https://mainnet.bosagora.org');
    const loader = setupLoader({ provider: web3 }).web3;

    const account = web3.eth.accounts.create();
    console.log(account);
}
이곳