- These are govm's dApp samples
- Introduce how to write and debug dApp
- (Optional)start database serverhttps://github.com/lengzhao/database
- download project
- download the data of databasehttp://govm.net/dl/database_*.zip
- build and start
- start local server
- go build server/server.go
- ./server.exe
- run app
- cd 1.hello
- go test
- Deploy the dApp
- win_wallet or html_wallet
- app->New app->input the path of code->submit
- package、import: All imported modules can only be modules on the chain, and reference to external modules is not supported.
go/select: Since this operation will be concurrent and cause data inconsistency, it is temporarily not supported.range: Since the rang of map is random, it will cause uncertainty in the execution order, so it is temporarily not supported.cap/recover: This function is not necessary, it may cause discrepancies.- var & const: Declaration of variables and constants.
- func: Used to define functions and methods.
- return: Used to return from a function.
- panic: Used to exit the app abnormally.All operations will be rolled back.
- interface: Used to define the interface.
- struct: Used to define abstract data types.
- type: Used to declare custom types.
- map: Built-in associated data types.
- case、continue、for、fallthrough、else、if、switch、goto、default: Process control.