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

Commit 00f173d

Browse files
committed
Merge branch 'pre-releasev0.9.1'
2 parents 8a727f5 + 85928aa commit 00f173d

Some content is hidden

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

72 files changed

+2715
-1008
lines changed

.travis.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
env:
2+
global:
3+
# The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
4+
# via the "travis encrypt" command using the project repo's public key
5+
- secure: "UzFj98mHlWrUob3k8s+T3AyPY3V/M5PIMyTzdNpLokby6YOl7BAb0ubeHkz3JxfYiEvGt1TB5zD/8LA8hBH0pn/EccrgNX/BYLW+ZUBA3rbBahJvpcTlGqKifKbWYEcPXSrW+naAEU5HFIfYayhyGLg1weucY2lsoM7yo8NlE2kYPu9+XXbltHpRYa2Nfw0bTHRs0RRVSs5kvtLIVyq/f2Mv/CdBbJJRaiTlzVUilQvejM9bdu/sLOvDdxucv6wMvPdzJL2LtXW6BSjjkE9lgQg58OT2AxErBENMElZMMG3lO2KgHozTJ+IOjJ+/CzkyUHfLjAD7aKxRN4cygV/DXcoZ/+ppw5MqDLA7eIVzX0xAjy6S93QPrfpiB4rkohls8NCAd4No6o0vFgCvFfPxcbYpa7eLEyrMpbHnUwBkGXcHUHyGg/v5WQUCthHGUTJ0A0SIPn7z5WEaNTv15IusSVSxYZhLu0PqWosABslDnaMVrOZkgkaNMty3ZFBpNBWHtlH9XjybBe4V28/E4g5xOrwkDm9KLiFQi+vjdPx2i0vOCgRHseG5DCRUBjyfgktOOP3DhOvbe48CxAyRm2qT1T/xeT9qK420k9fryjzdMV/4L86Fid4oBqAGd+ScjODhgIS3tAQRpdpOzFZWitwWxZUEGC4AjqrwTwIsyiBopuI="
6+
7+
language: c
8+
9+
before_install:
10+
- echo -n | openssl s_client -connect https://scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-
11+
# Add Bazel distribution URI as a package source
12+
- sudo apt install curl
13+
- curl https://bazel.build/bazel-release.pub.gpg | sudo apt-key add -
14+
- echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list
15+
# Install and update Bazel
16+
- sudo apt update && sudo apt install bazel
17+
18+
addons:
19+
coverity_scan:
20+
project:
21+
name: "DLTcollab/tangle-accelerator"
22+
description: "Accelerate IOTA transactions by caching API requests and redirecting to faster alternatives"
23+
notification_email: [email protected]
24+
build_command_prepend: ""
25+
build_command: "bash tests/coverity_analysis.sh"
26+
branch_pattern: develop
27+
28+
script: if [ "${COVERITY_SCAN_BRANCH}" != 1 ]; then make ; fi

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Being at the edge as a key-value store, an edge-caching node powered by `Tangle-
1212
does not have to communicate to typical [IOTA](https://www.iota.org/) full nodes for every API
1313
calls. Instead, the cached transaction data being sought is available as needed.
1414

15-
As an intermediate server accelerateing interactions with the Tangle, it faciliates
15+
As an intermediate server accelerating interactions with the Tangle, it facilitates
1616
[dcurl](https://github.com/DLTcollab/dcurl) to perform hardware-accelerated PoW operations
1717
on edge devices. In the meanwhile, `Tangle-accelerator` provides shortcuts for certain
1818
use scenarios such as MAM and [TangleID](https://tangleid.github.io/).
@@ -52,7 +52,7 @@ both footprint and startup time are behaved pretty well.
5252

5353
`Tangle-accelerator` helps to reattach pending transactions were attached from `Tangle-accelerator`.
5454
Reattachment increases chances of confirmation and prevents messages being pruned when full nodes perform snapshot.
55-
Clients should provide a uniqle ID as the identifier to each message and it's corresponding transaction hash since a new transaction hash will be generated after reattachement.
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.
5656

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

@@ -86,6 +86,7 @@ Tangle-accelerator is built and launched through Bazel, it also requires Redis t
8686
* [Redis-server](https://redis.io/topics/quickstart)
8787
* cmake (required by dcurl)
8888
* openssl-dev (required by mosquitto)
89+
* uuid-dev
8990

9091
## Build from Source
9192

@@ -107,7 +108,7 @@ Tangle-accelerator supports several different build time options.
107108
* MQTT connectivity
108109
* External database
109110

110-
See [docs/build.md](https://github.com/DLTcollab/tangle-accelerator/docs/build.md) for more information.
111+
See [docs/build.md](docs/build.md) for more information.
111112

112113
## Developing
113114

@@ -145,10 +146,10 @@ clang-format can be installed by command:
145146

146147
## Usage
147148
`Tangle-accelerator` currently supports two categories of APIs
148-
* direct API: check [wiki page](https://github.com/DLTcollab/tangle-accelerator/wiki) for details.
149+
* Direct API: check [wiki page](https://github.com/DLTcollab/tangle-accelerator/wiki) for details.
149150
* Proxy API to IRI core functionalities
150151

151-
### IRI Porxy API
152+
### IRI Proxy API
152153
`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.
153154
We support two way to forward Proxy APIs to IRI:
154155
1. Bypass Proxy APIs directly to IRI.

WORKSPACE

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ git_repository(
2222
git_repository(
2323
name = "io_bazel_rules_docker",
2424
remote = "https://github.com/bazelbuild/rules_docker.git",
25-
tag = "v0.7.0",
25+
tag = "v0.9.0",
2626
)
2727

2828
load("@rules_iota//:defs.bzl", "iota_deps")
@@ -32,6 +32,15 @@ container_repositories()
3232

3333
load("@io_bazel_rules_docker//cc:image.bzl", _cc_image_repos = "repositories")
3434

35+
load("@io_bazel_rules_docker//container:pull.bzl", "container_pull")
36+
37+
container_pull(
38+
name = "ubuntu1804",
39+
registry = "l.gcr.io",
40+
repository = "google/ubuntu1804",
41+
tag = "latest",
42+
)
43+
3544
iota_deps()
3645

3746
third_party_deps()

accelerator/BUILD

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
load("@io_bazel_rules_docker//cc:image.bzl", "cc_image")
2-
load("@io_bazel_rules_docker//container:container.bzl", "container_push")
2+
load("@io_bazel_rules_docker//container:container.bzl", "container_image")
3+
load("@io_bazel_rules_docker//docker/package_managers:download_pkgs.bzl", "download_pkgs")
4+
load("@io_bazel_rules_docker//docker/package_managers:install_pkgs.bzl", "install_pkgs")
35

46
cc_binary(
57
name = "accelerator",
@@ -52,18 +54,33 @@ cc_library(
5254
srcs = ["cli_info.h"],
5355
)
5456

57+
download_pkgs(
58+
name = "docker_runtime_pkgs",
59+
image_tar = "@ubuntu1804//image",
60+
packages = [
61+
"uuid-runtime",
62+
],
63+
)
64+
65+
install_pkgs(
66+
name = "docker_runtime_image",
67+
image_tar = "@ubuntu1804//image",
68+
installables_tar = ":docker_runtime_pkgs.tar",
69+
installation_cleanup_commands = "rm -rf /var/lib/apt/lists/*",
70+
output_image_name = "docker_runtime_image",
71+
)
72+
5573
cc_image(
56-
name = "docker",
74+
name = "docker_base_image",
75+
base = ":docker_runtime_image",
5776
binary = ":accelerator",
5877
)
5978

60-
container_push(
61-
name = "push_docker",
62-
format = "Docker",
63-
image = ":docker",
64-
registry = "index.docker.io",
65-
repository = "dltcollab/tangle-accelerator",
66-
tag = "latest",
79+
container_image(
80+
name = "docker_image",
81+
base = ":docker_base_image",
82+
repository = "dltcollab",
83+
stamp = True,
6784
)
6885

6986
cc_library(

accelerator/cli_info.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ typedef enum ta_cli_arg_value_e {
2929
/** IRI */
3030
IRI_HOST_CLI,
3131
IRI_PORT_CLI,
32+
IRI_ADDRESS_CLI,
3233

3334
/** MQTT */
3435
MQTT_HOST_CLI,
@@ -48,6 +49,7 @@ typedef enum ta_cli_arg_value_e {
4849
CACHE,
4950
CONF_CLI,
5051
PROXY_API,
52+
HEALTH_TRACK_PERIOD,
5153

5254
/** LOGGER */
5355
QUIET,
@@ -69,15 +71,18 @@ static struct ta_cli_argument_s {
6971
{"iri_port", required_argument, NULL, IRI_PORT_CLI, "IRI listening port"},
7072
{"mqtt_host", required_argument, NULL, MQTT_HOST_CLI, "MQTT listening host"},
7173
{"mqtt_root", required_argument, NULL, MQTT_ROOT_CLI, "MQTT listening topic root"},
74+
{"iri_address", required_argument, NULL, IRI_ADDRESS_CLI, " List of IRI listening URL"},
7275
{"redis_host", required_argument, NULL, REDIS_HOST_CLI, "Redis server listening host"},
7376
{"redis_port", required_argument, NULL, REDIS_PORT_CLI, "Redis server listening port"},
7477
{"db_host", required_argument, NULL, DB_HOST_CLI, "DB server listening host"},
7578
{"milestone_depth", optional_argument, NULL, MILESTONE_DEPTH_CLI, "IRI milestone depth"},
7679
{"mwm", optional_argument, NULL, MWM_CLI, "minimum weight magnitude"},
7780
{"seed", optional_argument, NULL, SEED_CLI, "IOTA seed"},
78-
{"cache", required_argument, NULL, CACHE, "Enable cache server with Y"},
81+
{"cache", no_argument, NULL, CACHE, "Enable cache server"},
7982
{"config", required_argument, NULL, CONF_CLI, "Read configuration file"},
8083
{"proxy_passthrough", no_argument, NULL, PROXY_API, "Pass proxy API directly to IRI without processing"},
84+
{"health_track_period", no_argument, NULL, HEALTH_TRACK_PERIOD,
85+
"The period for checking IRI host connection status"},
8186
{"quiet", no_argument, NULL, QUIET, "Disable logger"},
8287
{NULL, 0, NULL, 0, NULL}};
8388

0 commit comments

Comments
 (0)