Before doing a dapp development through train, talked about the development of a dapp process.
?
But involves many types of jobs, multi-step. It's still very difficult to start with.
?
After unremitting efforts to do a lot of bedding work, I can finally tell you:
?
Development of Dapp for NEO, never so simple
Green Valley Town Building.
?
?
First of all, please remember Nel's GitHub homepage, where there are a lot of neo related development results, I will not blow, you look at these projects, you can at least feel that we are really non-stop.
The only problem is that the level of documentation is very low, and we welcome interested comrades to work together to upgrade the building of Nel, the Chinese developer community around Neo.
?
So where's the light purse?
Find this project and he has a brother project
?
They use the light purse SDK developed by C # and Typescript, respectively, to provide the tools you need to develop your lightweight wallet.
After careful observation of Lan Tao code, NEONJS and other code, they are unable to complete our goal.
Developing a light purse for a developer, so we decided to make a big detour and re-establish the code.
The current C # SDK completion degree is 100%, currently in the construction example phase.
TS SDK completed 50%, but porting C # code only, the risk is zero, everyone just need to wait.
This is the SDK right, so light purse?
?
The light purse is an example of the SDK, which is included in the SDK code
While this is an example, we've been able to make most of our Neo wallets blush with functionality, and our nonstop development enthusiasm will continue to increase the average level of the development of Neo's lightweight wallets.
I think it won't be long before the development of Neo Light purse will become a very difficult thing, because you develop a half-day, but also bear great pressure. People will say, "You look at that purse as an example."
?
Example of C # wallet long like this
Example of TS wallet long like this
?
What's the relationship between purse and Dapp?
Our wallet positioning is an example, but also a developer tool, he has only one function, the trade, but do what the transaction can be sent.
NEP5 transaction, no problem, ICO fundraising, no problem.
Would you say that Neogui can be anything but a hair? What do users use?
This is true, the function is strong, does not mean to be useful.
Dapp is to solve the problem of the poor use of the production.
That dapp the smallest unit is just a deal?
So, our wallet has a dapp module, you do not need to write code, only need to configure, this dapp is composed of a few transactions, to help users fill in parameters, press a button.
The transaction is sent out, do not complete the user simple to use the function.
?
See the Dapp feature here
Use of wallets
Previously said the use of wallets, no longer repeat.
Http://www.cnblogs.com/crazylights/p/8338117.html
?
Load a key to come in before doing the experiment. This wallet protection is not very thorough, I know that the problem is unable to prevent you from sending out the WTF curse, the curse, to GitHub to mention a issue, very good. Or just send a PR help us fix the bug, better.
This is an experimental wallet, so it only supports importing a key. If you're happy, look at the code for this purse and make some modifications.
?
Attention to this Dapp area, I have divided the red, yellow, blue and green four regions
Yellow Zone
Yellow Zone is to choose a dapp, for our system, a DAPP is a JSON, which is cross-platform.
Then our web version uses the same JSON, nothing changes, cross-platform.
Automatically load all JSON under the Dapp path
Green Zone
The Green Zone is the choice of a dapp after the emergence of the dapp, we break down into a single operation
For example, who am I this dapp three operations, one is to check a person's name, enter the address.
One is to set the name, enter the address and name, set the name of my area divided into test trade, and send the transaction
The Green Zone is the operation and the input.
Blue Zone
The Blue zone shows you the value you entered.
Red zone
The red zone is used to perform operations and display results
Check this dapp function is to query from the store, the result is to display a string, the address to get the name of what.
?
Do not write code to implement a Dapp
Because we are using JSON to configure DAPP, it is not necessary to write code.
Of course, if the functionality we configure doesn't meet your needs, you'll need to write the code.
Let's start to look
This is the full picture of who am I Dapp
He had three features in the red area, and I folded two, one by one to see
Title Section
The title in JSON specifies the name of the Dapp.
Consts part
Consts is used to configure some constants, which can be referenced later, to reduce the number of direct fill errors
Here consts.base is actually WhoAmI Dapp's contract Scripthash
Mainly Scriptcall and Scriptparam need to be referenced
Funcs Part One
Funcs part, it looks very complicated, but he has five parts altogether.
Name desc Inputs Call Results
The Name and DESC correspond to the red on the graph, without explanation.
Inputs yellow on the corresponding chart
Here we specify the need to enter an address, which automatically generates this UI
Funcs Part Two
What looks more complicated here is the call section,
Type indicates that this Dapp operation only needs to check the storage area.
Do not need to call the contract to check the storage area
Need two parameters, script hash go to const inside take, address from input take. With this, we're going to treat this string as an address Scripthash.
There are other call type, mainly Invokescript, test execution contract, and sendrawtransaction, post transaction. You can see the code in detail.
Funcs Part Three
Results configuration output, there can be only one output for getstorage. Have done the intelligent contract development you know, GetStorage take the ByteArray, we can specify the type here, will help you translate well.
?
A Dapp function was completed
The result is that through this configuration, there is a handy tool for querying each person's name, which is the meaning of Dapp.
?
?
Other parts
Understand how we are simply developing Dapp, other features, I'll simply say
?
SetName (test) CallType is Invokescript, at this time or free operation, suitable for some query NEP5 balance, query Nns address and so on do not need to affect the blockchain function
?
Setname (Sendraw) CallType is sendrawtransaction, which is to spend gas (NEO10 a gas inside the trade free, basic or free)
The button here becomes two, and the first one will send out the deal.
The second one will let you look at the trading panel to see what you have just generated.
?
We have only one function for this client: to send a transaction.
We define DAPP as a convenient tool to help users launch a variety of transactions.
According to the features we offer, do you think that developing dapp is not so complicated?
?
One more thing
There is also good news that the NNS (NEO Domain Services) test version will be released soon. The NNS Domain Name service will also issue tokens.
In fact, we have already written a smart contract, is not a suitable place to put dapp, can not let everyone take Neogui to fight the contract it. Everything is ready, I dare to tell you.
Now this unfinished nns.test Dapp can actually register the domain name.
If you're happy, the NNS white paper on our Nel GitHub docs project is ready to do it yourself.
Dapp development through train-how to develop dapp based on Nel light purse