Bitgert Blockchain Documentation
  • BRISE Chain Documentation
    • Getting Started
    • Become a validator
    • Contributing
    • BRISE Chain Explorers
    • Genesis File
    • Consensus
    • Introduction
  • Wallets
  • For Developers
    • Network Status Monitoring Guideline
    • Proxy Contract
    • Local Brise Chain Network
    • Deploy NFT
    • RPC
    • BRISE Chain Relayer
    • BRISE Chain Full Node Documentation
    • Wallet Providers
    • Verify Proxy Contract
    • Hardhat Verify
    • Truffle Verify
    • Deploy on Truffle
    • Deploy on Remix IDE
    • Smart Contract Tools
    • Create Wallet
Powered by GitBook
On this page
  • Key Management
  • Setup Web3
  • Connect to BRISE network
  • Set up account
  • Recover account
  • Full Example
  1. For Developers

Create Wallet

PreviousSmart Contract Tools

Last updated 1 year ago

Key Management

This article is a guide about key management strategy on client side of your Decentralised Application on Brise Chain

Setup Web3

web3.js is a javascript library that allows our client-side application to talk to the blockchain. We configure web3 to communicate via Metamask.

web3.js doc is

Connect to BRISE network

    // mainnet 
     const web3 = new Web3('https://mainnet-rpc.brisescan.com');
    // testnet
    const web3 = new Web3('https://testnet-rpc.brisescan.com');

Set up account

If the installation and instantiation of web3 was successful, the following should successfully return a random account:

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

Recover account

If you have backup the private key of your account, you can use it to restore your account.

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

Full Example

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

    const web3 = new Web3('https://mainnet-rpc.brisescan.com');
    const loader = setupLoader({ provider: web3 }).web3;

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

here