CLI Wallet Users

Guide for Electroneum CLI Wallet Users: Transitioning to the New Smart Chain

Introduction: For those who manage their ETN through the CLI wallet, this comprehensive guide is designed to ensure a smooth migration process to the new Smart Chain. Let’s dive into the steps for a seamless transition:


1. 🔍 Begin with the Basics: Make sure you're using the terminal version (5.0.0.3+) of the Electroneum Flow programs. If you haven’t updated yet, visit the official Electroneum GitHub repository to get the final versions of the legacy programs. Here, you can compile the source or go to the releases page to download the pre-compiled binaries. The migration can be performed with a combination of the electroneum daemon (electroneumd) and either the cli wallet program (electroneum-wallet-cli) or the RPC wallet program (electroneum-wallet-rpc). These should be opened as you would usually open them without the need for any special flags or other input.

1.1 (Optional) Import Paper Wallet in CLI: If you prefer to import your paper wallet into the CLI Wallet you can do so by starting the CLI Wallet with the command below and follow the steps provided by the electroneum-wallet-cli in your terminal:

electroneum-wallet-cli --generate-from-keys <choose a wallet file name>

2. 🔄 Synchronise & Wait for the Fork: Ensure that your wallet is synchronised with the blockchain. When the anticipated fork block takes place, your wallet will automatically migrate your balances to the bridge portal address during the next wallet refresh, whether it’s auto-initiated or manually triggered. If you have not yet migrated to the public (v4) section of the old blockchain, this will be performed automatically before the Smart Chain migration transaction. To check the status of your migration transfers, you can simply type the following into your cli wallet:

show_transfers

3. 🌉 Crossing the Bridge: Here's what happens behind the scenes once you've initiated the migration:

  • The migration transaction transports your balance to the bridge portal (address) and simultaneously logs a record of your new Smart Chain address on the legacy blockchain (Electroneum Flow). You may check the status of your transaction using the usual wallet commands, and/or check the block explorer by typing your wallet address into the search bar at the top https://blockexplorer.electroneum.com/

  • Electroneum's bridge oracle will monitor the bridge portal address for inbound migration transactions.

  • Once your migration transaction receives five confirmations, the oracle takes action and dispatches a Smart Chain transaction to your new Smart Chain address.


4. 🔐 Accessing Your New Smart Chain Wallet

Upon successfully migrating your ETN balances to the new Smart Chain, accessing and managing them is essential. Here are the primary methods:

A) Via Command Line/ETN-SC Client:

  1. Setting Up the Environment:

    • Download and install the Smart Chain (etn-sc) client appropriate for your OS from the Electroneum GitHub repository. This acts as the command-line interface for running a full Electroneum node.

    • Alternatively, obtain official pre compiled binary releases from the same Github repository.

    • Ensure that your node is synchronised with the blockchain network.

  2. Importing Your Private Key:

    • Preparation: Ensure your computer is free from malware and key loggers. Disconnecting from the internet during the next steps might be advisable.

    • Paste your private key into a txt file: Copy the raw hex private key of your legacy Electroneum Flow wallet into a text file.

    • Private Key to Keystore File: Convert your raw private key into a key store file.

      • Open a terminal or command prompt.

      • Use the following command:

        etn-sc account import /path/to/your/raw_private_key.txt

        This will prompt you to set a password, and the etn-sc client will then create a new keystore file (inside directory <>) associated with the imported private key.

  3. Accessing and Using Your Wallet:

    • Start the etn-sc client with:

      etn-sc
    • Once synchronised, you can use the etn-sc console or attach to a running instance to initiate transactions or check your balance.

  4. If you have the etn-sc client already running, you can attach to this running instance. To do this:

    • Open your terminal or command prompt.

    • Enter the command:

      etn-sc attach

      This will open the etn-sc console, allowing you to interact directly with the blockchain and your accounts.

    • To view all the accounts associated with your etn-sc client, use the command:

      eth.accounts

      This will display a list of all the addresses you have in your client. If you've only

      imported one private key, you'll likely see just one address starting with "0x...". This is your new Smart Chain address where your migrated funds reside.

    • To check the balance for an account:

      • Identify the index number of your account. For instance, if it's the first address in the list, it will be indexed as [0].

      • Use the following command to check the balance for the first account:

        eth.getBalance(eth.accounts[0])

      This will show the balance in the smallest unit of the cryptocurrency, being the Wei unit. 1 Electroneum (ETN) is equivalent to 1,000,000,000,000,000,000 Wei. If you want to see the balance in a more familiar denomination, you'd typically use web3 to convert it. Web3.js is a widely used programmatic javascript tool used to interact with the blockchain and has blockchain related utilities like converting units. However, without web3, users might need to manually make the conversion or simply be aware they're seeing the balance in the base unit.

    • Rather than attaching in the way that we have done, you can also interact with the wallet using the Electroneum Wallet RPC, a guide for which is found here JSON-RPC Server

B) Via local ETN-SC Client & Metamask:

  1. Setting Up the Environment:

    • Download and install the Smart Chain (etn-sc) client appropriate for your OS from the Electroneum GitHub repository. This acts as the command-line interface for running a full Electroneum node.

    • Alternatively, obtain official pre compiled binary releases from the same Github repository.

    • Ensure that your node is synchronised with the blockchain network.

  2. Add a Custom Network to Metamask

    • With ETN-SC running, add a custom network in Metamask using the following data:

      • Network Name: Electroneum SmartChain

      • RPC URL: http://localhost:8545

      • Chain ID: 52014

      • Currency Symbol: ETN

      • Block Explorer URL: https://blockexplorer.electroneum.com

  3. Importing Your Private Key

    • Preparation: Ensure your computer is free from malware and key loggers. Disconnecting from the internet during the next steps might be advisable.

    • In Metamask: In the Accounts tab, select "Add account or hardware wallet" -> "Import Account" -> Type in your private key and select "Import"

C) Via Chainlist.wtf & Metamask

  1. Add Electroneum Smart Chain network to Metamask:

    • Visit chainlist.wtf and search for "Electroneum Mainnet"

    • Confirm the Chain ID 52014

    • Press "Connect Wallet", select "Metamask" and allow chainlist.wtf to add a custom network to your Metamask

  2. Importing Your Private Key

    • Preparation: Ensure your computer is free from malware and key loggers. Disconnecting from the internet during the next steps might be advisable.

    • In Metamask: In the Accounts tab, select "Add account or hardware wallet" -> "Import Account" -> Type in your private key and select "Import"


✍️ Logs & Notifications: During migration, the CLI wallet will keep a log of all significant activities, ensuring you remain informed throughout the process.

📢 Note on Post-Fork Actions & Restrictions:

  • Zero Fee Transactions: Both the migration transactions to the bridge address on Electroneum Flow, and the subsequent Smart Chain transaction from the oracle, carry no fees. This ensures users are made whole as they migrate.

  • Post-Fork Constraints: Following the definitive hard fork on the legacy chain, wallets will only support transactions to the bridge, barring any other addresses. The only exception to this rule is migration transactions associated with the previous hard fork in which we migrated to a totally publicised blockchain (in which users balances are swept back to the same wallet); this is necessary so that older wallets can cross the Smart Chain bridge.

Last updated