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.
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
@@ -90,74 +93,112 @@ Tangle-accelerator is built and launched through Bazel, it also requires Redis t
90
93
91
94
## Build from Source
92
95
93
-
Before running tangle-accelerator, please edit binding address/port of accelerator instance, IRI, and redis server in `accelerator/config.h` unless they are all localhost and/or you don't want to provide external connection. With dependency of [entangled](https://github.com/iotaledger/entangled), IRI address doesn't support https at the moment. Here are some configurations and command you might need to change and use:
96
+
Before running tangle-accelerator, please edit binding address/port of accelerator instance, IOTA full node, and redis server in `accelerator/config.h` unless they are all localhost and/or you don't want to provide external connection. With dependency of [iota.c](https://github.com/iotaledger/iota.c), IOTA full node address doesn't support https at the moment. Here are some configurations and command you might need to change and use:
94
97
95
-
*`TA_HOST`: binding address of accelerator instance
96
-
*`TA_PORT`: port of accelerator instance
97
-
*`IRI_HOST`: binding address of IRI
98
-
*`IRI_PORT`: port of IRI
99
-
*`quiet`: Turn off logging message
98
+
*`ta_host`: Binding address of accelerator instance.
99
+
*`ta_port`: Port of accelerator instance.
100
+
*`node_host`: Binding address of IOTA full node which includes IRI and Hornet or other community implementation.
101
+
*`node_port`: Port of IOTA full node.
102
+
*`http_threads`: Determine thread pool size to process HTTP connections.
103
+
*`quiet`: Turn off logging message.
100
104
101
-
```
105
+
```bash
102
106
$ make && bazel run //accelerator
103
107
```
108
+
104
109
### Building Options
110
+
105
111
Tangle-accelerator supports several different build time options.
106
112
107
113
* Docker images
108
114
* MQTT connectivity
109
115
* External database
116
+
* Debug Mode
117
+
118
+
Debug mode enables tangle-accelerator to display extra `debug` logs.
119
+
120
+
```bash
121
+
$ bazel run --define build_type=debug //accelerator
122
+
```
123
+
124
+
* Profiling Mode
125
+
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
130
+
```
110
131
111
132
See [docs/build.md](docs/build.md) for more information.
112
133
113
134
## Developing
114
135
115
136
The codebase of this repository follows [Google's C++ guidelines](https://google.github.io/styleguide/cppguide.html):
116
-
- Please run `hooks/autohook.sh install` after initial checkout.
117
-
- Pass `-c dbg` for building with debug symbols.
137
+
138
+
* Please run `hooks/autohook.sh install` after initial checkout.
3. build it with bazel command, `$ bazel build //buildifier`
138
165
The executable file will be located under `path/to/buildtools/bazel-bin`
139
-
4. make a soft link or move the executable file under `/usr/bin`
166
+
4. make a soft link or move the executable file under `/usr/bin`
140
167
141
168
### clang-format
169
+
142
170
clang-format can be installed by command:
143
-
- Debian/Ubuntu based systems: `$ sudo apt-get install clang-format`
144
-
- macOS: `$ brew install clang-format`
145
171
172
+
* Debian/Ubuntu based systems: `$ sudo apt-get install clang-format`
173
+
* macOS: `$ brew install clang-format`
174
+
175
+
### shfmt
176
+
177
+
It requires Go 1.13 or above, and install it with following command.
178
+
179
+
```shell
180
+
GO111MODULE=on go get mvdan.cc/sh/v3/cmd/shfmt
181
+
```
146
182
147
183
## Usage
184
+
148
185
`Tangle-accelerator` currently supports two categories of APIs
186
+
149
187
* Direct API: check [wiki page](https://github.com/DLTcollab/tangle-accelerator/wiki) for details.
150
-
* Proxy API to IRI core functionalities
188
+
* Proxy API to IOTA core functionalities
189
+
190
+
### Full Node Proxy API
151
191
152
-
### IRI Proxy API
153
-
`tangle-accelerator` allows the use of IRI core APIs. The calling process does not have to be aware of the destination machine running IRI. With the exactly same format of IRI API, `tangle-accelerator` would help users forward the request to IRI and forward the response back to users.
154
-
We support two way to forward Proxy APIs to IRI:
155
-
1. Bypass Proxy APIs directly to IRI.
156
-
2. Process the Proxy APIs, then transmit them to IRI.
192
+
`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.
193
+
We support two way to forward Proxy APIs to IOTA full node:
194
+
195
+
1. Bypass Proxy APIs directly to IOTA full node.
196
+
2. Process the Proxy APIs, then transmit them to IOTA full node.
157
197
158
198
The user can choose which way they want with CLI argument `--proxy_passthrough`.
159
199
All the Proxy APIs are supported with the first way.
160
200
However, the second way currently only supports the followings Proxy APIs:
201
+
161
202
* checkConsistency
162
203
* findTransactions
163
204
* getBalances
@@ -166,5 +207,6 @@ However, the second way currently only supports the followings Proxy APIs:
166
207
* getTrytes
167
208
168
209
## Licensing
210
+
169
211
`Tangle-accelerator` is freely redistributable under the MIT License. Use of this source
170
212
code is governed by a MIT-style license that can be found in the `LICENSE` file.
0 commit comments