All Products
Search
Document Center

Client Tool

Last Updated: Jun 14, 2019

We provide a client tool with interfaceIn to facilitate users to generate public private key pairs, certificates and deploy smart contract throught BaaS console. After downloaded, the tool needs to start by typing in the system console: (where the bizid should be replaced by the name of the corresponding chain, and expressed by the relative path, such as:. / icbu. The application will create the corresponding directory after starting. Catalog names are recommended in English or absolute paths. )

  1. java -Dfolder-path.mychain.env-config={bizid} -jar baas-crypto-tool-1.0-SNAPSHOT.jar

When the application is started in this way, the application will automatically listen on port 8080 and create a directory named bizid . This directory contains a subdirectory default , which represents the default environment for the current blockchain. The default directory contains files representing the private key (tls-client.key), the private key password (tls-client-key.pwd), the certificate (client.crt) and the certificate (ca.cert), as well as directories contracts and account , which store the created contract and account information respectively. For example, if we create an account named test then the test directory will be automatically generated under the account directory. Signed private key (sigPrivate. key), private key cryptographic file (sigPrivate key. pwd), recovery private key (recoverPrivate. key) and recovery private key cryptographic file (recoverPrivate. key) of ** test ** account are stored in the test directory. (Several of the above files were not created at startup. With the following steps, the corresponding files and directories will be created gradually.)

In the following document, we show two interfaces, one for client tools (the access address is localhost) and the other for BaaS, which need to be distinguished.

Enters the address in the browser:

  1. http://localhost:8080

You can see the main interface of our client tool:client_tool_main

On the homepage, we can see the configurable certificate information, CA certificate information, TLS connection private key, certificate request file and node address information. If the tool is opened for the first time, and no certificate-related content has been created before using the client tool, the content on the interface will be empty. Following four steps below to create certificates, create accounts, and create contracts:

  1. First, we need to confirm the basic configuration of the blockchain, including TLS encryption algorithm (RSA/EC) and signature suite (Classical/National Secret Suite) by clicking on the list of blockchains in the BaaS interface, and then clicking on the details of the blockchains:clienttool

  2. After confirming the basic information of the blockchain, we need to create the private key and certificate request file of the TLS connection by entering the address on the browser:

    1. http://localhost:8080/#/createTlsKey

    Open the interface for creating TLS private keys:client_tool2According to the TLS algorithm shown in Step 1, select the matching encryption algorithm and fill in the password. Note: all password should include number, upper and lower case letters and special characters as _^& and *, and the length of the password should at least be 8. Then click Confirm.client_tool5Click Download on the interface to download the certificate request file, then click the Apply on the BaaS interface. In the pop up windown, choose manually generated way. Click Upload on the pop-up interface and select the certificate request file just downloaded, click Apply, and complete the certificate signature:applymanualTill herre you have completed the process of certificate signature and will enter the third step of account creation.

  3. To create a blockchain Account, we first type in the browser:

    1. http://localhost:8080/#/createUserKey

    According to the signature encryption suite in step 1, select the corresponding cipher suit, and enter the appropriate account name (not the same as the existing account name on the block chain) and password. Note: all password should include number, upper and lower case letters and special characters as _^& and *, and the length of the password should at least be 8. Then click Apply:client_tool8After that, click the copy button above to copy the information of the public key file. Then, we click the create user button on the homepage. The operation process is as follows:accoutaccFill in the name of the account on the page above, paste the public key information just copied to the box of the account public key and the account recovery public key, and then click the confirmation button.After that, we created the initial account on the blockchain.

  4. Finally, we can download the signed certificate(cert.pem), root certificate(trustCA,to connect to the java client), root certificate(ca.cert, to connect to the js client) as follows:downloadIf it’s a Mac system or a Centos system, we can copy downloaded cert.pem and ca.cert to our client tools:client_tool13Address information of the node on above interface can be found on blockchain browser by clicking the View of the blockchain at blockchain list page:viewClick Details you will get the node information:detailAt last, copy node information to the address information textbox of the client tool, click Connect and you will step into the smart contract compile/depoly/call page, in which you can edit and compile your own Solidity smart contracts:client_tool16client_tool17To compile and depoly our smrat contract, we need first move the mouse to the Contracts button on the top left cornor, and create the contract, fill the black edit window with smart contract codes. After editing the contracts, click Compile to compile the smart contarct and click Deploy to deploy contracts on the blockchain. Contracts can be called after successfully deployed.