You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 26, 2022. It is now read-only.
Some files and parameters are missing from doxygen-generated
documentation. The version name in Dockerfile is bumped.
Some documents under tangle-accelerator didn't meet the standard of
Markdown. However, fenced code block for bash commands, we are always
starting with a `$` which doesn't meet the standard of Markdown.
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+19-5Lines changed: 19 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,22 +1,21 @@
1
1
# Contributing to Tangle-accelerator
2
2
3
3
When contributing to this repository, please first discuss the change you wish to make via issue,
4
-
email, or any other method with the owners of this repository before making a change.
4
+
email, or any other method with the owners of this repository before making a change.
5
5
6
6
Please note we have a code of conduct, please follow it in all your interactions with the project.
7
7
8
8
## Pull Request Process
9
9
10
-
1. Ensure any install or build dependencies are removed before the end of the layer when doing a
11
-
build.
10
+
1. Ensure any install or build dependencies are removed before the end of the layer when doing a build.
12
11
2. Create a new branch for fixing or developing the changes.
13
12
3. Run test with `bazel test //tests/...`, after finishing the changes.
14
-
4. Update the README.md with details of changes to the interface, which includes new environment
15
-
variables, exposed ports, useful file locations and container parameters.
13
+
4. Update the README.md with details of changes to the interface, which includes new environment variables, exposed ports, useful file locations and container parameters.
16
14
5. Run `hooks/formatter` before committing the changes.
17
15
6. Rebase to the latest `develop` branch.
18
16
19
17
## Git Commit Message Guidelines
18
+
20
19
Read this [blog article](https://chris.beams.io/posts/git-commit/) and [this article](https://www.conventionalcommits.org/en/v1.0.0-beta.2/) and follow the instructions in these articles.
21
20
The subject line of git commit message should follow this pattern
22
21
`<type>[optional scope]: <description>`
@@ -28,6 +27,21 @@ The `type` includes the following 5 words depending on the content of the commit
28
27
* test
29
28
* doc
30
29
30
+
## Doxygen-friendly Representation
31
+
32
+
Function parameters should be in the following style or [doxygen official example](https://www.doxygen.nl/manual/commands.html#cmdparam) which allows the generating doxygen documentation.
33
+
34
+
```c
35
+
/**
36
+
* Copies bytes from a source memory area to a destination memory area,
@@ -37,7 +37,7 @@ both footprint and startup time are behaved pretty well.
37
37
| | -Proxy | | | |
38
38
| +-----------------+ +-----------+ |
39
39
| ^ |
40
-
+---------|---------------------------------+
40
+
+---------|---------------------------------+
41
41
v
42
42
+-------------------------------------------+
43
43
| Full Node |
@@ -52,7 +52,7 @@ both footprint and startup time are behaved pretty well.
52
52
53
53
`Tangle-accelerator` helps to reattach pending transactions were attached from `Tangle-accelerator`.
54
54
Reattachment increases chances of confirmation and prevents messages being pruned when full nodes perform snapshot.
55
-
Clients should provide a unique ID as the identifier to each message and it's corresponding transaction hash since a new transaction hash will be generated after reattachment.
55
+
Clients should provide a unique ID as the identifier to each message and it's corresponding transaction hash since a new transaction hash will be generated after reattachment.
56
56
57
57
`Tangle-accelerator` uses ScyllaDB to store each transaction's ID, hash and status(Pending or confirmed). `Tangle-accelerator` will periodically check the status of pending transactions and reattach transactions which have been pended too long. Confirmed transactions will be stored into permanodes.
58
58
@@ -61,20 +61,23 @@ Clients can find the transaction alone with wanted message by using the ID to qu
61
61
## Connectivity
62
62
63
63
`Tangle-accelerator`, at this moment, supports the following TCP/IP derived protocols:
64
+
64
65
*`HTTP`
65
-
*`MQTT`
66
+
*`MQTT`
66
67
67
68
### HTTP
69
+
68
70
`HTTP` can be used in the normal internet service. User can use RESTful APIs to interact with `tangle-accelerator`.
69
71
70
72
### MQTT
73
+
71
74
`MQTT` is a lightweight communication protocol which can be used in the IoT scenarios. `Tangle-accelerator`'s support to `MQTT` allows embedded devices to write data on IOTA internet with relative low quality hardware devices. We hope this will speed up DLT into our daily life.
72
75
73
76
## Documentation
74
77
75
78
This page contains basic instructions for setting up tangle-accelerator, You can generate full documentation and API reference via Doxygen. The documentation is under `docs/` after generated:
76
79
77
-
```
80
+
```bash
78
81
$ doxygen Doxyfile
79
82
```
80
83
@@ -99,7 +102,7 @@ Before running tangle-accelerator, please edit binding address/port of accelerat
99
102
*`http_threads`: Determine thread pool size to process HTTP connections.
100
103
*`quiet`: Turn off logging message.
101
104
102
-
```
105
+
```bash
103
106
$ make && bazel run //accelerator
104
107
```
105
108
@@ -114,66 +117,79 @@ Tangle-accelerator supports several different build time options.
114
117
115
118
Debug mode enables tangle-accelerator to display extra `debug` logs.
116
119
120
+
```bash
121
+
$ bazel run --define build_type=debug //accelerator
117
122
```
118
-
bazel run --define build_type=debug //accelerator
119
-
```
123
+
120
124
* Profiling Mode
121
125
122
-
Profiling mode adds `-pg` flag when compiling tangle-accelerator. This allows tangle-accelerator to write profile information for the analysis program gprof.
123
-
```
124
-
bazel run --define build_type=profile //accelerator
126
+
Profiling mode adds `-pg` flag when compiling tangle-accelerator. This allows tangle-accelerator to write profile information for the analysis program gprof.
127
+
128
+
```bash
129
+
$ bazel run --define build_type=profile //accelerator
125
130
```
126
131
127
132
See [docs/build.md](docs/build.md) for more information.
128
133
129
134
## Developing
130
135
131
136
The codebase of this repository follows [Google's C++ guidelines](https://google.github.io/styleguide/cppguide.html):
132
-
- Please run `hooks/autohook.sh install` after initial checkout.
133
-
- Pass `-c dbg` for building with debug symbols.
137
+
138
+
* Please run `hooks/autohook.sh install` after initial checkout.
139
+
* Pass `-c dbg` for building with debug symbols.
134
140
135
141
### Tools required for running git commit hook
136
-
- buildifier
137
-
- clang-format
142
+
143
+
* buildifier
144
+
* clang-format
138
145
139
146
### Buildifier
147
+
140
148
Buildifier can be installed with `bazel` or `go`
141
149
142
150
#### Install with go
151
+
143
152
1. change directory to `$GOPATH`
144
153
2. run `$ go get github.com/bazelbuild/buildtools/buildifier`
145
154
The executable file will be located under `$GOPATH/bin`
3. build it with bazel command, `$ bazel build //buildifier`
154
164
The executable file will be located under `path/to/buildtools/bazel-bin`
155
-
4. make a soft link or move the executable file under `/usr/bin`
165
+
4. make a soft link or move the executable file under `/usr/bin`
156
166
157
167
### clang-format
168
+
158
169
clang-format can be installed by command:
159
-
- Debian/Ubuntu based systems: `$ sudo apt-get install clang-format`
160
-
- macOS: `$ brew install clang-format`
161
170
171
+
* Debian/Ubuntu based systems: `$ sudo apt-get install clang-format`
172
+
* macOS: `$ brew install clang-format`
162
173
163
174
## Usage
175
+
164
176
`Tangle-accelerator` currently supports two categories of APIs
177
+
165
178
* Direct API: check [wiki page](https://github.com/DLTcollab/tangle-accelerator/wiki) for details.
166
179
* Proxy API to IOTA core functionalities
167
180
168
181
### Full Node Proxy API
182
+
169
183
`tangle-accelerator` allows the use of IOTA core APIs. The calling process does not have to be aware of the destination machine running IOTA full node. With the exactly same format of IOTA core APIs, `tangle-accelerator` would help users forward the request to IOTA full node and forward the response back to users.
170
184
We support two way to forward Proxy APIs to IOTA full node:
185
+
171
186
1. Bypass Proxy APIs directly to IOTA full node.
172
187
2. Process the Proxy APIs, then transmit them to IOTA full node.
173
188
174
189
The user can choose which way they want with CLI argument `--proxy_passthrough`.
175
190
All the Proxy APIs are supported with the first way.
176
191
However, the second way currently only supports the followings Proxy APIs:
192
+
177
193
* checkConsistency
178
194
* findTransactions
179
195
* getBalances
@@ -182,5 +198,6 @@ However, the second way currently only supports the followings Proxy APIs:
182
198
* getTrytes
183
199
184
200
## Licensing
201
+
185
202
`Tangle-accelerator` is freely redistributable under the MIT License. Use of this source
186
203
code is governed by a MIT-style license that can be found in the `LICENSE` file.
0 commit comments