Skip to content

Commit 353bbfa

Browse files
Fix markdown lint issues
1 parent 3266a91 commit 353bbfa

27 files changed

+1633
-1362
lines changed

.markdown-lint.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
# Copyright 2022 Samsung Corporation
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
default: true
17+
18+
# MD013/line-length - Line length
19+
MD013: false

README-DEV.md

+54-28
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,42 @@ Please note, that the only officially supported platform now is Linux.
44
It's recommended to develop and deploy the App on Ubuntu 18.04 or Ubuntu 20.04.
55

66
## Pre-requisites
7-
1. Install Go as described at https://golang.org/doc/install
7+
8+
1. Install Go as described at <https://golang.org/doc/install>
89
- Ensure that the following line has been appended to `/etc/profile`:
9-
```
10+
11+
```bash
1012
export PATH=$PATH:/usr/local/go/bin
1113
```
14+
1215
- Ensure that the following line has been appended to `~/.profile`:
13-
```
16+
17+
```bash
1418
export PATH=$PATH:~/go/bin
1519
```
16-
2. Install Docker as described at https://docs.docker.com/engine/install/ubuntu/
20+
21+
2. Install Docker as described at <https://docs.docker.com/engine/install/ubuntu/>
1722
- In `Installation methods` section follow `Install using the repository` method
1823
- Check whether your user of Ubuntu has been added to `docker` group using the following command:
19-
```
24+
25+
```bash
2026
getent group docker | awk -F: '{print $4}'
2127
```
22-
- If it has not been added, add it using `Manage Docker as a non-root user` section from https://docs.docker.com/engine/install/linux-postinstall/
23-
3. Install Docker Compose as described at https://docs.docker.com/compose/install/
28+
29+
- If it has not been added, add it using `Manage Docker as a non-root user` section from <https://docs.docker.com/engine/install/linux-postinstall/>
30+
3. Install Docker Compose as described at <https://docs.docker.com/compose/install/>
2431

2532
## Build and test
2633

2734
1. Building
28-
```
35+
36+
```bash
2937
make build
3038
make install
3139
```
3240

33-
3441
2. Run unit tests
42+
3543
```bash
3644
make test
3745
```
@@ -42,10 +50,13 @@ It's recommended to develop and deploy the App on Ubuntu 18.04 or Ubuntu 20.04.
4250
REST integration tests need to have a backend running (CLI in REST mode).
4351

4452
The following script will start all necessary things and run all the tests:
53+
4554
```bash
4655
./integration_tests/run-all.sh
4756
```
57+
4858
If you want to run a particular group of tests (cli, light, rest), you can
59+
4960
```bash
5061
./integration_tests/run-all.sh cli
5162
./integration_tests/run-all.sh light
@@ -62,38 +73,42 @@ It's recommended to develop and deploy the App on Ubuntu 18.04 or Ubuntu 20.04.
6273
# OR
6374
go test <path-to-go-test-file> # to run REST or gRPC go test
6475
```
65-
76+
6677
4. Run deployment test
67-
78+
6879
The deployment test verifies deployment steps described in [docs/running-node.md](./docs/running-node.md).
6980

7081
```bash
7182
./integration_tests/deploy/test_deploy.sh
7283
```
7384

74-
7585
## Run local pool
86+
7687
The easiest way to run a local pool is to start it in Docker.
7788

7889
Validator nodes only (no Observers):
90+
7991
```bash
8092
make install
8193
make localnet_init
8294
make localnet_start
8395
```
8496

8597
Validator and Observer nodes:
98+
8699
```bash
87100
make install
88101
DCL_OBSERVERS=1 make localnet_init
89102
make localnet_start
90-
```
103+
```
91104

92105
This will start a local pool of 4 validator nodes in Docker. The nodes will expose their RPC endpoints on ports `26657`, `26659`, `26661`, `26663` correspondingly.
93106

94-
Stopping the network:
107+
Stopping the network:
95108

96-
make localnet_stop
109+
```bash
110+
make localnet_stop
111+
```
97112

98113
Then you can start the network again with the existing data using `make localnet_start`
99114

@@ -102,20 +117,25 @@ It will remove `.dcl` directories from your user home directory (`~`), remove `.
102117
and initialize a new network data using `make localnet_init`.
103118

104119
## CLI
120+
105121
Start a local pool as described above, and then just execute
106-
```
122+
123+
```bash
107124
dcld
108125
```
126+
109127
Have a look at [How To](docs/how-to.md) and [transactions](docs/transactions.md) for instructions how to configure and use the CLI.
110128

111129
## REST
130+
112131
Start a local pool as described above.
113132

114-
Every node exposes a REST API at `http://<node-host>:1317` (see https://docs.cosmos.network/master/core/grpc_rest.html).
133+
Every node exposes a REST API at `http://<node-host>:1317` (see <https://docs.cosmos.network/master/core/grpc_rest.html>).
115134

116135
Have a look at [transactions](docs/transactions.md) for a full list of REST endpoints.
117136

118137
## Contributing
138+
119139
Please take into account the following when sending a PR:
120140

121141
1) Make sure the new functionality has unit tests added
@@ -131,6 +151,7 @@ Please take into account the following when sending a PR:
131151
- run integration tests
132152

133153
## How To Add a new Module
154+
134155
- Use [starport](https://github.com/tendermint/starport) command to scaffold the module.
135156
Consider using a docker container built from the provided [Dockerfile](scripts/Dockerfile) to have a predictable version of starport. See [README.md](scripts/README.md).
136157
- Have a look at the scripts and commands used for generation of existing modules and do it in a similar way
@@ -141,55 +162,60 @@ Please take into account the following when sending a PR:
141162
- add message validation as annotations (`validate` tags) in `proto/<module>/tx.proto`
142163
- add `(cosmos_proto.scalar) = "cosmos.AddressString"` annotation for all fields with address/account type (such as `signer` or `owner`).
143164
- fix types if needed in `proto/<module>/<entity>.proto` files
144-
- Note1: `unit64` will be returned as string if the output is a JSON format. So, it's better to use `uint64` only when it's really `uint64`.
165+
- Note1: `unit64` will be returned as string if the output is a JSON format. So, it's better to use `uint64` only when it's really `uint64`.
145166
- Note2: for `uint16` type: use `int32` during starport scaffolding, and add custom validation (annotations above) to check the lower and upper bounds.
146167
- Note3: for `uint32` type: use `int32` during starport scaffolding, then replace it by `uint32` in .proto files, re-generate the code and fix compilation errors.
147168
- build proto (for example `starport chain build`). Fix compilation errors if any.
148169
- generate openapi docs from proto using (`scripts/dcl-swagger-gen.sh`). recommended to run from container built from [Dockerfile](scripts/Dockerfile)
149170

150171
- **Note1**: colons (`:`) are part of subject-id in PKI module, but colons are not allowed in gRPC REST URLs by default.
151172
`allow_colon_final_segments=true` should be used as a workaround.
152-
So, make sure that `runtime.AssumeColonVerbOpt(false)` in `/x/pki/types/query.pb.gw.go`.
173+
So, make sure that `runtime.AssumeColonVerbOpt(false)` in `/x/pki/types/query.pb.gw.go`.
153174
It's usually sufficient to revert the generated changes in `/x/pki/types/query.pb.gw.go`.
154175
- Call `validator.Validate(msg)` in `ValidateBasic` methods for all generated messages
155176
- Implement business logic in `msg_server_xxx.go`
156177
- Improve `NotFound` error processing:
157-
- replace `status.Error(codes.InvalidArgument, "not found")` to `status.Error(codes.NotFound, "not found")` in every generated `grpc_query_xxx.go` to return 404 error in REST.
178+
- replace `status.Error(codes.InvalidArgument, "not found")` to `status.Error(codes.NotFound, "not found")` in every generated `grpc_query_xxx.go` to return 404 error in REST.
158179
- Support state proof for single value queries in CLI:
159-
- use `cli.QueryWithProof` instead of cosmos queries that doesn't support state proofs
160-
- add proper handling for list queries and write requests when used with a light client proxy
180+
- use `cli.QueryWithProof` instead of cosmos queries that doesn't support state proofs
181+
- add proper handling for list queries and write requests when used with a light client proxy
161182
(see `IsWriteInsteadReadRpcError` and `IsKeyNotFoundRpcError`)
162183
- Add unit tests (see other modules for reference)
163184
- Add CLI-based integration tests to `integration_tests/cli/<module>` (see other modules for reference)
164185
- Add gRPC/REST-based integration tests to `integration_tests/grpc_rest/<module>` (see other modules for reference)
165186

166187
## How To Make Changes in Data Model for Existing Modules
188+
167189
- Use [starport](https://github.com/tendermint/starport) command to scaffold the module.
168190
Consider using the provided [Dockerfile](scripts/Dockerfile) to have a predictable version of starport. See [README.md](scripts/README.md).
169191
- **Never change `.pb` files manually**. Do the changes in `.proto` files.
170192
- Every time `.proto` files change, re-generate the code (for example `starport chain build`) and fix compilation errors if any.
171193
- Update openapi docs from proto using (`scripts/dcl-swagger-gen.sh`). recommended to run from container built from [Dockerfile](scripts/Dockerfile)
172194
- **Note1**: colons (`:`) are part of subject-id in PKI module, but colons are not allowed in gRPC REST URLs by default.
173195
`allow_colon_final_segments=true` should be used as a workaround.
174-
So, make sure that `runtime.AssumeColonVerbOpt(false)` in `/x/pki/types/query.pb.gw.go`.
175-
It's usually sufficient to revert the generated changes in `/x/pki/types/query.pb.gw.go`.
196+
So, make sure that `runtime.AssumeColonVerbOpt(false)` in `/x/pki/types/query.pb.gw.go`.
197+
It's usually sufficient to revert the generated changes in `/x/pki/types/query.pb.gw.go`.
176198
177199
## Update Cosmos-sdk Version
200+
178201
Re-generate cosmos base openapi (service API from cosmos exposed in DCL) using [cosmos-swagger-gen.sh](scripts/cosmos-swagger-gen.sh) from the project root:
202+
179203
- Consider using a docker container built from the provided [Dockerfile](scripts/Dockerfile) to have a predictable version of swagger
180-
```
204+
205+
```bash
181206
./scripts/cosmos-swagger-gen.sh base
182207
./scripts/cosmos-swagger-gen.sh tx
183208
```
184209
185210
## Update Tendermint Version
186-
Please note, that we depend on the Tendermint fork https://github.com/zigbee-alliance/tendermint/releases/tag/v0.34.140
187-
due to hotfixes for https://github.com/tendermint/tendermint/issues/7640 and https://github.com/tendermint/tendermint/issues/7641
211+
212+
Please note, that we depend on the Tendermint fork <https://github.com/zigbee-alliance/tendermint/releases/tag/v0.34.140>
213+
due to hotfixes for <https://github.com/tendermint/tendermint/issues/7640> and <https://github.com/tendermint/tendermint/issues/7641>
188214
required for Light Client Proxy.
189215
Now that fixes are merged to Tendermint master, so check if we still need to depend on the fork.
190216
191217
Also don't forget to update the link to the Tendermint RPC in [Swagger UI](docs/index.html).
192218

193219
## Other
194-
For more details, please have a look at [Cosmos SDK tutorial](https://tutorials.cosmos.network/).
195220

221+
For more details, please have a look at [Cosmos SDK tutorial](https://tutorials.cosmos.network/).

0 commit comments

Comments
 (0)