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

Commit

Permalink
Merge pull request #477 from DLTcollab/pre-release-v0.9.0
Browse files Browse the repository at this point in the history
Pre-release v0.9.0
  • Loading branch information
howjmay committed Feb 8, 2020
2 parents 9e8b43d + e41f362 commit 8a727f5
Show file tree
Hide file tree
Showing 120 changed files with 2,431 additions and 2,098 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,7 @@ ciri/ciri.db*
.vscode/

# Documentation
docs/
docs/html/

# Python
__pycache__/
96 changes: 96 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# Contributing to Tangle-accelerator

When contributing to this repository, please first discuss the change you wish to make via issue,
email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

## Pull Request Process

1. Ensure any install or build dependencies are removed before the end of the layer when doing a
build.
2. Create a new branch for fixing or developing the changes.
3. Run test with `bazel test //tests/...`, after finishing the changes.
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.
5. Run `hooks/formatter` before committing the changes.
6. Rebase to the latest `develop` branch.

## Git Commit Message Guidelines
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.
The subject line of git commit message should follow this pattern
`<type>[optional scope]: <description>`
The `type` includes the following 5 words depending on the content of the commit.

* feat
* fix
* refactor
* test
* doc

## Code of Conduct

### Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to make participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.

### Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

### Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

### Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

### Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [INSERT EMAIL ADDRESS]. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
12 changes: 8 additions & 4 deletions Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ OUTPUT_DIRECTORY = docs/
OPTIMIZE_OUTPUT_FOR_C = YES
INPUT = . \
accelerator \
request \
response \
serializer \
accelerator/core \
accelerator/core/request \
accelerator/core/response \
accelerator/core/serializer \
utils \
connectivity/mqtt
common \
storage \
connectivity/mqtt \
connectivity/http
FILE_PATTERNS = *.h \
*.md
EXAMPLE_PATH = tests
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ $(MOSQITTO_LIB): $(MOSQITTO_DIR)

clean:
$(MAKE) -C $(DCURL_DIR) clean
$(MAKE) -C $(MOSQITTO_LIB) clean
$(MAKE) -C $(MOSQITTO_DIR) clean

distclean: clean
$(RM) -r $(DCURL_DIR)
Expand Down
89 changes: 10 additions & 79 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,99 +84,30 @@ Tangle-accelerator is built and launched through Bazel, it also requires Redis t

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

## Build from Source

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:
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:

* `TA_HOST`: binding address of accelerator instance
* `TA_PORT`: port of accelerator instance
* `IRI_HOST`: binding address of IRI
* `IRI_PORT`: port of IRI
* `quiet`: Turn off logging message

```
$ make && bazel run //accelerator
```
### Building Options
Tangle-accelerator supports several different build time options.

### Optional: Build Docker Images
* Docker images
* MQTT connectivity
* External database

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`.

```
$ make && bazel run //accelerator:ta_image
```

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.

```
$ docker run -d --net=host --name tangle-accelerator dltcollab/tangle-accelerator
```

### Optional: Build and Push Docker Image to Docker Hub

Before pushing the docker image to Docker Hub, you need to log in the docker registry:

```
$ docker login
```

Then you could push the docker image with the following command:

```
$ make && bazel run //accelerator:push_docker
```

If you get the following error message:

```
SyntaxError: invalid syntax
----------------
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.
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.
------------
```

Use the `--host_force_python=PY2` parameter to force the Bazel to use the Python2 in entire build.

```
$ make && bazel run //accelerator:push_docker --host_force_python=PY2
```

### Optional: Enable MQTT connectivity
MQTT connectivity is an optional feature allowing IoT endpoint devices to collaborate with `Tangle-Accelerator`.

```
make MQTT && bazel run //accelerator:accelerator_mqtt
```

Note you may need to set up the `MQTT_HOST` and `TOPIC_ROOT` in `config.h` to connect to a MQTT broker.
For more information for MQTT connectivity of `tangle-accelerator`, you could read `connectivity/mqtt/usage.md`.

### Optional: Enable external database for transaction reattachment
Transaction reattachment is an optional feature.

You can enable it in the build time by adding option : `--define db=enable`

Transaction reattachment relies on ScyllDB, you need to install the dependency by following commands.

For Ubuntu Linux 16.04/x86_64:

```
wget https://downloads.datastax.com/cpp-driver/ubuntu/16.04/cassandra/v2.14.1/cassandra-cpp-driver_2.14.1-1_amd64.deb
wget https://downloads.datastax.com/cpp-driver/ubuntu/16.04/cassandra/v2.14.1/cassandra-cpp-driver-dev_2.14.1-1_amd64.deb
sudo dpkg -i cassandra-cpp-driver_2.14.1-1_amd64.deb
sudo dpkg -i cassandra-cpp-driver-dev_2.14.1-1_amd64.deb
```

For Ubuntu Linux 18.04/x86_64:

```
wget https://downloads.datastax.com/cpp-driver/ubuntu/18.04/cassandra/v2.14.1/cassandra-cpp-driver_2.14.1-1_amd64.deb
wget https://downloads.datastax.com/cpp-driver/ubuntu/18.04/cassandra/v2.14.1/cassandra-cpp-driver-dev_2.14.1-1_amd64.deb
sudo dpkg -i cassandra-cpp-driver_2.14.1-1_amd64.deb
sudo dpkg -i cassandra-cpp-driver-dev_2.14.1-1_amd64.deb
```
See [docs/build.md](https://github.com/DLTcollab/tangle-accelerator/docs/build.md) for more information.

## Developing

Expand Down
14 changes: 4 additions & 10 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,20 @@ load("//third_party:third_party.bzl", "third_party_deps")

git_repository(
name = "rules_iota",
commit = "73f598ad1ce3ba79ff22d747f723d6d5cbf351e1",
commit = "e08b0038f376d6c82b80f5283bb0a86648bb58dc",
remote = "https://github.com/iotaledger/rules_iota.git",
)

git_repository(
name = "iota_toolchains",
commit = "0f93f76fdff9f091dd3a99aa3f19b5d3f4f7f7fc",
commit = "700904f445d15ef948d112bf0bccf7dd3814ae5c",
remote = "https://github.com/iotaledger/toolchains.git",
)

git_repository(
name = "entangled",
remote = "https://github.com/iotaledger/entangled.git",
tag = "cclient-v1.0.0-beta",
)

git_repository(
name = "served",
commit = "757172e1d8aa7e273e800ce8ec91974c90a2a8b1",
remote = "https://github.com/meltwater/served.git",
commit = "fe3929b8ac6e7377eed82b83aad96369b42d0641",
remote = "https://github.com/DLTcollab/entangled",
)

git_repository(
Expand Down
Loading

0 comments on commit 8a727f5

Please sign in to comment.