Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
0b898fa
Merge branch 'release' into master
jansegre Oct 22, 2025
0b9c70f
fix(nano): avoid exception when generating json
jansegre Sep 19, 2025
d9c67bf
Merge pull request #1421 from HathorNetwork/fix/nano/json-exception
jansegre Oct 27, 2025
d256757
Merge pull request #1481 from HathorNetwork/release-candidate
jansegre Oct 28, 2025
3e8162d
Merge branch 'release' into master
jansegre Oct 28, 2025
2eddefa
chore: bump hathorlib (#1482)
raul-oliveira Oct 29, 2025
a54c01c
chore[nginx]: Setup Nginx images for Testnet India (#1459)
luislhl Oct 29, 2025
756b26b
feat: add tracked object counts metric (#1247)
glevco Nov 3, 2025
c52d316
chore: fix a large number of spelling issues (#1136)
hongmengning Nov 6, 2025
2e22d0f
refactor: rename `tests` module to `hathor_tests`
jansegre Nov 10, 2025
c2c02a9
refactor: move out hathor.cli from hathor
jansegre Nov 11, 2025
a25e7ab
Merge pull request #1485 from HathorNetwork/refactor/large-module-split
jansegre Nov 12, 2025
b451499
fix(nano): serialization on state api (#1492)
glevco Nov 21, 2025
c8434eb
chore: update localnet.yml to support nanos (#1493)
luislhl Nov 25, 2025
8714656
fix(nano): fix nc creation API
glevco Nov 11, 2025
c456da7
Merge pull request #1487 from HathorNetwork/fix/nc-creation-api
jansegre Nov 25, 2025
196bcf6
refactor: remove vertex children from metadata
glevco Oct 24, 2025
9f37644
fix test
glevco Nov 25, 2025
fb72843
Merge pull request #1495 from HathorNetwork/refactor/vertex-children
jansegre Nov 26, 2025
e3fcf65
feat(nano): Improve Nano History HTTP API
msbrogli Nov 11, 2025
6ca802e
Merge pull request #1486 from HathorNetwork/feat/nano/history-api-imp…
jansegre Nov 26, 2025
cb5e53f
fix(nano): do not allow dict in tuple/NamedTuple fields
jansegre Nov 27, 2025
1e44e24
Merge pull request #1500 from HathorNetwork/fix/no-dict-in-tuple-fields
jansegre Dec 1, 2025
c5509ce
chore[nginx]: add the Testnet Playground Docker registry for Nginx im…
luislhl Dec 2, 2025
de5fc73
feat(nano): emit a token-creation event including for nano executions
jansegre Nov 24, 2025
a134513
Merge pull request #1494 from HathorNetwork/feat/nano/emit-token-crea…
jansegre Dec 3, 2025
a930d86
chore: add soft-voided to testnet-india because of #1500
jansegre Dec 3, 2025
0cc2278
Merge pull request #1504 from HathorNetwork/chore/testnet-india-pr150…
jansegre Dec 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .coveragerc_full
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
branch = True
omit =
# No way to test top command.
hathor/cli/top.py
hathor_cli/top.py

[report]
exclude_lines =
Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ WORKDIR /app/
COPY pyproject.toml poetry.lock ./
RUN poetry install -n -E sentry --no-root --only=main
COPY hathor ./hathor
COPY hathor_cli ./hathor_cli
COPY README.md ./
RUN poetry build -f wheel
RUN poetry run pip install dist/hathor-*.whl
Expand Down
26 changes: 13 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
py_sources = hathor/ tests/ extras/custom_tests/
py_sources = hathor/ hathor_tests/ extras/custom_tests/

.PHONY: all
all: check tests

# testing:

tests_cli = tests/cli/
tests_nano = tests/nanocontracts/ tests/tx/test_indexes_nc_history.py tests/resources/nanocontracts/
tests_lib = $(filter-out ${tests_cli} tests/__pycache__/, $(dir $(wildcard tests/*/.)))
tests_cli = hathor_tests/cli/
tests_nano = hathor_tests/nanocontracts/ hathor_tests/tx/test_indexes_nc_history.py hathor_tests/resources/nanocontracts/
tests_lib = $(filter-out ${tests_cli} hathor_tests/__pycache__/, $(dir $(wildcard hathor_tests/*/.)))
tests_ci = extras/github/

pytest_flags = -p no:warnings --cov-report=term --cov-report=html --cov-report=xml --cov=hathor
Expand All @@ -31,7 +31,7 @@ tests-nano:

.PHONY: tests-cli
tests-cli:
pytest --durations=10 --cov=hathor/cli/ --cov-config=.coveragerc_full --cov-fail-under=27 -p no:warnings $(tests_cli)
pytest --durations=10 --cov=hathor_cli/ --cov-config=.coveragerc_full --cov-fail-under=27 -p no:warnings $(tests_cli)

.PHONY: tests-doctests
tests-doctests:
Expand All @@ -47,9 +47,9 @@ tests-quick:

.PHONY: tests-genesis
tests-genesis:
HATHOR_TEST_CONFIG_YAML='./hathor/conf/mainnet.yml' pytest -n0 tests/tx/test_genesis.py
HATHOR_TEST_CONFIG_YAML='./hathor/conf/testnet.yml' pytest -n0 tests/tx/test_genesis.py
HATHOR_TEST_CONFIG_YAML='./hathor/conf/nano_testnet.yml' pytest -n0 tests/tx/test_genesis.py
HATHOR_TEST_CONFIG_YAML='./hathor/conf/mainnet.yml' pytest -n0 hathor_tests/tx/test_genesis.py
HATHOR_TEST_CONFIG_YAML='./hathor/conf/testnet.yml' pytest -n0 hathor_tests/tx/test_genesis.py
HATHOR_TEST_CONFIG_YAML='./hathor/conf/nano_testnet.yml' pytest -n0 hathor_tests/tx/test_genesis.py

.PHONY: tests-ci
tests-ci:
Expand All @@ -64,17 +64,17 @@ tests: tests-cli tests-lib tests-genesis tests-custom tests-ci

.PHONY: tests-full
tests-full:
pytest $(pytest_flags) --durations=10 --cov-config=.coveragerc_full ./tests
pytest $(pytest_flags) --durations=10 --cov-config=.coveragerc_full ./hathor_tests

# checking:

.PHONY: mypy
mypy:
mypy -p hathor -p tests -p extras.custom_tests
mypy -p hathor -p hathor_tests -p extras.custom_tests

.PHONY: dmypy
dmypy:
dmypy run --timeout 86400 -- -p hathor -p tests -p extras.custom_tests
dmypy run --timeout 86400 -- -p hathor -p hathor_tests -p extras.custom_tests

.PHONY: flake8
flake8:
Expand Down Expand Up @@ -111,8 +111,8 @@ isort:

.PHONY: clean-pyc
clean-pyc:
find hathor tests -name \*.pyc -delete
find hathor tests -name __pycache__ -delete
find hathor hathor_tests -name \*.pyc -delete
find hathor hathor_tests -name __pycache__ -delete

.PHONY: clean-caches
clean-caches:
Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This directory contains a miscellany of documents of Hathor core.
Hathor core documentation is distributed over the following locations:
- For users: [Hathor full node at Hathor docs](https://docs.hathor.network/pathways/components/full-node).
- At the root of the `hathor-core` repository for default documents (license, readme, etc.).
- [API documentation following Open API standard](../hathor/cli).
- [API documentation following Open API standard](../hathor_cli).
- [RFCs](https://github.com/HathorNetwork/rfcs).
- And finally, this directory for all other documents.

Expand Down
2 changes: 1 addition & 1 deletion docs/developing.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Generate API docs:

```
hathor-cli generate_openapi_json
redoc-cli bundle hathor/cli/openapi_files/openapi.json --output index.html
redoc-cli bundle hathor/_openapi/openapi.json --output index.html
```

[open-issue]: https://github.com/HathorNetwork/hathor-core/issues/new
Expand Down
15 changes: 8 additions & 7 deletions extras/custom_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ GREEN='\033[0;32m'
NC='\033[0m' # No Color

# Source dirs
SOURCE_DIRS=(hathor tests)
SOURCE_DIRS=(hathor hathor_tests)

# Define your custom linter check functions here
# Each function should return 0 if everything is OK, and 1 if something is wrong.
Expand All @@ -15,7 +15,7 @@ function check_version_match() {
# This function will check all source files containing the project version and return 1 in case
# they don't match. When a version is provided as an environment variable, it is checked against the package version.

OPENAPI_FILE="hathor/cli/openapi_files/openapi_base.json"
OPENAPI_FILE="hathor/_openapi/openapi_base.json"
SRC_FILE="hathor/version.py"
PACKAGE_FILE="pyproject.toml"

Expand Down Expand Up @@ -57,8 +57,8 @@ function check_do_not_use_builtin_random_in_tests() {
exclude=(
hathor/merged_mining/debug_api.py
hathor/client.py
hathor/cli/tx_generator.py
tests/test_utils/test_leb128.py
hathor_cli/tx_generator.py
hathor_tests/test_utils/test_leb128.py
)
exclude_params=()
for item in "${exclude[@]}"; do
Expand All @@ -82,19 +82,20 @@ function check_deprecated_typing() {
}

function check_do_not_import_tests_in_hathor() {
if grep -Rn '\<.*import .*tests.*\>\|\<.*from .*tests.* import\>' "hathor" | grep -v '# skip-import-tests-custom-check'; then
if grep -Rn '\<.*import .*hathor_tests.*\>\|\<.*from .*hathor_tests.* import\>' "hathor" | grep -v '# skip-import-tests-custom-check'; then
echo 'do not import test definitions in the hathor module'
echo 'move them from tests to hathor instead'
echo 'move them from hathor_tests to hathor instead'
echo 'alternatively, comment `# skip-import-tests-custom-check` to exclude a line.'
return 1
fi
return 0
}

function check_do_not_import_from_hathor_in_entrypoints() {
EXCLUDES=(--exclude=builder.py)
PATTERN='^import .*hathor.*\|^from .*hathor.* import'

if grep -Rn "$PATTERN" "hathor/cli" | grep -v 'from hathor.cli.run_node import RunNode' | grep -v '# skip-cli-import-custom-check'; then
if grep -Rn $EXCLUDES "$PATTERN" "hathor_cli" | grep -v 'from hathor_cli.run_node import RunNode' | grep -v '# skip-cli-import-custom-check'; then
echo 'do not import from `hathor` in the module-level of a CLI entrypoint.'
echo 'instead, import locally inside the function that uses the import.'
echo 'alternatively, comment `# skip-cli-import-custom-check` to exclude a line.'
Expand Down
95 changes: 91 additions & 4 deletions extras/nginx_docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,39 @@ DEFAULT_NO_RATE_LIMIT_TAG = no-rate-limit-latest
# Build and Push Commands
# =======================

# GCP / Hathor Testnet
HATHOR_TESTNET_REGISTRY = us-central1-docker.pkg.dev/hathor-testnet/fullnodes/webtank

HATHOR_TESTNET_INDIA_TAG_LATEST = india-latest
HATHOR_TESTNET_INDIA_TAG_NO_RATE_LIMIT = india-no-rate-limit-latest

.PHONY: hathor-testnet
hathor-testnet: hathor-testnet-default hathor-testnet-no-rate-limit hathor-testnet-india-default hathor-testnet-india-no-rate-limit
@echo "All Hathor Testnet images built and pushed successfully!"

.PHONY: hathor-testnet-default
hathor-testnet-default: clean nginx.conf set_real_ip_from_cloudfront
@echo "Building and pushing latest image for Hathor Testnet..."
docker buildx build --pull --push --platform linux/arm64/v8,linux/amd64 --tag $(HATHOR_TESTNET_REGISTRY):$(DEFAULT_LATEST_TAG) .

.PHONY: hathor-testnet-no-rate-limit
hathor-testnet-no-rate-limit: clean nginx_no_rate_limit.conf set_real_ip_from_cloudfront
@echo "Building and pushing no-rate-limit image for Hathor Testnet..."
mv nginx_no_rate_limit.conf nginx.conf
docker buildx build --pull --push --platform linux/arm64/v8,linux/amd64 --tag $(HATHOR_TESTNET_REGISTRY):$(DEFAULT_NO_RATE_LIMIT_TAG) .

.PHONY: hathor-testnet-india-default
hathor-testnet-india-default: clean nginx_india.conf set_real_ip_from_cloudfront
@echo "Building and pushing india image for Hathor Testnet..."
mv nginx_india.conf nginx.conf
docker buildx build --pull --push --platform linux/arm64/v8,linux/amd64 --tag $(HATHOR_TESTNET_REGISTRY):$(HATHOR_TESTNET_INDIA_TAG_LATEST) .

.PHONY: hathor-testnet-india-no-rate-limit
hathor-testnet-india-no-rate-limit: clean nginx_india_no_rate_limit.conf set_real_ip_from_cloudfront
@echo "Building and pushing no-rate-limit india image for Hathor Testnet..."
mv nginx_india_no_rate_limit.conf nginx.conf
docker buildx build --pull --push --platform linux/arm64/v8,linux/amd64 --tag $(HATHOR_TESTNET_REGISTRY):$(HATHOR_TESTNET_INDIA_TAG_NO_RATE_LIMIT) .

# GCP / Nano Testnet
NANO_TESTNET_REGISTRY = us-central1-docker.pkg.dev/nano-testnet/fullnodes/webtank

Expand Down Expand Up @@ -35,9 +68,9 @@ nano-testnet-bravo-default: clean nginx_bravo.conf set_real_ip_from_cloudfront
docker buildx build --pull --push --platform linux/arm64/v8,linux/amd64 --tag $(NANO_TESTNET_REGISTRY):$(NANO_TESTNET_BRAVO_TAG_LATEST) .

.PHONY: nano-testnet-bravo-no-rate-limit
nano-testnet-bravo-no-rate-limit: clean nginx_bravo.conf set_real_ip_from_cloudfront
nano-testnet-bravo-no-rate-limit: clean nginx_bravo_no_rate_limit.conf set_real_ip_from_cloudfront
@echo "Building and pushing no-rate-limit bravo image for Nano Testnet..."
mv nginx_bravo.conf nginx.conf
mv nginx_bravo_no_rate_limit.conf nginx.conf
docker buildx build --pull --push --platform linux/arm64/v8,linux/amd64 --tag $(NANO_TESTNET_REGISTRY):$(NANO_TESTNET_BRAVO_TAG_NO_RATE_LIMIT) .

# GCP / Standalone Fullnodes
Expand Down Expand Up @@ -76,6 +109,25 @@ ekvilibro-no-rate-limit: clean nginx_no_rate_limit.conf set_real_ip_from_cloudfr
mv nginx_no_rate_limit.conf nginx.conf
docker buildx build --pull --push --platform linux/arm64/v8,linux/amd64 --tag $(EKVILIBRO_REGISTRY):$(DEFAULT_NO_RATE_LIMIT_TAG) .

# GCP / Hathor Testnet Playground
HATHOR_TESTNET_PLAYGROUND_REGISTRY = us-central1-docker.pkg.dev/hathor-testnet-playground/fullnodes/webtank

.PHONY: hathor-testnet-playground
hathor-testnet-playground: hathor-testnet-playground-default hathor-testnet-playground-no-rate-limit
@echo "All Hathor Testnet Playground images built and pushed successfully!"

.PHONY: hathor-testnet-playground-default
hathor-testnet-playground-default: clean nginx_playground.conf set_real_ip_from_cloudfront
@echo "Building and pushing latest image for Hathor Testnet Playground..."
mv nginx_playground.conf nginx.conf
docker buildx build --pull --push --platform linux/arm64/v8,linux/amd64 --tag $(HATHOR_TESTNET_PLAYGROUND_REGISTRY):$(DEFAULT_LATEST_TAG) .

.PHONY: hathor-testnet-playground-no-rate-limit
hathor-testnet-playground-no-rate-limit: clean nginx_playground_no_rate_limit.conf set_real_ip_from_cloudfront
@echo "Building and pushing no-rate-limit image for Hathor Testnet Playground..."
mv nginx_playground_no_rate_limit.conf nginx.conf
docker buildx build --pull --push --platform linux/arm64/v8,linux/amd64 --tag $(HATHOR_TESTNET_PLAYGROUND_REGISTRY):$(DEFAULT_NO_RATE_LIMIT_TAG) .

# AWS / Main Account
AWS_MAIN_REGISTRY = 769498303037.dkr.ecr.us-east-1.amazonaws.com/webtank

Expand All @@ -96,7 +148,7 @@ aws-main-no-rate-limit: clean nginx_no_rate_limit.conf set_real_ip_from_cloudfro

# Build All (convenience command)
.PHONY: build-all
build-all: nano-testnet standalone-fullnodes ekvilibro aws-main
build-all: hathor-testnet nano-testnet standalone-fullnodes ekvilibro hathor-testnet-playground aws-main
@echo "All images built and pushed successfully!"

# Legacy commands for backward compatibility
Expand Down Expand Up @@ -127,6 +179,31 @@ nginx_bravo.conf:
@python -c "import os; import hathor; print('Using hathor-core from:', os.path.dirname(hathor.__file__))"
python -m hathor generate_nginx_config --override nano-testnet-bravo - > $@

nginx_bravo_no_rate_limit.conf: export PYTHONPATH := ../..
nginx_bravo_no_rate_limit.conf:
@python -c "import os; import hathor; print('Using hathor-core from:', os.path.dirname(hathor.__file__))"
python -m hathor generate_nginx_config --override nano-testnet-bravo --disable-rate-limits - > $@

nginx_india.conf: export PYTHONPATH := ../..
nginx_india.conf:
@python -c "import os; import hathor; print('Using hathor-core from:', os.path.dirname(hathor.__file__))"
python -m hathor generate_nginx_config --override hathor-testnet-india - > $@

nginx_india_no_rate_limit.conf: export PYTHONPATH := ../..
nginx_india_no_rate_limit.conf:
@python -c "import os; import hathor; print('Using hathor-core from:', os.path.dirname(hathor.__file__))"
python -m hathor generate_nginx_config --override hathor-testnet-india --disable-rate-limits - > $@

nginx_playground.conf: export PYTHONPATH := ../..
nginx_playground.conf:
@python -c "import os; import hathor; print('Using hathor-core from:', os.path.dirname(hathor.__file__))"
python -m hathor generate_nginx_config --override hathor-testnet-playground - > $@

nginx_playground_no_rate_limit.conf: export PYTHONPATH := ../..
nginx_playground_no_rate_limit.conf:
@python -c "import os; import hathor; print('Using hathor-core from:', os.path.dirname(hathor.__file__))"
python -m hathor generate_nginx_config --override hathor-testnet-playground --disable-rate-limits - > $@

set_real_ip_from_cloudfront:
curl https://ip-ranges.amazonaws.com/ip-ranges.json -s \
| jq '.prefixes|map(select(.service=="CLOUDFRONT"))[]|.ip_prefix' -r \
Expand All @@ -139,13 +216,18 @@ set_real_ip_from_cloudfront:

.PHONY: clean
clean:
rm -f nginx.conf nginx_no_rate_limit.conf nginx_bravo.conf set_real_ip_from_cloudfront
rm -f nginx.conf nginx_no_rate_limit.conf nginx_bravo.conf nginx_bravo_no_rate_limit.conf nginx_india.conf nginx_india_no_rate_limit.conf set_real_ip_from_cloudfront

.PHONY: help
help:
@echo "Available commands:"
@echo ""
@echo "Project/Account Commands:"
@echo " hathor-testnet - Build and push all images for GCP Project Hathor Testnet"
@echo " hathor-testnet-default - Build and push default image for GCP Project Hathor Testnet"
@echo " hathor-testnet-no-rate-limit - Build and push no-rate-limit image for GCP Project Hathor Testnet"
@echo " hathor-testnet-india-default - Build and push india image for GCP Project Hathor Testnet"
@echo " hathor-testnet-india-no-rate-limit - Build and push no-rate-limit india image for GCP Project Hathor Testnet"
@echo " nano-testnet - Build and push all images for GCP Project Nano Testnet"
@echo " nano-testnet-default - Build and push default image for GCP Project Nano Testnet"
@echo " nano-testnet-no-rate-limit - Build and push no-rate-limit image for GCP Project Nano Testnet"
Expand All @@ -157,6 +239,9 @@ help:
@echo " ekvilibro - Build and push all images for GCP Project Ekvilibro"
@echo " ekvilibro-default - Build and push default image for GCP Project Ekvilibro"
@echo " ekvilibro-no-rate-limit - Build and push no-rate-limit image for GCP Project Ekvilibro"
@echo " hathor-testnet-playground - Build and push all images for GCP Project Hathor Testnet Playground"
@echo " hathor-testnet-playground-default - Build and push default image for GCP Project Hathor Testnet Playground"
@echo " hathor-testnet-playground-no-rate-limit - Build and push no-rate-limit image for GCP Project Hathor Testnet Playground"
@echo " aws-main - Build and push all images for AWS Main Account"
@echo " aws-main-default - Build and push default image for AWS Main Account"
@echo " aws-main-no-rate-limit - Build and push no-rate-limit image for AWS Main Account"
Expand All @@ -172,8 +257,10 @@ help:
@echo " docker-no-rate-limit - Alias for aws-main-no-rate-limit"
@echo ""
@echo "Supported Projects/Accounts:"
@echo " - Hathor Testnet: $(HATHOR_TESTNET_REGISTRY)"
@echo " - Nano Testnet: $(NANO_TESTNET_REGISTRY)"
@echo " - Standalone Fullnodes: $(STANDALONE_FULLNODES_REGISTRY)"
@echo " - Ekvilibro: $(EKVILIBRO_REGISTRY)"
@echo " - Hathor Testnet Playground: $(HATHOR_TESTNET_PLAYGROUND_REGISTRY)"
@echo " - AWS Main Account: $(AWS_MAIN_REGISTRY)"
@echo ""
2 changes: 1 addition & 1 deletion hathor/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
# limitations under the License.

if __name__ == '__main__':
from .cli import main
from hathor_cli import main
main.main()
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
],
"info": {
"title": "Hathor API",
"version": "0.67.1"
"version": "0.68.0"
},
"consumes": [
"application/json"
Expand Down
File renamed without changes.
2 changes: 0 additions & 2 deletions hathor/builder/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,11 @@
# limitations under the License.

from hathor.builder.builder import BuildArtifacts, Builder, SyncSupportLevel
from hathor.builder.cli_builder import CliBuilder
from hathor.builder.resources_builder import ResourcesBuilder

__all__ = [
'BuildArtifacts',
'Builder',
'CliBuilder',
'ResourcesBuilder',
'SyncSupportLevel',
]
Loading
Loading