Note: The best development experience is under the MacOS system

1. Download and install robin integrated development framework

sudo npm install -g robin-framework

Type robin or robin -h or robin --help,and there help information outing,it means robin framework has been installed successfully;

If you are prompted that the version of robin is too old,please install robin again:

2. Initialize a contract project and install dependencies using the robin command line

2.1. First create an empty directory and cd to the new directory to execute:

robin init


robin init --name MyContract

2.2. Then install dependencies via npm:

npm install

2.3. Finally, open the contract project the IDE WebStorm or VsCode

3. Download and install the longclaw local desktop chain environment

3.1. Longclaw depends on the docker environment, please install docker first, if it is installed, please skip this step;

Download and install from docker center:

3.2. If you already have a docker environment, please add docker's China warehouse image address.

For users using macOS, click the Docker for mac app icon -> Perferences... -> Daemon -> Registry mirrors in the taskbar. Fill in the accelerator address in the list. After the modification is complete, click the Apply & Restart button and Docker will restart and apply the configured mirror address.


3.3. Download the longclaw installation file from the developer portal


3.4. Install and start longclaw, this process takes about two minutes to build a local consensus network environment and initialize data


4. Develop a contract with reference to developer documentation and contract templates

4.1. Development documentation reference developer portal

4.2. Development Support Forum


5. Use robin for syntax and security checks and bug fixes

> robin lint

robin lint The command will automatically check for syntax errors and try to fix it.。


6. Compile contract for webassembly target format file

If the test cases are passed, the next step is to compile and run the command:

> robin build

robin build will generate *.abi, *.wast, *wasm three target files。

7. Deploy contract target files to longclaw(local ultrain environment)

> robin deploy

Before executing robin deploy, you need to modify or confirm the configuration information related to chain interaction, such as configuration items: httpEndpoint, logger, broadcast, sign, chainId, keyProvider etc.

Note: httpEndpoint and httpEndpoint_history are the ultrain realtime api service node and history api service node, If you have a longclaw running, you need not to change them. The chainId you can get using u3, like

    const u3 = createU3();
    await u3.getChainInfo((err, info) => {

If the deployment is successful, the corresponding transaction information will be displayed in longclaw, and after 10 seconds, the block confirmation message will be generated.

8. Write test cases with tools such as u3.js and u3-utils

Test cases can be written with reference to token.spec.js or index.test.js in u3.js. At the same time, it relies on tools such as u3-utils. Run test cases to use commands:

> robin test 

9. Deploy the contract to the test network and the main network separately for contract accuracy verification