Skip to content
This repository was archived by the owner on Dec 26, 2022. It is now read-only.

Commit 8a727f5

Browse files
authored
Merge pull request #477 from DLTcollab/pre-release-v0.9.0
Pre-release v0.9.0
2 parents 9e8b43d + e41f362 commit 8a727f5

File tree

120 files changed

+2431
-2098
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+2431
-2098
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,7 @@ ciri/ciri.db*
8888
.vscode/
8989

9090
# Documentation
91-
docs/
91+
docs/html/
92+
93+
# Python
94+
__pycache__/

CONTRIBUTING.md

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# Contributing to Tangle-accelerator
2+
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.
5+
6+
Please note we have a code of conduct, please follow it in all your interactions with the project.
7+
8+
## Pull Request Process
9+
10+
1. Ensure any install or build dependencies are removed before the end of the layer when doing a
11+
build.
12+
2. Create a new branch for fixing or developing the changes.
13+
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.
16+
5. Run `hooks/formatter` before committing the changes.
17+
6. Rebase to the latest `develop` branch.
18+
19+
## Git Commit Message Guidelines
20+
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+
The subject line of git commit message should follow this pattern
22+
`<type>[optional scope]: <description>`
23+
The `type` includes the following 5 words depending on the content of the commit.
24+
25+
* feat
26+
* fix
27+
* refactor
28+
* test
29+
* doc
30+
31+
## Code of Conduct
32+
33+
### Our Pledge
34+
35+
In the interest of fostering an open and welcoming environment, we as
36+
contributors and maintainers pledge to make participation in our project and
37+
our community a harassment-free experience for everyone, regardless of age, body
38+
size, disability, ethnicity, gender identity and expression, level of experience,
39+
nationality, personal appearance, race, religion, or sexual identity and
40+
orientation.
41+
42+
### Our Standards
43+
44+
Examples of behavior that contributes to creating a positive environment
45+
include:
46+
47+
* Using welcoming and inclusive language
48+
* Being respectful of differing viewpoints and experiences
49+
* Gracefully accepting constructive criticism
50+
* Focusing on what is best for the community
51+
* Showing empathy towards other community members
52+
53+
Examples of unacceptable behavior by participants include:
54+
55+
* The use of sexualized language or imagery and unwelcome sexual attention or
56+
advances
57+
* Trolling, insulting/derogatory comments, and personal or political attacks
58+
* Public or private harassment
59+
* Publishing others' private information, such as a physical or electronic
60+
address, without explicit permission
61+
* Other conduct which could reasonably be considered inappropriate in a
62+
professional setting
63+
64+
### Our Responsibilities
65+
66+
Project maintainers are responsible for clarifying the standards of acceptable
67+
behavior and are expected to take appropriate and fair corrective action in
68+
response to any instances of unacceptable behavior.
69+
70+
Project maintainers have the right and responsibility to remove, edit, or
71+
reject comments, commits, code, wiki edits, issues, and other contributions
72+
that are not aligned to this Code of Conduct, or to ban temporarily or
73+
permanently any contributor for other behaviors that they deem inappropriate,
74+
threatening, offensive, or harmful.
75+
76+
### Scope
77+
78+
This Code of Conduct applies both within project spaces and in public spaces
79+
when an individual is representing the project or its community. Examples of
80+
representing a project or community include using an official project e-mail
81+
address, posting via an official social media account or acting as an appointed
82+
representative at an online or offline event. Representation of a project may be
83+
further defined and clarified by project maintainers.
84+
85+
### Enforcement
86+
87+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
88+
reported by contacting the project team at [INSERT EMAIL ADDRESS]. All
89+
complaints will be reviewed and investigated and will result in a response that
90+
is deemed necessary and appropriate to the circumstances. The project team is
91+
obligated to maintain confidentiality with regard to the reporter of an incident.
92+
Further details of specific enforcement policies may be posted separately.
93+
94+
Project maintainers who do not follow or enforce the Code of Conduct in good
95+
faith may face temporary or permanent repercussions as determined by other
96+
members of the project's leadership.

Doxyfile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@ OUTPUT_DIRECTORY = docs/
55
OPTIMIZE_OUTPUT_FOR_C = YES
66
INPUT = . \
77
accelerator \
8-
request \
9-
response \
10-
serializer \
8+
accelerator/core \
9+
accelerator/core/request \
10+
accelerator/core/response \
11+
accelerator/core/serializer \
1112
utils \
12-
connectivity/mqtt
13+
common \
14+
storage \
15+
connectivity/mqtt \
16+
connectivity/http
1317
FILE_PATTERNS = *.h \
1418
*.md
1519
EXAMPLE_PATH = tests

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ $(MOSQITTO_LIB): $(MOSQITTO_DIR)
2323

2424
clean:
2525
$(MAKE) -C $(DCURL_DIR) clean
26-
$(MAKE) -C $(MOSQITTO_LIB) clean
26+
$(MAKE) -C $(MOSQITTO_DIR) clean
2727

2828
distclean: clean
2929
$(RM) -r $(DCURL_DIR)

README.md

Lines changed: 10 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -84,99 +84,30 @@ Tangle-accelerator is built and launched through Bazel, it also requires Redis t
8484

8585
* [Bazel](https://docs.bazel.build/versions/master/install.html)
8686
* [Redis-server](https://redis.io/topics/quickstart)
87+
* cmake (required by dcurl)
88+
* openssl-dev (required by mosquitto)
8789

8890
## Build from Source
8991

90-
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 you might need to change:
92+
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:
9193

9294
* `TA_HOST`: binding address of accelerator instance
9395
* `TA_PORT`: port of accelerator instance
9496
* `IRI_HOST`: binding address of IRI
9597
* `IRI_PORT`: port of IRI
98+
* `quiet`: Turn off logging message
9699

97100
```
98101
$ make && bazel run //accelerator
99102
```
103+
### Building Options
104+
Tangle-accelerator supports several different build time options.
100105

101-
### Optional: Build Docker Images
106+
* Docker images
107+
* MQTT connectivity
108+
* External database
102109

103-
If you prefer building a docker image, tangle-accelerator also provides build rules for it. Note that you still have to edit configurations in `accelerator/config.h`.
104-
105-
```
106-
$ make && bazel run //accelerator:ta_image
107-
```
108-
109-
There's also an easier option to pull image from docker hub then simply run with default configs. Please do remember a redis-server is still required in this way.
110-
111-
```
112-
$ docker run -d --net=host --name tangle-accelerator dltcollab/tangle-accelerator
113-
```
114-
115-
### Optional: Build and Push Docker Image to Docker Hub
116-
117-
Before pushing the docker image to Docker Hub, you need to log in the docker registry:
118-
119-
```
120-
$ docker login
121-
```
122-
123-
Then you could push the docker image with the following command:
124-
125-
```
126-
$ make && bazel run //accelerator:push_docker
127-
```
128-
129-
If you get the following error message:
130-
131-
```
132-
SyntaxError: invalid syntax
133-
----------------
134-
Note: The failure of target @containerregistry//:digester (with exit code 1) may have been caused by the fact that it is running under Python 3 instead of Python 2. Examine the error to determine if that appears to be the problem. Since this target is built in the host configuration, the only way to change its version is to set --host_force_python=PY2, which affects the entire build.
135-
136-
If this error started occurring in Bazel 0.27 and later, it may be because the Python toolchain now enforces that targets analyzed as PY2 and PY3 run under a Python 2 and Python 3 interpreter, respectively. See https://github.com/bazelbuild/bazel/issues/7899 for more information.
137-
------------
138-
```
139-
140-
Use the `--host_force_python=PY2` parameter to force the Bazel to use the Python2 in entire build.
141-
142-
```
143-
$ make && bazel run //accelerator:push_docker --host_force_python=PY2
144-
```
145-
146-
### Optional: Enable MQTT connectivity
147-
MQTT connectivity is an optional feature allowing IoT endpoint devices to collaborate with `Tangle-Accelerator`.
148-
149-
```
150-
make MQTT && bazel run //accelerator:accelerator_mqtt
151-
```
152-
153-
Note you may need to set up the `MQTT_HOST` and `TOPIC_ROOT` in `config.h` to connect to a MQTT broker.
154-
For more information for MQTT connectivity of `tangle-accelerator`, you could read `connectivity/mqtt/usage.md`.
155-
156-
### Optional: Enable external database for transaction reattachment
157-
Transaction reattachment is an optional feature.
158-
159-
You can enable it in the build time by adding option : `--define db=enable`
160-
161-
Transaction reattachment relies on ScyllDB, you need to install the dependency by following commands.
162-
163-
For Ubuntu Linux 16.04/x86_64:
164-
165-
```
166-
wget https://downloads.datastax.com/cpp-driver/ubuntu/16.04/cassandra/v2.14.1/cassandra-cpp-driver_2.14.1-1_amd64.deb
167-
wget https://downloads.datastax.com/cpp-driver/ubuntu/16.04/cassandra/v2.14.1/cassandra-cpp-driver-dev_2.14.1-1_amd64.deb
168-
sudo dpkg -i cassandra-cpp-driver_2.14.1-1_amd64.deb
169-
sudo dpkg -i cassandra-cpp-driver-dev_2.14.1-1_amd64.deb
170-
```
171-
172-
For Ubuntu Linux 18.04/x86_64:
173-
174-
```
175-
wget https://downloads.datastax.com/cpp-driver/ubuntu/18.04/cassandra/v2.14.1/cassandra-cpp-driver_2.14.1-1_amd64.deb
176-
wget https://downloads.datastax.com/cpp-driver/ubuntu/18.04/cassandra/v2.14.1/cassandra-cpp-driver-dev_2.14.1-1_amd64.deb
177-
sudo dpkg -i cassandra-cpp-driver_2.14.1-1_amd64.deb
178-
sudo dpkg -i cassandra-cpp-driver-dev_2.14.1-1_amd64.deb
179-
```
110+
See [docs/build.md](https://github.com/DLTcollab/tangle-accelerator/docs/build.md) for more information.
180111

181112
## Developing
182113

WORKSPACE

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,20 @@ load("//third_party:third_party.bzl", "third_party_deps")
33

44
git_repository(
55
name = "rules_iota",
6-
commit = "73f598ad1ce3ba79ff22d747f723d6d5cbf351e1",
6+
commit = "e08b0038f376d6c82b80f5283bb0a86648bb58dc",
77
remote = "https://github.com/iotaledger/rules_iota.git",
88
)
99

1010
git_repository(
1111
name = "iota_toolchains",
12-
commit = "0f93f76fdff9f091dd3a99aa3f19b5d3f4f7f7fc",
12+
commit = "700904f445d15ef948d112bf0bccf7dd3814ae5c",
1313
remote = "https://github.com/iotaledger/toolchains.git",
1414
)
1515

1616
git_repository(
1717
name = "entangled",
18-
remote = "https://github.com/iotaledger/entangled.git",
19-
tag = "cclient-v1.0.0-beta",
20-
)
21-
22-
git_repository(
23-
name = "served",
24-
commit = "757172e1d8aa7e273e800ce8ec91974c90a2a8b1",
25-
remote = "https://github.com/meltwater/served.git",
18+
commit = "fe3929b8ac6e7377eed82b83aad96369b42d0641",
19+
remote = "https://github.com/DLTcollab/entangled",
2620
)
2721

2822
git_repository(

0 commit comments

Comments
 (0)