Skip to content

Commit

Permalink
Merge branch 'main' into multiple-extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
phearnot authored Oct 22, 2024
2 parents 1b8c8a3 + 3d6864e commit acc18fd
Show file tree
Hide file tree
Showing 17 changed files with 130 additions and 113 deletions.
2 changes: 1 addition & 1 deletion docker/services/waves-node.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
services:
waves-node:
container_name: waves-node
image: ghcr.io/unitsnetwork/consensus-client:${WAVES_NODE_TAG:-${NETWORK}}
image: consensus-client:local
stop_grace_period: 5m
ports:
- "6869:6869"
Expand Down
2 changes: 1 addition & 1 deletion local-network/all-images-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ echo "Update deploy image"
docker compose build deploy --no-cache

echo "Update test image"
docker compose build test
docker compose build tests

echo "Done."
67 changes: 38 additions & 29 deletions local-network/configs/wavesnode/genesis-template.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,48 +9,57 @@ genesis-generator {
# the sum of shares should be <= initial-balance
distributions = [
# CL miner on wavesnode-1
# Seed text: devnet-1
# Nonce: 0
# Seed: HnyGuCEnV1A
# Private account key: DwPvPGEp3LPg5gVRz7Pqd8mHa6dWK9dXtP4XDmKTz6ga
# Public account key: Atej9hrXKQS6cLjuhjEnKyF5boyYGSp5VBZvfcmF9FqY
# Address: 3FNraPMYcfuGREcxorNSEBHgNLjmYtaHy9e
# Seed text: devnet-1
# Nonce: 0
# Seed: HnyGuCEnV1A
# Private key: DwPvPGEp3LPg5gVRz7Pqd8mHa6dWK9dXtP4XDmKTz6ga
# Public key: Atej9hrXKQS6cLjuhjEnKyF5boyYGSp5VBZvfcmF9FqY
# Address: 3FNraPMYcfuGREcxorNSEBHgNLjmYtaHy9e
{ seed-text = "devnet-1", nonce = 0, amount = 998036000000000 }

# Chain contract on wavesnode-1
# Seed text: devnet-1
# Nonce: 2
# Seed: HnyGuCEnV1A
# Private account key: 7TzN4c2XgvSN28gEbvW5wmUecfa4SrPRLXjgr5DRfQMG
# Public account key: 5yxSxDhB2ZL5agYnU6WRtEqPg3T3FfUY3zouKrMpnTX6
# Seed text: devnet-1
# Nonce: 2
# Seed: HnyGuCEnV1A
# Private key: 7TzN4c2XgvSN28gEbvW5wmUecfa4SrPRLXjgr5DRfQMG
# Public key: 5yxSxDhB2ZL5agYnU6WRtEqPg3T3FfUY3zouKrMpnTX6
# Address: 3FdaanzgX4roVgHevhq8L8q42E7EZL9XTQr
{ seed-text = "devnet-1", nonce = 2, amount = 20000000000 }

# DAO Address
# Seed text: devnet dao 1
# Nonce: 0
# Seed: 2ttKSSq2o7VU6kFwN
# Private key: EXC4wafzVus3tmesKEouuewZHGNzEG5qxNHMN66XAiG4
# Public key: 7S2iCGvRcx3bJA3y8R9k6sJdVATg3ss8r4RuW1S8VriA
# Address: 3FYp54DX9Np9uouxBtnnCFPYWzz7K3kvSD2
{ seed-text = "devnet dao 1", nonce = 0, amount = 100000000 }

# CL miner on wavesnode-2
# Seed text: devnet-2
# Nonce: 0
# Seed: HnyGuCEnV1B
# Private account key: F17jrRWmrR7en6eY6ptvnUTNqc9W8RSP34hpX7bNhbht
# Public account key: FuibB1rJ1uHVvvY6FNmhLqnbvQBNtziWbh7zh5c1CQCG
# Address: 3FSrRN8X7cDsLyYTScS8Yf8KSwZgJBwf1jU
# Seed text: devnet-2
# Nonce: 0
# Seed: HnyGuCEnV1B
# Private key: F17jrRWmrR7en6eY6ptvnUTNqc9W8RSP34hpX7bNhbht
# Public key: FuibB1rJ1uHVvvY6FNmhLqnbvQBNtziWbh7zh5c1CQCG
# Address: 3FSrRN8X7cDsLyYTScS8Yf8KSwZgJBwf1jU
{ seed-text = "devnet-2", nonce = 0, amount = 998036000000000 }

# Additional addresses

# Seed text: devnet-0
# Nonce: 0
# Seed: HnyGuCEnV19
# Private account key: 8aYKVCJVYfcSQeSH1kM4D2e4Fcj5cAQzMh8uZ5hW2tB9
# Public account key: GRKksNikCNXYT7HqxCnqzjP5pf4NctgtTnmCvCMDEhAT
# Address: 3Ffcu52v7ETMAFhNAqQvHsv4JuQjEVP9q6E
# Seed text: devnet-0
# Nonce: 0
# Seed: HnyGuCEnV19
# Private key: 8aYKVCJVYfcSQeSH1kM4D2e4Fcj5cAQzMh8uZ5hW2tB9
# Public key: GRKksNikCNXYT7HqxCnqzjP5pf4NctgtTnmCvCMDEhAT
# Address: 3Ffcu52v7ETMAFhNAqQvHsv4JuQjEVP9q6E
{ seed-text = "devnet-0", nonce = 0, amount = 2305842994213693951 }

# Seed text: devnet-0
# Nonce: 1
# Seed: HnyGuCEnV19
# Private account key: 5tE8jwZ3B4eLTvdz7LqEBMcmspoqXD9nPCEfcZgh2BeV
# Public account key: BArfnBGQ9gkNHC2EftXf42uJuBioSffZiJoyYCTtwxof
# Address: 3FQFFWxMCDmyZhkRzKA7QiAZL4RKMhJvFnu
# Seed text: devnet-0
# Nonce: 1
# Seed: HnyGuCEnV19
# Private key: 5tE8jwZ3B4eLTvdz7LqEBMcmspoqXD9nPCEfcZgh2BeV
# Public key: BArfnBGQ9gkNHC2EftXf42uJuBioSffZiJoyYCTtwxof
# Address: 3FQFFWxMCDmyZhkRzKA7QiAZL4RKMhJvFnu
{ seed-text = "devnet-0", nonce = 1, amount = 2305842994213693952 }
]
}
21 changes: 0 additions & 21 deletions local-network/configs/wavesnode/waves.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Waves node settings
waves {
directory = /var/lib/waves
db.directory = /var/lib/waves/data
db.store-state-hashes = true

# Blockchain settings
Expand All @@ -13,16 +11,6 @@ waves {
feature-check-blocks-period = 1
blocks-for-feature-activation = 1
min-asset-info-update-interval = 7
generation-balance-depth-from-50-to-1000-after-height = 0
last-time-based-fork-parameter = 1492128000000
reset-effective-balances-at-height = 4650
block-version-3-after-height = 0
max-complexity-in-block = 10000000000
double-features-periods-after-height = 1000000000
max-transaction-time-back-offset = 120m
max-transaction-time-forward-offset = 90m
lease-expiration = 1000000

min-block-time = 12000ms
delay-delta = 3

Expand Down Expand Up @@ -68,7 +56,6 @@ waves {
miner {
enable = yes
micro-block-interval = 200ms
max-transactions-in-key-block = 0
max-transactions-in-micro-block = 500
min-micro-block-age = 0ms
quorum = 0
Expand Down Expand Up @@ -97,9 +84,6 @@ waves {
enable-peers-exchange = no
enable-blacklisting = no

max-inbound-connections = 70
max-outbound-connections = 70

traffic-logger {
# Codes of transmitted messages to ignore. See MessageSpec.messageCode
ignore-tx-messages = [] # BlockMessageSpec, TransactionsMessageSpec
Expand Down Expand Up @@ -143,8 +127,6 @@ waves {
# Hash of API key string
api-key-hash = "2etchmPPsitn9VMShPjACKjWZ1M2sZLG7tsZqj9qEaRx" # hashSecure of "testapi"

api-key-different-host = yes
evaluate-script-complexity-limit = 52000
minimum-peers = 0
}

Expand All @@ -166,6 +148,3 @@ waves {
password = ""
}
}

kamon.enable = no
metrics.enable = no
2 changes: 1 addition & 1 deletion local-network/configs/wavesnode/wavesnode.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
wavesnode:
image: unitsnetwork/consensus-client:main
image: ghcr.io/unitsnetwork/consensus-client:testnet
pull_policy: never
environment:
JAVA_OPTS: -Dlogback.file.level=TRACE
Expand Down
2 changes: 1 addition & 1 deletion local-network/consensus_client-image-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ DIR="$(cd "$(dirname "$0")" && pwd)"
cd "${DIR}/.." || exit

sbt -J-Xmx4G -J-Xss4m -Dfile.encoding=UTF-8 -Dsbt.supershell=false buildTarballsForDocker
docker build -t unitsnetwork/consensus-client:main docker
docker build -t consensus-client:local docker
10 changes: 1 addition & 9 deletions local-network/deploy/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
FROM python:3.12-slim

RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
git \
gcc \
libc6-dev \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
FROM python:3.9

WORKDIR /usr/src/app

COPY local/__init__.py ./local/
COPY pyproject.toml ./

RUN pip install --no-cache-dir --editable .
Expand Down
5 changes: 4 additions & 1 deletion local-network/deploy/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@

log.info(f"Genesis block hash: {el_genesis_block_hash}")

r = network.cl_chain_contract.setup(el_genesis_block_hash)
r = network.cl_chain_contract.setup(
el_genesis_block_hash,
daoAddress = '3FYp54DX9Np9uouxBtnnCFPYWzz7K3kvSD2'
)
waves.force_success(log, r, "Can not setup the chain contract")

cl_token = network.cl_chain_contract.getToken()
Expand Down
Empty file.
6 changes: 3 additions & 3 deletions local-network/deploy/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools>=75.0", "wheel"]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
Expand All @@ -8,10 +8,10 @@ version = "0.1"
description = "Scripts and tests for a locally deployed Unit network"
dependencies = [
"solc-select",
"units-network @ git+https://github.com/UnitsNetwork/examples.git",
"units-network @ git+https://github.com/UnitsNetwork/examples.git@dao-rewards",
]
readme = "README.md"
requires-python = ">=3.12"
requires-python = ">=3.9"
license = { text = "MIT License" }
keywords = ["units network", "blockchain", "waves"]

Expand Down
18 changes: 16 additions & 2 deletions local-network/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ services:
extends:
file: ./configs/wavesnode/wavesnode.yml
service: wavesnode
image: unitsnetwork/consensus-client:${WAVES_NODE_1_TAG:-main}
image: ${WAVES_NODE_IMAGE_1:-${WAVES_NODE_IMAGE:-consensus-client:local}}
ports:
- "127.0.0.1:16869:6869"
environment:
Expand All @@ -47,14 +47,16 @@ services:
depends_on:
ec-1:
condition: service_healthy
update-genesis:
condition: service_completed_successfully

wavesnode-2:
container_name: wavesnode-2
hostname: wavesnode-2
extends:
file: ./configs/wavesnode/wavesnode.yml
service: wavesnode
image: unitsnetwork/consensus-client:${WAVES_NODE_2_TAG:-main}
image: ${WAVES_NODE_IMAGE_2:-${WAVES_NODE_IMAGE:-consensus-client:local}}
ports:
- "127.0.0.1:26869:6869"
environment:
Expand All @@ -65,6 +67,18 @@ services:
depends_on:
ec-2:
condition: service_healthy
update-genesis:
condition: service_completed_successfully

update-genesis:
container_name: update-genesis
image: ${WAVES_NODE_IMAGE:-ghcr.io/wavesplatform/waves:test-gengen}
volumes:
- ./configs/wavesnode:/tmp/configs
command:
- gengen
- /tmp/configs/genesis-template.conf
- /tmp/configs/genesis.conf

deploy:
container_name: deploy
Expand Down
23 changes: 1 addition & 22 deletions local-network/genesis-update.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,3 @@
#!/usr/bin/env bash

DIR="$(cd "$(dirname "$0")" && pwd)"
cd "${DIR}" || exit

CACHE_DIR=".cache"
JAR_FILE="waves.jar"
URL="https://github.com/wavesplatform/Waves/releases/download/v1.5.6/waves-all-1.5.6.jar"

mkdir -p "$CACHE_DIR"

if [ ! -f "$CACHE_DIR/$JAR_FILE" ]; then
echo "Downloading $JAR_FILE..."
curl -L -o "$CACHE_DIR/$JAR_FILE" "$URL"
echo "Download completed."
else
echo "$JAR_FILE already exists in $CACHE_DIR."
fi

java -cp "${DIR}/.cache/waves.jar" com.wavesplatform.GenesisBlockGenerator \
"${DIR}/configs/wavesnode/genesis-template.conf" \
"${DIR}/configs/wavesnode/genesis.conf" > /dev/null

echo "Genesis config updated"
docker compose up --no-deps update-genesis
1 change: 0 additions & 1 deletion local-network/restart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,5 @@ cp ../src/test/resources/main.ride ./deploy/setup/waves/
export COMPOSE_PROFILES="${COMPOSE_PROFILES:-}"
echo "Compose profiles are: ${COMPOSE_PROFILES}"

./genesis-update.sh
docker compose up -d
docker compose logs deploy tests -f
Loading

0 comments on commit acc18fd

Please sign in to comment.