5、 Application of plug-in wallet based on conflux

Time:2020-10-14

Installation and use of the conflux portal

The application forms of blockchain are mainly web page side, DAPP side and a few server-side scenarios. This course will teach you how to create a wallet on the public link of the confix on Google Chrome browser. You need to download plug-ins, install plug-ins, create wallets through mnemonics, and then get your personal wallet.

1、 Download plug-ins

1. Download address: https://github.com/Conflux-Ch…

2. After you open the address, you can enter the download address page as shown in the figure below

5、 Application of plug-in wallet based on conflux

It’s not hard to find that the highest available version in this tutorial is 0.2.2. Then I’ll show you how to install and use the plug-in wallet version of confix-portal-chrome-0.2.2.zip.

3. Click confix-portal-chrome-0.2.2.zip to download the plug-in version of Google Chrome.

4. After downloading, you can put it anywhere on the computer. It is not recommended to put it on the system disk. This tutorial is placed in the directory of disk D.

2、 Installing plug-ins

1. We will decompress the compressed package (friendly note: you should not directly unzip this directory, you need to specify a directory to decompress, because there is no package layer in the compressed package, I hope it will not be trapped. I unzip it to the directory of conflux-portal-chrome-0.2.2), and open your Google Chrome Open the extender panel according to the following three parts, as shown in the figure below:

5、 Application of plug-in wallet based on conflux

2. Your extension panel may not be in developer mode, so you need to open developer mode and click the button next to the development mode.

5、 Application of plug-in wallet based on conflux

3. After opening the panel, there will be “load decompressed extension program” and other columns. We will continue to click this column

5、 Application of plug-in wallet based on conflux

4. Find the directory we extracted and click OK. Installation steps are complete.

5. After the above steps are completed, it will automatically jump to the page shown in the figure, indicating that we have successfully installed the plug-in and can use it, as shown in the figure:

5、 Application of plug-in wallet based on conflux

3、 Create Wallet

1. Next, at the beginning of the above steps, we click “start using” to enter into the confix portal usage page, as shown in the following figure:

5、 Application of plug-in wallet based on conflux

2. There are two choices in the figure above. We can import a previously created wallet or create a new one. I believe that most of the partners who read this tutorial don’t have their own wallets. I will first create wallets, import wallets, and explain how to import wallets. If you have wallets, you can jump to the introduction of wallets tutorial directly. If you create a wallet, you will jump to the following page. If you don’t have any hesitation, just “I agree”. As shown in the figure:

5、 Application of plug-in wallet based on conflux

4. Click agree to enter the following page, here we need to enter the password twice, and check the agree agreement button, be sure to remember your password, or lost, but can’t find it. As shown in the figure:

5、 Application of plug-in wallet based on conflux

5. Click “create” and jump to the mnemonic page. You must remember this mnemonic word. You can’t remember which small notebook to remember. As shown in the figure:

5、 Application of plug-in wallet based on conflux

6. Click to display the secret language and write it down. This tutorial uses a randomly created wallet, so it doesn’t matter if the mnemonics are published. Please don’t leak the mnemonics, or you should be careful with your wallet.

able peanut rate myself menu funny logic focus hedgehog arrest real box

7. The next step is to complete the mnemonics in the confirmation page. This step is really redundant. I don’t like it, but I can’t help it. Who calls us users? Fill it in. As shown in the figure:

5、 Application of plug-in wallet based on conflux

8. After the correct sequence is entered, it is created successfully, as shown in the following figure:

5、 Application of plug-in wallet based on conflux

9. Click “all done” to enter the wallet page. As shown in the figure:

5、 Application of plug-in wallet based on conflux

10. It’s not easy to have a wallet of your own. You can start to make your own wallet. This is the public key address of this tutorial “0x12ea0fa7d2acaa4ef52ee7650bd16f56d60b51dc”. The public key address can be shown to anyone. The key address must be kept in person.

4、 Import Wallet

After we have created the wallet, we must remember the mnemonics and passwords so that we can log in to any application that can use mnemonics to log in. Next, we will use the wallet created in this tutorial to demonstrate how to import a wallet.

1. There are two import portals for plug-in wallets. One is the one that appears after the installation, and the other is the one that can be accessed through the program corner of the plug-in. We will import the plug-in in in the way of corner markers first. The following page is the one that appears after I close the plug-in and opens it. There is a “import using account mnemonics”, as shown in the figure:

5、 Application of plug-in wallet based on conflux

2. Click “import using account mnemonics” to enter the following page, as shown in the figure below:

5、 Application of plug-in wallet based on conflux

3. We use the mnemonic words above, fill in, re-enter the password, or use our previous password, all OK. After filling in, we click to restore, and we will find that we have entered the page after the above creation is successful.

5、 Application of plug-in wallet based on conflux

4. It is not very magical that the public key address obtained by “0x12ea0fa7d2aa4ef52e765bd16f56d60b51dc” is the same.

5、 Password unlock

I believe many friends have a question about what the password we set is for, right! In fact, this password is used on the browser you are using this time. For example, if you close the browser and open it, you will be asked to enter the password to unlock it, as shown in the following figure:

5、 Application of plug-in wallet based on conflux

We can enter the above password and unlock it. If the password is forgotten, the mnemonic will be used to retrieve your wallet and reset the password. That is, repeat the fourth step above.

Lesson 2: JS conflux SDK call

1. Checking the conflux portal plug-in

async function checkConflux() {
            if (window.conflux === 'undefined') {
                If (confirm ('It is detected that the confix wallet plug-in is not installed in your browser, click OK to download it. \Note: if there is no jump, see if it is blocked by the browser.){
                    window.open("https://github.com/Conflux-Chain/conflux-portal/releases")
                }


                var body = document.getElementById("body");
                body.innerHTML  ="This website needs to install the plug-in of the confix wallet, please < a http:// https://github.com/Conflux-Chain/conflux-portal/releases '> go to download < / a > conflux wallet plug-in ";
                return false;
            }


            accounts = await conflux.enable();
            return true;
        }

2. Get contract contract

        var contract;
        function buildContract() {
            contract = confluxJS.Contract({
                abi: abiJson,
                address: "0x8067244e0b629610eb24cc9da4fe8b023fc02fd9",
            });
        }

3. Call call

            let result = await contract.likeSupply();
            console.log(result.toString());

4. Send call

            await contract.startUp()
                .sendTransaction({ from: accounts[0] })
                .confirmed();

Project download address

Project address link