Skip to content

Commit

Permalink
merge with master (remove ct)
Browse files Browse the repository at this point in the history
  • Loading branch information
QYuQianchen committed Jan 19, 2023
2 parents d10ab27 + 48d3bc7 commit 5a1df60
Show file tree
Hide file tree
Showing 18 changed files with 16 additions and 249 deletions.
1 change: 0 additions & 1 deletion .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ jobs:
./scripts/wait-for-npm-package.sh core-ethereum
./scripts/wait-for-npm-package.sh utils
./scripts/wait-for-npm-package.sh ethereum
./scripts/wait-for-npm-package.sh cover-traffic-daemon
./scripts/wait-for-npm-package.sh connect
- name: "[FINISH] Send notification if anything failed on master or release/staging branches"
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ members = [
"packages/hoprd/crates/hoprd-misc",
"packages/utils/crates/utils-misc",
"packages/utils/crates/utils-proc-macros",
"packages/utils/crates/utils-metrics"
"packages/utils/crates/utils-metrics",
"packages/ethereum/crates/bindings",
"packages/ethereum/foundry-tool"
]
Expand Down
2 changes: 0 additions & 2 deletions METRICS.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ The following sections document the metrics per package:
| `core_ethereum_counter_indexer_tickets_redeemed` | counter | Number of redeemed tickets | |
| `core_ethereum_counter_num_send_transactions` | counter | The number of sendTransaction calls | |

### cover-traffic-daemon

### ethereum

### hoprd
Expand Down
16 changes: 2 additions & 14 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,6 @@ steps:
timeout: 1200s
waitFor:
- buildHoprd
- name: 'gcr.io/kaniko-project/executor:v1.9.1'
id: buildCoverTrafficDaemon
args:
- --build-arg=HOPR_TOOLCHAIN_IMAGE=gcr.io/${PROJECT_ID}/hopr-toolchain:${_IMAGE_VERSION}
- --dockerfile=packages/cover-traffic-daemon/Dockerfile
- --destination=gcr.io/${PROJECT_ID}/hopr-cover-traffic-daemon:${_IMAGE_VERSION}
- --cache=true
- --cache-ttl=96h
timeout: 1200s
waitFor:
- 'buildHoprToolchain'
- name: 'gcr.io/kaniko-project/executor:v1.9.1'
id: buildHardhat
args:
Expand All @@ -58,7 +47,7 @@ steps:
script: |
#!/usr/bin/env bash
set -Eeuo pipefail
for image in hoprd hoprd-nat hopr-cover-traffic-daemon; do
for image in hoprd hoprd-nat ; do
./scripts/verify-docker-image.sh "${image}" "${IMAGE_VERSION}" "${PACKAGE_VERSION}"
done
env:
Expand All @@ -68,7 +57,6 @@ steps:
waitFor:
- buildHoprd
- buildHoprdNat
- buildCoverTrafficDaemon
- buildHardhat
- name: 'gcr.io/kaniko-project/executor:v1.9.1'
id: buildPluto
Expand All @@ -89,7 +77,7 @@ steps:
#!/usr/bin/env bash
set -Eeuo pipefail
[ "${NO_TAGS}" = "true" ] && { exit 0; }
for image in hoprd hoprd-nat hopr-cover-traffic-daemon hopr-anvil hopr-pluto; do
for image in hoprd hoprd-nat hopr-anvil hopr-hardhat hopr-pluto; do
full_image="gcr.io/${PROJECT_ID}/${image}"
gcloud container images add-tag ${full_image}:${IMAGE_VERSION} ${full_image}:${PACKAGE_VERSION}
for release in ${RELEASES}; do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ Otherwise, the installation process is complete! You can proceed to our [hopr-ad

## Updating to a new release

When migrating between releases, Docker users need to either move their identity file to the newly specified location or edit the command to point to their old location. Otherwise, you will be running a new node instead of accessing your old node's information.
When migrating between releases, Docker users need to either move their identity file to the newly specified location or edit the command to point to their old location. Otherwise, you will be running a new node instead of accessing your old node's information.

For example, when we update from version `1.90.68`, which is internally known as `Valencia` to `1.91.24`, which is internally known as `Bogota`, the location the command points to will change as such:

Expand Down
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"packages/connect",
"packages/core",
"packages/core-ethereum",
"packages/cover-traffic-daemon",
"packages/utils",
"packages/hoprd",
"packages/real",
Expand All @@ -17,7 +16,6 @@
"build:hoprd": "yarn workspace @hoprnet/hoprd run build",
"build:utils": "yarn workspace @hoprnet/hopr-utils run build",
"build:chain": "yarn workspace @hoprnet/hopr-core-ethereum run build",
"run:ctd": "yarn workspace @hoprnet/hopr-cover-traffic-daemon run start",
"run:hoprd": "yarn workspace @hoprnet/hoprd run start --password='d3f4uL+!' --identity=/tmp/default-identity --disableApiAuthentication",
"run:hoprd:xdai": "yarn workspace @hoprnet/hoprd run start --host=0.0.0.0:9080 --apiPort=2991 --password='xDai' --announce --data=/tmp/xdai --identity=/tmp/xdai-identity --disableApiAuthentication",
"run:hoprd:xdai:protected": "yarn workspace @hoprnet/hoprd run start --host=0.0.0.0:9080 --apiPort=2991 --password='xDai' --announce --data=/tmp/xdai --identity=/tmp/xdai-identity --apiToken=xD4!-N3+w0rK",
Expand Down
2 changes: 1 addition & 1 deletion packages/connect/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hoprnet/hopr-connect",
"version": "1.92.0-next.38",
"version": "1.92.0-next.39",
"description": "A libp2p-complaint transport module that handles NAT traversal by using WebRTC",
"repository": "https://github.com/hoprnet/hopr-connect.git",
"homepage": "https://github.com/hoprnet/hopr-connect",
Expand Down
2 changes: 1 addition & 1 deletion packages/core-ethereum/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hoprnet/hopr-core-ethereum",
"version": "1.92.0-next.38",
"version": "1.92.0-next.39",
"description": "",
"repository": "https://github.com/hoprnet/hoprnet.git",
"homepage": "https://hoprnet.org",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hoprnet/hopr-core",
"version": "1.92.0-next.38",
"version": "1.92.0-next.39",
"description": "Privacy-preserving messaging protocol with incentivations for relay operators",
"repository": "https://github.com/hoprnet/hoprnet.git",
"homepage": "https://hoprnet.org",
Expand Down
30 changes: 0 additions & 30 deletions packages/cover-traffic-daemon/crates/Makefile

This file was deleted.

2 changes: 1 addition & 1 deletion packages/hoprd/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hoprnet/hoprd",
"version": "1.92.0-next.38",
"version": "1.92.0-next.39",
"description": "",
"repository": "https://github.com/hoprnet/hoprnet.git",
"homepage": "https://hoprnet.org",
Expand Down
2 changes: 1 addition & 1 deletion packages/real/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hoprnet/hopr-real",
"version": "1.92.0-next.38",
"version": "1.92.0-next.39",
"repository": "https://github.com/hoprnet/hoprnet.git",
"homepage": "https://hoprnet.org",
"license": "GPL-3.0-only",
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@hoprnet/hopr-utils",
"description": "HOPR-based utilities to process multiple data structures",
"version": "1.92.0-next.38",
"version": "1.92.0-next.39",
"repository": "https://github.com/hoprnet/hoprnet.git",
"homepage": "https://hoprnet.org",
"license": "GPL-3.0",
Expand Down
9 changes: 1 addition & 8 deletions scripts/build-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ usage() {
msg
msg "Use -l to build the images locally instead and not publish them to a
remote Docker repository. In addition -i can be used to build a single image locally instead of all images."
msg "Supported values for -p are 'hoprd', 'hoprd-nat', 'cover-traffic-daemon',
'anvil', 'pluto', 'pluto-complete'"
msg "Supported values for -p are 'hoprd', 'hoprd-nat', 'anvil', 'pluto', 'pluto-complete'"
msg
msg "Use -f to force a Docker builds even though no environment can be found. This is useful for local testing. No additional docker tags will be applied though if no environment has been found which is in contrast to the normal execution of the script."
msg
Expand Down Expand Up @@ -88,12 +87,6 @@ build_and_tag_images() {
-f packages/hoprd/Dockerfile . &
fi

if [ -z "${image_name}" ] || [ "${image_name}" = "cover-traffic-daemon" ]; then
log "Building Docker image hopr-cover-traffic-daemon-local"
docker build -q -t hopr-cover-traffic-daemon-local \
-f packages/cover-traffic-daemon/Dockerfile . &
fi

if [ -z "${image_name}" ] || [ "${image_name}" = "hoprd-nat" ]; then
log "Building Docker image hoprd-nat-local"
docker build -q -t hoprd-nat-local \
Expand Down
12 changes: 3 additions & 9 deletions scripts/publish-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,15 @@ usage() {
cleanup() {
# Remove lock files due to conflicts with workspaces
rm -f \
"${mydir}/../packages/cover-traffic-daemon/npm-shrinkwrap.json" \
"${mydir}/../packages/hoprd/npm-shrinkwrap.json"

# Don't commit changed package.json files as package resolutions are
# supposed to interfer with workspaces according to https://yarnpkg.com/configuration/manifest#resolutions
git restore packages/hoprd/package.json
git restore packages/cover-traffic-daemon/package.json

# delete default environments
rm -f \
"${mydir}/../packages/hoprd/default-environment.json" \
"${mydir}/../packages/cover-traffic-daemon/default-environment.json"
"${mydir}/../packages/hoprd/default-environment.json"
}

# return early with help info when requested
Expand All @@ -57,7 +54,7 @@ if [ ! "${version_type}" = "patch" ] &&
fi

# define packages
declare -a versioned_packages=( utils connect ethereum core-ethereum core real hoprd cover-traffic-daemon )
declare -a versioned_packages=( utils connect ethereum core-ethereum core real hoprd )

# ensure local copy is up-to-date with origin
branch=$(git rev-parse --abbrev-ref HEAD)
Expand Down Expand Up @@ -123,7 +120,7 @@ if [ "${CI:-}" = "true" ] && [ -z "${ACT:-}" ]; then
# pack and publish packages
yarn workspaces foreach -piv --topological-dev \
--exclude hoprnet --exclude hopr-docs \
--exclude @hoprnet/hoprd --exclude @hoprnet/hopr-cover-traffic-daemon \
--exclude @hoprnet/hoprd \
npm publish --access public

"${mydir}/wait-for-npm-package.sh" utils
Expand All @@ -138,15 +135,12 @@ if [ "${CI:-}" = "true" ] && [ -z "${ACT:-}" ]; then
# set default environments
log "adding default environments to packages"
echo "{\"id\": \"${environment_id}\"}" > "${mydir}/../packages/hoprd/default-environment.json"
echo "{\"id\": \"${environment_id}\"}" > "${mydir}/../packages/cover-traffic-daemon/default-environment.json"

# special treatment for end-of-chain packages
# to create lockfiles with resolution overrides
"${mydir}/build-lockfiles.sh" hoprd
"${mydir}/build-lockfiles.sh" cover-traffic-daemon

yarn workspace @hoprnet/hoprd npm publish --access public
yarn workspace @hoprnet/hopr-cover-traffic-daemon npm publish --access public

cleanup
fi
67 changes: 2 additions & 65 deletions scripts/run-integration-tests-source.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ declare node5_dir="${tmp}/${node_prefix}-5"
declare node6_dir="${tmp}/${node_prefix}-6"
declare node7_dir="${tmp}/${node_prefix}-7"

declare ct_node1_dir="${tmp}/${node_prefix}-ct1"

declare node1_log="${node1_dir}.log"
declare node2_log="${node2_dir}.log"
declare node3_log="${node3_dir}.log"
Expand All @@ -78,8 +76,6 @@ declare node5_log="${node5_dir}.log"
declare node6_log="${node6_dir}.log"
declare node7_log="${node7_dir}.log"

declare ct_node1_log="${ct_node1_dir}.log"

declare node1_id="${node1_dir}.id"
declare node2_id="${node2_dir}.id"
declare node3_id="${node3_dir}.id"
Expand All @@ -98,8 +94,6 @@ declare node7_privkey="0x9b813edd8a85cffbe3cd2e242dc0992cfa04be15caa9f50b0b03b5e

declare password="e2e-test"

declare ct_db_file="${tmp}/hopr-ct-db.json"

declare anvil_rpc_log="${tmp}/hopr-source-anvil-rpc.log"
declare anvil_cfg_file="${tmp}/hopr-source-anvil.cfg"

Expand All @@ -109,8 +103,6 @@ declare -a all_ports=( 8545 )
all_ports+=( 13301 13302 13303 13304 13305 13306 13307 )
# HOPRd p2p ports
all_ports+=( 19091 19092 19093 19094 19095 19096 19097 )
# CTd healthcheck port
all_ports+=( 20000 )

function cleanup {
local EXIT_CODE=$?
Expand Down Expand Up @@ -143,7 +135,7 @@ function cleanup {
done

log "Wiping databases"
rm -rf "${node1_dir}" "${node2_dir}" "${node3_dir}" "${node4_dir}" "${node5_dir}" "${node6_dir}" "${node7_dir}" "${ct_node1_dir}"
rm -rf "${node1_dir}" "${node2_dir}" "${node3_dir}" "${node4_dir}" "${node5_dir}" "${node6_dir}" "${node7_dir}"

if [ ${non_zero} ]; then
exit 1
Expand Down Expand Up @@ -220,48 +212,6 @@ function setup_node() {
> "${log}" 2>&1 &
}

# $1 = node log file
# $2 = private key, must be hex string of length 66
# $3 = health check port
# $4 = data directory
# $5 = OPTIONAL: additional args to ct daemon
function setup_ct_node() {
local log=${1}
local private_key=${2}
local health_check_port=${3}
local dir=${4}
local additional_args=${5:-""}

# Remove previous logs to make sure the regex does not match
rm -f "${log}"

log "Run CT node -> ${log}"

if [[ "${additional_args}" != *"--environment "* ]]; then
additional_args="--environment anvil-localhost ${additional_args}"
fi
log "Additional args: \"${additional_args}\""

# Remove previous logs to make sure the regex does not match
rm -f "${log}"

HOPR_CTD_HEARTBEAT_INTERVAL=2500 \
HOPR_CTD_HEARTBEAT_THRESHOLD=2500 \
HOPR_CTD_HEARTBEAT_VARIANCE=1000 \
NODE_OPTIONS="--experimental-wasm-modules" \
DEBUG="hopr*" NODE_ENV=development node packages/cover-traffic-daemon/lib/index.js \
--privateKey "${private_key}" \
--dbFile "${ct_db_file}" \
--data="${dir}" \
--healthCheck \
--healthCheckPort "${health_check_port}" \
--allowLocalNodeConnections \
--testAnnounceLocalAddresses \
--testPreferLocalAddresses \
${additional_args} \
> "${log}" 2>&1 &
}

# --- Log test info {{{
log "Test files and directories"
log "\tanvil"
Expand Down Expand Up @@ -295,9 +245,6 @@ log "\tnode7"
log "\t\tdata dir: ${node7_dir} (will be removed)"
log "\t\tlog: ${node7_log}"
log "\t\tid: ${node7_id}"
log "\tct_node1"
log "\t\tdata dir: ${ct_node1_dir} (will be removed)"
log "\t\tlog: ${ct_node1_log}"
# }}}

# --- Check all resources we need are free {{{
Expand Down Expand Up @@ -327,9 +274,6 @@ update_protocol_config_addresses "${protocol_config}" "${deployments_summary}" "
update_protocol_config_addresses "${protocol_config}" "${deployments_summary}" "anvil-localhost" "anvil-localhost2"
# }}}

# static address because static private key
declare ct_node1_address="0xde913eeed23bce5274ead3de8c196a41176fbd49"

# --- Run nodes --- {{{
setup_node 13301 ${default_api_token} 19091 "${node1_dir}" "${node1_log}" "${node1_id}" "${node1_privkey}" "--announce"
# use empty auth token to be able to test this in the security tests
Expand All @@ -341,11 +285,8 @@ setup_node 13305 ${default_api_token} 19095 "${node5_dir}" "${node5_log}" "${nod
setup_node 13306 ${default_api_token} 19096 "${node6_dir}" "${node6_log}" "${node6_id}" "${node6_privkey}" "--announce --environment anvil-localhost2"
# node n8 will be the only one NOT registered
setup_node 13307 ${default_api_token} 19097 "${node7_dir}" "${node7_log}" "${node7_id}" "${node7_privkey}" "--announce"
setup_ct_node "${ct_node1_log}" "0xa08666bca1363cb00b5402bbeb6d47f6b84296f3bba0f2f95b1081df5588a613" 20000 "${ct_node1_dir}"
# }}}

log "CT node1 address: ${ct_node1_address}"

# DO NOT MOVE THIS STEP
# --- Wait until private key has been created or recovered --- {{{
wait_for_regex ${node1_log} "please fund this node"
Expand All @@ -359,7 +300,7 @@ wait_for_regex ${node7_log} "please fund this node"

log "Funding nodes"
# --- Fund nodes --- {{{
fund_nodes "${node_prefix}" "${tmp}" "${password}" "${ct_node1_address}"
fund_nodes "${node_prefix}" "${tmp}" "${password}"
# }}}

log "Waiting for port binding"
Expand Down Expand Up @@ -399,7 +340,3 @@ ${mydir}/../test/integration-test.sh \
"localhost:13301" "localhost:13302" "localhost:13303" "localhost:13304" "localhost:13305" "localhost:13306" "localhost:13307"
# }}}

# -- CT test {{{
${mydir}/../test/ct-test.sh \
"${ct_node1_log}" "127.0.0.1" 20000
# }}}
Loading

0 comments on commit 5a1df60

Please sign in to comment.