CKB developers share exclusive secrets with live coding for the first time

Time๏ผš2020-11-27

Yesterday, the elder sister carried out the first live coding for three hours in the nervos live studio. During the live broadcast, she realized the open transaction live, and responded to everyone’s request, and the women’s clothing appeared on the screen.

๐Ÿ‘‡๐Ÿ‘‡๐Ÿ‘‡
CKB developers share exclusive secrets with live coding for the first time

CKB developers share exclusive secrets with live coding for the first time

If the response is good, we will continue to make a series of live broadcast in the future. If the response is not good So this is the first and last live streaming for you. (Everyone and line and treasure, don’t forget to leave a message in the comments area to some feedback!๏ผ‰

This live streaming lasted three hours, which made us have toI’m sorry for my sister’s physical and mental strength. Believe me, it must be beyond the reach of ordinary people.As for whether there was a rollover? Let’s start with a video review

Tencent Video: https://v.qq.com/x/page/v0976…

In the daily work, students often need to implement Otx. In line with the principle of not making all the contracts on their own and leaving some opportunities for everyone, she waited for a while after the proposal came out. However, since the proposal came out in March, no one has made it.Now the student sister urgently needs the contract, so she has to start her own hand.

Although our contract development has a lot of processes and routines to go, there are a lot of debugging tools to use, but these tools are not used frequently. We often hear people say, “I’ve been transferred for another night, and I’m stuck there and I can’t get it out. “And so on. But in fact, some cases may not be so complicated, as long as another method can be used smoothly.

Therefore, during the live broadcast, Xuejie explained the following four contents for us in detail:

  • Open transaction concept
  • Transaction structure
  • Build & debug CKB scripts
  • Some useful suggestions

The whole live broadcast shows you how to write a contract better. She said that the most important point in writing a CKB contract is to first clarify the structure of the contract

  • What is your transaction like?
  • What kind of transaction do you accept in your contract?
  • What kind of transaction will be rejected by your contract?

If you have such a complete set of data sets, the actual process of writing contracts will become much easier. Because when you have enough tests, you can develop more easily.

You can write code to verify some transactions, use various tools to help you debug these contracts, and even write some log messages to display the data used in the contracts and debug the contracts. In this way, the development of contracts will be faster and faster.

Some practical tools

Xuejie shared many useful development tools and materials throughout the process

๐Ÿ‘‰standalone-debugger๏ผšDo you need to run a CKB chain every time you test a contract? You don’t have to! Let’s try the stand-alone debugger. Instead of running the CKB chain, you can directly test the contract and support debug and printf. You can view the number of contract cycles and the complete contract running path
https://github.com/xxuejie/ck…

๐Ÿ‘‰Perkins’ tent: create a CKB server directly through a docker image package, including not only CKB, but also graphql server, a more powerful CKB indexer, flow control function, etc
https://github.com/xxuejie/pe…

๐Ÿ‘‰Felix๏ผšThis is a DAPP based on Lumos, which sends red packets in the telegram. Lumos is a DAPP development framework based on JavaScript / typescript, so that developers can quickly develop DAPP based on CKB ecology through JS / ts. Felix will develop more new functions based on it later:
https://github.com/xxuejie/felix

We hope to use these tools as much as possible to help you simplify the debugging process. If you can master some debugging skills from this streaming and help you reduce some contract development time, then this live coding will achieve the purpose.

Trivia

An episode in a gas field

During the three-hour live streaming process, the elder sister played a burning song: memory killing every other hourNew century Gospel warrior theme song “cruel angel”, andMy three body chapter: Night StarOnce again, it brings us into the programmer’s secondary meta culture and the origin of nervos’s name (omit 1000 words here).

Young and ignorant choose Emacs

Some people say that they saw her using Emacs, but they didn’t know that it was the editor he chose when he was young and ignorant. Now it’s just muscle memory. She has been trying to eliminate it, but has not been successful. At present, my sister is writing her own editor and is expected to switch to her editor in the near future.

Postscript

For some well-known reasons, the bullet screen function of the live broadcast last night passed us by. This may be during the live broadcastThe biggest rolloverใ€‚ Anyway, if you have any problems in the process of writing the contract, or if you have any new ideas to exchange, all of themWelcome to leave a message or come to our forum to tell us that the elder sister and the CKB team will certainly know everything and say everythingใ€‚

๐Ÿ‘‰talk.nervos.org๐Ÿ‘ˆ

Finally, I sincerely hope that both the contract development process and the dappp development process can be achievedMore and more smooth, amazing on CKB!