Recently, the Xuperide SIG team held its first regular meeting. Edrick, Product Leader of Obsidian Labs, gave a detailed introduction to the Xuperide operation method. The following manual is welcome for interested developers to review.

Xuperide uses documents

  1. The installation

Download 1.1.

Xuperide currently supports MacOS, Linux and Windows operating systems, and the corresponding installation package can be downloaded from the address below (MacOS, Linux, Windows).

Installed 1.2.

macOS

Double-click to open XuperIDE -x.x.x.x.x.x.xmg and drag XuperIDE into the application folder. (If you get a message that Apple has not authenticated at the first run, you can right-click on the application icon and open it to skip validation.)

Uperide – x.x.x.appImage: Properties => Permissions => Execute. Allow executing as progrom. Close the Property Settings window and double-click to open the application (different Linux distributions may install it differently).

Windows double click XuperIDE-x.x.x.exe to install and open the application.

  1. Preview function

2.1. Preparation

When Xuperide is installed correctly and started up for the first time, you will see a welcome page with all the dependencies needed for Xuperide to work properly, including Docker, XuperChain Node, and XDev



Xuperide uses Docker to start the Xuper node and compile the project. If you have not installed Docker before, you can click the Install Docker button to visit the official website of Docker and download and Install it.

For Windows users, we recommend using Docker Desktop. Docker Toolbox is also available, but can be problematic in some cases;

XuperChain node is the Docker image of the super chain node. XuperIDE uses this image to run the XuperChain node.

Xdev is the development and compilation tool for the hyperlink C++ contract.

When all dependencies are properly installed and running, the gray Skip button will change to the green Get Started button. Click this button to enter the main interface of Xuperide.

2.2. Create a key pair

After entering the home screen, we need to first create some key pairs. In any interface of Xuperide, click the key icon in the lower left corner of the application to open the key manager.



You can create, import, and manage key pairs in Key Manager. When you create and edit a key pair, you can alias the pair so that it can be identified in future use. In addition to storing the key pair, the key manager will also provide the creation address for the creation block. When you create a new instance of the Xuper node, Xuperide uses the address in the key manager as the creation address.

The new key pair created will use Chinese mnemonic words to generate the private key. However, you can also import an English mnemonic or a JSON super-linked private key when you import the private key.

Before proceeding, create a few key pairs in the key manager as the creation addresses for the next node instances to be created.

2.3. Start the node

Click the Network TAB at the top and the main page will be switched to Network Manager. In the network manager, we can manage the Xuper node versions and node instances, including downloading and deleting the Xuper node versions, and creating, deleting and running node instances according to different versions.

Click the New Instance button in the upper right corner of the home page to open the pop-up window of creating a New Instance, fill in the Instance name and select the appropriate version, and click the Create button to complete the creation of node Instance.



After the node instance is created, the instance list will display the newly created instance. Click the green Start button of the instance to Start the Xuper node. Once the boot is complete, you can examine the node run log in the Log Viewer below.



2.4. Connect to the open network of Baidu Super Chain

In addition to providing local node function, Xuperide also provides the function of connecting to Baidu Superchain open network and connecting to custom nodes. Click the drop-down menu next to the Network TAB and select Baidu Xuper to switch to Baidu Super Chain Open Network.



2.4. Blockchain Browser

After the node starts, click the Explorer TAB at the top, and the main page will switch to a block browser. In the block browser, we can query the corresponding address information.

Using the drop-down arrow next to the label, you can select and open the address in the key manager. You can also type or paste an address in the address bar. After opening a valid address, we can see the balance information of the corresponding address. The contract account address corresponding to this address is displayed on the right side of the balance information.



2.5. Create a smart contract account

A single account of Xuperchain can have multiple smart contract accounts, and users can deploy smart contracts under the contract account.

Click the “create contract account” button on the far right of the address bar, and enter the “create contract account” in the pop-up window. The address of the contract account should be a 16-digit pure number, and the first digit must not be 0.



Click “Create” and you can see the address of the newly created contract account in the browser in the format of XC2000000000000000@xuper. Click “Create” and you can jump to the contract interaction page of this address.

2.6. Create smart contract projects

Click the Project TAB at the top, and the main page will switch to Project Manager. Click the “New” button in the upper right corner of the page to open the pop-up window of creating a project, enter the project name and select the appropriate template. Xuperide currently provides two templates, respectively

C++ version of Counter

Solidity version of Counter



Fill in the project name and select the appropriate template and click Create Project. Xuperide will open the project in the project management page after the project is created.

The Counter contract implements a simple blockchain Counter that defines two methods, increase and get, to increment the Counter and get the value of the current Counter.

2.7. Compile the smart contract project

XuperChain supports the development of smart contracts using C++ and Solidity. C++ uses XDev for contract compilation and Solidity uses Solc for compilation. In the lower right corner you can see the compilers and compiler versions currently in use. You can click the button to select the version of the compiler you want to use, or open the manager to download more available versions of the compiler.

Xuperide will compile the project by clicking the Compile button in the toolbar (in the shape of a hammer). You can view the results by using the Log Viewer below. After compilation, a WASM or ABI file will be generated in the project directory.



2.8. Deploy smart contract projects

Click the Deployment button on the toolbar (ship shape), and the Deployment Parameters window will open where you can enter the name of the deployment contract, the constructor parameters, the transaction signer, and the contract account number.



2.9. Invoking contracts

After successfully deploying the smart contract, click the block browser and select the just deployed address from the contract address. The home page will switch to the contract browser and Xuperide will automatically open the just deployed smart contract.

The contract browser page is mainly divided into two parts: the left side is the calling method of the contract, you can fill in the calling method and parameters according to the contract code, and you can also choose different signature address. The right side is the data reading of the contract, which is similar to calling the contract. The methods and parameters of the query can be filled in according to the contract code, and different signing addresses can be selected.

Xuperide automatically reads the functions in the contract ABI and generates a parameter form for each Function. The user can simply select the function to call, enter parameters, and select the signer (the address that exists in the KeyPair Manager; Read without selecting) and click the Run button to make the contract call. The result of the call (success or failure) is shown in the Result column below.



Next we start invoking the deployed contract. In the Invoke side of the Method, add increase. Since the increase Method requires a key, it will leave a parameter in the input box under Args, and fill in a key on the left and a on the right. Select the address in Authorization’s Signer and click the Execute button at the top. After completing the transaction, we can see the results of a successful execution. The contract increases the value of the counter based on the key parameter passed in.

Enter “GET” in Query Method on the right, and a parameter will be left in the input box under Args. Enter “Key” on the left and “A” on the right. Click the “Executes” button, and the Result below, that is, the current value of the counter, can be seen.

Call increase multiple times and look up through GET to see the counter change according to the number of times the increase was called.