diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 7eb7dd7a2..cdaf5e08b 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -2,11 +2,11 @@ contact_links: - about: Ask a question or request support here name: Ask for Support url: >- - https://github.com/Chia-Network/chia-blockchain/discussions/new?category=support + https://github.com/Flax-Network/flax-blockchain/discussions/new?category=support - about: Request a new feature or idea here name: Make a Request url: >- - https://github.com/Chia-Network/chia-blockchain/discussions/new?category=ideas - - about: Get support on the Chia Keybase chat channels. - name: Join the Keybase.io support chat - url: 'https://keybase.io/team/chia_network.public' + https://github.com/Flax-Network/flax-blockchain/discussions/new?category=ideas + - about: Get support on the Flax Discord chat channels. + name: Join the Discord.io support chat + url: 'https://discord.gg/TgJyxsEFFc' diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 021d3cac9..000000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,31 +0,0 @@ -# Basic dependabot.yml file with -# minimum configuration for two package managers - -version: 2 -updates: - # Enable version updates for Python - - package-ecosystem: "pip" - # Look for a `Dockerfile` in the `root` directory - directory: "/" - # Check for updates once a week - schedule: - interval: "weekly" - day: "tuesday" - target-branch: "main" - pull-request-branch-name: - # Separate sections of the branch name with a hyphen - # for example, `dependabot-npm_and_yarn-next_js-acorn-6.4.1` - separator: "-" - - # Maintain dependencies for GitHub Actions - - package-ecosystem: "github-actions" - directory: "/" - # Check for updates once a week - schedule: - interval: "weekly" - day: "tuesday" - target-branch: "main" - pull-request-branch-name: - # Separate sections of the branch name with a hyphen - # for example, `dependabot-npm_and_yarn-next_js-acorn-6.4.1` - separator: "-" diff --git a/.github/workflows/build-linux-arm64-installer.yml b/.github/workflows/build-linux-arm64-installer.yml deleted file mode 100644 index eacb82bba..000000000 --- a/.github/workflows/build-linux-arm64-installer.yml +++ /dev/null @@ -1,77 +0,0 @@ -name: Linux ARM64 installer on Python 3.8 - -on: - push: - branches: - - main - tags: - - '**' - pull_request: - branches: - - '**' - -jobs: - build: - name: Linux ARM64 installer on Python 3.8 - runs-on: ${{ matrix.os }} - timeout-minutes: 40 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: [3.8] - os: [ARM64] - - steps: - - name: Cancel previous runs on the same branch - if: ${{ github.ref != 'refs/heads/main' }} - uses: styfle/cancel-workflow-action@0.9.0 - with: - access_token: ${{ github.token }} - - - name: Checkout Code - uses: actions/checkout@v2 - with: - fetch-depth: 0 - submodules: recursive - - - name: Build ARM64 Installer - run: | - podman run --rm=true \ - -v ${{ github.workspace }}:/ws:rw --workdir=/ws \ - docker.io/library/ubuntu:18.04 \ - bash -exc '\ - echo $PATH && \ - apt update && \ - apt upgrade -y && \ - apt -y install software-properties-common build-essential \ - curl git dialog apt-utils zlib1g-dev && \ - add-apt-repository ppa:deadsnakes/ppa -y && \ - curl -sL https://deb.nodesource.com/setup_12.x | bash - && \ - apt -y install nodejs fakeroot \ - python3.8 python3.8-venv libpython3.8-dev python3.8-distutils && \ - rm -rf venv && \ - python3 --version && \ - python3.8 -m venv venv && \ - source venv/bin/activate && \ - echo "Should be Python 3.8.x" && \ - python --version && \ - echo "Emulating install.sh" && \ - pip install --upgrade pip && \ - pip install wheel && \ - pip install --extra-index-url https://pypi.chia.net/simple/ miniupnpc==2.1 && \ - pip install . --extra-index-url https://pypi.chia.net/simple/ && \ - ldd --version && \ - cd build_scripts && \ - sh build_linux.sh arm64 \ - ' - - - name: Upload Linux artifacts - uses: actions/upload-artifact@v2 - with: - name: Linux-ARM-64-Installer - path: ${{ github.workspace }}/build_scripts/final_installer/ - - - name: Clean up on self hosted runner - run: | - sudo rm -rf build_scrpits/final_installer diff --git a/.github/workflows/build-linux-installer.yml b/.github/workflows/build-linux-installer.yml index 30d3a1468..9555088a0 100644 --- a/.github/workflows/build-linux-installer.yml +++ b/.github/workflows/build-linux-installer.yml @@ -34,6 +34,7 @@ jobs: with: fetch-depth: 0 submodules: recursive + token: ${{ secrets.PAT }} - name: Setup Python environment uses: actions/setup-python@v2 @@ -84,7 +85,7 @@ jobs: . ./activate sudo apt-get -y install rpm ldd --version - cd ./chia-blockchain-gui + cd ./flax-blockchain-gui git status cd ../build_scripts sh build_linux.sh amd64 diff --git a/.github/workflows/build-macos-installer.yml b/.github/workflows/build-macos-installer.yml index 9e81ff5c0..d44d853fb 100644 --- a/.github/workflows/build-macos-installer.yml +++ b/.github/workflows/build-macos-installer.yml @@ -34,6 +34,7 @@ jobs: with: fetch-depth: 0 submodules: recursive + token: ${{ secrets.PAT }} - name: Setup Python environment uses: actions/setup-python@v2 @@ -103,7 +104,7 @@ jobs: APPLE_NOTARIZE_PASSWORD: "${{ secrets.APPLE_NOTARIZE_PASSWORD }}" run: | . ./activate - cd ./chia-blockchain-gui + cd ./flax-blockchain-gui git status cd ../build_scripts sh build_macos.sh @@ -111,5 +112,5 @@ jobs: - name: Upload MacOS artifacts uses: actions/upload-artifact@v2 with: - name: Chia-Installer-on-MacOS-10.15-dmg + name: Flax-Installer-on-MacOS-10.15-dmg path: ${{ github.workspace }}/build_scripts/final_installer/ diff --git a/.github/workflows/build-test-macos-blockchain.yml b/.github/workflows/build-test-macos-blockchain.yml deleted file mode 100644 index d6a337ea8..000000000 --- a/.github/workflows/build-test-macos-blockchain.yml +++ /dev/null @@ -1,93 +0,0 @@ -name: MacOS blockchain Tests - -on: - push: - branches: - - main - tags: - - '**' - pull_request: - branches: - - '**' - -jobs: - build: - name: MacOS blockchain Tests - runs-on: ${{ matrix.os }} - timeout-minutes: 60 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: [3.8, 3.9] - os: [macOS-latest] - - steps: - - name: Cancel previous runs on the same branch - if: ${{ github.ref != 'refs/heads/main' }} - uses: styfle/cancel-workflow-action@0.9.0 - with: - access_token: ${{ github.token }} - - - name: Checkout Code - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v2.1.5 - with: - # Note that new runners may break this https://github.com/actions/cache/issues/292 - path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: Checkout test blocks and plots - uses: actions/checkout@v2 - with: - repository: 'Chia-Network/test-cache' - path: '.chia' - ref: '0.26.0' - fetch-depth: 1 - - - name: Link home directory - run: | - cd $HOME - ln -s $GITHUB_WORKSPACE/.chia - echo "$HOME/.chia" - ls -al $HOME/.chia - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - BUILD_VDF_CLIENT: "N" - run: | - brew install boost - sh install.sh - - - name: Install timelord - run: | - . ./activate - sh install-timelord.sh - ./vdf_bench square_asm 400000 - - - name: Install developer requirements - run: | - . ./activate - venv/bin/python -m pip install pytest pytest-asyncio pytest-xdist - - - name: Test blockchain code with pytest - run: | - . ./activate - ./venv/bin/py.test tests/blockchain/test_blockchain.py tests/blockchain/test_blockchain_transactions.py -s -v --durations 0 diff --git a/.github/workflows/build-test-macos-clvm.yml b/.github/workflows/build-test-macos-clvm.yml deleted file mode 100644 index 60bdbb935..000000000 --- a/.github/workflows/build-test-macos-clvm.yml +++ /dev/null @@ -1,83 +0,0 @@ -name: MacOS clvm Tests - -on: - push: - branches: - - main - tags: - - '**' - pull_request: - branches: - - '**' - -jobs: - build: - name: MacOS clvm Tests - runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: [3.8, 3.9] - os: [macOS-latest] - - steps: - - name: Cancel previous runs on the same branch - if: ${{ github.ref != 'refs/heads/main' }} - uses: styfle/cancel-workflow-action@0.9.0 - with: - access_token: ${{ github.token }} - - - name: Checkout Code - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v2.1.5 - with: - # Note that new runners may break this https://github.com/actions/cache/issues/292 - path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} - restore-keys: | - ${{ runner.os }}-pip- - -# Omitted checking out blocks and plots repo Chia-Network/test-cache - - - name: Link home directory - run: | - cd $HOME - ln -s $GITHUB_WORKSPACE/.chia - echo "$HOME/.chia" - ls -al $HOME/.chia - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - BUILD_VDF_CLIENT: "N" - run: | - brew install boost - sh install.sh - -# Omitted installing Timelord - - - name: Install developer requirements - run: | - . ./activate - venv/bin/python -m pip install pytest pytest-asyncio pytest-xdist - - - name: Test clvm code with pytest - run: | - . ./activate - ./venv/bin/py.test tests/clvm/test_chialisp_deserialization.py tests/clvm/test_clvm_compilation.py tests/clvm/test_puzzles.py tests/clvm/test_serialized_program.py -s -v --durations 0 -n auto diff --git a/.github/workflows/build-test-macos-core-consensus.yml b/.github/workflows/build-test-macos-core-consensus.yml deleted file mode 100644 index 4d01c48c0..000000000 --- a/.github/workflows/build-test-macos-core-consensus.yml +++ /dev/null @@ -1,93 +0,0 @@ -name: MacOS core-consensus Tests - -on: - push: - branches: - - main - tags: - - '**' - pull_request: - branches: - - '**' - -jobs: - build: - name: MacOS core-consensus Tests - runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: [3.8, 3.9] - os: [macOS-latest] - - steps: - - name: Cancel previous runs on the same branch - if: ${{ github.ref != 'refs/heads/main' }} - uses: styfle/cancel-workflow-action@0.9.0 - with: - access_token: ${{ github.token }} - - - name: Checkout Code - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v2.1.5 - with: - # Note that new runners may break this https://github.com/actions/cache/issues/292 - path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: Checkout test blocks and plots - uses: actions/checkout@v2 - with: - repository: 'Chia-Network/test-cache' - path: '.chia' - ref: '0.26.0' - fetch-depth: 1 - - - name: Link home directory - run: | - cd $HOME - ln -s $GITHUB_WORKSPACE/.chia - echo "$HOME/.chia" - ls -al $HOME/.chia - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - BUILD_VDF_CLIENT: "N" - run: | - brew install boost - sh install.sh - - - name: Install timelord - run: | - . ./activate - sh install-timelord.sh - ./vdf_bench square_asm 400000 - - - name: Install developer requirements - run: | - . ./activate - venv/bin/python -m pip install pytest pytest-asyncio pytest-xdist - - - name: Test core-consensus code with pytest - run: | - . ./activate - ./venv/bin/py.test tests/core/consensus/test_pot_iterations.py -s -v --durations 0 diff --git a/.github/workflows/build-test-macos-core-full_node-full_sync.yml b/.github/workflows/build-test-macos-core-full_node-full_sync.yml deleted file mode 100644 index 7fc3ca2aa..000000000 --- a/.github/workflows/build-test-macos-core-full_node-full_sync.yml +++ /dev/null @@ -1,93 +0,0 @@ -name: MacOS core-full_node-full_sync Tests - -on: - push: - branches: - - main - tags: - - '**' - pull_request: - branches: - - '**' - -jobs: - build: - name: MacOS core-full_node-full_sync Tests - runs-on: ${{ matrix.os }} - timeout-minutes: 60 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: [3.8, 3.9] - os: [macOS-latest] - - steps: - - name: Cancel previous runs on the same branch - if: ${{ github.ref != 'refs/heads/main' }} - uses: styfle/cancel-workflow-action@0.9.0 - with: - access_token: ${{ github.token }} - - - name: Checkout Code - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v2.1.5 - with: - # Note that new runners may break this https://github.com/actions/cache/issues/292 - path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: Checkout test blocks and plots - uses: actions/checkout@v2 - with: - repository: 'Chia-Network/test-cache' - path: '.chia' - ref: '0.26.0' - fetch-depth: 1 - - - name: Link home directory - run: | - cd $HOME - ln -s $GITHUB_WORKSPACE/.chia - echo "$HOME/.chia" - ls -al $HOME/.chia - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - BUILD_VDF_CLIENT: "N" - run: | - brew install boost - sh install.sh - - - name: Install timelord - run: | - . ./activate - sh install-timelord.sh - ./vdf_bench square_asm 400000 - - - name: Install developer requirements - run: | - . ./activate - venv/bin/python -m pip install pytest pytest-asyncio pytest-xdist - - - name: Test core-full_node-full_sync code with pytest - run: | - . ./activate - ./venv/bin/py.test tests/core/full_node/full_sync/test_full_sync.py -s -v --durations 0 diff --git a/.github/workflows/build-test-macos-core-full_node.yml b/.github/workflows/build-test-macos-core-full_node.yml deleted file mode 100644 index ec558be8e..000000000 --- a/.github/workflows/build-test-macos-core-full_node.yml +++ /dev/null @@ -1,93 +0,0 @@ -name: MacOS core-full_node Tests - -on: - push: - branches: - - main - tags: - - '**' - pull_request: - branches: - - '**' - -jobs: - build: - name: MacOS core-full_node Tests - runs-on: ${{ matrix.os }} - timeout-minutes: 60 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: [3.8, 3.9] - os: [macOS-latest] - - steps: - - name: Cancel previous runs on the same branch - if: ${{ github.ref != 'refs/heads/main' }} - uses: styfle/cancel-workflow-action@0.9.0 - with: - access_token: ${{ github.token }} - - - name: Checkout Code - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v2.1.5 - with: - # Note that new runners may break this https://github.com/actions/cache/issues/292 - path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: Checkout test blocks and plots - uses: actions/checkout@v2 - with: - repository: 'Chia-Network/test-cache' - path: '.chia' - ref: '0.26.0' - fetch-depth: 1 - - - name: Link home directory - run: | - cd $HOME - ln -s $GITHUB_WORKSPACE/.chia - echo "$HOME/.chia" - ls -al $HOME/.chia - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - BUILD_VDF_CLIENT: "N" - run: | - brew install boost - sh install.sh - - - name: Install timelord - run: | - . ./activate - sh install-timelord.sh - ./vdf_bench square_asm 400000 - - - name: Install developer requirements - run: | - . ./activate - venv/bin/python -m pip install pytest pytest-asyncio pytest-xdist - - - name: Test core-full_node code with pytest - run: | - . ./activate - ./venv/bin/py.test tests/core/full_node/test_address_manager.py tests/core/full_node/test_block_store.py tests/core/full_node/test_coin_store.py tests/core/full_node/test_full_node.py tests/core/full_node/test_full_node_store.py tests/core/full_node/test_initial_freeze.py tests/core/full_node/test_mempool.py tests/core/full_node/test_mempool_performance.py tests/core/full_node/test_node_load.py tests/core/full_node/test_sync_store.py tests/core/full_node/test_transactions.py -s -v --durations 0 diff --git a/.github/workflows/build-test-macos-core-server.yml b/.github/workflows/build-test-macos-core-server.yml deleted file mode 100644 index e0c8bb1f2..000000000 --- a/.github/workflows/build-test-macos-core-server.yml +++ /dev/null @@ -1,93 +0,0 @@ -name: MacOS core-server Tests - -on: - push: - branches: - - main - tags: - - '**' - pull_request: - branches: - - '**' - -jobs: - build: - name: MacOS core-server Tests - runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: [3.8, 3.9] - os: [macOS-latest] - - steps: - - name: Cancel previous runs on the same branch - if: ${{ github.ref != 'refs/heads/main' }} - uses: styfle/cancel-workflow-action@0.9.0 - with: - access_token: ${{ github.token }} - - - name: Checkout Code - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v2.1.5 - with: - # Note that new runners may break this https://github.com/actions/cache/issues/292 - path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: Checkout test blocks and plots - uses: actions/checkout@v2 - with: - repository: 'Chia-Network/test-cache' - path: '.chia' - ref: '0.26.0' - fetch-depth: 1 - - - name: Link home directory - run: | - cd $HOME - ln -s $GITHUB_WORKSPACE/.chia - echo "$HOME/.chia" - ls -al $HOME/.chia - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - BUILD_VDF_CLIENT: "N" - run: | - brew install boost - sh install.sh - - - name: Install timelord - run: | - . ./activate - sh install-timelord.sh - ./vdf_bench square_asm 400000 - - - name: Install developer requirements - run: | - . ./activate - venv/bin/python -m pip install pytest pytest-asyncio pytest-xdist - - - name: Test core-server code with pytest - run: | - . ./activate - ./venv/bin/py.test tests/core/server/test_dos.py tests/core/server/test_rate_limits.py -s -v --durations 0 diff --git a/.github/workflows/build-test-macos-core-ssl.yml b/.github/workflows/build-test-macos-core-ssl.yml deleted file mode 100644 index 934768fbb..000000000 --- a/.github/workflows/build-test-macos-core-ssl.yml +++ /dev/null @@ -1,93 +0,0 @@ -name: MacOS core-ssl Tests - -on: - push: - branches: - - main - tags: - - '**' - pull_request: - branches: - - '**' - -jobs: - build: - name: MacOS core-ssl Tests - runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: [3.8, 3.9] - os: [macOS-latest] - - steps: - - name: Cancel previous runs on the same branch - if: ${{ github.ref != 'refs/heads/main' }} - uses: styfle/cancel-workflow-action@0.9.0 - with: - access_token: ${{ github.token }} - - - name: Checkout Code - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v2.1.5 - with: - # Note that new runners may break this https://github.com/actions/cache/issues/292 - path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: Checkout test blocks and plots - uses: actions/checkout@v2 - with: - repository: 'Chia-Network/test-cache' - path: '.chia' - ref: '0.26.0' - fetch-depth: 1 - - - name: Link home directory - run: | - cd $HOME - ln -s $GITHUB_WORKSPACE/.chia - echo "$HOME/.chia" - ls -al $HOME/.chia - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - BUILD_VDF_CLIENT: "N" - run: | - brew install boost - sh install.sh - - - name: Install timelord - run: | - . ./activate - sh install-timelord.sh - ./vdf_bench square_asm 400000 - - - name: Install developer requirements - run: | - . ./activate - venv/bin/python -m pip install pytest pytest-asyncio pytest-xdist - - - name: Test core-ssl code with pytest - run: | - . ./activate - ./venv/bin/py.test tests/core/ssl/test_ssl.py -s -v --durations 0 diff --git a/.github/workflows/build-test-macos-core-types.yml b/.github/workflows/build-test-macos-core-types.yml deleted file mode 100644 index 3d9a50a73..000000000 --- a/.github/workflows/build-test-macos-core-types.yml +++ /dev/null @@ -1,93 +0,0 @@ -name: MacOS core-types Tests - -on: - push: - branches: - - main - tags: - - '**' - pull_request: - branches: - - '**' - -jobs: - build: - name: MacOS core-types Tests - runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: [3.8, 3.9] - os: [macOS-latest] - - steps: - - name: Cancel previous runs on the same branch - if: ${{ github.ref != 'refs/heads/main' }} - uses: styfle/cancel-workflow-action@0.9.0 - with: - access_token: ${{ github.token }} - - - name: Checkout Code - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v2.1.5 - with: - # Note that new runners may break this https://github.com/actions/cache/issues/292 - path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: Checkout test blocks and plots - uses: actions/checkout@v2 - with: - repository: 'Chia-Network/test-cache' - path: '.chia' - ref: '0.26.0' - fetch-depth: 1 - - - name: Link home directory - run: | - cd $HOME - ln -s $GITHUB_WORKSPACE/.chia - echo "$HOME/.chia" - ls -al $HOME/.chia - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - BUILD_VDF_CLIENT: "N" - run: | - brew install boost - sh install.sh - - - name: Install timelord - run: | - . ./activate - sh install-timelord.sh - ./vdf_bench square_asm 400000 - - - name: Install developer requirements - run: | - . ./activate - venv/bin/python -m pip install pytest pytest-asyncio pytest-xdist - - - name: Test core-types code with pytest - run: | - . ./activate - ./venv/bin/py.test tests/core/types/test_proof_of_space.py -s -v --durations 0 diff --git a/.github/workflows/build-test-macos-core-util.yml b/.github/workflows/build-test-macos-core-util.yml deleted file mode 100644 index ae5e2a4ab..000000000 --- a/.github/workflows/build-test-macos-core-util.yml +++ /dev/null @@ -1,93 +0,0 @@ -name: MacOS core-util Tests - -on: - push: - branches: - - main - tags: - - '**' - pull_request: - branches: - - '**' - -jobs: - build: - name: MacOS core-util Tests - runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: [3.8, 3.9] - os: [macOS-latest] - - steps: - - name: Cancel previous runs on the same branch - if: ${{ github.ref != 'refs/heads/main' }} - uses: styfle/cancel-workflow-action@0.9.0 - with: - access_token: ${{ github.token }} - - - name: Checkout Code - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v2.1.5 - with: - # Note that new runners may break this https://github.com/actions/cache/issues/292 - path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: Checkout test blocks and plots - uses: actions/checkout@v2 - with: - repository: 'Chia-Network/test-cache' - path: '.chia' - ref: '0.26.0' - fetch-depth: 1 - - - name: Link home directory - run: | - cd $HOME - ln -s $GITHUB_WORKSPACE/.chia - echo "$HOME/.chia" - ls -al $HOME/.chia - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - BUILD_VDF_CLIENT: "N" - run: | - brew install boost - sh install.sh - - - name: Install timelord - run: | - . ./activate - sh install-timelord.sh - ./vdf_bench square_asm 400000 - - - name: Install developer requirements - run: | - . ./activate - venv/bin/python -m pip install pytest pytest-asyncio pytest-xdist - - - name: Test core-util code with pytest - run: | - . ./activate - ./venv/bin/py.test tests/core/util/test_keychain.py tests/core/util/test_significant_bits.py tests/core/util/test_streamable.py tests/core/util/test_type_checking.py -s -v --durations 0 diff --git a/.github/workflows/build-test-macos-core.yml b/.github/workflows/build-test-macos-core.yml deleted file mode 100644 index e1aaba367..000000000 --- a/.github/workflows/build-test-macos-core.yml +++ /dev/null @@ -1,93 +0,0 @@ -name: MacOS core Tests - -on: - push: - branches: - - main - tags: - - '**' - pull_request: - branches: - - '**' - -jobs: - build: - name: MacOS core Tests - runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: [3.8, 3.9] - os: [macOS-latest] - - steps: - - name: Cancel previous runs on the same branch - if: ${{ github.ref != 'refs/heads/main' }} - uses: styfle/cancel-workflow-action@0.9.0 - with: - access_token: ${{ github.token }} - - - name: Checkout Code - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v2.1.5 - with: - # Note that new runners may break this https://github.com/actions/cache/issues/292 - path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: Checkout test blocks and plots - uses: actions/checkout@v2 - with: - repository: 'Chia-Network/test-cache' - path: '.chia' - ref: '0.26.0' - fetch-depth: 1 - - - name: Link home directory - run: | - cd $HOME - ln -s $GITHUB_WORKSPACE/.chia - echo "$HOME/.chia" - ls -al $HOME/.chia - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - BUILD_VDF_CLIENT: "N" - run: | - brew install boost - sh install.sh - - - name: Install timelord - run: | - . ./activate - sh install-timelord.sh - ./vdf_bench square_asm 400000 - - - name: Install developer requirements - run: | - . ./activate - venv/bin/python -m pip install pytest pytest-asyncio pytest-xdist - - - name: Test core code with pytest - run: | - . ./activate - ./venv/bin/py.test tests/core/test_cost_calculation.py tests/core/test_farmer_harvester_rpc.py tests/core/test_filter.py tests/core/test_full_node_rpc.py tests/core/test_merkle_set.py tests/core/test_setproctitle.py -s -v --durations 0 diff --git a/.github/workflows/build-test-macos-generator.yml b/.github/workflows/build-test-macos-generator.yml deleted file mode 100644 index 0a5722f9e..000000000 --- a/.github/workflows/build-test-macos-generator.yml +++ /dev/null @@ -1,93 +0,0 @@ -name: MacOS generator Tests - -on: - push: - branches: - - main - tags: - - '**' - pull_request: - branches: - - '**' - -jobs: - build: - name: MacOS generator Tests - runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: [3.8, 3.9] - os: [macOS-latest] - - steps: - - name: Cancel previous runs on the same branch - if: ${{ github.ref != 'refs/heads/main' }} - uses: styfle/cancel-workflow-action@0.9.0 - with: - access_token: ${{ github.token }} - - - name: Checkout Code - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v2.1.5 - with: - # Note that new runners may break this https://github.com/actions/cache/issues/292 - path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: Checkout test blocks and plots - uses: actions/checkout@v2 - with: - repository: 'Chia-Network/test-cache' - path: '.chia' - ref: '0.26.0' - fetch-depth: 1 - - - name: Link home directory - run: | - cd $HOME - ln -s $GITHUB_WORKSPACE/.chia - echo "$HOME/.chia" - ls -al $HOME/.chia - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - BUILD_VDF_CLIENT: "N" - run: | - brew install boost - sh install.sh - - - name: Install timelord - run: | - . ./activate - sh install-timelord.sh - ./vdf_bench square_asm 400000 - - - name: Install developer requirements - run: | - . ./activate - venv/bin/python -m pip install pytest pytest-asyncio pytest-xdist - - - name: Test generator code with pytest - run: | - . ./activate - ./venv/bin/py.test tests/generator/test_compression.py tests/generator/test_generator_types.py tests/generator/test_scan.py -s -v --durations 0 diff --git a/.github/workflows/build-test-macos-simulation.yml b/.github/workflows/build-test-macos-simulation.yml deleted file mode 100644 index fd0976d9e..000000000 --- a/.github/workflows/build-test-macos-simulation.yml +++ /dev/null @@ -1,93 +0,0 @@ -name: MacOS simulation Tests - -on: - push: - branches: - - main - tags: - - '**' - pull_request: - branches: - - '**' - -jobs: - build: - name: MacOS simulation Tests - runs-on: ${{ matrix.os }} - timeout-minutes: 60 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: [3.8, 3.9] - os: [macOS-latest] - - steps: - - name: Cancel previous runs on the same branch - if: ${{ github.ref != 'refs/heads/main' }} - uses: styfle/cancel-workflow-action@0.9.0 - with: - access_token: ${{ github.token }} - - - name: Checkout Code - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v2.1.5 - with: - # Note that new runners may break this https://github.com/actions/cache/issues/292 - path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: Checkout test blocks and plots - uses: actions/checkout@v2 - with: - repository: 'Chia-Network/test-cache' - path: '.chia' - ref: '0.26.0' - fetch-depth: 1 - - - name: Link home directory - run: | - cd $HOME - ln -s $GITHUB_WORKSPACE/.chia - echo "$HOME/.chia" - ls -al $HOME/.chia - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - BUILD_VDF_CLIENT: "N" - run: | - brew install boost - sh install.sh - - - name: Install timelord - run: | - . ./activate - sh install-timelord.sh - ./vdf_bench square_asm 400000 - - - name: Install developer requirements - run: | - . ./activate - venv/bin/python -m pip install pytest pytest-asyncio pytest-xdist - - - name: Test simulation code with pytest - run: | - . ./activate - ./venv/bin/py.test tests/simulation/test_simulation.py -s -v --durations 0 diff --git a/.github/workflows/build-test-macos-wallet-cc_wallet.yml b/.github/workflows/build-test-macos-wallet-cc_wallet.yml deleted file mode 100644 index 0357a82a6..000000000 --- a/.github/workflows/build-test-macos-wallet-cc_wallet.yml +++ /dev/null @@ -1,93 +0,0 @@ -name: MacOS wallet-cc_wallet Tests - -on: - push: - branches: - - main - tags: - - '**' - pull_request: - branches: - - '**' - -jobs: - build: - name: MacOS wallet-cc_wallet Tests - runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: [3.8, 3.9] - os: [macOS-latest] - - steps: - - name: Cancel previous runs on the same branch - if: ${{ github.ref != 'refs/heads/main' }} - uses: styfle/cancel-workflow-action@0.9.0 - with: - access_token: ${{ github.token }} - - - name: Checkout Code - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v2.1.5 - with: - # Note that new runners may break this https://github.com/actions/cache/issues/292 - path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: Checkout test blocks and plots - uses: actions/checkout@v2 - with: - repository: 'Chia-Network/test-cache' - path: '.chia' - ref: '0.26.0' - fetch-depth: 1 - - - name: Link home directory - run: | - cd $HOME - ln -s $GITHUB_WORKSPACE/.chia - echo "$HOME/.chia" - ls -al $HOME/.chia - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - BUILD_VDF_CLIENT: "N" - run: | - brew install boost - sh install.sh - - - name: Install timelord - run: | - . ./activate - sh install-timelord.sh - ./vdf_bench square_asm 400000 - - - name: Install developer requirements - run: | - . ./activate - venv/bin/python -m pip install pytest pytest-asyncio pytest-xdist - - - name: Test wallet-cc_wallet code with pytest - run: | - . ./activate - ./venv/bin/py.test tests/wallet/cc_wallet/test_cc_wallet.py tests/wallet/cc_wallet/test_trades.py -s -v --durations 0 diff --git a/.github/workflows/build-test-macos-wallet-rl_wallet.yml b/.github/workflows/build-test-macos-wallet-rl_wallet.yml deleted file mode 100644 index 162bd6e51..000000000 --- a/.github/workflows/build-test-macos-wallet-rl_wallet.yml +++ /dev/null @@ -1,93 +0,0 @@ -name: MacOS wallet-rl_wallet Tests - -on: - push: - branches: - - main - tags: - - '**' - pull_request: - branches: - - '**' - -jobs: - build: - name: MacOS wallet-rl_wallet Tests - runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: [3.8, 3.9] - os: [macOS-latest] - - steps: - - name: Cancel previous runs on the same branch - if: ${{ github.ref != 'refs/heads/main' }} - uses: styfle/cancel-workflow-action@0.9.0 - with: - access_token: ${{ github.token }} - - - name: Checkout Code - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v2.1.5 - with: - # Note that new runners may break this https://github.com/actions/cache/issues/292 - path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: Checkout test blocks and plots - uses: actions/checkout@v2 - with: - repository: 'Chia-Network/test-cache' - path: '.chia' - ref: '0.26.0' - fetch-depth: 1 - - - name: Link home directory - run: | - cd $HOME - ln -s $GITHUB_WORKSPACE/.chia - echo "$HOME/.chia" - ls -al $HOME/.chia - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - BUILD_VDF_CLIENT: "N" - run: | - brew install boost - sh install.sh - - - name: Install timelord - run: | - . ./activate - sh install-timelord.sh - ./vdf_bench square_asm 400000 - - - name: Install developer requirements - run: | - . ./activate - venv/bin/python -m pip install pytest pytest-asyncio pytest-xdist - - - name: Test wallet-rl_wallet code with pytest - run: | - . ./activate - ./venv/bin/py.test tests/wallet/rl_wallet/test_rl_rpc.py tests/wallet/rl_wallet/test_rl_wallet.py -s -v --durations 0 diff --git a/.github/workflows/build-test-macos-wallet-rpc.yml b/.github/workflows/build-test-macos-wallet-rpc.yml deleted file mode 100644 index 0efec688d..000000000 --- a/.github/workflows/build-test-macos-wallet-rpc.yml +++ /dev/null @@ -1,93 +0,0 @@ -name: MacOS wallet-rpc Tests - -on: - push: - branches: - - main - tags: - - '**' - pull_request: - branches: - - '**' - -jobs: - build: - name: MacOS wallet-rpc Tests - runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: [3.8, 3.9] - os: [macOS-latest] - - steps: - - name: Cancel previous runs on the same branch - if: ${{ github.ref != 'refs/heads/main' }} - uses: styfle/cancel-workflow-action@0.9.0 - with: - access_token: ${{ github.token }} - - - name: Checkout Code - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v2.1.5 - with: - # Note that new runners may break this https://github.com/actions/cache/issues/292 - path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: Checkout test blocks and plots - uses: actions/checkout@v2 - with: - repository: 'Chia-Network/test-cache' - path: '.chia' - ref: '0.26.0' - fetch-depth: 1 - - - name: Link home directory - run: | - cd $HOME - ln -s $GITHUB_WORKSPACE/.chia - echo "$HOME/.chia" - ls -al $HOME/.chia - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - BUILD_VDF_CLIENT: "N" - run: | - brew install boost - sh install.sh - - - name: Install timelord - run: | - . ./activate - sh install-timelord.sh - ./vdf_bench square_asm 400000 - - - name: Install developer requirements - run: | - . ./activate - venv/bin/python -m pip install pytest pytest-asyncio pytest-xdist - - - name: Test wallet-rpc code with pytest - run: | - . ./activate - ./venv/bin/py.test tests/wallet/rpc/test_wallet_rpc.py -s -v --durations 0 diff --git a/.github/workflows/build-test-macos-wallet-sync.yml b/.github/workflows/build-test-macos-wallet-sync.yml deleted file mode 100644 index 98a7b1d6d..000000000 --- a/.github/workflows/build-test-macos-wallet-sync.yml +++ /dev/null @@ -1,93 +0,0 @@ -name: MacOS wallet-sync Tests - -on: - push: - branches: - - main - tags: - - '**' - pull_request: - branches: - - '**' - -jobs: - build: - name: MacOS wallet-sync Tests - runs-on: ${{ matrix.os }} - timeout-minutes: 60 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: [3.8, 3.9] - os: [macOS-latest] - - steps: - - name: Cancel previous runs on the same branch - if: ${{ github.ref != 'refs/heads/main' }} - uses: styfle/cancel-workflow-action@0.9.0 - with: - access_token: ${{ github.token }} - - - name: Checkout Code - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v2.1.5 - with: - # Note that new runners may break this https://github.com/actions/cache/issues/292 - path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: Checkout test blocks and plots - uses: actions/checkout@v2 - with: - repository: 'Chia-Network/test-cache' - path: '.chia' - ref: '0.26.0' - fetch-depth: 1 - - - name: Link home directory - run: | - cd $HOME - ln -s $GITHUB_WORKSPACE/.chia - echo "$HOME/.chia" - ls -al $HOME/.chia - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - BUILD_VDF_CLIENT: "N" - run: | - brew install boost - sh install.sh - - - name: Install timelord - run: | - . ./activate - sh install-timelord.sh - ./vdf_bench square_asm 400000 - - - name: Install developer requirements - run: | - . ./activate - venv/bin/python -m pip install pytest pytest-asyncio pytest-xdist - - - name: Test wallet-sync code with pytest - run: | - . ./activate - ./venv/bin/py.test tests/wallet/sync/test_wallet_sync.py -s -v --durations 0 diff --git a/.github/workflows/build-test-macos-wallet.yml b/.github/workflows/build-test-macos-wallet.yml deleted file mode 100644 index c06b174bd..000000000 --- a/.github/workflows/build-test-macos-wallet.yml +++ /dev/null @@ -1,93 +0,0 @@ -name: MacOS wallet Tests - -on: - push: - branches: - - main - tags: - - '**' - pull_request: - branches: - - '**' - -jobs: - build: - name: MacOS wallet Tests - runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: [3.8, 3.9] - os: [macOS-latest] - - steps: - - name: Cancel previous runs on the same branch - if: ${{ github.ref != 'refs/heads/main' }} - uses: styfle/cancel-workflow-action@0.9.0 - with: - access_token: ${{ github.token }} - - - name: Checkout Code - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v2.1.5 - with: - # Note that new runners may break this https://github.com/actions/cache/issues/292 - path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: Checkout test blocks and plots - uses: actions/checkout@v2 - with: - repository: 'Chia-Network/test-cache' - path: '.chia' - ref: '0.26.0' - fetch-depth: 1 - - - name: Link home directory - run: | - cd $HOME - ln -s $GITHUB_WORKSPACE/.chia - echo "$HOME/.chia" - ls -al $HOME/.chia - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - BUILD_VDF_CLIENT: "N" - run: | - brew install boost - sh install.sh - - - name: Install timelord - run: | - . ./activate - sh install-timelord.sh - ./vdf_bench square_asm 400000 - - - name: Install developer requirements - run: | - . ./activate - venv/bin/python -m pip install pytest pytest-asyncio pytest-xdist - - - name: Test wallet code with pytest - run: | - . ./activate - ./venv/bin/py.test tests/wallet/test_backup.py tests/wallet/test_bech32m.py tests/wallet/test_chialisp.py tests/wallet/test_puzzle_store.py tests/wallet/test_singleton.py tests/wallet/test_taproot.py tests/wallet/test_wallet.py tests/wallet/test_wallet_store.py -s -v --durations 0 diff --git a/.github/workflows/build-test-ubuntu-blockchain.yml b/.github/workflows/build-test-ubuntu-blockchain.yml deleted file mode 100644 index 087607c19..000000000 --- a/.github/workflows/build-test-ubuntu-blockchain.yml +++ /dev/null @@ -1,105 +0,0 @@ -name: Ubuntu blockchain Test - -on: - push: - branches: - - main - tags: - - '**' - pull_request: - branches: - - '**' - -jobs: - build: - name: Ubuntu blockchain Test - runs-on: ${{ matrix.os }} - timeout-minutes: 60 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: [3.7, 3.8, 3.9] - os: [ubuntu-latest] - - steps: - - name: Cancel previous runs on the same branch - if: ${{ github.ref != 'refs/heads/main' }} - uses: styfle/cancel-workflow-action@0.9.0 - with: - access_token: ${{ github.token }} - - - name: Checkout Code - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Cache npm - uses: actions/cache@v2.1.5 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node- - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v2.1.5 - with: - path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: Checkout test blocks and plots - uses: actions/checkout@v2 - with: - repository: 'Chia-Network/test-cache' - path: '.chia' - ref: '0.26.0' - fetch-depth: 1 - - - name: Link home directory - run: | - cd $HOME - ln -s $GITHUB_WORKSPACE/.chia - echo "$HOME/.chia" - ls -al $HOME/.chia - - - name: Install ubuntu dependencies - run: | - sudo apt-get install software-properties-common - sudo add-apt-repository ppa:deadsnakes/ppa - sudo apt-get update - sudo apt-get install python${{ matrix.python-version }}-venv python${{ matrix.python-version }}-distutils git -y - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: | - sh install.sh - - - name: Install timelord - run: | - . ./activate - sh install-timelord.sh - ./vdf_bench square_asm 400000 - - - name: Install developer requirements - run: | - . ./activate - venv/bin/python -m pip install pytest pytest-asyncio pytest-xdist - - - name: Test blockchain code with pytest - run: | - . ./activate - ./venv/bin/py.test tests/blockchain/test_blockchain.py tests/blockchain/test_blockchain_transactions.py -s -v --durations 0 diff --git a/.github/workflows/build-test-ubuntu-clvm.yml b/.github/workflows/build-test-ubuntu-clvm.yml deleted file mode 100644 index fa78351f7..000000000 --- a/.github/workflows/build-test-ubuntu-clvm.yml +++ /dev/null @@ -1,95 +0,0 @@ -name: Ubuntu clvm Test - -on: - push: - branches: - - main - tags: - - '**' - pull_request: - branches: - - '**' - -jobs: - build: - name: Ubuntu clvm Test - runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: [3.7, 3.8, 3.9] - os: [ubuntu-latest] - - steps: - - name: Cancel previous runs on the same branch - if: ${{ github.ref != 'refs/heads/main' }} - uses: styfle/cancel-workflow-action@0.9.0 - with: - access_token: ${{ github.token }} - - - name: Checkout Code - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Cache npm - uses: actions/cache@v2.1.5 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node- - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v2.1.5 - with: - path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} - restore-keys: | - ${{ runner.os }}-pip- - -# Omitted checking out blocks and plots repo Chia-Network/test-cache - - - name: Link home directory - run: | - cd $HOME - ln -s $GITHUB_WORKSPACE/.chia - echo "$HOME/.chia" - ls -al $HOME/.chia - - - name: Install ubuntu dependencies - run: | - sudo apt-get install software-properties-common - sudo add-apt-repository ppa:deadsnakes/ppa - sudo apt-get update - sudo apt-get install python${{ matrix.python-version }}-venv python${{ matrix.python-version }}-distutils git -y - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: | - sh install.sh - -# Omitted installing Timelord - - - name: Install developer requirements - run: | - . ./activate - venv/bin/python -m pip install pytest pytest-asyncio pytest-xdist - - - name: Test clvm code with pytest - run: | - . ./activate - ./venv/bin/py.test tests/clvm/test_chialisp_deserialization.py tests/clvm/test_clvm_compilation.py tests/clvm/test_puzzles.py tests/clvm/test_serialized_program.py -s -v --durations 0 -n auto diff --git a/.github/workflows/build-test-ubuntu-core-consensus.yml b/.github/workflows/build-test-ubuntu-core-consensus.yml deleted file mode 100644 index 117acd248..000000000 --- a/.github/workflows/build-test-ubuntu-core-consensus.yml +++ /dev/null @@ -1,105 +0,0 @@ -name: Ubuntu core-consensus Test - -on: - push: - branches: - - main - tags: - - '**' - pull_request: - branches: - - '**' - -jobs: - build: - name: Ubuntu core-consensus Test - runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: [3.7, 3.8, 3.9] - os: [ubuntu-latest] - - steps: - - name: Cancel previous runs on the same branch - if: ${{ github.ref != 'refs/heads/main' }} - uses: styfle/cancel-workflow-action@0.9.0 - with: - access_token: ${{ github.token }} - - - name: Checkout Code - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Cache npm - uses: actions/cache@v2.1.5 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node- - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v2.1.5 - with: - path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: Checkout test blocks and plots - uses: actions/checkout@v2 - with: - repository: 'Chia-Network/test-cache' - path: '.chia' - ref: '0.26.0' - fetch-depth: 1 - - - name: Link home directory - run: | - cd $HOME - ln -s $GITHUB_WORKSPACE/.chia - echo "$HOME/.chia" - ls -al $HOME/.chia - - - name: Install ubuntu dependencies - run: | - sudo apt-get install software-properties-common - sudo add-apt-repository ppa:deadsnakes/ppa - sudo apt-get update - sudo apt-get install python${{ matrix.python-version }}-venv python${{ matrix.python-version }}-distutils git -y - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: | - sh install.sh - - - name: Install timelord - run: | - . ./activate - sh install-timelord.sh - ./vdf_bench square_asm 400000 - - - name: Install developer requirements - run: | - . ./activate - venv/bin/python -m pip install pytest pytest-asyncio pytest-xdist - - - name: Test core-consensus code with pytest - run: | - . ./activate - ./venv/bin/py.test tests/core/consensus/test_pot_iterations.py -s -v --durations 0 diff --git a/.github/workflows/build-test-ubuntu-core-full_node-full_sync.yml b/.github/workflows/build-test-ubuntu-core-full_node-full_sync.yml deleted file mode 100644 index 46253a543..000000000 --- a/.github/workflows/build-test-ubuntu-core-full_node-full_sync.yml +++ /dev/null @@ -1,105 +0,0 @@ -name: Ubuntu core-full_node-full_sync Test - -on: - push: - branches: - - main - tags: - - '**' - pull_request: - branches: - - '**' - -jobs: - build: - name: Ubuntu core-full_node-full_sync Test - runs-on: ${{ matrix.os }} - timeout-minutes: 60 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: [3.7, 3.8, 3.9] - os: [ubuntu-latest] - - steps: - - name: Cancel previous runs on the same branch - if: ${{ github.ref != 'refs/heads/main' }} - uses: styfle/cancel-workflow-action@0.9.0 - with: - access_token: ${{ github.token }} - - - name: Checkout Code - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Cache npm - uses: actions/cache@v2.1.5 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node- - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v2.1.5 - with: - path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: Checkout test blocks and plots - uses: actions/checkout@v2 - with: - repository: 'Chia-Network/test-cache' - path: '.chia' - ref: '0.26.0' - fetch-depth: 1 - - - name: Link home directory - run: | - cd $HOME - ln -s $GITHUB_WORKSPACE/.chia - echo "$HOME/.chia" - ls -al $HOME/.chia - - - name: Install ubuntu dependencies - run: | - sudo apt-get install software-properties-common - sudo add-apt-repository ppa:deadsnakes/ppa - sudo apt-get update - sudo apt-get install python${{ matrix.python-version }}-venv python${{ matrix.python-version }}-distutils git -y - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: | - sh install.sh - - - name: Install timelord - run: | - . ./activate - sh install-timelord.sh - ./vdf_bench square_asm 400000 - - - name: Install developer requirements - run: | - . ./activate - venv/bin/python -m pip install pytest pytest-asyncio pytest-xdist - - - name: Test core-full_node-full_sync code with pytest - run: | - . ./activate - ./venv/bin/py.test tests/core/full_node/full_sync/test_full_sync.py -s -v --durations 0 diff --git a/.github/workflows/build-test-ubuntu-core-full_node.yml b/.github/workflows/build-test-ubuntu-core-full_node.yml deleted file mode 100644 index 2af84277d..000000000 --- a/.github/workflows/build-test-ubuntu-core-full_node.yml +++ /dev/null @@ -1,105 +0,0 @@ -name: Ubuntu core-full_node Test - -on: - push: - branches: - - main - tags: - - '**' - pull_request: - branches: - - '**' - -jobs: - build: - name: Ubuntu core-full_node Test - runs-on: ${{ matrix.os }} - timeout-minutes: 60 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: [3.7, 3.8, 3.9] - os: [ubuntu-latest] - - steps: - - name: Cancel previous runs on the same branch - if: ${{ github.ref != 'refs/heads/main' }} - uses: styfle/cancel-workflow-action@0.9.0 - with: - access_token: ${{ github.token }} - - - name: Checkout Code - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Cache npm - uses: actions/cache@v2.1.5 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node- - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v2.1.5 - with: - path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: Checkout test blocks and plots - uses: actions/checkout@v2 - with: - repository: 'Chia-Network/test-cache' - path: '.chia' - ref: '0.26.0' - fetch-depth: 1 - - - name: Link home directory - run: | - cd $HOME - ln -s $GITHUB_WORKSPACE/.chia - echo "$HOME/.chia" - ls -al $HOME/.chia - - - name: Install ubuntu dependencies - run: | - sudo apt-get install software-properties-common - sudo add-apt-repository ppa:deadsnakes/ppa - sudo apt-get update - sudo apt-get install python${{ matrix.python-version }}-venv python${{ matrix.python-version }}-distutils git -y - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: | - sh install.sh - - - name: Install timelord - run: | - . ./activate - sh install-timelord.sh - ./vdf_bench square_asm 400000 - - - name: Install developer requirements - run: | - . ./activate - venv/bin/python -m pip install pytest pytest-asyncio pytest-xdist - - - name: Test core-full_node code with pytest - run: | - . ./activate - ./venv/bin/py.test tests/core/full_node/test_address_manager.py tests/core/full_node/test_block_store.py tests/core/full_node/test_coin_store.py tests/core/full_node/test_full_node.py tests/core/full_node/test_full_node_store.py tests/core/full_node/test_initial_freeze.py tests/core/full_node/test_mempool.py tests/core/full_node/test_mempool_performance.py tests/core/full_node/test_node_load.py tests/core/full_node/test_sync_store.py tests/core/full_node/test_transactions.py -s -v --durations 0 diff --git a/.github/workflows/build-test-ubuntu-core-server.yml b/.github/workflows/build-test-ubuntu-core-server.yml deleted file mode 100644 index a5c349618..000000000 --- a/.github/workflows/build-test-ubuntu-core-server.yml +++ /dev/null @@ -1,105 +0,0 @@ -name: Ubuntu core-server Test - -on: - push: - branches: - - main - tags: - - '**' - pull_request: - branches: - - '**' - -jobs: - build: - name: Ubuntu core-server Test - runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: [3.7, 3.8, 3.9] - os: [ubuntu-latest] - - steps: - - name: Cancel previous runs on the same branch - if: ${{ github.ref != 'refs/heads/main' }} - uses: styfle/cancel-workflow-action@0.9.0 - with: - access_token: ${{ github.token }} - - - name: Checkout Code - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Cache npm - uses: actions/cache@v2.1.5 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node- - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v2.1.5 - with: - path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: Checkout test blocks and plots - uses: actions/checkout@v2 - with: - repository: 'Chia-Network/test-cache' - path: '.chia' - ref: '0.26.0' - fetch-depth: 1 - - - name: Link home directory - run: | - cd $HOME - ln -s $GITHUB_WORKSPACE/.chia - echo "$HOME/.chia" - ls -al $HOME/.chia - - - name: Install ubuntu dependencies - run: | - sudo apt-get install software-properties-common - sudo add-apt-repository ppa:deadsnakes/ppa - sudo apt-get update - sudo apt-get install python${{ matrix.python-version }}-venv python${{ matrix.python-version }}-distutils git -y - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: | - sh install.sh - - - name: Install timelord - run: | - . ./activate - sh install-timelord.sh - ./vdf_bench square_asm 400000 - - - name: Install developer requirements - run: | - . ./activate - venv/bin/python -m pip install pytest pytest-asyncio pytest-xdist - - - name: Test core-server code with pytest - run: | - . ./activate - ./venv/bin/py.test tests/core/server/test_dos.py tests/core/server/test_rate_limits.py -s -v --durations 0 diff --git a/.github/workflows/build-test-ubuntu-core-ssl.yml b/.github/workflows/build-test-ubuntu-core-ssl.yml deleted file mode 100644 index f2aa98777..000000000 --- a/.github/workflows/build-test-ubuntu-core-ssl.yml +++ /dev/null @@ -1,105 +0,0 @@ -name: Ubuntu core-ssl Test - -on: - push: - branches: - - main - tags: - - '**' - pull_request: - branches: - - '**' - -jobs: - build: - name: Ubuntu core-ssl Test - runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: [3.7, 3.8, 3.9] - os: [ubuntu-latest] - - steps: - - name: Cancel previous runs on the same branch - if: ${{ github.ref != 'refs/heads/main' }} - uses: styfle/cancel-workflow-action@0.9.0 - with: - access_token: ${{ github.token }} - - - name: Checkout Code - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Cache npm - uses: actions/cache@v2.1.5 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node- - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v2.1.5 - with: - path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: Checkout test blocks and plots - uses: actions/checkout@v2 - with: - repository: 'Chia-Network/test-cache' - path: '.chia' - ref: '0.26.0' - fetch-depth: 1 - - - name: Link home directory - run: | - cd $HOME - ln -s $GITHUB_WORKSPACE/.chia - echo "$HOME/.chia" - ls -al $HOME/.chia - - - name: Install ubuntu dependencies - run: | - sudo apt-get install software-properties-common - sudo add-apt-repository ppa:deadsnakes/ppa - sudo apt-get update - sudo apt-get install python${{ matrix.python-version }}-venv python${{ matrix.python-version }}-distutils git -y - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: | - sh install.sh - - - name: Install timelord - run: | - . ./activate - sh install-timelord.sh - ./vdf_bench square_asm 400000 - - - name: Install developer requirements - run: | - . ./activate - venv/bin/python -m pip install pytest pytest-asyncio pytest-xdist - - - name: Test core-ssl code with pytest - run: | - . ./activate - ./venv/bin/py.test tests/core/ssl/test_ssl.py -s -v --durations 0 diff --git a/.github/workflows/build-test-ubuntu-core-types.yml b/.github/workflows/build-test-ubuntu-core-types.yml deleted file mode 100644 index efd5b6465..000000000 --- a/.github/workflows/build-test-ubuntu-core-types.yml +++ /dev/null @@ -1,105 +0,0 @@ -name: Ubuntu core-types Test - -on: - push: - branches: - - main - tags: - - '**' - pull_request: - branches: - - '**' - -jobs: - build: - name: Ubuntu core-types Test - runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: [3.7, 3.8, 3.9] - os: [ubuntu-latest] - - steps: - - name: Cancel previous runs on the same branch - if: ${{ github.ref != 'refs/heads/main' }} - uses: styfle/cancel-workflow-action@0.9.0 - with: - access_token: ${{ github.token }} - - - name: Checkout Code - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Cache npm - uses: actions/cache@v2.1.5 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node- - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v2.1.5 - with: - path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: Checkout test blocks and plots - uses: actions/checkout@v2 - with: - repository: 'Chia-Network/test-cache' - path: '.chia' - ref: '0.26.0' - fetch-depth: 1 - - - name: Link home directory - run: | - cd $HOME - ln -s $GITHUB_WORKSPACE/.chia - echo "$HOME/.chia" - ls -al $HOME/.chia - - - name: Install ubuntu dependencies - run: | - sudo apt-get install software-properties-common - sudo add-apt-repository ppa:deadsnakes/ppa - sudo apt-get update - sudo apt-get install python${{ matrix.python-version }}-venv python${{ matrix.python-version }}-distutils git -y - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: | - sh install.sh - - - name: Install timelord - run: | - . ./activate - sh install-timelord.sh - ./vdf_bench square_asm 400000 - - - name: Install developer requirements - run: | - . ./activate - venv/bin/python -m pip install pytest pytest-asyncio pytest-xdist - - - name: Test core-types code with pytest - run: | - . ./activate - ./venv/bin/py.test tests/core/types/test_proof_of_space.py -s -v --durations 0 diff --git a/.github/workflows/build-test-ubuntu-core-util.yml b/.github/workflows/build-test-ubuntu-core-util.yml deleted file mode 100644 index 152961d4d..000000000 --- a/.github/workflows/build-test-ubuntu-core-util.yml +++ /dev/null @@ -1,105 +0,0 @@ -name: Ubuntu core-util Test - -on: - push: - branches: - - main - tags: - - '**' - pull_request: - branches: - - '**' - -jobs: - build: - name: Ubuntu core-util Test - runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: [3.7, 3.8, 3.9] - os: [ubuntu-latest] - - steps: - - name: Cancel previous runs on the same branch - if: ${{ github.ref != 'refs/heads/main' }} - uses: styfle/cancel-workflow-action@0.9.0 - with: - access_token: ${{ github.token }} - - - name: Checkout Code - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Cache npm - uses: actions/cache@v2.1.5 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node- - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v2.1.5 - with: - path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: Checkout test blocks and plots - uses: actions/checkout@v2 - with: - repository: 'Chia-Network/test-cache' - path: '.chia' - ref: '0.26.0' - fetch-depth: 1 - - - name: Link home directory - run: | - cd $HOME - ln -s $GITHUB_WORKSPACE/.chia - echo "$HOME/.chia" - ls -al $HOME/.chia - - - name: Install ubuntu dependencies - run: | - sudo apt-get install software-properties-common - sudo add-apt-repository ppa:deadsnakes/ppa - sudo apt-get update - sudo apt-get install python${{ matrix.python-version }}-venv python${{ matrix.python-version }}-distutils git -y - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: | - sh install.sh - - - name: Install timelord - run: | - . ./activate - sh install-timelord.sh - ./vdf_bench square_asm 400000 - - - name: Install developer requirements - run: | - . ./activate - venv/bin/python -m pip install pytest pytest-asyncio pytest-xdist - - - name: Test core-util code with pytest - run: | - . ./activate - ./venv/bin/py.test tests/core/util/test_keychain.py tests/core/util/test_significant_bits.py tests/core/util/test_streamable.py tests/core/util/test_type_checking.py -s -v --durations 0 diff --git a/.github/workflows/build-test-ubuntu-core.yml b/.github/workflows/build-test-ubuntu-core.yml deleted file mode 100644 index f90a8ef55..000000000 --- a/.github/workflows/build-test-ubuntu-core.yml +++ /dev/null @@ -1,105 +0,0 @@ -name: Ubuntu core Test - -on: - push: - branches: - - main - tags: - - '**' - pull_request: - branches: - - '**' - -jobs: - build: - name: Ubuntu core Test - runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: [3.7, 3.8, 3.9] - os: [ubuntu-latest] - - steps: - - name: Cancel previous runs on the same branch - if: ${{ github.ref != 'refs/heads/main' }} - uses: styfle/cancel-workflow-action@0.9.0 - with: - access_token: ${{ github.token }} - - - name: Checkout Code - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Cache npm - uses: actions/cache@v2.1.5 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node- - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v2.1.5 - with: - path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: Checkout test blocks and plots - uses: actions/checkout@v2 - with: - repository: 'Chia-Network/test-cache' - path: '.chia' - ref: '0.26.0' - fetch-depth: 1 - - - name: Link home directory - run: | - cd $HOME - ln -s $GITHUB_WORKSPACE/.chia - echo "$HOME/.chia" - ls -al $HOME/.chia - - - name: Install ubuntu dependencies - run: | - sudo apt-get install software-properties-common - sudo add-apt-repository ppa:deadsnakes/ppa - sudo apt-get update - sudo apt-get install python${{ matrix.python-version }}-venv python${{ matrix.python-version }}-distutils git -y - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: | - sh install.sh - - - name: Install timelord - run: | - . ./activate - sh install-timelord.sh - ./vdf_bench square_asm 400000 - - - name: Install developer requirements - run: | - . ./activate - venv/bin/python -m pip install pytest pytest-asyncio pytest-xdist - - - name: Test core code with pytest - run: | - . ./activate - ./venv/bin/py.test tests/core/test_cost_calculation.py tests/core/test_farmer_harvester_rpc.py tests/core/test_filter.py tests/core/test_full_node_rpc.py tests/core/test_merkle_set.py tests/core/test_setproctitle.py -s -v --durations 0 diff --git a/.github/workflows/build-test-ubuntu-generator.yml b/.github/workflows/build-test-ubuntu-generator.yml deleted file mode 100644 index 94bb76857..000000000 --- a/.github/workflows/build-test-ubuntu-generator.yml +++ /dev/null @@ -1,105 +0,0 @@ -name: Ubuntu generator Test - -on: - push: - branches: - - main - tags: - - '**' - pull_request: - branches: - - '**' - -jobs: - build: - name: Ubuntu generator Test - runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: [3.7, 3.8, 3.9] - os: [ubuntu-latest] - - steps: - - name: Cancel previous runs on the same branch - if: ${{ github.ref != 'refs/heads/main' }} - uses: styfle/cancel-workflow-action@0.9.0 - with: - access_token: ${{ github.token }} - - - name: Checkout Code - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Cache npm - uses: actions/cache@v2.1.5 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node- - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v2.1.5 - with: - path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: Checkout test blocks and plots - uses: actions/checkout@v2 - with: - repository: 'Chia-Network/test-cache' - path: '.chia' - ref: '0.26.0' - fetch-depth: 1 - - - name: Link home directory - run: | - cd $HOME - ln -s $GITHUB_WORKSPACE/.chia - echo "$HOME/.chia" - ls -al $HOME/.chia - - - name: Install ubuntu dependencies - run: | - sudo apt-get install software-properties-common - sudo add-apt-repository ppa:deadsnakes/ppa - sudo apt-get update - sudo apt-get install python${{ matrix.python-version }}-venv python${{ matrix.python-version }}-distutils git -y - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: | - sh install.sh - - - name: Install timelord - run: | - . ./activate - sh install-timelord.sh - ./vdf_bench square_asm 400000 - - - name: Install developer requirements - run: | - . ./activate - venv/bin/python -m pip install pytest pytest-asyncio pytest-xdist - - - name: Test generator code with pytest - run: | - . ./activate - ./venv/bin/py.test tests/generator/test_compression.py tests/generator/test_generator_types.py tests/generator/test_scan.py -s -v --durations 0 diff --git a/.github/workflows/build-test-ubuntu-simulation.yml b/.github/workflows/build-test-ubuntu-simulation.yml deleted file mode 100644 index e1221093b..000000000 --- a/.github/workflows/build-test-ubuntu-simulation.yml +++ /dev/null @@ -1,105 +0,0 @@ -name: Ubuntu simulation Test - -on: - push: - branches: - - main - tags: - - '**' - pull_request: - branches: - - '**' - -jobs: - build: - name: Ubuntu simulation Test - runs-on: ${{ matrix.os }} - timeout-minutes: 60 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: [3.7, 3.8, 3.9] - os: [ubuntu-latest] - - steps: - - name: Cancel previous runs on the same branch - if: ${{ github.ref != 'refs/heads/main' }} - uses: styfle/cancel-workflow-action@0.9.0 - with: - access_token: ${{ github.token }} - - - name: Checkout Code - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Cache npm - uses: actions/cache@v2.1.5 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node- - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v2.1.5 - with: - path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: Checkout test blocks and plots - uses: actions/checkout@v2 - with: - repository: 'Chia-Network/test-cache' - path: '.chia' - ref: '0.26.0' - fetch-depth: 1 - - - name: Link home directory - run: | - cd $HOME - ln -s $GITHUB_WORKSPACE/.chia - echo "$HOME/.chia" - ls -al $HOME/.chia - - - name: Install ubuntu dependencies - run: | - sudo apt-get install software-properties-common - sudo add-apt-repository ppa:deadsnakes/ppa - sudo apt-get update - sudo apt-get install python${{ matrix.python-version }}-venv python${{ matrix.python-version }}-distutils git -y - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: | - sh install.sh - - - name: Install timelord - run: | - . ./activate - sh install-timelord.sh - ./vdf_bench square_asm 400000 - - - name: Install developer requirements - run: | - . ./activate - venv/bin/python -m pip install pytest pytest-asyncio pytest-xdist - - - name: Test simulation code with pytest - run: | - . ./activate - ./venv/bin/py.test tests/simulation/test_simulation.py -s -v --durations 0 diff --git a/.github/workflows/build-test-ubuntu-wallet-cc_wallet.yml b/.github/workflows/build-test-ubuntu-wallet-cc_wallet.yml deleted file mode 100644 index 9cc56489c..000000000 --- a/.github/workflows/build-test-ubuntu-wallet-cc_wallet.yml +++ /dev/null @@ -1,105 +0,0 @@ -name: Ubuntu wallet-cc_wallet Test - -on: - push: - branches: - - main - tags: - - '**' - pull_request: - branches: - - '**' - -jobs: - build: - name: Ubuntu wallet-cc_wallet Test - runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: [3.7, 3.8, 3.9] - os: [ubuntu-latest] - - steps: - - name: Cancel previous runs on the same branch - if: ${{ github.ref != 'refs/heads/main' }} - uses: styfle/cancel-workflow-action@0.9.0 - with: - access_token: ${{ github.token }} - - - name: Checkout Code - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Cache npm - uses: actions/cache@v2.1.5 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node- - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v2.1.5 - with: - path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: Checkout test blocks and plots - uses: actions/checkout@v2 - with: - repository: 'Chia-Network/test-cache' - path: '.chia' - ref: '0.26.0' - fetch-depth: 1 - - - name: Link home directory - run: | - cd $HOME - ln -s $GITHUB_WORKSPACE/.chia - echo "$HOME/.chia" - ls -al $HOME/.chia - - - name: Install ubuntu dependencies - run: | - sudo apt-get install software-properties-common - sudo add-apt-repository ppa:deadsnakes/ppa - sudo apt-get update - sudo apt-get install python${{ matrix.python-version }}-venv python${{ matrix.python-version }}-distutils git -y - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: | - sh install.sh - - - name: Install timelord - run: | - . ./activate - sh install-timelord.sh - ./vdf_bench square_asm 400000 - - - name: Install developer requirements - run: | - . ./activate - venv/bin/python -m pip install pytest pytest-asyncio pytest-xdist - - - name: Test wallet-cc_wallet code with pytest - run: | - . ./activate - ./venv/bin/py.test tests/wallet/cc_wallet/test_cc_wallet.py tests/wallet/cc_wallet/test_trades.py -s -v --durations 0 diff --git a/.github/workflows/build-test-ubuntu-wallet-rl_wallet.yml b/.github/workflows/build-test-ubuntu-wallet-rl_wallet.yml deleted file mode 100644 index 2941487d1..000000000 --- a/.github/workflows/build-test-ubuntu-wallet-rl_wallet.yml +++ /dev/null @@ -1,105 +0,0 @@ -name: Ubuntu wallet-rl_wallet Test - -on: - push: - branches: - - main - tags: - - '**' - pull_request: - branches: - - '**' - -jobs: - build: - name: Ubuntu wallet-rl_wallet Test - runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: [3.7, 3.8, 3.9] - os: [ubuntu-latest] - - steps: - - name: Cancel previous runs on the same branch - if: ${{ github.ref != 'refs/heads/main' }} - uses: styfle/cancel-workflow-action@0.9.0 - with: - access_token: ${{ github.token }} - - - name: Checkout Code - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Cache npm - uses: actions/cache@v2.1.5 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node- - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v2.1.5 - with: - path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: Checkout test blocks and plots - uses: actions/checkout@v2 - with: - repository: 'Chia-Network/test-cache' - path: '.chia' - ref: '0.26.0' - fetch-depth: 1 - - - name: Link home directory - run: | - cd $HOME - ln -s $GITHUB_WORKSPACE/.chia - echo "$HOME/.chia" - ls -al $HOME/.chia - - - name: Install ubuntu dependencies - run: | - sudo apt-get install software-properties-common - sudo add-apt-repository ppa:deadsnakes/ppa - sudo apt-get update - sudo apt-get install python${{ matrix.python-version }}-venv python${{ matrix.python-version }}-distutils git -y - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: | - sh install.sh - - - name: Install timelord - run: | - . ./activate - sh install-timelord.sh - ./vdf_bench square_asm 400000 - - - name: Install developer requirements - run: | - . ./activate - venv/bin/python -m pip install pytest pytest-asyncio pytest-xdist - - - name: Test wallet-rl_wallet code with pytest - run: | - . ./activate - ./venv/bin/py.test tests/wallet/rl_wallet/test_rl_rpc.py tests/wallet/rl_wallet/test_rl_wallet.py -s -v --durations 0 diff --git a/.github/workflows/build-test-ubuntu-wallet-rpc.yml b/.github/workflows/build-test-ubuntu-wallet-rpc.yml deleted file mode 100644 index e05b02b38..000000000 --- a/.github/workflows/build-test-ubuntu-wallet-rpc.yml +++ /dev/null @@ -1,105 +0,0 @@ -name: Ubuntu wallet-rpc Test - -on: - push: - branches: - - main - tags: - - '**' - pull_request: - branches: - - '**' - -jobs: - build: - name: Ubuntu wallet-rpc Test - runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: [3.7, 3.8, 3.9] - os: [ubuntu-latest] - - steps: - - name: Cancel previous runs on the same branch - if: ${{ github.ref != 'refs/heads/main' }} - uses: styfle/cancel-workflow-action@0.9.0 - with: - access_token: ${{ github.token }} - - - name: Checkout Code - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Cache npm - uses: actions/cache@v2.1.5 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node- - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v2.1.5 - with: - path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: Checkout test blocks and plots - uses: actions/checkout@v2 - with: - repository: 'Chia-Network/test-cache' - path: '.chia' - ref: '0.26.0' - fetch-depth: 1 - - - name: Link home directory - run: | - cd $HOME - ln -s $GITHUB_WORKSPACE/.chia - echo "$HOME/.chia" - ls -al $HOME/.chia - - - name: Install ubuntu dependencies - run: | - sudo apt-get install software-properties-common - sudo add-apt-repository ppa:deadsnakes/ppa - sudo apt-get update - sudo apt-get install python${{ matrix.python-version }}-venv python${{ matrix.python-version }}-distutils git -y - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: | - sh install.sh - - - name: Install timelord - run: | - . ./activate - sh install-timelord.sh - ./vdf_bench square_asm 400000 - - - name: Install developer requirements - run: | - . ./activate - venv/bin/python -m pip install pytest pytest-asyncio pytest-xdist - - - name: Test wallet-rpc code with pytest - run: | - . ./activate - ./venv/bin/py.test tests/wallet/rpc/test_wallet_rpc.py -s -v --durations 0 diff --git a/.github/workflows/build-test-ubuntu-wallet-sync.yml b/.github/workflows/build-test-ubuntu-wallet-sync.yml deleted file mode 100644 index 61c37b328..000000000 --- a/.github/workflows/build-test-ubuntu-wallet-sync.yml +++ /dev/null @@ -1,105 +0,0 @@ -name: Ubuntu wallet-sync Test - -on: - push: - branches: - - main - tags: - - '**' - pull_request: - branches: - - '**' - -jobs: - build: - name: Ubuntu wallet-sync Test - runs-on: ${{ matrix.os }} - timeout-minutes: 60 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: [3.7, 3.8, 3.9] - os: [ubuntu-latest] - - steps: - - name: Cancel previous runs on the same branch - if: ${{ github.ref != 'refs/heads/main' }} - uses: styfle/cancel-workflow-action@0.9.0 - with: - access_token: ${{ github.token }} - - - name: Checkout Code - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Cache npm - uses: actions/cache@v2.1.5 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node- - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v2.1.5 - with: - path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: Checkout test blocks and plots - uses: actions/checkout@v2 - with: - repository: 'Chia-Network/test-cache' - path: '.chia' - ref: '0.26.0' - fetch-depth: 1 - - - name: Link home directory - run: | - cd $HOME - ln -s $GITHUB_WORKSPACE/.chia - echo "$HOME/.chia" - ls -al $HOME/.chia - - - name: Install ubuntu dependencies - run: | - sudo apt-get install software-properties-common - sudo add-apt-repository ppa:deadsnakes/ppa - sudo apt-get update - sudo apt-get install python${{ matrix.python-version }}-venv python${{ matrix.python-version }}-distutils git -y - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: | - sh install.sh - - - name: Install timelord - run: | - . ./activate - sh install-timelord.sh - ./vdf_bench square_asm 400000 - - - name: Install developer requirements - run: | - . ./activate - venv/bin/python -m pip install pytest pytest-asyncio pytest-xdist - - - name: Test wallet-sync code with pytest - run: | - . ./activate - ./venv/bin/py.test tests/wallet/sync/test_wallet_sync.py -s -v --durations 0 diff --git a/.github/workflows/build-test-ubuntu-wallet.yml b/.github/workflows/build-test-ubuntu-wallet.yml deleted file mode 100644 index bb530b91d..000000000 --- a/.github/workflows/build-test-ubuntu-wallet.yml +++ /dev/null @@ -1,105 +0,0 @@ -name: Ubuntu wallet Test - -on: - push: - branches: - - main - tags: - - '**' - pull_request: - branches: - - '**' - -jobs: - build: - name: Ubuntu wallet Test - runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: [3.7, 3.8, 3.9] - os: [ubuntu-latest] - - steps: - - name: Cancel previous runs on the same branch - if: ${{ github.ref != 'refs/heads/main' }} - uses: styfle/cancel-workflow-action@0.9.0 - with: - access_token: ${{ github.token }} - - - name: Checkout Code - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Cache npm - uses: actions/cache@v2.1.5 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node- - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v2.1.5 - with: - path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: Checkout test blocks and plots - uses: actions/checkout@v2 - with: - repository: 'Chia-Network/test-cache' - path: '.chia' - ref: '0.26.0' - fetch-depth: 1 - - - name: Link home directory - run: | - cd $HOME - ln -s $GITHUB_WORKSPACE/.chia - echo "$HOME/.chia" - ls -al $HOME/.chia - - - name: Install ubuntu dependencies - run: | - sudo apt-get install software-properties-common - sudo add-apt-repository ppa:deadsnakes/ppa - sudo apt-get update - sudo apt-get install python${{ matrix.python-version }}-venv python${{ matrix.python-version }}-distutils git -y - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: | - sh install.sh - - - name: Install timelord - run: | - . ./activate - sh install-timelord.sh - ./vdf_bench square_asm 400000 - - - name: Install developer requirements - run: | - . ./activate - venv/bin/python -m pip install pytest pytest-asyncio pytest-xdist - - - name: Test wallet code with pytest - run: | - . ./activate - ./venv/bin/py.test tests/wallet/test_backup.py tests/wallet/test_bech32m.py tests/wallet/test_chialisp.py tests/wallet/test_puzzle_store.py tests/wallet/test_singleton.py tests/wallet/test_taproot.py tests/wallet/test_wallet.py tests/wallet/test_wallet_store.py -s -v --durations 0 diff --git a/.github/workflows/build-windows-installer.yml b/.github/workflows/build-windows-installer.yml index 45c2ecfd4..7d90927fc 100644 --- a/.github/workflows/build-windows-installer.yml +++ b/.github/workflows/build-windows-installer.yml @@ -28,6 +28,7 @@ jobs: with: fetch-depth: 0 submodules: recursive + token: ${{ secrets.PAT }} - name: Get npm cache directory id: npm-cache @@ -76,7 +77,7 @@ jobs: uses: kitek/decode-base64-into-file-action@1.0 with: encoded-value: ${{ secrets.WIN_CODE_SIGN_CERT }} - destination-file: .\chia-blockchain-gui\win_code_sign_cert.p12 + destination-file: .\flax-blockchain-gui\win_code_sign_cert.p12 - name: Build Windows installer with build_scripts\build_windows.ps1 env: @@ -91,10 +92,10 @@ jobs: uses: actions/upload-artifact@v2.2.2 with: name: Windows-Exe - path: ${{ github.workspace }}\chia-blockchain-gui\Chia-win32-x64\ + path: ${{ github.workspace }}\flax-blockchain-gui\Flax-win32-x64\ - name: Upload Installer to artifacts uses: actions/upload-artifact@v2.2.2 with: name: Windows-Installers - path: ${{ github.workspace }}\chia-blockchain-gui\release-builds\ + path: ${{ github.workspace }}\flax-blockchain-gui\release-builds\ diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index a93704913..000000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,67 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: "CodeQL" - -on: - push: - branches: [ main ] - pull_request: - # The branches below must be a subset of the branches above - branches: [ main ] - schedule: - - cron: '34 14 * * 3' - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - language: [ 'python' ] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] - # Learn more: - # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v1 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v1 - - # ℹ️ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 diff --git a/.github/workflows/super-linter.yml b/.github/workflows/super-linter.yml deleted file mode 100644 index 874e05f0b..000000000 --- a/.github/workflows/super-linter.yml +++ /dev/null @@ -1,80 +0,0 @@ ---- -########################### -########################### -## Linter GitHub Actions ## -########################### -########################### -name: GithHub Super Linter - -# -# Documentation: -# https://github.com/github/super-linter -# https://help.github.com/en/articles/workflow-syntax-for-github-actions -# - -############################# -# Start the job on all push # -############################# -on: - push: - branches-ignore: - - 'main' - pull_request: - branches-ignore: - - '' - -############### -# Set the Job # -############### -jobs: - build: - # Name the Job - name: Lint Code Base - # Set the agent to run on - runs-on: ubuntu-latest - timeout-minutes: 60 - - ################## - # Load all steps # - ################## - steps: - ########################## - # Checkout the code base # - ########################## - - name: Checkout Code - uses: actions/checkout@v2 - - ################################ - # Run Linter against code base # - ################################ - - name: Lint Code Base - uses: github/super-linter@v3.15.5 -# uses: docker://github/super-linter:v3.10.2 - env: - VALIDATE_ALL_CODEBASE: true - DEFAULT_BRANCH: main - LINTER_RULES_PATH: .github/linters - VALIDATE_BASH: true - VALIDATE_CSS: true - VALIDATE_DOCKER: true - VALIDATE_GO: true - VALIDATE_HTML: true - VALIDATE_JAVASCRIPT_ES: true - VALIDATE_JSON: true - VALIDATE_MD: true - VALIDATE_POWERSHELL: true - VALIDATE_PYTHON: true - VALIDATE_PYTHON_PYLINT: true - VALIDATE_PYTHON_FLAKE8: true - VALIDATE_PYTHON_BLACK: true -# VALIDATE_PYTHON_ISORT: true - VALIDATE_SHELL_SHFMT: true - VALIDATE_TYPESCRIPT_ES: true - VALIDATE_YAML: true - DISABLE_ERRORS: false - PYTHONPATH: ${{ github.workspace }}:$PYTHONPATH - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - FILTER_REGEX_EXCLUDE: .*github/ISSUE_TEMPLATE/config.yml -# ACTIONS_RUNNER_DEBUG: true - -... diff --git a/.github/workflows/upload-pypi-source.yml b/.github/workflows/upload-pypi-source.yml deleted file mode 100644 index a5f71ba85..000000000 --- a/.github/workflows/upload-pypi-source.yml +++ /dev/null @@ -1,90 +0,0 @@ -name: Lint and upload source distribution - -on: - push: - branches: - - main - tags: - - '**' - pull_request: - branches: - - '**' - -jobs: - upload_source_dist: - name: Lint and Upload source distribution - runs-on: [ubuntu-latest] - timeout-minutes: 30 - - steps: - - name: Cancel previous runs on the same branch - if: ${{ github.ref != 'refs/heads/main' }} - uses: styfle/cancel-workflow-action@0.9.0 - with: - access_token: ${{ github.token }} - - - name: Checkout Code - uses: actions/checkout@v2 - with: - fetch-depth: 0 - submodules: recursive - - - uses: actions/setup-python@v2 - name: Install Python - with: - python-version: '3.8' - - - name: Test for secrets access - id: check_secrets - shell: bash - run: | - unset HAS_SECRET - if [ -n "$SECRET" ]; then HAS_SECRET='true' ; fi - echo ::set-output name=HAS_SECRET::${HAS_SECRET} - env: - SECRET: "${{ secrets.test_pypi_password }}" - - - name: Install lint requirements - run: | - python -m pip install --upgrade pip - python -m pip install pytest flake8 mypy - - - name: Lint source with flake8 - run: | - flake8 chia tests - - - name: Lint source with mypy - run: | - mypy --exclude config.py tests - mypy chia - - - name: Build source distribution - run: | - pip install build - python -m build --sdist --outdir dist . - - - name: Upload artifacts - uses: actions/upload-artifact@v2 - with: - name: dist - path: ./dist - - - name: Install twine - run: pip install twine - - - name: Publish distribution to Test PyPI - if: steps.check_secrets.outputs.HAS_SECRET - env: - TWINE_REPOSITORY_URL: https://test.pypi.org/legacy/ - TWINE_USERNAME: __token__ - TWINE_NON_INTERACTIVE: 1 - TWINE_PASSWORD: ${{ secrets.test_pypi_password }} - run: twine upload --non-interactive --skip-existing --verbose 'dist/*' - - - name: Publish distribution to PyPI - if: steps.check_secrets.outputs.HAS_SECRET && startsWith(github.event.ref, 'refs/tags') - env: - TWINE_USERNAME: __token__ - TWINE_NON_INTERACTIVE: 1 - TWINE_PASSWORD: ${{ secrets.pypi_password }} - run: twine upload --non-interactive --skip-existing --verbose 'dist/*' diff --git a/.gitignore b/.gitignore index dc3303e05..cf19ff3ae 100644 --- a/.gitignore +++ b/.gitignore @@ -25,7 +25,7 @@ config/keys.yaml config/plots.yaml # Bundled code -chia-blockchain.tar.gz.tar.gz +flax-blockchain.tar.gz.tar.gz # PyInstaller # Usually these files are written by a python script from a template @@ -66,7 +66,7 @@ activate .idea # Packaging -chia-blockchain.tar.gz +flax-blockchain.tar.gz # Timelord utilities vdf_bench @@ -88,13 +88,13 @@ main.sym *.recompiled # Dev config react -# chia-blockchain-gui/src/dev_config.js +# flax-blockchain-gui/src/dev_config.js # React built app -chia-blockchain-gui/.eslintcache -chia-blockchain-gui/build +flax-blockchain-gui/.eslintcache +flax-blockchain-gui/build build_scripts/dist build_scripts/*.Dmg -chia-blockchain-gui/src/locales/_build +flax-blockchain-gui/src/locales/_build build_scripts\win_build build_scripts/win_build win_code_sign_cert.p12 diff --git a/.gitmodules b/.gitmodules index e63ea0dde..e317ed056 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,6 @@ -[submodule "chia-blockchain-gui"] - path = chia-blockchain-gui - url = https://github.com/Chia-Network/chia-blockchain-gui.git +[submodule "flax-blockchain-gui"] + path = flax-blockchain-gui + url = https://github.com/Flax-Network/flax-blockchain-gui.git branch = main [submodule "mozilla-ca"] path = mozilla-ca diff --git a/BUILD_TIMELORD.md b/BUILD_TIMELORD.md index ad59e0d0f..1611a4018 100644 --- a/BUILD_TIMELORD.md +++ b/BUILD_TIMELORD.md @@ -1,7 +1,7 @@ # Building timelords The Linux and MacOS chiavdf binary wheels currently exclude an executable -required to run a [Timelord](https://github.com/Chia-Network/chia-blockchain/wiki/Timelords). +required to run a [Timelord](https://github.com/Flax-Network/flax-blockchain/wiki/Timelords). If you want to run a Timelord on Linux or MacOS, you must install the wheel from source (which may require some additional development packages) while in the virtual environment. @@ -13,7 +13,7 @@ sh install-timelord.sh ``` If the compile fails, it's likely due to a missing dependency. The script -[install-timelord.sh](https://github.com/Chia-Network/chia-blockchain/blob/main/install-timelord.sh) +[install-timelord.sh](https://github.com/Flax-Network/flax-blockchain/blob/main/install-timelord.sh) attempts to install required build dependencies for Linux and MacOS before invoking pip to build from the source python distribution of chiavdf. diff --git a/CHANGELOG.md b/CHANGELOG.md index 9dc02d6cc..83dc0918e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,22 +6,22 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project does not yet adhere to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) for setuptools_scm/PEP 440 reasons. -## 1.1.7 Chia Blockchain 2021-06-05 +## 1.1.7 Flax Blockchain 2021-06-05 ### Fixed Batch process weight proof epochs in groups of 900 to fit below May 2020 sqlite limit (999 for Python 3.7 on Windows). Fixes sqlite3.OperationalError: too many SQL variables error and resulting issues with syncing wallets on Windows. -## 1.1.6 Chia Blockchain 2021-05-20 +## 1.1.6 Flax Blockchain 2021-05-20 ### Added - This is the initial release of our DNS introducer. We built a far too simple basic introducer that we hoped to replace as quickly as possible with an introducer that uses DNS in the style of Bitcoin. This release will now use both and as we gain testing with the DNS version, we will slowly be phasing the classic introducers out. This should significantly help in finding nodes to connect and sync to. - You can now whitelist networks and hosts so that a node can always connect with chosen peers. -- We added a simple profiler to track performance times in the application (see /chia/util/profiler.py for instructions). +- We added a simple profiler to track performance times in the application (see /flax/util/profiler.py for instructions). - We added a transaction filter to get_header_blocks_in_range. - There is now an unspent coin count and pending coin removal count to wallet_rpc_api. -- Added configuration options for moving an install to testnet and back (use `chia configure -t true|false`). +- Added configuration options for moving an install to testnet and back (use `flax configure -t true|false`). - Added Arabic language support. Thank you to the following community members for their translation contributions: @MohamedSiddig, @bilalghalib, @HoussenAlSamer, @esmailelbob, @MCoreiX, @bestq8, @bt.layth, @sam_774, @yahyakhalid, @itsmekarim44, @anasjawabreh1996, @algeria98, @abduallh, @rabee.khalil, @ajoolee. - Added Bulgarian language support. Thank you to the following community members for their translation contributions: @shaosoft, @sitio72, @yonchevsv, @sleit2000, @TerminalX, @WoWGeleto, @DrEnderTV, @l2rx, @iliakurdalanov, @liveroy. - Added Croatian language support. Thank you to the following community members for their translation contributions: @hrvoje555, @ATfarm, @m.filipovski2505, @goranpravda035, @Fistrake, @marko.anti12. @@ -56,17 +56,17 @@ Batch process weight proof epochs in groups of 900 to fit below May 2020 sqlite - Thanks to @msg7086 for fixing install.sh for Debian. - And thank you to @alfonsoperez, @asdf2014, @fredericosilva, @lamba09, @Nikolaj-K, @sargonas, @aisk, @Ich5003, and @trumankain for various other fixes and improvements. -## 1.1.5 Chia Blockchain 2021-05-09 +## 1.1.5 Flax Blockchain 2021-05-09 ### Fixed - We were not checking for negative values in the uint64 constructor. Therefore coins with negative values were added to the mempool. These blocks passed validation, but they did not get added into the blockchain due to negative values not serializing in uint64. Farmers making these blocks would make blocks that did not make it into or advance the chain, so the blockchain slowed down starting at block 255518 around 6:35AM PDT 5/9/2021. The fix adds a check in the mempool and block validation, and does not disconnect peers who send these invalid blocks (any peer 1.1.4 or older), making this update not mandatory but is recommended. Users not updating might see their blocks get rejected from other peers. Upgraded nodes will show an error when they encounter an old node trying to send an invalid block. This "Consensus error 124..." can be safely ignored. -## 1.1.4 Chia Blockchain 2021-05-04 +## 1.1.4 Flax Blockchain 2021-05-04 ### Changed -- Secret wallet key is hidden by default in `chia keys show`. Use `chia keys show --show-mnemonic-seed` for private keys. +- Secret wallet key is hidden by default in `flax keys show`. Use `flax keys show --show-mnemonic-seed` for private keys. - Performance improvement while parsing variable length field in transaction blocks. ### Fixed @@ -77,7 +77,7 @@ Batch process weight proof epochs in groups of 900 to fit below May 2020 sqlite - Two issues with processing Weight Proofs during syncing while farming. - Fixed a bug in the outgoing rate control logic that could prevent messages being sent. -## 1.1.3 Chia Blockchain 2021-05-01 +## 1.1.3 Flax Blockchain 2021-05-01 ### Added @@ -88,7 +88,7 @@ Batch process weight proof epochs in groups of 900 to fit below May 2020 sqlite - We now require node 12.x to build the GUI. Installers have been building using node 12.x for quite some time. - Node will now farm while syncing. -- We changed chialisp singletons to take a puzzlehash as its origin. We also updated the DID wallet to use this. +- We changed flaxlisp singletons to take a puzzlehash as its origin. We also updated the DID wallet to use this. - Transactions are now cached for 10 minutes in mempool to retry if there is a failure of a spending attempt. - Thank you to @Chida82 who made the log rotation count fully configurable. Apologies to him for not initially being included here. - Thank you to @fiveangle for making install.sh more resilient across python installations. @@ -102,7 +102,7 @@ Batch process weight proof epochs in groups of 900 to fit below May 2020 sqlite - @martomi added logging of added coins back. - Thank you to @aisk for additional type checking. - @aisk added error checking in bech32m -- Chialisp programs now remained serialized in Node for better performance. +- Flaxlisp programs now remained serialized in Node for better performance. - Mempool is now set to be 50 times the single block size. - Mitigate 1-3 mojo dust attacks. - CLI now switches to EiB for netspace display as appropriate. @@ -122,7 +122,7 @@ Batch process weight proof epochs in groups of 900 to fit below May 2020 sqlite - Thanks @antoniobg for a typo fix in keychain.py. - Thanks to @altendky for catching a Copyright date error. -## 1.1.2 Chia Blockchain 2021-04-24 +## 1.1.2 Flax Blockchain 2021-04-24 ### Changed @@ -133,7 +133,7 @@ Batch process weight proof epochs in groups of 900 to fit below May 2020 sqlite - When attempting to sync, connections could accidentally disconnect for rate limiting reasons. This was causing many to not be able to sync. - Some temp files were not being closed during GUI plotting. -## 1.1.1 Chia Blockchain 2021-04-21 +## 1.1.1 Flax Blockchain 2021-04-21 ### Added @@ -147,12 +147,12 @@ Batch process weight proof epochs in groups of 900 to fit below May 2020 sqlite - Changes were made in 1.1.0 to make sure that even out of order signage points were found and responded to by as many farmers as possible. That change lead to a situation where the harvester could thrash on the same cached signage point. -## 1.1.0 Chia Blockchain 2021-04-21 +## 1.1.0 Flax Blockchain 2021-04-21 ### Added -- This fork release includes full transaction support for the Chia Blockchain. Transactions are still disabled until 5/3/2021 at 10:00AM PDT. It is hard to overstate how much work and clean up went into this release. -- This is the 1.0 release of Chialisp. Much has been massaged and finalized. We will be putting a focus on updating and expanding the documentation on [chialisp.com](https://chialisp.com) shortly. +- This fork release includes full transaction support for the Flax Blockchain. Transactions are still disabled until 5/3/2021 at 10:00AM PDT. It is hard to overstate how much work and clean up went into this release. +- This is the 1.0 release of Flaxlisp. Much has been massaged and finalized. We will be putting a focus on updating and expanding the documentation on [flaxlisp.com](https://flaxlisp.com) shortly. - Farmers now compress blocks using code snippets from previous blocks. This saves storage space and allows larger smart coins to have a library of sorts on chain. - We now support offline signing of coins. - You can now ask for an offset wallet receive address in the cli. Thanks @jespino. @@ -173,7 +173,7 @@ Batch process weight proof epochs in groups of 900 to fit below May 2020 sqlite - Timelords are now successfully infusing almost 100% of blocks. - Harvester should be a bit more tolerant of some bad plots. -## 1.0.5 Chia Blockchain 2021-04-14 +## 1.0.5 Flax Blockchain 2021-04-14 ### Added @@ -191,7 +191,7 @@ Batch process weight proof epochs in groups of 900 to fit below May 2020 sqlite - Help -> About was blank. - Our estimate for k=32 was about 0.4GiB too low in some cases. - Building the GUI in especially ARM64 Linux was painful enough to be considered broken. -## 1.0.4 Chia Blockchain 2021-04-12 +## 1.0.4 Flax Blockchain 2021-04-12 ### Added @@ -201,8 +201,8 @@ Batch process weight proof epochs in groups of 900 to fit below May 2020 sqlite ### Changed - The plotter in bitfield mode is much improved in plotting speed (~15% faster than in 1.0.3), now requires 28% less temporary space (238.3 GiB/256 GB), and now uses its maximum memory in phase 1 and only needs 3389MiB for optimal sorting of a k32. Total writes should also be down by about 20%. On almost all machines we expect bitfield to be as fast or faster. For CPUs that predate the [Nehalem architecture](https://en.wikipedia.org/wiki/Nehalem_(microarchitecture)), bitfield plotting will not work and you will need to use no bitfield. Those CPUs were generally designed before 2010. -- The `src` directory in chia-blockchain has been changed to `chia` to avoid namespace collisions. -- GUI install builds have been simplified to rely on one `.spec` file in `chia/` +- The `src` directory in flax-blockchain has been changed to `flax` to avoid namespace collisions. +- GUI install builds have been simplified to rely on one `.spec` file in `flax/` - The weight proof timeout can now be configured in config.yaml. - Peer discovery is now retried more often after you receive initial peers. @@ -215,34 +215,34 @@ Batch process weight proof epochs in groups of 900 to fit below May 2020 sqlite - Wallet start up would have a race condition that output a harmless error on startup. - Thanks for a typo fix from @alfonsoperez. -## 1.0.3 Chia Blockchain 2021-03-30 +## 1.0.3 Flax Blockchain 2021-03-30 ### Added - This is a minor bug fix release for version 1.0.2 -- You should review the [release notes for v1.0.2](https://github.com/Chia-Network/chia-blockchain/releases/tag/1.0.2) but we especially want to point out that wallet sync is much faster than in 1.0.1 and earlier versions. +- You should review the [release notes for v1.0.2](https://github.com/Flax-Network/flax-blockchain/releases/tag/1.0.2) but we especially want to point out that wallet sync is much faster than in 1.0.1 and earlier versions. ### Fixed -- An incorrect merge brought in unreleased features and broke `chia keys`. +- An incorrect merge brought in unreleased features and broke `flax keys`. - Omitted from the 1.0.2 changelog, we fixed one crash in harvester with the release of chiapos 1.0.0 as well. -## 1.0.2 Chia Blockchain 2021-03-30 +## 1.0.2 Flax Blockchain 2021-03-30 ### Added -- We have released version 1.0.0 of [chiapos](https://github.com/Chia-Network/chiapos). This includes a 20% speed increase for bitfield plotting compared to the previous version on the same machine. In many cases this will mean that bitfield plotting is as fast or faster than non bitfield plotting. +- We have released version 1.0.0 of [chiapos](https://github.com/Flax-Network/chiapos). This includes a 20% speed increase for bitfield plotting compared to the previous version on the same machine. In many cases this will mean that bitfield plotting is as fast or faster than non bitfield plotting. - @xorinox improved our support for RedHat related distributions in `install.sh`. - @ayaseen improved our support for RedHat related distributions in `install-timelord.sh`. -- We have added Dutch and Polish to supported translations. Thanks @psydafke, @WesleyVH, @pieterhauwaerts, @bartlomiej.tokarzewski, @abstruso, @feel.the.code, and @Axadiw for contributions to [translations on Crowdin](https://crowdin.com/project/chia-blockchain). +- We have added Dutch and Polish to supported translations. Thanks @psydafke, @WesleyVH, @pieterhauwaerts, @bartlomiej.tokarzewski, @abstruso, @feel.the.code, and @Axadiw for contributions to [translations on Crowdin](https://crowdin.com/project/flax-blockchain). - The GUI now supports "Exclude final directory" when plotting. This is found in the Advanced Options for step 2 on the plot creation page. ### Changed - Wallet now uses a trusted node and, when syncing from that node, Wallet does not do as many validations. -- @jespino changed `chia keys show` to require the `--show-mnemonic-seed` before it displays your 24 work private key mnemonic. +- @jespino changed `flax keys show` to require the `--show-mnemonic-seed` before it displays your 24 work private key mnemonic. - We decreased the size of the block cache in node to perform better with longer chains. -- You can now add a private key mnemonic from a file with `chia keys show`. +- You can now add a private key mnemonic from a file with `flax keys show`. - @Flofie caught an error in CONTRIBUTING.md. - We no longer rely on aiter so it has been removed. - Keyring deprecated the use of OS_X in favor of MacOS. @@ -258,14 +258,14 @@ Batch process weight proof epochs in groups of 900 to fit below May 2020 sqlite - There was a potential node locking issue that could have prevented a Timelord from getting a new peak and cause a chain stall. - We did not correctly support some Crowdin locales. Pirate English was starting to overwrite US English for example. -## 1.0.1 Chia Blockchain 2021-03-23 +## 1.0.1 Flax Blockchain 2021-03-23 ### Added - There is now a simple progress bar on the GUI Plot page and when you view the log from the three dots on the right. -- Users must now explicitly set the `--show-mnemonic-seed` flag to see their private keys when running `chia keys show`. +- Users must now explicitly set the `--show-mnemonic-seed` flag to see their private keys when running `flax keys show`. - We are now building Linux GUI installers. These should be considered beta quality for now. -- Translations now available for German, Traditional Chinese, and Danish. Thanks to @Dravenex, @MaestroOnICe, @loudsyncro, @loppefaaret, @thirteenthd, @wong8888, @N418, and @swjz for all the translation help. You to can translate at our [Crowdin project](https://crowdin.com/project/chia-blockchain/). +- Translations now available for German, Traditional Chinese, and Danish. Thanks to @Dravenex, @MaestroOnICe, @loudsyncro, @loppefaaret, @thirteenthd, @wong8888, @N418, and @swjz for all the translation help. You to can translate at our [Crowdin project](https://crowdin.com/project/flax-blockchain/). ### Changed @@ -276,19 +276,19 @@ Batch process weight proof epochs in groups of 900 to fit below May 2020 sqlite ### Fixed - Weight proofs, especially wallet weight proofs were failing when some Blueboxed proofs of time were encountered. -- Users can now pip install e.g. chia-blockchain==1.0.1 on most platforms. +- Users can now pip install e.g. flax-blockchain==1.0.1 on most platforms. - Sometimes the GUI had an error regarding MainWindow. -## 1.0.0 First Release of Chia Blockchain 2021-03-17 +## 1.0.0 First Release of Flax Blockchain 2021-03-17 ### Added -- This is the first production release of the Chia Blockchain. This can be installed and will wait for the green flag that will be dropped at approximately 7AM PDST (14:00 UTC) on Friday March 19, 2021. All farming rewards from that point forward will be considered valid and valuable XCH. There is a six week lock on all transactions. During those six weeks farmers will be earning their farming rewards but those rewards can not be spent. +- This is the first production release of the Flax Blockchain. This can be installed and will wait for the green flag that will be dropped at approximately 7AM PDST (14:00 UTC) on Friday March 19, 2021. All farming rewards from that point forward will be considered valid and valuable XCH. There is a six week lock on all transactions. During those six weeks farmers will be earning their farming rewards but those rewards can not be spent. - Initial difficulty will be set for 100PB. This may mean the initial epoch may be slow. Mainnet difficulty resets are targeted for 24 hours so this difficulty will adjust to the actual space brought online in 24 to 48 hours after launch. - Transactions are not enabled in the 1.0.0 version and will be soft forked in during the six week period via a 1.1.0 release. - There will also be a 1.0.1 release after the green flag process is complete to simplify install for new users by removing the green flag alert. In the interim there will be new testnet releases using the 1.1bx version scheme. - Starting with release 1.0.0 you usually no longer need to upgrade and 1.0.1 will be fully optional. However you will have to upgrade to 1.1 after it is out and before the six week period ends. We plan to give plenty of time between those two events up to and including pushing back the transaction start date by a short period of time. -- Thank you to @L3Sota for adding a Japanese translation via our [Crowdin project](https://crowdin.com/project/chia-blockchain). +- Thank you to @L3Sota for adding a Japanese translation via our [Crowdin project](https://crowdin.com/project/flax-blockchain). - The generation of CoinIDs is now unique on mainnet to avoid testnet transaction replays. - Validation of transactions will now fail after the expiration of the six week period. @@ -316,13 +316,13 @@ Batch process weight proof epochs in groups of 900 to fit below May 2020 sqlite - Found and fixed another green flag related issue - Fixed an issue with weight proofs where all sub-epochs were sampled, and the size of the weight proof kept growing - Fixed an issue with install-gui.sh, where npm audit fix was failing. (Thanks @Depado!) -- Migration with CHIA_ROOT set does not crash chia init +- Migration with FLAX_ROOT set does not crash flax init ## 1.0rc8 aka Release Candidate 8 - 2021-03-15 ### Added -- This is a hard fork/breaking change from RC6/7. TXCH Coins will **not** be moved forward but your plots and keys and parts of your configuration do. When you install this version before 10AM PDST on 3/16/2021 it will load up, start finding peers, and otherwise wait for the flag drop at that time to start farming. This is likely to be the last dress rehearsal for mainnet launch. Our [3/15/2021 blog post](https://www.chia.net/2021/03/15/mainnet-update.html) has more details on the current mainnet launch plan. +- This is a hard fork/breaking change from RC6/7. TXCH Coins will **not** be moved forward but your plots and keys and parts of your configuration do. When you install this version before 10AM PDST on 3/16/2021 it will load up, start finding peers, and otherwise wait for the flag drop at that time to start farming. This is likely to be the last dress rehearsal for mainnet launch. Our [3/15/2021 blog post](https://www.flaxnetwork.org/2021/03/15/mainnet-update.html) has more details on the current mainnet launch plan. - The GUI now has a tooltip that directs users to the explanation of the plot filter. - The GUI now has a tooltip to explain the "Disable bitfield plotting" option. Thanks @shaneo257 for the idea. - The GUI now has a tooltip to explain Hierarchical Deterministic keys next to Receive Address on the Wallet page. @@ -333,14 +333,14 @@ Batch process weight proof epochs in groups of 900 to fit below May 2020 sqlite - Harvester now catches another error class and continues to harvest. Thanks to @xorinox for this PR. - We now use a smaller weight proof sample size to ease the load on smaller machines when syncing. - Starting the GUI from Linux will now also error out if `npm run build` is run outside the venv. Huge thanks to @dkackman for that PR. -- `chia farm summary` will now display TXCH or XCH as appropriate. +- `flax farm summary` will now display TXCH or XCH as appropriate. - We added more time to our API timeouts and improved logging around times outs. ### Fixed - We no longer use the transaction cache to look up transactions for new transactions as that was causing a wallet sync bug. - Sometimes the GUI would not pick up the fingerprint for the plotting key. -- `chia farm summary` displayed some incorrect amounts. +- `flax farm summary` displayed some incorrect amounts. - Weight proofs were timing out. - Changes to farming rewards target addresses from the GUI were not being saved for restart correctly. - Signage points, recent deficit blocks, and slots for overflow challenge blocks had minor issues. @@ -351,7 +351,7 @@ Batch process weight proof epochs in groups of 900 to fit below May 2020 sqlite - Our green flag test blockchain launch worked but it uncovered a flaw in our installer versions. This release is a bug fix release to address that flaw. You should read the RC6 changes below if this is your first time installing since RC5. - Thanks to @dkackman for implementing an early exit of the GUI if you run `npm run build` without being in the `venv`. -- `chia netspace` now defaults to 1000 blocks to mirror the GUI. +- `flax netspace` now defaults to 1000 blocks to mirror the GUI. - The installer build process was spruced up some. ### Fixed @@ -361,12 +361,12 @@ Batch process weight proof epochs in groups of 900 to fit below May 2020 sqlite - Wallet notoriously showed "not synced" when it was in sync. - Installers were not correctly placing root TLS certificates into the bundle. - Weight proofs had a logic typo. -- There was a typo in `chia netspace`. Thanks @altendky. -- There was a typo in `chia plots`. Thanks @adamfiddler. +- There was a typo in `flax netspace`. Thanks @altendky. +- There was a typo in `flax plots`. Thanks @adamfiddler. ### Known Issues -- Some users can't plot in the GUI in MacOS Big Sur - especially on M1. See issue [1189](https://github.com/Chia-Network/chia-blockchain/issues/1189) +- Some users can't plot in the GUI in MacOS Big Sur - especially on M1. See issue [1189](https://github.com/Flax-Network/flax-blockchain/issues/1189) ## 1.0rc6 aka Release Candidate 6 - 2021-03-11 @@ -382,11 +382,11 @@ Batch process weight proof epochs in groups of 900 to fit below May 2020 sqlite ## Changed -- Remove `chia plots "-s" "--stripe_size"` and the strip size setting in the Advanced section of the GUI. We now always use the best default of 64K for the GUI and cli. -- `chia keys add` takes secret words a prompt on the command line or stdin instead of command line arguments for security. +- Remove `flax plots "-s" "--stripe_size"` and the strip size setting in the Advanced section of the GUI. We now always use the best default of 64K for the GUI and cli. +- `flax keys add` takes secret words a prompt on the command line or stdin instead of command line arguments for security. - Version 1.0.1 of chiavdf was added. This brought MPIR on Windows to the most recent release. Additionally we removed inefficient ConvertIntegerToBytes() and ConvertBytesToInt() functions, use GMP library's mpz_export/mpz_import for big integers and simple helper functions for built-in integer types. The latter are taken from chiavdf. We now require compressed forms to be encoded canonically when deserializing. This should prevent potential grinding attacks where some non-canonical encodings of a compressed form could be used to change its hash and thus the next challenges derived from it. Canonically encoded compressed forms must be reduced and must produce the same string when deserialized and serialized again. - Version 1.0 of our BLS signature library is included. We brought Relic, gmp and MPIR up to their most recent releases. We again thank the Dash team for their fixes and improvements. -- We now hand build Apple Silicon native binary wheels for all chia-blockchain dependencies and host them at [https://pypi.chia.net/simple](https://pypi.chia.net/simple). We are likely to hand build a MacOS ARM64 dmg available and certainly will for 1.0. You can install natively on M1 now with the `git clone` developer method today. Just make sure Python 3.9 is installed. `python3 --version` works. +- We now hand build Apple Silicon native binary wheels for all flax-blockchain dependencies and host them at [https://pypi.flaxnetwork.org/simple](https://pypi.flaxnetwork.org/simple). We are likely to hand build a MacOS ARM64 dmg available and certainly will for 1.0. You can install natively on M1 now with the `git clone` developer method today. Just make sure Python 3.9 is installed. `python3 --version` works. - The GUI now shows you which network you are connected to on the Full Node page. It will also wait patiently for the green flag to drop on a network launch. - In the GUI you can only plot k=32 or larger with the single exception of k=25 for testing. You will have to confirm choosing k=25 however. Thanks to @jespino for help on this and limiting the cli as well. - The restore smart wallets from backup prompt has been improved to better get the intent across and that it can be skipped. @@ -397,27 +397,27 @@ Batch process weight proof epochs in groups of 900 to fit below May 2020 sqlite - There are new timestamp consensus rules. A block N must have a greater timestamp than block N-1. Also, a block's timestamp cannot be more than 5 minutes in the future. Note that we have decided that work factor difficulty resets are now going to be 24 hours on mainnet but are still shorter on testnet. - A List[Tuple[uint16, str]] is added to the peer network handshake. These are the capabilities that the node supports, to add new features to the protocol in an easy - soft fork - manner. The message_id is now before the data in each message. - Peer gossip limits were set. -- Generators have been re-worked in CLVM. We added a chialisp deserialization puzzle and improved the low-level generator. We reduce the accepted atom size to 1MB during ChiaLisp native deserialization. +- Generators have been re-worked in CLVM. We added a flaxlisp deserialization puzzle and improved the low-level generator. We reduce the accepted atom size to 1MB during FlaxLisp native deserialization. - When processing mempool transactions, Coin IDs are now calculated from parent coin ID and amount - We implemented rate limiting for full node. This can and will lead to short term bans of certain peers that didn't behave in expected ways. This is ok and normal, but strong defense against many DDOS attacks. - `requirements-dev.txt` has been removed in favor of the CI actions and test scripts. -- We have moved to a new and much higher scalability download.chia.net to support the mainnet launch flag and additional download demand. -- To always get the latest testnet and then mainnet installers you can now use a latest URL: [Windows](https://download.chia.net/latest/Setup-Win64.exe) and [MacOS x86_64](https://download.chia.net/latest/Setup-MacOS.dmg). -- Chia wheels not on Pypi and some dependecies not found there also are now on pypi.chia.net. +- We have moved to a new and much higher scalability download.flaxnetwork.org to support the mainnet launch flag and additional download demand. +- To always get the latest testnet and then mainnet installers you can now use a latest URL: [Windows](https://download.flaxnetwork.org/latest/Setup-Win64.exe) and [MacOS x86_64](https://download.flaxnetwork.org/latest/Setup-MacOS.dmg). +- Flax wheels not on Pypi and some dependecies not found there also are now on pypi.flaxnetwork.org. - Additional typing has been added to the Python code with thanks to @jespino. - Cryptography and Keyring have been bumped to their current releases. -- PRs and commits to the chia-blockchain-gui repository will automatically have their locales updated. +- PRs and commits to the flax-blockchain-gui repository will automatically have their locales updated. ## Fixed - The Farm page will now no longer get stuck at 50 TXCH farmed. -- `chia farm` has had multiple bugs and spelling issues addressed. Thanks to @alfonsoperez, @soulmerge and @olivernyc for your contributions. -- `chia wallet` had various bugs. +- `flax farm` has had multiple bugs and spelling issues addressed. Thanks to @alfonsoperez, @soulmerge and @olivernyc for your contributions. +- `flax wallet` had various bugs. - Various weight proof improvements. - Some users on Big Sur could not plot from the GUI as the log window would be stuck on "Loading." - We believe we have fixed the chain stall/confused Timelord bug from ~ 13:00 UTC 3/10/21. We've added additional recovery logic as well. - Logs from receiving a duplicate compacted Proof of Time are much more human friendly. -- We believe that the install/migrate process was bringing forward bad farming rewards receive addresses. We have attempted to stop that by only migrating RC3 and newer configurations. You can make sure you are not effected by using the Manage Farming Rewards tool mentioned above or putting a known good wallet receive address in both `xch_target_address` sections of config.yaml. +- We believe that the install/migrate process was bringing forward bad farming rewards receive addresses. We have attempted to stop that by only migrating RC3 and newer configurations. You can make sure you are not effected by using the Manage Farming Rewards tool mentioned above or putting a known good wallet receive address in both `xfx_target_address` sections of config.yaml. - Wallet cached transactions incorrectly in some cases. ## 1.0rc5 aka Release Candidate 5 - 2021-03-04 @@ -425,19 +425,19 @@ Batch process weight proof epochs in groups of 900 to fit below May 2020 sqlite ### Added - The RC5 release is a new breaking change/hard fork blockchain. Plots and keys from previous chains will work fine on RC5 but balances of TXCH will not come forward. -- We now support a "green flag" chain launch process. A new version of the software will poll download.chia.net/notify/ for a signed json file that will be the genesis block of the chain for that version. This will allow unattended start at mainnet. +- We now support a "green flag" chain launch process. A new version of the software will poll download.flaxnetwork.org/notify/ for a signed json file that will be the genesis block of the chain for that version. This will allow unattended start at mainnet. - Bluebox Timelords are back. These are Timelords most anyone can run. They search through the historical chain and find large proofs of times and compact them down to their smallest representation. This significantly speeds up syncing for newly started nodes. Currently this is only supported on Linux and MacOS x86_64 but we will expand that. Any desktop or server of any age will be fast enough to be a useful Bluebox Timelord. -- Thanks to @jespino there is now `chia farm summary`. You can now get almost exactly the same farming information on the CLI as the GUI. -- We have added Romanian to the GUI translations. Thank you to @bicilis on [Crowdin](https://crowdin.com/project/chia-blockchain). We also added a couple of additional target languages. Klingon anyone? -- `chia wallet` now takes get_address to get a new wallet receive address from the CLI. -- `chia plots check` will list out all the failed plot filenames at the end of the report. Thanks for the PR go to @eFishCent. -- Chialisp and the clvm have had the standard puzzle updated and we replaced `((c P A))` with `(a P A)`. +- Thanks to @jespino there is now `flax farm summary`. You can now get almost exactly the same farming information on the CLI as the GUI. +- We have added Romanian to the GUI translations. Thank you to @bicilis on [Crowdin](https://crowdin.com/project/flax-blockchain). We also added a couple of additional target languages. Klingon anyone? +- `flax wallet` now takes get_address to get a new wallet receive address from the CLI. +- `flax plots check` will list out all the failed plot filenames at the end of the report. Thanks for the PR go to @eFishCent. +- Flaxlisp and the clvm have had the standard puzzle updated and we replaced `((c P A))` with `(a P A)`. ## Changed - Testnets and mainnet now set their minimum `k` size and enforce it. RC5 testnet will reject plots of size less than k=32. - Sub slots now require 16 blocks instead of 12. -- Thanks to @xdustinface of Dash, the BlS Signature library has been updated to 0.9 with clean ups and some speed ups. This changed how the G2 infinity element was handled and we now manage it inside of chia-blockchain, etc., instead of in blspy. +- Thanks to @xdustinface of Dash, the BlS Signature library has been updated to 0.9 with clean ups and some speed ups. This changed how the G2 infinity element was handled and we now manage it inside of flax-blockchain, etc., instead of in blspy. - We have updated the display of peer nodes and moved adding a peer to it's own pop up in the GUI. - Block searching in the GUI has been improved. - @jespino added i18n support and refactored how locales are loaded in the GUI. Additionally he moved more strings into the translation infrastructure for translators. @@ -445,24 +445,24 @@ Batch process weight proof epochs in groups of 900 to fit below May 2020 sqlite - The new chiavdf proof format is not compatible with the old one, however zero-Wesolowski proofs are not affected as they have zero proof segments and consist only of (y, proof). - We made two HashPrime optimizations in chiavdf. This forces numbers being tested for primality to be odd and avoids an unnecessary update of the sprout vector by stopping after the first non-zero value. This is a breaking change as it changes the prime numbers generated from a given seed. We believe this is the final breaking change for chiavdf. - chiabip158 was set to a gold 1.0 version. -- Comments to Chialisp and clvm source have been updated for all of the Chialisp changes over the proceeding three weeks. -- And thanks yet again to @jespino for a host of PRs to add more detailed typing to various components in chia-blockchain. +- Comments to Flaxlisp and clvm source have been updated for all of the Flaxlisp changes over the proceeding three weeks. +- And thanks yet again to @jespino for a host of PRs to add more detailed typing to various components in flax-blockchain. - aiohttp was updated to 3.7.4 to address a low severity [security issue](https://github.com/advisories/GHSA-v6wp-4m6f-gcjg). -- calccrypto/uint128_t was updated in the Windows chiapos implementation. Chiapos required some changes its build process to support MacOS ARM64. +- calccrypto/uint128_t was updated in the Windows chiapos implementation. Flaxpos required some changes its build process to support MacOS ARM64. ### Fixed - Harvester would crash if it encountered more than 16,000 plot files or 256 directories. - Nodes that were interrupted by a network crash or standby on a laptop were not syncing upon reconnection in RC4. - Sync issues could stop syncing from restarting and could lead to a peer host that you could not remove. -- Adding Click changed the behavior of `chia keys add -m`. The help now makes it clear that the 24 word mnemonic needs to be surrounded by a pair of quotes. -- Python root CA certificates have issues so we have added the Mozilla certificate store via curl.se and use that to connect to backup.chia.net via https, for example. +- Adding Click changed the behavior of `flax keys add -m`. The help now makes it clear that the 24 word mnemonic needs to be surrounded by a pair of quotes. +- Python root CA certificates have issues so we have added the Mozilla certificate store via curl.se and use that to connect to backup.flaxnetwork.org via https, for example. - The difficulty adjustment calculation was simplified. -- All of the chia sub repositories that were attempting to build MacOS Universal wheels were only generating x86_64 wheels internally. We have moved back to only generating x86_64 MacOS wheels on CI. -- However, we have updated and test compiled all Chia dependencies on Apple Silicon and will be making available a test .dmg for MacOS ARM64 shortly. +- All of the flax sub repositories that were attempting to build MacOS Universal wheels were only generating x86_64 wheels internally. We have moved back to only generating x86_64 MacOS wheels on CI. +- However, we have updated and test compiled all Flax dependencies on Apple Silicon and will be making available a test .dmg for MacOS ARM64 shortly. - Various weight proof edge cases have been fixed. -- Various typos and style clean ups were made to the Click CLI implementation. `chia -upnp f` was added to disable uPnP. -- `chia plots check` shouldn't crash when encountering plots that cause RuntimeError. PR again thanks to @eFishCent. +- Various typos and style clean ups were made to the Click CLI implementation. `flax -upnp f` was added to disable uPnP. +- `flax plots check` shouldn't crash when encountering plots that cause RuntimeError. PR again thanks to @eFishCent. - Coloured coin announcements had a bug that would allow counterfeiting. ## 1.0rc4 aka Release Candidate 4 - 2021-02-25 @@ -475,28 +475,28 @@ Batch process weight proof epochs in groups of 900 to fit below May 2020 sqlite ### Added -- RC3 is a new chain to support the last major chialisp changes. TXCH from the RC1/2 chain do not come forward to this chain but plots and keys continue to work as usual. +- RC3 is a new chain to support the last major flaxlisp changes. TXCH from the RC1/2 chain do not come forward to this chain but plots and keys continue to work as usual. - We have lowered the transaction lock to the first 5000 blocks to facilitate testing. We also started this chain at a lower difficulty. -- A new RPC api: /push_tx. Using this RPC, you can spend custom chialisp programs. You need to make a SpendBundle, which includes the puzzle reveal (chialisp), a solution (chialisp) and a signature. +- A new RPC api: /push_tx. Using this RPC, you can spend custom flaxlisp programs. You need to make a SpendBundle, which includes the puzzle reveal (flaxlisp), a solution (flaxlisp) and a signature. - You can now use the RPC apis to query the mempool. -- There are now Swedish, Spanish, and Slovak translations. Huge thanks to @ordtrogen (Swedish), @jespino and @dvd101x (Spanish), and our own @seeden (Slovak). Also thanks were due to @f00b4r (Finnish), @A-Caccese (Italian), and @Bibop182 and @LeonidShamis (Russian). Quite a few more are almost complete and ready for inclusion. You can help translate and review translations at our [crowdin project](https://crowdin.com/project/chia-blockchain). -- You can obtain a new wallet receive address on the command line with `chia wallet new_address`. Thanks to @jespino for this and a lot more in the next section below. +- There are now Swedish, Spanish, and Slovak translations. Huge thanks to @ordtrogen (Swedish), @jespino and @dvd101x (Spanish), and our own @seeden (Slovak). Also thanks were due to @f00b4r (Finnish), @A-Caccese (Italian), and @Bibop182 and @LeonidShamis (Russian). Quite a few more are almost complete and ready for inclusion. You can help translate and review translations at our [crowdin project](https://crowdin.com/project/flax-blockchain). +- You can obtain a new wallet receive address on the command line with `flax wallet new_address`. Thanks to @jespino for this and a lot more in the next section below. - You will now see Your Harvester Network in the GUI even if you have no plots. ### Changed -- All chialisp opcodes have been renumbered. This should be the last major breaking change for chialisp and the clvm. There are a couple minor enhancements still needed for mainnet launch, but they may or may not require minor breaking changes. We will be restarting testnet chains on a mostly weekly basis either way. +- All flaxlisp opcodes have been renumbered. This should be the last major breaking change for flaxlisp and the clvm. There are a couple minor enhancements still needed for mainnet launch, but they may or may not require minor breaking changes. We will be restarting testnet chains on a mostly weekly basis either way. - Node batch syncing performance was increased, and it now avoids re-validating blocks that node had already validated. -- The entire CLI has been ported to [Click](https://click.palletsprojects.com/en/7.x/). Huge thanks to @jespino for the big assist and @unparalleled-js for the [recommendation and the initial start](https://github.com/Chia-Network/chia-blockchain/issues/464). This will make building out the CLI much easier. There are some subtle changes and some shortcuts are not there anymore. `chia -h` and `chia SUBCOMMAND -h` can be your guide. +- The entire CLI has been ported to [Click](https://click.palletsprojects.com/en/7.x/). Huge thanks to @jespino for the big assist and @unparalleled-js for the [recommendation and the initial start](https://github.com/Flax-Network/flax-blockchain/issues/464). This will make building out the CLI much easier. There are some subtle changes and some shortcuts are not there anymore. `flax -h` and `flax SUBCOMMAND -h` can be your guide. - We have upgraded Electron to 11.3 to support Apple Silicon. There are still one or two issues in our build chain for Apple Silicon but we should have an M1 native build shortly. - The websocket address is no longer displayed in the GUI unless it is running as a remote GUI. Thanks @dkackman ! -- `chia plots check` now will continue checking after it finds an error in a plot to the total number of checks you specified. +- `flax plots check` now will continue checking after it finds an error in a plot to the total number of checks you specified. - If you run install-gui.sh or install-timelord.sh without being in the venv, the script will warn you that you need to `. ./activate` and exit with error. - If you attempt to install on a 32 bit Pi/ARM OS, the installer exits with a helpful error message. You can still fail when running under a 64 bit kernel but using a 32 bit Python 3. - The application is now more aware of whether it is running a testnet or mainnet. This impacts wallet's display behavior and certain blockchain validation rules. -- Interface improvements for `chia netspace`. +- Interface improvements for `flax netspace`. - Now that aiosqlite included our upstream improvements we install version 0.17.0. -- `chia init` only migrates release candidate directories. The versioned sub directories under `~/chia` will be going away before mainnet. +- `flax init` only migrates release candidate directories. The versioned sub directories under `~/flax` will be going away before mainnet. ### Fixed @@ -508,7 +508,7 @@ Batch process weight proof epochs in groups of 900 to fit below May 2020 sqlite - We made various fixes and changes to weight proofs. - Some configuration values were improperly ignored in migrations. - Some debug logging was accidentally left in. -- `chia configure -log-level` was broken. +- `flax configure -log-level` was broken. - We believe we finally have the Windows Installer obtaining the correct version information at build time. - The application was sometimes not cancel pending items when closing certain websockets. - Fixed filter hash and generator validation. @@ -518,7 +518,7 @@ Batch process weight proof epochs in groups of 900 to fit below May 2020 sqlite ### Fixed -- This is an errata release for Release Candidate 1. There were a couple of things that did not smoothly migrate from the Beta versions. Please make sure you also consult the [release notes for RC-1](https://github.com/Chia-Network/chia-blockchain/releases/tag/1.0rc1) was well. +- This is an errata release for Release Candidate 1. There were a couple of things that did not smoothly migrate from the Beta versions. Please make sure you also consult the [release notes for RC-1](https://github.com/Flax-Network/flax-blockchain/releases/tag/1.0rc1) was well. - Incorrect older spend to addresses were being migrated from Beta 27. This would send farming rewards to un-spendable coins. - Netspace was not calculating properly in RC-1. - The Windows installer was building with the wrong version number. @@ -528,25 +528,25 @@ Batch process weight proof epochs in groups of 900 to fit below May 2020 sqlite ### Added -- This is the first release in our release candidate series. There are still a few things that will change at the edges but the blockchain, clvm, and chialisp are in release form. We have one major change to chialisp/clvm that we have chosen to schedule for the next release as in this release we're breaking the way q/quote works. We also have one more revision to the VDF that will decrease the sizes of the proofs of time. We expect a few more releases in the release candidate series. -- Installers will now be of the pattern ChiaSetup-0.2.1.exe. `0.2` is release candidate and the final `.1` is the first release candidate. -- Use 'chia wallet get_transactions' in the command line to see your transactions. -- 'chia wallet show' now shows your wallet's height. +- This is the first release in our release candidate series. There are still a few things that will change at the edges but the blockchain, clvm, and flaxlisp are in release form. We have one major change to flaxlisp/clvm that we have chosen to schedule for the next release as in this release we're breaking the way q/quote works. We also have one more revision to the VDF that will decrease the sizes of the proofs of time. We expect a few more releases in the release candidate series. +- Installers will now be of the pattern FlaxSetup-0.2.1.exe. `0.2` is release candidate and the final `.1` is the first release candidate. +- Use 'flax wallet get_transactions' in the command line to see your transactions. +- 'flax wallet show' now shows your wallet's height. - Last Attempted Proof is now above Latest Block Challenge on the Farm page of the GUI. - The GUI now detects duplicate plots and also only counts unique plots and unique plot size. -- We have integrated with crowdin to make it easier to translate the GUI. Check out [Chia Blockchain GUI](https://crowdin.com/project/chia-blockchain) there. +- We have integrated with crowdin to make it easier to translate the GUI. Check out [Flax Blockchain GUI](https://crowdin.com/project/flax-blockchain) there. - We have added Italian, Russian, and Finnish. More to come soon. -- There is now remote UI support. [Documents](https://github.com/Chia-Network/chia-blockchain-gui/blob/main/remote.md) will temporarily live in the repository but have moved to the [wiki](https://github.com/Chia-Network/chia-blockchain/wiki/Connecting-the-UI-to-a-remote-daemon). Thanks to @dkackman for this excellent addition! +- There is now remote UI support. [Documents](https://github.com/Flax-Network/flax-blockchain-gui/blob/main/remote.md) will temporarily live in the repository but have moved to the [wiki](https://github.com/Flax-Network/flax-blockchain/wiki/Connecting-the-UI-to-a-remote-daemon). Thanks to @dkackman for this excellent addition! - Added the ability to specify an address for the pool when making plots (-c flag), as opposed to a public key. The block validation was changed to allow blocks like these to be made. This will enable changing pools in the future, by specifying a smart transaction for your pool rewards. -- Added `chia plots check --challenge-start [start]` that begins at a different `[start]` for `-n [challenges]`. Useful when you want to do more detailed checks on plots without restarting from lower challenge values you already have done. Huge thanks to @eFishCent for this and all of the debugging work behind the scenes confirming that plot failures were machine errors and not bugs! +- Added `flax plots check --challenge-start [start]` that begins at a different `[start]` for `-n [challenges]`. Useful when you want to do more detailed checks on plots without restarting from lower challenge values you already have done. Huge thanks to @eFishCent for this and all of the debugging work behind the scenes confirming that plot failures were machine errors and not bugs! ### Changed - Sub blocks renamed to blocks, and blocks renamed to transaction blocks, everywhere. This effects the RPC, now all fields that referred to sub blocks are changed to blocks. - Base difficulty and weight have increased, so difficulty of "5" in the rc1 testnet will be equivalent to "21990232555520" in the previous testnet. -- 'chia wallet send' now takes in TXCH or XCH as units instead of mojos. +- 'flax wallet send' now takes in TXCH or XCH as units instead of mojos. - Transactions have been further sped up. - The blockchain database has more careful validation. - The GUI is now using bech32m. @@ -566,10 +566,10 @@ all fields that referred to sub blocks are changed to blocks. - We now use the rust version of clvm, clvm_rs, in preference to validate transactions. We have additionally published binary wheels or clvm_rs for all four platforms and all three supported python versions. The rust version is approximately 50 times faster than the python version used to validate on chain transactions in previous versions. - We have moved to compressed quadratic forms for VDFs. Using compressed representation of quadratic forms reduces their serialized size from 130 to 100 bytes (for forms with 1024-bit discriminant). This shrinks the size of VDF outputs and VDF proofs, and it's a breaking change as the compressed representation is not compatible with the older uncompressed (a, b) representation. Compressed forms are also used in calls to chiavdf and in timelord's communication with VDF clients. The form compression algorithm is based on ["Trustless Groups of Unknown Order with Hyperelliptic Curves"](https://eprint.iacr.org/2020/196) by Samuel Dobson, Steven D. Galbraith and Benjamin Smith. - Last Attempted Proof on the Farm tab of the GUI now shows hours:minutes:seconds instead of just hours:minutes. This makes it much easier to see that your farmer is responding to recent challenges at a glance. -- You can now send and receive transactions with the command line. Try `chia wallet -h` to learn more. Also, `chia wallet` now requires a third argument of `show`, therefor you will use `chia wallet show` to see your wallet balance. -- We have added the [Crowdin](https://crowdin.com/) translation platform to [chia blockchain gui](https://crowdin.com/project/chia-blockchain). We are still getting it fully set up, but helping to translate the GUI is going to be much easier. +- You can now send and receive transactions with the command line. Try `flax wallet -h` to learn more. Also, `flax wallet` now requires a third argument of `show`, therefor you will use `flax wallet show` to see your wallet balance. +- We have added the [Crowdin](https://crowdin.com/) translation platform to [flax blockchain gui](https://crowdin.com/project/flax-blockchain). We are still getting it fully set up, but helping to translate the GUI is going to be much easier. - Full Node > Connections in the GUI now shows the peak sub block height your connected peers believe they are at. A node syncing from you will not be at the true peak sub block height until it gets into sync. -- `chia init -c [directory]` will create new TLS certificates signed by your CA located in `[directory]`. Use this feature to configure a new remote harvester. Type `chia init -h` to get instructions. Huge thanks to a very efficient @eFishCent for this quick and thorough pull request. +- `flax init -c [directory]` will create new TLS certificates signed by your CA located in `[directory]`. Use this feature to configure a new remote harvester. Type `flax init -h` to get instructions. Huge thanks to a very efficient @eFishCent for this quick and thorough pull request. - We build both MacOS x86_64 and MacOS universal wheels for chiapos, chiavdf, blpsy, and chiabip158 in Python 3.9. The universal build allows M1 Macs to run these dependencies in ARM64 native mode. - On first run in the GUI (or when there are no plot directories) there is now an "Add Plot Directories" on the Farm tab also. @@ -578,7 +578,7 @@ all fields that referred to sub blocks are changed to blocks. - We are moving away from the terms sub blocks and blocks in our new consensus. What used to be called sub blocks will now just be blocks. Some blocks are now also transaction blocks. This is simpler both in the code and to reason about. Not all the code or UI may have caught up yet. - This release has the final mainnet rewards schedule. During the first three years, each block winner will win 2 TXCH/XCH per block for a total of 9216 TXCH per day from 4608 challenges per day. - Smart transactions now use an announcement instead of 'coin consumed' or lock methods. -- The GUI is now in a separate submodule repository from chia-blockchain, [chia-blockchain-gui](https://github.com/Chia-Network/chia-blockchain-gui). The installers and install scripts have been updated and it continues to follow the same install steps. Note that the GUI directory will now be `chia-blockchain-gui`. The workflow for this may be "touch and go" for people who use the git install methods over the short term. +- The GUI is now in a separate submodule repository from flax-blockchain, [flax-blockchain-gui](https://github.com/Flax-Network/flax-blockchain-gui). The installers and install scripts have been updated and it continues to follow the same install steps. Note that the GUI directory will now be `flax-blockchain-gui`. The workflow for this may be "touch and go" for people who use the git install methods over the short term. - Very large coin counts are now supported. - Various RPC endpoints have been renamed to follow our switch to "just blocks" from sub blocks. - We've made changes to the protocol handshake and the blockchain genesis process to support mainnet launch and running/farming more than one chain at a time. That also means we can't as easily determine when an old version of the peer tries to connect so we will put warnings in the logs for now. @@ -594,7 +594,7 @@ all fields that referred to sub blocks are changed to blocks. - The GUI was incorrectly reporting the time frame that the netspace estimate it displays utilizes. It is technically 312.5 minutes, on average, over the trailing 1000 sub blocks. - Coloured coins were not working in the new consensus. - Some Haswell processors do not have certain AVX extensions and therefor would not run. -- The cli wallet, `chia wallet`, was incorrectly displaying TXCH balances as if they were Coloured Coins. +- The cli wallet, `flax wallet`, was incorrectly displaying TXCH balances as if they were Coloured Coins. - We addressed [CVE-2020-28477](https://nvd.nist.gov/vuln/detail/CVE-2020-28477) in the GUI. - We made changes to CI to hopefully not repeat our skipped releases from the previous release cycle. @@ -605,26 +605,26 @@ all fields that referred to sub blocks are changed to blocks. - We now use our own faster primality test based on Baillie-PSW. The new primality test is based on the 2020 paper ["Strengthening the Baillie-PSW primality test" by Robert Baillie, Andrew Fiori, Samuel S. Wagstaff Jr](https://arxiv.org/abs/2006.14425). The new test works approximately 20% faster than GMP library's mpz_probab_prime_p() function when generating random 1024-bit primes. This lowers the load on Timelords and speeds up VDF verifications in full node. - The GUI now checks for an an already running GUI and stops the second launch. Thank you for that PR to @dkackman ! - Transactions are now validated in a separate process in full node. -- `chia plots check -l` will list all duplicate plot IDs found on the machine. Thanks very much for this PR @eFishCent. +- `flax plots check -l` will list all duplicate plot IDs found on the machine. Thanks very much for this PR @eFishCent. ### Changed -- Significant improvements have been made to how the full node handles the mempool. This generally cuts CPU usage of node by 2x or more. Part of this increase is that we have temporarily limited the size of transactions. If you want to test sending a transaction you should keep the value of your transaction below 20 TXCH as new consensus will cause you to use a lot of inputs. This will be returned to the expected level as soon as the integration of [clvm rust](https://github.com/Chia-Network/clvm_rs) is complete. -- We have changed the way TLS between nodes and between chia services work. Each node now has two certificate authorities. One is a public, shared CA that signs the TLS certificates that every node uses to connect to other nodes on 8444 or 58444. You now also have a self generated private CA that must sign e.g. farmer and harvester's certificates. To run a remote harvester you need a new harvester key that is then signed by your private CA. We know this is not easy for remote harvester in this release but will address it quickly. +- Significant improvements have been made to how the full node handles the mempool. This generally cuts CPU usage of node by 2x or more. Part of this increase is that we have temporarily limited the size of transactions. If you want to test sending a transaction you should keep the value of your transaction below 20 TXCH as new consensus will cause you to use a lot of inputs. This will be returned to the expected level as soon as the integration of [clvm rust](https://github.com/Flax-Network/clvm_rs) is complete. +- We have changed the way TLS between nodes and between flax services work. Each node now has two certificate authorities. One is a public, shared CA that signs the TLS certificates that every node uses to connect to other nodes on 8444 or 58444. You now also have a self generated private CA that must sign e.g. farmer and harvester's certificates. To run a remote harvester you need a new harvester key that is then signed by your private CA. We know this is not easy for remote harvester in this release but will address it quickly. - We have changed the way we compile the proof of space plotter and added one additional optimization. On many modern processors this will mean that using the plotter with the `-e` flag will be 2-3% faster than the Beta 17 plotter on the same CPU. We have found this to be very sensitive to different CPUs but are now confident that, at worst, the Beta 24 plotter with `-e` will be the same speed as Beta 17 if not slightly faster on the same hardware. Huge thanks to @xorinox for meticulously tracking down and testing this. - If a peer is not responsive during sync, node will disconnect it. - Peers that have not sent data in the last hour are now disconnected. -- We have made the "Help Translate" button in the GUI open in your default web browser and added instructions for adding new translations and more phrases in existing translations at that [URL](https://github.com/Chia-Network/chia-blockchain/tree/main/electron-react/src/locales). Try the "Help Translate" option on the language selection pull down to the left of the dark/light mode selection at the top right of the GUI. +- We have made the "Help Translate" button in the GUI open in your default web browser and added instructions for adding new translations and more phrases in existing translations at that [URL](https://github.com/Flax-Network/flax-blockchain/tree/main/electron-react/src/locales). Try the "Help Translate" option on the language selection pull down to the left of the dark/light mode selection at the top right of the GUI. - Sync store now tracks all connected peers and removes them as they get removed. -- The Rate Limited Wallet has been ported to new consensus and updated Chialisp methods. -- We are down to only one sub dependency that does not ship binary wheels for all four platforms. The only platform still impacted is ARM64 (generally Raspberry Pi) but that only means that you still need the minor build tools as outlined on the [wiki](https://github.com/Chia-Network/chia-blockchain/wiki/Raspberry-Pi). +- The Rate Limited Wallet has been ported to new consensus and updated Flaxlisp methods. +- We are down to only one sub dependency that does not ship binary wheels for all four platforms. The only platform still impacted is ARM64 (generally Raspberry Pi) but that only means that you still need the minor build tools as outlined on the [wiki](https://github.com/Flax-Network/flax-blockchain/wiki/Raspberry-Pi). - We upgraded to Electron 9.4.2 for the GUI. - We have upgraded to py-setproctitle 1.2.2. We now have binary wheels for setproctitle on all four platforms and make it a requirement in setup.py. It is run-time optional if you wish to disable it. ### Fixed - On the Farm page of the GUI Latest Block Challenge is now populated. This shows you the actual challenge that came from the Timelord. Index is the signage point index in the current slot. There are 64 signage points every 10 minutes on average where 32 sub blocks can be won. -- Last Attempted Proof is now fixed. This will show you the last time one of your plots passed the [plot filter](https://github.com/Chia-Network/chia-blockchain/wiki/FAQ#what-is-the-plot-filter-and-why-didnt-my-plot-pass-it). +- Last Attempted Proof is now fixed. This will show you the last time one of your plots passed the [plot filter](https://github.com/Flax-Network/flax-blockchain/wiki/FAQ#what-is-the-plot-filter-and-why-didnt-my-plot-pass-it). - Plot filename is now back in the Plots table of the GUI. - There was a bug in adding a sub block to weight proofs and an issue in the weight proof index. - Over time the node would think that there were no peers attached with peak sub block heights higher than 0. @@ -650,7 +650,7 @@ all fields that referred to sub blocks are changed to blocks. ### Added - The GUI now displays sub blocks as well as transaction blocks on the Full Node page. -- `chia plots check` enforces a minimum of `-n 5` to decrease false negatives. Thanks to @eFishCent for these ongoing pull requests! +- `flax plots check` enforces a minimum of `-n 5` to decrease false negatives. Thanks to @eFishCent for these ongoing pull requests! - Testnets and mainnets will now have an initial period of sub blocks where transactions are blocked. - Transaction volume testing added to tests and various tests have been sped up. - We have added connection limits for max_inbound_wallet, max_inbound_farmer, and max_inbound_timelord. @@ -659,13 +659,13 @@ all fields that referred to sub blocks are changed to blocks. - On starting full node, the weight proof cache does not attempt to load all sub blocks. Startup times are noticeably improved though there remains a hesitation when validating the mempool. Our clvm Rust implementation, which will likely ship in the next release, will drop example processing times from 180 to 3 seconds. - Changes to weight proofs and sub block storage and cacheing required a new database schema. This will require a re-sync or obtaining a synced blockchain_v23.db. -- clvm bytecode is now generated and confirmed that the checked-in clvm and ChiaLisp code matches the CI compiled code. -- We have removed the '-r' flag from `chia` as it was being overridden in most cases by the `-r` for restart flag to `chia start`. Use `chia --root-path` instead. -- `chia -h` now recommends `chia netspace -d 192` which is approximately one hours worth of sub blocks. Use `-d 1000` to get the same estimate of netspace as the RPC and GUI. -- `chia show -c` now displays in MiB and the GUI has been changed to MiB to match. -- `chia configure` now accepts the shorter `-upnp` and `-log-level` arguments also. -- `chia plots check` now defaults to `-n 30` instead of `-n 1` - HT @eFishCent. -- `chia plots create` now enforces a minimum of k=22. As a reminder, anything less than k=32 is just for testing and be careful extrapolating performance of a k less than 30 to a k=32 or larger. +- clvm bytecode is now generated and confirmed that the checked-in clvm and FlaxLisp code matches the CI compiled code. +- We have removed the '-r' flag from `flax` as it was being overridden in most cases by the `-r` for restart flag to `flax start`. Use `flax --root-path` instead. +- `flax -h` now recommends `flax netspace -d 192` which is approximately one hours worth of sub blocks. Use `-d 1000` to get the same estimate of netspace as the RPC and GUI. +- `flax show -c` now displays in MiB and the GUI has been changed to MiB to match. +- `flax configure` now accepts the shorter `-upnp` and `-log-level` arguments also. +- `flax plots check` now defaults to `-n 30` instead of `-n 1` - HT @eFishCent. +- `flax plots create` now enforces a minimum of k=22. As a reminder, anything less than k=32 is just for testing and be careful extrapolating performance of a k less than 30 to a k=32 or larger. - We have updated development dependencies for setuptools, yarl, idna, multidict, and chardet. - Updated some copyright dates to 2021. @@ -676,8 +676,8 @@ all fields that referred to sub blocks are changed to blocks. - Inbound and outbound peer connection limits were not being honored. - Weight proofs were not correctly extending. - In some cases when closing a p2p connection to another node, there was an infinite "Closing" loop. -- `chia show -c` was showing upload MiB in the download column and vice versa. @pyl and @psydafke deserves credit for insisting it was broken and @kd637xx for the PR assist. -- `chia show` handles sub block 0 better. +- `flax show -c` was showing upload MiB in the download column and vice versa. @pyl and @psydafke deserves credit for insisting it was broken and @kd637xx for the PR assist. +- `flax show` handles sub block 0 better. ## [1.0beta22] aka Beta 1.22 - 2021-01-19 @@ -685,21 +685,21 @@ all fields that referred to sub blocks are changed to blocks. - Node now attempts to pre-validate and cache transactions. - The harvester will try to not load a plot file that is too small for its k size. This should help keep from partial plots being found when they are copied into a harvester directory. Harvester will check again on the next challenge and find a completed copy of a plot file then. -- `chia plots create -x` skips adding [final dir] to harvester for farming +- `flax plots create -x` skips adding [final dir] to harvester for farming ### Changed - We now use bech32m and have added the bech32m tests from Pieter Wuille (@sipa) outlined [here](https://gist.github.com/sipa/14c248c288c3880a3b191f978a34508e) with thanks. - In the GUI, choosing to parallel plot with a delay now is a delay between the start of the parallel plots started in one session. -- Removed loading plot file names when starting `chia plots create`; decreases plotter time when there are a lot of plots on the machine. Huge thanks to @eFishCent for this PR! +- Removed loading plot file names when starting `flax plots create`; decreases plotter time when there are a lot of plots on the machine. Huge thanks to @eFishCent for this PR! ### Fixed - Various fixes to improve node's ability to sync. There are still plenty of additional performance improvements coming for node so expect it to get easier to run on less powerful devices. - Wallet now handles large amounts of coins much better and generally syncs better. - Thanks to @nup002 for the PR to use scientific notation in the logs for address_manager.select_peer timings. -- `chia show -h` now correctly states that you use the first 8 characters of the node id to remove a node on the cli. -- Thank you to @wallentx for adding better help for `chia configure --enable-upnp`. +- `flax show -h` now correctly states that you use the first 8 characters of the node id to remove a node on the cli. +- Thank you to @wallentx for adding better help for `flax configure --enable-upnp`. - Pull requests from forks won't have failures on CI. ## [1.0beta21] aka Beta 1.21 - 2021-01-16 @@ -707,7 +707,7 @@ all fields that referred to sub blocks are changed to blocks. ### Added - The cli now warns if you attempt to create a plot smaller than k=32. -- `chia configure` now lets you enable or disable uPnP. +- `flax configure` now lets you enable or disable uPnP. - If a peer gives a bad weight proof it will now be disconnected. ### Changed @@ -721,7 +721,7 @@ all fields that referred to sub blocks are changed to blocks. - Weight proofs were failing to verify contributing to a chain stall. This release gets things moving again but nodes are using too much CPU and can pause/lag at times. This may resolve as people upgrade to Beta 21. - A toxic combination of transaction limits set too high and a non performant clvm kept the chain stalled. A faster rust implementation of clvm is already nearing completion. -- `chia netspace -s` would not correctly look up the start block height by block hash. Additionally netspace now flips to PiB above 1024 TiB. To compare netspace to `chia show` of the GUI use `chia netspace -d 1000` as `chia netspace` defaults to `-d 192` which is one hour. +- `flax netspace -s` would not correctly look up the start block height by block hash. Additionally netspace now flips to PiB above 1024 TiB. To compare netspace to `flax show` of the GUI use `flax netspace -d 1000` as `flax netspace` defaults to `-d 192` which is one hour. ## [1.0beta20] aka Beta 1.20 - 2021-01-14 @@ -749,7 +749,7 @@ all fields that referred to sub blocks are changed to blocks. - Welcome to the new consensus. This release is an all but a full re-write of the blockchain in under 30 days. There is now only one tip of the blockchain but we went from two chains to three. Block times are now a little under a minute but there are a couple of sub blocks between each transaction block. A block is also itself a special kind of sub block and each sub block rewards the farmer who won it 1 TXCH. Sub blocks come, on average, about every 17 to 18 seconds. - Starting with this Beta, there are 4608 opportunities per day for a farmer to win 1 TXCH compared to Beta 18 where there were 288 opportunities per day for a farmer to win 16 TXCH. -- There is a lot more information and explanation of the new consensus algorithm in the New Consensus Working Document linked from [chia.net](https://chia.net/). Among the improvements this gives the Chia blockchain are a much higher security level against all attacks, more frequent transaction blocks that have less time variation between them and are then buried under confirmations (sub blocks also count towards re-org security) much more quickly. +- There is a lot more information and explanation of the new consensus algorithm in the New Consensus Working Document linked from [flaxnetwork.org](https://flaxnetwork.org/). Among the improvements this gives the Flax blockchain are a much higher security level against all attacks, more frequent transaction blocks that have less time variation between them and are then buried under confirmations (sub blocks also count towards re-org security) much more quickly. - New consensus means this is a very hard fork. All of your TXCH from Beta 17/18 will be gone. Your plots and keys will work just fine however. You will have to sync to the new chain. - You now have to sync 16 times more "blocks" for every 5 minutes of historical time so syncing is slower than it was on the old chain. We're aware of this and will be speeding it up and addressing blockchain database growth in the nest couple of releases. - Prior to this Beta 19, we had block times that targeted 5 minutes and rewarded 16 TXCH to one farmer. Moving forward we have epoch times that target 10 minutes and reward 32 TXCH to 32 farmers about every 17-18 seconds over that period. This has subtle naming and UI impacts in various places. @@ -758,9 +758,9 @@ all fields that referred to sub blocks are changed to blocks. - You can now plot in parallel using the GUI. A known limitation is that you can't yet specify that you want 4 sets of two parallel plots. Each parallel plot added starts immediately parallel. We will continue to improve this. - The GUI now warns if you attempt to create a plot smaller than k=32. - Added Chinese language localization (zh-cn). A big thank you to @goomario for their pull request! -- You can now specify which private key to use for `chia plots create`. After obtaining the fingerprint from `chia keys show`, try `chia plots create -a FINGERPRINT`. Thanks to @eFishCent for this pull request! +- You can now specify which private key to use for `flax plots create`. After obtaining the fingerprint from `flax keys show`, try `flax plots create -a FINGERPRINT`. Thanks to @eFishCent for this pull request! - We use a faster hash to prime function for chiavdf from the current release of gmp-6.2.1 which we have upgraded chiavdf and blspy to support. -- There is a new cli command - `chia configure`. This allows you to update certain configuration details like log level in config.yaml from the command line. This is particularly useful in containerization and linux automation. Try `chia configure -h`. Note that if chia services are running and you issue this command you will have to restart them for changes to take effect but you can use this command in the venv when no services are running or call it directly by path in the venv without activating the venv. Expect the options for this command to expand. +- There is a new cli command - `flax configure`. This allows you to update certain configuration details like log level in config.yaml from the command line. This is particularly useful in containerization and linux automation. Try `flax configure -h`. Note that if flax services are running and you issue this command you will have to restart them for changes to take effect but you can use this command in the venv when no services are running or call it directly by path in the venv without activating the venv. Expect the options for this command to expand. - We now fully support Python 3.9. ### Changed @@ -769,23 +769,23 @@ all fields that referred to sub blocks are changed to blocks. - The new plots page offers advanced plotting options in the various "Show Advanced Options" fold outs. - The plotter supports the new bitfield back propagation method and the old method from Beta 17. To choose the old method add a `-e` to the command line or choose "Disable bitfield plotting" in "Show Advanced Options" of the Plots tab. Bitfield back propagation writes about 13% less total writes and can be faster on some slower hard drive temp spaces. For now, SSD temp space will likely plot faster with bitfield back propagation disabled. We will be returning to speed enhancements to the plotter as we approach and pass our mainnet launch. - The Farm tab in the GUI is significantly enhanced. Here you have a dashboard overview of your farm and your activity in response to challenges blockchain challnegs, how long it will take you - on average - to win a block, and how much TXCH you've won so far. Harvester and Full Node connections have moved to Advanced Options. -- Harvester and farmer will start when the GUI starts instead of waiting for key selection if there are already keys available. This means you will start farming on reboot if you have the Chia application set to launch on start. +- Harvester and farmer will start when the GUI starts instead of waiting for key selection if there are already keys available. This means you will start farming on reboot if you have the Flax application set to launch on start. - Testnet is now running at the primary port of 58444. Update your routers appropriately. This opens 8444 for mainnet. - All networking code has been refactored and mostly moved to websockets. -- RPCs and daemon now communicate over TLS with certificates that are generated into `~/.chia/VERSION/config/` +- RPCs and daemon now communicate over TLS with certificates that are generated into `~/.flax/VERSION/config/` - We have moved to taproot across all of our transactions and smart transactions. - We have adopted chech32m encoding of keys and addresses in parallel to bitcoin's coming adoption of bech32m. - The rate limited wallet was updated and re-factored. -- All appropriate Chialisp smart transactions have been updated to use aggsig_me. +- All appropriate Flaxlisp smart transactions have been updated to use aggsig_me. - Full node should be more aggressive about finding other peers. - Peer disconnect messages are now set to log level INFO down from WARNING. - chiavdf now allows passing in input to a VDF for new consensus. -- sha256tree has been removed from Chialisp. -- `chia show -s` has been refactored to support the new consensus. -- `chia netspace` has been refactored for new consensus. +- sha256tree has been removed from Flaxlisp. +- `flax show -s` has been refactored to support the new consensus. +- `flax netspace` has been refactored for new consensus. - aiohttp, clvm-tools, colorlog, concurrent-log-handler, keyring, cryptography, and sortedcontainers have been upgraded to their current versions. -- Tests now place a cache of blocks and plots in the ~/.chia/ directory to speed up total testing time. -- Changes were made to chiapos to correctly support the new bitfiled backpropogation on FreeBSD and OpenBSD. With the exception of needing to work around python cryptography as outlined on the wiki, FreeBSD and OpenBSD should be able to compile and run chia-blockchain. +- Tests now place a cache of blocks and plots in the ~/.flax/ directory to speed up total testing time. +- Changes were made to chiapos to correctly support the new bitfiled backpropogation on FreeBSD and OpenBSD. With the exception of needing to work around python cryptography as outlined on the wiki, FreeBSD and OpenBSD should be able to compile and run flax-blockchain. - With the change to new consensus many components of the chain and local database are not yet stored optimally. Startup and sync times may be slower than usual so please be patient. This will improve next release. - Errata: Coinbase amount is missing from the GUI Block view. - Eratta: wallet Backup, and Fly-sync on the wallet are currently not working. @@ -796,15 +796,15 @@ all fields that referred to sub blocks are changed to blocks. - blspy was bumped to 0.3.1 which now correctly supports the aggsig of no signatures and is built with gmp-6.2.1. - Fixed a plotter crash after pulling a disk without ejecting it first. - `sh install.sh` now works properly on Linux Mint. -- `chia show -s` now is less brain dead when a node is initially starting to sync. +- `flax show -s` now is less brain dead when a node is initially starting to sync. ## [1.0beta18] aka Beta 1.18 - 2020-12-03 ### Added - F1 generation in the plotter is now fully parallel for a small speedup. -- We have bitfield optimized phase 2 of plotting. There is only about a 1% increase in speed from this change but there is a 12% decrease in writes with a penalty of 3% more reads. More details in [PR 120](https://github.com/Chia-Network/chiapos/pull/120). Note that some sorts in phase 2 and phase 3 will now appear "out of order" and that is now expected behavior. -- Partial support for Python 3.9. That includes new versions of Chia dependencies like chiabip158. +- We have bitfield optimized phase 2 of plotting. There is only about a 1% increase in speed from this change but there is a 12% decrease in writes with a penalty of 3% more reads. More details in [PR 120](https://github.com/Flax-Network/chiapos/pull/120). Note that some sorts in phase 2 and phase 3 will now appear "out of order" and that is now expected behavior. +- Partial support for Python 3.9. That includes new versions of Flax dependencies like chiabip158. ### Changed @@ -813,10 +813,10 @@ all fields that referred to sub blocks are changed to blocks. ### Fixed -- A segfault caused by memory leaks in bls-library has been fixed. This should end the random farmer and harvester crashes over time as outlined in [Issue 500](https://github.com/Chia-Network/chia-blockchain/issues/500). +- A segfault caused by memory leaks in bls-library has been fixed. This should end the random farmer and harvester crashes over time as outlined in [Issue 500](https://github.com/Flax-Network/flax-blockchain/issues/500). - Plotting could hang up retrying in an "error 0" state due to a bug in table handling in some edge cases. - CPU utilization as reported in the plotter is now accurate for Windows. -- FreeBSD and OpenBSD should be able to build and install chia-blockchain and its dependencies again. +- FreeBSD and OpenBSD should be able to build and install flax-blockchain and its dependencies again. - Starting with recent setuptools fixes, we can no longer pass an empty string to the linker on Windows when building binary wheels in the sub repos. Thanks @jaraco for tracking this down. ## [1.0beta17] aka Beta 1.17 - 2020-10-22 @@ -827,25 +827,25 @@ all fields that referred to sub blocks are changed to blocks. ### Fixed -- In the GUI there was [a regression](https://github.com/Chia-Network/chia-blockchain/issues/484) that removed the scroll bar on the Plot page. The scroll bar has returned! +- In the GUI there was [a regression](https://github.com/Flax-Network/flax-blockchain/issues/484) that removed the scroll bar on the Plot page. The scroll bar has returned! - In Dark Mode you couldn't read the white on white plotting log text. - To fix a bug in Beta 15's plotter we introduced a fixed that slowed plotting by as much as 25%. - Certain NTFS root mount points couldn't be used for plotting or farming. -- Logging had [a regression](https://github.com/Chia-Network/chia-blockchain/issues/485) where log level could no longer be set by service. +- Logging had [a regression](https://github.com/Flax-Network/flax-blockchain/issues/485) where log level could no longer be set by service. ## [1.0beta16] aka Beta 1.16 - 2020-10-20 ### Added -- The Chia GUI now supports dark and light mode. -- The GUI now supports translations and localizations. If you'd like to add your language you can see the examples in [the locales directory](https://github.com/Chia-Network/chia-blockchain/tree/dev/electron-react/src/locales) of the chia-blockchain repository. -- `chia check plots` now takes a `-g` option that allows you to specify a matching path string to only check a single plot file, a wild card list of plot files, or all plots in a single directory instead of the default behavior of checking every directory listed in your config.yaml. A big thank you to @eFishCent for this pull request! +- The Flax GUI now supports dark and light mode. +- The GUI now supports translations and localizations. If you'd like to add your language you can see the examples in [the locales directory](https://github.com/Flax-Network/flax-blockchain/tree/dev/electron-react/src/locales) of the flax-blockchain repository. +- `flax check plots` now takes a `-g` option that allows you to specify a matching path string to only check a single plot file, a wild card list of plot files, or all plots in a single directory instead of the default behavior of checking every directory listed in your config.yaml. A big thank you to @eFishCent for this pull request! - Better documentation of the various timelord options in the default config.yaml. ### Changed - The entire GUI has been refactored for code quality and performance. -- Updated to chiapos 0.12.32. This update significantly speeds up the F1/first table plot generation. It also now can log disk usage while plotting and generate graphs. More details in the [chiapos release notes](https://github.com/Chia-Network/chiapos/releases/tag/0.12.32). +- Updated to chiapos 0.12.32. This update significantly speeds up the F1/first table plot generation. It also now can log disk usage while plotting and generate graphs. More details in the [chiapos release notes](https://github.com/Flax-Network/chiapos/releases/tag/0.12.32). - Node losing or not connecting to another peer node (which is entirely normal behaviour) is now logged at INFO and not WARNING. Your logs will be quieter. - Both the GUI and CLI now default to putting the second temporary directory files into the specified temporary directory. - SSL Certificate handling was refactored along with Consensus constants, service launching, and internal configuration management. @@ -900,15 +900,15 @@ all fields that referred to sub blocks are changed to blocks. - `sh install.sh` was upgraded so that on Ubuntu it will install any needed OS dependencies. - Wallet and puzzlehash generation have been refactored and simplified. - Wallet has had various sync speed ups added. -- The rpc interfaces of all chia services have been refactored, simplified, and had various additional functionality added. -- Block timestamps are now stored in the wallet database. Both database versions were incremented and databases from previous versions will not work with Beta 14. However, upon re-sync all test chia since Beta 12 should appear in your wallet. +- The rpc interfaces of all flax services have been refactored, simplified, and had various additional functionality added. +- Block timestamps are now stored in the wallet database. Both database versions were incremented and databases from previous versions will not work with Beta 14. However, upon re-sync all test flax since Beta 12 should appear in your wallet. - All vestigial references to plots.yaml have been removed. ### Fixed - Temporary space required for each k size was updated with more accurate estimates. - Tables in the README.MD were not rendering correctly on Pypi. Thanks again @altendky. -- Chiapos issue where memory was spiking and increasing +- Flaxpos issue where memory was spiking and increasing - Fixed working space estimates so they are exact - Log all errors in chiapos - Fixed a bug that was causing Bluebox vdfs to fail. @@ -919,7 +919,7 @@ all fields that referred to sub blocks are changed to blocks. ### Changed -- Long_description_content_type is now set to improve chia-blockchian's Pypi entry. Thanks to @altendky for this pull request. +- Long_description_content_type is now set to improve flax-blockflaxn's Pypi entry. Thanks to @altendky for this pull request. - A minor edit was made to clarify that excessive was only related to trolling in the Code of Conduct document. ### Fixed @@ -932,13 +932,13 @@ all fields that referred to sub blocks are changed to blocks. ### Added - Rate limited wallets can now have unspent and un-spendable funds clawed back by the Admin wallet. -- You can now backup your wallet related metadata in an encrypted and signed file to a free service from Chia Network at backup.chia.net. Simply having a backup of your private key will allow you to fully restore the state of your wallet including coloured coins, rate limited wallets, distributed identity wallets and many more. Your private key is used to automatically restore the last backup you saved to the Chia backup cloud service. This service is open source and ultimately you will be able to configure your backups to go to backup.chia.net, your own installation, or a third party's version of it. +- You can now backup your wallet related metadata in an encrypted and signed file to a free service from Flax Network at backup.flaxnetwork.org. Simply having a backup of your private key will allow you to fully restore the state of your wallet including coloured coins, rate limited wallets, distributed identity wallets and many more. Your private key is used to automatically restore the last backup you saved to the Flax backup cloud service. This service is open source and ultimately you will be able to configure your backups to go to backup.flaxnetwork.org, your own installation, or a third party's version of it. - Added a Code of Conduct in CODE_OF_CONDUCT.md. - Added a bug report template in `.github/ISSUE_TEMPLATE/bug_report.md`. ### Changed -- This is a new blockchain as we changed how the default puzzle hashes are generated and previous coins would not be easy to spend. Plots made with Beta 8 and newer continue to work, but all previous test chia are left on the old chain and do not migrate over. Configuration data like plot directories automatically migrate in your `~/.chia` directory. +- This is a new blockchain as we changed how the default puzzle hashes are generated and previous coins would not be easy to spend. Plots made with Beta 8 and newer continue to work, but all previous test flax are left on the old chain and do not migrate over. Configuration data like plot directories automatically migrate in your `~/.flax` directory. - Proof of Space now requires significantly less temp space to generate a new plot. A k=32 that used to require 524GiB now requires only 313GiB - generally a 40% decrease across all k sizes. - When plotting, instead of 1 monolithic temp file, there are now 8 files - one for each of the 7 tables and one for sorting plot data. These files are deleted as the `-2` or `-d` final file is written so the final file can fit within the footprint of the temporary files on the same filesystem. - We've made various additional CPU optimizations to the Proof of Space plotter that reduces plotting time by an additional 13%. These changes will also reduce CPU utilization in harvesting. @@ -947,26 +947,26 @@ all fields that referred to sub blocks are changed to blocks. - Coloured coins have been updated to simplify them, remove 'a', and stop using an 'auditor'. - clvm has been significantly changed to support the new coloured coins implementation. - Bumped cryptography to 3.1. Cryptography is now publishing ARM64 binary wheels to PyPi so Raspberry Pi installs should be even easier. -- `chia init` now automatically discovers previous releases in each new release. +- `flax init` now automatically discovers previous releases in each new release. ### Fixed -- `chia show -w` should now more reliably work. Wallet balances should be more often correct. +- `flax show -w` should now more reliably work. Wallet balances should be more often correct. - View -> Developer -> Developer Tools now correctly opens the developer tools. Thank you to @roxaaams for this pull request! -- Fixed 'Receive Address' typo in Wallet. Thanks @meurtn on Keybase. -- Fixed a typo in `chia show -w` with thanks to @pyl on Keybase. -- In Windows the start menu item is now Chia Network and the icon in Add/Remove is updated. +- Fixed 'Receive Address' typo in Wallet. Thanks @meurtn on Discord. +- Fixed a typo in `flax show -w` with thanks to @pyl on Discord. +- In Windows the start menu item is now Flax Network and the icon in Add/Remove is updated. ## [1.0beta11] aka Beta 1.11 - 2020-08-24 ### Added -- The Chia UI now has a proper About menu entry that gives the various component versions and directs people to submit issues on GitHub. Thank you to @freddiecoleman for this pull request! -- Ability to run only the farmer, wallet, or timelord services, for more advanced configurations (chia run farmer-only, wallet-only, timelord-only) +- The Flax UI now has a proper About menu entry that gives the various component versions and directs people to submit issues on GitHub. Thank you to @freddiecoleman for this pull request! +- Ability to run only the farmer, wallet, or timelord services, for more advanced configurations (flax run farmer-only, wallet-only, timelord-only) ### Changed -- To complement the new About menu, we have revamped all Electron menus and made them OS native. There are now direct links to the Wiki, Keybase, and FAQ in the Help menu. +- To complement the new About menu, we have revamped all Electron menus and made them OS native. There are now direct links to the Wiki, Discord, and FAQ in the Help menu. - There are minor improvements to how working space is calculated and displayed by the plotter. The plotter also has additional debugging information in its output. - Successful plots only have an atomic rename. @@ -974,7 +974,7 @@ all fields that referred to sub blocks are changed to blocks. - kOffsetSize should have been 10 bits and not 9. This was causing plots, especially larger plots, to fail with "Error 0". This bug was introduced in Beta 8 with the new plot file format. - A bug in aiosqlite was causing tests to hang - especially on the ci. This may also have been causing wallet database corruption. -- `chia show -w` now correctly outputs all wallet types and balances from the local wallet. +- `flax show -w` now correctly outputs all wallet types and balances from the local wallet. ## [1.0beta10] aka Beta 1.10 - 2020-08-18 @@ -983,12 +983,12 @@ all fields that referred to sub blocks are changed to blocks. - Meet our new Rate Limited wallet. You can now fund a wallet from an Admin wallet that will set how many coins can be spent over a given range of blocks for a given User wallet. Once combined with on chain wallet recovery, this makes it much easier to secure your "spending money" wallet so that if it is compromised you have time to get most of the funds back before an attacker can steal them all. This wallet should be considered alpha in this release as additional fixes and functionality will be coming in subsequent releases. - We've added unhardened HD keys to bls-signatures for the smart wallets that need them. We've added significant cross project testing to our BLS implementation. - The python implementation of bls-signatures is now current to the new specification. -- `chia show -b` now returns plot public key and pool public key for each block. -- Added cbor2 binary wheels for ARM64 to the Chia simple site. Raspberry Pi should be just a little easier to install. +- `flax show -b` now returns plot public key and pool public key for each block. +- Added cbor2 binary wheels for ARM64 to the Flax simple site. Raspberry Pi should be just a little easier to install. ### Changed -- Wallet addresses and other key related elements are now expressed in Chech32 which is the Chia implementation of [Bech32](https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki). All of your old wallet addresses will be replaced with the new Chech32 addresses. The only thing you can't do is send test chia between 1.8/1.9 and 1.10 software. Anyone who upgrades to 1.10 will keep their transactions and balances of test chia from the earlier two releases however. +- Wallet addresses and other key related elements are now expressed in Chech32 which is the Flax implementation of [Bech32](https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki). All of your old wallet addresses will be replaced with the new Chech32 addresses. The only thing you can't do is send test flax between 1.8/1.9 and 1.10 software. Anyone who upgrades to 1.10 will keep their transactions and balances of test flax from the earlier two releases however. - We added a first few enhancements to plotting speed. For a k=30 on a ramdisk with `-b 64 GiB` it results in an 11% speedup in overall plotting speed and a 23% improvement in phase 1 speed. Many more significant increases in plotting speed are in the works. - The proof of space document in chiapos has been updated to the new format and edited for clarity. Additionally GitHub actions now has the on demand ability to create the PDF version. - Relic has upstreamed our changes required for the IETF BLS standard. We now build directly from the Relic repository for all but Windows and will be migrating Windows in the next release. @@ -998,8 +998,8 @@ all fields that referred to sub blocks are changed to blocks. ### Fixed - Proof of space plotting now correctly calculates the total working space used in the `-t` directory. -- `chia show -w` now displays a message when balances cannot be displayed instead of throwing an error. Thanks to @freddiecoleman for this fix! -- Fix issue with shutting down full node (full node processes remained open, and caused a spinner when launching Chia) +- `flax show -w` now displays a message when balances cannot be displayed instead of throwing an error. Thanks to @freddiecoleman for this fix! +- Fix issue with shutting down full node (full node processes remained open, and caused a spinner when launching Flax) - Various code review alerts for comparing to a wider type in chiapos were fixed. Additionally, unused code was removed from chiapos - Benchmarking has been re-enabled in bls-signatures. - Various node security vulnerabilities were addressed. @@ -1009,9 +1009,9 @@ all fields that referred to sub blocks are changed to blocks. ### Added -- See wallet balances in command line: `chia show -w` +- See wallet balances in command line: `flax show -w` - Retry opening invalid plots every 20 minutes (so you can copy a large plot into a plot directory.) -- We've added `chia keys sign` and `chia keys verify` to allow farmers to certify their ownership of keys. +- We've added `flax keys sign` and `flax keys verify` to allow farmers to certify their ownership of keys. - Windows BLS Signature library now uses libsodium for additional security. - You can now backup and restore Smart Wallet metadata. - Binary wheels for ARM64/aarch64 also build for python 3.7. @@ -1021,7 +1021,7 @@ all fields that referred to sub blocks are changed to blocks. ### Changed -- `chia start wallet-server` changed to `chia start wallet`, for consistency. +- `flax start wallet-server` changed to `flax start wallet`, for consistency. - All data size units are clarified to displayed in GiB instead of GB (powers of 1024 instead of 1000.) - Better error messages for restoring wallet from mnemonic. @@ -1041,7 +1041,7 @@ the blspy/bls-signatures library. ### Deprecated -- Removed legacy scripts such as chia-stop-server, chia-restart-harvester, etc. +- Removed legacy scripts such as flax-stop-server, flax-restart-harvester, etc. ## [1.0beta8] aka Beta 1.8 - 2020-07-16 @@ -1056,7 +1056,7 @@ the now deprecated AES methods. This should increase plotting speed and support more processors. - Plot refreshing happens during all new challenges and only new/modified files are read. -- Updated [blspy](https://github.com/Chia-Network/bls-signatures) to use the +- Updated [blspy](https://github.com/Flax-Network/bls-signatures) to use the new [IETF standard for BLS signatures](https://tools.ietf.org/html/draft-irtf-cfrg-bls-signature-02). - Added a faster VDF process which generates n-wesolowski proofs quickly after the VDF result is known. This requires a high number of CPUs. To use it, @@ -1083,11 +1083,11 @@ that ci runs successfully complete from PRs or forked repositories. - Farmer now sends challenges after a handshake with harvester. - The bls-signatures binary wheels include libsodium on all but Windows which we expect to add in future releases. -- The chia executable is now available if installing from the Windows or MacOS -Graphical installer. Try `./chia -h` from -`~\AppData\Local\Chia-Blockchain\app-0.1.8\resources\app.asar.unpacked\daemon\` +- The flax executable is now available if installing from the Windows or MacOS +Graphical installer. Try `./flax -h` from +`~\AppData\Local\Flax-Blockchain\app-0.1.8\resources\app.asar.unpacked\daemon\` in Windows or -`/Applications/Chia.app/Contents/Resources/app.asar.unpacked/daemon` on MacOS. +`/Applications/Flax.app/Contents/Resources/app.asar.unpacked/daemon` on MacOS. ### Changed @@ -1113,8 +1113,8 @@ has the correct farmer's secret key too. farmer and full node protocols. - 255/256 filter which allows virtually unlimited plots per harvester or drive. - Improved create_plots and check_plots scripts, which are now -"chia plots create" and "chia plots check". -- Add plot directories to config.yaml from the cli with "chia plots add". +"flax plots create" and "flax plots check". +- Add plot directories to config.yaml from the cli with "flax plots add". - Use real plot sizes in UI instead of a formula/ - HD keys now use EIP 2333 format instead of BIP32, for compatibility with other chains. @@ -1158,20 +1158,20 @@ relic. We will make a patch available for these systems shortly. - Added ability to import private keys in the UI. - Added ability to see private keys and mnemonic seeds in the keys menu - User can specify log level in the config file (defaults to info.) -- The Windows installer is now signed by a Chia Network certificate. It may take some time to develop enough reputation to not warn multiple times during install. +- The Windows installer is now signed by a Flax Network certificate. It may take some time to develop enough reputation to not warn multiple times during install. ### Changed - Plots are now refreshed in the UI after each plot instead of at the end of plotting. - We have made performance improvements to plotting speed on all platforms. - The command line plotter now supports specifying it's memory buffer size. -- Test plots for the simulation and testing harness now go into `~/.chia/test-plots/` -- We have completely refactored all networking code towards making each Chia service use the same default networking infrastructure and move to websockets as the default networking wire protocol. -- We added additional improvements and more RPCs to the start daemon and various services to continue to make chia start/stop reliable cross platform. +- Test plots for the simulation and testing harness now go into `~/.flax/test-plots/` +- We have completely refactored all networking code towards making each Flax service use the same default networking infrastructure and move to websockets as the default networking wire protocol. +- We added additional improvements and more RPCs to the start daemon and various services to continue to make flax start/stop reliable cross platform. - The install.sh script now discovers if it's running on Ubuntu less than 20.04 and correctly upgrades node.js to the current stable version. - For GitHub ci builds of the Windows installer, editbin.exe is more reliably found. - All installer ci builds now obtain version information automatically from setuptools_scm and convert it to an installer version number that is appropriate for the platform and type of release (dev versus release.) -- We now codesign the Apple .dmg installer with the Chia Network developer ID on both GitHub Actions and Azure Pipelines. We will be notarizing and distributing the Azure Pipelines version as it's built on MacOS Mojave (10.14.6) for stronger cross version support. +- We now codesign the Apple .dmg installer with the Flax Network developer ID on both GitHub Actions and Azure Pipelines. We will be notarizing and distributing the Azure Pipelines version as it's built on MacOS Mojave (10.14.6) for stronger cross version support. ### Fixed @@ -1180,7 +1180,7 @@ relic. We will make a patch available for these systems shortly. - 1.6 introduced a bug where certain very many core machines would sync the blockchain very slowly. - The plotter log in the UI should scroll more reliably. - The plotter UI should display the correct log on all platforms -- Starting chia now waits for the full node to be active before contacting the introducer. +- Starting flax now waits for the full node to be active before contacting the introducer. ## [1.0beta6] aka Beta 1.6 - 2020-06-01 @@ -1189,15 +1189,15 @@ relic. We will make a patch available for these systems shortly. - Windows and MacOS now have one click installers that then send users to a GUI on both platforms to farm or use their wallets. Windows is built on GitHub Actions and MacOS is also built on Azure Pipelines so as to build on Mojave. - You can see and control your farmer, harvester, and plotter from the GUI on Windows, MacOS, and Linux. - Create plots and see the plotting log from a GUI on Windows, MacOS, and Linux. -- You can now create or import private keys with a 24 word mnemonic, both in the UI and 'chia keys' command line. +- You can now create or import private keys with a 24 word mnemonic, both in the UI and 'flax keys' command line. - You can delete and change active keys from the GUI and cli. - We added a new keychain system that replaces keys.yaml, and migrates existing users from keys.yaml. It utilizes each OS's keychain for slightly more secure key storage. -- We added a `chia keys` command line program, to see, add, and remove private keys. +- We added a `flax keys` command line program, to see, add, and remove private keys. - We added RPC servers and RPC client implementations for Farmer and Harvester. The new UI uses these for additional information and functionality. - We added total network storage space estimation to the node RPC at the `/get_network_space` endpoint instead of only being available in the cli. The RPC endpoint takes two block header hashes and estimates space between those header hashes. - Logs now autorotate. Once the debug.log reaches 20MB it is compressed and archived keeping 7 historical 20MB logs. - We now have a CHANGELOG.md that adheres closely to the [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) standard. We merged in the version history and updated some previous release notes to capture items important to the change log. We are modifying our release process to accumulate changes at the top of the change log and then copy those to the release notes at the time of the release. -- We added [lgtm](https://lgtm.com/) source analysis on pull request to the chia-blockchain, chiapos, chiavdf, chiabip158, and bls-library repositories to add some automated security analysis to our ci. +- We added [lgtm](https://lgtm.com/) source analysis on pull request to the flax-blockchain, chiapos, chiavdf, chiabip158, and bls-library repositories to add some automated security analysis to our ci. ### Changed @@ -1205,7 +1205,7 @@ relic. We will make a patch available for these systems shortly. - We replaced the Electron/JavaScript interface with a React user interface which is cleaner and more responsive. - We now have a multithreaded harvester to farm more plots concurrently. This is especially faster when there are multiple disks being harvested. The class is also made thread safe with mutex guards. This is achieved by releasing GIL in the python bindings when fetching qualities and proofs. We estimate that the former guidance of only 50 plots per physical drive should be updated to 250-350 plots per physical drive. We will continue to improve the plots per physical drive limit during the beta period. - Syncing a node is now much faster and uses less memory. -- `chia netspace` has been refactored to use the `/get_network_space` RPC. The command +- `flax netspace` has been refactored to use the `/get_network_space` RPC. The command syntax has changed slightly. By default it calculates the last 24 blocks from the current LCA. Optionally you can use the `-b` flag to start the calculation from a different block height. Use `-d` to specify the delta number of blocks back into history to estimate over from either LCA or your `-b` block height. @@ -1220,8 +1220,8 @@ relic. We will make a patch available for these systems shortly. - In beta 1.5 we introduced a bug in aggsig and aggsig-me that we have fixed in this release. That forced a hard fork of the chain so coins and balances are lost from beta 1.5. There is no impact on existing plots. - Starting and stopping servers now works much more reliably. -- `chia-check-plots` uses the plot root and checks the plots in the same manner as harvester. -- `chia-check-plots` now does not override plots.yaml, which means concurrent plots will properly be added to plots.yaml. +- `flax-check-plots` uses the plot root and checks the plots in the same manner as harvester. +- `flax-check-plots` now does not override plots.yaml, which means concurrent plots will properly be added to plots.yaml. - Fixed and issue where [Relic](https://github.com/relic-toolkit/relic) and thus blspy would crash on processors older than Haswell as they don't support lzc. - Some non-critical networking errors are no longer logged. - Blocks with compact proofs of time are now able to be updated into the node database. @@ -1235,26 +1235,26 @@ relic. We will make a patch available for these systems shortly. ### Added - This release is primarily a maintenance release for Beta 1.4. -- We have added an option to `chia-create-plots` to specify the second temporary directory. Creating a plot is a three step process. First a working file ending in `.dat.tmp` is created. This file is usually 5 times larger than the final plot file. In the later stages of plotting a second temp file is created ending in `.dat.2.tmp` which will grow to the size of the final plot file. In the final step, the `.dat.2.tmp` is copied to the final `.dat` plot file. You can now optionally set the directory for the `.dat.2.tmp` file with the `-2` flag. An example use case is plotting on a ramdisk and writing both the second temp file and the final file out to an SSD - `chia-create-plots -n 1 -k 30 -t /mnt/ramdisk -2 /mnt/SSD -d /mnt/SSD`. +- We have added an option to `flax-create-plots` to specify the second temporary directory. Creating a plot is a three step process. First a working file ending in `.dat.tmp` is created. This file is usually 5 times larger than the final plot file. In the later stages of plotting a second temp file is created ending in `.dat.2.tmp` which will grow to the size of the final plot file. In the final step, the `.dat.2.tmp` is copied to the final `.dat` plot file. You can now optionally set the directory for the `.dat.2.tmp` file with the `-2` flag. An example use case is plotting on a ramdisk and writing both the second temp file and the final file out to an SSD - `flax-create-plots -n 1 -k 30 -t /mnt/ramdisk -2 /mnt/SSD -d /mnt/SSD`. ### Changed -- `chia init` properly migrates from previous versions including the k>=32 workaround. Additionally, the farming target key is checked to make sure that it is the valid and correct public key format. -- We have implemented a workaround for the `chia start` issues some were having upon crash or reboot. We will be rebuilding start and stop to be robust across platforms. -- This release re-includes `chia-start-harvester`. +- `flax init` properly migrates from previous versions including the k>=32 workaround. Additionally, the farming target key is checked to make sure that it is the valid and correct public key format. +- We have implemented a workaround for the `flax start` issues some were having upon crash or reboot. We will be rebuilding start and stop to be robust across platforms. +- This release re-includes `flax-start-harvester`. - Coloured coins now have a prefix to help identify them. When sending transactions, the new prefix is incompatible with older clients. -- The user interface now refers to chia coins with their correct currency code of XCH. +- The user interface now refers to flax coins with their correct currency code of XCH. - The next release will now be in the dev branch instead of the e.g. beta-1.5. Additionally we are enforcing linear merge into dev and prefer rebase merges or partial squash merges of particularly chatty commit histories. - Building the sub reposities (chiapos, chiavdf, blslibrary) now requires CMake 3.14+. ### Fixed -- There was a regression in Chia Proof of Space ([chiapos](https://github.com/Chia-Network/chiapos)) that came from our efforts to speed up plotting on Windows native. Now k>=32 plots work correctly. We made additional bug fixes and corrected limiting small k size generation. +- There was a regression in Flax Proof of Space ([chiapos](https://github.com/Flax-Network/chiapos)) that came from our efforts to speed up plotting on Windows native. Now k>=32 plots work correctly. We made additional bug fixes and corrected limiting small k size generation. - There was a bug in Timelord handling that could stop all VDF progress. ### Deprecated -- We have made significant changes to the full node database to make it more reliable and quicker to restart. This requires re-syncing the current chain. If you use `chia init` then sync on first start will happen automatically. "\$CHIA_ROOT" users will need to delete `$CHIA_ROOT/db/*` before starting Beta 1.5. This also fixes the simulation issue in Beta 1.4 where tips could go "back in time." +- We have made significant changes to the full node database to make it more reliable and quicker to restart. This requires re-syncing the current chain. If you use `flax init` then sync on first start will happen automatically. "\$FLAX_ROOT" users will need to delete `$FLAX_ROOT/db/*` before starting Beta 1.5. This also fixes the simulation issue in Beta 1.4 where tips could go "back in time." ### Known issues @@ -1265,27 +1265,27 @@ relic. We will make a patch available for these systems shortly. ### Added -- This release adds Coloured coin support with offers. Yes that is the correct spelling. Coloured coins allow you to issue a coin, token, or asset with nearly unlimited issuance plans and functionality. They support inner smart transactions so they can inherit any of the other functionality you can implement in Chialisp. Offers are especially cool as they create a truly decentralized exchange capability. Read much more about them in Bram's [blog post on Coloured coins](https://chia.net/2020/04/29/coloured-coins-launch.en.html). +- This release adds Coloured coin support with offers. Yes that is the correct spelling. Coloured coins allow you to issue a coin, token, or asset with nearly unlimited issuance plans and functionality. They support inner smart transactions so they can inherit any of the other functionality you can implement in Flaxlisp. Offers are especially cool as they create a truly decentralized exchange capability. Read much more about them in Bram's [blog post on Coloured coins](https://flaxnetwork.org/2020/04/29/coloured-coins-launch.en.html). - This release adds support for native Windows via a (mostly) automated installer and MacOS Mojave. Windows still requires some PowerShell command line use. You should expect ongoing improvements in ease of install and replication of the command line tools in the GUI. Again huge thanks to @dkackman for continued Windows installer development. Native Windows is currently slightly slower than the same version running in WSL 2 on the same machine for both block verification and plotting. - We made some speed improvements that positively affected all platforms while trying to increase plotting speed in Windows. - The graphical Full Node display now shows the expected finish times of each of the prospective chain tips. -- Now you can run estimates of the total space currently farming the network. Try `chia netspace -d 12` to run an estimate over the last 12 blocks which is approximately 1 hour. -- We’ve added TLS authentication for incoming farmer connections. TLS certs and keys are generated during chia init and only full nodes with your keys will be able to connect to your Farmer. Also, Harvester, Timelord, and Wallet will now not accept incoming connections which reduces the application attack surface. -- The node RPC has a new endpoint get_header_by_height which allows you to retrieve the block header from a block height. Try `chia show -bh 1000` to see the block header hash of block 1000. You can then look up the block details with `chia show -b f655e1a9f7f8c89a703e40d9ce82ae33508badaf7b37fa1a56cad27926b5e936` which will look up a block by it's header hash. +- Now you can run estimates of the total space currently farming the network. Try `flax netspace -d 12` to run an estimate over the last 12 blocks which is approximately 1 hour. +- We’ve added TLS authentication for incoming farmer connections. TLS certs and keys are generated during flax init and only full nodes with your keys will be able to connect to your Farmer. Also, Harvester, Timelord, and Wallet will now not accept incoming connections which reduces the application attack surface. +- The node RPC has a new endpoint get_header_by_height which allows you to retrieve the block header from a block height. Try `flax show -bh 1000` to see the block header hash of block 1000. You can then look up the block details with `flax show -b f655e1a9f7f8c89a703e40d9ce82ae33508badaf7b37fa1a56cad27926b5e936` which will look up a block by it's header hash. - Our Windows binaries check the processor they are about to run on at runtime and choose the best processor optimizations for our [MPIR](http://mpir.org/) VDF dependency on Windows. -- Most of the content of README.md and INSTALL.md have been moved to the [repository wiki](https://github.com/Chia-Network/chia-blockchain/wiki) and placed in [INSTALL](https://github.com/Chia-Network/chia-blockchain/wiki/INSTALL) and [Quick Start Guide](https://github.com/Chia-Network/chia-blockchain/wiki/Quick-Start-Guide) +- Most of the content of README.md and INSTALL.md have been moved to the [repository wiki](https://github.com/Flax-Network/flax-blockchain/wiki) and placed in [INSTALL](https://github.com/Flax-Network/flax-blockchain/wiki/INSTALL) and [Quick Start Guide](https://github.com/Flax-Network/flax-blockchain/wiki/Quick-Start-Guide) - Harvester is now asynchronous and will better be able to look up more plots spread across more physical drives. - Full node startup time has been sped up significantly by optimizing the loading of the blockchain from disk. ### Changed -- Most scripts have been removed in favor of chia action commands. You can run `chia version` or `chia start node` for example. Just running `chia` will show you more options. However `chia-create-plots` continues to use the hyphenated form. Also it's now `chia generate keys` as another example. -- Chia start commands like `chia start farmer` and `chia stop node` now keep track of process IDs in a run/ directory in your configuration directory. `chia stop` is unlikely to work on Windows native for now. If `chia start -r node` doesn't work you can force the run/ directory to be reset with `chia start -f node`. -- We suggest you take a look at our [Upgrading documentation](https://github.com/Chia-Network/chia-blockchain/wiki/Updating-beta-software) if you aren't performing a new install. +- Most scripts have been removed in favor of flax action commands. You can run `flax version` or `flax start node` for example. Just running `flax` will show you more options. However `flax-create-plots` continues to use the hyphenated form. Also it's now `flax generate keys` as another example. +- Flax start commands like `flax start farmer` and `flax stop node` now keep track of process IDs in a run/ directory in your configuration directory. `flax stop` is unlikely to work on Windows native for now. If `flax start -r node` doesn't work you can force the run/ directory to be reset with `flax start -f node`. +- We suggest you take a look at our [Upgrading documentation](https://github.com/Flax-Network/flax-blockchain/wiki/Updating-beta-software) if you aren't performing a new install. - blspy now has libsodium included in the MacOS and Linux binary wheels. - miniupnpc and setprotitle were dynamically checked for an installed at runtime. Removed those checks and we rely upon the install tools installing them before first run. - Windows wheels that the Windows Installer packages are also available in the ci Artifacts in a .zip file. -- The script `chia start wallet-gui` has been chaned to `chia start wallet` which launches but the GUI and server on MacOS and Linux. `chia start wallet-server` remains for WSL 2 and Windows native. +- The script `flax start wallet-gui` has been chaned to `flax start wallet` which launches but the GUI and server on MacOS and Linux. `flax start wallet-server` remains for WSL 2 and Windows native. ### Deprecated @@ -1293,12 +1293,12 @@ relic. We will make a patch available for these systems shortly. ### Known issues -- Plots of k>=32 are not working for farming, and some broken plots can cause a memory leak. A [workaround is available](https://github.com/Chia-Network/chia-blockchain/wiki/Beta-1.4-k=32-or-larger-work-around). +- Plots of k>=32 are not working for farming, and some broken plots can cause a memory leak. A [workaround is available](https://github.com/Flax-Network/flax-blockchain/wiki/Beta-1.4-k=32-or-larger-work-around). - If you are running a simulation, blockchain tips are not saved in the database and this is a regression. If you stop a node it can go back in time and cause an odd state. This doesn't practically effect testnet participation as, on restart, node will just sync up a few blocks to the then current tips. - uPnP support on Windows may be broken. However, Windows nodes will be able to connect to other nodes and, once connected, participate fully in the network. - Coins are not currently reserved as part of trade offers and thus could potentially be spent before the offer is accepted resulting in a failed offer transaction. - Currently, there is no way to restore a Coloured Coin Wallet. -- The `chia stop all` command sometimes fails, use `chia-stop-all` instead. In windows, use the task manager to stop the servers. +- The `flax stop all` command sometimes fails, use `flax-stop-all` instead. In windows, use the task manager to stop the servers. ## [1.0beta3] aka Beta 1.3 - 2020-04-08 @@ -1307,15 +1307,15 @@ relic. We will make a patch available for these systems shortly. - Windows, WSL 2, Linux and MacOS installation is significantly streamlined. There is a new Windows installer for the Wallet GUI (huge thanks to @dkackman). - All installs can now be from the source repository or just the binary dependencies on WSL 2, most modern Linuxes, and MacOS Catalina. Binary support is for both Python 3.7 and 3.8. - There is a new migration tool to move from Beta1 (or 2) to Beta3. It should move everything except your plots. -- There is a new command `chia init` that will migrate files and generate your initial configuration. If you want to use the Wallet or farm, you will also have to `chia-generate-keys`. You can read step by step instructions for [upgrading from a previous beta release](https://github.com/Chia-Network/chia-blockchain/wiki/Updating-beta-software). If you've set `$CHIA_ROOT` you will have to make sure your existing configuration remains compatible manually. +- There is a new command `flax init` that will migrate files and generate your initial configuration. If you want to use the Wallet or farm, you will also have to `flax-generate-keys`. You can read step by step instructions for [upgrading from a previous beta release](https://github.com/Flax-Network/flax-blockchain/wiki/Updating-beta-software). If you've set `$FLAX_ROOT` you will have to make sure your existing configuration remains compatible manually. - Wallet has improved paper wallet recovery support. - We now also support restoring old wallets with only the wallet_sk and wallet_target. Beta3's Wallet will re-sync from scratch. - We've made lots of little improvements that should speed up node syncing -- We added full block lookup to `chia show`. +- We added full block lookup to `flax show`. ### Changed -- `chia-restart-harvester` has been renamed from `chia-start-harvester` to better reflect its functionality. Use it to restart a harvester that's farming so that it will pick up newly finished plots. +- `flax-restart-harvester` has been renamed from `flax-start-harvester` to better reflect its functionality. Use it to restart a harvester that's farming so that it will pick up newly finished plots. - We made the Wallet configurable to connect to a remote trusted node. - We now have farmers reconnect to their trusted node if they lose contact. - We updated our miniupnpc dependency to version 2.1. @@ -1336,7 +1336,7 @@ relic. We will make a patch available for these systems shortly. - Windows native is close but not here yet. Also, we should be adding back MacOS Mojave support shortly. - So why is this Beta 3 you're wondering? Well, we're getting used to our new release management tools and a hotfix devoured our beta2 nomenclature... We've marked it YANKED here. -- If you previously used the plot_root variable in config, your plot directory names might not migrate correctly. Please double check the filenames in `~/.chia/beta-1.0b3/config/plots.yaml` after migrating +- If you previously used the plot_root variable in config, your plot directory names might not migrate correctly. Please double check the filenames in `~/.flax/beta-1.0b3/config/plots.yaml` after migrating ## [1.0beta2] aka Beta 1.2 - 2020-04-04 [YANKED] @@ -1344,7 +1344,7 @@ relic. We will make a patch available for these systems shortly. ### Added -- There is now full transaction support on the Chia blockchain. In this initial Beta 1.0 release, all transaction types are supported though the wallets and UIs currently only directly support basic transactions like coinbase rewards and sending coins while paying fees. UI support for our [smart transactions](https://github.com/Chia-Network/wallets/blob/main/README.md) will be available in the UIs shortly. +- There is now full transaction support on the Flax blockchain. In this initial Beta 1.0 release, all transaction types are supported though the wallets and UIs currently only directly support basic transactions like coinbase rewards and sending coins while paying fees. UI support for our [smart transactions](https://github.com/Flax-Network/wallets/blob/main/README.md) will be available in the UIs shortly. - Wallet and Node GUI’s are available on Windows, Mac, and desktop Linux platforms. We now use an Electron UI that is a full light client wallet that can also serve as a node UI. Our Windows Electron Wallet can run standalone by connecting to other nodes on the network or another node you run. WSL 2 on Windows can run everything except the Wallet but you can run the Wallet on the native Windows side of the same machine. Also the WSL 2 install process is 3 times faster and _much_ easier. Windows native node/farmer/plotting functionality are coming soon. - Install is significantly easier with less dependencies on all supported platforms. - If you’re a farmer you can use the Wallet to keep track of your earnings. Either use the same keys.yaml on the same machine or copy the keys.yaml to another machine where you want to track of and spend your coins. @@ -1352,12 +1352,12 @@ relic. We will make a patch available for these systems shortly. ### Changed -- We have revamped the chia management command line. To start a farmer all you have to do is start the venv with `. ./activate` and then type `chia-start-farmer &`. The [README.md](https://github.com/Chia-Network/chia-blockchain/blob/main/README.md) has been updated to reflect the new commands. +- We have revamped the flax management command line. To start a farmer all you have to do is start the venv with `. ./activate` and then type `flax-start-farmer &`. The [README.md](https://github.com/Flax-Network/flax-blockchain/blob/main/README.md) has been updated to reflect the new commands. - We have moved all node to node communication to TLS 1.3 by default. For now, all TLS is unauthenticated but certain types of over the wire node to node communications will have the ability to authenticate both by certificate and by inter protocol signature. Encrypting over the wire by default stops casual snooping of transaction origination, light wallet to trusted node communication, and harvester-farmer-node communication for example. This leaves only the mempool and the chain itself open to casual observation by the public and the various entities around the world. -- Configuration directories have been moved to a default location of HomeDirectory/.chia/release/config, plots/ db/, wallet/ etc. This can be overridden by `export CHIA_ROOT=~/.chia` for example which would then put the plots directory in `HomeDirectory/.chia/plots`. -- The libraries chia-pos, chia-fast-vdf, and chia-bip-158 have been moved to their own repositories: [chiapos](https://github.com/Chia-Network/chiapos), [chiavdf](https://github.com/Chia-Network/chiavdf), and [chaibip158](https://github.com/Chia-Network/chiabip158). They are brought in by chia-blockchain at install time. Our BLS signature library remains at [bls-signatures](https://github.com/Chia-Network/bls-signatures). +- Configuration directories have been moved to a default location of HomeDirectory/.flax/release/config, plots/ db/, wallet/ etc. This can be overridden by `export FLAX_ROOT=~/.flax` for example which would then put the plots directory in `HomeDirectory/.flax/plots`. +- The libraries flax-pos, flax-fast-vdf, and flax-bip-158 have been moved to their own repositories: [chiapos](https://github.com/Flax-Network/chiapos), [chiavdf](https://github.com/Flax-Network/chiavdf), and [chaibip158](https://github.com/Flax-Network/chiabip158). They are brought in by flax-blockchain at install time. Our BLS signature library remains at [bls-signatures](https://github.com/Flax-Network/bls-signatures). - The install process now brings in chiapos, chiavdf, etc from Pypi where they are auto published via GitHub Actions ci using cibuildwheel. Check out `.github/workflows/build.yml` for build methods in each of the sub repositories. -- `chia-regenerate-keys` has been renamed `chia-generate-keys`. +- `flax-regenerate-keys` has been renamed `flax-generate-keys`. - setproctitle is now an optional install dependency that we will continue to install in the default install methods. - The project now defaults to `venv` without the proceeding . to better match best practices. - Developer requirements were separated from the actual requirements. @@ -1365,8 +1365,8 @@ relic. We will make a patch available for these systems shortly. ### Removed -- The Beta release is not compatible with the history of the Alpha blockchain and we will be ceasing support of the Alpha chain approximately two weeks after the release of this Beta. However, your plots and keys are fully compatible with the Beta chain. Please save your plot keys! Examples of how to save your keys and upgrade to the Beta are available on the [repo wiki](https://github.com/Chia-Network/chia-blockchain/wiki). -- The ssh ui and web ui are removed in favor of the cli ui and the Electron GUI. To mimic the ssh ui try `chia show -s -c` and try `chia show --help` for usage instructions. +- The Beta release is not compatible with the history of the Alpha blockchain and we will be ceasing support of the Alpha chain approximately two weeks after the release of this Beta. However, your plots and keys are fully compatible with the Beta chain. Please save your plot keys! Examples of how to save your keys and upgrade to the Beta are available on the [repo wiki](https://github.com/Flax-Network/flax-blockchain/wiki). +- The ssh ui and web ui are removed in favor of the cli ui and the Electron GUI. To mimic the ssh ui try `flax show -s -c` and try `flax show --help` for usage instructions. - We have removed the inkfish vdf implementation and replaced it with the pybind11 C++ version. ### Known Issues @@ -1424,7 +1424,7 @@ relic. We will make a patch available for these systems shortly. - Due to changes to the sqlite database that are not backwards compatible, re-synch will be required. - Loading the blockchain only loads headers into memory instead of header blocks (header + proofs), speeds up the startup, and reduces normal operation memory usage by 80%. - Memory access is now synchronous to reduce use of locks and speed up block processing. -- Chia fullnode, farmer and harvester now default to logging to chia.log in the chia-blockchain directory. This is configured in config.yaml and due to config.yaml changes it is recommended to edit the new template config instead of using older config.yaml’s from previous versions. +- Flax fullnode, farmer and harvester now default to logging to flax.log in the flax-blockchain directory. This is configured in config.yaml and due to config.yaml changes it is recommended to edit the new template config instead of using older config.yaml’s from previous versions. - uvloop is now an optional add on. - Harvester/farmer will not try to farm plots that they don’t have the key for. @@ -1438,16 +1438,16 @@ relic. We will make a patch available for these systems shortly. ### Added - FullNode performance improvements - Syncing up to the blockchain by importing all blocks is faster due to improvements in VDF verification speed and multithreading block verification. -- VDF improvements - VDF verification and generation speed has increased and dependence on flint2 has been removed. We wish to thank Dr. William Hart (@wbhart) for dual licensing parts of his contributions in FLINT and Antic for inclusion in the Chia blockchain. +- VDF improvements - VDF verification and generation speed has increased and dependence on flint2 has been removed. We wish to thank Dr. William Hart (@wbhart) for dual licensing parts of his contributions in FLINT and Antic for inclusion in the Flax blockchain. - Implemented an RPC interface with JSON serialization for streamables - currently on port 8555. - Added details on how to contribute in CONTRIBUTING.md. Thanks @RichardLitt. - Added color logging -- Now chia_harvester will periodically announce which plots it is currently farming and their k sizes. +- Now flax_harvester will periodically announce which plots it is currently farming and their k sizes. ### Changed - Moved the ssh UI to use RPC. -- Changed the displayed process names for harvester, farmer, fullnode, timelords, and VDFs to to chia_full node, chia_harvester, etc. Fixed a bug that could cause inadvertent shutdown of other processes like an ongoing plotting session when new chia services were started. +- Changed the displayed process names for harvester, farmer, fullnode, timelords, and VDFs to to flax_full node, flax_harvester, etc. Fixed a bug that could cause inadvertent shutdown of other processes like an ongoing plotting session when new flax services were started. - Clarified the minimum version of boost required to build timelord/VDFs. Hat tip @AdrianScott - Consensus and related documentation moved to the repository wiki. @@ -1519,21 +1519,21 @@ relic. We will make a patch available for these systems shortly. ### Added -- This is the first release of the Chia testnet! Blockchain consensus, proof of time, and proof of space are included. -- More details on the release at [https://www.chia.net/developer/](https://www.chia.net/developer/) - -[unreleased]: https://github.com/Chia-Network/chia-blockchain/compare/1.0beta5...dev -[1.0beta5]: https://github.com/Chia-Network/chia-blockchain/compare/1.0beta4...1.0beta5 -[1.0beta4]: https://github.com/Chia-Network/chia-blockchain/compare/1.0beta3...1.0beta4 -[1.0beta3]: https://github.com/Chia-Network/chia-blockchain/compare/1.0beta2...1.0beta3 -[1.0beta2]: https://github.com/Chia-Network/chia-blockchain/compare/1.0beta1...1.0beta2 -[1.0beta1]: https://github.com/Chia-Network/chia-blockchain/compare/alpha-1.5.1...1.0beta1 -[alpha 1.5.1]: https://github.com/Chia-Network/chia-blockchain/compare/alpha-1.5...alpha-1.5.1 -[alpha 1.5]: https://github.com/Chia-Network/chia-blockchain/compare/alpha-1.4.1...alpha-1.5 -[alpha 1.4.1]: https://github.com/Chia-Network/chia-blockchain/compare/alpha-1.4...alpha-1.4.1 -[alpha 1.4]: https://github.com/Chia-Network/chia-blockchain/compare/alpha-1.3...alpha-1.4 -[alpha 1.3]: https://github.com/Chia-Network/chia-blockchain/compare/alpha-1.2...alpha-1.3 -[alpha 1.2]: https://github.com/Chia-Network/chia-blockchain/compare/alpha-1.1.1...alpha-1.2 -[alpha 1.1.1]: https://github.com/Chia-Network/chia-blockchain/compare/alpha-1.1...alpha-1.1.1 -[alpha 1.1]: https://github.com/Chia-Network/chia-blockchain/compare/alpha-1.0...alpha-1.1 -[alpha 1.0]: https://github.com/Chia-Network/chia-blockchain/releases/tag/Alpha-1.0 +- This is the first release of the Flax testnet! Blockchain consensus, proof of time, and proof of space are included. +- More details on the release at [https://www.flaxnetwork.org/developer/](https://www.flaxnetwork.org/developer/) + +[unreleased]: https://github.com/Flax-Network/flax-blockchain/compare/1.0beta5...dev +[1.0beta5]: https://github.com/Flax-Network/flax-blockchain/compare/1.0beta4...1.0beta5 +[1.0beta4]: https://github.com/Flax-Network/flax-blockchain/compare/1.0beta3...1.0beta4 +[1.0beta3]: https://github.com/Flax-Network/flax-blockchain/compare/1.0beta2...1.0beta3 +[1.0beta2]: https://github.com/Flax-Network/flax-blockchain/compare/1.0beta1...1.0beta2 +[1.0beta1]: https://github.com/Flax-Network/flax-blockchain/compare/alpha-1.5.1...1.0beta1 +[alpha 1.5.1]: https://github.com/Flax-Network/flax-blockchain/compare/alpha-1.5...alpha-1.5.1 +[alpha 1.5]: https://github.com/Flax-Network/flax-blockchain/compare/alpha-1.4.1...alpha-1.5 +[alpha 1.4.1]: https://github.com/Flax-Network/flax-blockchain/compare/alpha-1.4...alpha-1.4.1 +[alpha 1.4]: https://github.com/Flax-Network/flax-blockchain/compare/alpha-1.3...alpha-1.4 +[alpha 1.3]: https://github.com/Flax-Network/flax-blockchain/compare/alpha-1.2...alpha-1.3 +[alpha 1.2]: https://github.com/Flax-Network/flax-blockchain/compare/alpha-1.1.1...alpha-1.2 +[alpha 1.1.1]: https://github.com/Flax-Network/flax-blockchain/compare/alpha-1.1...alpha-1.1.1 +[alpha 1.1]: https://github.com/Flax-Network/flax-blockchain/compare/alpha-1.0...alpha-1.1 +[alpha 1.0]: https://github.com/Flax-Network/flax-blockchain/releases/tag/Alpha-1.0 diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 899890623..0ad6e0656 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -55,7 +55,7 @@ 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 legal@chia.net. All +reported by contacting the project team at legal@flaxnetwork.org. 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. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2c5525a2b..d805f3d8a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,13 +1,13 @@ # Introduction -Welcome to the chia-blockchain project! -We are happy that you are taking a look at the code for Chia, a proof of space and time cryptocurrency. +Welcome to the flax-blockchain project! +We are happy that you are taking a look at the code for Flax, a proof of space and time cryptocurrency. A lot of fascinating new cryptography and blockchain concepts are used and implemented here. -This repo includes the code for the Chia full node, farmer, and timelord (in chia folder), which are all written in python. -It also includes a verifiable delay function implementation that it imports from the [chiavdf repo](https://github.com/Chia-Network/chiavdf) (in c/c++), and a proof of space implementation that it imports from the [chiapos repo](https://github.com/Chia-Network/chiapos). BLS signatures are imported from the [bls-signatures repo](https://github.com/Chia-Network/bls-signatures) as blspy. There is an additional dependency on the [chiabip158 repo](https://github.com/Chia-Network/chiabip158). For major platforms, binary and source wheels are shipped to PyPI from each dependent repo. Then chia-blockchain can pip install those from PyPI or they can be prepackaged as is done for the Windows installer. On unsupported platforms, pip will fall back to the source distributions, to be compiled locally. +This repo includes the code for the Flax full node, farmer, and timelord (in flax folder), which are all written in python. +It also includes a verifiable delay function implementation that it imports from the [chiavdf repo](https://github.com/Flax-Network/chiavdf) (in c/c++), and a proof of space implementation that it imports from the [chiapos repo](https://github.com/Flax-Network/chiapos). BLS signatures are imported from the [bls-signatures repo](https://github.com/Flax-Network/bls-signatures) as blspy. There is an additional dependency on the [chiabip158 repo](https://github.com/Flax-Network/chiabip158). For major platforms, binary and source wheels are shipped to PyPI from each dependent repo. Then flax-blockchain can pip install those from PyPI or they can be prepackaged as is done for the Windows installer. On unsupported platforms, pip will fall back to the source distributions, to be compiled locally. -If you want to learn more about this project, read the [wiki](https://github.com/Chia-Network/chia-blockchain/wiki), or check out the [green paper](https://www.chia.net/assets/ChiaGreenPaper.pdf). +If you want to learn more about this project, read the [wiki](https://github.com/Flax-Network/flax-blockchain/wiki), or check out the [green paper](https://www.flaxnetwork.org/assets/FlaxGreenPaper.pdf). ## Contributions @@ -19,13 +19,13 @@ You can visit our [Trello project board](https://trello.com/b/ZuNx7sET) to get a Generally, things to the left are in progress or done. Some things go through "Coming up soon", but some will come directly out of other columns. Usually, the things closer to the top of each column are the ones that will be worked on soonest. If you are interested in cryptography, math, or just like hacking in python, there are many interesting problems to work on. -Contact any of the team members on [Keybase](https://keybase.io/team/chia_network.public), which we use as the main communication method. You can also comment on any Trello card. +Contact any of the team members on [Discord](https://discord.gg/TgJyxsEFFc), which we use as the main communication method. You can also comment on any Trello card. We ask that external contributors create a fork of the `main` branch for any feature work they wish to take on. -Members of the Chia organization may create feature branches from the `main` branch. +Members of the Flax organization may create feature branches from the `main` branch. -In the event an emergency fix is required for the release version of Chia, members of the Chia organization will create a feature branch from the current release branch `1.0.0`. +In the event an emergency fix is required for the release version of Flax, members of the Flax organization will create a feature branch from the current release branch `1.0.0`. ## Branching Strategy @@ -34,7 +34,7 @@ In the event an emergency fix is required for the release version of Chia, membe 1. All changes go into the main branch. 2. Main is stable at all times, all tests pass. 3. Features (with tests) are developed and fully tested on feature branches, and reviewed before landing in main. -4. Chia Network's nodes on the public testnet are running the latest version `x.y.z`. +4. Flax Network's nodes on the public testnet are running the latest version `x.y.z`. 5. The `main` branch will have a long running `beta testnet` to allow previewing of changes. 6. Pull Request events may require a `beta testnet` review environment. At the moment this is at the discretion of the reviewer. 7. Hotfixes land in the release branch they fix, and all later versions. (This will be achieved by regularly merging from `1.0.x` to main). @@ -51,7 +51,7 @@ proofs of space during testing. The next time tests are run, this will not be ne ```bash . ./activate pip install ".[dev]" -black chia tests && mypy chia tests && flake8 chia tests +black flax tests && mypy flax tests && flake8 flax tests py.test tests -v --durations 0 ``` @@ -69,7 +69,7 @@ If you want verbose logging for tests, edit the `tests/pytest.ini` file. 4. Preferences > Settings > Python > Linting > flake8 enabled 5. Preferences > Settings > Python > Linting > mypy enabled 6. Preferences > Settings > Formatting > Python > Provider > black -7. Preferences > Settings > mypy > Targets: set to `./chia` and `./tests` +7. Preferences > Settings > mypy > Targets: set to `./flax` and `./tests` ## Configure Pycharm @@ -82,24 +82,24 @@ workflow. 3. Install BlackConnect plugin 4. Set to run python black on save 5. Set line length to 120 -6. Install these linters https://github.com/Chia-Network/chia-blockchain/tree/main/.github/linters +6. Install these linters https://github.com/Flax-Network/flax-blockchain/tree/main/.github/linters ## Testnets and review environments With the launch of `1.0.0` we will begin running an official `testnet`. -Prior to the release of `1.1.0` there will be two running test nets. `testnet` and `transaction-beta-testnet`. The `transaction-beta-testnet` testnet will be a beta of the pending 1.1 release, which will enable transactions on the chia blockchain. +Prior to the release of `1.1.0` there will be two running test nets. `testnet` and `transaction-beta-testnet`. The `transaction-beta-testnet` testnet will be a beta of the pending 1.1 release, which will enable transactions on the flax blockchain. Following the release of `1.1.0`, the official `testnet` will include all changes that have been accepted to the current release branch. Prior to proposing changes to `main`, proposers should consider if running a `beta testnet` review environment will make the reviewer more effective when evaluating a change. Changes that impact the blockchain could require a review environment before acceptance into `main`. This is at the discretion of the reviewer. -Chia organization members have been granted CI access to deploy `beta testnets`. -If you are not a Chia organization member, you can enquire about deploying a `beta testnet` in the public dev Keybase channel. +Flax organization members have been granted CI access to deploy `beta testnets`. +If you are not a Flax organization member, you can enquire about deploying a `beta testnet` in the public dev Discord channel. ## Submit changes To propose changes, please make a pull request to the `main` branch. See Branching Strategy above. -To propose changes for the production releases of Chia, please make a pull request to the latest release branch. +To propose changes for the production releases of Flax, please make a pull request to the latest release branch. ## Copyright diff --git a/INSTALL.md b/INSTALL.md index 37814ef86..8156df944 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -1,7 +1,7 @@ # Installation -Install instructions have been moved to the [INSTALL](https://github.com/Chia-Network/chia-blockchain/wiki/INSTALL) section of the repository [Wiki](https://github.com/Chia-Network/chia-blockchain/wiki). +Install instructions have been moved to the [INSTALL](https://github.com/Flax-Network/flax-blockchain/wiki/INSTALL) section of the repository [Wiki](https://github.com/Flax-Network/flax-blockchain/wiki). After installing, follow the remaining instructions in the -[Quick Start Guide](https://github.com/Chia-Network/chia-blockchain/wiki/Quick-Start-Guide) +[Quick Start Guide](https://github.com/Flax-Network/flax-blockchain/wiki/Quick-Start-Guide) to run the software. diff --git a/README.md b/README.md index e580f8b9e..ea7b43d3d 100644 --- a/README.md +++ b/README.md @@ -1,52 +1,5 @@ -# chia-blockchain +# flax-blockchain -![Alt text](https://www.chia.net/img/chia_logo.svg) +**Flax** is a modern community-centric green cryptocurrency based on a proof-of-space-and-time consensus algorithm. It is a community-supported fork of the [Chia Network](https://github.com/Chia-Network/chia-blockchain) codebase. -| Current Release/main | Development Branch/dev | -| :---: | :---: | -| [![Ubuntu Core Tests](https://github.com/Chia-Network/chia-blockchain/actions/workflows/build-test-ubuntu-core.yml/badge.svg)](https://github.com/Chia-Network/chia-blockchain/actions/workflows/build-test-ubuntu-core.yml) [![MacOS Core Tests](https://github.com/Chia-Network/chia-blockchain/actions/workflows/build-test-macos-core.yml/badge.svg)](https://github.com/Chia-Network/chia-blockchain/actions/workflows/build-test-macos-core.yml) [![Windows Installer on Windows 10 and Python 3.7](https://github.com/Chia-Network/chia-blockchain/actions/workflows/build-windows-installer.yml/badge.svg)](https://github.com/Chia-Network/chia-blockchain/actions/workflows/build-windows-installer.yml) | [![Ubuntu Core Tests](https://github.com/Chia-Network/chia-blockchain/actions/workflows/build-test-ubuntu-core.yml/badge.svg?branch=dev)](https://github.com/Chia-Network/chia-blockchain/actions/workflows/build-test-ubuntu-core.yml) [![MacOS Core Tests](https://github.com/Chia-Network/chia-blockchain/actions/workflows/build-test-macos-core.yml/badge.svg?branch=dev)](https://github.com/Chia-Network/chia-blockchain/actions/workflows/build-test-macos-core.yml) [![Windows Installer on Windows 10 and Python 3.7](https://github.com/Chia-Network/chia-blockchain/actions/workflows/build-windows-installer.yml/badge.svg?branch=dev)](https://github.com/Chia-Network/chia-blockchain/actions/workflows/build-windows-installer.yml) | - -![GitHub contributors](https://img.shields.io/github/contributors/Chia-Network/chia-blockchain?logo=GitHub) - -Chia is a modern cryptocurrency built from scratch, designed to be efficient, decentralized, and secure. Here are some of the features and benefits: -* [Proof of space and time](https://docs.google.com/document/d/1tmRIb7lgi4QfKkNaxuKOBHRmwbVlGL4f7EsBDr_5xZE/edit) based consensus which allows anyone to farm with commodity hardware -* Very easy to use full node and farmer GUI and cli (thousands of nodes active on mainnet) -* Simplified UTXO based transaction model, with small on chain state -* Lisp-style turing complete functional [programming language](https://chialisp.com/) for money related use cases -* BLS keys and aggregate signatures (only one signature per block) -* [Pooling protocol](https://www.chia.net/2020/11/10/pools-in-chia.html) (in development) that allows farmers to have control of making blocks -* Support for light clients with fast, objective syncing -* A growing community of farmers and developers around the world - -Please check out the [wiki](https://github.com/Chia-Network/chia-blockchain/wiki) -and [FAQ](https://github.com/Chia-Network/chia-blockchain/wiki/FAQ) for -information on this project. - -Python 3.7+ is required. Make sure your default python version is >=3.7 -by typing `python3`. - -If you are behind a NAT, it can be difficult for peers outside your subnet to -reach you when they start up. You can enable -[UPnP](https://www.homenethowto.com/ports-and-nat/upnp-automatic-port-forward/) -on your router or add a NAT (for IPv4 but not IPv6) and firewall rules to allow -TCP port 8444 access to your peer. -These methods tend to be router make/model specific. - -Most users should only install harvesters, farmers, plotter, full nodes, and wallets. -Building Timelords and VDFs is for sophisticated users, in most environments. -Chia Network and additional volunteers are running sufficient Timelords -for consensus. - -## Installing - -Install instructions are available in the -[INSTALL](https://github.com/Chia-Network/chia-blockchain/wiki/INSTALL) -section of the -[chia-blockchain repository wiki](https://github.com/Chia-Network/chia-blockchain/wiki). - -## Running - -Once installed, a -[Quick Start Guide](https://github.com/Chia-Network/chia-blockchain/wiki/Quick-Start-Guide) -is available from the repository -[wiki](https://github.com/Chia-Network/chia-blockchain/wiki). +For more information, see our website and downloads at https://flaxnetwork.org. diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 9cc62199c..31ef5f65f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -36,8 +36,8 @@ steps: # Install an Apple certificate required to build on a macOS agent machine - task: InstallAppleCertificate@2 inputs: - certSecureFile: 'chia-apple-dev-id-app.p12' - certPwd: $(CHIA_APPLE_DEV_ID_APP_PASS) + certSecureFile: 'flax-apple-dev-id-app.p12' + certPwd: $(FLAX_APPLE_DEV_ID_APP_PASS) keychain: temp deleteCert: true @@ -55,7 +55,7 @@ steps: . ./activate clang --version pip wheel --use-pep517 --extra-index-url https://pypi.chia.net/simple/ --wheel-dir=wheels . - pip install --no-index --find-links=./wheels/ chia-blockchain + pip install --no-index --find-links=./wheels/ flax-blockchain displayName: "Build and install wheels" - task: NodeTool@0 diff --git a/build_scripts/build_linux.sh b/build_scripts/build_linux.sh index b0fdb2406..6e562d423 100644 --- a/build_scripts/build_linux.sh +++ b/build_scripts/build_linux.sh @@ -6,23 +6,23 @@ if [ ! "$1" ]; then elif [ "$1" = "amd64" ]; then PLATFORM="$1" REDHAT_PLATFORM="x86_64" - DIR_NAME="chia-blockchain-linux-x64" + DIR_NAME="flax-blockchain-linux-x64" else PLATFORM="$1" - DIR_NAME="chia-blockchain-linux-arm64" + DIR_NAME="flax-blockchain-linux-arm64" fi pip install setuptools_scm -# The environment variable CHIA_INSTALLER_VERSION needs to be defined +# The environment variable FLAX_INSTALLER_VERSION needs to be defined # If the env variable NOTARIZE and the username and password variables are # set, this will attempt to Notarize the signed DMG -CHIA_INSTALLER_VERSION=$(python installer-version.py) +FLAX_INSTALLER_VERSION=$(python installer-version.py) -if [ ! "$CHIA_INSTALLER_VERSION" ]; then - echo "WARNING: No environment variable CHIA_INSTALLER_VERSION set. Using 0.0.0." - CHIA_INSTALLER_VERSION="0.0.0" +if [ ! "$FLAX_INSTALLER_VERSION" ]; then + echo "WARNING: No environment variable FLAX_INSTALLER_VERSION set. Using 0.0.0." + FLAX_INSTALLER_VERSION="0.0.0" fi -echo "Chia Installer Version is: $CHIA_INSTALLER_VERSION" +echo "Flax Installer Version is: $FLAX_INSTALLER_VERSION" echo "Installing npm and electron packagers" npm install electron-packager -g @@ -35,7 +35,7 @@ mkdir dist echo "Create executables with pyinstaller" pip install pyinstaller==4.2 -SPEC_FILE=$(python -c 'import chia; print(chia.PYINSTALLER_SPEC_PATH)') +SPEC_FILE=$(python -c 'import flax; print(flax.PYINSTALLER_SPEC_PATH)') pyinstaller --log-level=INFO "$SPEC_FILE" LAST_EXIT_CODE=$? if [ "$LAST_EXIT_CODE" -ne 0 ]; then @@ -43,9 +43,9 @@ if [ "$LAST_EXIT_CODE" -ne 0 ]; then exit $LAST_EXIT_CODE fi -cp -r dist/daemon ../chia-blockchain-gui +cp -r dist/daemon ../flax-blockchain-gui cd .. || exit -cd chia-blockchain-gui || exit +cd flax-blockchain-gui || exit echo "npm build" npm install @@ -57,9 +57,9 @@ if [ "$LAST_EXIT_CODE" -ne 0 ]; then exit $LAST_EXIT_CODE fi -electron-packager . chia-blockchain --asar.unpack="**/daemon/**" --platform=linux \ ---icon=src/assets/img/Chia.icns --overwrite --app-bundle-id=net.chia.blockchain \ ---appVersion=$CHIA_INSTALLER_VERSION +electron-packager . flax-blockchain --asar.unpack="**/daemon/**" --platform=linux \ +--icon=src/assets/img/Flax.icns --overwrite --app-bundle-id=net.flax.blockchain \ +--appVersion=$FLAX_INSTALLER_VERSION LAST_EXIT_CODE=$? if [ "$LAST_EXIT_CODE" -ne 0 ]; then echo >&2 "electron-packager failed!" @@ -69,11 +69,11 @@ fi mv $DIR_NAME ../build_scripts/dist/ cd ../build_scripts || exit -echo "Create chia-$CHIA_INSTALLER_VERSION.deb" +echo "Create flax-$FLAX_INSTALLER_VERSION.deb" rm -rf final_installer mkdir final_installer electron-installer-debian --src dist/$DIR_NAME/ --dest final_installer/ \ ---arch "$PLATFORM" --options.version $CHIA_INSTALLER_VERSION +--arch "$PLATFORM" --options.version $FLAX_INSTALLER_VERSION LAST_EXIT_CODE=$? if [ "$LAST_EXIT_CODE" -ne 0 ]; then echo >&2 "electron-installer-debian failed!" @@ -81,9 +81,9 @@ if [ "$LAST_EXIT_CODE" -ne 0 ]; then fi if [ "$REDHAT_PLATFORM" = "x86_64" ]; then - echo "Create chia-blockchain-$CHIA_INSTALLER_VERSION.rpm" + echo "Create flax-blockchain-$FLAX_INSTALLER_VERSION.rpm" electron-installer-redhat --src dist/$DIR_NAME/ --dest final_installer/ \ - --arch "$REDHAT_PLATFORM" --options.version $CHIA_INSTALLER_VERSION \ + --arch "$REDHAT_PLATFORM" --options.version $FLAX_INSTALLER_VERSION \ --license ../LICENSE LAST_EXIT_CODE=$? if [ "$LAST_EXIT_CODE" -ne 0 ]; then diff --git a/build_scripts/build_macos.sh b/build_scripts/build_macos.sh index 4df16ecb4..3bd094088 100644 --- a/build_scripts/build_macos.sh +++ b/build_scripts/build_macos.sh @@ -1,15 +1,15 @@ #!/bin/bash pip install setuptools_scm -# The environment variable CHIA_INSTALLER_VERSION needs to be defined. +# The environment variable FLAX_INSTALLER_VERSION needs to be defined. # If the env variable NOTARIZE and the username and password variables are # set, this will attempt to Notarize the signed DMG. -CHIA_INSTALLER_VERSION=$(python installer-version.py) +FLAX_INSTALLER_VERSION=$(python installer-version.py) -if [ ! "$CHIA_INSTALLER_VERSION" ]; then - echo "WARNING: No environment variable CHIA_INSTALLER_VERSION set. Using 0.0.0." - CHIA_INSTALLER_VERSION="0.0.0" +if [ ! "$FLAX_INSTALLER_VERSION" ]; then + echo "WARNING: No environment variable FLAX_INSTALLER_VERSION set. Using 0.0.0." + FLAX_INSTALLER_VERSION="0.0.0" fi -echo "Chia Installer Version is: $CHIA_INSTALLER_VERSION" +echo "Flax Installer Version is: $FLAX_INSTALLER_VERSION" echo "Installing npm and electron packagers" npm install electron-installer-dmg -g @@ -23,16 +23,16 @@ mkdir dist echo "Create executables with pyinstaller" pip install pyinstaller==4.2 -SPEC_FILE=$(python -c 'import chia; print(chia.PYINSTALLER_SPEC_PATH)') +SPEC_FILE=$(python -c 'import flax; print(flax.PYINSTALLER_SPEC_PATH)') pyinstaller --log-level=INFO "$SPEC_FILE" LAST_EXIT_CODE=$? if [ "$LAST_EXIT_CODE" -ne 0 ]; then echo >&2 "pyinstaller failed!" exit $LAST_EXIT_CODE fi -cp -r dist/daemon ../chia-blockchain-gui +cp -r dist/daemon ../flax-blockchain-gui cd .. || exit -cd chia-blockchain-gui || exit +cd flax-blockchain-gui || exit echo "npm build" npm install @@ -44,9 +44,9 @@ if [ "$LAST_EXIT_CODE" -ne 0 ]; then exit $LAST_EXIT_CODE fi -electron-packager . Chia --asar.unpack="**/daemon/**" --platform=darwin \ ---icon=src/assets/img/Chia.icns --overwrite --app-bundle-id=net.chia.blockchain \ ---appVersion=$CHIA_INSTALLER_VERSION +electron-packager . Flax --asar.unpack="**/daemon/**" --platform=darwin \ +--icon=src/assets/img/Flax.icns --overwrite --app-bundle-id=net.flax.blockchain \ +--appVersion=$FLAX_INSTALLER_VERSION LAST_EXIT_CODE=$? if [ "$LAST_EXIT_CODE" -ne 0 ]; then echo >&2 "electron-packager failed!" @@ -54,8 +54,8 @@ if [ "$LAST_EXIT_CODE" -ne 0 ]; then fi if [ "$NOTARIZE" ]; then - electron-osx-sign Chia-darwin-x64/Chia.app --platform=darwin \ - --hardened-runtime=true --provisioning-profile=chiablockchain.provisionprofile \ + electron-osx-sign Flax-darwin-x64/Flax.app --platform=darwin \ + --hardened-runtime=true --provisioning-profile=flaxblockchain.provisionprofile \ --entitlements=entitlements.mac.plist --entitlements-inherit=entitlements.mac.plist \ --no-gatekeeper-assess fi @@ -65,13 +65,13 @@ if [ "$LAST_EXIT_CODE" -ne 0 ]; then exit $LAST_EXIT_CODE fi -mv Chia-darwin-x64 ../build_scripts/dist/ +mv Flax-darwin-x64 ../build_scripts/dist/ cd ../build_scripts || exit -DMG_NAME="Chia-$CHIA_INSTALLER_VERSION.dmg" +DMG_NAME="Flax-$FLAX_INSTALLER_VERSION.dmg" echo "Create $DMG_NAME" mkdir final_installer -electron-installer-dmg dist/Chia-darwin-x64/Chia.app Chia-$CHIA_INSTALLER_VERSION \ +electron-installer-dmg dist/Flax-darwin-x64/Flax.app Flax-$FLAX_INSTALLER_VERSION \ --overwrite --out final_installer LAST_EXIT_CODE=$? if [ "$LAST_EXIT_CODE" -ne 0 ]; then @@ -82,7 +82,7 @@ fi if [ "$NOTARIZE" ]; then echo "Notarize $DMG_NAME on ci" cd final_installer || exit - notarize-cli --file=$DMG_NAME --bundle-id net.chia.blockchain \ + notarize-cli --file=$DMG_NAME --bundle-id net.flax.blockchain \ --username "$APPLE_NOTARIZE_USERNAME" --password "$APPLE_NOTARIZE_PASSWORD" echo "Notarization step complete" else @@ -93,7 +93,7 @@ fi # # Ask for username and password. password should be an app specific password. # Generate app specific password https://support.apple.com/en-us/HT204397 -# xcrun altool --notarize-app -f Chia-0.1.X.dmg --primary-bundle-id net.chia.blockchain -u username -p password +# xcrun altool --notarize-app -f Flax-0.1.X.dmg --primary-bundle-id net.flax.blockchain -u username -p password # xcrun altool --notarize-app; -should return REQUEST-ID, use it in next command # # Wait until following command return a success message". @@ -101,7 +101,7 @@ fi # It can take a while, run it every few minutes. # # Once that is successful, execute the following command": -# xcrun stapler staple Chia-0.1.X.dmg +# xcrun stapler staple Flax-0.1.X.dmg # # Validate DMG: -# xcrun stapler validate Chia-0.1.X.dmg +# xcrun stapler validate Flax-0.1.X.dmg diff --git a/build_scripts/build_windows.ps1 b/build_scripts/build_windows.ps1 index 041018b4e..e1813947f 100644 --- a/build_scripts/build_windows.ps1 +++ b/build_scripts/build_windows.ps1 @@ -33,24 +33,24 @@ pip install pyinstaller==4.2 pip install setuptools_scm Write-Output " ---" -Write-Output "Get CHIA_INSTALLER_VERSION" -# The environment variable CHIA_INSTALLER_VERSION needs to be defined -$env:CHIA_INSTALLER_VERSION = python .\build_scripts\installer-version.py -win +Write-Output "Get FLAX_INSTALLER_VERSION" +# The environment variable FLAX_INSTALLER_VERSION needs to be defined +$env:FLAX_INSTALLER_VERSION = python .\build_scripts\installer-version.py -win -if (-not (Test-Path env:CHIA_INSTALLER_VERSION)) { - $env:CHIA_INSTALLER_VERSION = '0.0.0' - Write-Output "WARNING: No environment variable CHIA_INSTALLER_VERSION set. Using 0.0.0" +if (-not (Test-Path env:FLAX_INSTALLER_VERSION)) { + $env:FLAX_INSTALLER_VERSION = '0.0.0' + Write-Output "WARNING: No environment variable FLAX_INSTALLER_VERSION set. Using 0.0.0" } -Write-Output "Chia Version is: $env:CHIA_INSTALLER_VERSION" +Write-Output "Flax Version is: $env:FLAX_INSTALLER_VERSION" Write-Output " ---" Write-Output " ---" -Write-Output "Build chia-blockchain wheels" +Write-Output "Build flax-blockchain wheels" Write-Output " ---" pip wheel --use-pep517 --extra-index-url https://pypi.chia.net/simple/ -f . --wheel-dir=.\build_scripts\win_build . Write-Output " ---" -Write-Output "Install chia-blockchain wheels into venv with pip" +Write-Output "Install flax-blockchain wheels into venv with pip" Write-Output " ---" Write-Output "pip install miniupnpc" @@ -59,20 +59,20 @@ pip install --no-index --find-links=.\win_build\ miniupnpc # Write-Output "pip install setproctitle" # pip install setproctitle==1.2.2 -Write-Output "pip install chia-blockchain" -pip install --no-index --find-links=.\win_build\ chia-blockchain +Write-Output "pip install flax-blockchain" +pip install --no-index --find-links=.\win_build\ flax-blockchain Write-Output " ---" -Write-Output "Use pyinstaller to create chia .exe's" +Write-Output "Use pyinstaller to create flax .exe's" Write-Output " ---" -$SPEC_FILE = (python -c 'import chia; print(chia.PYINSTALLER_SPEC_PATH)') -join "`n" +$SPEC_FILE = (python -c 'import flax; print(flax.PYINSTALLER_SPEC_PATH)') -join "`n" pyinstaller --log-level INFO $SPEC_FILE Write-Output " ---" -Write-Output "Copy chia executables to chia-blockchain-gui\" +Write-Output "Copy flax executables to flax-blockchain-gui\" Write-Output " ---" -Copy-Item "dist\daemon" -Destination "..\chia-blockchain-gui\" -Recurse -Set-Location -Path "..\chia-blockchain-gui" -PassThru +Copy-Item "dist\daemon" -Destination "..\flax-blockchain-gui\" -Recurse +Set-Location -Path "..\flax-blockchain-gui" -PassThru git status @@ -95,19 +95,19 @@ If ($LastExitCode -gt 0){ } Write-Output " ---" -Write-Output "Increase the stack for chia command for (chia plots create) chiapos limitations" +Write-Output "Increase the stack for flax command for (flax plots create) chiapos limitations" # editbin.exe needs to be in the path -editbin.exe /STACK:8000000 daemon\chia.exe +editbin.exe /STACK:8000000 daemon\flax.exe Write-Output " ---" -$packageVersion = "$env:CHIA_INSTALLER_VERSION" -$packageName = "Chia-$packageVersion" +$packageVersion = "$env:FLAX_INSTALLER_VERSION" +$packageName = "Flax-$packageVersion" Write-Output "packageName is $packageName" Write-Output " ---" Write-Output "electron-packager" -electron-packager . Chia --asar.unpack="**\daemon\**" --overwrite --icon=.\src\assets\img\chia.ico --app-version=$packageVersion +electron-packager . Flax --asar.unpack="**\daemon\**" --overwrite --icon=.\src\assets\img\flax.ico --app-version=$packageVersion Write-Output " ---" Write-Output " ---" @@ -121,8 +121,8 @@ If ($env:HAS_SECRET) { Write-Output " ---" Write-Output "Add timestamp and verify signature" Write-Output " ---" - signtool.exe timestamp /v /t http://timestamp.comodoca.com/ .\release-builds\windows-installer\ChiaSetup-$packageVersion.exe - signtool.exe verify /v /pa .\release-builds\windows-installer\ChiaSetup-$packageVersion.exe + signtool.exe timestamp /v /t http://timestamp.comodoca.com/ .\release-builds\windows-installer\FlaxSetup-$packageVersion.exe + signtool.exe verify /v /pa .\release-builds\windows-installer\FlaxSetup-$packageVersion.exe } Else { Write-Output "Skipping timestamp and verify signatures - no authorization to install certificates" } diff --git a/chia/ssl/chia_ca.crt b/chia/ssl/chia_ca.crt deleted file mode 100644 index ab2f35748..000000000 --- a/chia/ssl/chia_ca.crt +++ /dev/null @@ -1,19 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDKTCCAhGgAwIBAgIUXIpxI5MoZQ65/vhc7DK/d5ymoMUwDQYJKoZIhvcNAQEL -BQAwRDENMAsGA1UECgwEQ2hpYTEQMA4GA1UEAwwHQ2hpYSBDQTEhMB8GA1UECwwY -T3JnYW5pYyBGYXJtaW5nIERpdmlzaW9uMB4XDTIxMDEyMzA4NTEwNloXDTMxMDEy -MTA4NTEwNlowRDENMAsGA1UECgwEQ2hpYTEQMA4GA1UEAwwHQ2hpYSBDQTEhMB8G -A1UECwwYT3JnYW5pYyBGYXJtaW5nIERpdmlzaW9uMIIBIjANBgkqhkiG9w0BAQEF -AAOCAQ8AMIIBCgKCAQEAzz/L219Zjb5CIKnUkpd2julGC+j3E97KUiuOalCH9wdq -gpJi9nBqLccwPCSFXFew6CNBIBM+CW2jT3UVwgzjdXJ7pgtu8gWj0NQ6NqSLiXV2 -WbpZovfrVh3x7Z4bjPgI3ouWjyehUfmK1GPIld4BfUSQtPlUJ53+XT32GRizUy+b -0CcJ84jp1XvyZAMajYnclFRNNJSw9WXtTlMUu+Z1M4K7c4ZPwEqgEnCgRc0TCaXj -180vo7mCHJQoDiNSCRATwfH+kWxOOK/nePkq2t4mPSFaX8xAS4yILISIOWYn7sNg -dy9D6gGNFo2SZ0FR3x9hjUjYEV3cPqg3BmNE3DDynQIDAQABoxMwETAPBgNVHRMB -Af8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQAEugnFQjzHhS0eeCqUwOHmP3ww -/rXPkKF+bJ6uiQgXZl+B5W3m3zaKimJeyatmuN+5ST1gUET+boMhbA/7grXAsRsk -SFTHG0T9CWfPiuimVmGCzoxLGpWDMJcHZncpQZ72dcy3h7mjWS+U59uyRVHeiprE -hvSyoNSYmfvh7vplRKS1wYeA119LL5fRXvOQNW6pSsts17auu38HWQGagSIAd1UP -5zEvDS1HgvaU1E09hlHzlpdSdNkAx7si0DMzxKHUg9oXeRZedt6kcfyEmryd52Mj -1r1R9mf4iMIUv1zc2sHVc1omxnCw9+7U4GMWLtL5OgyJyfNyoxk3tC+D3KNU ------END CERTIFICATE----- diff --git a/chia/ssl/chia_ca.key b/chia/ssl/chia_ca.key deleted file mode 100644 index e37eb96b2..000000000 --- a/chia/ssl/chia_ca.key +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEowIBAAKCAQEAzz/L219Zjb5CIKnUkpd2julGC+j3E97KUiuOalCH9wdqgpJi -9nBqLccwPCSFXFew6CNBIBM+CW2jT3UVwgzjdXJ7pgtu8gWj0NQ6NqSLiXV2WbpZ -ovfrVh3x7Z4bjPgI3ouWjyehUfmK1GPIld4BfUSQtPlUJ53+XT32GRizUy+b0CcJ -84jp1XvyZAMajYnclFRNNJSw9WXtTlMUu+Z1M4K7c4ZPwEqgEnCgRc0TCaXj180v -o7mCHJQoDiNSCRATwfH+kWxOOK/nePkq2t4mPSFaX8xAS4yILISIOWYn7sNgdy9D -6gGNFo2SZ0FR3x9hjUjYEV3cPqg3BmNE3DDynQIDAQABAoIBAGupS4BJdx8gEAAh -2VDRqAAzhHTZb8j9uoKXJ+NotEkKrDTqUMiOu0nOqOsFWdYPo9HjxoggFuEU+Hpl -a4kj4uF3OG6Yj+jgLypjpV4PeoFM6M9R9BCp07In2i7DLLK9gvYA85SoVLBd/tW4 -hFH+Qy3M+ZNZ1nLCK4pKjtaYs0dpi5zLoVvpEcEem2O+aRpUPCZqkNwU0umATCfg -ZGfFzgXI/XPJr8Uy+LVZOFp3PXXHfnZZD9T5AjO/ViBeqbMFuWQ8BpVOqapNPKj8 -xDY3ovw3uiAYPC7eLib3u/WoFelMc2OMX0QljLp5Y+FScFHAMxoco3AQdWSYvSQw -b5xZmg0CgYEA6zKASfrw3EtPthkLR5NBmesI4RbbY6iFVhS5loLbzTtStvsus8EI -6RQgLgAFF14H21YSHxb6dB1Mbo45BN83gmDpUvKPREslqD3YPMKFo5GXMmv+JhNo -5Y9fhiOEnxzLJGtBB1HeGmg5NXp9mr2Ch9u8w/slfuCHckbA9AYvdxMCgYEA4ZR5 -zg73+UA1a6Pm93bLYZGj+hf7OaB/6Hiw9YxCBgDfWM9dJ48iz382nojT5ui0rClV -5YAo8UCLh01Np9AbBZHuBdYm9IziuKNzTeK31UW+Tvbz+dEx7+PlYQffNOhcIgd+ -9SXjoZorQksImKdMGZld1lEReHuBawq92JQvtY8CgYEAtNwUws7xQLW5CjKf9d5K -5+1Q2qYU9sG0JsmxHQhrtZoUtRjahOe/zlvnkvf48ksgh43cSYQF/Bw7lhhPyGtN -6DhVs69KdB3FS2ajTbXXxjxCpEdfHDB4zW4+6ouNhD1ECTFgxBw0SuIye+lBhSiN -o6NZuOr7nmFSRpIZ9ox7G3kCgYA4pvxMNtAqJekEpn4cChab42LGLX2nhFp7PMxc -bqQqM8/j0vg3Nihs6isCd6SYKjstvZfX8m7V3/rquQxWp9oRdQvNJXJVGojaDBqq -JdU7V6+qzzSIufQLpjV2P+7br7trxGwrDx/y9vAETynShLmE+FJrv6Jems3u3xy8 -psKwmwKBgG5uLzCyMvMB2KwI+f3np2LYVGG0Pl1jq6yNXSaBosAiF0y+IgUjtWY5 -EejO8oPWcb9AbqgPtrWaiJi17KiKv4Oyba5+y36IEtyjolWt0AB6F3oDK0X+Etw8 -j/xlvBNuzDL6gRJHQg1+d4dO8Lz54NDUbKW8jGl+N/7afGVpGmX9 ------END RSA PRIVATE KEY----- diff --git a/chia/util/default_root.py b/chia/util/default_root.py deleted file mode 100644 index 35a964fbf..000000000 --- a/chia/util/default_root.py +++ /dev/null @@ -1,4 +0,0 @@ -import os -from pathlib import Path - -DEFAULT_ROOT_PATH = Path(os.path.expanduser(os.getenv("CHIA_ROOT", "~/.chia/mainnet"))).resolve() diff --git a/chia/util/service_groups.py b/chia/util/service_groups.py deleted file mode 100644 index 3facee460..000000000 --- a/chia/util/service_groups.py +++ /dev/null @@ -1,31 +0,0 @@ -from typing import KeysView, Generator - -SERVICES_FOR_GROUP = { - "all": "chia_harvester chia_timelord_launcher chia_timelord chia_farmer chia_full_node chia_wallet".split(), - "node": "chia_full_node".split(), - "harvester": "chia_harvester".split(), - "farmer": "chia_harvester chia_farmer chia_full_node chia_wallet".split(), - "farmer-no-wallet": "chia_harvester chia_farmer chia_full_node".split(), - "farmer-only": "chia_farmer".split(), - "timelord": "chia_timelord_launcher chia_timelord chia_full_node".split(), - "timelord-only": "chia_timelord".split(), - "timelord-launcher-only": "chia_timelord_launcher".split(), - "wallet": "chia_wallet chia_full_node".split(), - "wallet-only": "chia_wallet".split(), - "introducer": "chia_introducer".split(), - "simulator": "chia_full_node_simulator".split(), -} - - -def all_groups() -> KeysView[str]: - return SERVICES_FOR_GROUP.keys() - - -def services_for_groups(groups) -> Generator[str, None, None]: - for group in groups: - for service in SERVICES_FOR_GROUP[group]: - yield service - - -def validate_service(service: str) -> bool: - return any(service in _ for _ in SERVICES_FOR_GROUP.values()) diff --git a/flax-blockchain-gui b/flax-blockchain-gui new file mode 160000 index 000000000..b2ab8a07d --- /dev/null +++ b/flax-blockchain-gui @@ -0,0 +1 @@ +Subproject commit b2ab8a07df8c979f0defd6652933afb8af55dc92 diff --git a/chia/__init__.py b/flax/__init__.py similarity index 59% rename from chia/__init__.py rename to flax/__init__.py index c136c9c3d..890b2fe9e 100644 --- a/chia/__init__.py +++ b/flax/__init__.py @@ -1,9 +1,9 @@ from pkg_resources import DistributionNotFound, get_distribution, resource_filename try: - __version__ = get_distribution("chia-blockchain").version + __version__ = get_distribution("flax-blockchain").version except DistributionNotFound: # package is not installed __version__ = "unknown" -PYINSTALLER_SPEC_PATH = resource_filename("chia", "pyinstaller.spec") +PYINSTALLER_SPEC_PATH = resource_filename("flax", "pyinstaller.spec") diff --git a/chia/cmds/__init__.py b/flax/cmds/__init__.py similarity index 100% rename from chia/cmds/__init__.py rename to flax/cmds/__init__.py diff --git a/chia/cmds/configure.py b/flax/cmds/configure.py similarity index 94% rename from chia/cmds/configure.py rename to flax/cmds/configure.py index 94029232f..da2ef0b54 100644 --- a/chia/cmds/configure.py +++ b/flax/cmds/configure.py @@ -3,8 +3,8 @@ import click -from chia.util.config import load_config, save_config, str2bool -from chia.util.default_root import DEFAULT_ROOT_PATH +from flax.util.config import load_config, save_config, str2bool +from flax.util.default_root import DEFAULT_ROOT_PATH def configure( @@ -75,8 +75,8 @@ def configure( if testnet is not None: if testnet == "true" or testnet == "t": print("Setting Testnet") - testnet_port = "58444" - testnet_introducer = "beta1_introducer.chia.net" + testnet_port = "56888" + testnet_introducer = "beta1_introducer.flaxnetwork.org" testnet = "testnet7" config["full_node"]["port"] = int(testnet_port) config["full_node"]["introducer_peer"]["port"] = int(testnet_port) @@ -100,8 +100,8 @@ def configure( elif testnet == "false" or testnet == "f": print("Setting Mainnet") - mainnet_port = "8444" - mainnet_introducer = "introducer.chia.net" + mainnet_port = "6888" + mainnet_introducer = "introducer.flaxnetwork.org" net = "mainnet" config["full_node"]["port"] = int(mainnet_port) config["full_node"]["introducer_peer"]["port"] = int(mainnet_port) @@ -126,7 +126,7 @@ def configure( print("Please choose True or False") if change_made: - print("Restart any running chia services for changes to take effect") + print("Restart any running flax services for changes to take effect") save_config(root_path, "config.yaml", config) return 0 diff --git a/chia/cmds/farm.py b/flax/cmds/farm.py similarity index 100% rename from chia/cmds/farm.py rename to flax/cmds/farm.py diff --git a/chia/cmds/farm_funcs.py b/flax/cmds/farm_funcs.py similarity index 92% rename from chia/cmds/farm_funcs.py rename to flax/cmds/farm_funcs.py index 7419f2a44..571d5269a 100644 --- a/chia/cmds/farm_funcs.py +++ b/flax/cmds/farm_funcs.py @@ -2,16 +2,16 @@ import aiohttp -from chia.cmds.units import units -from chia.consensus.block_record import BlockRecord -from chia.rpc.farmer_rpc_client import FarmerRpcClient -from chia.rpc.full_node_rpc_client import FullNodeRpcClient -from chia.rpc.harvester_rpc_client import HarvesterRpcClient -from chia.rpc.wallet_rpc_client import WalletRpcClient -from chia.util.config import load_config -from chia.util.default_root import DEFAULT_ROOT_PATH -from chia.util.ints import uint16 -from chia.util.misc import format_minutes +from flax.cmds.units import units +from flax.consensus.block_record import BlockRecord +from flax.rpc.farmer_rpc_client import FarmerRpcClient +from flax.rpc.full_node_rpc_client import FullNodeRpcClient +from flax.rpc.harvester_rpc_client import HarvesterRpcClient +from flax.rpc.wallet_rpc_client import WalletRpcClient +from flax.util.config import load_config +from flax.util.default_root import DEFAULT_ROOT_PATH +from flax.util.ints import uint16 +from flax.util.misc import format_minutes SECONDS_PER_BLOCK = (24 * 3600) / 4608 @@ -200,12 +200,12 @@ async def summary(rpc_port: int, wallet_rpc_port: int, harvester_rpc_port: int, print("Farming") if amounts is not None: - print(f"Total chia farmed: {amounts['farmed_amount'] / units['chia']}") - print(f"User transaction fees: {amounts['fee_amount'] / units['chia']}") - print(f"Block rewards: {(amounts['farmer_reward_amount'] + amounts['pool_reward_amount']) / units['chia']}") + print(f"Total flax farmed: {amounts['farmed_amount'] / units['flax']}") + print(f"User transaction fees: {amounts['fee_amount'] / units['flax']}") + print(f"Block rewards: {(amounts['farmer_reward_amount'] + amounts['pool_reward_amount']) / units['flax']}") print(f"Last height farmed: {amounts['last_height_farmed']}") else: - print("Total chia farmed: Unknown") + print("Total flax farmed: Unknown") print("User transaction fees: Unknown") print("Block rewards: Unknown") print("Last height farmed: Unknown") @@ -246,4 +246,4 @@ async def summary(rpc_port: int, wallet_rpc_port: int, harvester_rpc_port: int, proportion = total_plot_size / blockchain_state["space"] if blockchain_state["space"] else -1 minutes = int((await get_average_block_time(rpc_port) / 60) / proportion) if proportion else -1 print("Expected time to win: " + format_minutes(minutes)) - print("Note: log into your key using 'chia wallet show' to see rewards for each key") + print("Note: log into your key using 'flax wallet show' to see rewards for each key") diff --git a/chia/cmds/chia.py b/flax/cmds/flax.py similarity index 69% rename from chia/cmds/chia.py rename to flax/cmds/flax.py index 17fe56588..25533b6f3 100644 --- a/chia/cmds/chia.py +++ b/flax/cmds/flax.py @@ -1,17 +1,17 @@ import click -from chia import __version__ -from chia.cmds.configure import configure_cmd -from chia.cmds.farm import farm_cmd -from chia.cmds.init import init_cmd -from chia.cmds.keys import keys_cmd -from chia.cmds.netspace import netspace_cmd -from chia.cmds.plots import plots_cmd -from chia.cmds.show import show_cmd -from chia.cmds.start import start_cmd -from chia.cmds.stop import stop_cmd -from chia.cmds.wallet import wallet_cmd -from chia.util.default_root import DEFAULT_ROOT_PATH +from flax import __version__ +from flax.cmds.configure import configure_cmd +from flax.cmds.farm import farm_cmd +from flax.cmds.init import init_cmd +from flax.cmds.keys import keys_cmd +from flax.cmds.netspace import netspace_cmd +from flax.cmds.plots import plots_cmd +from flax.cmds.show import show_cmd +from flax.cmds.start import start_cmd +from flax.cmds.stop import stop_cmd +from flax.cmds.wallet import wallet_cmd +from flax.util.default_root import DEFAULT_ROOT_PATH CONTEXT_SETTINGS = dict(help_option_names=["-h", "--help"]) @@ -33,8 +33,8 @@ def monkey_patch_click() -> None: @click.group( - help=f"\n Manage chia blockchain infrastructure ({__version__})\n", - epilog="Try 'chia start node', 'chia netspace -d 192', or 'chia show -s'", + help=f"\n Manage flax blockchain infrastructure ({__version__})\n", + epilog="Try 'flax start node', 'flax netspace -d 192', or 'flax show -s'", context_settings=CONTEXT_SETTINGS, ) @click.option("--root-path", default=DEFAULT_ROOT_PATH, help="Config file root", type=click.Path(), show_default=True) @@ -46,15 +46,15 @@ def cli(ctx: click.Context, root_path: str) -> None: ctx.obj["root_path"] = Path(root_path) -@cli.command("version", short_help="Show chia version") +@cli.command("version", short_help="Show flax version") def version_cmd() -> None: print(__version__) -@cli.command("run_daemon", short_help="Runs chia daemon") +@cli.command("run_daemon", short_help="Runs flax daemon") @click.pass_context def run_daemon_cmd(ctx: click.Context) -> None: - from chia.daemon.server import async_run_daemon + from flax.daemon.server import async_run_daemon import asyncio asyncio.get_event_loop().run_until_complete(async_run_daemon(ctx.obj["root_path"])) diff --git a/chia/cmds/init.py b/flax/cmds/init.py similarity index 64% rename from chia/cmds/init.py rename to flax/cmds/init.py index 1bf4d2011..139efa6bc 100644 --- a/chia/cmds/init.py +++ b/flax/cmds/init.py @@ -16,12 +16,12 @@ def init_cmd(ctx: click.Context, create_certs: str): \b Follow these steps to create new certificates for a remote harvester: - - Make a copy of your Farming Machine CA directory: ~/.chia/[version]/config/ssl/ca - - Shut down all chia daemon processes with `chia stop all -d` - - Run `chia init -c [directory]` on your remote harvester, + - Make a copy of your Farming Machine CA directory: ~/.flax/[version]/config/ssl/ca + - Shut down all flax daemon processes with `flax stop all -d` + - Run `flax init -c [directory]` on your remote harvester, where [directory] is the the copy of your Farming Machine CA directory - - Get more details on remote harvester on Chia wiki: - https://github.com/Chia-Network/chia-blockchain/wiki/Farming-on-many-machines + - Get more details on remote harvester on Flax wiki: + https://github.com/Flax-Network/flax-blockchain/wiki/Farming-on-many-machines """ from pathlib import Path from .init_funcs import init @@ -30,7 +30,7 @@ def init_cmd(ctx: click.Context, create_certs: str): if __name__ == "__main__": - from .init_funcs import chia_init - from chia.util.default_root import DEFAULT_ROOT_PATH + from .init_funcs import flax_init + from flax.util.default_root import DEFAULT_ROOT_PATH - chia_init(DEFAULT_ROOT_PATH) + flax_init(DEFAULT_ROOT_PATH) diff --git a/chia/cmds/init_funcs.py b/flax/cmds/init_funcs.py similarity index 80% rename from chia/cmds/init_funcs.py rename to flax/cmds/init_funcs.py index 61345317c..06646fd9f 100644 --- a/chia/cmds/init_funcs.py +++ b/flax/cmds/init_funcs.py @@ -5,21 +5,21 @@ import yaml -from chia import __version__ -from chia.consensus.coinbase import create_puzzlehash_for_pk -from chia.ssl.create_ssl import generate_ca_signed_cert, get_chia_ca_crt_key, make_ca_cert -from chia.util.bech32m import encode_puzzle_hash -from chia.util.config import ( - create_default_chia_config, +from flax import __version__ +from flax.consensus.coinbase import create_puzzlehash_for_pk +from flax.ssl.create_ssl import generate_ca_signed_cert, get_flax_ca_crt_key, make_ca_cert +from flax.util.bech32m import encode_puzzle_hash +from flax.util.config import ( + create_default_flax_config, initial_config_file, load_config, save_config, unflatten_properties, ) -from chia.util.ints import uint32 -from chia.util.keychain import Keychain -from chia.util.path import mkdir -from chia.wallet.derive_keys import master_sk_to_pool_sk, master_sk_to_wallet_sk +from flax.util.ints import uint32 +from flax.util.keychain import Keychain +from flax.util.path import mkdir +from flax.wallet.derive_keys import master_sk_to_pool_sk, master_sk_to_wallet_sk private_node_names = {"full_node", "wallet", "farmer", "harvester", "timelord", "daemon"} public_node_names = {"full_node", "wallet", "farmer", "introducer", "timelord"} @@ -50,14 +50,14 @@ def check_keys(new_root: Path) -> None: keychain: Keychain = Keychain() all_sks = keychain.get_all_private_keys() if len(all_sks) == 0: - print("No keys are present in the keychain. Generate them with 'chia keys generate'") + print("No keys are present in the keychain. Generate them with 'flax keys generate'") return None config: Dict = load_config(new_root, "config.yaml") pool_child_pubkeys = [master_sk_to_pool_sk(sk).get_g1() for sk, _ in all_sks] all_targets = [] - stop_searching_for_farmer = "xch_target_address" not in config["farmer"] - stop_searching_for_pool = "xch_target_address" not in config["pool"] + stop_searching_for_farmer = "xfx_target_address" not in config["farmer"] + stop_searching_for_pool = "xfx_target_address" not in config["pool"] number_of_ph_to_search = 500 selected = config["selected_network"] prefix = config["network_overrides"]["config"][selected]["address_prefix"] @@ -68,32 +68,32 @@ def check_keys(new_root: Path) -> None: all_targets.append( encode_puzzle_hash(create_puzzlehash_for_pk(master_sk_to_wallet_sk(sk, uint32(i)).get_g1()), prefix) ) - if all_targets[-1] == config["farmer"].get("xch_target_address"): + if all_targets[-1] == config["farmer"].get("xfx_target_address"): stop_searching_for_farmer = True - if all_targets[-1] == config["pool"].get("xch_target_address"): + if all_targets[-1] == config["pool"].get("xfx_target_address"): stop_searching_for_pool = True # Set the destinations - if "xch_target_address" not in config["farmer"]: - print(f"Setting the xch destination address for coinbase fees reward to {all_targets[0]}") - config["farmer"]["xch_target_address"] = all_targets[0] - elif config["farmer"]["xch_target_address"] not in all_targets: + if "xfx_target_address" not in config["farmer"]: + print(f"Setting the xfx destination address for coinbase fees reward to {all_targets[0]}") + config["farmer"]["xfx_target_address"] = all_targets[0] + elif config["farmer"]["xfx_target_address"] not in all_targets: print( f"WARNING: using a farmer address which we don't have the private" f" keys for. We searched the first {number_of_ph_to_search} addresses. Consider overriding " - f"{config['farmer']['xch_target_address']} with {all_targets[0]}" + f"{config['farmer']['xfx_target_address']} with {all_targets[0]}" ) if "pool" not in config: config["pool"] = {} - if "xch_target_address" not in config["pool"]: - print(f"Setting the xch destination address for coinbase reward to {all_targets[0]}") - config["pool"]["xch_target_address"] = all_targets[0] - elif config["pool"]["xch_target_address"] not in all_targets: + if "xfx_target_address" not in config["pool"]: + print(f"Setting the xfx destination address for coinbase reward to {all_targets[0]}") + config["pool"]["xfx_target_address"] = all_targets[0] + elif config["pool"]["xfx_target_address"] not in all_targets: print( f"WARNING: using a pool address which we don't have the private" f" keys for. We searched the first {number_of_ph_to_search} addresses. Consider overriding " - f"{config['pool']['xch_target_address']} with {all_targets[0]}" + f"{config['pool']['xfx_target_address']} with {all_targets[0]}" ) # Set the pool pks in the farmer @@ -176,11 +176,11 @@ def create_all_ssl(root: Path): private_ca_key_path = ca_dir / "private_ca.key" private_ca_crt_path = ca_dir / "private_ca.crt" - chia_ca_crt, chia_ca_key = get_chia_ca_crt_key() - chia_ca_crt_path = ca_dir / "chia_ca.crt" - chia_ca_key_path = ca_dir / "chia_ca.key" - chia_ca_crt_path.write_bytes(chia_ca_crt) - chia_ca_key_path.write_bytes(chia_ca_key) + flax_ca_crt, flax_ca_key = get_flax_ca_crt_key() + flax_ca_crt_path = ca_dir / "flax_ca.crt" + flax_ca_key_path = ca_dir / "flax_ca.key" + flax_ca_crt_path.write_bytes(flax_ca_crt) + flax_ca_key_path.write_bytes(flax_ca_key) if not private_ca_key_path.exists() or not private_ca_crt_path.exists(): # Create private CA @@ -197,8 +197,8 @@ def create_all_ssl(root: Path): ca_crt = private_ca_crt_path.read_bytes() generate_ssl_for_nodes(ssl_dir, ca_crt, ca_key, True) - chia_ca_crt, chia_ca_key = get_chia_ca_crt_key() - generate_ssl_for_nodes(ssl_dir, chia_ca_crt, chia_ca_key, False, overwrite=False) + flax_ca_crt, flax_ca_key = get_flax_ca_crt_key() + generate_ssl_for_nodes(ssl_dir, flax_ca_crt, flax_ca_key, False, overwrite=False) def generate_ssl_for_nodes(ssl_dir: Path, ca_crt: bytes, ca_key: bytes, private: bool, overwrite=True): @@ -244,12 +244,12 @@ def init(create_certs: Optional[Path], root_path: Path): print(f"** Directory {create_certs} does not exist **") else: print(f"** {root_path} does not exist **") - print("** Please run `chia init` to migrate or create new config files **") + print("** Please run `flax init` to migrate or create new config files **") else: - return chia_init(root_path) + return flax_init(root_path) -def chia_version_number() -> Tuple[str, str, str, str]: +def flax_version_number() -> Tuple[str, str, str, str]: scm_full_version = __version__ left_full_version = scm_full_version.split("+") @@ -297,37 +297,37 @@ def chia_version_number() -> Tuple[str, str, str, str]: return major_release_number, minor_release_number, patch_release_number, dev_release_number -def chia_minor_release_number(): - res = int(chia_version_number()[2]) +def flax_minor_release_number(): + res = int(flax_version_number()[2]) print(f"Install release number: {res}") return res -def chia_full_version_str() -> str: - major, minor, patch, dev = chia_version_number() +def flax_full_version_str() -> str: + major, minor, patch, dev = flax_version_number() return f"{major}.{minor}.{patch}{dev}" -def chia_init(root_path: Path): - if os.environ.get("CHIA_ROOT", None) is not None: +def flax_init(root_path: Path): + if os.environ.get("FLAX_ROOT", None) is not None: print( - f"warning, your CHIA_ROOT is set to {os.environ['CHIA_ROOT']}. " - f"Please unset the environment variable and run chia init again\n" + f"warning, your FLAX_ROOT is set to {os.environ['FLAX_ROOT']}. " + f"Please unset the environment variable and run flax init again\n" f"or manually migrate config.yaml" ) - print(f"Chia directory {root_path}") + print(f"Flax directory {root_path}") if root_path.is_dir() and Path(root_path / "config" / "config.yaml").exists(): - # This is reached if CHIA_ROOT is set, or if user has run chia init twice + # This is reached if FLAX_ROOT is set, or if user has run flax init twice # before a new update. check_keys(root_path) print(f"{root_path} already exists, no migration action taken") return -1 - create_default_chia_config(root_path) + create_default_flax_config(root_path) create_all_ssl(root_path) check_keys(root_path) print("") - print("To see your keys, run 'chia keys show --show-mnemonic-seed'") + print("To see your keys, run 'flax keys show --show-mnemonic-seed'") return 0 diff --git a/chia/cmds/keys.py b/flax/cmds/keys.py similarity index 99% rename from chia/cmds/keys.py rename to flax/cmds/keys.py index 6ea3494a5..504da4292 100644 --- a/chia/cmds/keys.py +++ b/flax/cmds/keys.py @@ -9,7 +9,7 @@ def keys_cmd(ctx: click.Context): root_path: Path = ctx.obj["root_path"] if not root_path.is_dir(): - raise RuntimeError("Please initialize (or migrate) your config directory with chia init") + raise RuntimeError("Please initialize (or migrate) your config directory with flax init") @keys_cmd.command("generate", short_help="Generates and adds a key to keychain") diff --git a/chia/cmds/keys_funcs.py b/flax/cmds/keys_funcs.py similarity index 91% rename from chia/cmds/keys_funcs.py rename to flax/cmds/keys_funcs.py index c747dee9e..dd39b9c59 100644 --- a/chia/cmds/keys_funcs.py +++ b/flax/cmds/keys_funcs.py @@ -2,13 +2,13 @@ from blspy import AugSchemeMPL, G1Element, G2Element -from chia.consensus.coinbase import create_puzzlehash_for_pk -from chia.util.bech32m import encode_puzzle_hash -from chia.util.config import load_config -from chia.util.default_root import DEFAULT_ROOT_PATH -from chia.util.ints import uint32 -from chia.util.keychain import Keychain, bytes_to_mnemonic, generate_mnemonic -from chia.wallet.derive_keys import master_sk_to_farmer_sk, master_sk_to_pool_sk, master_sk_to_wallet_sk +from flax.consensus.coinbase import create_puzzlehash_for_pk +from flax.util.bech32m import encode_puzzle_hash +from flax.util.config import load_config +from flax.util.default_root import DEFAULT_ROOT_PATH +from flax.util.ints import uint32 +from flax.util.keychain import Keychain, bytes_to_mnemonic, generate_mnemonic +from flax.wallet.derive_keys import master_sk_to_farmer_sk, master_sk_to_pool_sk, master_sk_to_wallet_sk keychain: Keychain = Keychain() @@ -21,7 +21,7 @@ def generate_and_print(): mnemonic = generate_mnemonic() print("Generating private key. Mnemonic (24 secret words):") print(mnemonic) - print("Note that this key has not been added to the keychain. Run chia keys add") + print("Note that this key has not been added to the keychain. Run flax keys add") return mnemonic diff --git a/chia/cmds/netspace.py b/flax/cmds/netspace.py similarity index 100% rename from chia/cmds/netspace.py rename to flax/cmds/netspace.py diff --git a/chia/cmds/netspace_funcs.py b/flax/cmds/netspace_funcs.py similarity index 93% rename from chia/cmds/netspace_funcs.py rename to flax/cmds/netspace_funcs.py index 4ee713c9e..fcbfa9f71 100644 --- a/chia/cmds/netspace_funcs.py +++ b/flax/cmds/netspace_funcs.py @@ -1,10 +1,10 @@ import aiohttp -from chia.rpc.full_node_rpc_client import FullNodeRpcClient -from chia.util.byte_types import hexstr_to_bytes -from chia.util.config import load_config -from chia.util.default_root import DEFAULT_ROOT_PATH -from chia.util.ints import uint16 +from flax.rpc.full_node_rpc_client import FullNodeRpcClient +from flax.util.byte_types import hexstr_to_bytes +from flax.util.config import load_config +from flax.util.default_root import DEFAULT_ROOT_PATH +from flax.util.ints import uint16 async def netstorge_async(rpc_port: int, delta_block_height: str, start: str) -> None: diff --git a/chia/cmds/plots.py b/flax/cmds/plots.py similarity index 92% rename from chia/cmds/plots.py rename to flax/cmds/plots.py index 58b4e9ec1..fdcab2363 100644 --- a/chia/cmds/plots.py +++ b/flax/cmds/plots.py @@ -9,14 +9,14 @@ def show_plots(root_path: Path): - from chia.plotting.plot_tools import get_plot_directories + from flax.plotting.plot_tools import get_plot_directories print("Directories where plots are being searched for:") print("Note that subdirectories must be added manually") print( - "Add with 'chia plots add -d [dir]' and remove with" - + " 'chia plots remove -d [dir]'" - + " Scan and check plots with 'chia plots check'" + "Add with 'flax plots add -d [dir]' and remove with" + + " 'flax plots remove -d [dir]'" + + " Scan and check plots with 'flax plots check'" ) print() for str_path in get_plot_directories(root_path): @@ -27,11 +27,11 @@ def show_plots(root_path: Path): @click.pass_context def plots_cmd(ctx: click.Context): """Create, add, remove and check your plots""" - from chia.util.chia_logging import initialize_logging + from flax.util.flax_logging import initialize_logging root_path: Path = ctx.obj["root_path"] if not root_path.is_dir(): - raise RuntimeError("Please initialize (or migrate) your config directory with 'chia init'") + raise RuntimeError("Please initialize (or migrate) your config directory with 'flax init'") initialize_logging("", {"log_stdout": True}, root_path) @@ -102,7 +102,7 @@ def create_cmd( nobitfield: bool, exclude_final_dir: bool, ): - from chia.plotting.create_plots import create_plots + from flax.plotting.create_plots import create_plots class Params(object): def __init__(self): @@ -151,7 +151,7 @@ def __init__(self): def check_cmd( ctx: click.Context, num: int, grep_string: str, list_duplicates: bool, debug_show_memo: bool, challenge_start: int ): - from chia.plotting.check_plots import check_plots + from flax.plotting.check_plots import check_plots check_plots(ctx.obj["root_path"], num, challenge_start, grep_string, list_duplicates, debug_show_memo) @@ -167,7 +167,7 @@ def check_cmd( ) @click.pass_context def add_cmd(ctx: click.Context, final_dir: str): - from chia.plotting.plot_tools import add_plot_directory + from flax.plotting.plot_tools import add_plot_directory add_plot_directory(Path(final_dir), ctx.obj["root_path"]) print(f'Added plot directory "{final_dir}".') @@ -184,7 +184,7 @@ def add_cmd(ctx: click.Context, final_dir: str): ) @click.pass_context def remove_cmd(ctx: click.Context, final_dir: str): - from chia.plotting.plot_tools import remove_plot_directory + from flax.plotting.plot_tools import remove_plot_directory remove_plot_directory(Path(final_dir), ctx.obj["root_path"]) print(f'Removed plot directory "{final_dir}".') diff --git a/chia/cmds/show.py b/flax/cmds/show.py similarity index 96% rename from chia/cmds/show.py rename to flax/cmds/show.py index 9cda05766..e63e0fe93 100644 --- a/chia/cmds/show.py +++ b/flax/cmds/show.py @@ -19,15 +19,15 @@ async def show_async( from time import localtime, struct_time from typing import List, Optional - from chia.consensus.block_record import BlockRecord - from chia.rpc.full_node_rpc_client import FullNodeRpcClient - from chia.server.outbound_message import NodeType - from chia.types.full_block import FullBlock - from chia.util.bech32m import encode_puzzle_hash - from chia.util.byte_types import hexstr_to_bytes - from chia.util.config import load_config - from chia.util.default_root import DEFAULT_ROOT_PATH - from chia.util.ints import uint16 + from flax.consensus.block_record import BlockRecord + from flax.rpc.full_node_rpc_client import FullNodeRpcClient + from flax.server.outbound_message import NodeType + from flax.types.full_block import FullBlock + from flax.util.bech32m import encode_puzzle_hash + from flax.util.byte_types import hexstr_to_bytes + from flax.util.config import load_config + from flax.util.default_root import DEFAULT_ROOT_PATH + from flax.util.ints import uint16 try: config = load_config(DEFAULT_ROOT_PATH, "config.yaml") @@ -65,7 +65,7 @@ async def show_async( print(f"Current Blockchain Status: Not Synced. Peak height: {peak.height}") else: print("\nSearching for an initial chain\n") - print("You may be able to expedite with 'chia show -a host:port' using a known node.\n") + print("You may be able to expedite with 'flax show -a host:port' using a known node.\n") if peak is not None: if peak.is_transaction_block: diff --git a/chia/cmds/start.py b/flax/cmds/start.py similarity index 91% rename from chia/cmds/start.py rename to flax/cmds/start.py index 393f89ea7..4002f6da2 100644 --- a/chia/cmds/start.py +++ b/flax/cmds/start.py @@ -1,6 +1,6 @@ import click -from chia.util.service_groups import all_groups +from flax.util.service_groups import all_groups @click.command("start", short_help="Start service groups") diff --git a/chia/cmds/start_funcs.py b/flax/cmds/start_funcs.py similarity index 87% rename from chia/cmds/start_funcs.py rename to flax/cmds/start_funcs.py index 5a4a8bebf..f465d2f21 100644 --- a/chia/cmds/start_funcs.py +++ b/flax/cmds/start_funcs.py @@ -6,15 +6,15 @@ from pathlib import Path from typing import Optional -from chia.daemon.client import DaemonProxy, connect_to_daemon_and_validate -from chia.util.service_groups import services_for_groups +from flax.daemon.client import DaemonProxy, connect_to_daemon_and_validate +from flax.util.service_groups import services_for_groups def launch_start_daemon(root_path: Path) -> subprocess.Popen: - os.environ["CHIA_ROOT"] = str(root_path) + os.environ["FLAX_ROOT"] = str(root_path) # TODO: use startupinfo=subprocess.DETACHED_PROCESS on windows - chia = sys.argv[0] - process = subprocess.Popen(f"{chia} run_daemon".split(), stdout=subprocess.PIPE) + flax = sys.argv[0] + process = subprocess.Popen(f"{flax} run_daemon".split(), stdout=subprocess.PIPE) return process @@ -38,7 +38,7 @@ async def create_start_daemon_connection(root_path: Path) -> Optional[DaemonProx async def async_start(root_path: Path, group: str, restart: bool) -> None: daemon = await create_start_daemon_connection(root_path) if daemon is None: - print("Failed to create the chia daemon") + print("Failed to create the flax daemon") return None for service in services_for_groups(group): diff --git a/chia/cmds/stop.py b/flax/cmds/stop.py similarity index 87% rename from chia/cmds/stop.py rename to flax/cmds/stop.py index 9efc919eb..bd4c32ad6 100644 --- a/chia/cmds/stop.py +++ b/flax/cmds/stop.py @@ -3,15 +3,15 @@ import click -from chia.util.service_groups import all_groups, services_for_groups +from flax.util.service_groups import all_groups, services_for_groups async def async_stop(root_path: Path, group: str, stop_daemon: bool) -> int: - from chia.daemon.client import connect_to_daemon_and_validate + from flax.daemon.client import connect_to_daemon_and_validate daemon = await connect_to_daemon_and_validate(root_path) if daemon is None: - print("Couldn't connect to chia daemon") + print("Couldn't connect to flax daemon") return 1 if stop_daemon: diff --git a/chia/cmds/units.py b/flax/cmds/units.py similarity index 80% rename from chia/cmds/units.py rename to flax/cmds/units.py index c3bd405c4..040d99b3f 100644 --- a/chia/cmds/units.py +++ b/flax/cmds/units.py @@ -3,7 +3,7 @@ # The rest of the codebase uses mojos everywhere. Only uses these units # for user facing interfaces units: Dict[str, int] = { - "chia": 10 ** 12, # 1 chia (XCH) is 1,000,000,000,000 mojo (1 Trillion) + "flax": 10 ** 12, # 1 flax (XCH) is 1,000,000,000,000 mojo (1 Trillion) "mojo:": 1, "colouredcoin": 10 ** 3, # 1 coloured coin is 1000 colouredcoin mojos } diff --git a/chia/cmds/wallet.py b/flax/cmds/wallet.py similarity index 97% rename from chia/cmds/wallet.py rename to flax/cmds/wallet.py index fd16c18ca..3afd4de4d 100644 --- a/chia/cmds/wallet.py +++ b/flax/cmds/wallet.py @@ -54,7 +54,7 @@ def get_transactions_cmd(wallet_rpc_port: int, fingerprint: int, id: int, offset asyncio.run(execute_with_wallet(wallet_rpc_port, fingerprint, extra_params, get_transactions)) -@wallet_cmd.command("send", short_help="Send chia to another wallet") +@wallet_cmd.command("send", short_help="Send flax to another wallet") @click.option( "-wp", "--wallet-rpc-port", @@ -64,7 +64,7 @@ def get_transactions_cmd(wallet_rpc_port: int, fingerprint: int, id: int, offset ) @click.option("-f", "--fingerprint", help="Set the fingerprint to specify which wallet to use", type=int) @click.option("-i", "--id", help="Id of the wallet to use", type=int, default=1, show_default=True, required=True) -@click.option("-a", "--amount", help="How much chia to send, in XCH", type=str, required=True) +@click.option("-a", "--amount", help="How much flax to send, in XCH", type=str, required=True) @click.option( "-m", "--fee", diff --git a/chia/cmds/wallet_funcs.py b/flax/cmds/wallet_funcs.py similarity index 88% rename from chia/cmds/wallet_funcs.py rename to flax/cmds/wallet_funcs.py index f59764f6b..87b08d775 100644 --- a/chia/cmds/wallet_funcs.py +++ b/flax/cmds/wallet_funcs.py @@ -7,27 +7,27 @@ import aiohttp -from chia.cmds.units import units -from chia.rpc.wallet_rpc_client import WalletRpcClient -from chia.server.start_wallet import SERVICE_NAME -from chia.util.bech32m import encode_puzzle_hash -from chia.util.byte_types import hexstr_to_bytes -from chia.util.config import load_config -from chia.util.default_root import DEFAULT_ROOT_PATH -from chia.util.ints import uint16, uint64 -from chia.wallet.transaction_record import TransactionRecord -from chia.wallet.util.wallet_types import WalletType +from flax.cmds.units import units +from flax.rpc.wallet_rpc_client import WalletRpcClient +from flax.server.start_wallet import SERVICE_NAME +from flax.util.bech32m import encode_puzzle_hash +from flax.util.byte_types import hexstr_to_bytes +from flax.util.config import load_config +from flax.util.default_root import DEFAULT_ROOT_PATH +from flax.util.ints import uint16, uint64 +from flax.wallet.transaction_record import TransactionRecord +from flax.wallet.util.wallet_types import WalletType def print_transaction(tx: TransactionRecord, verbose: bool, name) -> None: if verbose: print(tx) else: - chia_amount = Decimal(int(tx.amount)) / units["chia"] + flax_amount = Decimal(int(tx.amount)) / units["flax"] to_address = encode_puzzle_hash(tx.to_puzzle_hash, name) print(f"Transaction {tx.name}") print(f"Status: {'Confirmed' if tx.confirmed else ('In mempool' if tx.is_in_mempool() else 'Pending')}") - print(f"Amount: {chia_amount} {name}") + print(f"Amount: {flax_amount} {name}") print(f"To address: {to_address}") print("Created at:", datetime.fromtimestamp(tx.created_at_time).strftime("%Y-%m-%d %H:%M:%S")) print("") @@ -75,8 +75,8 @@ async def send(args: dict, wallet_client: WalletRpcClient, fingerprint: int) -> address = args["address"] print("Submitting transaction...") - final_amount = uint64(int(amount * units["chia"])) - final_fee = uint64(int(fee * units["chia"])) + final_amount = uint64(int(amount * units["flax"])) + final_fee = uint64(int(fee * units["flax"])) res = await wallet_client.send_transaction(wallet_id, final_amount, address, final_fee) tx_id = res.name start = time.time() @@ -85,11 +85,11 @@ async def send(args: dict, wallet_client: WalletRpcClient, fingerprint: int) -> tx = await wallet_client.get_transaction(wallet_id, tx_id) if len(tx.sent_to) > 0: print(f"Transaction submitted to nodes: {tx.sent_to}") - print(f"Do chia wallet get_transaction -f {fingerprint} -tx 0x{tx_id} to get status") + print(f"Do flax wallet get_transaction -f {fingerprint} -tx 0x{tx_id} to get status") return None print("Transaction not yet submitted to nodes") - print(f"Do 'chia wallet get_transaction -f {fingerprint} -tx 0x{tx_id}' to get status") + print(f"Do 'flax wallet get_transaction -f {fingerprint} -tx 0x{tx_id}' to get status") async def get_address(args: dict, wallet_client: WalletRpcClient, fingerprint: int) -> None: @@ -118,15 +118,15 @@ async def print_balances(args: dict, wallet_client: WalletRpcClient, fingerprint else: print(f"Wallet ID {wallet_id} type {typ}") print( - f" -Total Balance: {balances['confirmed_wallet_balance']/units['chia']} {address_prefix} " + f" -Total Balance: {balances['confirmed_wallet_balance']/units['flax']} {address_prefix} " f"({balances['confirmed_wallet_balance']} mojo)" ) print( - f" -Pending Total Balance: {balances['unconfirmed_wallet_balance']/units['chia']} {address_prefix} " + f" -Pending Total Balance: {balances['unconfirmed_wallet_balance']/units['flax']} {address_prefix} " f"({balances['unconfirmed_wallet_balance']} mojo)" ) print( - f" -Spendable: {balances['spendable_balance']/units['chia']} {address_prefix} " + f" -Spendable: {balances['spendable_balance']/units['flax']} {address_prefix} " f"({balances['spendable_balance']} mojo)" ) @@ -137,7 +137,7 @@ async def get_wallet(wallet_client: WalletRpcClient, fingerprint: int = None) -> else: fingerprints = await wallet_client.get_public_keys() if len(fingerprints) == 0: - print("No keys loaded. Run 'chia keys generate' or import a key") + print("No keys loaded. Run 'flax keys generate' or import a key") return None if len(fingerprints) == 1: fingerprint = fingerprints[0] @@ -170,7 +170,7 @@ async def get_wallet(wallet_client: WalletRpcClient, fingerprint: int = None) -> use_cloud = True if "backup_path" in log_in_response: path = log_in_response["backup_path"] - print(f"Backup file from backup.chia.net downloaded and written to: {path}") + print(f"Backup file from backup.flaxnetwork.org downloaded and written to: {path}") val = input("Do you want to use this file to restore from backup? (Y/N) ") if val.lower() == "y": log_in_response = await wallet_client.log_in_and_restore(fingerprint, path) diff --git a/chia/consensus/__init__.py b/flax/consensus/__init__.py similarity index 100% rename from chia/consensus/__init__.py rename to flax/consensus/__init__.py diff --git a/chia/consensus/block_body_validation.py b/flax/consensus/block_body_validation.py similarity index 93% rename from chia/consensus/block_body_validation.py rename to flax/consensus/block_body_validation.py index e1ddb0e4e..9c2ea840c 100644 --- a/chia/consensus/block_body_validation.py +++ b/flax/consensus/block_body_validation.py @@ -6,39 +6,39 @@ from chiabip158 import PyBIP158 from clvm.casts import int_from_bytes -from chia.consensus.block_record import BlockRecord -from chia.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward -from chia.consensus.block_root_validation import validate_block_merkle_roots -from chia.full_node.mempool_check_conditions import mempool_check_conditions_dict -from chia.consensus.blockchain_interface import BlockchainInterface -from chia.consensus.coinbase import create_farmer_coin, create_pool_coin -from chia.consensus.constants import ConsensusConstants -from chia.consensus.cost_calculator import NPCResult, calculate_cost_of_program -from chia.consensus.find_fork_point import find_fork_point_in_chain -from chia.full_node.block_store import BlockStore -from chia.full_node.coin_store import CoinStore -from chia.full_node.mempool_check_conditions import get_name_puzzle_conditions -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.coin_record import CoinRecord -from chia.types.condition_opcodes import ConditionOpcode -from chia.types.condition_with_args import ConditionWithArgs -from chia.types.full_block import FullBlock -from chia.types.generator_types import BlockGenerator -from chia.types.name_puzzle_condition import NPC -from chia.types.unfinished_block import UnfinishedBlock -from chia.util.condition_tools import ( +from flax.consensus.block_record import BlockRecord +from flax.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward +from flax.consensus.block_root_validation import validate_block_merkle_roots +from flax.full_node.mempool_check_conditions import mempool_check_conditions_dict +from flax.consensus.blockchain_interface import BlockchainInterface +from flax.consensus.coinbase import create_farmer_coin, create_pool_coin +from flax.consensus.constants import ConsensusConstants +from flax.consensus.cost_calculator import NPCResult, calculate_cost_of_program +from flax.consensus.find_fork_point import find_fork_point_in_chain +from flax.full_node.block_store import BlockStore +from flax.full_node.coin_store import CoinStore +from flax.full_node.mempool_check_conditions import get_name_puzzle_conditions +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.coin_record import CoinRecord +from flax.types.condition_opcodes import ConditionOpcode +from flax.types.condition_with_args import ConditionWithArgs +from flax.types.full_block import FullBlock +from flax.types.generator_types import BlockGenerator +from flax.types.name_puzzle_condition import NPC +from flax.types.unfinished_block import UnfinishedBlock +from flax.util.condition_tools import ( pkm_pairs_for_conditions_dict, coin_announcements_names_for_npc, puzzle_announcements_names_for_npc, ) -from chia.util.errors import Err -from chia.util.generator_tools import ( +from flax.util.errors import Err +from flax.util.generator_tools import ( additions_for_npc, tx_removals_and_additions, ) -from chia.util.hash import std_hash -from chia.util.ints import uint32, uint64, uint128 +from flax.util.hash import std_hash +from flax.util.ints import uint32, uint64, uint128 log = logging.getLogger(__name__) diff --git a/chia/consensus/block_creation.py b/flax/consensus/block_creation.py similarity index 93% rename from chia/consensus/block_creation.py rename to flax/consensus/block_creation.py index 177a61231..9c29f16c3 100644 --- a/chia/consensus/block_creation.py +++ b/flax/consensus/block_creation.py @@ -7,30 +7,30 @@ from blspy import G1Element, G2Element from chiabip158 import PyBIP158 -from chia.consensus.block_record import BlockRecord -from chia.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward -from chia.consensus.blockchain_interface import BlockchainInterface -from chia.consensus.coinbase import create_farmer_coin, create_pool_coin -from chia.consensus.constants import ConsensusConstants -from chia.consensus.cost_calculator import NPCResult, calculate_cost_of_program -from chia.full_node.mempool_check_conditions import get_name_puzzle_conditions -from chia.full_node.signage_point import SignagePoint -from chia.types.blockchain_format.coin import Coin, hash_coin_list -from chia.types.blockchain_format.foliage import Foliage, FoliageBlockData, FoliageTransactionBlock, TransactionsInfo -from chia.types.blockchain_format.pool_target import PoolTarget -from chia.types.blockchain_format.proof_of_space import ProofOfSpace -from chia.types.blockchain_format.reward_chain_block import RewardChainBlock, RewardChainBlockUnfinished -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.blockchain_format.vdf import VDFInfo, VDFProof -from chia.types.end_of_slot_bundle import EndOfSubSlotBundle -from chia.types.full_block import FullBlock -from chia.types.generator_types import BlockGenerator -from chia.types.unfinished_block import UnfinishedBlock -from chia.util.hash import std_hash -from chia.util.ints import uint8, uint32, uint64, uint128 -from chia.util.merkle_set import MerkleSet -from chia.util.prev_transaction_block import get_prev_transaction_block -from chia.util.recursive_replace import recursive_replace +from flax.consensus.block_record import BlockRecord +from flax.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward +from flax.consensus.blockchain_interface import BlockchainInterface +from flax.consensus.coinbase import create_farmer_coin, create_pool_coin +from flax.consensus.constants import ConsensusConstants +from flax.consensus.cost_calculator import NPCResult, calculate_cost_of_program +from flax.full_node.mempool_check_conditions import get_name_puzzle_conditions +from flax.full_node.signage_point import SignagePoint +from flax.types.blockchain_format.coin import Coin, hash_coin_list +from flax.types.blockchain_format.foliage import Foliage, FoliageBlockData, FoliageTransactionBlock, TransactionsInfo +from flax.types.blockchain_format.pool_target import PoolTarget +from flax.types.blockchain_format.proof_of_space import ProofOfSpace +from flax.types.blockchain_format.reward_chain_block import RewardChainBlock, RewardChainBlockUnfinished +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.blockchain_format.vdf import VDFInfo, VDFProof +from flax.types.end_of_slot_bundle import EndOfSubSlotBundle +from flax.types.full_block import FullBlock +from flax.types.generator_types import BlockGenerator +from flax.types.unfinished_block import UnfinishedBlock +from flax.util.hash import std_hash +from flax.util.ints import uint8, uint32, uint64, uint128 +from flax.util.merkle_set import MerkleSet +from flax.util.prev_transaction_block import get_prev_transaction_block +from flax.util.recursive_replace import recursive_replace log = logging.getLogger(__name__) diff --git a/chia/consensus/block_header_validation.py b/flax/consensus/block_header_validation.py similarity index 97% rename from chia/consensus/block_header_validation.py rename to flax/consensus/block_header_validation.py index d4f935db1..1867c4093 100644 --- a/chia/consensus/block_header_validation.py +++ b/flax/consensus/block_header_validation.py @@ -5,31 +5,31 @@ from blspy import AugSchemeMPL -from chia.consensus.block_record import BlockRecord -from chia.consensus.blockchain_interface import BlockchainInterface -from chia.consensus.constants import ConsensusConstants -from chia.consensus.deficit import calculate_deficit -from chia.consensus.difficulty_adjustment import can_finish_sub_and_full_epoch -from chia.consensus.get_block_challenge import final_eos_is_already_included, get_block_challenge -from chia.consensus.make_sub_epoch_summary import make_sub_epoch_summary -from chia.consensus.pot_iterations import ( +from flax.consensus.block_record import BlockRecord +from flax.consensus.blockchain_interface import BlockchainInterface +from flax.consensus.constants import ConsensusConstants +from flax.consensus.deficit import calculate_deficit +from flax.consensus.difficulty_adjustment import can_finish_sub_and_full_epoch +from flax.consensus.get_block_challenge import final_eos_is_already_included, get_block_challenge +from flax.consensus.make_sub_epoch_summary import make_sub_epoch_summary +from flax.consensus.pot_iterations import ( calculate_ip_iters, calculate_iterations_quality, calculate_sp_interval_iters, calculate_sp_iters, is_overflow_block, ) -from chia.consensus.vdf_info_computation import get_signage_point_vdf_info -from chia.types.blockchain_format.classgroup import ClassgroupElement -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.blockchain_format.slots import ChallengeChainSubSlot, RewardChainSubSlot, SubSlotProofs -from chia.types.blockchain_format.vdf import VDFInfo, VDFProof -from chia.types.end_of_slot_bundle import EndOfSubSlotBundle -from chia.types.header_block import HeaderBlock -from chia.types.unfinished_header_block import UnfinishedHeaderBlock -from chia.util.errors import Err, ValidationError -from chia.util.hash import std_hash -from chia.util.ints import uint8, uint32, uint64, uint128 +from flax.consensus.vdf_info_computation import get_signage_point_vdf_info +from flax.types.blockchain_format.classgroup import ClassgroupElement +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.blockchain_format.slots import ChallengeChainSubSlot, RewardChainSubSlot, SubSlotProofs +from flax.types.blockchain_format.vdf import VDFInfo, VDFProof +from flax.types.end_of_slot_bundle import EndOfSubSlotBundle +from flax.types.header_block import HeaderBlock +from flax.types.unfinished_header_block import UnfinishedHeaderBlock +from flax.util.errors import Err, ValidationError +from flax.util.hash import std_hash +from flax.util.ints import uint8, uint32, uint64, uint128 log = logging.getLogger(__name__) diff --git a/chia/consensus/block_record.py b/flax/consensus/block_record.py similarity index 88% rename from chia/consensus/block_record.py rename to flax/consensus/block_record.py index 520a9497b..78b82eff6 100644 --- a/chia/consensus/block_record.py +++ b/flax/consensus/block_record.py @@ -1,14 +1,14 @@ from dataclasses import dataclass from typing import List, Optional -from chia.consensus.constants import ConsensusConstants -from chia.consensus.pot_iterations import calculate_ip_iters, calculate_sp_iters -from chia.types.blockchain_format.classgroup import ClassgroupElement -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.blockchain_format.sub_epoch_summary import SubEpochSummary -from chia.util.ints import uint8, uint32, uint64, uint128 -from chia.util.streamable import Streamable, streamable +from flax.consensus.constants import ConsensusConstants +from flax.consensus.pot_iterations import calculate_ip_iters, calculate_sp_iters +from flax.types.blockchain_format.classgroup import ClassgroupElement +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.blockchain_format.sub_epoch_summary import SubEpochSummary +from flax.util.ints import uint8, uint32, uint64, uint128 +from flax.util.streamable import Streamable, streamable @dataclass(frozen=True) diff --git a/chia/consensus/block_rewards.py b/flax/consensus/block_rewards.py similarity index 61% rename from chia/consensus/block_rewards.py rename to flax/consensus/block_rewards.py index b2c21bb92..57ee717b7 100644 --- a/chia/consensus/block_rewards.py +++ b/flax/consensus/block_rewards.py @@ -1,7 +1,7 @@ -from chia.util.ints import uint32, uint64 +from flax.util.ints import uint32, uint64 -# 1 Chia coin = 1,000,000,000,000 = 1 trillion mojo. -_mojo_per_chia = 1000000000000 +# 1 Flax coin = 1,000,000,000,000 = 1 trillion mojo. +_mojo_per_flax = 1000000000000 _blocks_per_year = 1681920 # 32 * 6 * 24 * 365 @@ -15,17 +15,17 @@ def calculate_pool_reward(height: uint32) -> uint64: """ if height == 0: - return uint64(int((7 / 8) * 21000000 * _mojo_per_chia)) + return uint64(int((7 / 8) * 300000 * _mojo_per_flax)) elif height < 3 * _blocks_per_year: - return uint64(int((7 / 8) * 2 * _mojo_per_chia)) + return uint64(int((7 / 8) * 2 * _mojo_per_flax)) elif height < 6 * _blocks_per_year: - return uint64(int((7 / 8) * 1 * _mojo_per_chia)) + return uint64(int((7 / 8) * 1 * _mojo_per_flax)) elif height < 9 * _blocks_per_year: - return uint64(int((7 / 8) * 0.5 * _mojo_per_chia)) + return uint64(int((7 / 8) * 0.5 * _mojo_per_flax)) elif height < 12 * _blocks_per_year: - return uint64(int((7 / 8) * 0.25 * _mojo_per_chia)) + return uint64(int((7 / 8) * 0.25 * _mojo_per_flax)) else: - return uint64(int((7 / 8) * 0.125 * _mojo_per_chia)) + return uint64(int((7 / 8) * 0.125 * _mojo_per_flax)) def calculate_base_farmer_reward(height: uint32) -> uint64: @@ -38,14 +38,14 @@ def calculate_base_farmer_reward(height: uint32) -> uint64: rates increase continuously. """ if height == 0: - return uint64(int((1 / 8) * 21000000 * _mojo_per_chia)) + return uint64(int((1 / 8) * 300000 * _mojo_per_flax)) elif height < 3 * _blocks_per_year: - return uint64(int((1 / 8) * 2 * _mojo_per_chia)) + return uint64(int((1 / 8) * 2 * _mojo_per_flax)) elif height < 6 * _blocks_per_year: - return uint64(int((1 / 8) * 1 * _mojo_per_chia)) + return uint64(int((1 / 8) * 1 * _mojo_per_flax)) elif height < 9 * _blocks_per_year: - return uint64(int((1 / 8) * 0.5 * _mojo_per_chia)) + return uint64(int((1 / 8) * 0.5 * _mojo_per_flax)) elif height < 12 * _blocks_per_year: - return uint64(int((1 / 8) * 0.25 * _mojo_per_chia)) + return uint64(int((1 / 8) * 0.25 * _mojo_per_flax)) else: - return uint64(int((1 / 8) * 0.125 * _mojo_per_chia)) + return uint64(int((1 / 8) * 0.125 * _mojo_per_flax)) diff --git a/chia/consensus/block_root_validation.py b/flax/consensus/block_root_validation.py similarity index 87% rename from chia/consensus/block_root_validation.py rename to flax/consensus/block_root_validation.py index 9d0951435..0aae92f92 100644 --- a/chia/consensus/block_root_validation.py +++ b/flax/consensus/block_root_validation.py @@ -1,9 +1,9 @@ from typing import Dict, List, Optional -from chia.types.blockchain_format.coin import Coin, hash_coin_list -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.errors import Err -from chia.util.merkle_set import MerkleSet +from flax.types.blockchain_format.coin import Coin, hash_coin_list +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.errors import Err +from flax.util.merkle_set import MerkleSet def validate_block_merkle_roots( diff --git a/chia/consensus/blockchain.py b/flax/consensus/blockchain.py similarity index 95% rename from chia/consensus/blockchain.py rename to flax/consensus/blockchain.py index 24c4041b7..e0adf1a75 100644 --- a/chia/consensus/blockchain.py +++ b/flax/consensus/blockchain.py @@ -6,35 +6,35 @@ from enum import Enum from typing import Dict, List, Optional, Set, Tuple, Union -from chia.consensus.block_body_validation import validate_block_body -from chia.consensus.block_header_validation import validate_finished_header_block, validate_unfinished_header_block -from chia.consensus.block_record import BlockRecord -from chia.consensus.blockchain_interface import BlockchainInterface -from chia.consensus.constants import ConsensusConstants -from chia.consensus.cost_calculator import NPCResult -from chia.consensus.difficulty_adjustment import get_next_sub_slot_iters_and_difficulty -from chia.consensus.find_fork_point import find_fork_point_in_chain -from chia.consensus.full_block_to_block_record import block_to_block_record -from chia.consensus.multiprocess_validation import PreValidationResult, pre_validate_blocks_multiprocessing -from chia.full_node.block_store import BlockStore -from chia.full_node.coin_store import CoinStore -from chia.full_node.mempool_check_conditions import get_name_puzzle_conditions -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.blockchain_format.sub_epoch_summary import SubEpochSummary -from chia.types.blockchain_format.vdf import VDFInfo -from chia.types.coin_record import CoinRecord -from chia.types.end_of_slot_bundle import EndOfSubSlotBundle -from chia.types.full_block import FullBlock -from chia.types.generator_types import BlockGenerator, GeneratorArg -from chia.types.header_block import HeaderBlock -from chia.types.unfinished_block import UnfinishedBlock -from chia.types.unfinished_header_block import UnfinishedHeaderBlock -from chia.types.weight_proof import SubEpochChallengeSegment -from chia.util.errors import Err -from chia.util.generator_tools import get_block_header, tx_removals_and_additions -from chia.util.ints import uint16, uint32, uint64, uint128 -from chia.util.streamable import recurse_jsonify +from flax.consensus.block_body_validation import validate_block_body +from flax.consensus.block_header_validation import validate_finished_header_block, validate_unfinished_header_block +from flax.consensus.block_record import BlockRecord +from flax.consensus.blockchain_interface import BlockchainInterface +from flax.consensus.constants import ConsensusConstants +from flax.consensus.cost_calculator import NPCResult +from flax.consensus.difficulty_adjustment import get_next_sub_slot_iters_and_difficulty +from flax.consensus.find_fork_point import find_fork_point_in_chain +from flax.consensus.full_block_to_block_record import block_to_block_record +from flax.consensus.multiprocess_validation import PreValidationResult, pre_validate_blocks_multiprocessing +from flax.full_node.block_store import BlockStore +from flax.full_node.coin_store import CoinStore +from flax.full_node.mempool_check_conditions import get_name_puzzle_conditions +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.blockchain_format.sub_epoch_summary import SubEpochSummary +from flax.types.blockchain_format.vdf import VDFInfo +from flax.types.coin_record import CoinRecord +from flax.types.end_of_slot_bundle import EndOfSubSlotBundle +from flax.types.full_block import FullBlock +from flax.types.generator_types import BlockGenerator, GeneratorArg +from flax.types.header_block import HeaderBlock +from flax.types.unfinished_block import UnfinishedBlock +from flax.types.unfinished_header_block import UnfinishedHeaderBlock +from flax.types.weight_proof import SubEpochChallengeSegment +from flax.util.errors import Err +from flax.util.generator_tools import get_block_header, tx_removals_and_additions +from flax.util.ints import uint16, uint32, uint64, uint128 +from flax.util.streamable import recurse_jsonify log = logging.getLogger(__name__) diff --git a/chia/consensus/blockchain_interface.py b/flax/consensus/blockchain_interface.py similarity index 85% rename from chia/consensus/blockchain_interface.py rename to flax/consensus/blockchain_interface.py index ab15e1656..a06cdebb9 100644 --- a/chia/consensus/blockchain_interface.py +++ b/flax/consensus/blockchain_interface.py @@ -1,12 +1,12 @@ from typing import Dict, List, Optional -from chia.consensus.block_record import BlockRecord -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.blockchain_format.sub_epoch_summary import SubEpochSummary -from chia.types.blockchain_format.vdf import VDFInfo -from chia.types.header_block import HeaderBlock -from chia.types.weight_proof import SubEpochChallengeSegment -from chia.util.ints import uint32 +from flax.consensus.block_record import BlockRecord +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.blockchain_format.sub_epoch_summary import SubEpochSummary +from flax.types.blockchain_format.vdf import VDFInfo +from flax.types.header_block import HeaderBlock +from flax.types.weight_proof import SubEpochChallengeSegment +from flax.util.ints import uint32 class BlockchainInterface: diff --git a/chia/consensus/coinbase.py b/flax/consensus/coinbase.py similarity index 81% rename from chia/consensus/coinbase.py rename to flax/consensus/coinbase.py index 7f58b3297..e97e2c705 100644 --- a/chia/consensus/coinbase.py +++ b/flax/consensus/coinbase.py @@ -1,9 +1,9 @@ from blspy import G1Element -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.ints import uint32, uint64 -from chia.wallet.puzzles.p2_delegated_puzzle_or_hidden_puzzle import puzzle_for_pk +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.ints import uint32, uint64 +from flax.wallet.puzzles.p2_delegated_puzzle_or_hidden_puzzle import puzzle_for_pk def create_puzzlehash_for_pk(pub_key: G1Element) -> bytes32: diff --git a/chia/consensus/condition_costs.py b/flax/consensus/condition_costs.py similarity index 100% rename from chia/consensus/condition_costs.py rename to flax/consensus/condition_costs.py diff --git a/chia/consensus/constants.py b/flax/consensus/constants.py similarity index 92% rename from chia/consensus/constants.py rename to flax/consensus/constants.py index 30684a34b..0e6d58c3f 100644 --- a/chia/consensus/constants.py +++ b/flax/consensus/constants.py @@ -1,8 +1,8 @@ import dataclasses -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.byte_types import hexstr_to_bytes -from chia.util.ints import uint8, uint32, uint64, uint128 +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.byte_types import hexstr_to_bytes +from flax.util.ints import uint8, uint32, uint64, uint128 @dataclasses.dataclass(frozen=True) @@ -34,14 +34,14 @@ class ConsensusConstants: # Used as the initial cc rc challenges, as well as first block back pointers, and first SES back pointer # We override this value based on the chain being run (testnet0, testnet1, mainnet, etc) GENESIS_CHALLENGE: bytes32 - # Forks of chia should change this value to provide replay attack protection + # Forks of flax should change this value to provide replay attack protection AGG_SIG_ME_ADDITIONAL_DATA: bytes GENESIS_PRE_FARM_POOL_PUZZLE_HASH: bytes32 # The block at height must pay out to this pool puzzle hash GENESIS_PRE_FARM_FARMER_PUZZLE_HASH: bytes32 # The block at height must pay out to this farmer puzzle hash MAX_VDF_WITNESS_SIZE: int # The maximum number of classgroup elements within an n-wesolowski proof # Size of mempool = 10x the size of block MEMPOOL_BLOCK_BUFFER: int - # Max coin amount uint(1 << 64). This allows coin amounts to fit in 64 bits. This is around 18M chia. + # Max coin amount uint(1 << 64). This allows coin amounts to fit in 64 bits. This is around 18M flax. MAX_COIN_AMOUNT: int # Max block cost in clvm cost units MAX_BLOCK_COST_CLVM: int diff --git a/chia/consensus/cost_calculator.py b/flax/consensus/cost_calculator.py similarity index 89% rename from chia/consensus/cost_calculator.py rename to flax/consensus/cost_calculator.py index eb8b94ed8..1a7c46548 100644 --- a/chia/consensus/cost_calculator.py +++ b/flax/consensus/cost_calculator.py @@ -1,12 +1,12 @@ from dataclasses import dataclass from typing import List, Optional -from chia.consensus.condition_costs import ConditionCost -from chia.types.blockchain_format.program import SerializedProgram -from chia.types.condition_opcodes import ConditionOpcode -from chia.types.name_puzzle_condition import NPC -from chia.util.ints import uint64, uint16 -from chia.util.streamable import Streamable, streamable +from flax.consensus.condition_costs import ConditionCost +from flax.types.blockchain_format.program import SerializedProgram +from flax.types.condition_opcodes import ConditionOpcode +from flax.types.name_puzzle_condition import NPC +from flax.util.ints import uint64, uint16 +from flax.util.streamable import Streamable, streamable @dataclass(frozen=True) diff --git a/chia/consensus/default_constants.py b/flax/consensus/default_constants.py similarity index 86% rename from chia/consensus/default_constants.py rename to flax/consensus/default_constants.py index f038c21da..2fe87e359 100644 --- a/chia/consensus/default_constants.py +++ b/flax/consensus/default_constants.py @@ -1,4 +1,4 @@ -from chia.util.ints import uint64 +from flax.util.ints import uint64 from .constants import ConsensusConstants @@ -10,7 +10,7 @@ "SUB_SLOT_ITERS_STARTING": 2 ** 27, # DIFFICULTY_STARTING is the starting difficulty for the first epoch, which is then further # multiplied by another factor of DIFFICULTY_CONSTANT_FACTOR, to be used in the VDF iter calculation formula. - "DIFFICULTY_CONSTANT_FACTOR": 2 ** 67, + "DIFFICULTY_CONSTANT_FACTOR": 2 ** 57, "DIFFICULTY_STARTING": 7, "DIFFICULTY_CHANGE_MAX_FACTOR": 3, # The next difficulty is truncated to range [prev / FACTOR, prev * FACTOR] # These 3 constants must be changed at the same time @@ -29,13 +29,13 @@ # We override this value based on the chain being run (testnet0, testnet1, mainnet, etc) # Default used for tests is std_hash(b'') "GENESIS_CHALLENGE": bytes.fromhex("e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"), - # Forks of chia should change this value to provide replay attack protection. This is set to mainnet genesis chall - "AGG_SIG_ME_ADDITIONAL_DATA": bytes.fromhex("ccd5bb71183532bff220ba46c268991a3ff07eb358e8255a65c30a2dce0e5fbb"), + # Forks of flax should change this value to provide replay attack protection. This is set to mainnet genesis chall + "AGG_SIG_ME_ADDITIONAL_DATA": bytes.fromhex("9b9ffca948750d8b41ac755da213461e9d2253ec7bfce80695d78f7fe7d55112"), "GENESIS_PRE_FARM_POOL_PUZZLE_HASH": bytes.fromhex( - "d23da14695a188ae5708dd152263c4db883eb27edeb936178d4d988b8f3ce5fc" + "e8e245e2e6536e17fd7cbc2e3bd90de06f55362ee3c84cea5a68391e5bad7ef6" ), "GENESIS_PRE_FARM_FARMER_PUZZLE_HASH": bytes.fromhex( - "3d8765d3a597ec1d99663f6c9816d915b9f68613ac94009884c4addaefcce6af" + "e8e245e2e6536e17fd7cbc2e3bd90de06f55362ee3c84cea5a68391e5bad7ef6" ), "MAX_VDF_WITNESS_SIZE": 64, # Size of mempool = 50x the size of block @@ -50,7 +50,7 @@ "BLOCKS_CACHE_SIZE": 4608 + (128 * 4), "WEIGHT_PROOF_RECENT_BLOCKS": 1000, "MAX_BLOCK_COUNT_PER_REQUESTS": 32, # Allow up to 32 blocks per request - "INITIAL_FREEZE_END_TIMESTAMP": 1620061200, # Mon May 03 2021 17:00:00 GMT+0000 + "INITIAL_FREEZE_END_TIMESTAMP": 0, "NETWORK_TYPE": 0, "MAX_GENERATOR_SIZE": 1000000, "MAX_GENERATOR_REF_LIST_SIZE": 512, # Number of references allowed in the block generator ref list diff --git a/chia/consensus/deficit.py b/flax/consensus/deficit.py similarity index 93% rename from chia/consensus/deficit.py rename to flax/consensus/deficit.py index bd4dc4fd6..3cf0be937 100644 --- a/chia/consensus/deficit.py +++ b/flax/consensus/deficit.py @@ -1,8 +1,8 @@ from typing import Optional -from chia.consensus.block_record import BlockRecord -from chia.consensus.constants import ConsensusConstants -from chia.util.ints import uint8, uint32 +from flax.consensus.block_record import BlockRecord +from flax.consensus.constants import ConsensusConstants +from flax.util.ints import uint8, uint32 def calculate_deficit( diff --git a/chia/consensus/difficulty_adjustment.py b/flax/consensus/difficulty_adjustment.py similarity index 98% rename from chia/consensus/difficulty_adjustment.py rename to flax/consensus/difficulty_adjustment.py index a0db3f643..eb9c374db 100644 --- a/chia/consensus/difficulty_adjustment.py +++ b/flax/consensus/difficulty_adjustment.py @@ -1,11 +1,11 @@ from typing import List, Optional, Tuple -from chia.consensus.block_record import BlockRecord -from chia.consensus.blockchain_interface import BlockchainInterface -from chia.consensus.constants import ConsensusConstants -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.ints import uint8, uint32, uint64, uint128 -from chia.util.significant_bits import count_significant_bits, truncate_to_significant_bits +from flax.consensus.block_record import BlockRecord +from flax.consensus.blockchain_interface import BlockchainInterface +from flax.consensus.constants import ConsensusConstants +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.ints import uint8, uint32, uint64, uint128 +from flax.util.significant_bits import count_significant_bits, truncate_to_significant_bits def _get_blocks_at_height( diff --git a/chia/consensus/find_fork_point.py b/flax/consensus/find_fork_point.py similarity index 86% rename from chia/consensus/find_fork_point.py rename to flax/consensus/find_fork_point.py index 4f2d08f50..dc182872d 100644 --- a/chia/consensus/find_fork_point.py +++ b/flax/consensus/find_fork_point.py @@ -1,8 +1,8 @@ from typing import Union -from chia.consensus.block_record import BlockRecord -from chia.consensus.blockchain_interface import BlockchainInterface -from chia.types.header_block import HeaderBlock +from flax.consensus.block_record import BlockRecord +from flax.consensus.blockchain_interface import BlockchainInterface +from flax.types.header_block import HeaderBlock def find_fork_point_in_chain( diff --git a/chia/consensus/full_block_to_block_record.py b/flax/consensus/full_block_to_block_record.py similarity index 87% rename from chia/consensus/full_block_to_block_record.py rename to flax/consensus/full_block_to_block_record.py index 8013bde8f..cd9c3761c 100644 --- a/chia/consensus/full_block_to_block_record.py +++ b/flax/consensus/full_block_to_block_record.py @@ -1,19 +1,19 @@ from typing import List, Optional, Union -from chia.consensus.block_record import BlockRecord -from chia.consensus.blockchain_interface import BlockchainInterface -from chia.consensus.constants import ConsensusConstants -from chia.consensus.deficit import calculate_deficit -from chia.consensus.difficulty_adjustment import get_next_sub_slot_iters_and_difficulty -from chia.consensus.make_sub_epoch_summary import make_sub_epoch_summary -from chia.consensus.pot_iterations import is_overflow_block -from chia.types.blockchain_format.classgroup import ClassgroupElement -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.blockchain_format.slots import ChallengeBlockInfo -from chia.types.blockchain_format.sub_epoch_summary import SubEpochSummary -from chia.types.full_block import FullBlock -from chia.types.header_block import HeaderBlock -from chia.util.ints import uint8, uint32, uint64 +from flax.consensus.block_record import BlockRecord +from flax.consensus.blockchain_interface import BlockchainInterface +from flax.consensus.constants import ConsensusConstants +from flax.consensus.deficit import calculate_deficit +from flax.consensus.difficulty_adjustment import get_next_sub_slot_iters_and_difficulty +from flax.consensus.make_sub_epoch_summary import make_sub_epoch_summary +from flax.consensus.pot_iterations import is_overflow_block +from flax.types.blockchain_format.classgroup import ClassgroupElement +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.blockchain_format.slots import ChallengeBlockInfo +from flax.types.blockchain_format.sub_epoch_summary import SubEpochSummary +from flax.types.full_block import FullBlock +from flax.types.header_block import HeaderBlock +from flax.util.ints import uint8, uint32, uint64 def block_to_block_record( diff --git a/chia/consensus/get_block_challenge.py b/flax/consensus/get_block_challenge.py similarity index 89% rename from chia/consensus/get_block_challenge.py rename to flax/consensus/get_block_challenge.py index 40f169a88..511a723b5 100644 --- a/chia/consensus/get_block_challenge.py +++ b/flax/consensus/get_block_challenge.py @@ -1,15 +1,15 @@ import logging from typing import List, Union -from chia.consensus.block_record import BlockRecord -from chia.consensus.blockchain_interface import BlockchainInterface -from chia.consensus.constants import ConsensusConstants -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.full_block import FullBlock -from chia.types.header_block import HeaderBlock -from chia.types.unfinished_block import UnfinishedBlock -from chia.types.unfinished_header_block import UnfinishedHeaderBlock -from chia.util.ints import uint64 +from flax.consensus.block_record import BlockRecord +from flax.consensus.blockchain_interface import BlockchainInterface +from flax.consensus.constants import ConsensusConstants +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.full_block import FullBlock +from flax.types.header_block import HeaderBlock +from flax.types.unfinished_block import UnfinishedBlock +from flax.types.unfinished_header_block import UnfinishedHeaderBlock +from flax.util.ints import uint64 log = logging.getLogger(__name__) diff --git a/chia/consensus/make_sub_epoch_summary.py b/flax/consensus/make_sub_epoch_summary.py similarity index 92% rename from chia/consensus/make_sub_epoch_summary.py rename to flax/consensus/make_sub_epoch_summary.py index 393767cd3..fa88660f4 100644 --- a/chia/consensus/make_sub_epoch_summary.py +++ b/flax/consensus/make_sub_epoch_summary.py @@ -1,22 +1,22 @@ import logging from typing import Optional, Union -from chia.consensus.block_record import BlockRecord -from chia.consensus.blockchain_interface import BlockchainInterface -from chia.consensus.constants import ConsensusConstants -from chia.consensus.deficit import calculate_deficit -from chia.consensus.difficulty_adjustment import ( +from flax.consensus.block_record import BlockRecord +from flax.consensus.blockchain_interface import BlockchainInterface +from flax.consensus.constants import ConsensusConstants +from flax.consensus.deficit import calculate_deficit +from flax.consensus.difficulty_adjustment import ( _get_next_difficulty, _get_next_sub_slot_iters, can_finish_sub_and_full_epoch, get_next_sub_slot_iters_and_difficulty, height_can_be_first_in_epoch, ) -from chia.consensus.pot_iterations import calculate_ip_iters, calculate_sp_iters, is_overflow_block -from chia.types.blockchain_format.sub_epoch_summary import SubEpochSummary -from chia.types.full_block import FullBlock -from chia.types.unfinished_block import UnfinishedBlock -from chia.util.ints import uint8, uint32, uint64, uint128 +from flax.consensus.pot_iterations import calculate_ip_iters, calculate_sp_iters, is_overflow_block +from flax.types.blockchain_format.sub_epoch_summary import SubEpochSummary +from flax.types.full_block import FullBlock +from flax.types.unfinished_block import UnfinishedBlock +from flax.util.ints import uint8, uint32, uint64, uint128 log = logging.getLogger(__name__) diff --git a/chia/consensus/multiprocess_validation.py b/flax/consensus/multiprocess_validation.py similarity index 92% rename from chia/consensus/multiprocess_validation.py rename to flax/consensus/multiprocess_validation.py index b4c97a273..a64ff9c72 100644 --- a/chia/consensus/multiprocess_validation.py +++ b/flax/consensus/multiprocess_validation.py @@ -5,26 +5,26 @@ from dataclasses import dataclass from typing import Dict, List, Optional, Sequence, Tuple, Union, Callable -from chia.consensus.block_header_validation import validate_finished_header_block -from chia.consensus.block_record import BlockRecord -from chia.consensus.blockchain_interface import BlockchainInterface -from chia.consensus.constants import ConsensusConstants -from chia.consensus.cost_calculator import NPCResult -from chia.consensus.difficulty_adjustment import get_next_sub_slot_iters_and_difficulty -from chia.consensus.full_block_to_block_record import block_to_block_record -from chia.consensus.get_block_challenge import get_block_challenge -from chia.consensus.pot_iterations import calculate_iterations_quality, is_overflow_block -from chia.full_node.mempool_check_conditions import get_name_puzzle_conditions -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.full_block import FullBlock -from chia.types.generator_types import BlockGenerator -from chia.types.header_block import HeaderBlock -from chia.util.block_cache import BlockCache -from chia.util.errors import Err -from chia.util.generator_tools import get_block_header, tx_removals_and_additions -from chia.util.ints import uint16, uint64, uint32 -from chia.util.streamable import Streamable, dataclass_from_dict, streamable +from flax.consensus.block_header_validation import validate_finished_header_block +from flax.consensus.block_record import BlockRecord +from flax.consensus.blockchain_interface import BlockchainInterface +from flax.consensus.constants import ConsensusConstants +from flax.consensus.cost_calculator import NPCResult +from flax.consensus.difficulty_adjustment import get_next_sub_slot_iters_and_difficulty +from flax.consensus.full_block_to_block_record import block_to_block_record +from flax.consensus.get_block_challenge import get_block_challenge +from flax.consensus.pot_iterations import calculate_iterations_quality, is_overflow_block +from flax.full_node.mempool_check_conditions import get_name_puzzle_conditions +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.full_block import FullBlock +from flax.types.generator_types import BlockGenerator +from flax.types.header_block import HeaderBlock +from flax.util.block_cache import BlockCache +from flax.util.errors import Err +from flax.util.generator_tools import get_block_header, tx_removals_and_additions +from flax.util.ints import uint16, uint64, uint32 +from flax.util.streamable import Streamable, dataclass_from_dict, streamable log = logging.getLogger(__name__) diff --git a/chia/consensus/network_type.py b/flax/consensus/network_type.py similarity index 100% rename from chia/consensus/network_type.py rename to flax/consensus/network_type.py diff --git a/chia/consensus/pos_quality.py b/flax/consensus/pos_quality.py similarity index 95% rename from chia/consensus/pos_quality.py rename to flax/consensus/pos_quality.py index 8deba0966..239ea6538 100644 --- a/chia/consensus/pos_quality.py +++ b/flax/consensus/pos_quality.py @@ -1,4 +1,4 @@ -from chia.util.ints import uint64 +from flax.util.ints import uint64 # The actual space in bytes of a plot, is _expected_plot_size(k) * UI_ACTUAL_SPACE_CONSTANT_FACTO # This is not used in consensus, only for display purposes diff --git a/chia/consensus/pot_iterations.py b/flax/consensus/pot_iterations.py similarity index 90% rename from chia/consensus/pot_iterations.py rename to flax/consensus/pot_iterations.py index 31576dbdb..0b403afac 100644 --- a/chia/consensus/pot_iterations.py +++ b/flax/consensus/pot_iterations.py @@ -1,8 +1,8 @@ -from chia.consensus.constants import ConsensusConstants -from chia.consensus.pos_quality import _expected_plot_size -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.hash import std_hash -from chia.util.ints import uint8, uint64, uint128 +from flax.consensus.constants import ConsensusConstants +from flax.consensus.pos_quality import _expected_plot_size +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.hash import std_hash +from flax.util.ints import uint8, uint64, uint128 def is_overflow_block(constants: ConsensusConstants, signage_point_index: uint8) -> bool: diff --git a/chia/consensus/vdf_info_computation.py b/flax/consensus/vdf_info_computation.py similarity index 94% rename from chia/consensus/vdf_info_computation.py rename to flax/consensus/vdf_info_computation.py index 222fe8f7d..9028ac278 100644 --- a/chia/consensus/vdf_info_computation.py +++ b/flax/consensus/vdf_info_computation.py @@ -1,12 +1,12 @@ from typing import List, Optional -from chia.consensus.block_record import BlockRecord -from chia.consensus.blockchain_interface import BlockchainInterface -from chia.consensus.constants import ConsensusConstants -from chia.types.blockchain_format.classgroup import ClassgroupElement -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.end_of_slot_bundle import EndOfSubSlotBundle -from chia.util.ints import uint64, uint128 +from flax.consensus.block_record import BlockRecord +from flax.consensus.blockchain_interface import BlockchainInterface +from flax.consensus.constants import ConsensusConstants +from flax.types.blockchain_format.classgroup import ClassgroupElement +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.end_of_slot_bundle import EndOfSubSlotBundle +from flax.util.ints import uint64, uint128 def get_signage_point_vdf_info( diff --git a/chia/daemon/__init__.py b/flax/daemon/__init__.py similarity index 100% rename from chia/daemon/__init__.py rename to flax/daemon/__init__.py diff --git a/chia/daemon/client.py b/flax/daemon/client.py similarity index 94% rename from chia/daemon/client.py rename to flax/daemon/client.py index ce11e9cbc..88b95b658 100644 --- a/chia/daemon/client.py +++ b/flax/daemon/client.py @@ -6,11 +6,11 @@ import websockets -from chia.server.server import ssl_context_for_client -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.config import load_config -from chia.util.json_util import dict_to_json_str -from chia.util.ws_message import WsRpcMessage, create_payload_dict +from flax.server.server import ssl_context_for_client +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.config import load_config +from flax.util.json_util import dict_to_json_str +from flax.util.ws_message import WsRpcMessage, create_payload_dict class DaemonProxy: diff --git a/chia/daemon/server.py b/flax/daemon/server.py similarity index 95% rename from chia/daemon/server.py rename to flax/daemon/server.py index 099f987d1..0a3a4d854 100644 --- a/chia/daemon/server.py +++ b/flax/daemon/server.py @@ -16,24 +16,24 @@ from websockets import ConnectionClosedOK, WebSocketException, WebSocketServerProtocol, serve -from chia.cmds.init_funcs import chia_init -from chia.daemon.windows_signal import kill -from chia.server.server import ssl_context_for_root, ssl_context_for_server -from chia.ssl.create_ssl import get_mozzila_ca_crt -from chia.util.chia_logging import initialize_logging -from chia.util.config import load_config -from chia.util.json_util import dict_to_json_str -from chia.util.path import mkdir -from chia.util.service_groups import validate_service -from chia.util.setproctitle import setproctitle -from chia.util.ws_message import WsRpcMessage, create_payload, format_response +from flax.cmds.init_funcs import flax_init +from flax.daemon.windows_signal import kill +from flax.server.server import ssl_context_for_root, ssl_context_for_server +from flax.ssl.create_ssl import get_mozzila_ca_crt +from flax.util.flax_logging import initialize_logging +from flax.util.config import load_config +from flax.util.json_util import dict_to_json_str +from flax.util.path import mkdir +from flax.util.service_groups import validate_service +from flax.util.setproctitle import setproctitle +from flax.util.ws_message import WsRpcMessage, create_payload, format_response io_pool_exc = ThreadPoolExecutor() try: from aiohttp import ClientSession, web except ModuleNotFoundError: - print("Error: Make sure to run . ./activate from the project folder before starting Chia.") + print("Error: Make sure to run . ./activate from the project folder before starting Flax.") quit() try: @@ -45,7 +45,7 @@ log = logging.getLogger(__name__) -service_plotter = "chia plots create" +service_plotter = "flax plots create" async def fetch(url: str): @@ -78,15 +78,15 @@ class PlotEvent(str, Enum): # determine if application is a script file or frozen exe if getattr(sys, "frozen", False): name_map = { - "chia": "chia", - "chia_wallet": "start_wallet", - "chia_full_node": "start_full_node", - "chia_harvester": "start_harvester", - "chia_farmer": "start_farmer", - "chia_introducer": "start_introducer", - "chia_timelord": "start_timelord", - "chia_timelord_launcher": "timelord_launcher", - "chia_full_node_simulator": "start_simulator", + "flax": "flax", + "flax_wallet": "start_wallet", + "flax_full_node": "start_full_node", + "flax_harvester": "start_harvester", + "flax_farmer": "start_farmer", + "flax_introducer": "start_introducer", + "flax_timelord": "start_timelord", + "flax_timelord_launcher": "timelord_launcher", + "flax_full_node_simulator": "start_simulator", } def executable_for_service(service_name: str) -> str: @@ -672,7 +672,7 @@ async def exit(self) -> Dict[str, Any]: # TODO: fix this hack asyncio.get_event_loop().call_later(5, lambda *args: sys.exit(0)) - log.info("chia daemon exiting in 5 seconds") + log.info("flax daemon exiting in 5 seconds") response = {"success": True} return response @@ -729,8 +729,8 @@ def plotter_log_path(root_path: Path, id: str): def launch_plotter(root_path: Path, service_name: str, service_array: List[str], id: str): - # we need to pass on the possibly altered CHIA_ROOT - os.environ["CHIA_ROOT"] = str(root_path) + # we need to pass on the possibly altered FLAX_ROOT + os.environ["FLAX_ROOT"] = str(root_path) service_executable = executable_for_service(service_array[0]) # Swap service name with name of executable @@ -765,14 +765,14 @@ def launch_service(root_path: Path, service_command) -> Tuple[subprocess.Popen, """ Launch a child process. """ - # set up CHIA_ROOT + # set up FLAX_ROOT # invoke correct script # save away PID - # we need to pass on the possibly altered CHIA_ROOT - os.environ["CHIA_ROOT"] = str(root_path) + # we need to pass on the possibly altered FLAX_ROOT + os.environ["FLAX_ROOT"] = str(root_path) - log.debug(f"Launching service with CHIA_ROOT: {os.environ['CHIA_ROOT']}") + log.debug(f"Launching service with FLAX_ROOT: {os.environ['FLAX_ROOT']}") lockfile = singleton(service_launch_lock_path(root_path, service_command)) if lockfile is None: @@ -946,9 +946,9 @@ def singleton(lockfile: Path, text: str = "semaphore") -> Optional[TextIO]: async def async_run_daemon(root_path: Path) -> int: - chia_init(root_path) + flax_init(root_path) config = load_config(root_path, "config.yaml") - setproctitle("chia_daemon") + setproctitle("flax_daemon") initialize_logging("daemon", config["logging"], root_path) lockfile = singleton(daemon_launch_lock_path(root_path)) crt_path = root_path / config["daemon_ssl"]["private_crt"] @@ -986,7 +986,7 @@ def run_daemon(root_path: Path) -> int: def main() -> int: - from chia.util.default_root import DEFAULT_ROOT_PATH + from flax.util.default_root import DEFAULT_ROOT_PATH return run_daemon(DEFAULT_ROOT_PATH) diff --git a/chia/daemon/windows_signal.py b/flax/daemon/windows_signal.py similarity index 100% rename from chia/daemon/windows_signal.py rename to flax/daemon/windows_signal.py diff --git a/chia/farmer/__init__.py b/flax/farmer/__init__.py similarity index 100% rename from chia/farmer/__init__.py rename to flax/farmer/__init__.py diff --git a/chia/farmer/farmer.py b/flax/farmer/farmer.py similarity index 84% rename from chia/farmer/farmer.py rename to flax/farmer/farmer.py index cc8292609..26277bc76 100644 --- a/chia/farmer/farmer.py +++ b/flax/farmer/farmer.py @@ -6,20 +6,20 @@ from blspy import G1Element -import chia.server.ws_connection as ws # lgtm [py/import-and-import-from] -from chia.consensus.coinbase import create_puzzlehash_for_pk -from chia.consensus.constants import ConsensusConstants -from chia.protocols import farmer_protocol, harvester_protocol -from chia.protocols.protocol_message_types import ProtocolMessageTypes -from chia.server.outbound_message import NodeType, make_msg -from chia.server.ws_connection import WSChiaConnection -from chia.types.blockchain_format.proof_of_space import ProofOfSpace -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.bech32m import decode_puzzle_hash -from chia.util.config import load_config, save_config -from chia.util.ints import uint32, uint64 -from chia.util.keychain import Keychain -from chia.wallet.derive_keys import master_sk_to_farmer_sk, master_sk_to_pool_sk, master_sk_to_wallet_sk +import flax.server.ws_connection as ws # lgtm [py/import-and-import-from] +from flax.consensus.coinbase import create_puzzlehash_for_pk +from flax.consensus.constants import ConsensusConstants +from flax.protocols import farmer_protocol, harvester_protocol +from flax.protocols.protocol_message_types import ProtocolMessageTypes +from flax.server.outbound_message import NodeType, make_msg +from flax.server.ws_connection import WSFlaxConnection +from flax.types.blockchain_format.proof_of_space import ProofOfSpace +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.bech32m import decode_puzzle_hash +from flax.util.config import load_config, save_config +from flax.util.ints import uint32, uint64 +from flax.util.keychain import Keychain +from flax.wallet.derive_keys import master_sk_to_farmer_sk, master_sk_to_pool_sk, master_sk_to_wallet_sk log = logging.getLogger(__name__) @@ -69,17 +69,17 @@ def __init__( ] if len(self.get_public_keys()) == 0: - error_str = "No keys exist. Please run 'chia keys generate' or open the UI." + error_str = "No keys exist. Please run 'flax keys generate' or open the UI." raise RuntimeError(error_str) # This is the farmer configuration - self.farmer_target_encoded = self.config["xch_target_address"] + self.farmer_target_encoded = self.config["xfx_target_address"] self.farmer_target = decode_puzzle_hash(self.farmer_target_encoded) self.pool_public_keys = [G1Element.from_bytes(bytes.fromhex(pk)) for pk in self.config["pool_public_keys"]] # This is the pool configuration, which should be moved out to the pool once it exists - self.pool_target_encoded = pool_config["xch_target_address"] + self.pool_target_encoded = pool_config["xfx_target_address"] self.pool_target = decode_puzzle_hash(self.pool_target_encoded) self.pool_sks_map: Dict = {} for key in self.get_private_keys(): @@ -88,7 +88,7 @@ def __init__( assert len(self.farmer_target) == 32 assert len(self.pool_target) == 32 if len(self.pool_sks_map) == 0: - error_str = "No keys exist. Please run 'chia keys generate' or open the UI." + error_str = "No keys exist. Please run 'flax keys generate' or open the UI." raise RuntimeError(error_str) async def _start(self): @@ -103,7 +103,7 @@ async def _await_closed(self): def _set_state_changed_callback(self, callback: Callable): self.state_changed_callback = callback - async def on_connect(self, peer: WSChiaConnection): + async def on_connect(self, peer: WSFlaxConnection): # Sends a handshake to the harvester handshake = harvester_protocol.HarvesterHandshake( self.get_public_keys(), @@ -120,7 +120,7 @@ def state_changed(self, change: str, data: Dict[str, Any]): if self.state_changed_callback is not None: self.state_changed_callback(change, data) - def on_disconnect(self, connection: ws.WSChiaConnection): + def on_disconnect(self, connection: ws.WSFlaxConnection): self.log.info(f"peer disconnected {connection.get_peer_info()}") self.state_changed("close_connection", {}) @@ -160,11 +160,11 @@ def set_reward_targets(self, farmer_target_encoded: Optional[str], pool_target_e if farmer_target_encoded is not None: self.farmer_target_encoded = farmer_target_encoded self.farmer_target = decode_puzzle_hash(farmer_target_encoded) - config["farmer"]["xch_target_address"] = farmer_target_encoded + config["farmer"]["xfx_target_address"] = farmer_target_encoded if pool_target_encoded is not None: self.pool_target_encoded = pool_target_encoded self.pool_target = decode_puzzle_hash(pool_target_encoded) - config["pool"]["xch_target_address"] = pool_target_encoded + config["pool"]["xfx_target_address"] = pool_target_encoded save_config(self._root_path, "config.yaml", config) async def _periodically_clear_cache_task(self): diff --git a/chia/farmer/farmer_api.py b/flax/farmer/farmer_api.py similarity index 95% rename from chia/farmer/farmer_api.py rename to flax/farmer/farmer_api.py index d07752374..0dc91478e 100644 --- a/chia/farmer/farmer_api.py +++ b/flax/farmer/farmer_api.py @@ -3,16 +3,16 @@ from blspy import AugSchemeMPL, G2Element -import chia.server.ws_connection as ws -from chia.consensus.pot_iterations import calculate_iterations_quality, calculate_sp_interval_iters -from chia.farmer.farmer import Farmer -from chia.protocols import farmer_protocol, harvester_protocol -from chia.protocols.protocol_message_types import ProtocolMessageTypes -from chia.server.outbound_message import NodeType, make_msg -from chia.types.blockchain_format.pool_target import PoolTarget -from chia.types.blockchain_format.proof_of_space import ProofOfSpace -from chia.util.api_decorators import api_request, peer_required -from chia.util.ints import uint32, uint64 +import flax.server.ws_connection as ws +from flax.consensus.pot_iterations import calculate_iterations_quality, calculate_sp_interval_iters +from flax.farmer.farmer import Farmer +from flax.protocols import farmer_protocol, harvester_protocol +from flax.protocols.protocol_message_types import ProtocolMessageTypes +from flax.server.outbound_message import NodeType, make_msg +from flax.types.blockchain_format.pool_target import PoolTarget +from flax.types.blockchain_format.proof_of_space import ProofOfSpace +from flax.util.api_decorators import api_request, peer_required +from flax.util.ints import uint32, uint64 class FarmerAPI: @@ -27,7 +27,7 @@ def _set_state_changed_callback(self, callback: Callable): @api_request @peer_required async def new_proof_of_space( - self, new_proof_of_space: harvester_protocol.NewProofOfSpace, peer: ws.WSChiaConnection + self, new_proof_of_space: harvester_protocol.NewProofOfSpace, peer: ws.WSFlaxConnection ): """ This is a response from the harvester, for a NewChallenge. Here we check if the proof diff --git a/chia/full_node/__init__.py b/flax/full_node/__init__.py similarity index 100% rename from chia/full_node/__init__.py rename to flax/full_node/__init__.py diff --git a/chia/full_node/block_store.py b/flax/full_node/block_store.py similarity index 97% rename from chia/full_node/block_store.py rename to flax/full_node/block_store.py index 5fbde8e90..7ec870196 100644 --- a/chia/full_node/block_store.py +++ b/flax/full_node/block_store.py @@ -3,14 +3,14 @@ import aiosqlite -from chia.consensus.block_record import BlockRecord -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.blockchain_format.sub_epoch_summary import SubEpochSummary -from chia.types.full_block import FullBlock -from chia.types.weight_proof import SubEpochChallengeSegment, SubEpochSegments -from chia.util.db_wrapper import DBWrapper -from chia.util.ints import uint32 -from chia.util.lru_cache import LRUCache +from flax.consensus.block_record import BlockRecord +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.blockchain_format.sub_epoch_summary import SubEpochSummary +from flax.types.full_block import FullBlock +from flax.types.weight_proof import SubEpochChallengeSegment, SubEpochSegments +from flax.util.db_wrapper import DBWrapper +from flax.util.ints import uint32 +from flax.util.lru_cache import LRUCache log = logging.getLogger(__name__) diff --git a/chia/full_node/bundle_tools.py b/flax/full_node/bundle_tools.py similarity index 93% rename from chia/full_node/bundle_tools.py rename to flax/full_node/bundle_tools.py index b3786a9c2..0e320410d 100644 --- a/chia/full_node/bundle_tools.py +++ b/flax/full_node/bundle_tools.py @@ -4,13 +4,13 @@ from clvm import SExp from clvm_tools import binutils -from chia.full_node.generator import create_compressed_generator -from chia.types.blockchain_format.program import SerializedProgram, Program -from chia.types.coin_solution import CoinSolution -from chia.types.generator_types import BlockGenerator, CompressorArg -from chia.types.spend_bundle import SpendBundle -from chia.util.byte_types import hexstr_to_bytes -from chia.util.ints import uint32, uint64 +from flax.full_node.generator import create_compressed_generator +from flax.types.blockchain_format.program import SerializedProgram, Program +from flax.types.coin_solution import CoinSolution +from flax.types.generator_types import BlockGenerator, CompressorArg +from flax.types.spend_bundle import SpendBundle +from flax.util.byte_types import hexstr_to_bytes +from flax.util.ints import uint32, uint64 def spend_bundle_to_serialized_coin_solution_entry_list(bundle: SpendBundle) -> bytes: diff --git a/chia/full_node/coin_store.py b/flax/full_node/coin_store.py similarity index 96% rename from chia/full_node/coin_store.py rename to flax/full_node/coin_store.py index 15b71df86..11eb0f58f 100644 --- a/chia/full_node/coin_store.py +++ b/flax/full_node/coin_store.py @@ -2,13 +2,13 @@ import aiosqlite -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.coin_record import CoinRecord -from chia.types.full_block import FullBlock -from chia.util.db_wrapper import DBWrapper -from chia.util.ints import uint32, uint64 -from chia.util.lru_cache import LRUCache +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.coin_record import CoinRecord +from flax.types.full_block import FullBlock +from flax.util.db_wrapper import DBWrapper +from flax.util.ints import uint32, uint64 +from flax.util.lru_cache import LRUCache class CoinStore: diff --git a/chia/full_node/full_node.py b/flax/full_node/full_node.py similarity index 96% rename from chia/full_node/full_node.py rename to flax/full_node/full_node.py index 2f0ceb22c..f41881c55 100644 --- a/chia/full_node/full_node.py +++ b/flax/full_node/full_node.py @@ -10,53 +10,53 @@ import aiosqlite from blspy import AugSchemeMPL -import chia.server.ws_connection as ws # lgtm [py/import-and-import-from] -from chia.consensus.block_creation import unfinished_block_to_full_block -from chia.consensus.block_record import BlockRecord -from chia.consensus.blockchain import Blockchain, ReceiveBlockResult -from chia.consensus.constants import ConsensusConstants -from chia.consensus.difficulty_adjustment import get_next_sub_slot_iters_and_difficulty -from chia.consensus.make_sub_epoch_summary import next_sub_epoch_summary -from chia.consensus.multiprocess_validation import PreValidationResult -from chia.consensus.pot_iterations import calculate_sp_iters -from chia.full_node.block_store import BlockStore -from chia.full_node.bundle_tools import detect_potential_template_generator -from chia.full_node.coin_store import CoinStore -from chia.full_node.full_node_store import FullNodeStore -from chia.full_node.mempool_manager import MempoolManager -from chia.full_node.signage_point import SignagePoint -from chia.full_node.sync_store import SyncStore -from chia.full_node.weight_proof import WeightProofHandler -from chia.protocols import farmer_protocol, full_node_protocol, timelord_protocol, wallet_protocol -from chia.protocols.full_node_protocol import ( +import flax.server.ws_connection as ws # lgtm [py/import-and-import-from] +from flax.consensus.block_creation import unfinished_block_to_full_block +from flax.consensus.block_record import BlockRecord +from flax.consensus.blockchain import Blockchain, ReceiveBlockResult +from flax.consensus.constants import ConsensusConstants +from flax.consensus.difficulty_adjustment import get_next_sub_slot_iters_and_difficulty +from flax.consensus.make_sub_epoch_summary import next_sub_epoch_summary +from flax.consensus.multiprocess_validation import PreValidationResult +from flax.consensus.pot_iterations import calculate_sp_iters +from flax.full_node.block_store import BlockStore +from flax.full_node.bundle_tools import detect_potential_template_generator +from flax.full_node.coin_store import CoinStore +from flax.full_node.full_node_store import FullNodeStore +from flax.full_node.mempool_manager import MempoolManager +from flax.full_node.signage_point import SignagePoint +from flax.full_node.sync_store import SyncStore +from flax.full_node.weight_proof import WeightProofHandler +from flax.protocols import farmer_protocol, full_node_protocol, timelord_protocol, wallet_protocol +from flax.protocols.full_node_protocol import ( RejectBlocks, RequestBlocks, RespondBlock, RespondBlocks, RespondSignagePoint, ) -from chia.protocols.protocol_message_types import ProtocolMessageTypes -from chia.server.node_discovery import FullNodePeers -from chia.server.outbound_message import Message, NodeType, make_msg -from chia.server.server import ChiaServer -from chia.types.blockchain_format.classgroup import ClassgroupElement -from chia.types.blockchain_format.pool_target import PoolTarget -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.blockchain_format.sub_epoch_summary import SubEpochSummary -from chia.types.blockchain_format.vdf import CompressibleVDFField, VDFInfo, VDFProof -from chia.types.end_of_slot_bundle import EndOfSubSlotBundle -from chia.types.full_block import FullBlock -from chia.types.header_block import HeaderBlock -from chia.types.mempool_inclusion_status import MempoolInclusionStatus -from chia.types.spend_bundle import SpendBundle -from chia.types.unfinished_block import UnfinishedBlock -from chia.util.bech32m import encode_puzzle_hash -from chia.util.db_wrapper import DBWrapper -from chia.util.errors import ConsensusError, Err -from chia.util.ints import uint8, uint32, uint64, uint128 -from chia.util.path import mkdir, path_from_root -from chia.util.safe_cancel_task import cancel_task_safe -from chia.util.profiler import profile_task +from flax.protocols.protocol_message_types import ProtocolMessageTypes +from flax.server.node_discovery import FullNodePeers +from flax.server.outbound_message import Message, NodeType, make_msg +from flax.server.server import FlaxServer +from flax.types.blockchain_format.classgroup import ClassgroupElement +from flax.types.blockchain_format.pool_target import PoolTarget +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.blockchain_format.sub_epoch_summary import SubEpochSummary +from flax.types.blockchain_format.vdf import CompressibleVDFField, VDFInfo, VDFProof +from flax.types.end_of_slot_bundle import EndOfSubSlotBundle +from flax.types.full_block import FullBlock +from flax.types.header_block import HeaderBlock +from flax.types.mempool_inclusion_status import MempoolInclusionStatus +from flax.types.spend_bundle import SpendBundle +from flax.types.unfinished_block import UnfinishedBlock +from flax.util.bech32m import encode_puzzle_hash +from flax.util.db_wrapper import DBWrapper +from flax.util.errors import ConsensusError, Err +from flax.util.ints import uint8, uint32, uint64, uint128 +from flax.util.path import mkdir, path_from_root +from flax.util.safe_cancel_task import cancel_task_safe +from flax.util.profiler import profile_task class FullNode: @@ -173,14 +173,14 @@ async def initialize_weight_proof(self): if peak is not None: await self.weight_proof_handler.create_sub_epoch_segments() - def set_server(self, server: ChiaServer): + def set_server(self, server: FlaxServer): self.server = server dns_servers = [] if "dns_servers" in self.config: dns_servers = self.config["dns_servers"] - elif self.config["port"] == 8444: + elif self.config["port"] == 6888: # If `dns_servers` misses from the `config`, hardcode it if we're running mainnet. - dns_servers.append("dns-introducer.chia.net") + dns_servers.append("dns-introducer.flaxnetwork.org") try: self.full_node_peers = FullNodePeers( self.server, @@ -203,7 +203,7 @@ def _state_changed(self, change: str): if self.state_changed_callback is not None: self.state_changed_callback(change) - async def short_sync_batch(self, peer: ws.WSChiaConnection, start_height: uint32, target_height: uint32) -> bool: + async def short_sync_batch(self, peer: ws.WSFlaxConnection, start_height: uint32, target_height: uint32) -> bool: """ Tries to sync to a chain which is not too far in the future, by downloading batches of blocks. If the first block that we download is not connected to our chain, we return False and do an expensive long sync instead. @@ -273,7 +273,7 @@ async def short_sync_batch(self, peer: ws.WSChiaConnection, start_height: uint32 return True async def short_sync_backtrack( - self, peer: ws.WSChiaConnection, peak_height: uint32, target_height: uint32, target_unf_hash: bytes32 + self, peer: ws.WSFlaxConnection, peak_height: uint32, target_height: uint32, target_unf_hash: bytes32 ): """ Performs a backtrack sync, where blocks are downloaded one at a time from newest to oldest. If we do not @@ -324,7 +324,7 @@ async def short_sync_backtrack( self.sync_store.backtrack_syncing[peer.peer_node_id] -= 1 return found_fork_point - async def new_peak(self, request: full_node_protocol.NewPeak, peer: ws.WSChiaConnection): + async def new_peak(self, request: full_node_protocol.NewPeak, peer: ws.WSFlaxConnection): """ We have received a notification of a new peak from a peer. This happens either when we have just connected, or when the peer has updated their peak. @@ -391,7 +391,7 @@ async def new_peak(self, request: full_node_protocol.NewPeak, peer: ws.WSChiaCon self._sync_task = asyncio.create_task(self._sync()) async def send_peak_to_timelords( - self, peak_block: Optional[FullBlock] = None, peer: Optional[ws.WSChiaConnection] = None + self, peak_block: Optional[FullBlock] = None, peer: Optional[ws.WSFlaxConnection] = None ): """ Sends current peak to timelords @@ -464,7 +464,7 @@ async def synced(self) -> bool: else: return True - async def on_connect(self, connection: ws.WSChiaConnection): + async def on_connect(self, connection: ws.WSFlaxConnection): """ Whenever we connect to another node / wallet, send them our current heads. Also send heads to farmers and challenges to timelords. @@ -516,7 +516,7 @@ async def on_connect(self, connection: ws.WSChiaConnection): elif connection.connection_type is NodeType.TIMELORD: await self.send_peak_to_timelords() - def on_disconnect(self, connection: ws.WSChiaConnection): + def on_disconnect(self, connection: ws.WSFlaxConnection): self.log.info(f"peer disconnected {connection.get_peer_info()}") self._state_changed("close_connection") self._state_changed("sync_mode") @@ -780,7 +780,7 @@ async def sync_from_fork_point( async def receive_block_batch( self, all_blocks: List[FullBlock], - peer: ws.WSChiaConnection, + peer: ws.WSFlaxConnection, fork_point: Optional[uint32], wp_summaries: Optional[List[SubEpochSummary]] = None, ) -> Tuple[bool, bool, Optional[uint32]]: @@ -874,7 +874,7 @@ def has_valid_pool_sig(self, block: Union[UnfinishedBlock, FullBlock]): async def signage_point_post_processing( self, request: full_node_protocol.RespondSignagePoint, - peer: ws.WSChiaConnection, + peer: ws.WSFlaxConnection, ip_sub_slot: Optional[EndOfSubSlotBundle], ): self.log.info( @@ -928,7 +928,7 @@ async def signage_point_post_processing( await self.server.send_to_all([msg], NodeType.FARMER) async def peak_post_processing( - self, block: FullBlock, record: BlockRecord, fork_height: uint32, peer: Optional[ws.WSChiaConnection] + self, block: FullBlock, record: BlockRecord, fork_height: uint32, peer: Optional[ws.WSFlaxConnection] ): """ Must be called under self.blockchain.lock. This updates the internal state of the full node with the @@ -1077,7 +1077,7 @@ async def peak_post_processing( async def respond_block( self, respond_block: full_node_protocol.RespondBlock, - peer: Optional[ws.WSChiaConnection] = None, + peer: Optional[ws.WSFlaxConnection] = None, ) -> Optional[Message]: """ Receive a full block from a peer full node (or ourselves). @@ -1238,7 +1238,7 @@ async def respond_block( async def respond_unfinished_block( self, respond_unfinished_block: full_node_protocol.RespondUnfinishedBlock, - peer: Optional[ws.WSChiaConnection], + peer: Optional[ws.WSFlaxConnection], farmed_block: bool = False, ): """ @@ -1347,7 +1347,7 @@ async def respond_unfinished_block( f"Added unfinished_block {block_hash}, not farmed by us," f" SP: {block.reward_chain_block.signage_point_index} farmer response time: " f"{time.time() - self.signage_point_times[block.reward_chain_block.signage_point_index]}, " - f"Pool pk {encode_puzzle_hash(block.foliage.foliage_block_data.pool_target.puzzle_hash, 'xch')}, " + f"Pool pk {encode_puzzle_hash(block.foliage.foliage_block_data.pool_target.puzzle_hash, 'xfx')}, " f"validation time: {validation_time}, " f"cost: {block.transactions_info.cost if block.transactions_info else 'None'}" f"{percent_full_str}" @@ -1395,7 +1395,7 @@ async def respond_unfinished_block( self._state_changed("unfinished_block") async def new_infusion_point_vdf( - self, request: timelord_protocol.NewInfusionPointVDF, timelord_peer: Optional[ws.WSChiaConnection] = None + self, request: timelord_protocol.NewInfusionPointVDF, timelord_peer: Optional[ws.WSFlaxConnection] = None ) -> Optional[Message]: # Lookup unfinished blocks unfinished_block: Optional[UnfinishedBlock] = self.full_node_store.get_unfinished_block( @@ -1498,7 +1498,7 @@ async def new_infusion_point_vdf( return None async def respond_end_of_sub_slot( - self, request: full_node_protocol.RespondEndOfSubSlot, peer: ws.WSChiaConnection + self, request: full_node_protocol.RespondEndOfSubSlot, peer: ws.WSFlaxConnection ) -> Tuple[Optional[Message], bool]: fetched_ss = self.full_node_store.get_sub_slot(request.end_of_slot_bundle.challenge_chain.get_hash()) @@ -1586,7 +1586,7 @@ async def respond_transaction( self, transaction: SpendBundle, spend_name: bytes32, - peer: Optional[ws.WSChiaConnection] = None, + peer: Optional[ws.WSFlaxConnection] = None, test: bool = False, ) -> Tuple[MempoolInclusionStatus, Optional[Err]]: if self.sync_store.get_sync_mode(): @@ -1790,7 +1790,7 @@ async def respond_compact_proof_of_time(self, request: timelord_protocol.Respond if self.server is not None: await self.server.send_to_all([msg], NodeType.FULL_NODE) - async def new_compact_vdf(self, request: full_node_protocol.NewCompactVDF, peer: ws.WSChiaConnection): + async def new_compact_vdf(self, request: full_node_protocol.NewCompactVDF, peer: ws.WSFlaxConnection): is_fully_compactified = await self.block_store.is_fully_compactified(request.header_hash) if is_fully_compactified is None or is_fully_compactified: return False @@ -1808,7 +1808,7 @@ async def new_compact_vdf(self, request: full_node_protocol.NewCompactVDF, peer: if response is not None and isinstance(response, full_node_protocol.RespondCompactVDF): await self.respond_compact_vdf(response, peer) - async def request_compact_vdf(self, request: full_node_protocol.RequestCompactVDF, peer: ws.WSChiaConnection): + async def request_compact_vdf(self, request: full_node_protocol.RequestCompactVDF, peer: ws.WSFlaxConnection): header_block = await self.blockchain.get_header_block_by_height( request.height, request.header_hash, tx_filter=False ) @@ -1852,7 +1852,7 @@ async def request_compact_vdf(self, request: full_node_protocol.RequestCompactVD msg = make_msg(ProtocolMessageTypes.respond_compact_vdf, compact_vdf) await peer.send_message(msg) - async def respond_compact_vdf(self, request: full_node_protocol.RespondCompactVDF, peer: ws.WSChiaConnection): + async def respond_compact_vdf(self, request: full_node_protocol.RespondCompactVDF, peer: ws.WSFlaxConnection): field_vdf = CompressibleVDFField(int(request.field_vdf)) if not await self._can_accept_compact_proof( request.vdf_info, request.vdf_proof, request.height, request.header_hash, field_vdf diff --git a/chia/full_node/full_node_api.py b/flax/full_node/full_node_api.py similarity index 96% rename from chia/full_node/full_node_api.py rename to flax/full_node/full_node_api.py index 24c661de2..99bcde443 100644 --- a/chia/full_node/full_node_api.py +++ b/flax/full_node/full_node_api.py @@ -7,36 +7,36 @@ from blspy import AugSchemeMPL, G2Element from chiabip158 import PyBIP158 -import chia.server.ws_connection as ws -from chia.consensus.block_creation import create_unfinished_block -from chia.consensus.block_record import BlockRecord -from chia.consensus.pot_iterations import calculate_ip_iters, calculate_iterations_quality, calculate_sp_iters -from chia.full_node.bundle_tools import best_solution_generator_from_template, simple_solution_generator -from chia.full_node.full_node import FullNode -from chia.full_node.mempool_check_conditions import get_puzzle_and_solution_for_coin -from chia.full_node.signage_point import SignagePoint -from chia.protocols import farmer_protocol, full_node_protocol, introducer_protocol, timelord_protocol, wallet_protocol -from chia.protocols.full_node_protocol import RejectBlock, RejectBlocks -from chia.protocols.protocol_message_types import ProtocolMessageTypes -from chia.protocols.wallet_protocol import PuzzleSolutionResponse, RejectHeaderBlocks, RejectHeaderRequest -from chia.server.outbound_message import Message, make_msg -from chia.types.blockchain_format.coin import Coin, hash_coin_list -from chia.types.blockchain_format.pool_target import PoolTarget -from chia.types.blockchain_format.program import Program -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.coin_record import CoinRecord -from chia.types.end_of_slot_bundle import EndOfSubSlotBundle -from chia.types.full_block import FullBlock -from chia.types.generator_types import BlockGenerator -from chia.types.mempool_inclusion_status import MempoolInclusionStatus -from chia.types.mempool_item import MempoolItem -from chia.types.peer_info import PeerInfo -from chia.types.unfinished_block import UnfinishedBlock -from chia.util.api_decorators import api_request, peer_required, bytes_required, execute_task -from chia.util.generator_tools import get_block_header -from chia.util.hash import std_hash -from chia.util.ints import uint8, uint32, uint64, uint128 -from chia.util.merkle_set import MerkleSet +import flax.server.ws_connection as ws +from flax.consensus.block_creation import create_unfinished_block +from flax.consensus.block_record import BlockRecord +from flax.consensus.pot_iterations import calculate_ip_iters, calculate_iterations_quality, calculate_sp_iters +from flax.full_node.bundle_tools import best_solution_generator_from_template, simple_solution_generator +from flax.full_node.full_node import FullNode +from flax.full_node.mempool_check_conditions import get_puzzle_and_solution_for_coin +from flax.full_node.signage_point import SignagePoint +from flax.protocols import farmer_protocol, full_node_protocol, introducer_protocol, timelord_protocol, wallet_protocol +from flax.protocols.full_node_protocol import RejectBlock, RejectBlocks +from flax.protocols.protocol_message_types import ProtocolMessageTypes +from flax.protocols.wallet_protocol import PuzzleSolutionResponse, RejectHeaderBlocks, RejectHeaderRequest +from flax.server.outbound_message import Message, make_msg +from flax.types.blockchain_format.coin import Coin, hash_coin_list +from flax.types.blockchain_format.pool_target import PoolTarget +from flax.types.blockchain_format.program import Program +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.coin_record import CoinRecord +from flax.types.end_of_slot_bundle import EndOfSubSlotBundle +from flax.types.full_block import FullBlock +from flax.types.generator_types import BlockGenerator +from flax.types.mempool_inclusion_status import MempoolInclusionStatus +from flax.types.mempool_item import MempoolItem +from flax.types.peer_info import PeerInfo +from flax.types.unfinished_block import UnfinishedBlock +from flax.util.api_decorators import api_request, peer_required, bytes_required, execute_task +from flax.util.generator_tools import get_block_header +from flax.util.hash import std_hash +from flax.util.ints import uint8, uint32, uint64, uint128 +from flax.util.merkle_set import MerkleSet class FullNodeAPI: @@ -62,7 +62,7 @@ def api_ready(self): @peer_required @api_request - async def request_peers(self, _request: full_node_protocol.RequestPeers, peer: ws.WSChiaConnection): + async def request_peers(self, _request: full_node_protocol.RequestPeers, peer: ws.WSFlaxConnection): if peer.peer_server_port is None: return None peer_info = PeerInfo(peer.peer_host, peer.peer_server_port) @@ -73,7 +73,7 @@ async def request_peers(self, _request: full_node_protocol.RequestPeers, peer: w @peer_required @api_request async def respond_peers( - self, request: full_node_protocol.RespondPeers, peer: ws.WSChiaConnection + self, request: full_node_protocol.RespondPeers, peer: ws.WSFlaxConnection ) -> Optional[Message]: self.log.debug(f"Received {len(request.peer_list)} peers") if self.full_node.full_node_peers is not None: @@ -83,7 +83,7 @@ async def respond_peers( @peer_required @api_request async def respond_peers_introducer( - self, request: introducer_protocol.RespondPeersIntroducer, peer: ws.WSChiaConnection + self, request: introducer_protocol.RespondPeersIntroducer, peer: ws.WSFlaxConnection ) -> Optional[Message]: self.log.debug(f"Received {len(request.peer_list)} peers from introducer") if self.full_node.full_node_peers is not None: @@ -95,7 +95,7 @@ async def respond_peers_introducer( @execute_task @peer_required @api_request - async def new_peak(self, request: full_node_protocol.NewPeak, peer: ws.WSChiaConnection) -> Optional[Message]: + async def new_peak(self, request: full_node_protocol.NewPeak, peer: ws.WSFlaxConnection) -> Optional[Message]: """ A peer notifies us that they have added a new peak to their blockchain. If we don't have it, we can ask for it. @@ -106,7 +106,7 @@ async def new_peak(self, request: full_node_protocol.NewPeak, peer: ws.WSChiaCon @peer_required @api_request async def new_transaction( - self, transaction: full_node_protocol.NewTransaction, peer: ws.WSChiaConnection + self, transaction: full_node_protocol.NewTransaction, peer: ws.WSFlaxConnection ) -> Optional[Message]: """ A peer notifies us of a new transaction. @@ -210,7 +210,7 @@ async def request_transaction(self, request: full_node_protocol.RequestTransacti async def respond_transaction( self, tx: full_node_protocol.RespondTransaction, - peer: ws.WSChiaConnection, + peer: ws.WSFlaxConnection, tx_bytes: bytes = b"", test: bool = False, ) -> Optional[Message]: @@ -358,7 +358,7 @@ async def respond_blocks(self, request: full_node_protocol.RespondBlocks) -> Non async def respond_block( self, respond_block: full_node_protocol.RespondBlock, - peer: ws.WSChiaConnection, + peer: ws.WSFlaxConnection, ) -> Optional[Message]: """ Receive a full block from a peer full node (or ourselves). @@ -419,7 +419,7 @@ async def request_unfinished_block( async def respond_unfinished_block( self, respond_unfinished_block: full_node_protocol.RespondUnfinishedBlock, - peer: ws.WSChiaConnection, + peer: ws.WSFlaxConnection, ) -> Optional[Message]: if self.full_node.sync_store.get_sync_mode(): return None @@ -429,7 +429,7 @@ async def respond_unfinished_block( @api_request @peer_required async def new_signage_point_or_end_of_sub_slot( - self, new_sp: full_node_protocol.NewSignagePointOrEndOfSubSlot, peer: ws.WSChiaConnection + self, new_sp: full_node_protocol.NewSignagePointOrEndOfSubSlot, peer: ws.WSFlaxConnection ) -> Optional[Message]: # Ignore if syncing if self.full_node.sync_store.get_sync_mode(): @@ -555,7 +555,7 @@ async def request_signage_point_or_end_of_sub_slot( @peer_required @api_request async def respond_signage_point( - self, request: full_node_protocol.RespondSignagePoint, peer: ws.WSChiaConnection + self, request: full_node_protocol.RespondSignagePoint, peer: ws.WSFlaxConnection ) -> Optional[Message]: if self.full_node.sync_store.get_sync_mode(): return None @@ -611,7 +611,7 @@ async def respond_signage_point( @peer_required @api_request async def respond_end_of_sub_slot( - self, request: full_node_protocol.RespondEndOfSubSlot, peer: ws.WSChiaConnection + self, request: full_node_protocol.RespondEndOfSubSlot, peer: ws.WSFlaxConnection ) -> Optional[Message]: if self.full_node.sync_store.get_sync_mode(): return None @@ -623,7 +623,7 @@ async def respond_end_of_sub_slot( async def request_mempool_transactions( self, request: full_node_protocol.RequestMempoolTransactions, - peer: ws.WSChiaConnection, + peer: ws.WSFlaxConnection, ) -> Optional[Message]: received_filter = PyBIP158(bytearray(request.filter)) @@ -639,7 +639,7 @@ async def request_mempool_transactions( @api_request @peer_required async def declare_proof_of_space( - self, request: farmer_protocol.DeclareProofOfSpace, peer: ws.WSChiaConnection + self, request: farmer_protocol.DeclareProofOfSpace, peer: ws.WSFlaxConnection ) -> Optional[Message]: """ Creates a block body and header, with the proof of space, coinbase, and fee targets provided @@ -927,7 +927,7 @@ def get_pool_sig(_1, _2) -> Optional[G2Element]: @api_request @peer_required async def signed_values( - self, farmer_request: farmer_protocol.SignedValues, peer: ws.WSChiaConnection + self, farmer_request: farmer_protocol.SignedValues, peer: ws.WSFlaxConnection ) -> Optional[Message]: """ Signature of header hash, by the harvester. This is enough to create an unfinished @@ -992,7 +992,7 @@ async def signed_values( @peer_required @api_request async def new_infusion_point_vdf( - self, request: timelord_protocol.NewInfusionPointVDF, peer: ws.WSChiaConnection + self, request: timelord_protocol.NewInfusionPointVDF, peer: ws.WSFlaxConnection ) -> Optional[Message]: if self.full_node.sync_store.get_sync_mode(): return None @@ -1003,7 +1003,7 @@ async def new_infusion_point_vdf( @peer_required @api_request async def new_signage_point_vdf( - self, request: timelord_protocol.NewSignagePointVDF, peer: ws.WSChiaConnection + self, request: timelord_protocol.NewSignagePointVDF, peer: ws.WSFlaxConnection ) -> None: if self.full_node.sync_store.get_sync_mode(): return None @@ -1020,7 +1020,7 @@ async def new_signage_point_vdf( @peer_required @api_request async def new_end_of_sub_slot_vdf( - self, request: timelord_protocol.NewEndOfSubSlotVDF, peer: ws.WSChiaConnection + self, request: timelord_protocol.NewEndOfSubSlotVDF, peer: ws.WSFlaxConnection ) -> Optional[Message]: if self.full_node.sync_store.get_sync_mode(): return None @@ -1274,7 +1274,7 @@ async def respond_compact_proof_of_time(self, request: timelord_protocol.Respond @execute_task @peer_required @api_request - async def new_compact_vdf(self, request: full_node_protocol.NewCompactVDF, peer: ws.WSChiaConnection): + async def new_compact_vdf(self, request: full_node_protocol.NewCompactVDF, peer: ws.WSFlaxConnection): if self.full_node.sync_store.get_sync_mode(): return None async with self.full_node.compact_vdf_lock: @@ -1282,14 +1282,14 @@ async def new_compact_vdf(self, request: full_node_protocol.NewCompactVDF, peer: @peer_required @api_request - async def request_compact_vdf(self, request: full_node_protocol.RequestCompactVDF, peer: ws.WSChiaConnection): + async def request_compact_vdf(self, request: full_node_protocol.RequestCompactVDF, peer: ws.WSFlaxConnection): if self.full_node.sync_store.get_sync_mode(): return None await self.full_node.request_compact_vdf(request, peer) @peer_required @api_request - async def respond_compact_vdf(self, request: full_node_protocol.RespondCompactVDF, peer: ws.WSChiaConnection): + async def respond_compact_vdf(self, request: full_node_protocol.RespondCompactVDF, peer: ws.WSFlaxConnection): if self.full_node.sync_store.get_sync_mode(): return None await self.full_node.respond_compact_vdf(request, peer) diff --git a/chia/full_node/full_node_store.py b/flax/full_node/full_node_store.py similarity index 96% rename from chia/full_node/full_node_store.py rename to flax/full_node/full_node_store.py index e15bc142e..7ec2142e7 100644 --- a/chia/full_node/full_node_store.py +++ b/flax/full_node/full_node_store.py @@ -4,25 +4,25 @@ import time from typing import Dict, List, Optional, Set, Tuple -from chia.consensus.block_record import BlockRecord -from chia.consensus.blockchain_interface import BlockchainInterface -from chia.consensus.constants import ConsensusConstants -from chia.consensus.difficulty_adjustment import can_finish_sub_and_full_epoch -from chia.consensus.make_sub_epoch_summary import next_sub_epoch_summary -from chia.consensus.multiprocess_validation import PreValidationResult -from chia.consensus.pot_iterations import calculate_sp_interval_iters -from chia.full_node.signage_point import SignagePoint -from chia.protocols import timelord_protocol -from chia.server.outbound_message import Message -from chia.types.blockchain_format.classgroup import ClassgroupElement -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.blockchain_format.sub_epoch_summary import SubEpochSummary -from chia.types.blockchain_format.vdf import VDFInfo -from chia.types.end_of_slot_bundle import EndOfSubSlotBundle -from chia.types.full_block import FullBlock -from chia.types.generator_types import CompressorArg -from chia.types.unfinished_block import UnfinishedBlock -from chia.util.ints import uint8, uint32, uint64, uint128 +from flax.consensus.block_record import BlockRecord +from flax.consensus.blockchain_interface import BlockchainInterface +from flax.consensus.constants import ConsensusConstants +from flax.consensus.difficulty_adjustment import can_finish_sub_and_full_epoch +from flax.consensus.make_sub_epoch_summary import next_sub_epoch_summary +from flax.consensus.multiprocess_validation import PreValidationResult +from flax.consensus.pot_iterations import calculate_sp_interval_iters +from flax.full_node.signage_point import SignagePoint +from flax.protocols import timelord_protocol +from flax.server.outbound_message import Message +from flax.types.blockchain_format.classgroup import ClassgroupElement +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.blockchain_format.sub_epoch_summary import SubEpochSummary +from flax.types.blockchain_format.vdf import VDFInfo +from flax.types.end_of_slot_bundle import EndOfSubSlotBundle +from flax.types.full_block import FullBlock +from flax.types.generator_types import CompressorArg +from flax.types.unfinished_block import UnfinishedBlock +from flax.util.ints import uint8, uint32, uint64, uint128 log = logging.getLogger(__name__) diff --git a/chia/full_node/generator.py b/flax/full_node/generator.py similarity index 86% rename from chia/full_node/generator.py rename to flax/full_node/generator.py index 82d4b15cd..df4829762 100644 --- a/chia/full_node/generator.py +++ b/flax/full_node/generator.py @@ -1,19 +1,19 @@ import logging from typing import List, Optional, Union, Tuple -from chia.types.blockchain_format.program import Program, SerializedProgram -from chia.types.generator_types import BlockGenerator, GeneratorArg, GeneratorBlockCacheInterface, CompressorArg -from chia.util.ints import uint32, uint64 -from chia.wallet.puzzles.load_clvm import load_clvm -from chia.wallet.puzzles.rom_bootstrap_generator import get_generator +from flax.types.blockchain_format.program import Program, SerializedProgram +from flax.types.generator_types import BlockGenerator, GeneratorArg, GeneratorBlockCacheInterface, CompressorArg +from flax.util.ints import uint32, uint64 +from flax.wallet.puzzles.load_clvm import load_clvm +from flax.wallet.puzzles.rom_bootstrap_generator import get_generator GENERATOR_MOD = get_generator() -DECOMPRESS_BLOCK = load_clvm("block_program_zero.clvm", package_or_requirement="chia.wallet.puzzles") -DECOMPRESS_PUZZLE = load_clvm("decompress_puzzle.clvm", package_or_requirement="chia.wallet.puzzles") -# DECOMPRESS_CSE = load_clvm("decompress_coin_solution_entry.clvm", package_or_requirement="chia.wallet.puzzles") +DECOMPRESS_BLOCK = load_clvm("block_program_zero.clvm", package_or_requirement="flax.wallet.puzzles") +DECOMPRESS_PUZZLE = load_clvm("decompress_puzzle.clvm", package_or_requirement="flax.wallet.puzzles") +# DECOMPRESS_CSE = load_clvm("decompress_coin_solution_entry.clvm", package_or_requirement="flax.wallet.puzzles") DECOMPRESS_CSE_WITH_PREFIX = load_clvm( - "decompress_coin_solution_entry_with_prefix.clvm", package_or_requirement="chia.wallet.puzzles" + "decompress_coin_solution_entry_with_prefix.clvm", package_or_requirement="flax.wallet.puzzles" ) log = logging.getLogger(__name__) diff --git a/chia/full_node/mempool.py b/flax/full_node/mempool.py similarity index 95% rename from chia/full_node/mempool.py rename to flax/full_node/mempool.py index 4bdd39bf2..4fdaee4ac 100644 --- a/chia/full_node/mempool.py +++ b/flax/full_node/mempool.py @@ -2,9 +2,9 @@ from sortedcontainers import SortedDict -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.mempool_item import MempoolItem +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.mempool_item import MempoolItem class Mempool: diff --git a/chia/full_node/mempool_check_conditions.py b/flax/full_node/mempool_check_conditions.py similarity index 91% rename from chia/full_node/mempool_check_conditions.py rename to flax/full_node/mempool_check_conditions.py index 65fded60e..0cb1ffb7d 100644 --- a/chia/full_node/mempool_check_conditions.py +++ b/flax/full_node/mempool_check_conditions.py @@ -1,21 +1,21 @@ import time from typing import Dict, List, Optional, Set -from chia.consensus.cost_calculator import NPCResult -from chia.full_node.generator import create_generator_args, setup_generator_args -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.program import NIL -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.coin_record import CoinRecord -from chia.types.condition_with_args import ConditionWithArgs -from chia.types.generator_types import BlockGenerator -from chia.types.name_puzzle_condition import NPC -from chia.util.clvm import int_from_bytes -from chia.util.condition_tools import ConditionOpcode, conditions_by_opcode -from chia.util.errors import Err -from chia.util.ints import uint32, uint64, uint16 -from chia.wallet.puzzles.generator_loader import GENERATOR_FOR_SINGLE_COIN_MOD -from chia.wallet.puzzles.rom_bootstrap_generator import get_generator +from flax.consensus.cost_calculator import NPCResult +from flax.full_node.generator import create_generator_args, setup_generator_args +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.program import NIL +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.coin_record import CoinRecord +from flax.types.condition_with_args import ConditionWithArgs +from flax.types.generator_types import BlockGenerator +from flax.types.name_puzzle_condition import NPC +from flax.util.clvm import int_from_bytes +from flax.util.condition_tools import ConditionOpcode, conditions_by_opcode +from flax.util.errors import Err +from flax.util.ints import uint32, uint64, uint16 +from flax.wallet.puzzles.generator_loader import GENERATOR_FOR_SINGLE_COIN_MOD +from flax.wallet.puzzles.rom_bootstrap_generator import get_generator GENERATOR_MOD = get_generator() diff --git a/chia/full_node/mempool_manager.py b/flax/full_node/mempool_manager.py similarity index 95% rename from chia/full_node/mempool_manager.py rename to flax/full_node/mempool_manager.py index b48d84876..cd142d37b 100644 --- a/chia/full_node/mempool_manager.py +++ b/flax/full_node/mempool_manager.py @@ -8,32 +8,32 @@ from blspy import AugSchemeMPL, G1Element from chiabip158 import PyBIP158 -from chia.consensus.block_record import BlockRecord -from chia.consensus.constants import ConsensusConstants -from chia.consensus.cost_calculator import NPCResult, calculate_cost_of_program -from chia.full_node.bundle_tools import simple_solution_generator -from chia.full_node.coin_store import CoinStore -from chia.full_node.mempool import Mempool -from chia.full_node.mempool_check_conditions import mempool_check_conditions_dict, get_name_puzzle_conditions -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.program import SerializedProgram -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.coin_record import CoinRecord -from chia.types.condition_opcodes import ConditionOpcode -from chia.types.condition_with_args import ConditionWithArgs -from chia.types.mempool_inclusion_status import MempoolInclusionStatus -from chia.types.mempool_item import MempoolItem -from chia.types.spend_bundle import SpendBundle -from chia.util.clvm import int_from_bytes -from chia.util.condition_tools import ( +from flax.consensus.block_record import BlockRecord +from flax.consensus.constants import ConsensusConstants +from flax.consensus.cost_calculator import NPCResult, calculate_cost_of_program +from flax.full_node.bundle_tools import simple_solution_generator +from flax.full_node.coin_store import CoinStore +from flax.full_node.mempool import Mempool +from flax.full_node.mempool_check_conditions import mempool_check_conditions_dict, get_name_puzzle_conditions +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.program import SerializedProgram +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.coin_record import CoinRecord +from flax.types.condition_opcodes import ConditionOpcode +from flax.types.condition_with_args import ConditionWithArgs +from flax.types.mempool_inclusion_status import MempoolInclusionStatus +from flax.types.mempool_item import MempoolItem +from flax.types.spend_bundle import SpendBundle +from flax.util.clvm import int_from_bytes +from flax.util.condition_tools import ( pkm_pairs_for_conditions_dict, coin_announcements_names_for_npc, puzzle_announcements_names_for_npc, ) -from chia.util.errors import Err -from chia.util.generator_tools import additions_for_npc -from chia.util.ints import uint32, uint64 -from chia.util.streamable import recurse_jsonify +from flax.util.errors import Err +from flax.util.generator_tools import additions_for_npc +from flax.util.ints import uint32, uint64 +from flax.util.streamable import recurse_jsonify log = logging.getLogger(__name__) @@ -388,7 +388,7 @@ async def add_spendbundle( log.warning(f"{npc.puzzle_hash} != {coin_record.coin.puzzle_hash}") return None, MempoolInclusionStatus.FAILED, Err.WRONG_PUZZLE_HASH - chialisp_height = ( + flaxlisp_height = ( self.peak.prev_transaction_block_height if not self.peak.is_transaction_block else self.peak.height ) assert self.peak.timestamp is not None @@ -397,7 +397,7 @@ async def add_spendbundle( coin_announcements_in_spend, puzzle_announcements_in_spend, npc.condition_dict, - uint32(chialisp_height), + uint32(flaxlisp_height), self.peak.timestamp, ) diff --git a/chia/full_node/signage_point.py b/flax/full_node/signage_point.py similarity index 68% rename from chia/full_node/signage_point.py rename to flax/full_node/signage_point.py index be79026fd..da1fc713b 100644 --- a/chia/full_node/signage_point.py +++ b/flax/full_node/signage_point.py @@ -1,8 +1,8 @@ from dataclasses import dataclass from typing import Optional -from chia.types.blockchain_format.vdf import VDFInfo, VDFProof -from chia.util.streamable import Streamable, streamable +from flax.types.blockchain_format.vdf import VDFInfo, VDFProof +from flax.util.streamable import Streamable, streamable @dataclass(frozen=True) diff --git a/chia/full_node/sync_store.py b/flax/full_node/sync_store.py similarity index 97% rename from chia/full_node/sync_store.py rename to flax/full_node/sync_store.py index 27b339176..de4331fa7 100644 --- a/chia/full_node/sync_store.py +++ b/flax/full_node/sync_store.py @@ -2,8 +2,8 @@ import logging from typing import Dict, List, Optional, Set, Tuple -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.ints import uint32, uint128 +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.ints import uint32, uint128 log = logging.getLogger(__name__) diff --git a/chia/full_node/weight_proof.py b/flax/full_node/weight_proof.py similarity index 98% rename from chia/full_node/weight_proof.py rename to flax/full_node/weight_proof.py index 2b4fea34c..725481745 100644 --- a/chia/full_node/weight_proof.py +++ b/flax/full_node/weight_proof.py @@ -6,27 +6,27 @@ from concurrent.futures.process import ProcessPoolExecutor from typing import Dict, List, Optional, Tuple -from chia.consensus.block_header_validation import validate_finished_header_block -from chia.consensus.block_record import BlockRecord -from chia.consensus.blockchain_interface import BlockchainInterface -from chia.consensus.constants import ConsensusConstants -from chia.consensus.deficit import calculate_deficit -from chia.consensus.full_block_to_block_record import header_block_to_sub_block_record -from chia.consensus.pot_iterations import ( +from flax.consensus.block_header_validation import validate_finished_header_block +from flax.consensus.block_record import BlockRecord +from flax.consensus.blockchain_interface import BlockchainInterface +from flax.consensus.constants import ConsensusConstants +from flax.consensus.deficit import calculate_deficit +from flax.consensus.full_block_to_block_record import header_block_to_sub_block_record +from flax.consensus.pot_iterations import ( calculate_ip_iters, calculate_iterations_quality, calculate_sp_iters, is_overflow_block, ) -from chia.consensus.vdf_info_computation import get_signage_point_vdf_info -from chia.types.blockchain_format.classgroup import ClassgroupElement -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.blockchain_format.slots import ChallengeChainSubSlot, RewardChainSubSlot -from chia.types.blockchain_format.sub_epoch_summary import SubEpochSummary -from chia.types.blockchain_format.vdf import VDFInfo -from chia.types.end_of_slot_bundle import EndOfSubSlotBundle -from chia.types.header_block import HeaderBlock -from chia.types.weight_proof import ( +from flax.consensus.vdf_info_computation import get_signage_point_vdf_info +from flax.types.blockchain_format.classgroup import ClassgroupElement +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.blockchain_format.slots import ChallengeChainSubSlot, RewardChainSubSlot +from flax.types.blockchain_format.sub_epoch_summary import SubEpochSummary +from flax.types.blockchain_format.vdf import VDFInfo +from flax.types.end_of_slot_bundle import EndOfSubSlotBundle +from flax.types.header_block import HeaderBlock +from flax.types.weight_proof import ( SubEpochChallengeSegment, SubEpochData, SubSlotData, @@ -34,10 +34,10 @@ SubEpochSegments, RecentChainData, ) -from chia.util.block_cache import BlockCache -from chia.util.hash import std_hash -from chia.util.ints import uint8, uint32, uint64, uint128 -from chia.util.streamable import dataclass_from_dict, recurse_jsonify +from flax.util.block_cache import BlockCache +from flax.util.hash import std_hash +from flax.util.ints import uint8, uint32, uint64, uint128 +from flax.util.streamable import dataclass_from_dict, recurse_jsonify log = logging.getLogger(__name__) diff --git a/chia/harvester/__init__.py b/flax/harvester/__init__.py similarity index 100% rename from chia/harvester/__init__.py rename to flax/harvester/__init__.py diff --git a/chia/harvester/harvester.py b/flax/harvester/harvester.py similarity index 90% rename from chia/harvester/harvester.py rename to flax/harvester/harvester.py index ed1c00d02..aa041388b 100644 --- a/chia/harvester/harvester.py +++ b/flax/harvester/harvester.py @@ -7,13 +7,13 @@ from blspy import G1Element -import chia.server.ws_connection as ws # lgtm [py/import-and-import-from] -from chia.consensus.constants import ConsensusConstants -from chia.plotting.plot_tools import PlotInfo -from chia.plotting.plot_tools import add_plot_directory as add_plot_directory_pt -from chia.plotting.plot_tools import get_plot_directories as get_plot_directories_pt -from chia.plotting.plot_tools import load_plots -from chia.plotting.plot_tools import remove_plot_directory as remove_plot_directory_pt +import flax.server.ws_connection as ws # lgtm [py/import-and-import-from] +from flax.consensus.constants import ConsensusConstants +from flax.plotting.plot_tools import PlotInfo +from flax.plotting.plot_tools import add_plot_directory as add_plot_directory_pt +from flax.plotting.plot_tools import get_plot_directories as get_plot_directories_pt +from flax.plotting.plot_tools import load_plots +from flax.plotting.plot_tools import remove_plot_directory as remove_plot_directory_pt log = logging.getLogger(__name__) @@ -72,7 +72,7 @@ def _state_changed(self, change: str): if self.state_changed_callback is not None: self.state_changed_callback(change) - def on_disconnect(self, connection: ws.WSChiaConnection): + def on_disconnect(self, connection: ws.WSFlaxConnection): self.log.info(f"peer disconnected {connection.get_peer_info()}") self._state_changed("close_connection") diff --git a/chia/harvester/harvester_api.py b/flax/harvester/harvester_api.py similarity index 94% rename from chia/harvester/harvester_api.py rename to flax/harvester/harvester_api.py index 3e9014de2..f68fde58d 100644 --- a/chia/harvester/harvester_api.py +++ b/flax/harvester/harvester_api.py @@ -5,19 +5,19 @@ from blspy import AugSchemeMPL, G2Element -from chia.consensus.pot_iterations import calculate_iterations_quality, calculate_sp_interval_iters -from chia.harvester.harvester import Harvester -from chia.plotting.plot_tools import PlotInfo, parse_plot_info -from chia.protocols import harvester_protocol -from chia.protocols.farmer_protocol import FarmingInfo -from chia.protocols.protocol_message_types import ProtocolMessageTypes -from chia.server.outbound_message import make_msg -from chia.server.ws_connection import WSChiaConnection -from chia.types.blockchain_format.proof_of_space import ProofOfSpace -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.api_decorators import api_request, peer_required -from chia.util.ints import uint8, uint32, uint64 -from chia.wallet.derive_keys import master_sk_to_local_sk +from flax.consensus.pot_iterations import calculate_iterations_quality, calculate_sp_interval_iters +from flax.harvester.harvester import Harvester +from flax.plotting.plot_tools import PlotInfo, parse_plot_info +from flax.protocols import harvester_protocol +from flax.protocols.farmer_protocol import FarmingInfo +from flax.protocols.protocol_message_types import ProtocolMessageTypes +from flax.server.outbound_message import make_msg +from flax.server.ws_connection import WSFlaxConnection +from flax.types.blockchain_format.proof_of_space import ProofOfSpace +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.api_decorators import api_request, peer_required +from flax.util.ints import uint8, uint32, uint64 +from flax.wallet.derive_keys import master_sk_to_local_sk class HarvesterAPI: @@ -48,7 +48,7 @@ async def harvester_handshake(self, harvester_handshake: harvester_protocol.Harv @peer_required @api_request async def new_signage_point_harvester( - self, new_challenge: harvester_protocol.NewSignagePointHarvester, peer: WSChiaConnection + self, new_challenge: harvester_protocol.NewSignagePointHarvester, peer: WSFlaxConnection ): """ The harvester receives a new signage point from the farmer, this happens at the start of each slot. diff --git a/chia/introducer/__init__.py b/flax/introducer/__init__.py similarity index 100% rename from chia/introducer/__init__.py rename to flax/introducer/__init__.py diff --git a/chia/introducer/introducer.py b/flax/introducer/introducer.py similarity index 93% rename from chia/introducer/introducer.py rename to flax/introducer/introducer.py index c739555c9..748579bea 100644 --- a/chia/introducer/introducer.py +++ b/flax/introducer/introducer.py @@ -3,9 +3,9 @@ import time from typing import Optional -from chia.server.server import ChiaServer -from chia.server.introducer_peers import VettedPeer -from chia.util.ints import uint64 +from flax.server.server import FlaxServer +from flax.server.introducer_peers import VettedPeer +from flax.util.ints import uint64 class Introducer: @@ -13,7 +13,7 @@ def __init__(self, max_peers_to_send: int, recent_peer_threshold: int): self.max_peers_to_send = max_peers_to_send self.recent_peer_threshold = recent_peer_threshold self._shut_down = False - self.server: Optional[ChiaServer] = None + self.server: Optional[FlaxServer] = None self.log = logging.getLogger(__name__) async def _start(self): @@ -27,7 +27,7 @@ async def _await_closed(self): pass # await self._vetting_task - def set_server(self, server: ChiaServer): + def set_server(self, server: FlaxServer): self.server = server async def _vetting_loop(self): diff --git a/chia/introducer/introducer_api.py b/flax/introducer/introducer_api.py similarity index 75% rename from chia/introducer/introducer_api.py rename to flax/introducer/introducer_api.py index ec6e92a3b..8b2843f5e 100644 --- a/chia/introducer/introducer_api.py +++ b/flax/introducer/introducer_api.py @@ -1,13 +1,13 @@ from typing import Callable, Optional -from chia.introducer.introducer import Introducer -from chia.protocols.introducer_protocol import RequestPeersIntroducer, RespondPeersIntroducer -from chia.protocols.protocol_message_types import ProtocolMessageTypes -from chia.server.outbound_message import Message, make_msg -from chia.server.ws_connection import WSChiaConnection -from chia.types.peer_info import TimestampedPeerInfo -from chia.util.api_decorators import api_request, peer_required -from chia.util.ints import uint64 +from flax.introducer.introducer import Introducer +from flax.protocols.introducer_protocol import RequestPeersIntroducer, RespondPeersIntroducer +from flax.protocols.protocol_message_types import ProtocolMessageTypes +from flax.server.outbound_message import Message, make_msg +from flax.server.ws_connection import WSFlaxConnection +from flax.types.peer_info import TimestampedPeerInfo +from flax.util.api_decorators import api_request, peer_required +from flax.util.ints import uint64 class IntroducerAPI: @@ -24,7 +24,7 @@ def _set_state_changed_callback(self, callback: Callable): async def request_peers_introducer( self, request: RequestPeersIntroducer, - peer: WSChiaConnection, + peer: WSFlaxConnection, ) -> Optional[Message]: max_peers = self.introducer.max_peers_to_send if self.introducer.server is None or self.introducer.server.introducer_peers is None: diff --git a/chia/plotting/check_plots.py b/flax/plotting/check_plots.py similarity index 94% rename from chia/plotting/check_plots.py rename to flax/plotting/check_plots.py index d1eac39fd..e6ffde2e1 100644 --- a/chia/plotting/check_plots.py +++ b/flax/plotting/check_plots.py @@ -6,11 +6,11 @@ from blspy import G1Element from chiapos import Verifier -from chia.plotting.plot_tools import find_duplicate_plot_IDs, get_plot_filenames, load_plots, parse_plot_info -from chia.util.config import load_config -from chia.util.hash import std_hash -from chia.util.keychain import Keychain -from chia.wallet.derive_keys import master_sk_to_farmer_sk, master_sk_to_local_sk +from flax.plotting.plot_tools import find_duplicate_plot_IDs, get_plot_filenames, load_plots, parse_plot_info +from flax.util.config import load_config +from flax.util.hash import std_hash +from flax.util.keychain import Keychain +from flax.wallet.derive_keys import master_sk_to_farmer_sk, master_sk_to_local_sk log = logging.getLogger(__name__) @@ -142,5 +142,5 @@ def check_plots(root_path, num, challenge_start, grep_string, list_duplicates, d log.warning( f"There are {len(no_key_filenames)} plots with a farmer or pool public key that " f"is not on this machine. The farmer private key must be in the keychain in order to " - f"farm them, use 'chia keys' to transfer keys. The pool public keys must be in the config.yaml" + f"farm them, use 'flax keys' to transfer keys. The pool public keys must be in the config.yaml" ) diff --git a/chia/plotting/create_plots.py b/flax/plotting/create_plots.py similarity index 91% rename from chia/plotting/create_plots.py rename to flax/plotting/create_plots.py index 1f2cc2a2c..61226842a 100644 --- a/chia/plotting/create_plots.py +++ b/flax/plotting/create_plots.py @@ -7,14 +7,14 @@ from blspy import AugSchemeMPL, G1Element, PrivateKey from chiapos import DiskPlotter -from chia.plotting.plot_tools import add_plot_directory, stream_plot_info_ph, stream_plot_info_pk -from chia.types.blockchain_format.proof_of_space import ProofOfSpace -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.bech32m import decode_puzzle_hash -from chia.util.config import config_path_for_filename, load_config -from chia.util.keychain import Keychain -from chia.util.path import mkdir -from chia.wallet.derive_keys import master_sk_to_farmer_sk, master_sk_to_local_sk, master_sk_to_pool_sk +from flax.plotting.plot_tools import add_plot_directory, stream_plot_info_ph, stream_plot_info_pk +from flax.types.blockchain_format.proof_of_space import ProofOfSpace +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.bech32m import decode_puzzle_hash +from flax.util.config import config_path_for_filename, load_config +from flax.util.keychain import Keychain +from flax.util.path import mkdir +from flax.wallet.derive_keys import master_sk_to_farmer_sk, master_sk_to_local_sk, master_sk_to_pool_sk log = logging.getLogger(__name__) @@ -27,7 +27,7 @@ def get_farmer_public_key(alt_fingerprint: Optional[int] = None) -> G1Element: else: sk_ent = keychain.get_first_private_key() if sk_ent is None: - raise RuntimeError("No keys, please run 'chia keys add', 'chia keys generate' or provide a public key with -f") + raise RuntimeError("No keys, please run 'flax keys add', 'flax keys generate' or provide a public key with -f") return master_sk_to_farmer_sk(sk_ent[0]).get_g1() @@ -39,7 +39,7 @@ def get_pool_public_key(alt_fingerprint: Optional[int] = None) -> G1Element: else: sk_ent = keychain.get_first_private_key() if sk_ent is None: - raise RuntimeError("No keys, please run 'chia keys add', 'chia keys generate' or provide a public key with -p") + raise RuntimeError("No keys, please run 'flax keys add', 'flax keys generate' or provide a public key with -p") return master_sk_to_pool_sk(sk_ent[0]).get_g1() diff --git a/chia/plotting/plot_tools.py b/flax/plotting/plot_tools.py similarity index 97% rename from chia/plotting/plot_tools.py rename to flax/plotting/plot_tools.py index c3925c945..798ca5129 100644 --- a/chia/plotting/plot_tools.py +++ b/flax/plotting/plot_tools.py @@ -11,11 +11,11 @@ from blspy import G1Element, PrivateKey from chiapos import DiskProver -from chia.consensus.pos_quality import UI_ACTUAL_SPACE_CONSTANT_FACTOR, _expected_plot_size -from chia.types.blockchain_format.proof_of_space import ProofOfSpace -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.config import load_config, save_config -from chia.wallet.derive_keys import master_sk_to_local_sk +from flax.consensus.pos_quality import UI_ACTUAL_SPACE_CONSTANT_FACTOR, _expected_plot_size +from flax.types.blockchain_format.proof_of_space import ProofOfSpace +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.config import load_config, save_config +from flax.wallet.derive_keys import master_sk_to_local_sk log = logging.getLogger(__name__) diff --git a/chia/protocols/__init__.py b/flax/protocols/__init__.py similarity index 100% rename from chia/protocols/__init__.py rename to flax/protocols/__init__.py diff --git a/chia/protocols/farmer_protocol.py b/flax/protocols/farmer_protocol.py similarity index 83% rename from chia/protocols/farmer_protocol.py rename to flax/protocols/farmer_protocol.py index 1d2c4f062..b774f2cef 100644 --- a/chia/protocols/farmer_protocol.py +++ b/flax/protocols/farmer_protocol.py @@ -3,11 +3,11 @@ from blspy import G2Element -from chia.types.blockchain_format.pool_target import PoolTarget -from chia.types.blockchain_format.proof_of_space import ProofOfSpace -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.ints import uint8, uint32, uint64 -from chia.util.streamable import Streamable, streamable +from flax.types.blockchain_format.pool_target import PoolTarget +from flax.types.blockchain_format.proof_of_space import ProofOfSpace +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.ints import uint8, uint32, uint64 +from flax.util.streamable import Streamable, streamable """ Protocol between farmer and full node. diff --git a/chia/protocols/full_node_protocol.py b/flax/protocols/full_node_protocol.py similarity index 87% rename from chia/protocols/full_node_protocol.py rename to flax/protocols/full_node_protocol.py index cbafdad00..ce169d0f6 100644 --- a/chia/protocols/full_node_protocol.py +++ b/flax/protocols/full_node_protocol.py @@ -1,16 +1,16 @@ from dataclasses import dataclass from typing import List, Optional -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.blockchain_format.vdf import VDFInfo, VDFProof -from chia.types.end_of_slot_bundle import EndOfSubSlotBundle -from chia.types.full_block import FullBlock -from chia.types.peer_info import TimestampedPeerInfo -from chia.types.spend_bundle import SpendBundle -from chia.types.unfinished_block import UnfinishedBlock -from chia.types.weight_proof import WeightProof -from chia.util.ints import uint8, uint32, uint64, uint128 -from chia.util.streamable import Streamable, streamable +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.blockchain_format.vdf import VDFInfo, VDFProof +from flax.types.end_of_slot_bundle import EndOfSubSlotBundle +from flax.types.full_block import FullBlock +from flax.types.peer_info import TimestampedPeerInfo +from flax.types.spend_bundle import SpendBundle +from flax.types.unfinished_block import UnfinishedBlock +from flax.types.weight_proof import WeightProof +from flax.util.ints import uint8, uint32, uint64, uint128 +from flax.util.streamable import Streamable, streamable """ Protocol between full nodes. diff --git a/chia/protocols/harvester_protocol.py b/flax/protocols/harvester_protocol.py similarity index 85% rename from chia/protocols/harvester_protocol.py rename to flax/protocols/harvester_protocol.py index d7db668f1..a138b1150 100644 --- a/chia/protocols/harvester_protocol.py +++ b/flax/protocols/harvester_protocol.py @@ -3,10 +3,10 @@ from blspy import G1Element, G2Element -from chia.types.blockchain_format.proof_of_space import ProofOfSpace -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.ints import uint8, uint64 -from chia.util.streamable import Streamable, streamable +from flax.types.blockchain_format.proof_of_space import ProofOfSpace +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.ints import uint8, uint64 +from flax.util.streamable import Streamable, streamable """ Protocol between harvester and farmer. diff --git a/chia/protocols/introducer_protocol.py b/flax/protocols/introducer_protocol.py similarity index 80% rename from chia/protocols/introducer_protocol.py rename to flax/protocols/introducer_protocol.py index 7eadacb21..8dcede1b8 100644 --- a/chia/protocols/introducer_protocol.py +++ b/flax/protocols/introducer_protocol.py @@ -1,8 +1,8 @@ from dataclasses import dataclass from typing import List -from chia.types.peer_info import TimestampedPeerInfo -from chia.util.streamable import Streamable, streamable +from flax.types.peer_info import TimestampedPeerInfo +from flax.util.streamable import Streamable, streamable """ Protocol to introducer diff --git a/chia/protocols/pool_protocol.py b/flax/protocols/pool_protocol.py similarity index 86% rename from chia/protocols/pool_protocol.py rename to flax/protocols/pool_protocol.py index caa6a8922..97e3901ab 100644 --- a/chia/protocols/pool_protocol.py +++ b/flax/protocols/pool_protocol.py @@ -1,9 +1,9 @@ from dataclasses import dataclass from typing import List, Optional -from chia.types.blockchain_format.proof_of_space import ProofOfSpace -from chia.util.ints import uint32, uint64 -from chia.util.streamable import Streamable, streamable +from flax.types.blockchain_format.proof_of_space import ProofOfSpace +from flax.util.ints import uint32, uint64 +from flax.util.streamable import Streamable, streamable """ Protocol between farmer and pool. diff --git a/chia/protocols/protocol_message_types.py b/flax/protocols/protocol_message_types.py similarity index 100% rename from chia/protocols/protocol_message_types.py rename to flax/protocols/protocol_message_types.py diff --git a/chia/protocols/shared_protocol.py b/flax/protocols/shared_protocol.py similarity index 80% rename from chia/protocols/shared_protocol.py rename to flax/protocols/shared_protocol.py index 27342a1e6..315b7328b 100644 --- a/chia/protocols/shared_protocol.py +++ b/flax/protocols/shared_protocol.py @@ -2,8 +2,8 @@ from enum import IntEnum from typing import List, Tuple -from chia.util.ints import uint8, uint16 -from chia.util.streamable import Streamable, streamable +from flax.util.ints import uint8, uint16 +from flax.util.streamable import Streamable, streamable protocol_version = "0.0.32" @@ -16,7 +16,7 @@ # Capabilities can be added here when new features are added to the protocol # These are passed in as uint16 into the Handshake class Capability(IntEnum): - BASE = 1 # Base capability just means it supports the chia protocol at mainnet + BASE = 1 # Base capability just means it supports the flax protocol at mainnet @dataclass(frozen=True) diff --git a/chia/protocols/timelord_protocol.py b/flax/protocols/timelord_protocol.py similarity index 84% rename from chia/protocols/timelord_protocol.py rename to flax/protocols/timelord_protocol.py index 282bb09bf..fdc539406 100644 --- a/chia/protocols/timelord_protocol.py +++ b/flax/protocols/timelord_protocol.py @@ -1,14 +1,14 @@ from dataclasses import dataclass from typing import List, Optional, Tuple -from chia.types.blockchain_format.foliage import Foliage -from chia.types.blockchain_format.reward_chain_block import RewardChainBlock, RewardChainBlockUnfinished -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.blockchain_format.sub_epoch_summary import SubEpochSummary -from chia.types.blockchain_format.vdf import VDFInfo, VDFProof -from chia.types.end_of_slot_bundle import EndOfSubSlotBundle -from chia.util.ints import uint8, uint32, uint64, uint128 -from chia.util.streamable import Streamable, streamable +from flax.types.blockchain_format.foliage import Foliage +from flax.types.blockchain_format.reward_chain_block import RewardChainBlock, RewardChainBlockUnfinished +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.blockchain_format.sub_epoch_summary import SubEpochSummary +from flax.types.blockchain_format.vdf import VDFInfo, VDFProof +from flax.types.end_of_slot_bundle import EndOfSubSlotBundle +from flax.util.ints import uint8, uint32, uint64, uint128 +from flax.util.streamable import Streamable, streamable """ Protocol between timelord and full node. diff --git a/chia/protocols/wallet_protocol.py b/flax/protocols/wallet_protocol.py similarity index 88% rename from chia/protocols/wallet_protocol.py rename to flax/protocols/wallet_protocol.py index 829bbd0a5..77b5ade5a 100644 --- a/chia/protocols/wallet_protocol.py +++ b/flax/protocols/wallet_protocol.py @@ -1,13 +1,13 @@ from dataclasses import dataclass from typing import List, Optional, Tuple -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.program import Program -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.header_block import HeaderBlock -from chia.types.spend_bundle import SpendBundle -from chia.util.ints import uint8, uint32, uint128 -from chia.util.streamable import Streamable, streamable +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.program import Program +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.header_block import HeaderBlock +from flax.types.spend_bundle import SpendBundle +from flax.util.ints import uint8, uint32, uint128 +from flax.util.streamable import Streamable, streamable """ Protocol between wallet (SPV node) and full node. diff --git a/chia/pyinstaller.spec b/flax/pyinstaller.spec similarity index 76% rename from chia/pyinstaller.spec rename to flax/pyinstaller.spec index 8027e25e7..2b7e12851 100644 --- a/chia/pyinstaller.spec +++ b/flax/pyinstaller.spec @@ -9,15 +9,15 @@ from PyInstaller.utils.hooks import collect_submodules, copy_metadata THIS_IS_WINDOWS = platform.system().lower().startswith("win") -ROOT = pathlib.Path(importlib.import_module("chia").__file__).absolute().parent.parent +ROOT = pathlib.Path(importlib.import_module("flax").__file__).absolute().parent.parent def solve_name_collision_problem(analysis): """ - There is a collision between the `chia` file name (which is the executable) - and the `chia` directory, which contains non-code resources like `english.txt`. + There is a collision between the `flax` file name (which is the executable) + and the `flax` directory, which contains non-code resources like `english.txt`. We move all the resources in the zipped area so there is no - need to create the `chia` directory, since the names collide. + need to create the `flax` directory, since the names collide. Fetching data now requires going into a zip file, so it will be slower. It's best if files that are used frequently are cached. @@ -31,7 +31,7 @@ def solve_name_collision_problem(analysis): zipped = [] datas = [] for data in analysis.datas: - if str(data[0]).startswith("chia/"): + if str(data[0]).startswith("flax/"): zipped.append(data) else: datas.append(data) @@ -48,7 +48,7 @@ keyring_imports = collect_submodules("keyring.backends") # keyring uses entrypoints to read keyring.backends from metadata file entry_points.txt. keyring_datas = copy_metadata("keyring")[0] -version_data = copy_metadata(get_distribution("chia-blockchain"))[0] +version_data = copy_metadata(get_distribution("flax-blockchain"))[0] block_cipher = None @@ -61,9 +61,9 @@ SERVERS = [ "timelord", ] -# TODO: collapse all these entry points into one `chia_exec` entrypoint that accepts the server as a parameter +# TODO: collapse all these entry points into one `flax_exec` entrypoint that accepts the server as a parameter -entry_points = ["chia.cmds.chia"] + [f"chia.server.start_{s}" for s in SERVERS] +entry_points = ["flax.cmds.flax"] + [f"flax.server.start_{s}" for s in SERVERS] hiddenimports = [] hiddenimports.extend(entry_points) @@ -77,10 +77,10 @@ if THIS_IS_WINDOWS: # this probably isn't necessary if THIS_IS_WINDOWS: - entry_points.extend(["aiohttp", "chia.util.bip39"]) + entry_points.extend(["aiohttp", "flax.util.bip39"]) if THIS_IS_WINDOWS: - chia_mod = importlib.import_module("chia") + flax_mod = importlib.import_module("flax") dll_paths = ROOT / "*.dll" binaries = [ @@ -101,10 +101,10 @@ if THIS_IS_WINDOWS: datas = [] -datas.append((f"{ROOT}/chia/util/english.txt", "chia/util")) -datas.append((f"{ROOT}/chia/util/initial-config.yaml", "chia/util")) -datas.append((f"{ROOT}/chia/wallet/puzzles/*.hex", "chia/wallet/puzzles")) -datas.append((f"{ROOT}/chia/ssl/*", "chia/ssl")) +datas.append((f"{ROOT}/flax/util/english.txt", "flax/util")) +datas.append((f"{ROOT}/flax/util/initial-config.yaml", "flax/util")) +datas.append((f"{ROOT}/flax/wallet/puzzles/*.hex", "flax/wallet/puzzles")) +datas.append((f"{ROOT}/flax/ssl/*", "flax/ssl")) datas.append((f"{ROOT}/mozilla-ca/*", "mozilla-ca")) datas.append(version_data) @@ -154,11 +154,11 @@ def add_binary(name, path_to_script, collect_args): COLLECT_ARGS = [] -add_binary("chia", f"{ROOT}/chia/cmds/chia.py", COLLECT_ARGS) -add_binary("daemon", f"{ROOT}/chia/daemon/server.py", COLLECT_ARGS) +add_binary("flax", f"{ROOT}/flax/cmds/flax.py", COLLECT_ARGS) +add_binary("daemon", f"{ROOT}/flax/daemon/server.py", COLLECT_ARGS) for server in SERVERS: - add_binary(f"start_{server}", f"{ROOT}/chia/server/start_{server}.py", COLLECT_ARGS) + add_binary(f"start_{server}", f"{ROOT}/flax/server/start_{server}.py", COLLECT_ARGS) COLLECT_KWARGS = dict( strip=False, diff --git a/chia/rpc/__init__.py b/flax/rpc/__init__.py similarity index 100% rename from chia/rpc/__init__.py rename to flax/rpc/__init__.py diff --git a/chia/rpc/farmer_rpc_api.py b/flax/rpc/farmer_rpc_api.py similarity index 95% rename from chia/rpc/farmer_rpc_api.py rename to flax/rpc/farmer_rpc_api.py index 697854a22..702560cee 100644 --- a/chia/rpc/farmer_rpc_api.py +++ b/flax/rpc/farmer_rpc_api.py @@ -1,14 +1,14 @@ from typing import Callable, Dict, List -from chia.farmer.farmer import Farmer -from chia.util.byte_types import hexstr_to_bytes -from chia.util.ws_message import WsRpcMessage, create_payload_dict +from flax.farmer.farmer import Farmer +from flax.util.byte_types import hexstr_to_bytes +from flax.util.ws_message import WsRpcMessage, create_payload_dict class FarmerRpcApi: def __init__(self, farmer: Farmer): self.service = farmer - self.service_name = "chia_farmer" + self.service_name = "flax_farmer" def get_routes(self) -> Dict[str, Callable]: return { diff --git a/chia/rpc/farmer_rpc_client.py b/flax/rpc/farmer_rpc_client.py similarity index 89% rename from chia/rpc/farmer_rpc_client.py rename to flax/rpc/farmer_rpc_client.py index 82f0cfb47..5c3ff26c5 100644 --- a/chia/rpc/farmer_rpc_client.py +++ b/flax/rpc/farmer_rpc_client.py @@ -1,14 +1,14 @@ from typing import Dict, List, Optional -from chia.rpc.rpc_client import RpcClient -from chia.types.blockchain_format.sized_bytes import bytes32 +from flax.rpc.rpc_client import RpcClient +from flax.types.blockchain_format.sized_bytes import bytes32 class FarmerRpcClient(RpcClient): """ - Client to Chia RPC, connects to a local farmer. Uses HTTP/JSON, and converts back from + Client to Flax RPC, connects to a local farmer. Uses HTTP/JSON, and converts back from JSON into native python objects before returning. All api calls use POST requests. - Note that this is not the same as the peer protocol, or wallet protocol (which run Chia's + Note that this is not the same as the peer protocol, or wallet protocol (which run Flax's protocol on top of TCP), it's a separate protocol on top of HTTP that provides easy access to the full node. """ diff --git a/chia/rpc/full_node_rpc_api.py b/flax/rpc/full_node_rpc_api.py similarity index 96% rename from chia/rpc/full_node_rpc_api.py rename to flax/rpc/full_node_rpc_api.py index 156062be9..7269fc22a 100644 --- a/chia/rpc/full_node_rpc_api.py +++ b/flax/rpc/full_node_rpc_api.py @@ -1,23 +1,23 @@ from typing import Any, Callable, Dict, List, Optional -from chia.consensus.block_record import BlockRecord -from chia.consensus.pos_quality import UI_ACTUAL_SPACE_CONSTANT_FACTOR -from chia.full_node.full_node import FullNode -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.coin_record import CoinRecord -from chia.types.full_block import FullBlock -from chia.types.mempool_inclusion_status import MempoolInclusionStatus -from chia.types.spend_bundle import SpendBundle -from chia.types.unfinished_header_block import UnfinishedHeaderBlock -from chia.util.byte_types import hexstr_to_bytes -from chia.util.ints import uint32, uint64, uint128 -from chia.util.ws_message import WsRpcMessage, create_payload_dict +from flax.consensus.block_record import BlockRecord +from flax.consensus.pos_quality import UI_ACTUAL_SPACE_CONSTANT_FACTOR +from flax.full_node.full_node import FullNode +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.coin_record import CoinRecord +from flax.types.full_block import FullBlock +from flax.types.mempool_inclusion_status import MempoolInclusionStatus +from flax.types.spend_bundle import SpendBundle +from flax.types.unfinished_header_block import UnfinishedHeaderBlock +from flax.util.byte_types import hexstr_to_bytes +from flax.util.ints import uint32, uint64, uint128 +from flax.util.ws_message import WsRpcMessage, create_payload_dict class FullNodeRpcApi: def __init__(self, service: FullNode): self.service = service - self.service_name = "chia_full_node" + self.service_name = "flax_full_node" self.cached_blockchain_state: Optional[Dict] = None def get_routes(self) -> Dict[str, Callable]: diff --git a/chia/rpc/full_node_rpc_client.py b/flax/rpc/full_node_rpc_client.py similarity index 91% rename from chia/rpc/full_node_rpc_client.py rename to flax/rpc/full_node_rpc_client.py index b6cfde5bb..938e60c91 100644 --- a/chia/rpc/full_node_rpc_client.py +++ b/flax/rpc/full_node_rpc_client.py @@ -1,21 +1,21 @@ from typing import Dict, List, Optional, Tuple -from chia.consensus.block_record import BlockRecord -from chia.rpc.rpc_client import RpcClient -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.coin_record import CoinRecord -from chia.types.full_block import FullBlock -from chia.types.spend_bundle import SpendBundle -from chia.types.unfinished_header_block import UnfinishedHeaderBlock -from chia.util.byte_types import hexstr_to_bytes -from chia.util.ints import uint32, uint64 +from flax.consensus.block_record import BlockRecord +from flax.rpc.rpc_client import RpcClient +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.coin_record import CoinRecord +from flax.types.full_block import FullBlock +from flax.types.spend_bundle import SpendBundle +from flax.types.unfinished_header_block import UnfinishedHeaderBlock +from flax.util.byte_types import hexstr_to_bytes +from flax.util.ints import uint32, uint64 class FullNodeRpcClient(RpcClient): """ - Client to Chia RPC, connects to a local full node. Uses HTTP/JSON, and converts back from + Client to Flax RPC, connects to a local full node. Uses HTTP/JSON, and converts back from JSON into native python objects before returning. All api calls use POST requests. - Note that this is not the same as the peer protocol, or wallet protocol (which run Chia's + Note that this is not the same as the peer protocol, or wallet protocol (which run Flax's protocol on top of TCP), it's a separate protocol on top of HTTP thats provides easy access to the full node. """ diff --git a/chia/rpc/harvester_rpc_api.py b/flax/rpc/harvester_rpc_api.py similarity index 93% rename from chia/rpc/harvester_rpc_api.py rename to flax/rpc/harvester_rpc_api.py index c5027799f..da7defac2 100644 --- a/chia/rpc/harvester_rpc_api.py +++ b/flax/rpc/harvester_rpc_api.py @@ -1,13 +1,13 @@ from typing import Callable, Dict, List -from chia.harvester.harvester import Harvester -from chia.util.ws_message import WsRpcMessage, create_payload_dict +from flax.harvester.harvester import Harvester +from flax.util.ws_message import WsRpcMessage, create_payload_dict class HarvesterRpcApi: def __init__(self, harvester: Harvester): self.service = harvester - self.service_name = "chia_harvester" + self.service_name = "flax_harvester" def get_routes(self) -> Dict[str, Callable]: return { diff --git a/chia/rpc/harvester_rpc_client.py b/flax/rpc/harvester_rpc_client.py similarity index 89% rename from chia/rpc/harvester_rpc_client.py rename to flax/rpc/harvester_rpc_client.py index b5fa6a2ea..82c4729fc 100644 --- a/chia/rpc/harvester_rpc_client.py +++ b/flax/rpc/harvester_rpc_client.py @@ -1,13 +1,13 @@ from typing import Any, Dict, List -from chia.rpc.rpc_client import RpcClient +from flax.rpc.rpc_client import RpcClient class HarvesterRpcClient(RpcClient): """ - Client to Chia RPC, connects to a local harvester. Uses HTTP/JSON, and converts back from + Client to Flax RPC, connects to a local harvester. Uses HTTP/JSON, and converts back from JSON into native python objects before returning. All api calls use POST requests. - Note that this is not the same as the peer protocol, or wallet protocol (which run Chia's + Note that this is not the same as the peer protocol, or wallet protocol (which run Flax's protocol on top of TCP), it's a separate protocol on top of HTTP thats provides easy access to the full node. """ diff --git a/chia/rpc/rpc_client.py b/flax/rpc/rpc_client.py similarity index 87% rename from chia/rpc/rpc_client.py rename to flax/rpc/rpc_client.py index b8e5cc86f..a803f36ae 100644 --- a/chia/rpc/rpc_client.py +++ b/flax/rpc/rpc_client.py @@ -4,18 +4,18 @@ import aiohttp -from chia.server.server import ssl_context_for_client -from chia.server.ssl_context import private_ssl_ca_paths -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.byte_types import hexstr_to_bytes -from chia.util.ints import uint16 +from flax.server.server import ssl_context_for_client +from flax.server.ssl_context import private_ssl_ca_paths +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.byte_types import hexstr_to_bytes +from flax.util.ints import uint16 class RpcClient: """ - Client to Chia RPC, connects to a local service. Uses HTTP/JSON, and converts back from + Client to Flax RPC, connects to a local service. Uses HTTP/JSON, and converts back from JSON into native python objects before returning. All api calls use POST requests. - Note that this is not the same as the peer protocol, or wallet protocol (which run Chia's + Note that this is not the same as the peer protocol, or wallet protocol (which run Flax's protocol on top of TCP), it's a separate protocol on top of HTTP thats provides easy access to the full node. """ diff --git a/chia/rpc/rpc_server.py b/flax/rpc/rpc_server.py similarity index 97% rename from chia/rpc/rpc_server.py rename to flax/rpc/rpc_server.py index 978e3c84d..7cc782345 100644 --- a/chia/rpc/rpc_server.py +++ b/flax/rpc/rpc_server.py @@ -7,13 +7,13 @@ import aiohttp -from chia.server.outbound_message import NodeType -from chia.server.server import ssl_context_for_server -from chia.types.peer_info import PeerInfo -from chia.util.byte_types import hexstr_to_bytes -from chia.util.ints import uint16 -from chia.util.json_util import dict_to_json_str, obj_to_response -from chia.util.ws_message import create_payload, create_payload_dict, format_response, pong +from flax.server.outbound_message import NodeType +from flax.server.server import ssl_context_for_server +from flax.types.peer_info import PeerInfo +from flax.util.byte_types import hexstr_to_bytes +from flax.util.ints import uint16 +from flax.util.json_util import dict_to_json_str, obj_to_response +from flax.util.ws_message import create_payload, create_payload_dict, format_response, pong log = logging.getLogger(__name__) diff --git a/chia/rpc/wallet_rpc_api.py b/flax/rpc/wallet_rpc_api.py similarity index 96% rename from chia/rpc/wallet_rpc_api.py rename to flax/rpc/wallet_rpc_api.py index ff29accf4..badeb4f8d 100644 --- a/chia/rpc/wallet_rpc_api.py +++ b/flax/rpc/wallet_rpc_api.py @@ -7,30 +7,30 @@ from blspy import PrivateKey, G1Element -from chia.cmds.init_funcs import check_keys -from chia.consensus.block_rewards import calculate_base_farmer_reward -from chia.protocols.protocol_message_types import ProtocolMessageTypes -from chia.server.outbound_message import NodeType, make_msg -from chia.simulator.simulator_protocol import FarmNewBlockProtocol -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.bech32m import decode_puzzle_hash, encode_puzzle_hash -from chia.util.byte_types import hexstr_to_bytes -from chia.util.ints import uint32, uint64 -from chia.util.keychain import bytes_to_mnemonic, generate_mnemonic -from chia.util.path import path_from_root -from chia.util.ws_message import WsRpcMessage, create_payload_dict -from chia.wallet.cc_wallet.cc_wallet import CCWallet -from chia.wallet.rl_wallet.rl_wallet import RLWallet -from chia.wallet.did_wallet.did_wallet import DIDWallet -from chia.wallet.trade_record import TradeRecord -from chia.wallet.transaction_record import TransactionRecord -from chia.wallet.util.backup_utils import download_backup, get_backup_info, upload_backup -from chia.wallet.util.trade_utils import trade_record_to_dict -from chia.wallet.util.transaction_type import TransactionType -from chia.wallet.util.wallet_types import WalletType -from chia.wallet.wallet_info import WalletInfo -from chia.wallet.wallet_node import WalletNode +from flax.cmds.init_funcs import check_keys +from flax.consensus.block_rewards import calculate_base_farmer_reward +from flax.protocols.protocol_message_types import ProtocolMessageTypes +from flax.server.outbound_message import NodeType, make_msg +from flax.simulator.simulator_protocol import FarmNewBlockProtocol +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.bech32m import decode_puzzle_hash, encode_puzzle_hash +from flax.util.byte_types import hexstr_to_bytes +from flax.util.ints import uint32, uint64 +from flax.util.keychain import bytes_to_mnemonic, generate_mnemonic +from flax.util.path import path_from_root +from flax.util.ws_message import WsRpcMessage, create_payload_dict +from flax.wallet.cc_wallet.cc_wallet import CCWallet +from flax.wallet.rl_wallet.rl_wallet import RLWallet +from flax.wallet.did_wallet.did_wallet import DIDWallet +from flax.wallet.trade_record import TradeRecord +from flax.wallet.transaction_record import TransactionRecord +from flax.wallet.util.backup_utils import download_backup, get_backup_info, upload_backup +from flax.wallet.util.trade_utils import trade_record_to_dict +from flax.wallet.util.transaction_type import TransactionType +from flax.wallet.util.wallet_types import WalletType +from flax.wallet.wallet_info import WalletInfo +from flax.wallet.wallet_node import WalletNode # Timeout for response from wallet/full node for sending a transaction TIMEOUT = 30 @@ -42,7 +42,7 @@ class WalletRpcApi: def __init__(self, wallet_node: WalletNode): assert wallet_node is not None self.service = wallet_node - self.service_name = "chia_wallet" + self.service_name = "flax_wallet" def get_routes(self) -> Dict[str, Callable]: return { @@ -115,7 +115,7 @@ async def _state_changed(self, *args) -> List[WsRpcMessage]: data["wallet_id"] = args[1] if args[2] is not None: data["additional_data"] = args[2] - return [create_payload_dict("state_changed", data, "chia_wallet", "wallet_ui")] + return [create_payload_dict("state_changed", data, "flax_wallet", "wallet_ui")] async def _stop_wallet(self): """ diff --git a/chia/rpc/wallet_rpc_client.py b/flax/rpc/wallet_rpc_client.py similarity index 89% rename from chia/rpc/wallet_rpc_client.py rename to flax/rpc/wallet_rpc_client.py index 6b3e40ee6..c33be3168 100644 --- a/chia/rpc/wallet_rpc_client.py +++ b/flax/rpc/wallet_rpc_client.py @@ -1,19 +1,19 @@ from pathlib import Path from typing import Dict, List -from chia.rpc.rpc_client import RpcClient -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.bech32m import decode_puzzle_hash -from chia.util.ints import uint32, uint64 -from chia.wallet.transaction_record import TransactionRecord +from flax.rpc.rpc_client import RpcClient +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.bech32m import decode_puzzle_hash +from flax.util.ints import uint32, uint64 +from flax.wallet.transaction_record import TransactionRecord class WalletRpcClient(RpcClient): """ - Client to Chia RPC, connects to a local wallet. Uses HTTP/JSON, and converts back from + Client to Flax RPC, connects to a local wallet. Uses HTTP/JSON, and converts back from JSON into native python objects before returning. All api calls use POST requests. - Note that this is not the same as the peer protocol, or wallet protocol (which run Chia's + Note that this is not the same as the peer protocol, or wallet protocol (which run Flax's protocol on top of TCP), it's a separate protocol on top of HTTP thats provides easy access to the full node. """ @@ -23,7 +23,7 @@ async def log_in(self, fingerprint: int) -> Dict: try: return await self.fetch( "log_in", - {"host": "https://backup.chia.net", "fingerprint": fingerprint, "type": "start"}, + {"host": "https://backup.flaxnetwork.org", "fingerprint": fingerprint, "type": "start"}, ) except ValueError as e: @@ -34,7 +34,7 @@ async def log_in_and_restore(self, fingerprint: int, file_path) -> Dict: return await self.fetch( "log_in", { - "host": "https://backup.chia.net", + "host": "https://backup.flaxnetwork.org", "fingerprint": fingerprint, "type": "restore_backup", "file_path": file_path, @@ -47,7 +47,7 @@ async def log_in_and_skip(self, fingerprint: int) -> Dict: try: return await self.fetch( "log_in", - {"host": "https://backup.chia.net", "fingerprint": fingerprint, "type": "skip"}, + {"host": "https://backup.flaxnetwork.org", "fingerprint": fingerprint, "type": "skip"}, ) except ValueError as e: return e.args[0] diff --git a/chia/server/__init__.py b/flax/server/__init__.py similarity index 100% rename from chia/server/__init__.py rename to flax/server/__init__.py diff --git a/chia/server/address_manager.py b/flax/server/address_manager.py similarity index 99% rename from chia/server/address_manager.py rename to flax/server/address_manager.py index 26d7f3868..35ca81978 100644 --- a/chia/server/address_manager.py +++ b/flax/server/address_manager.py @@ -6,9 +6,9 @@ from secrets import randbits from typing import Dict, List, Optional, Set, Tuple -from chia.types.peer_info import PeerInfo, TimestampedPeerInfo -from chia.util.hash import std_hash -from chia.util.ints import uint16, uint64 +from flax.types.peer_info import PeerInfo, TimestampedPeerInfo +from flax.util.hash import std_hash +from flax.util.ints import uint16, uint64 TRIED_BUCKETS_PER_GROUP = 8 NEW_BUCKETS_PER_SOURCE_GROUP = 64 diff --git a/chia/server/address_manager_store.py b/flax/server/address_manager_store.py similarity index 99% rename from chia/server/address_manager_store.py rename to flax/server/address_manager_store.py index 0a4df161b..aa1ee35c3 100644 --- a/chia/server/address_manager_store.py +++ b/flax/server/address_manager_store.py @@ -3,7 +3,7 @@ import aiosqlite -from chia.server.address_manager import ( +from flax.server.address_manager import ( BUCKET_SIZE, NEW_BUCKET_COUNT, NEW_BUCKETS_PER_ADDRESS, diff --git a/chia/server/connection_utils.py b/flax/server/connection_utils.py similarity index 79% rename from chia/server/connection_utils.py rename to flax/server/connection_utils.py index 72cc7c843..83574a400 100644 --- a/chia/server/connection_utils.py +++ b/flax/server/connection_utils.py @@ -2,15 +2,15 @@ import random from typing import Any, List, Optional, Tuple -from chia.server.ws_connection import WSChiaConnection +from flax.server.ws_connection import WSFlaxConnection async def send_all_first_reply( - func: str, arg: Any, peers: List[WSChiaConnection], timeout=15 -) -> Optional[Tuple[Any, WSChiaConnection]]: + func: str, arg: Any, peers: List[WSFlaxConnection], timeout=15 +) -> Optional[Tuple[Any, WSFlaxConnection]]: """performs an API request to peers and returns the result of the first response and the peer that sent it.""" - async def do_func(peer_x: WSChiaConnection, func_x: str, arg_x: Any): + async def do_func(peer_x: WSFlaxConnection, func_x: str, arg_x: Any): method_to_call = getattr(peer_x, func_x) result_x = await method_to_call(arg_x) if result_x is not None: @@ -37,10 +37,10 @@ async def do_func(peer_x: WSChiaConnection, func_x: str, arg_x: Any): return None -async def send_to_random(func: str, arg: Any, peers: List[WSChiaConnection]) -> Optional[Tuple[Any, WSChiaConnection]]: +async def send_to_random(func: str, arg: Any, peers: List[WSFlaxConnection]) -> Optional[Tuple[Any, WSFlaxConnection]]: """performs an API request to peers and returns the result of the first response and the peer that sent it.""" - async def do_func(peer_x: WSChiaConnection, func_x: str, arg_x: Any): + async def do_func(peer_x: WSFlaxConnection, func_x: str, arg_x: Any): method_to_call = getattr(peer_x, func_x) result_x = await method_to_call(arg_x) if result_x is not None: diff --git a/chia/server/introducer_peers.py b/flax/server/introducer_peers.py similarity index 96% rename from chia/server/introducer_peers.py rename to flax/server/introducer_peers.py index 20743441d..08cf2d17b 100644 --- a/chia/server/introducer_peers.py +++ b/flax/server/introducer_peers.py @@ -3,8 +3,8 @@ from typing import Set, List, Optional from dataclasses import dataclass -from chia.types.peer_info import PeerInfo -from chia.util.ints import uint64, uint16 +from flax.types.peer_info import PeerInfo +from flax.util.ints import uint64, uint16 @dataclass(frozen=False) diff --git a/chia/server/node_discovery.py b/flax/server/node_discovery.py similarity index 97% rename from chia/server/node_discovery.py rename to flax/server/node_discovery.py index de3615ea3..15a3373e7 100644 --- a/chia/server/node_discovery.py +++ b/flax/server/node_discovery.py @@ -9,18 +9,18 @@ import aiosqlite -import chia.server.ws_connection as ws +import flax.server.ws_connection as ws import dns.asyncresolver -from chia.protocols import full_node_protocol, introducer_protocol -from chia.protocols.protocol_message_types import ProtocolMessageTypes -from chia.server.address_manager import AddressManager, ExtendedPeerInfo -from chia.server.address_manager_store import AddressManagerStore -from chia.server.outbound_message import NodeType, make_msg -from chia.server.server import ChiaServer -from chia.types.peer_info import PeerInfo, TimestampedPeerInfo -from chia.util.hash import std_hash -from chia.util.ints import uint64 -from chia.util.path import mkdir, path_from_root +from flax.protocols import full_node_protocol, introducer_protocol +from flax.protocols.protocol_message_types import ProtocolMessageTypes +from flax.server.address_manager import AddressManager, ExtendedPeerInfo +from flax.server.address_manager_store import AddressManagerStore +from flax.server.outbound_message import NodeType, make_msg +from flax.server.server import FlaxServer +from flax.types.peer_info import PeerInfo, TimestampedPeerInfo +from flax.util.hash import std_hash +from flax.util.ints import uint64 +from flax.util.path import mkdir, path_from_root MAX_PEERS_RECEIVED_PER_REQUEST = 1000 MAX_TOTAL_PEERS_RECEIVED = 3000 @@ -30,7 +30,7 @@ class FullNodeDiscovery: def __init__( self, - server: ChiaServer, + server: FlaxServer, root_path: Path, target_outbound_count: int, peer_db_path: str, @@ -39,7 +39,7 @@ def __init__( peer_connect_interval: int, log, ): - self.server: ChiaServer = server + self.server: FlaxServer = server self.message_queue: asyncio.Queue = asyncio.Queue() self.is_closed = False self.target_outbound_count = target_outbound_count @@ -100,7 +100,7 @@ def cancel_task_safe(self, task: Optional[asyncio.Task]): def add_message(self, message, data): self.message_queue.put_nowait((message, data)) - async def on_connect(self, peer: ws.WSChiaConnection): + async def on_connect(self, peer: ws.WSFlaxConnection): if ( peer.is_outbound is False and peer.peer_server_port is not None @@ -127,7 +127,7 @@ async def on_connect(self, peer: ws.WSChiaConnection): await peer.send_message(msg) # Updates timestamps each time we receive a message for outbound connections. - async def update_peer_timestamp_on_message(self, peer: ws.WSChiaConnection): + async def update_peer_timestamp_on_message(self, peer: ws.WSFlaxConnection): if ( peer.is_outbound and peer.peer_server_port is not None @@ -165,7 +165,7 @@ async def _introducer_client(self): if self.introducer_info is None: return None - async def on_connect(peer: ws.WSChiaConnection): + async def on_connect(peer: ws.WSFlaxConnection): msg = make_msg(ProtocolMessageTypes.request_peers_introducer, introducer_protocol.RequestPeersIntroducer()) await peer.send_message(msg) @@ -179,7 +179,7 @@ async def _query_dns(self, dns_address): peers.append( TimestampedPeerInfo( ip.to_text(), - 8444, + 6888, 0, ) ) diff --git a/chia/server/outbound_message.py b/flax/server/outbound_message.py similarity index 86% rename from chia/server/outbound_message.py rename to flax/server/outbound_message.py index 66861b413..30a183be3 100644 --- a/chia/server/outbound_message.py +++ b/flax/server/outbound_message.py @@ -2,9 +2,9 @@ from enum import IntEnum from typing import Any, Optional -from chia.protocols.protocol_message_types import ProtocolMessageTypes -from chia.util.ints import uint8, uint16 -from chia.util.streamable import Streamable, streamable +from flax.protocols.protocol_message_types import ProtocolMessageTypes +from flax.util.ints import uint8, uint16 +from flax.util.streamable import Streamable, streamable class NodeType(IntEnum): diff --git a/chia/server/rate_limits.py b/flax/server/rate_limits.py similarity index 98% rename from chia/server/rate_limits.py rename to flax/server/rate_limits.py index c0f7a7286..1b6041d41 100644 --- a/chia/server/rate_limits.py +++ b/flax/server/rate_limits.py @@ -4,8 +4,8 @@ from collections import Counter from typing import Optional -from chia.protocols.protocol_message_types import ProtocolMessageTypes -from chia.server.outbound_message import Message +from flax.protocols.protocol_message_types import ProtocolMessageTypes +from flax.server.outbound_message import Message log = logging.getLogger(__name__) diff --git a/chia/server/reconnect_task.py b/flax/server/reconnect_task.py similarity index 86% rename from chia/server/reconnect_task.py rename to flax/server/reconnect_task.py index df9b2b7b3..faef2bead 100644 --- a/chia/server/reconnect_task.py +++ b/flax/server/reconnect_task.py @@ -1,11 +1,11 @@ import asyncio import socket -from chia.server.server import ChiaServer -from chia.types.peer_info import PeerInfo +from flax.server.server import FlaxServer +from flax.types.peer_info import PeerInfo -def start_reconnect_task(server: ChiaServer, peer_info_arg: PeerInfo, log, auth: bool): +def start_reconnect_task(server: FlaxServer, peer_info_arg: PeerInfo, log, auth: bool): """ Start a background task that checks connection and reconnects periodically to a peer. """ diff --git a/chia/server/server.py b/flax/server/server.py similarity index 94% rename from chia/server/server.py rename to flax/server/server.py index 48aa5085c..fc97a329c 100644 --- a/chia/server/server.py +++ b/flax/server/server.py @@ -15,17 +15,17 @@ from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives import hashes, serialization -from chia.protocols.protocol_message_types import ProtocolMessageTypes -from chia.protocols.shared_protocol import protocol_version -from chia.server.introducer_peers import IntroducerPeers -from chia.server.outbound_message import Message, NodeType -from chia.server.ssl_context import private_ssl_paths, public_ssl_paths -from chia.server.ws_connection import WSChiaConnection -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.peer_info import PeerInfo -from chia.util.errors import Err, ProtocolError -from chia.util.ints import uint16 -from chia.util.network import is_localhost, is_in_network +from flax.protocols.protocol_message_types import ProtocolMessageTypes +from flax.protocols.shared_protocol import protocol_version +from flax.server.introducer_peers import IntroducerPeers +from flax.server.outbound_message import Message, NodeType +from flax.server.ssl_context import private_ssl_paths, public_ssl_paths +from flax.server.ws_connection import WSFlaxConnection +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.peer_info import PeerInfo +from flax.util.errors import Err, ProtocolError +from flax.util.ints import uint16 +from flax.util.network import is_localhost, is_in_network def ssl_context_for_server( @@ -58,7 +58,7 @@ def ssl_context_for_client( return ssl_context -class ChiaServer: +class FlaxServer: def __init__( self, port: int, @@ -72,16 +72,16 @@ def __init__( root_path: Path, config: Dict, private_ca_crt_key: Tuple[Path, Path], - chia_ca_crt_key: Tuple[Path, Path], + flax_ca_crt_key: Tuple[Path, Path], name: str = None, introducer_peers: Optional[IntroducerPeers] = None, ): # Keeps track of all connections to and from this node. logging.basicConfig(level=logging.DEBUG) - self.all_connections: Dict[bytes32, WSChiaConnection] = {} + self.all_connections: Dict[bytes32, WSFlaxConnection] = {} self.tasks: Set[asyncio.Task] = set() - self.connection_by_type: Dict[NodeType, Dict[bytes32, WSChiaConnection]] = { + self.connection_by_type: Dict[NodeType, Dict[bytes32, WSFlaxConnection]] = { NodeType.FULL_NODE: {}, NodeType.WALLET: {}, NodeType.HARVESTER: {}, @@ -125,7 +125,7 @@ def __init__( else: self.p2p_crt_path, self.p2p_key_path = None, None self.ca_private_crt_path, self.ca_private_key_path = private_ca_crt_key - self.chia_ca_crt_path, self.chia_ca_key_path = chia_ca_crt_key + self.flax_ca_crt_path, self.flax_ca_key_path = flax_ca_crt_key self.node_id = self.my_id() self.incoming_task = asyncio.create_task(self.incoming_api_task()) @@ -169,7 +169,7 @@ async def garbage_collect_connections_task(self) -> None: """ while True: await asyncio.sleep(600) - to_remove: List[WSChiaConnection] = [] + to_remove: List[WSFlaxConnection] = [] for connection in self.all_connections.values(): if self._local_type == NodeType.FULL_NODE and connection.connection_type == NodeType.FULL_NODE: if time.time() - connection.last_message_time > 1800: @@ -206,7 +206,7 @@ async def start_server(self, on_connect: Callable = None): else: self.p2p_crt_path, self.p2p_key_path = public_ssl_paths(self.root_path, self.config) ssl_context = ssl_context_for_server( - self.chia_ca_crt_path, self.chia_ca_key_path, self.p2p_crt_path, self.p2p_key_path + self.flax_ca_crt_path, self.flax_ca_key_path, self.p2p_crt_path, self.p2p_key_path ) self.site = web.TCPSite( @@ -230,9 +230,9 @@ async def incoming_connection(self, request): peer_id = bytes32(der_cert.fingerprint(hashes.SHA256())) if peer_id == self.node_id: return ws - connection: Optional[WSChiaConnection] = None + connection: Optional[WSFlaxConnection] = None try: - connection = WSChiaConnection( + connection = WSFlaxConnection( self._local_type, ws, self._port, @@ -291,7 +291,7 @@ async def incoming_connection(self, request): await close_event.wait() return ws - async def connection_added(self, connection: WSChiaConnection, on_connect=None): + async def connection_added(self, connection: WSFlaxConnection, on_connect=None): # If we already had a connection to this peer_id, close the old one. This is secure because peer_ids are based # on TLS public keys if connection.peer_node_id in self.all_connections: @@ -340,10 +340,10 @@ async def start_client( ) else: ssl_context = ssl_context_for_client( - self.chia_ca_crt_path, self.chia_ca_key_path, self.p2p_crt_path, self.p2p_key_path + self.flax_ca_crt_path, self.flax_ca_key_path, self.p2p_crt_path, self.p2p_key_path ) session = None - connection: Optional[WSChiaConnection] = None + connection: Optional[WSFlaxConnection] = None try: timeout = ClientTimeout(total=30) session = ClientSession(timeout=timeout) @@ -377,7 +377,7 @@ async def start_client( if peer_id == self.node_id: raise RuntimeError(f"Trying to connect to a peer ({target_node}) with the same peer_id: {peer_id}") - connection = WSChiaConnection( + connection = WSFlaxConnection( self._local_type, ws, self._port, @@ -435,7 +435,7 @@ async def start_client( return False - def connection_closed(self, connection: WSChiaConnection, ban_time: int): + def connection_closed(self, connection: WSFlaxConnection, ban_time: int): if is_localhost(connection.peer_host) and ban_time != 0: self.log.warning(f"Trying to ban localhost for {ban_time}, but will not ban") ban_time = 0 @@ -484,7 +484,7 @@ async def incoming_api_task(self) -> None: if payload_inc is None or connection_inc is None: continue - async def api_call(full_message: Message, connection: WSChiaConnection, task_id): + async def api_call(full_message: Message, connection: WSFlaxConnection, task_id): start_time = time.time() try: if self.received_message_callback is not None: @@ -571,7 +571,7 @@ async def send_to_others( self, messages: List[Message], node_type: NodeType, - origin_peer: WSChiaConnection, + origin_peer: WSFlaxConnection, ): for node_id, connection in self.all_connections.items(): if node_id == origin_peer.peer_node_id: @@ -598,7 +598,7 @@ async def send_to_specific(self, messages: List[Message], node_id: bytes32): for message in messages: await connection.send_message(message) - def get_outgoing_connections(self) -> List[WSChiaConnection]: + def get_outgoing_connections(self) -> List[WSFlaxConnection]: result = [] for _, connection in self.all_connections.items(): if connection.is_outbound: @@ -606,7 +606,7 @@ def get_outgoing_connections(self) -> List[WSChiaConnection]: return result - def get_full_node_outgoing_connections(self) -> List[WSChiaConnection]: + def get_full_node_outgoing_connections(self) -> List[WSFlaxConnection]: result = [] connections = self.get_full_node_connections() for connection in connections: @@ -614,10 +614,10 @@ def get_full_node_outgoing_connections(self) -> List[WSChiaConnection]: result.append(connection) return result - def get_full_node_connections(self) -> List[WSChiaConnection]: + def get_full_node_connections(self) -> List[WSFlaxConnection]: return list(self.connection_by_type[NodeType.FULL_NODE].values()) - def get_connections(self) -> List[WSChiaConnection]: + def get_connections(self) -> List[WSFlaxConnection]: result = [] for _, connection in self.all_connections.items(): result.append(connection) @@ -689,7 +689,7 @@ def accept_inbound_connections(self, node_type: NodeType) -> bool: return inbound_count < self.config["max_inbound_timelord"] return True - def is_trusted_peer(self, peer: WSChiaConnection, trusted_peers: Dict) -> bool: + def is_trusted_peer(self, peer: WSFlaxConnection, trusted_peers: Dict) -> bool: if trusted_peers is None: return False for trusted_peer in trusted_peers: diff --git a/chia/server/ssl_context.py b/flax/server/ssl_context.py similarity index 80% rename from chia/server/ssl_context.py rename to flax/server/ssl_context.py index 282b79659..0846dca40 100644 --- a/chia/server/ssl_context.py +++ b/flax/server/ssl_context.py @@ -23,8 +23,8 @@ def private_ssl_ca_paths(path: Path, config: Dict): ) -def chia_ssl_ca_paths(path: Path, config: Dict): +def flax_ssl_ca_paths(path: Path, config: Dict): return ( - path / config["chia_ssl_ca"]["crt"], - path / config["chia_ssl_ca"]["key"], + path / config["flax_ssl_ca"]["crt"], + path / config["flax_ssl_ca"]["key"], ) diff --git a/chia/server/start_farmer.py b/flax/server/start_farmer.py similarity index 76% rename from chia/server/start_farmer.py rename to flax/server/start_farmer.py index ce18237b2..b64ea6021 100644 --- a/chia/server/start_farmer.py +++ b/flax/server/start_farmer.py @@ -1,17 +1,17 @@ import pathlib from typing import Dict -from chia.consensus.constants import ConsensusConstants -from chia.consensus.default_constants import DEFAULT_CONSTANTS -from chia.farmer.farmer import Farmer -from chia.farmer.farmer_api import FarmerAPI -from chia.rpc.farmer_rpc_api import FarmerRpcApi -from chia.server.outbound_message import NodeType -from chia.server.start_service import run_service -from chia.types.peer_info import PeerInfo -from chia.util.config import load_config_cli -from chia.util.default_root import DEFAULT_ROOT_PATH -from chia.util.keychain import Keychain +from flax.consensus.constants import ConsensusConstants +from flax.consensus.default_constants import DEFAULT_CONSTANTS +from flax.farmer.farmer import Farmer +from flax.farmer.farmer_api import FarmerAPI +from flax.rpc.farmer_rpc_api import FarmerRpcApi +from flax.server.outbound_message import NodeType +from flax.server.start_service import run_service +from flax.types.peer_info import PeerInfo +from flax.util.config import load_config_cli +from flax.util.default_root import DEFAULT_ROOT_PATH +from flax.util.keychain import Keychain # See: https://bugs.python.org/issue29288 "".encode("idna") diff --git a/chia/server/start_full_node.py b/flax/server/start_full_node.py similarity index 77% rename from chia/server/start_full_node.py rename to flax/server/start_full_node.py index 1c409e915..3c0b849bb 100644 --- a/chia/server/start_full_node.py +++ b/flax/server/start_full_node.py @@ -3,15 +3,15 @@ from multiprocessing import freeze_support from typing import Dict -from chia.consensus.constants import ConsensusConstants -from chia.consensus.default_constants import DEFAULT_CONSTANTS -from chia.full_node.full_node import FullNode -from chia.full_node.full_node_api import FullNodeAPI -from chia.rpc.full_node_rpc_api import FullNodeRpcApi -from chia.server.outbound_message import NodeType -from chia.server.start_service import run_service -from chia.util.config import load_config_cli -from chia.util.default_root import DEFAULT_ROOT_PATH +from flax.consensus.constants import ConsensusConstants +from flax.consensus.default_constants import DEFAULT_CONSTANTS +from flax.full_node.full_node import FullNode +from flax.full_node.full_node_api import FullNodeAPI +from flax.rpc.full_node_rpc_api import FullNodeRpcApi +from flax.server.outbound_message import NodeType +from flax.server.start_service import run_service +from flax.util.config import load_config_cli +from flax.util.default_root import DEFAULT_ROOT_PATH # See: https://bugs.python.org/issue29288 "".encode("idna") diff --git a/chia/server/start_harvester.py b/flax/server/start_harvester.py similarity index 73% rename from chia/server/start_harvester.py rename to flax/server/start_harvester.py index d98edc199..7a584bdf3 100644 --- a/chia/server/start_harvester.py +++ b/flax/server/start_harvester.py @@ -1,16 +1,16 @@ import pathlib from typing import Dict -from chia.consensus.constants import ConsensusConstants -from chia.consensus.default_constants import DEFAULT_CONSTANTS -from chia.harvester.harvester import Harvester -from chia.harvester.harvester_api import HarvesterAPI -from chia.rpc.harvester_rpc_api import HarvesterRpcApi -from chia.server.outbound_message import NodeType -from chia.server.start_service import run_service -from chia.types.peer_info import PeerInfo -from chia.util.config import load_config_cli -from chia.util.default_root import DEFAULT_ROOT_PATH +from flax.consensus.constants import ConsensusConstants +from flax.consensus.default_constants import DEFAULT_CONSTANTS +from flax.harvester.harvester import Harvester +from flax.harvester.harvester_api import HarvesterAPI +from flax.rpc.harvester_rpc_api import HarvesterRpcApi +from flax.server.outbound_message import NodeType +from flax.server.start_service import run_service +from flax.types.peer_info import PeerInfo +from flax.util.config import load_config_cli +from flax.util.default_root import DEFAULT_ROOT_PATH # See: https://bugs.python.org/issue29288 "".encode("idna") diff --git a/chia/server/start_introducer.py b/flax/server/start_introducer.py similarity index 75% rename from chia/server/start_introducer.py rename to flax/server/start_introducer.py index 4156c54fb..be2bda924 100644 --- a/chia/server/start_introducer.py +++ b/flax/server/start_introducer.py @@ -1,12 +1,12 @@ import pathlib from typing import Dict -from chia.introducer.introducer import Introducer -from chia.introducer.introducer_api import IntroducerAPI -from chia.server.outbound_message import NodeType -from chia.server.start_service import run_service -from chia.util.config import load_config_cli -from chia.util.default_root import DEFAULT_ROOT_PATH +from flax.introducer.introducer import Introducer +from flax.introducer.introducer_api import IntroducerAPI +from flax.server.outbound_message import NodeType +from flax.server.start_service import run_service +from flax.util.config import load_config_cli +from flax.util.default_root import DEFAULT_ROOT_PATH # See: https://bugs.python.org/issue29288 "".encode("idna") diff --git a/chia/server/start_service.py b/flax/server/start_service.py similarity index 90% rename from chia/server/start_service.py rename to flax/server/start_service.py index de9835963..d5c5607c3 100644 --- a/chia/server/start_service.py +++ b/flax/server/start_service.py @@ -5,22 +5,22 @@ from sys import platform from typing import Any, Callable, List, Optional, Tuple -from chia.server.ssl_context import chia_ssl_ca_paths, private_ssl_ca_paths +from flax.server.ssl_context import flax_ssl_ca_paths, private_ssl_ca_paths try: import uvloop except ImportError: uvloop = None -from chia.rpc.rpc_server import start_rpc_server -from chia.server.outbound_message import NodeType -from chia.server.server import ChiaServer -from chia.server.upnp import UPnP -from chia.types.peer_info import PeerInfo -from chia.util.chia_logging import initialize_logging -from chia.util.config import load_config, load_config_cli -from chia.util.setproctitle import setproctitle -from chia.util.ints import uint16 +from flax.rpc.rpc_server import start_rpc_server +from flax.server.outbound_message import NodeType +from flax.server.server import FlaxServer +from flax.server.upnp import UPnP +from flax.types.peer_info import PeerInfo +from flax.util.flax_logging import initialize_logging +from flax.util.config import load_config, load_config_cli +from flax.util.setproctitle import setproctitle +from flax.util.ints import uint16 from .reconnect_task import start_reconnect_task @@ -57,7 +57,7 @@ def __init__( self._rpc_close_task: Optional[asyncio.Task] = None self._network_id: str = network_id - proctitle_name = f"chia_{service_name}" + proctitle_name = f"flax_{service_name}" setproctitle(proctitle_name) self._log = logging.getLogger(service_name) @@ -69,11 +69,11 @@ def __init__( self._rpc_info = rpc_info private_ca_crt, private_ca_key = private_ssl_ca_paths(root_path, self.config) - chia_ca_crt, chia_ca_key = chia_ssl_ca_paths(root_path, self.config) + flax_ca_crt, flax_ca_key = flax_ssl_ca_paths(root_path, self.config) inbound_rlp = self.config.get("inbound_rate_limit_percent") outbound_rlp = self.config.get("outbound_rate_limit_percent") assert inbound_rlp and outbound_rlp - self._server = ChiaServer( + self._server = FlaxServer( advertised_port, node, peer_api, @@ -85,7 +85,7 @@ def __init__( root_path, service_config, (private_ca_crt, private_ca_key), - (chia_ca_crt, chia_ca_key), + (flax_ca_crt, flax_ca_key), name=f"{service_name}_server", ) f = getattr(node, "set_server", None) @@ -202,7 +202,7 @@ async def wait_closed(self) -> None: self._log.info("Waiting for socket to be closed (if opened)") - self._log.info("Waiting for ChiaServer to be closed") + self._log.info("Waiting for FlaxServer to be closed") await self._server.await_closed() if self._rpc_close_task: diff --git a/chia/server/start_timelord.py b/flax/server/start_timelord.py similarity index 74% rename from chia/server/start_timelord.py rename to flax/server/start_timelord.py index 53596c696..527c381d3 100644 --- a/chia/server/start_timelord.py +++ b/flax/server/start_timelord.py @@ -2,15 +2,15 @@ import pathlib from typing import Dict -from chia.consensus.constants import ConsensusConstants -from chia.consensus.default_constants import DEFAULT_CONSTANTS -from chia.server.outbound_message import NodeType -from chia.server.start_service import run_service -from chia.timelord.timelord import Timelord -from chia.timelord.timelord_api import TimelordAPI -from chia.types.peer_info import PeerInfo -from chia.util.config import load_config_cli -from chia.util.default_root import DEFAULT_ROOT_PATH +from flax.consensus.constants import ConsensusConstants +from flax.consensus.default_constants import DEFAULT_CONSTANTS +from flax.server.outbound_message import NodeType +from flax.server.start_service import run_service +from flax.timelord.timelord import Timelord +from flax.timelord.timelord_api import TimelordAPI +from flax.types.peer_info import PeerInfo +from flax.util.config import load_config_cli +from flax.util.default_root import DEFAULT_ROOT_PATH # See: https://bugs.python.org/issue29288 "".encode("idna") diff --git a/chia/server/start_wallet.py b/flax/server/start_wallet.py similarity index 80% rename from chia/server/start_wallet.py rename to flax/server/start_wallet.py index ac602f74a..68700148d 100644 --- a/chia/server/start_wallet.py +++ b/flax/server/start_wallet.py @@ -2,20 +2,20 @@ from multiprocessing import freeze_support from typing import Dict -from chia.consensus.constants import ConsensusConstants -from chia.consensus.default_constants import DEFAULT_CONSTANTS -from chia.rpc.wallet_rpc_api import WalletRpcApi -from chia.server.outbound_message import NodeType -from chia.server.start_service import run_service -from chia.types.peer_info import PeerInfo -from chia.util.block_tools import test_constants -from chia.util.config import load_config_cli, load_config -from chia.util.default_root import DEFAULT_ROOT_PATH -from chia.util.keychain import Keychain -from chia.wallet.wallet_node import WalletNode +from flax.consensus.constants import ConsensusConstants +from flax.consensus.default_constants import DEFAULT_CONSTANTS +from flax.rpc.wallet_rpc_api import WalletRpcApi +from flax.server.outbound_message import NodeType +from flax.server.start_service import run_service +from flax.types.peer_info import PeerInfo +from flax.util.block_tools import test_constants +from flax.util.config import load_config_cli, load_config +from flax.util.default_root import DEFAULT_ROOT_PATH +from flax.util.keychain import Keychain +from flax.wallet.wallet_node import WalletNode # See: https://bugs.python.org/issue29288 -from chia.wallet.wallet_node_api import WalletNodeAPI +from flax.wallet.wallet_node_api import WalletNodeAPI "".encode("idna") diff --git a/chia/server/upnp.py b/flax/server/upnp.py similarity index 92% rename from chia/server/upnp.py rename to flax/server/upnp.py index 5661670e3..459f81957 100644 --- a/chia/server/upnp.py +++ b/flax/server/upnp.py @@ -28,7 +28,7 @@ def run(): port = msg[1] log.info(f"Attempting to enable UPnP (open up port {port})") self.upnp.deleteportmapping(port, "TCP") - self.upnp.addportmapping(port, "TCP", self.upnp.lanaddr, port, "chia", "") + self.upnp.addportmapping(port, "TCP", self.upnp.lanaddr, port, "flax", "") log.info( f"Port {port} opened with UPnP. lanaddr {self.upnp.lanaddr} " f"external: {self.upnp.externalipaddress()}" @@ -41,7 +41,7 @@ def run(): keep_going = False except Exception as e: log.info( - "UPnP failed. This is not required to run chia, it allows incoming connections from other peers." + "UPnP failed. This is not required to run flax, it allows incoming connections from other peers." ) log.info(e) diff --git a/chia/server/ws_connection.py b/flax/server/ws_connection.py similarity index 95% rename from chia/server/ws_connection.py rename to flax/server/ws_connection.py index 481165202..1133fb7cd 100644 --- a/chia/server/ws_connection.py +++ b/flax/server/ws_connection.py @@ -6,24 +6,24 @@ from aiohttp import WSCloseCode, WSMessage, WSMsgType -from chia.cmds.init_funcs import chia_full_version_str -from chia.protocols.protocol_message_types import ProtocolMessageTypes -from chia.protocols.shared_protocol import Capability, Handshake -from chia.server.outbound_message import Message, NodeType, make_msg -from chia.server.rate_limits import RateLimiter -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.peer_info import PeerInfo -from chia.util.errors import Err, ProtocolError -from chia.util.ints import uint8, uint16 +from flax.cmds.init_funcs import flax_full_version_str +from flax.protocols.protocol_message_types import ProtocolMessageTypes +from flax.protocols.shared_protocol import Capability, Handshake +from flax.server.outbound_message import Message, NodeType, make_msg +from flax.server.rate_limits import RateLimiter +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.peer_info import PeerInfo +from flax.util.errors import Err, ProtocolError +from flax.util.ints import uint8, uint16 # Each message is prepended with LENGTH_BYTES bytes specifying the length -from chia.util.network import class_for_type, is_localhost +from flax.util.network import class_for_type, is_localhost # Max size 2^(8*4) which is around 4GiB LENGTH_BYTES: int = 4 -class WSChiaConnection: +class WSFlaxConnection: """ Represents a connection to another node. Local host and port are ours, while peer host and port are the host and port of the peer that we are connected to. Node_id and connection_type are @@ -69,7 +69,7 @@ def __init__( self.is_outbound = is_outbound self.is_feeler = is_feeler - # ChiaConnection metrics + # FlaxConnection metrics self.creation_time = time.time() self.bytes_read = 0 self.bytes_written = 0 @@ -108,9 +108,9 @@ async def perform_handshake(self, network_id: str, protocol_version: str, server outbound_handshake = make_msg( ProtocolMessageTypes.handshake, Handshake( - network_id, + 'flax-' + network_id, protocol_version, - chia_full_version_str(), + flax_full_version_str(), uint16(server_port), uint8(local_type.value), [(uint16(Capability.BASE.value), "1")], @@ -124,7 +124,7 @@ async def perform_handshake(self, network_id: str, protocol_version: str, server inbound_handshake = Handshake.from_bytes(inbound_handshake_msg.data) if ProtocolMessageTypes(inbound_handshake_msg.type) != ProtocolMessageTypes.handshake: raise ProtocolError(Err.INVALID_HANDSHAKE) - if inbound_handshake.network_id != network_id: + if inbound_handshake.network_id != 'flax-' + network_id: raise ProtocolError(Err.INCOMPATIBLE_NETWORK_ID) self.peer_server_port = inbound_handshake.server_port @@ -141,14 +141,14 @@ async def perform_handshake(self, network_id: str, protocol_version: str, server inbound_handshake = Handshake.from_bytes(message.data) if ProtocolMessageTypes(message.type) != ProtocolMessageTypes.handshake: raise ProtocolError(Err.INVALID_HANDSHAKE) - if inbound_handshake.network_id != network_id: + if inbound_handshake.network_id != 'flax-' + network_id: raise ProtocolError(Err.INCOMPATIBLE_NETWORK_ID) outbound_handshake = make_msg( ProtocolMessageTypes.handshake, Handshake( - network_id, + 'flax-' + network_id, protocol_version, - chia_full_version_str(), + flax_full_version_str(), uint16(server_port), uint8(local_type.value), [(uint16(Capability.BASE.value), "1")], diff --git a/chia/simulator/__init__.py b/flax/simulator/__init__.py similarity index 100% rename from chia/simulator/__init__.py rename to flax/simulator/__init__.py diff --git a/chia/simulator/full_node_simulator.py b/flax/simulator/full_node_simulator.py similarity index 93% rename from chia/simulator/full_node_simulator.py rename to flax/simulator/full_node_simulator.py index be6a7353c..42a304879 100644 --- a/chia/simulator/full_node_simulator.py +++ b/flax/simulator/full_node_simulator.py @@ -1,12 +1,12 @@ from typing import List, Optional -from chia.consensus.block_record import BlockRecord -from chia.full_node.full_node_api import FullNodeAPI -from chia.protocols.full_node_protocol import RespondBlock -from chia.simulator.simulator_protocol import FarmNewBlockProtocol, ReorgProtocol -from chia.types.full_block import FullBlock -from chia.util.api_decorators import api_request -from chia.util.ints import uint8 +from flax.consensus.block_record import BlockRecord +from flax.full_node.full_node_api import FullNodeAPI +from flax.protocols.full_node_protocol import RespondBlock +from flax.simulator.simulator_protocol import FarmNewBlockProtocol, ReorgProtocol +from flax.types.full_block import FullBlock +from flax.util.api_decorators import api_request +from flax.util.ints import uint8 class FullNodeSimulator(FullNodeAPI): diff --git a/chia/simulator/simulator_constants.py b/flax/simulator/simulator_constants.py similarity index 65% rename from chia/simulator/simulator_constants.py rename to flax/simulator/simulator_constants.py index d77a47a98..aa84ab5d6 100644 --- a/chia/simulator/simulator_constants.py +++ b/flax/simulator/simulator_constants.py @@ -1,6 +1,6 @@ if __name__ == "__main__": - from chia.util.block_tools import BlockTools, test_constants - from chia.util.default_root import DEFAULT_ROOT_PATH + from flax.util.block_tools import BlockTools, test_constants + from flax.util.default_root import DEFAULT_ROOT_PATH # TODO: mariano: fix this with new consensus bt = BlockTools(root_path=DEFAULT_ROOT_PATH) diff --git a/chia/simulator/simulator_protocol.py b/flax/simulator/simulator_protocol.py similarity index 64% rename from chia/simulator/simulator_protocol.py rename to flax/simulator/simulator_protocol.py index f512ab04c..66422b2b2 100644 --- a/chia/simulator/simulator_protocol.py +++ b/flax/simulator/simulator_protocol.py @@ -1,8 +1,8 @@ from dataclasses import dataclass -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.ints import uint32 -from chia.util.streamable import Streamable, streamable +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.ints import uint32 +from flax.util.streamable import Streamable, streamable @dataclass(frozen=True) diff --git a/chia/simulator/start_simulator.py b/flax/simulator/start_simulator.py similarity index 80% rename from chia/simulator/start_simulator.py rename to flax/simulator/start_simulator.py index 286865a25..7a6b1d66f 100644 --- a/chia/simulator/start_simulator.py +++ b/flax/simulator/start_simulator.py @@ -2,14 +2,14 @@ from pathlib import Path from typing import Dict -from chia.full_node.full_node import FullNode -from chia.rpc.full_node_rpc_api import FullNodeRpcApi -from chia.server.outbound_message import NodeType -from chia.server.start_service import run_service -from chia.util.block_tools import BlockTools, test_constants -from chia.util.config import load_config_cli -from chia.util.default_root import DEFAULT_ROOT_PATH -from chia.util.path import mkdir, path_from_root +from flax.full_node.full_node import FullNode +from flax.rpc.full_node_rpc_api import FullNodeRpcApi +from flax.server.outbound_message import NodeType +from flax.server.start_service import run_service +from flax.util.block_tools import BlockTools, test_constants +from flax.util.config import load_config_cli +from flax.util.default_root import DEFAULT_ROOT_PATH +from flax.util.path import mkdir, path_from_root from .full_node_simulator import FullNodeSimulator diff --git a/chia/ssl/create_ssl.py b/flax/ssl/create_ssl.py similarity index 84% rename from chia/ssl/create_ssl.py rename to flax/ssl/create_ssl.py index 31f1b2c7a..f5d134d0c 100644 --- a/chia/ssl/create_ssl.py +++ b/flax/ssl/create_ssl.py @@ -11,9 +11,9 @@ from cryptography.x509.oid import NameOID -def get_chia_ca_crt_key() -> Tuple[Any, Any]: - crt = pkg_resources.resource_string(__name__, "chia_ca.crt") - key = pkg_resources.resource_string(__name__, "chia_ca.key") +def get_flax_ca_crt_key() -> Tuple[Any, Any]: + crt = pkg_resources.resource_string(__name__, "flax_ca.crt") + key = pkg_resources.resource_string(__name__, "flax_ca.key") return crt, key @@ -30,8 +30,8 @@ def generate_ca_signed_cert(ca_crt: bytes, ca_key: bytes, cert_out: Path, key_ou cert_key = rsa.generate_private_key(public_exponent=65537, key_size=2048, backend=default_backend()) new_subject = x509.Name( [ - x509.NameAttribute(NameOID.COMMON_NAME, "Chia"), - x509.NameAttribute(NameOID.ORGANIZATION_NAME, "Chia"), + x509.NameAttribute(NameOID.COMMON_NAME, "Flax"), + x509.NameAttribute(NameOID.ORGANIZATION_NAME, "Flax"), x509.NameAttribute(NameOID.ORGANIZATIONAL_UNIT_NAME, "Organic Farming Division"), ] ) @@ -45,7 +45,7 @@ def generate_ca_signed_cert(ca_crt: bytes, ca_key: bytes, cert_out: Path, key_ou .not_valid_before(datetime.datetime.today() - one_day) .not_valid_after(datetime.datetime(2100, 8, 2)) .add_extension( - x509.SubjectAlternativeName([x509.DNSName("chia.net")]), + x509.SubjectAlternativeName([x509.DNSName("flaxnetwork.org")]), critical=False, ) .sign(root_key, hashes.SHA256(), default_backend()) @@ -66,8 +66,8 @@ def make_ca_cert(cert_path: Path, key_path: Path): root_key = rsa.generate_private_key(public_exponent=65537, key_size=2048, backend=default_backend()) subject = issuer = x509.Name( [ - x509.NameAttribute(NameOID.ORGANIZATION_NAME, "Chia"), - x509.NameAttribute(NameOID.COMMON_NAME, "Chia CA"), + x509.NameAttribute(NameOID.ORGANIZATION_NAME, "Flax"), + x509.NameAttribute(NameOID.COMMON_NAME, "Flax CA"), x509.NameAttribute(NameOID.ORGANIZATIONAL_UNIT_NAME, "Organic Farming Division"), ] ) @@ -99,7 +99,7 @@ def make_ca_cert(cert_path: Path, key_path: Path): def main(): - return make_ca_cert(Path("./chia_ca.crt"), Path("./chia_ca.key")) + return make_ca_cert(Path("./flax_ca.crt"), Path("./flax_ca.key")) if __name__ == "__main__": diff --git a/chia/ssl/dst_root_ca.pem b/flax/ssl/dst_root_ca.pem similarity index 100% rename from chia/ssl/dst_root_ca.pem rename to flax/ssl/dst_root_ca.pem diff --git a/flax/ssl/flax_ca.crt b/flax/ssl/flax_ca.crt new file mode 100644 index 000000000..c0c4f7f4c --- /dev/null +++ b/flax/ssl/flax_ca.crt @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDKTCCAhGgAwIBAgIUNgtAPGy+jcZhwAivtrGUIkIQ89EwDQYJKoZIhvcNAQEL +BQAwRDENMAsGA1UECgwERmxheDEQMA4GA1UEAwwHRmxheCBDQTEhMB8GA1UECwwY +T3JnYW5pYyBGYXJtaW5nIERpdmlzaW9uMB4XDTIxMDYxNTEwMDE0NloXDTMxMDYx +MzEwMDE0NlowRDENMAsGA1UECgwERmxheDEQMA4GA1UEAwwHRmxheCBDQTEhMB8G +A1UECwwYT3JnYW5pYyBGYXJtaW5nIERpdmlzaW9uMIIBIjANBgkqhkiG9w0BAQEF +AAOCAQ8AMIIBCgKCAQEAmqcnpRQBo8bcIF35HuwcuuLEtOVTEM+ZW8kWy6SWyBIG +jd10AuldbSPgXoN6Gez/vVWXWpJkc5pGc4KgdMtSUalaQutJglqMEKz0B+0MLpiR +pBY7vE0aPuRAsIdtnjzrEzkeiw4GdfjBa2IOz+aheJReXlQgAxiR0lEhj7fHqCQY +gQ7TZnCnQ+rMKH5c72RYzbSitC614rqa1pgDheHSnZAF0Z6AByZCExCcz3EC0hJI +Az8ln2HVGt3xurb8JmZGRlxZtU4ei3ZIyYjKfE2ApFQkZ8NR8IMbBgODvuL+c7kH +2rDfM4mgix+1tRAYJsh/9YjXYgv/hjjXgh7WrkyA7QIDAQABoxMwETAPBgNVHRMB +Af8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQBZGE0C3YSWWZ/wxYCeZU+tgjGM +pvUxrdKZmnuf8ErK048U1y+AD4a5LwcJIcwiIL/S5EKHAbL2C+kMrUzGYI3eAqNt +fMcFvh/izpENUa86X0zLiW0H55zKCLK1CynI0uJ+JbpfuIDQkU+fLtSXhAMvu1Ow +P+F3umj1RzVVhDAYWfq5yuainceyYAZVex2B++K/L6FGP+Sp6erEamKIwbTJ6Lvb +B/GS927CXVmi/fmKDs8CvuREJB7VB70PW1ZapsBx/NKmCYEjvCr46aE3VhF2/8wp +fk4F/oveThwsZwyV2kqmx7EEFLYZrZtCGG0IX4hyqYBDEZ8m0pNoqZIM2lzv +-----END CERTIFICATE----- diff --git a/flax/ssl/flax_ca.key b/flax/ssl/flax_ca.key new file mode 100644 index 000000000..4a54a5c75 --- /dev/null +++ b/flax/ssl/flax_ca.key @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEowIBAAKCAQEAmqcnpRQBo8bcIF35HuwcuuLEtOVTEM+ZW8kWy6SWyBIGjd10 +AuldbSPgXoN6Gez/vVWXWpJkc5pGc4KgdMtSUalaQutJglqMEKz0B+0MLpiRpBY7 +vE0aPuRAsIdtnjzrEzkeiw4GdfjBa2IOz+aheJReXlQgAxiR0lEhj7fHqCQYgQ7T +ZnCnQ+rMKH5c72RYzbSitC614rqa1pgDheHSnZAF0Z6AByZCExCcz3EC0hJIAz8l +n2HVGt3xurb8JmZGRlxZtU4ei3ZIyYjKfE2ApFQkZ8NR8IMbBgODvuL+c7kH2rDf +M4mgix+1tRAYJsh/9YjXYgv/hjjXgh7WrkyA7QIDAQABAoIBACroa6hyZ44QE2zr +hb3dlo8Hcboa0jQc1RjRLwDrNmZmEel0YsaYBrLMPGkco1jkF4RpZefcLACi8h8E +RA6DhuBfU0qzyx5ejvPleINmcnXPIMFc5c/1uG1wmL4hpPk9P5+CvoWoK4S5srhf +aWqnO2+gApq7TnJtc6/dkKk2PS/Z/YLrVm2dbGtR7gblKJhUPouY/r0YEh6nnuH6 +q0/iQFXFRnuzI+ucOYDAyQ+SMCZRQ5VeE0XPUKVYJQb2V2EMUTndJ+dI1TxFJIgw +wB2fA4IiJsNdYlSl5xrQtGpbUoiM5FND3CC/NsjKgDrsIbiMy1eLdmMhN1lbqJjj +EZSd56ECgYEAyXcDA5Ah9CJw4OlQcJN34ZQG7rDilahwAKsXL7M6lJVXgD4eiQ9Q +pYxt3zn5R79UggkRWTI1dFBZ50dKrlKd9PkI0xIDcfXdjOoH0RZQ0tuimFqHubyC +dHN3yNuU95rIzwyT3wMU0AS2DN4m8JGBrTYn6+15k+N0oUCX1U0XT/kCgYEAxIQy +yr2901G0zo5biFk1bOEgp3eX4edI57khjNeoUsUyHLrFkB+36sOCdbgc4eHTIfmm +ETC5O6CI72OtbdZvApVV3cf8Sd/bxGZ53CahG02XP7GMNzY84m019P3OKXvXapKO +X8N+UxSQs1YnBeysH69b/jblpjX2ks3fVLt53ZUCgYAzem+Qt4GVij9hmPxu55+Y +SmTDFPuw1gtYgF86Vwe+87IaGMVgrEMlKg7hHUUvKhqD56FBM20pPWbbjAHvLTkj +YYb5t/6dXf+whBRfPt6EIo8Xcvp/YUXMT7zp3AHiivCIx2P5diYZSTrjath0XBnQ +kqf8xv9r5JDmq0SgwkQUsQKBgQCCXLwg+Du7umD6AT/BNISXZMS3s0MjDb20UoBq +IQm9VqlGm7PBRvlHmEir9OXcBmV8DVNX5f2LC5SrUXFUAsMDcLNUe3zmOMVeBSjj +nRCUvyUNkKdWXPmIry/zBIdFx6yAOxaNem8LiAHxpb4fVQBdyIN7IUm4t+WJP17e +o7tU/QKBgBZ+ejP5SWtjtzFLMbAAgKlBp/f/ErUb7omrsyCL3e/tzveDgLorUunk +0211k7+VvueLich7grUOXjvpL30gem9HD4rpnNH3R6l3HtL3AA0/ZjUNIDvuB12y +Kzs0SeTE4Nj3k5vTexoR4WXoIy6l0leIq4rAIym1WWtC6SR8VJRg +-----END RSA PRIVATE KEY----- diff --git a/chia/timelord/__init__.py b/flax/timelord/__init__.py similarity index 100% rename from chia/timelord/__init__.py rename to flax/timelord/__init__.py diff --git a/chia/timelord/iters_from_block.py b/flax/timelord/iters_from_block.py similarity index 85% rename from chia/timelord/iters_from_block.py rename to flax/timelord/iters_from_block.py index 2cca5394c..f05f99fee 100644 --- a/chia/timelord/iters_from_block.py +++ b/flax/timelord/iters_from_block.py @@ -1,9 +1,9 @@ from typing import Optional, Tuple, Union -from chia.consensus.pot_iterations import calculate_ip_iters, calculate_iterations_quality, calculate_sp_iters -from chia.types.blockchain_format.reward_chain_block import RewardChainBlock, RewardChainBlockUnfinished -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.ints import uint64 +from flax.consensus.pot_iterations import calculate_ip_iters, calculate_iterations_quality, calculate_sp_iters +from flax.types.blockchain_format.reward_chain_block import RewardChainBlock, RewardChainBlockUnfinished +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.ints import uint64 def iters_from_block( diff --git a/chia/timelord/timelord.py b/flax/timelord/timelord.py similarity index 97% rename from chia/timelord/timelord.py rename to flax/timelord/timelord.py index 266450dc4..94950ee25 100644 --- a/chia/timelord/timelord.py +++ b/flax/timelord/timelord.py @@ -9,28 +9,28 @@ from chiavdf import create_discriminant -from chia.consensus.constants import ConsensusConstants -from chia.consensus.pot_iterations import calculate_sp_iters, is_overflow_block -from chia.protocols import timelord_protocol -from chia.protocols.protocol_message_types import ProtocolMessageTypes -from chia.server.outbound_message import NodeType, make_msg -from chia.server.server import ChiaServer -from chia.timelord.iters_from_block import iters_from_block -from chia.timelord.timelord_state import LastState -from chia.timelord.types import Chain, IterationType, StateType -from chia.types.blockchain_format.classgroup import ClassgroupElement -from chia.types.blockchain_format.reward_chain_block import RewardChainBlock -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.blockchain_format.slots import ( +from flax.consensus.constants import ConsensusConstants +from flax.consensus.pot_iterations import calculate_sp_iters, is_overflow_block +from flax.protocols import timelord_protocol +from flax.protocols.protocol_message_types import ProtocolMessageTypes +from flax.server.outbound_message import NodeType, make_msg +from flax.server.server import FlaxServer +from flax.timelord.iters_from_block import iters_from_block +from flax.timelord.timelord_state import LastState +from flax.timelord.types import Chain, IterationType, StateType +from flax.types.blockchain_format.classgroup import ClassgroupElement +from flax.types.blockchain_format.reward_chain_block import RewardChainBlock +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.blockchain_format.slots import ( ChallengeChainSubSlot, InfusedChallengeChainSubSlot, RewardChainSubSlot, SubSlotProofs, ) -from chia.types.blockchain_format.sub_epoch_summary import SubEpochSummary -from chia.types.blockchain_format.vdf import VDFInfo, VDFProof -from chia.types.end_of_slot_bundle import EndOfSubSlotBundle -from chia.util.ints import uint8, uint32, uint64, uint128 +from flax.types.blockchain_format.sub_epoch_summary import SubEpochSummary +from flax.types.blockchain_format.vdf import VDFInfo, VDFProof +from flax.types.end_of_slot_bundle import EndOfSubSlotBundle +from flax.util.ints import uint8, uint32, uint64, uint128 log = logging.getLogger(__name__) @@ -44,7 +44,7 @@ def __init__(self, root_path, config: Dict, constants: ConsensusConstants): self.free_clients: List[Tuple[str, asyncio.StreamReader, asyncio.StreamWriter]] = [] self.potential_free_clients: List = [] self.ip_whitelist = self.config["vdf_clients"]["ip"] - self.server: Optional[ChiaServer] = None + self.server: Optional[FlaxServer] = None self.chain_type_to_stream: Dict[Chain, Tuple[str, asyncio.StreamReader, asyncio.StreamWriter]] = {} self.chain_start_time: Dict = {} # Chains that currently don't have a vdf_client. @@ -116,7 +116,7 @@ def _close(self): async def _await_closed(self): pass - def set_server(self, server: ChiaServer): + def set_server(self, server: FlaxServer): self.server = server async def _handle_client(self, reader: asyncio.StreamReader, writer: asyncio.StreamWriter): diff --git a/chia/timelord/timelord_api.py b/flax/timelord/timelord_api.py similarity index 95% rename from chia/timelord/timelord_api.py rename to flax/timelord/timelord_api.py index ce93108cd..ffa5604da 100644 --- a/chia/timelord/timelord_api.py +++ b/flax/timelord/timelord_api.py @@ -1,10 +1,10 @@ import logging from typing import Callable, Optional -from chia.protocols import timelord_protocol -from chia.timelord.timelord import Chain, IterationType, Timelord, iters_from_block -from chia.util.api_decorators import api_request -from chia.util.ints import uint64 +from flax.protocols import timelord_protocol +from flax.timelord.timelord import Chain, IterationType, Timelord, iters_from_block +from flax.util.api_decorators import api_request +from flax.util.ints import uint64 log = logging.getLogger(__name__) diff --git a/chia/timelord/timelord_launcher.py b/flax/timelord/timelord_launcher.py similarity index 93% rename from chia/timelord/timelord_launcher.py rename to flax/timelord/timelord_launcher.py index 98279b1e7..863b5314c 100644 --- a/chia/timelord/timelord_launcher.py +++ b/flax/timelord/timelord_launcher.py @@ -8,10 +8,10 @@ import pkg_resources -from chia.util.chia_logging import initialize_logging -from chia.util.config import load_config -from chia.util.default_root import DEFAULT_ROOT_PATH -from chia.util.setproctitle import setproctitle +from flax.util.flax_logging import initialize_logging +from flax.util.config import load_config +from flax.util.default_root import DEFAULT_ROOT_PATH +from flax.util.setproctitle import setproctitle active_processes: List = [] stopped = False @@ -87,7 +87,7 @@ async def spawn_all_processes(config: Dict, net_config: Dict): def main(): root_path = DEFAULT_ROOT_PATH - setproctitle("chia_timelord_launcher") + setproctitle("flax_timelord_launcher") net_config = load_config(root_path, "config.yaml") config = net_config["timelord_launcher"] initialize_logging("TLauncher", config["logging"], root_path) diff --git a/chia/timelord/timelord_state.py b/flax/timelord/timelord_state.py similarity index 95% rename from chia/timelord/timelord_state.py rename to flax/timelord/timelord_state.py index bd94f81e1..4988576a9 100644 --- a/chia/timelord/timelord_state.py +++ b/flax/timelord/timelord_state.py @@ -1,16 +1,16 @@ import logging from typing import List, Optional, Tuple, Union -from chia.consensus.constants import ConsensusConstants -from chia.protocols import timelord_protocol -from chia.timelord.iters_from_block import iters_from_block -from chia.timelord.types import Chain, StateType -from chia.types.blockchain_format.classgroup import ClassgroupElement -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.blockchain_format.slots import ChallengeBlockInfo -from chia.types.blockchain_format.sub_epoch_summary import SubEpochSummary -from chia.types.end_of_slot_bundle import EndOfSubSlotBundle -from chia.util.ints import uint8, uint32, uint64, uint128 +from flax.consensus.constants import ConsensusConstants +from flax.protocols import timelord_protocol +from flax.timelord.iters_from_block import iters_from_block +from flax.timelord.types import Chain, StateType +from flax.types.blockchain_format.classgroup import ClassgroupElement +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.blockchain_format.slots import ChallengeBlockInfo +from flax.types.blockchain_format.sub_epoch_summary import SubEpochSummary +from flax.types.end_of_slot_bundle import EndOfSubSlotBundle +from flax.util.ints import uint8, uint32, uint64, uint128 log = logging.getLogger(__name__) diff --git a/chia/timelord/types.py b/flax/timelord/types.py similarity index 100% rename from chia/timelord/types.py rename to flax/timelord/types.py diff --git a/chia/types/__init__.py b/flax/types/__init__.py similarity index 100% rename from chia/types/__init__.py rename to flax/types/__init__.py diff --git a/chia/types/announcement.py b/flax/types/announcement.py similarity index 69% rename from chia/types/announcement.py rename to flax/types/announcement.py index 864d2e3c4..2abfe6b40 100644 --- a/chia/types/announcement.py +++ b/flax/types/announcement.py @@ -1,7 +1,7 @@ from dataclasses import dataclass -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.hash import std_hash +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.hash import std_hash @dataclass(frozen=True) diff --git a/chia/types/blockchain_format/__init__.py b/flax/types/blockchain_format/__init__.py similarity index 100% rename from chia/types/blockchain_format/__init__.py rename to flax/types/blockchain_format/__init__.py diff --git a/chia/types/blockchain_format/classgroup.py b/flax/types/blockchain_format/classgroup.py similarity index 84% rename from chia/types/blockchain_format/classgroup.py rename to flax/types/blockchain_format/classgroup.py index a3bf22ad9..f21f0f1c3 100644 --- a/chia/types/blockchain_format/classgroup.py +++ b/flax/types/blockchain_format/classgroup.py @@ -1,8 +1,8 @@ from dataclasses import dataclass -from chia.consensus.constants import ConsensusConstants -from chia.types.blockchain_format.sized_bytes import bytes100 -from chia.util.streamable import Streamable, streamable +from flax.consensus.constants import ConsensusConstants +from flax.types.blockchain_format.sized_bytes import bytes100 +from flax.util.streamable import Streamable, streamable @dataclass(frozen=True) diff --git a/chia/types/blockchain_format/coin.py b/flax/types/blockchain_format/coin.py similarity index 88% rename from chia/types/blockchain_format/coin.py rename to flax/types/blockchain_format/coin.py index 15c9c2292..ed0068916 100644 --- a/chia/types/blockchain_format/coin.py +++ b/flax/types/blockchain_format/coin.py @@ -1,11 +1,11 @@ from dataclasses import dataclass from typing import Any, List -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.clvm import int_to_bytes -from chia.util.hash import std_hash -from chia.util.ints import uint64 -from chia.util.streamable import Streamable, streamable +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.clvm import int_to_bytes +from flax.util.hash import std_hash +from flax.util.ints import uint64 +from flax.util.streamable import Streamable, streamable @dataclass(frozen=True) diff --git a/chia/types/blockchain_format/foliage.py b/flax/types/blockchain_format/foliage.py similarity index 88% rename from chia/types/blockchain_format/foliage.py rename to flax/types/blockchain_format/foliage.py index c3c2b5314..57c2948ff 100644 --- a/chia/types/blockchain_format/foliage.py +++ b/flax/types/blockchain_format/foliage.py @@ -3,11 +3,11 @@ from blspy import G2Element -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.pool_target import PoolTarget -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.ints import uint64 -from chia.util.streamable import Streamable, streamable +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.pool_target import PoolTarget +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.ints import uint64 +from flax.util.streamable import Streamable, streamable @dataclass(frozen=True) diff --git a/chia/types/blockchain_format/pool_target.py b/flax/types/blockchain_format/pool_target.py similarity index 56% rename from chia/types/blockchain_format/pool_target.py rename to flax/types/blockchain_format/pool_target.py index 57659c9f6..c3c230856 100644 --- a/chia/types/blockchain_format/pool_target.py +++ b/flax/types/blockchain_format/pool_target.py @@ -1,8 +1,8 @@ from dataclasses import dataclass -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.ints import uint32 -from chia.util.streamable import Streamable, streamable +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.ints import uint32 +from flax.util.streamable import Streamable, streamable @dataclass(frozen=True) diff --git a/chia/types/blockchain_format/program.py b/flax/types/blockchain_format/program.py similarity index 98% rename from chia/types/blockchain_format/program.py rename to flax/types/blockchain_format/program.py index b585c328c..e090731cc 100644 --- a/chia/types/blockchain_format/program.py +++ b/flax/types/blockchain_format/program.py @@ -10,8 +10,8 @@ from clvm_rs import STRICT_MODE, deserialize_and_run_program, serialized_length from clvm_tools.curry import curry, uncurry -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.hash import std_hash +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.hash import std_hash from .tree_hash import sha256_treehash diff --git a/chia/types/blockchain_format/proof_of_space.py b/flax/types/blockchain_format/proof_of_space.py similarity index 93% rename from chia/types/blockchain_format/proof_of_space.py rename to flax/types/blockchain_format/proof_of_space.py index ed90467d8..9948c5d6d 100644 --- a/chia/types/blockchain_format/proof_of_space.py +++ b/flax/types/blockchain_format/proof_of_space.py @@ -6,11 +6,11 @@ from blspy import G1Element from chiapos import Verifier -from chia.consensus.constants import ConsensusConstants -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.hash import std_hash -from chia.util.ints import uint8 -from chia.util.streamable import Streamable, streamable +from flax.consensus.constants import ConsensusConstants +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.hash import std_hash +from flax.util.ints import uint8 +from flax.util.streamable import Streamable, streamable log = logging.getLogger(__name__) diff --git a/chia/types/blockchain_format/reward_chain_block.py b/flax/types/blockchain_format/reward_chain_block.py similarity index 85% rename from chia/types/blockchain_format/reward_chain_block.py rename to flax/types/blockchain_format/reward_chain_block.py index 9bcb4bf59..608faea92 100644 --- a/chia/types/blockchain_format/reward_chain_block.py +++ b/flax/types/blockchain_format/reward_chain_block.py @@ -3,11 +3,11 @@ from blspy import G2Element -from chia.types.blockchain_format.proof_of_space import ProofOfSpace -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.blockchain_format.vdf import VDFInfo -from chia.util.ints import uint8, uint32, uint128 -from chia.util.streamable import Streamable, streamable +from flax.types.blockchain_format.proof_of_space import ProofOfSpace +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.blockchain_format.vdf import VDFInfo +from flax.util.ints import uint8, uint32, uint128 +from flax.util.streamable import Streamable, streamable @dataclass(frozen=True) diff --git a/chia/types/blockchain_format/sized_bytes.py b/flax/types/blockchain_format/sized_bytes.py similarity index 81% rename from chia/types/blockchain_format/sized_bytes.py rename to flax/types/blockchain_format/sized_bytes.py index 8ad5ac590..7d092b7fa 100644 --- a/chia/types/blockchain_format/sized_bytes.py +++ b/flax/types/blockchain_format/sized_bytes.py @@ -1,4 +1,4 @@ -from chia.util.byte_types import make_sized_bytes +from flax.util.byte_types import make_sized_bytes bytes4 = make_sized_bytes(4) bytes8 = make_sized_bytes(8) diff --git a/chia/types/blockchain_format/slots.py b/flax/types/blockchain_format/slots.py similarity index 84% rename from chia/types/blockchain_format/slots.py rename to flax/types/blockchain_format/slots.py index 0f55073f5..983c20977 100644 --- a/chia/types/blockchain_format/slots.py +++ b/flax/types/blockchain_format/slots.py @@ -3,11 +3,11 @@ from blspy import G2Element -from chia.types.blockchain_format.proof_of_space import ProofOfSpace -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.blockchain_format.vdf import VDFInfo, VDFProof -from chia.util.ints import uint8, uint64 -from chia.util.streamable import Streamable, streamable +from flax.types.blockchain_format.proof_of_space import ProofOfSpace +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.blockchain_format.vdf import VDFInfo, VDFProof +from flax.util.ints import uint8, uint64 +from flax.util.streamable import Streamable, streamable @dataclass(frozen=True) diff --git a/chia/types/blockchain_format/sub_epoch_summary.py b/flax/types/blockchain_format/sub_epoch_summary.py similarity index 75% rename from chia/types/blockchain_format/sub_epoch_summary.py rename to flax/types/blockchain_format/sub_epoch_summary.py index 419182374..ef1f85738 100644 --- a/chia/types/blockchain_format/sub_epoch_summary.py +++ b/flax/types/blockchain_format/sub_epoch_summary.py @@ -1,9 +1,9 @@ from dataclasses import dataclass from typing import Optional -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.ints import uint8, uint64 -from chia.util.streamable import Streamable, streamable +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.ints import uint8, uint64 +from flax.util.streamable import Streamable, streamable @dataclass(frozen=True) diff --git a/chia/types/blockchain_format/tree_hash.py b/flax/types/blockchain_format/tree_hash.py similarity index 94% rename from chia/types/blockchain_format/tree_hash.py rename to flax/types/blockchain_format/tree_hash.py index 5bd03db8b..b76d49da6 100644 --- a/chia/types/blockchain_format/tree_hash.py +++ b/flax/types/blockchain_format/tree_hash.py @@ -10,8 +10,8 @@ from clvm import CLVMObject -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.hash import std_hash +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.hash import std_hash def sha256_treehash(sexp: CLVMObject, precalculated: Optional[Set[bytes32]] = None) -> bytes32: diff --git a/chia/types/blockchain_format/vdf.py b/flax/types/blockchain_format/vdf.py similarity index 89% rename from chia/types/blockchain_format/vdf.py rename to flax/types/blockchain_format/vdf.py index 7d1d902da..61c662ad7 100644 --- a/chia/types/blockchain_format/vdf.py +++ b/flax/types/blockchain_format/vdf.py @@ -7,11 +7,11 @@ from chiavdf import create_discriminant, verify_n_wesolowski -from chia.consensus.constants import ConsensusConstants -from chia.types.blockchain_format.classgroup import ClassgroupElement -from chia.types.blockchain_format.sized_bytes import bytes32, bytes100 -from chia.util.ints import uint8, uint64 -from chia.util.streamable import Streamable, streamable +from flax.consensus.constants import ConsensusConstants +from flax.types.blockchain_format.classgroup import ClassgroupElement +from flax.types.blockchain_format.sized_bytes import bytes32, bytes100 +from flax.util.ints import uint8, uint64 +from flax.util.streamable import Streamable, streamable log = logging.getLogger(__name__) diff --git a/chia/types/coin_record.py b/flax/types/coin_record.py similarity index 70% rename from chia/types/coin_record.py rename to flax/types/coin_record.py index f4187ee4f..52605119b 100644 --- a/chia/types/coin_record.py +++ b/flax/types/coin_record.py @@ -1,9 +1,9 @@ from dataclasses import dataclass -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.ints import uint32, uint64 -from chia.util.streamable import Streamable, streamable +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.ints import uint32, uint64 +from flax.util.streamable import Streamable, streamable @dataclass(frozen=True) diff --git a/chia/types/coin_solution.py b/flax/types/coin_solution.py similarity index 73% rename from chia/types/coin_solution.py rename to flax/types/coin_solution.py index 1063957d1..2f9cfd01e 100644 --- a/chia/types/coin_solution.py +++ b/flax/types/coin_solution.py @@ -1,10 +1,10 @@ from dataclasses import dataclass from typing import List -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.program import SerializedProgram, INFINITE_COST -from chia.util.chain_utils import additions_for_solution -from chia.util.streamable import Streamable, streamable +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.program import SerializedProgram, INFINITE_COST +from flax.util.chain_utils import additions_for_solution +from flax.util.streamable import Streamable, streamable @dataclass(frozen=True) diff --git a/chia/types/condition_opcodes.py b/flax/types/condition_opcodes.py similarity index 96% rename from chia/types/condition_opcodes.py rename to flax/types/condition_opcodes.py index a926bbe6c..7be434610 100644 --- a/chia/types/condition_opcodes.py +++ b/flax/types/condition_opcodes.py @@ -2,7 +2,7 @@ from typing import Any -# See chia/wallet/puzzles/condition_codes.clvm +# See flax/wallet/puzzles/condition_codes.clvm class ConditionOpcode(bytes, enum.Enum): # UNKNOWN is ascii "0" UNKNOWN = bytes([48]) diff --git a/chia/types/condition_with_args.py b/flax/types/condition_with_args.py similarity index 75% rename from chia/types/condition_with_args.py rename to flax/types/condition_with_args.py index 2222baa3e..eb9564fca 100644 --- a/chia/types/condition_with_args.py +++ b/flax/types/condition_with_args.py @@ -1,8 +1,8 @@ from dataclasses import dataclass from typing import List -from chia.types.condition_opcodes import ConditionOpcode -from chia.util.streamable import Streamable, streamable +from flax.types.condition_opcodes import ConditionOpcode +from flax.util.streamable import Streamable, streamable @dataclass(frozen=True) diff --git a/chia/types/end_of_slot_bundle.py b/flax/types/end_of_slot_bundle.py similarity index 79% rename from chia/types/end_of_slot_bundle.py rename to flax/types/end_of_slot_bundle.py index 0e7292b61..b0786165e 100644 --- a/chia/types/end_of_slot_bundle.py +++ b/flax/types/end_of_slot_bundle.py @@ -1,13 +1,13 @@ from dataclasses import dataclass from typing import Optional -from chia.types.blockchain_format.slots import ( +from flax.types.blockchain_format.slots import ( ChallengeChainSubSlot, InfusedChallengeChainSubSlot, RewardChainSubSlot, SubSlotProofs, ) -from chia.util.streamable import Streamable, streamable +from flax.util.streamable import Streamable, streamable @dataclass(frozen=True) diff --git a/chia/types/full_block.py b/flax/types/full_block.py similarity index 86% rename from chia/types/full_block.py rename to flax/types/full_block.py index 0f4156cd6..8c6e30cc0 100644 --- a/chia/types/full_block.py +++ b/flax/types/full_block.py @@ -1,13 +1,13 @@ from dataclasses import dataclass from typing import List, Optional, Set -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.foliage import Foliage, FoliageTransactionBlock, TransactionsInfo -from chia.types.blockchain_format.program import SerializedProgram -from chia.types.blockchain_format.reward_chain_block import RewardChainBlock -from chia.types.blockchain_format.vdf import VDFProof -from chia.types.end_of_slot_bundle import EndOfSubSlotBundle -from chia.util.ints import uint32 -from chia.util.streamable import Streamable, streamable +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.foliage import Foliage, FoliageTransactionBlock, TransactionsInfo +from flax.types.blockchain_format.program import SerializedProgram +from flax.types.blockchain_format.reward_chain_block import RewardChainBlock +from flax.types.blockchain_format.vdf import VDFProof +from flax.types.end_of_slot_bundle import EndOfSubSlotBundle +from flax.util.ints import uint32 +from flax.util.streamable import Streamable, streamable @dataclass(frozen=True) diff --git a/chia/types/generator_types.py b/flax/types/generator_types.py similarity index 87% rename from chia/types/generator_types.py rename to flax/types/generator_types.py index 963e8d292..673feefcc 100644 --- a/chia/types/generator_types.py +++ b/flax/types/generator_types.py @@ -1,8 +1,8 @@ from dataclasses import dataclass from typing import List -from chia.types.blockchain_format.program import SerializedProgram -from chia.util.ints import uint32 -from chia.util.streamable import Streamable, streamable +from flax.types.blockchain_format.program import SerializedProgram +from flax.util.ints import uint32 +from flax.util.streamable import Streamable, streamable class GeneratorBlockCacheInterface: diff --git a/chia/types/header_block.py b/flax/types/header_block.py similarity index 86% rename from chia/types/header_block.py rename to flax/types/header_block.py index afc5c5a50..7e38c5317 100644 --- a/chia/types/header_block.py +++ b/flax/types/header_block.py @@ -1,11 +1,11 @@ from dataclasses import dataclass from typing import List, Optional -from chia.types.blockchain_format.foliage import Foliage, FoliageTransactionBlock, TransactionsInfo -from chia.types.blockchain_format.reward_chain_block import RewardChainBlock -from chia.types.blockchain_format.vdf import VDFProof -from chia.types.end_of_slot_bundle import EndOfSubSlotBundle -from chia.util.streamable import Streamable, streamable +from flax.types.blockchain_format.foliage import Foliage, FoliageTransactionBlock, TransactionsInfo +from flax.types.blockchain_format.reward_chain_block import RewardChainBlock +from flax.types.blockchain_format.vdf import VDFProof +from flax.types.end_of_slot_bundle import EndOfSubSlotBundle +from flax.util.streamable import Streamable, streamable @dataclass(frozen=True) diff --git a/chia/types/mempool_inclusion_status.py b/flax/types/mempool_inclusion_status.py similarity index 100% rename from chia/types/mempool_inclusion_status.py rename to flax/types/mempool_inclusion_status.py diff --git a/chia/types/mempool_item.py b/flax/types/mempool_item.py similarity index 62% rename from chia/types/mempool_item.py rename to flax/types/mempool_item.py index 9e89b86cc..c32cfa955 100644 --- a/chia/types/mempool_item.py +++ b/flax/types/mempool_item.py @@ -1,13 +1,13 @@ from dataclasses import dataclass from typing import List -from chia.consensus.cost_calculator import NPCResult -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.program import SerializedProgram -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.spend_bundle import SpendBundle -from chia.util.ints import uint64 -from chia.util.streamable import Streamable, streamable +from flax.consensus.cost_calculator import NPCResult +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.program import SerializedProgram +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.spend_bundle import SpendBundle +from flax.util.ints import uint64 +from flax.util.streamable import Streamable, streamable @dataclass(frozen=True) diff --git a/chia/types/name_puzzle_condition.py b/flax/types/name_puzzle_condition.py similarity index 65% rename from chia/types/name_puzzle_condition.py rename to flax/types/name_puzzle_condition.py index a7327cd30..a0b6a1299 100644 --- a/chia/types/name_puzzle_condition.py +++ b/flax/types/name_puzzle_condition.py @@ -1,10 +1,10 @@ from dataclasses import dataclass from typing import Dict, List, Tuple -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.condition_with_args import ConditionWithArgs -from chia.util.condition_tools import ConditionOpcode -from chia.util.streamable import Streamable, streamable +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.condition_with_args import ConditionWithArgs +from flax.util.condition_tools import ConditionOpcode +from flax.util.streamable import Streamable, streamable @dataclass(frozen=True) diff --git a/chia/types/peer_info.py b/flax/types/peer_info.py similarity index 94% rename from chia/types/peer_info.py rename to flax/types/peer_info.py index 4404b1fc8..635239638 100644 --- a/chia/types/peer_info.py +++ b/flax/types/peer_info.py @@ -2,8 +2,8 @@ from dataclasses import dataclass from typing import Optional, Union -from chia.util.ints import uint16, uint64 -from chia.util.streamable import Streamable, streamable +from flax.util.ints import uint16, uint64 +from flax.util.streamable import Streamable, streamable @dataclass(frozen=True) diff --git a/chia/types/spend_bundle.py b/flax/types/spend_bundle.py similarity index 92% rename from chia/types/spend_bundle.py rename to flax/types/spend_bundle.py index ad9e159c7..2afce55fa 100644 --- a/chia/types/spend_bundle.py +++ b/flax/types/spend_bundle.py @@ -3,9 +3,9 @@ from blspy import AugSchemeMPL, G2Element -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.streamable import Streamable, streamable +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.streamable import Streamable, streamable from .coin_solution import CoinSolution diff --git a/chia/types/unfinished_block.py b/flax/types/unfinished_block.py similarity index 78% rename from chia/types/unfinished_block.py rename to flax/types/unfinished_block.py index 491ab364f..bc7b9a85b 100644 --- a/chia/types/unfinished_block.py +++ b/flax/types/unfinished_block.py @@ -1,13 +1,13 @@ from dataclasses import dataclass from typing import List, Optional -from chia.types.blockchain_format.foliage import Foliage, FoliageTransactionBlock, TransactionsInfo -from chia.types.blockchain_format.program import SerializedProgram -from chia.types.blockchain_format.reward_chain_block import RewardChainBlockUnfinished -from chia.types.blockchain_format.vdf import VDFProof -from chia.types.end_of_slot_bundle import EndOfSubSlotBundle -from chia.util.ints import uint32 -from chia.util.streamable import Streamable, streamable +from flax.types.blockchain_format.foliage import Foliage, FoliageTransactionBlock, TransactionsInfo +from flax.types.blockchain_format.program import SerializedProgram +from flax.types.blockchain_format.reward_chain_block import RewardChainBlockUnfinished +from flax.types.blockchain_format.vdf import VDFProof +from flax.types.end_of_slot_bundle import EndOfSubSlotBundle +from flax.util.ints import uint32 +from flax.util.streamable import Streamable, streamable @dataclass(frozen=True) diff --git a/chia/types/unfinished_header_block.py b/flax/types/unfinished_header_block.py similarity index 78% rename from chia/types/unfinished_header_block.py rename to flax/types/unfinished_header_block.py index 39db047c1..c58abf3d3 100644 --- a/chia/types/unfinished_header_block.py +++ b/flax/types/unfinished_header_block.py @@ -1,11 +1,11 @@ from dataclasses import dataclass from typing import List, Optional -from chia.types.blockchain_format.foliage import Foliage, FoliageTransactionBlock -from chia.types.blockchain_format.reward_chain_block import RewardChainBlockUnfinished -from chia.types.blockchain_format.vdf import VDFProof -from chia.types.end_of_slot_bundle import EndOfSubSlotBundle -from chia.util.streamable import Streamable, streamable +from flax.types.blockchain_format.foliage import Foliage, FoliageTransactionBlock +from flax.types.blockchain_format.reward_chain_block import RewardChainBlockUnfinished +from flax.types.blockchain_format.vdf import VDFProof +from flax.types.end_of_slot_bundle import EndOfSubSlotBundle +from flax.util.streamable import Streamable, streamable @dataclass(frozen=True) diff --git a/chia/types/weight_proof.py b/flax/types/weight_proof.py similarity index 85% rename from chia/types/weight_proof.py rename to flax/types/weight_proof.py index bb958040e..339a50a8c 100644 --- a/chia/types/weight_proof.py +++ b/flax/types/weight_proof.py @@ -1,14 +1,14 @@ from dataclasses import dataclass from typing import List, Optional -from chia.types.blockchain_format.proof_of_space import ProofOfSpace -from chia.types.blockchain_format.reward_chain_block import RewardChainBlock -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.blockchain_format.vdf import VDFInfo, VDFProof -from chia.types.end_of_slot_bundle import EndOfSubSlotBundle -from chia.types.header_block import HeaderBlock -from chia.util.ints import uint8, uint32, uint64, uint128 -from chia.util.streamable import Streamable, streamable +from flax.types.blockchain_format.proof_of_space import ProofOfSpace +from flax.types.blockchain_format.reward_chain_block import RewardChainBlock +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.blockchain_format.vdf import VDFInfo, VDFProof +from flax.types.end_of_slot_bundle import EndOfSubSlotBundle +from flax.types.header_block import HeaderBlock +from flax.util.ints import uint8, uint32, uint64, uint128 +from flax.util.streamable import Streamable, streamable @dataclass(frozen=True) diff --git a/chia/util/__init__.py b/flax/util/__init__.py similarity index 100% rename from chia/util/__init__.py rename to flax/util/__init__.py diff --git a/chia/util/api_decorators.py b/flax/util/api_decorators.py similarity index 97% rename from chia/util/api_decorators.py rename to flax/util/api_decorators.py index 6311c7e8f..cc7f3eb49 100644 --- a/chia/util/api_decorators.py +++ b/flax/util/api_decorators.py @@ -2,7 +2,7 @@ import logging from inspect import signature -from chia.util.streamable import Streamable +from flax.util.streamable import Streamable log = logging.getLogger(__name__) diff --git a/chia/util/bech32m.py b/flax/util/bech32m.py similarity index 98% rename from chia/util/bech32m.py rename to flax/util/bech32m.py index 18a4cdc6c..0188600dc 100644 --- a/chia/util/bech32m.py +++ b/flax/util/bech32m.py @@ -24,7 +24,7 @@ """Reference implementation for Bech32m and segwit addresses.""" from typing import List, Optional, Tuple -from chia.types.blockchain_format.sized_bytes import bytes32 +from flax.types.blockchain_format.sized_bytes import bytes32 CHARSET = "qpzry9x8gf2tvdw0s3jn54khce6mua7l" diff --git a/chia/util/block_cache.py b/flax/util/block_cache.py similarity index 89% rename from chia/util/block_cache.py rename to flax/util/block_cache.py index d0a6b6421..bfde6f2fe 100644 --- a/chia/util/block_cache.py +++ b/flax/util/block_cache.py @@ -1,13 +1,13 @@ import logging from typing import Dict, List, Optional -from chia.consensus.block_record import BlockRecord -from chia.consensus.blockchain_interface import BlockchainInterface -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.blockchain_format.sub_epoch_summary import SubEpochSummary -from chia.types.header_block import HeaderBlock -from chia.types.weight_proof import SubEpochChallengeSegment, SubEpochSegments -from chia.util.ints import uint32 +from flax.consensus.block_record import BlockRecord +from flax.consensus.blockchain_interface import BlockchainInterface +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.blockchain_format.sub_epoch_summary import SubEpochSummary +from flax.types.header_block import HeaderBlock +from flax.types.weight_proof import SubEpochChallengeSegment, SubEpochSegments +from flax.util.ints import uint32 class BlockCache(BlockchainInterface): diff --git a/chia/util/block_tools.py b/flax/util/block_tools.py similarity index 96% rename from chia/util/block_tools.py rename to flax/util/block_tools.py index 950add364..aeac4580b 100644 --- a/chia/util/block_tools.py +++ b/flax/util/block_tools.py @@ -13,60 +13,60 @@ from blspy import AugSchemeMPL, G1Element, G2Element, PrivateKey -from chia.cmds.init_funcs import create_all_ssl, create_default_chia_config -from chia.full_node.bundle_tools import ( +from flax.cmds.init_funcs import create_all_ssl, create_default_flax_config +from flax.full_node.bundle_tools import ( best_solution_generator_from_template, detect_potential_template_generator, simple_solution_generator, ) -from chia.plotting.create_plots import create_plots -from chia.consensus.block_creation import create_unfinished_block, unfinished_block_to_full_block -from chia.consensus.block_record import BlockRecord -from chia.consensus.blockchain_interface import BlockchainInterface -from chia.consensus.coinbase import create_puzzlehash_for_pk -from chia.consensus.constants import ConsensusConstants -from chia.consensus.default_constants import DEFAULT_CONSTANTS -from chia.consensus.deficit import calculate_deficit -from chia.consensus.full_block_to_block_record import block_to_block_record -from chia.consensus.make_sub_epoch_summary import next_sub_epoch_summary -from chia.consensus.pot_iterations import ( +from flax.plotting.create_plots import create_plots +from flax.consensus.block_creation import create_unfinished_block, unfinished_block_to_full_block +from flax.consensus.block_record import BlockRecord +from flax.consensus.blockchain_interface import BlockchainInterface +from flax.consensus.coinbase import create_puzzlehash_for_pk +from flax.consensus.constants import ConsensusConstants +from flax.consensus.default_constants import DEFAULT_CONSTANTS +from flax.consensus.deficit import calculate_deficit +from flax.consensus.full_block_to_block_record import block_to_block_record +from flax.consensus.make_sub_epoch_summary import next_sub_epoch_summary +from flax.consensus.pot_iterations import ( calculate_ip_iters, calculate_iterations_quality, calculate_sp_interval_iters, calculate_sp_iters, is_overflow_block, ) -from chia.consensus.vdf_info_computation import get_signage_point_vdf_info -from chia.full_node.signage_point import SignagePoint -from chia.plotting.plot_tools import PlotInfo, load_plots, parse_plot_info -from chia.types.blockchain_format.classgroup import ClassgroupElement -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.pool_target import PoolTarget -from chia.types.blockchain_format.proof_of_space import ProofOfSpace -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.blockchain_format.slots import ( +from flax.consensus.vdf_info_computation import get_signage_point_vdf_info +from flax.full_node.signage_point import SignagePoint +from flax.plotting.plot_tools import PlotInfo, load_plots, parse_plot_info +from flax.types.blockchain_format.classgroup import ClassgroupElement +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.pool_target import PoolTarget +from flax.types.blockchain_format.proof_of_space import ProofOfSpace +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.blockchain_format.slots import ( ChallengeChainSubSlot, InfusedChallengeChainSubSlot, RewardChainSubSlot, SubSlotProofs, ) -from chia.types.blockchain_format.sub_epoch_summary import SubEpochSummary -from chia.types.blockchain_format.vdf import VDFInfo, VDFProof -from chia.types.end_of_slot_bundle import EndOfSubSlotBundle -from chia.types.full_block import FullBlock -from chia.types.generator_types import BlockGenerator, CompressorArg -from chia.types.spend_bundle import SpendBundle -from chia.types.unfinished_block import UnfinishedBlock -from chia.util.bech32m import encode_puzzle_hash -from chia.util.block_cache import BlockCache -from chia.util.config import load_config, save_config -from chia.util.hash import std_hash -from chia.util.ints import uint8, uint32, uint64, uint128 -from chia.util.keychain import Keychain, bytes_to_mnemonic -from chia.util.path import mkdir -from chia.util.vdf_prover import get_vdf_info_and_proof -from chia.util.wallet_tools import WalletTool -from chia.wallet.derive_keys import ( +from flax.types.blockchain_format.sub_epoch_summary import SubEpochSummary +from flax.types.blockchain_format.vdf import VDFInfo, VDFProof +from flax.types.end_of_slot_bundle import EndOfSubSlotBundle +from flax.types.full_block import FullBlock +from flax.types.generator_types import BlockGenerator, CompressorArg +from flax.types.spend_bundle import SpendBundle +from flax.types.unfinished_block import UnfinishedBlock +from flax.util.bech32m import encode_puzzle_hash +from flax.util.block_cache import BlockCache +from flax.util.config import load_config, save_config +from flax.util.hash import std_hash +from flax.util.ints import uint8, uint32, uint64, uint128 +from flax.util.keychain import Keychain, bytes_to_mnemonic +from flax.util.path import mkdir +from flax.util.vdf_prover import get_vdf_info_and_proof +from flax.util.wallet_tools import WalletTool +from flax.wallet.derive_keys import ( master_sk_to_farmer_sk, master_sk_to_local_sk, master_sk_to_pool_sk, @@ -118,7 +118,7 @@ def __init__( root_path = Path(self._tempdir.name) self.root_path = root_path - create_default_chia_config(root_path) + create_default_flax_config(root_path) self.keychain = Keychain("testing-1.8.0", True) self.keychain.delete_all_keys() self.farmer_master_sk_entropy = std_hash(b"block_tools farmer key") @@ -142,7 +142,7 @@ def __init__( farmer_pubkeys: List[G1Element] = [master_sk_to_farmer_sk(sk).get_g1() for sk in self.all_sks] if len(self.pool_pubkeys) == 0 or len(farmer_pubkeys) == 0: - raise RuntimeError("Keys not generated. Run `chia generate keys`") + raise RuntimeError("Keys not generated. Run `flax generate keys`") _, loaded_plots, _, _ = load_plots({}, {}, farmer_pubkeys, self.pool_pubkeys, None, False, root_path) self.plots: Dict[Path, PlotInfo] = loaded_plots @@ -207,7 +207,7 @@ def init_plots(self, root_path: Path): ) # Create more plots, but to a pool address instead of public key args.pool_public_key = None - args.pool_contract_address = encode_puzzle_hash(self.pool_ph, "xch") + args.pool_contract_address = encode_puzzle_hash(self.pool_ph, "xfx") args.num = num_pool_address_plots create_plots( args, @@ -1180,7 +1180,7 @@ def get_challenges( def get_plot_dir() -> Path: - cache_path = Path(os.path.expanduser(os.getenv("CHIA_ROOT", "~/.chia/"))) / "test-plots" + cache_path = Path(os.path.expanduser(os.getenv("FLAX_ROOT", "~/.flax/"))) / "test-plots" mkdir(cache_path) return cache_path diff --git a/chia/util/byte_types.py b/flax/util/byte_types.py similarity index 100% rename from chia/util/byte_types.py rename to flax/util/byte_types.py diff --git a/chia/util/chain_utils.py b/flax/util/chain_utils.py similarity index 71% rename from chia/util/chain_utils.py rename to flax/util/chain_utils.py index 156f77009..e2ad214ea 100644 --- a/chia/util/chain_utils.py +++ b/flax/util/chain_utils.py @@ -1,9 +1,9 @@ from typing import List -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.program import SerializedProgram -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.condition_tools import ( +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.program import SerializedProgram +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.condition_tools import ( conditions_dict_for_solution, created_outputs_for_conditions_dict, ) diff --git a/chia/util/clvm.py b/flax/util/clvm.py similarity index 100% rename from chia/util/clvm.py rename to flax/util/clvm.py diff --git a/chia/util/condition_tools.py b/flax/util/condition_tools.py similarity index 92% rename from chia/util/condition_tools.py rename to flax/util/condition_tools.py index c06f9b37e..11508e765 100644 --- a/chia/util/condition_tools.py +++ b/flax/util/condition_tools.py @@ -2,15 +2,15 @@ from blspy import G1Element -from chia.types.announcement import Announcement -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.program import Program, SerializedProgram -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.condition_opcodes import ConditionOpcode -from chia.types.condition_with_args import ConditionWithArgs -from chia.util.clvm import int_from_bytes -from chia.util.errors import ConsensusError, Err -from chia.util.ints import uint64 +from flax.types.announcement import Announcement +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.program import Program, SerializedProgram +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.condition_opcodes import ConditionOpcode +from flax.types.condition_with_args import ConditionWithArgs +from flax.util.clvm import int_from_bytes +from flax.util.errors import ConsensusError, Err +from flax.util.ints import uint64 # TODO: review each `assert` and consider replacing with explicit checks # since asserts can be stripped with python `-OO` flag @@ -20,7 +20,7 @@ def parse_sexp_to_condition( sexp: Program, ) -> Tuple[Optional[Err], Optional[ConditionWithArgs]]: """ - Takes a ChiaLisp sexp and returns a ConditionWithArgs. + Takes a FlaxLisp sexp and returns a ConditionWithArgs. If it fails, returns an Error """ as_atoms = sexp.as_atom_list() @@ -40,7 +40,7 @@ def parse_sexp_to_conditions( sexp: Program, ) -> Tuple[Optional[Err], Optional[List[ConditionWithArgs]]]: """ - Takes a ChiaLisp sexp (list) and returns the list of ConditionWithArgss + Takes a FlaxLisp sexp (list) and returns the list of ConditionWithArgss If it fails, returns as Error """ results: List[ConditionWithArgs] = [] diff --git a/chia/util/config.py b/flax/util/config.py similarity index 96% rename from chia/util/config.py rename to flax/util/config.py index 870ac7dd0..70b979843 100644 --- a/chia/util/config.py +++ b/flax/util/config.py @@ -8,14 +8,14 @@ import pkg_resources import yaml -from chia.util.path import mkdir +from flax.util.path import mkdir def initial_config_file(filename: Union[str, Path]) -> str: return pkg_resources.resource_string(__name__, f"initial-{filename}").decode() -def create_default_chia_config(root_path: Path) -> None: +def create_default_flax_config(root_path: Path) -> None: for filename in ["config.yaml"]: default_config_file_data = initial_config_file(filename) path = config_path_for_filename(root_path, filename) @@ -49,7 +49,7 @@ def load_config( if not exit_on_error: raise ValueError("Config not found") print(f"can't find {path}") - print("** please run `chia init` to migrate or create new config files **") + print("** please run `flax init` to migrate or create new config files **") # TODO: fix this hack sys.exit(-1) r = yaml.safe_load(open(path, "r")) diff --git a/chia/util/create_alert_file.py b/flax/util/create_alert_file.py similarity index 96% rename from chia/util/create_alert_file.py rename to flax/util/create_alert_file.py index 5c2e46425..bcd461a3d 100644 --- a/chia/util/create_alert_file.py +++ b/flax/util/create_alert_file.py @@ -3,9 +3,9 @@ from blspy import AugSchemeMPL -from chia.util.ints import uint32 -from chia.util.keychain import Keychain -from chia.util.validate_alert import create_alert_file, create_not_ready_alert_file, validate_alert_file +from flax.util.ints import uint32 +from flax.util.keychain import Keychain +from flax.util.validate_alert import create_alert_file, create_not_ready_alert_file, validate_alert_file bitcoin_hash = None bram_message = None diff --git a/chia/util/db_wrapper.py b/flax/util/db_wrapper.py similarity index 100% rename from chia/util/db_wrapper.py rename to flax/util/db_wrapper.py diff --git a/flax/util/default_root.py b/flax/util/default_root.py new file mode 100644 index 000000000..11b15b844 --- /dev/null +++ b/flax/util/default_root.py @@ -0,0 +1,4 @@ +import os +from pathlib import Path + +DEFAULT_ROOT_PATH = Path(os.path.expanduser(os.getenv("FLAX_ROOT", "~/.flax/mainnet"))).resolve() diff --git a/chia/util/english.txt b/flax/util/english.txt similarity index 100% rename from chia/util/english.txt rename to flax/util/english.txt diff --git a/chia/util/errors.py b/flax/util/errors.py similarity index 100% rename from chia/util/errors.py rename to flax/util/errors.py diff --git a/chia/util/chia_logging.py b/flax/util/flax_logging.py similarity index 97% rename from chia/util/chia_logging.py rename to flax/util/flax_logging.py index 3c894deac..9045f28c3 100644 --- a/chia/util/chia_logging.py +++ b/flax/util/flax_logging.py @@ -5,7 +5,7 @@ import colorlog from concurrent_log_handler import ConcurrentRotatingFileHandler -from chia.util.path import mkdir, path_from_root +from flax.util.path import mkdir, path_from_root def initialize_logging(service_name: str, logging_config: Dict, root_path: Path): diff --git a/chia/util/generator_tools.py b/flax/util/generator_tools.py similarity index 84% rename from chia/util/generator_tools.py rename to flax/util/generator_tools.py index 4d8b1d942..2d4aa1ca4 100644 --- a/chia/util/generator_tools.py +++ b/flax/util/generator_tools.py @@ -1,12 +1,12 @@ from typing import List, Tuple from chiabip158 import PyBIP158 -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.full_block import FullBlock -from chia.types.header_block import HeaderBlock -from chia.types.name_puzzle_condition import NPC -from chia.util.condition_tools import created_outputs_for_conditions_dict +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.full_block import FullBlock +from flax.types.header_block import HeaderBlock +from flax.types.name_puzzle_condition import NPC +from flax.util.condition_tools import created_outputs_for_conditions_dict def get_block_header(block: FullBlock, tx_addition_coins: List[Coin], removals_names: List[bytes32]) -> HeaderBlock: diff --git a/chia/util/hash.py b/flax/util/hash.py similarity index 71% rename from chia/util/hash.py rename to flax/util/hash.py index e035b7823..3808e7083 100644 --- a/chia/util/hash.py +++ b/flax/util/hash.py @@ -1,6 +1,6 @@ import blspy -from chia.types.blockchain_format.sized_bytes import bytes32 +from flax.types.blockchain_format.sized_bytes import bytes32 def std_hash(b) -> bytes32: diff --git a/chia/util/initial-config.yaml b/flax/util/initial-config.yaml similarity index 67% rename from chia/util/initial-config.yaml rename to flax/util/initial-config.yaml index 4d532995f..25feb78e1 100644 --- a/chia/util/initial-config.yaml +++ b/flax/util/initial-config.yaml @@ -3,7 +3,7 @@ min_mainnet_k_size: 32 # Send a ping to all peers after ping_interval seconds ping_interval: 120 self_hostname: &self_hostname "localhost" -daemon_port: 55400 +daemon_port: 56600 inbound_rate_limit_percent: 100 outbound_rate_limit_percent: 30 @@ -11,83 +11,23 @@ network_overrides: &network_overrides constants: mainnet: NETWORK_TYPE: 0 - GENESIS_CHALLENGE: ccd5bb71183532bff220ba46c268991a3ff07eb358e8255a65c30a2dce0e5fbb - GENESIS_PRE_FARM_POOL_PUZZLE_HASH: "d23da14695a188ae5708dd152263c4db883eb27edeb936178d4d988b8f3ce5fc" - GENESIS_PRE_FARM_FARMER_PUZZLE_HASH: "3d8765d3a597ec1d99663f6c9816d915b9f68613ac94009884c4addaefcce6af" + GENESIS_CHALLENGE: 9b9ffca948750d8b41ac755da213461e9d2253ec7bfce80695d78f7fe7d55112 + GENESIS_PRE_FARM_POOL_PUZZLE_HASH: "e8e245e2e6536e17fd7cbc2e3bd90de06f55362ee3c84cea5a68391e5bad7ef6" + GENESIS_PRE_FARM_FARMER_PUZZLE_HASH: "e8e245e2e6536e17fd7cbc2e3bd90de06f55362ee3c84cea5a68391e5bad7ef6" testnet0: - MIN_PLOT_SIZE: 18 - GENESIS_CHALLENGE: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + GENESIS_CHALLENGE: 28a206a22e7e2060230c88ad149d81cc8e74bcf5e8e74aafcce8b8efe6181dbb NETWORK_TYPE: 1 - GENESIS_PRE_FARM_POOL_PUZZLE_HASH: "d23da14695a188ae5708dd152263c4db883eb27edeb936178d4d988b8f3ce5fc" - GENESIS_PRE_FARM_FARMER_PUZZLE_HASH: "3d8765d3a597ec1d99663f6c9816d915b9f68613ac94009884c4addaefcce6af" - testnet2: - MIN_PLOT_SIZE: 18 - GENESIS_CHALLENGE: ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad - NETWORK_TYPE: 1 - INITIAL_FREEZE_PERIOD: 100 - DIFFICULTY_CONSTANT_FACTOR: 10052721566054 - GENESIS_PRE_FARM_POOL_PUZZLE_HASH: "d23da14695a188ae5708dd152263c4db883eb27edeb936178d4d988b8f3ce5fc" - GENESIS_PRE_FARM_FARMER_PUZZLE_HASH: "3d8765d3a597ec1d99663f6c9816d915b9f68613ac94009884c4addaefcce6af" - testnet3: - DIFFICULTY_CONSTANT_FACTOR: 10052721566054 - GENESIS_CHALLENGE: ca7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015af - GENESIS_PRE_FARM_FARMER_PUZZLE_HASH: 3d8765d3a597ec1d99663f6c9816d915b9f68613ac94009884c4addaefcce6af - GENESIS_PRE_FARM_POOL_PUZZLE_HASH: d23da14695a188ae5708dd152263c4db883eb27edeb936178d4d988b8f3ce5fc - MIN_PLOT_SIZE: 18 - NETWORK_TYPE: 1 - MEMPOOL_BLOCK_BUFFER: 10 - testnet4: - DIFFICULTY_CONSTANT_FACTOR: 10052721566054 - GENESIS_CHALLENGE: dd7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015af - GENESIS_PRE_FARM_FARMER_PUZZLE_HASH: 3d8765d3a597ec1d99663f6c9816d915b9f68613ac94009884c4addaefcce6af - GENESIS_PRE_FARM_POOL_PUZZLE_HASH: d23da14695a188ae5708dd152263c4db883eb27edeb936178d4d988b8f3ce5fc - INITIAL_FREEZE_END_TIMESTAMP: 1618776900 # Sun Apr 18 2021 16:15:00 GMT-0400 (Eastern Daylight Time) - MIN_PLOT_SIZE: 18 - NETWORK_TYPE: 1 - MEMPOOL_BLOCK_BUFFER: 10 - EPOCH_BLOCKS: 768 - DIFFICULTY_STARTING: 30 - testnet5: - DIFFICULTY_CONSTANT_FACTOR: 10052721566054 - GENESIS_CHALLENGE: ee7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015af - GENESIS_PRE_FARM_FARMER_PUZZLE_HASH: 3d8765d3a597ec1d99663f6c9816d915b9f68613ac94009884c4addaefcce6af - GENESIS_PRE_FARM_POOL_PUZZLE_HASH: d23da14695a188ae5708dd152263c4db883eb27edeb936178d4d988b8f3ce5fc - INITIAL_FREEZE_END_TIMESTAMP: 1618869600 # Mon Apr 19 2021 18:00:00 GMT-0400 (Eastern Daylight Time) - MIN_PLOT_SIZE: 18 - NETWORK_TYPE: 1 - MEMPOOL_BLOCK_BUFFER: 10 - EPOCH_BLOCKS: 768 - DIFFICULTY_STARTING: 30 - testnet7: - DIFFICULTY_CONSTANT_FACTOR: 10052721566054 - GENESIS_CHALLENGE: 117816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015af - GENESIS_PRE_FARM_FARMER_PUZZLE_HASH: 3d8765d3a597ec1d99663f6c9816d915b9f68613ac94009884c4addaefcce6af - GENESIS_PRE_FARM_POOL_PUZZLE_HASH: d23da14695a188ae5708dd152263c4db883eb27edeb936178d4d988b8f3ce5fc - INITIAL_FREEZE_END_TIMESTAMP: 1619661600 # Wed Apr 28 2021 22:00:00 GMT-0400 (Eastern Daylight Time) - MIN_PLOT_SIZE: 18 - NETWORK_TYPE: 1 - MEMPOOL_BLOCK_BUFFER: 10 - EPOCH_BLOCKS: 768 - DIFFICULTY_STARTING: 30 + GENESIS_PRE_FARM_POOL_PUZZLE_HASH: "e8e245e2e6536e17fd7cbc2e3bd90de06f55362ee3c84cea5a68391e5bad7ef6" + GENESIS_PRE_FARM_FARMER_PUZZLE_HASH: "e8e245e2e6536e17fd7cbc2e3bd90de06f55362ee3c84cea5a68391e5bad7ef6" config: mainnet: - address_prefix: "xch" + address_prefix: "xfx" testnet0: - address_prefix: "txch" - testnet1: - address_prefix: "txch" - testnet2: - address_prefix: "txch" - testnet3: - address_prefix: "txch" - testnet4: - address_prefix: "txch" - testnet7: - address_prefix: "txch" + address_prefix: "txfx" selected_network: &selected_network "mainnet" -ALERTS_URL: https://download.chia.net/notify/mainnet_alert.txt -CHIA_ALERTS_PUBKEY: 89b7fd87cb56e926ecefb879a29aae308be01f31980569f6a75a69d2a9a69daefd71fb778d865f7c50d6c967e3025937 +ALERTS_URL: https://download.flaxnetwork.org/notify/mainnet_alert.txt +FLAX_ALERTS_PUBKEY: a88dc9b53e21088dcd53347eda53b533aec7cd5ff267c3968b1dfc0dc132e39575cf401f0d6bc9952404dbbfc30731c5 # public ssl ca is included in source code # Private ssl ca is used for trusted connections between machines user owns @@ -95,9 +35,9 @@ private_ssl_ca: crt: "config/ssl/ca/private_ca.crt" key: "config/ssl/ca/private_ca.key" -chia_ssl_ca: - crt: "config/ssl/ca/chia_ca.crt" - key: "config/ssl/ca/chia_ca.key" +flax_ssl_ca: + crt: "config/ssl/ca/flax_ca.crt" + key: "config/ssl/ca/flax_ca.key" daemon_ssl: @@ -114,14 +54,14 @@ logging: &logging harvester: # The harvester server (if run) will run on this port - port: 8448 + port: 6884 farmer_peer: host: *self_hostname - port: 8447 + port: 6885 # If True, starts an RPC server at the following port start_rpc_server: True - rpc_port: 8560 + rpc_port: 6760 num_threads: 30 plot_loading_frequency_seconds: 120 @@ -140,13 +80,13 @@ harvester: crt: "config/ssl/ca/private_ca.crt" key: "config/ssl/ca/private_ca.key" - chia_ssl_ca: - crt: "config/ssl/ca/chia_ca.crt" - key: "config/ssl/ca/chia_ca.key" + flax_ssl_ca: + crt: "config/ssl/ca/flax_ca.crt" + key: "config/ssl/ca/flax_ca.key" pool: # Replace this with a real puzzle hash - # xch_target_address: txch102gkhhzs60grx7cfnpng5n6rjecr89r86l5s8xux2za8k820cxsq64ssdg + # xfx_target_address: txfx102gkhhzs60grx7cfnpng5n6rjecr89r86l5s8xux2za8k820cxsq64ssdg logging: *logging network_overrides: *network_overrides selected_network: *selected_network @@ -154,23 +94,23 @@ pool: farmer: # The farmer server (if run) will run on this port - port: 8447 + port: 6885 # The farmer will attempt to connect to this full node and harvester full_node_peer: host: *self_hostname - port: 8444 + port: 6888 harvester_peer: host: *self_hostname - port: 8448 + port: 6884 pool_public_keys: [] # Replace this with a real puzzle hash - # xch_target_address: txch102gkhhzs60grx7cfnpng5n6rjecr89r86l5s8xux2za8k820cxsq64ssdg + # xfx_target_address: txfx102gkhhzs60grx7cfnpng5n6rjecr89r86l5s8xux2za8k820cxsq64ssdg # If True, starts an RPC server at the following port start_rpc_server: True - rpc_port: 8559 + rpc_port: 6759 # To send a share to a pool, a proof of space must have required_iters less than this number pool_share_threshold: 1000 @@ -187,7 +127,7 @@ farmer: # Don't run this unless you want to run VDF clients on the local machine. timelord_launcher: # The server where the VDF clients will connect to. - port: 8000 + port: 6600 # Number of VDF client processes to keep alive in the local machine. process_count: 3 logging: *logging @@ -195,7 +135,7 @@ timelord_launcher: timelord: # The timelord server (if run) will run on this port - port: 8446 + port: 6886 # Provides a list of VDF clients expected to connect to this timelord. # For each client, an IP is provided, together with the estimated iterations per second. vdf_clients: @@ -207,13 +147,13 @@ timelord: - 150000 full_node_peer: host: *self_hostname - port: 8444 + port: 6888 # Maximum number of seconds allowed for a client to reconnect to the server. max_connection_time: 60 # The ip and port where the TCP clients will connect. vdf_server: host: *self_hostname - port: 8000 + port: 6600 logging: *logging network_overrides: *network_overrides selected_network: *selected_network @@ -242,7 +182,7 @@ timelord: full_node: # The full node server (if run) will run on this port - port: 8444 + port: 6888 # Run multiple nodes with different databases by changing the database_path database_path: db/blockchain_v1_CHALLENGE.sqlite @@ -252,7 +192,7 @@ full_node: # If True, starts an RPC server at the following port start_rpc_server: True - rpc_port: 8555 + rpc_port: 6755 # Use UPnP to attempt to allow other full nodes to reach your node behind a gateway enable_upnp: True @@ -279,7 +219,7 @@ full_node: # Only connect to peers who we have heard about in the last recent_peer_threshold seconds recent_peer_threshold: 6000 - # Send to a Bluebox (sanatizing timelord) uncompact blocks once every + # Send to a Bluebox (sanitizing timelord) uncompact blocks once every # 'send_uncompact_interval' seconds. Set to 0 if you don't use this feature. send_uncompact_interval: 0 # At every 'send_uncompact_interval' seconds, send blueboxes 'target_uncompact_proofs' proofs to be normalized. @@ -291,25 +231,25 @@ full_node: weight_proof_timeout: 360 # when enabled, the full node will print a pstats profile to the root_dir/profile every second - # analyze with chia/utils/profiler.py + # analyze with flax/utils/profiler.py enable_profiler: False # List of trusted DNS seeders to bootstrap from. # If you modify this, please change the hardcode as well from FullNode.set_server() dns_servers: - - "dns-introducer.chia.net" + - "dns-introducer.flaxnetwork.org" farmer_peer: host: *self_hostname - port: 8447 + port: 6885 timelord_peer: host: *self_hostname - port: 8446 + port: 6886 introducer_peer: - host: introducer.chia.net # Chia AWS introducer IPv4/IPv6 - port: 8444 + host: introducer.flaxnetwork.org # Flax AWS introducer IPv4/IPv6 + port: 6888 wallet_peer: host: *self_hostname - port: 8449 + port: 6883 logging: *logging network_overrides: *network_overrides selected_network: *selected_network @@ -322,10 +262,10 @@ full_node: ui: # The ui node server (if run) will run on this port - port: 8222 + port: 6222 # Which port to use to communicate with the full node - rpc_port: 8555 + rpc_port: 6755 # This SSH key is for the ui SSH server ssh_filename: config/ssh_host_key @@ -336,14 +276,14 @@ ui: # this is where the electron UI will find its daemon # defaults to the one running locally with its private keys daemon_host: *self_hostname - daemon_port: 55400 + daemon_port: 56600 daemon_ssl: private_crt: config/ssl/daemon/private_daemon.crt private_key: config/ssl/daemon/private_daemon.key introducer: host: *self_hostname - port: 8445 + port: 6887 max_peers_to_send: 20 # The introducer will only return peers who it has seen in the last # recent_peer_threshold seconds @@ -357,8 +297,8 @@ introducer: public_key: "config/ssl/full_node/public_full_node.key" wallet: - port: 8449 - rpc_port: 9256 + port: 6883 + rpc_port: 6761 # The minimum height that we care about for our transactions. Set to zero # If we are restoring from private key and don't know the height. @@ -370,7 +310,7 @@ wallet: full_node_peer: host: *self_hostname - port: 8444 + port: 6888 testing: False database_path: wallet/db/blockchain_wallet_v1_CHALLENGE_KEY.sqlite @@ -387,8 +327,8 @@ wallet: recent_peer_threshold: 6000 introducer_peer: - host: introducer.chia.net # Chia AWS introducer IPv4/IPv6 - port: 8444 + host: introducer.flaxnetwork.org # Flax AWS introducer IPv4/IPv6 + port: 6888 ssl: private_crt: "config/ssl/wallet/private_wallet.crt" diff --git a/chia/util/ints.py b/flax/util/ints.py similarity index 96% rename from chia/util/ints.py rename to flax/util/ints.py index 88cad82b8..548917ecf 100644 --- a/chia/util/ints.py +++ b/flax/util/ints.py @@ -1,6 +1,6 @@ from typing import Any, BinaryIO -from chia.util.struct_stream import StructStream +from flax.util.struct_stream import StructStream class int8(StructStream): diff --git a/chia/util/json_util.py b/flax/util/json_util.py similarity index 95% rename from chia/util/json_util.py rename to flax/util/json_util.py index 914ae99ae..5743d340f 100644 --- a/chia/util/json_util.py +++ b/flax/util/json_util.py @@ -4,7 +4,7 @@ from aiohttp import web -from chia.wallet.util.wallet_types import WalletType +from flax.wallet.util.wallet_types import WalletType class EnhancedJSONEncoder(json.JSONEncoder): diff --git a/chia/util/keychain.py b/flax/util/keychain.py similarity index 98% rename from chia/util/keychain.py rename to flax/util/keychain.py index fd66f74fd..e3fe7d3c4 100644 --- a/chia/util/keychain.py +++ b/flax/util/keychain.py @@ -10,7 +10,7 @@ from blspy import AugSchemeMPL, G1Element, PrivateKey from keyrings.cryptfile.cryptfile import CryptFileKeyring -from chia.util.hash import std_hash +from flax.util.hash import std_hash MAX_KEYS = 100 @@ -120,7 +120,7 @@ class Keychain: testing: bool user: str - def __init__(self, user: str = "user-chia-1.8", testing: bool = False): + def __init__(self, user: str = "user-flax-1.8", testing: bool = False): self.testing = testing self.user = user @@ -129,9 +129,9 @@ def _get_service(self) -> str: The keychain stores keys under a different name for tests. """ if self.testing: - return f"chia-{self.user}-test" + return f"flax-{self.user}-test" else: - return f"chia-{self.user}" + return f"flax-{self.user}" def _get_pk_and_entropy(self, user: str) -> Optional[Tuple[G1Element, bytes]]: """ diff --git a/chia/util/lru_cache.py b/flax/util/lru_cache.py similarity index 100% rename from chia/util/lru_cache.py rename to flax/util/lru_cache.py diff --git a/chia/util/make_test_constants.py b/flax/util/make_test_constants.py similarity index 74% rename from chia/util/make_test_constants.py rename to flax/util/make_test_constants.py index 5a05a289c..1bdf66e35 100644 --- a/chia/util/make_test_constants.py +++ b/flax/util/make_test_constants.py @@ -1,6 +1,6 @@ from typing import Dict -from chia.consensus.default_constants import DEFAULT_CONSTANTS, ConsensusConstants +from flax.consensus.default_constants import DEFAULT_CONSTANTS, ConsensusConstants def make_test_constants(test_constants_overrides: Dict) -> ConsensusConstants: diff --git a/chia/util/merkle_set.py b/flax/util/merkle_set.py similarity index 99% rename from chia/util/merkle_set.py rename to flax/util/merkle_set.py index 87aaeae9c..be5298894 100644 --- a/chia/util/merkle_set.py +++ b/flax/util/merkle_set.py @@ -2,7 +2,7 @@ from hashlib import sha256 from typing import Any, Dict, List, Tuple -from chia.types.blockchain_format.sized_bytes import bytes32 +from flax.types.blockchain_format.sized_bytes import bytes32 """ A simple, confidence-inspiring Merkle Set standard diff --git a/chia/util/misc.py b/flax/util/misc.py similarity index 100% rename from chia/util/misc.py rename to flax/util/misc.py diff --git a/chia/util/network.py b/flax/util/network.py similarity index 70% rename from chia/util/network.py rename to flax/util/network.py index 1e872ec90..4a8002dab 100644 --- a/chia/util/network.py +++ b/flax/util/network.py @@ -1,6 +1,6 @@ from ipaddress import ip_address, IPv4Network, IPv6Network from typing import Iterable, Union, Any -from chia.server.outbound_message import NodeType +from flax.server.outbound_message import NodeType def is_in_network(peer_host: str, networks: Iterable[Union[IPv4Network, IPv6Network]]) -> bool: @@ -17,27 +17,27 @@ def is_localhost(peer_host: str) -> bool: def class_for_type(type: NodeType) -> Any: if type is NodeType.FULL_NODE: - from chia.full_node.full_node_api import FullNodeAPI + from flax.full_node.full_node_api import FullNodeAPI return FullNodeAPI elif type is NodeType.WALLET: - from chia.wallet.wallet_node_api import WalletNodeAPI + from flax.wallet.wallet_node_api import WalletNodeAPI return WalletNodeAPI elif type is NodeType.INTRODUCER: - from chia.introducer.introducer_api import IntroducerAPI + from flax.introducer.introducer_api import IntroducerAPI return IntroducerAPI elif type is NodeType.TIMELORD: - from chia.timelord.timelord_api import TimelordAPI + from flax.timelord.timelord_api import TimelordAPI return TimelordAPI elif type is NodeType.FARMER: - from chia.farmer.farmer_api import FarmerAPI + from flax.farmer.farmer_api import FarmerAPI return FarmerAPI elif type is NodeType.HARVESTER: - from chia.harvester.harvester_api import HarvesterAPI + from flax.harvester.harvester_api import HarvesterAPI return HarvesterAPI raise ValueError("No class for type") diff --git a/chia/util/partial_func.py b/flax/util/partial_func.py similarity index 100% rename from chia/util/partial_func.py rename to flax/util/partial_func.py diff --git a/chia/util/path.py b/flax/util/path.py similarity index 100% rename from chia/util/path.py rename to flax/util/path.py diff --git a/chia/util/pip_import.py b/flax/util/pip_import.py similarity index 100% rename from chia/util/pip_import.py rename to flax/util/pip_import.py diff --git a/chia/util/prev_transaction_block.py b/flax/util/prev_transaction_block.py similarity index 77% rename from chia/util/prev_transaction_block.py rename to flax/util/prev_transaction_block.py index 8a9eacd2c..708cfa6dd 100644 --- a/chia/util/prev_transaction_block.py +++ b/flax/util/prev_transaction_block.py @@ -1,8 +1,8 @@ from typing import Tuple -from chia.consensus.block_record import BlockRecord -from chia.consensus.blockchain_interface import BlockchainInterface -from chia.util.ints import uint128 +from flax.consensus.block_record import BlockRecord +from flax.consensus.blockchain_interface import BlockchainInterface +from flax.util.ints import uint128 def get_prev_transaction_block( diff --git a/chia/util/profiler.py b/flax/util/profiler.py similarity index 93% rename from chia/util/profiler.py rename to flax/util/profiler.py index 01440dd9e..c87e65caf 100644 --- a/chia/util/profiler.py +++ b/flax/util/profiler.py @@ -3,20 +3,20 @@ import logging import pathlib -from chia.util.path import mkdir, path_from_root +from flax.util.path import mkdir, path_from_root # to use the profiler, enable it config file, "enable_profiler" -# the output will be printed to your chia root path, e.g. ~/.chia/mainnet/profile/ +# the output will be printed to your flax root path, e.g. ~/.flax/mainnet/profile/ # to analyze the profile, run: -# python chia/utils/profiler.py ~/.chia/mainnet/profile | less -r +# python flax/utils/profiler.py ~/.flax/mainnet/profile | less -r -# this will print CPU usage of the chia full node main thread at 1 second increments. +# this will print CPU usage of the flax full node main thread at 1 second increments. # find a time window of interest and analyze the profile file (which are in pstats format). # for example: -# python chia/utils/profiler.py ~/.chia/mainnet/profile 10 20 +# python flax/utils/profiler.py ~/.flax/mainnet/profile 10 20 async def profile_task(root_path: pathlib.Path, log: logging.Logger) -> None: @@ -118,7 +118,7 @@ def analyze_slot_range(profile_dir: pathlib.Path, first: int, last: int): for i in range(first, last + 1): files.append(str(profile_dir / ("slot-%05d.profile" % i))) - output_file = "chia-hotspot-%d" % first + output_file = "flax-hotspot-%d" % first if first < last: output_file += "-%d" % last diff --git a/chia/util/recursive_replace.py b/flax/util/recursive_replace.py similarity index 100% rename from chia/util/recursive_replace.py rename to flax/util/recursive_replace.py diff --git a/chia/util/safe_cancel_task.py b/flax/util/safe_cancel_task.py similarity index 100% rename from chia/util/safe_cancel_task.py rename to flax/util/safe_cancel_task.py diff --git a/flax/util/service_groups.py b/flax/util/service_groups.py new file mode 100644 index 000000000..7d630802b --- /dev/null +++ b/flax/util/service_groups.py @@ -0,0 +1,31 @@ +from typing import KeysView, Generator + +SERVICES_FOR_GROUP = { + "all": "flax_harvester flax_timelord_launcher flax_timelord flax_farmer flax_full_node flax_wallet".split(), + "node": "flax_full_node".split(), + "harvester": "flax_harvester".split(), + "farmer": "flax_harvester flax_farmer flax_full_node flax_wallet".split(), + "farmer-no-wallet": "flax_harvester flax_farmer flax_full_node".split(), + "farmer-only": "flax_farmer".split(), + "timelord": "flax_timelord_launcher flax_timelord flax_full_node".split(), + "timelord-only": "flax_timelord".split(), + "timelord-launcher-only": "flax_timelord_launcher".split(), + "wallet": "flax_wallet flax_full_node".split(), + "wallet-only": "flax_wallet".split(), + "introducer": "flax_introducer".split(), + "simulator": "flax_full_node_simulator".split(), +} + + +def all_groups() -> KeysView[str]: + return SERVICES_FOR_GROUP.keys() + + +def services_for_groups(groups) -> Generator[str, None, None]: + for group in groups: + for service in SERVICES_FOR_GROUP[group]: + yield service + + +def validate_service(service: str) -> bool: + return any(service in _ for _ in SERVICES_FOR_GROUP.values()) diff --git a/chia/util/setproctitle.py b/flax/util/setproctitle.py similarity index 100% rename from chia/util/setproctitle.py rename to flax/util/setproctitle.py diff --git a/chia/util/significant_bits.py b/flax/util/significant_bits.py similarity index 100% rename from chia/util/significant_bits.py rename to flax/util/significant_bits.py diff --git a/chia/util/streamable.py b/flax/util/streamable.py similarity index 97% rename from chia/util/streamable.py rename to flax/util/streamable.py index 8b69fb89e..25711c7a6 100644 --- a/chia/util/streamable.py +++ b/flax/util/streamable.py @@ -11,12 +11,12 @@ from blspy import G1Element, G2Element, PrivateKey -from chia.types.blockchain_format.program import Program, SerializedProgram -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.byte_types import hexstr_to_bytes -from chia.util.hash import std_hash -from chia.util.ints import int64, int512, uint32, uint64, uint128 -from chia.util.type_checking import is_type_List, is_type_SpecificOptional, is_type_Tuple, strictdataclass +from flax.types.blockchain_format.program import Program, SerializedProgram +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.byte_types import hexstr_to_bytes +from flax.util.hash import std_hash +from flax.util.ints import int64, int512, uint32, uint64, uint128 +from flax.util.type_checking import is_type_List, is_type_SpecificOptional, is_type_Tuple, strictdataclass if sys.version_info < (3, 8): diff --git a/chia/util/struct_stream.py b/flax/util/struct_stream.py similarity index 100% rename from chia/util/struct_stream.py rename to flax/util/struct_stream.py diff --git a/chia/util/type_checking.py b/flax/util/type_checking.py similarity index 100% rename from chia/util/type_checking.py rename to flax/util/type_checking.py diff --git a/chia/util/validate_alert.py b/flax/util/validate_alert.py similarity index 95% rename from chia/util/validate_alert.py rename to flax/util/validate_alert.py index 031226ef1..00973c3cc 100644 --- a/chia/util/validate_alert.py +++ b/flax/util/validate_alert.py @@ -3,8 +3,8 @@ from blspy import AugSchemeMPL, PublicKeyMPL, SignatureMPL -from chia.util.byte_types import hexstr_to_bytes -from chia.util.hash import std_hash +from flax.util.byte_types import hexstr_to_bytes +from flax.util.hash import std_hash def validate_alert_file(file_path: Path, pubkey: str) -> bool: diff --git a/chia/util/vdf_prover.py b/flax/util/vdf_prover.py similarity index 71% rename from chia/util/vdf_prover.py rename to flax/util/vdf_prover.py index 30d0382bf..af03b9c6f 100644 --- a/chia/util/vdf_prover.py +++ b/flax/util/vdf_prover.py @@ -2,11 +2,11 @@ from chiavdf import prove -from chia.consensus.constants import ConsensusConstants -from chia.types.blockchain_format.classgroup import ClassgroupElement -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.blockchain_format.vdf import VDFInfo, VDFProof -from chia.util.ints import uint8, uint64 +from flax.consensus.constants import ConsensusConstants +from flax.types.blockchain_format.classgroup import ClassgroupElement +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.blockchain_format.vdf import VDFInfo, VDFProof +from flax.util.ints import uint8, uint64 def get_vdf_info_and_proof( diff --git a/chia/util/wallet_tools.py b/flax/util/wallet_tools.py similarity index 92% rename from chia/util/wallet_tools.py rename to flax/util/wallet_tools.py index 5aba5c590..e1f39fa74 100644 --- a/chia/util/wallet_tools.py +++ b/flax/util/wallet_tools.py @@ -2,27 +2,27 @@ from blspy import AugSchemeMPL, G2Element, PrivateKey -from chia.consensus.constants import ConsensusConstants -from chia.util.hash import std_hash -from chia.types.announcement import Announcement -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.program import Program -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.coin_solution import CoinSolution -from chia.types.condition_opcodes import ConditionOpcode -from chia.types.condition_with_args import ConditionWithArgs -from chia.types.spend_bundle import SpendBundle -from chia.util.clvm import int_from_bytes, int_to_bytes -from chia.util.condition_tools import conditions_by_opcode, conditions_for_solution, pkm_pairs_for_conditions_dict -from chia.util.ints import uint32, uint64 -from chia.wallet.derive_keys import master_sk_to_wallet_sk -from chia.wallet.puzzles.p2_delegated_puzzle_or_hidden_puzzle import ( +from flax.consensus.constants import ConsensusConstants +from flax.util.hash import std_hash +from flax.types.announcement import Announcement +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.program import Program +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.coin_solution import CoinSolution +from flax.types.condition_opcodes import ConditionOpcode +from flax.types.condition_with_args import ConditionWithArgs +from flax.types.spend_bundle import SpendBundle +from flax.util.clvm import int_from_bytes, int_to_bytes +from flax.util.condition_tools import conditions_by_opcode, conditions_for_solution, pkm_pairs_for_conditions_dict +from flax.util.ints import uint32, uint64 +from flax.wallet.derive_keys import master_sk_to_wallet_sk +from flax.wallet.puzzles.p2_delegated_puzzle_or_hidden_puzzle import ( DEFAULT_HIDDEN_PUZZLE_HASH, calculate_synthetic_secret_key, puzzle_for_pk, solution_for_conditions, ) -from chia.wallet.puzzles.puzzle_utils import ( +from flax.wallet.puzzles.puzzle_utils import ( make_assert_aggsig_condition, make_assert_coin_announcement, make_assert_puzzle_announcement, diff --git a/chia/util/ws_message.py b/flax/util/ws_message.py similarity index 97% rename from chia/util/ws_message.py rename to flax/util/ws_message.py index 92e72c122..272ca3eff 100644 --- a/chia/util/ws_message.py +++ b/flax/util/ws_message.py @@ -1,7 +1,7 @@ from secrets import token_bytes from typing import Any, Dict -from chia.util.json_util import dict_to_json_str +from flax.util.json_util import dict_to_json_str try: from typings import TypedDict diff --git a/chia/wallet/__init__.py b/flax/wallet/__init__.py similarity index 100% rename from chia/wallet/__init__.py rename to flax/wallet/__init__.py diff --git a/chia/wallet/block_record.py b/flax/wallet/block_record.py similarity index 83% rename from chia/wallet/block_record.py rename to flax/wallet/block_record.py index 81cc7c57c..244afb923 100644 --- a/chia/wallet/block_record.py +++ b/flax/wallet/block_record.py @@ -1,9 +1,9 @@ from dataclasses import dataclass from typing import List -from chia.types.blockchain_format.coin import Coin -from chia.types.header_block import HeaderBlock -from chia.util.streamable import Streamable, streamable +from flax.types.blockchain_format.coin import Coin +from flax.types.header_block import HeaderBlock +from flax.util.streamable import Streamable, streamable @dataclass(frozen=True) diff --git a/chia/wallet/cc_wallet/__init__.py b/flax/wallet/cc_wallet/__init__.py similarity index 100% rename from chia/wallet/cc_wallet/__init__.py rename to flax/wallet/cc_wallet/__init__.py diff --git a/chia/wallet/cc_wallet/cc_info.py b/flax/wallet/cc_wallet/cc_info.py similarity index 63% rename from chia/wallet/cc_wallet/cc_info.py rename to flax/wallet/cc_wallet/cc_info.py index d74884d05..7ee0dfd01 100644 --- a/chia/wallet/cc_wallet/cc_info.py +++ b/flax/wallet/cc_wallet/cc_info.py @@ -1,9 +1,9 @@ from dataclasses import dataclass from typing import List, Optional, Tuple -from chia.types.blockchain_format.program import Program -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.streamable import Streamable, streamable +from flax.types.blockchain_format.program import Program +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.streamable import Streamable, streamable @dataclass(frozen=True) diff --git a/chia/wallet/cc_wallet/cc_utils.py b/flax/wallet/cc_wallet/cc_utils.py similarity index 93% rename from chia/wallet/cc_wallet/cc_utils.py rename to flax/wallet/cc_wallet/cc_utils.py index 66f0ee969..81b698c27 100644 --- a/chia/wallet/cc_wallet/cc_utils.py +++ b/flax/wallet/cc_wallet/cc_utils.py @@ -3,15 +3,15 @@ from blspy import AugSchemeMPL, G2Element -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.program import Program, INFINITE_COST -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.condition_opcodes import ConditionOpcode -from chia.types.spend_bundle import CoinSolution, SpendBundle -from chia.util.condition_tools import conditions_dict_for_solution -from chia.util.ints import uint64 -from chia.wallet.puzzles.cc_loader import CC_MOD, LOCK_INNER_PUZZLE -from chia.wallet.puzzles.genesis_by_coin_id_with_0 import ( +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.program import Program, INFINITE_COST +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.condition_opcodes import ConditionOpcode +from flax.types.spend_bundle import CoinSolution, SpendBundle +from flax.util.condition_tools import conditions_dict_for_solution +from flax.util.ints import uint64 +from flax.wallet.puzzles.cc_loader import CC_MOD, LOCK_INNER_PUZZLE +from flax.wallet.puzzles.genesis_by_coin_id_with_0 import ( genesis_coin_id_for_genesis_coin_checker, lineage_proof_for_coin, lineage_proof_for_genesis, diff --git a/chia/wallet/cc_wallet/cc_wallet.py b/flax/wallet/cc_wallet/cc_wallet.py similarity index 95% rename from chia/wallet/cc_wallet/cc_wallet.py rename to flax/wallet/cc_wallet/cc_wallet.py index ab27244b1..b9fb08056 100644 --- a/chia/wallet/cc_wallet/cc_wallet.py +++ b/flax/wallet/cc_wallet/cc_wallet.py @@ -8,23 +8,23 @@ from blspy import AugSchemeMPL, G2Element -from chia.consensus.cost_calculator import calculate_cost_of_program, NPCResult -from chia.full_node.bundle_tools import simple_solution_generator -from chia.full_node.mempool_check_conditions import get_name_puzzle_conditions -from chia.protocols.wallet_protocol import PuzzleSolutionResponse -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.program import Program -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.coin_solution import CoinSolution -from chia.types.generator_types import BlockGenerator -from chia.types.spend_bundle import SpendBundle -from chia.util.byte_types import hexstr_to_bytes -from chia.util.condition_tools import conditions_dict_for_solution, pkm_pairs_for_conditions_dict -from chia.util.ints import uint8, uint32, uint64, uint128 -from chia.util.json_util import dict_to_json_str -from chia.wallet.block_record import HeaderBlockRecord -from chia.wallet.cc_wallet.cc_info import CCInfo -from chia.wallet.cc_wallet.cc_utils import ( +from flax.consensus.cost_calculator import calculate_cost_of_program, NPCResult +from flax.full_node.bundle_tools import simple_solution_generator +from flax.full_node.mempool_check_conditions import get_name_puzzle_conditions +from flax.protocols.wallet_protocol import PuzzleSolutionResponse +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.program import Program +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.coin_solution import CoinSolution +from flax.types.generator_types import BlockGenerator +from flax.types.spend_bundle import SpendBundle +from flax.util.byte_types import hexstr_to_bytes +from flax.util.condition_tools import conditions_dict_for_solution, pkm_pairs_for_conditions_dict +from flax.util.ints import uint8, uint32, uint64, uint128 +from flax.util.json_util import dict_to_json_str +from flax.wallet.block_record import HeaderBlockRecord +from flax.wallet.cc_wallet.cc_info import CCInfo +from flax.wallet.cc_wallet.cc_utils import ( CC_MOD, SpendableCC, cc_puzzle_for_inner_puzzle, @@ -33,22 +33,22 @@ spend_bundle_for_spendable_ccs, uncurry_cc, ) -from chia.wallet.derivation_record import DerivationRecord -from chia.wallet.puzzles.genesis_by_coin_id_with_0 import ( +from flax.wallet.derivation_record import DerivationRecord +from flax.wallet.puzzles.genesis_by_coin_id_with_0 import ( create_genesis_or_zero_coin_checker, genesis_coin_id_for_genesis_coin_checker, lineage_proof_for_genesis, ) -from chia.wallet.puzzles.p2_delegated_puzzle_or_hidden_puzzle import ( +from flax.wallet.puzzles.p2_delegated_puzzle_or_hidden_puzzle import ( DEFAULT_HIDDEN_PUZZLE_HASH, calculate_synthetic_secret_key, ) -from chia.wallet.transaction_record import TransactionRecord -from chia.wallet.util.transaction_type import TransactionType -from chia.wallet.util.wallet_types import WalletType -from chia.wallet.wallet import Wallet -from chia.wallet.wallet_coin_record import WalletCoinRecord -from chia.wallet.wallet_info import WalletInfo +from flax.wallet.transaction_record import TransactionRecord +from flax.wallet.util.transaction_type import TransactionType +from flax.wallet.util.wallet_types import WalletType +from flax.wallet.wallet import Wallet +from flax.wallet.wallet_coin_record import WalletCoinRecord +from flax.wallet.wallet_info import WalletInfo class CCWallet: diff --git a/chia/wallet/cc_wallet/ccparent.py b/flax/wallet/cc_wallet/ccparent.py similarity index 58% rename from chia/wallet/cc_wallet/ccparent.py rename to flax/wallet/cc_wallet/ccparent.py index 3ce7a9a1c..2c3a59382 100644 --- a/chia/wallet/cc_wallet/ccparent.py +++ b/flax/wallet/cc_wallet/ccparent.py @@ -1,9 +1,9 @@ from dataclasses import dataclass from typing import Optional -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.ints import uint64 -from chia.util.streamable import Streamable, streamable +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.ints import uint64 +from flax.util.streamable import Streamable, streamable @dataclass(frozen=True) diff --git a/chia/wallet/cc_wallet/debug_spend_bundle.py b/flax/wallet/cc_wallet/debug_spend_bundle.py similarity index 93% rename from chia/wallet/cc_wallet/debug_spend_bundle.py rename to flax/wallet/cc_wallet/debug_spend_bundle.py index ce4079520..bfbac90d4 100644 --- a/chia/wallet/cc_wallet/debug_spend_bundle.py +++ b/flax/wallet/cc_wallet/debug_spend_bundle.py @@ -4,13 +4,13 @@ from clvm import KEYWORD_FROM_ATOM from clvm_tools.binutils import disassemble as bu_disassemble -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.program import Program, INFINITE_COST -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.condition_opcodes import ConditionOpcode -from chia.types.spend_bundle import SpendBundle -from chia.util.condition_tools import conditions_dict_for_solution, pkm_pairs_for_conditions_dict -from chia.util.hash import std_hash +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.program import Program, INFINITE_COST +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.condition_opcodes import ConditionOpcode +from flax.types.spend_bundle import SpendBundle +from flax.util.condition_tools import conditions_dict_for_solution, pkm_pairs_for_conditions_dict +from flax.util.hash import std_hash CONDITIONS = dict((k, bytes(v)[0]) for k, v in ConditionOpcode.__members__.items()) # pylint: disable=E1101 KFA = {v: k for k, v in CONDITIONS.items()} diff --git a/chia/wallet/derivation_record.py b/flax/wallet/derivation_record.py similarity index 73% rename from chia/wallet/derivation_record.py rename to flax/wallet/derivation_record.py index 697ec795f..4db0b5dc5 100644 --- a/chia/wallet/derivation_record.py +++ b/flax/wallet/derivation_record.py @@ -2,9 +2,9 @@ from blspy import G1Element -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.ints import uint32 -from chia.wallet.util.wallet_types import WalletType +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.ints import uint32 +from flax.wallet.util.wallet_types import WalletType @dataclass(frozen=True) diff --git a/chia/wallet/derive_keys.py b/flax/wallet/derive_keys.py similarity index 90% rename from chia/wallet/derive_keys.py rename to flax/wallet/derive_keys.py index ca7cbf4a6..deaef3289 100644 --- a/chia/wallet/derive_keys.py +++ b/flax/wallet/derive_keys.py @@ -2,12 +2,12 @@ from blspy import AugSchemeMPL, PrivateKey -from chia.util.ints import uint32 +from flax.util.ints import uint32 # EIP 2334 bls key derivation # https://eips.ethereum.org/EIPS/eip-2334 # 12381 = bls spec number -# 8444 = Chia blockchain number and port number +# 8444 = Chia blockchain number and port number for compatibility # 0, 1, 2, 3, 4, farmer, pool, wallet, local, backup key numbers diff --git a/chia/wallet/did_wallet/__init__.py b/flax/wallet/did_wallet/__init__.py similarity index 100% rename from chia/wallet/did_wallet/__init__.py rename to flax/wallet/did_wallet/__init__.py diff --git a/chia/wallet/did_wallet/did_info.py b/flax/wallet/did_wallet/did_info.py similarity index 65% rename from chia/wallet/did_wallet/did_info.py rename to flax/wallet/did_wallet/did_info.py index 0fd299344..d9d0549fe 100644 --- a/chia/wallet/did_wallet/did_info.py +++ b/flax/wallet/did_wallet/did_info.py @@ -1,12 +1,12 @@ from dataclasses import dataclass from typing import List, Optional, Tuple -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.ints import uint64 -from chia.util.streamable import streamable, Streamable -from chia.wallet.cc_wallet.ccparent import CCParent -from chia.types.blockchain_format.program import Program -from chia.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.ints import uint64 +from flax.util.streamable import streamable, Streamable +from flax.wallet.cc_wallet.ccparent import CCParent +from flax.types.blockchain_format.program import Program +from flax.types.blockchain_format.coin import Coin @dataclass(frozen=True) diff --git a/chia/wallet/did_wallet/did_wallet.py b/flax/wallet/did_wallet/did_wallet.py similarity index 97% rename from chia/wallet/did_wallet/did_wallet.py rename to flax/wallet/did_wallet/did_wallet.py index 09e22872d..9e697c84d 100644 --- a/chia/wallet/did_wallet/did_wallet.py +++ b/flax/wallet/did_wallet/did_wallet.py @@ -6,28 +6,28 @@ from blspy import AugSchemeMPL, G1Element from secrets import token_bytes -from chia.protocols import wallet_protocol -from chia.protocols.wallet_protocol import RespondAdditions, RejectAdditionsRequest -from chia.server.outbound_message import NodeType -from chia.types.blockchain_format.coin import Coin -from chia.types.coin_solution import CoinSolution - -from chia.types.blockchain_format.program import Program -from chia.types.spend_bundle import SpendBundle -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.wallet.util.transaction_type import TransactionType -from chia.util.ints import uint64, uint32, uint8 - -from chia.wallet.did_wallet.did_info import DIDInfo -from chia.wallet.cc_wallet.ccparent import CCParent -from chia.wallet.transaction_record import TransactionRecord -from chia.wallet.util.wallet_types import WalletType -from chia.wallet.wallet import Wallet -from chia.wallet.wallet_coin_record import WalletCoinRecord -from chia.wallet.wallet_info import WalletInfo -from chia.wallet.derivation_record import DerivationRecord -from chia.wallet.did_wallet import did_wallet_puzzles -from chia.wallet.derive_keys import master_sk_to_wallet_sk +from flax.protocols import wallet_protocol +from flax.protocols.wallet_protocol import RespondAdditions, RejectAdditionsRequest +from flax.server.outbound_message import NodeType +from flax.types.blockchain_format.coin import Coin +from flax.types.coin_solution import CoinSolution + +from flax.types.blockchain_format.program import Program +from flax.types.spend_bundle import SpendBundle +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.wallet.util.transaction_type import TransactionType +from flax.util.ints import uint64, uint32, uint8 + +from flax.wallet.did_wallet.did_info import DIDInfo +from flax.wallet.cc_wallet.ccparent import CCParent +from flax.wallet.transaction_record import TransactionRecord +from flax.wallet.util.wallet_types import WalletType +from flax.wallet.wallet import Wallet +from flax.wallet.wallet_coin_record import WalletCoinRecord +from flax.wallet.wallet_info import WalletInfo +from flax.wallet.derivation_record import DerivationRecord +from flax.wallet.did_wallet import did_wallet_puzzles +from flax.wallet.derive_keys import master_sk_to_wallet_sk class DIDWallet: diff --git a/chia/wallet/did_wallet/did_wallet_puzzles.py b/flax/wallet/did_wallet/did_wallet_puzzles.py similarity index 88% rename from chia/wallet/did_wallet/did_wallet_puzzles.py rename to flax/wallet/did_wallet/did_wallet_puzzles.py index deb8572ee..36953ae20 100644 --- a/chia/wallet/did_wallet/did_wallet_puzzles.py +++ b/flax/wallet/did_wallet/did_wallet_puzzles.py @@ -1,13 +1,13 @@ from clvm_tools import binutils -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.blockchain_format.program import Program +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.blockchain_format.program import Program from typing import List, Optional, Tuple from blspy import G1Element -from chia.types.blockchain_format.coin import Coin -from chia.types.coin_solution import CoinSolution -from chia.util.ints import uint64 -from chia.wallet.puzzles.load_clvm import load_clvm -from chia.types.condition_opcodes import ConditionOpcode +from flax.types.blockchain_format.coin import Coin +from flax.types.coin_solution import CoinSolution +from flax.util.ints import uint64 +from flax.wallet.puzzles.load_clvm import load_clvm +from flax.types.condition_opcodes import ConditionOpcode DID_CORE_MOD = load_clvm("singleton_top_layer.clvm") DID_INNERPUZ_MOD = load_clvm("did_innerpuz.clvm") diff --git a/chia/wallet/chialisp.py b/flax/wallet/flaxlisp.py similarity index 100% rename from chia/wallet/chialisp.py rename to flax/wallet/flaxlisp.py diff --git a/chia/wallet/key_val_store.py b/flax/wallet/key_val_store.py similarity index 93% rename from chia/wallet/key_val_store.py rename to flax/wallet/key_val_store.py index 92f2ac287..b508b2295 100644 --- a/chia/wallet/key_val_store.py +++ b/flax/wallet/key_val_store.py @@ -2,9 +2,9 @@ import aiosqlite -from chia.util.byte_types import hexstr_to_bytes -from chia.util.db_wrapper import DBWrapper -from chia.util.streamable import Streamable +from flax.util.byte_types import hexstr_to_bytes +from flax.util.db_wrapper import DBWrapper +from flax.util.streamable import Streamable class KeyValStore: diff --git a/chia/wallet/puzzles/__init__.py b/flax/wallet/puzzles/__init__.py similarity index 100% rename from chia/wallet/puzzles/__init__.py rename to flax/wallet/puzzles/__init__.py diff --git a/chia/wallet/puzzles/block_program_zero.clvm b/flax/wallet/puzzles/block_program_zero.clvm similarity index 100% rename from chia/wallet/puzzles/block_program_zero.clvm rename to flax/wallet/puzzles/block_program_zero.clvm diff --git a/chia/wallet/puzzles/block_program_zero.clvm.hex b/flax/wallet/puzzles/block_program_zero.clvm.hex similarity index 100% rename from chia/wallet/puzzles/block_program_zero.clvm.hex rename to flax/wallet/puzzles/block_program_zero.clvm.hex diff --git a/chia/wallet/puzzles/block_program_zero.clvm.hex.sha256tree b/flax/wallet/puzzles/block_program_zero.clvm.hex.sha256tree similarity index 100% rename from chia/wallet/puzzles/block_program_zero.clvm.hex.sha256tree rename to flax/wallet/puzzles/block_program_zero.clvm.hex.sha256tree diff --git a/chia/wallet/puzzles/calculate_synthetic_public_key.clvm b/flax/wallet/puzzles/calculate_synthetic_public_key.clvm similarity index 100% rename from chia/wallet/puzzles/calculate_synthetic_public_key.clvm rename to flax/wallet/puzzles/calculate_synthetic_public_key.clvm diff --git a/chia/wallet/puzzles/calculate_synthetic_public_key.clvm.hex b/flax/wallet/puzzles/calculate_synthetic_public_key.clvm.hex similarity index 100% rename from chia/wallet/puzzles/calculate_synthetic_public_key.clvm.hex rename to flax/wallet/puzzles/calculate_synthetic_public_key.clvm.hex diff --git a/chia/wallet/puzzles/calculate_synthetic_public_key.clvm.hex.sha256tree b/flax/wallet/puzzles/calculate_synthetic_public_key.clvm.hex.sha256tree similarity index 100% rename from chia/wallet/puzzles/calculate_synthetic_public_key.clvm.hex.sha256tree rename to flax/wallet/puzzles/calculate_synthetic_public_key.clvm.hex.sha256tree diff --git a/chia/wallet/puzzles/cc.clvm b/flax/wallet/puzzles/cc.clvm similarity index 100% rename from chia/wallet/puzzles/cc.clvm rename to flax/wallet/puzzles/cc.clvm diff --git a/chia/wallet/puzzles/cc.clvm.hex b/flax/wallet/puzzles/cc.clvm.hex similarity index 100% rename from chia/wallet/puzzles/cc.clvm.hex rename to flax/wallet/puzzles/cc.clvm.hex diff --git a/chia/wallet/puzzles/cc.clvm.hex.sha256tree b/flax/wallet/puzzles/cc.clvm.hex.sha256tree similarity index 100% rename from chia/wallet/puzzles/cc.clvm.hex.sha256tree rename to flax/wallet/puzzles/cc.clvm.hex.sha256tree diff --git a/chia/wallet/puzzles/cc_loader.py b/flax/wallet/puzzles/cc_loader.py similarity index 74% rename from chia/wallet/puzzles/cc_loader.py rename to flax/wallet/puzzles/cc_loader.py index 5cfbc4f09..99ab2aba2 100644 --- a/chia/wallet/puzzles/cc_loader.py +++ b/flax/wallet/puzzles/cc_loader.py @@ -1,4 +1,4 @@ -from chia.wallet.puzzles.load_clvm import load_clvm +from flax.wallet.puzzles.load_clvm import load_clvm CC_MOD = load_clvm("cc.clvm", package_or_requirement=__name__) LOCK_INNER_PUZZLE = load_clvm("lock.inner.puzzle.clvm", package_or_requirement=__name__) diff --git a/chia/wallet/puzzles/condition_codes.clvm b/flax/wallet/puzzles/condition_codes.clvm similarity index 96% rename from chia/wallet/puzzles/condition_codes.clvm rename to flax/wallet/puzzles/condition_codes.clvm index f8f607ccd..98589b658 100644 --- a/chia/wallet/puzzles/condition_codes.clvm +++ b/flax/wallet/puzzles/condition_codes.clvm @@ -1,4 +1,4 @@ -; See chia/types/condition_opcodes.py +; See flax/types/condition_opcodes.py ( (defconstant AGG_SIG_UNSAFE 49) diff --git a/chia/wallet/puzzles/create-lock-puzzlehash.clvm b/flax/wallet/puzzles/create-lock-puzzlehash.clvm similarity index 100% rename from chia/wallet/puzzles/create-lock-puzzlehash.clvm rename to flax/wallet/puzzles/create-lock-puzzlehash.clvm diff --git a/chia/wallet/puzzles/create-lock-puzzlehash.clvm.hex.sha256tree b/flax/wallet/puzzles/create-lock-puzzlehash.clvm.hex.sha256tree similarity index 100% rename from chia/wallet/puzzles/create-lock-puzzlehash.clvm.hex.sha256tree rename to flax/wallet/puzzles/create-lock-puzzlehash.clvm.hex.sha256tree diff --git a/chia/wallet/puzzles/decompress_coin_solution_entry.clvm b/flax/wallet/puzzles/decompress_coin_solution_entry.clvm similarity index 100% rename from chia/wallet/puzzles/decompress_coin_solution_entry.clvm rename to flax/wallet/puzzles/decompress_coin_solution_entry.clvm diff --git a/chia/wallet/puzzles/decompress_coin_solution_entry.clvm.hex b/flax/wallet/puzzles/decompress_coin_solution_entry.clvm.hex similarity index 100% rename from chia/wallet/puzzles/decompress_coin_solution_entry.clvm.hex rename to flax/wallet/puzzles/decompress_coin_solution_entry.clvm.hex diff --git a/chia/wallet/puzzles/decompress_coin_solution_entry.clvm.hex.sha256tree b/flax/wallet/puzzles/decompress_coin_solution_entry.clvm.hex.sha256tree similarity index 100% rename from chia/wallet/puzzles/decompress_coin_solution_entry.clvm.hex.sha256tree rename to flax/wallet/puzzles/decompress_coin_solution_entry.clvm.hex.sha256tree diff --git a/chia/wallet/puzzles/decompress_coin_solution_entry_with_prefix.clvm b/flax/wallet/puzzles/decompress_coin_solution_entry_with_prefix.clvm similarity index 100% rename from chia/wallet/puzzles/decompress_coin_solution_entry_with_prefix.clvm rename to flax/wallet/puzzles/decompress_coin_solution_entry_with_prefix.clvm diff --git a/chia/wallet/puzzles/decompress_coin_solution_entry_with_prefix.clvm.hex b/flax/wallet/puzzles/decompress_coin_solution_entry_with_prefix.clvm.hex similarity index 100% rename from chia/wallet/puzzles/decompress_coin_solution_entry_with_prefix.clvm.hex rename to flax/wallet/puzzles/decompress_coin_solution_entry_with_prefix.clvm.hex diff --git a/chia/wallet/puzzles/decompress_coin_solution_entry_with_prefix.clvm.hex.sha256tree b/flax/wallet/puzzles/decompress_coin_solution_entry_with_prefix.clvm.hex.sha256tree similarity index 100% rename from chia/wallet/puzzles/decompress_coin_solution_entry_with_prefix.clvm.hex.sha256tree rename to flax/wallet/puzzles/decompress_coin_solution_entry_with_prefix.clvm.hex.sha256tree diff --git a/chia/wallet/puzzles/decompress_puzzle.clvm b/flax/wallet/puzzles/decompress_puzzle.clvm similarity index 100% rename from chia/wallet/puzzles/decompress_puzzle.clvm rename to flax/wallet/puzzles/decompress_puzzle.clvm diff --git a/chia/wallet/puzzles/decompress_puzzle.clvm.hex b/flax/wallet/puzzles/decompress_puzzle.clvm.hex similarity index 100% rename from chia/wallet/puzzles/decompress_puzzle.clvm.hex rename to flax/wallet/puzzles/decompress_puzzle.clvm.hex diff --git a/chia/wallet/puzzles/decompress_puzzle.clvm.hex.sha256tree b/flax/wallet/puzzles/decompress_puzzle.clvm.hex.sha256tree similarity index 100% rename from chia/wallet/puzzles/decompress_puzzle.clvm.hex.sha256tree rename to flax/wallet/puzzles/decompress_puzzle.clvm.hex.sha256tree diff --git a/chia/wallet/puzzles/did_innerpuz.clvm b/flax/wallet/puzzles/did_innerpuz.clvm similarity index 100% rename from chia/wallet/puzzles/did_innerpuz.clvm rename to flax/wallet/puzzles/did_innerpuz.clvm diff --git a/chia/wallet/puzzles/did_innerpuz.clvm.hex b/flax/wallet/puzzles/did_innerpuz.clvm.hex similarity index 100% rename from chia/wallet/puzzles/did_innerpuz.clvm.hex rename to flax/wallet/puzzles/did_innerpuz.clvm.hex diff --git a/chia/wallet/puzzles/did_innerpuz.clvm.hex.sha256tree b/flax/wallet/puzzles/did_innerpuz.clvm.hex.sha256tree similarity index 100% rename from chia/wallet/puzzles/did_innerpuz.clvm.hex.sha256tree rename to flax/wallet/puzzles/did_innerpuz.clvm.hex.sha256tree diff --git a/chia/wallet/puzzles/chialisp_deserialisation.clvm b/flax/wallet/puzzles/flaxlisp_deserialisation.clvm similarity index 100% rename from chia/wallet/puzzles/chialisp_deserialisation.clvm rename to flax/wallet/puzzles/flaxlisp_deserialisation.clvm diff --git a/chia/wallet/puzzles/chialisp_deserialisation.clvm.hex b/flax/wallet/puzzles/flaxlisp_deserialisation.clvm.hex similarity index 100% rename from chia/wallet/puzzles/chialisp_deserialisation.clvm.hex rename to flax/wallet/puzzles/flaxlisp_deserialisation.clvm.hex diff --git a/chia/wallet/puzzles/chialisp_deserialisation.clvm.hex.sha256tree b/flax/wallet/puzzles/flaxlisp_deserialisation.clvm.hex.sha256tree similarity index 100% rename from chia/wallet/puzzles/chialisp_deserialisation.clvm.hex.sha256tree rename to flax/wallet/puzzles/flaxlisp_deserialisation.clvm.hex.sha256tree diff --git a/chia/wallet/puzzles/generator_for_single_coin.clvm b/flax/wallet/puzzles/generator_for_single_coin.clvm similarity index 96% rename from chia/wallet/puzzles/generator_for_single_coin.clvm rename to flax/wallet/puzzles/generator_for_single_coin.clvm index 5fd940820..f6633b383 100644 --- a/chia/wallet/puzzles/generator_for_single_coin.clvm +++ b/flax/wallet/puzzles/generator_for_single_coin.clvm @@ -1,7 +1,7 @@ (mod (block_program block_ref coinname) (defconstant local_deserialize_mod - ;; this monstrosity is the assembly output of `chialisp_deserialisation.clvm` + ;; this monstrosity is the assembly output of `flaxlisp_deserialisation.clvm` ;; it's pasted in here because the compiler doesn't yet support nested `mod` ;; my apologies -- RK diff --git a/chia/wallet/puzzles/generator_for_single_coin.clvm.hex b/flax/wallet/puzzles/generator_for_single_coin.clvm.hex similarity index 100% rename from chia/wallet/puzzles/generator_for_single_coin.clvm.hex rename to flax/wallet/puzzles/generator_for_single_coin.clvm.hex diff --git a/chia/wallet/puzzles/generator_for_single_coin.clvm.hex.sha256tree b/flax/wallet/puzzles/generator_for_single_coin.clvm.hex.sha256tree similarity index 100% rename from chia/wallet/puzzles/generator_for_single_coin.clvm.hex.sha256tree rename to flax/wallet/puzzles/generator_for_single_coin.clvm.hex.sha256tree diff --git a/chia/wallet/puzzles/generator_loader.py b/flax/wallet/puzzles/generator_loader.py similarity index 65% rename from chia/wallet/puzzles/generator_loader.py rename to flax/wallet/puzzles/generator_loader.py index 0cc98b9ce..b811c97ed 100644 --- a/chia/wallet/puzzles/generator_loader.py +++ b/flax/wallet/puzzles/generator_loader.py @@ -1,3 +1,3 @@ -from chia.wallet.puzzles.load_clvm import load_serialized_clvm +from flax.wallet.puzzles.load_clvm import load_serialized_clvm GENERATOR_FOR_SINGLE_COIN_MOD = load_serialized_clvm("generator_for_single_coin.clvm", package_or_requirement=__name__) diff --git a/chia/wallet/puzzles/genesis-by-coin-id-with-0.clvm b/flax/wallet/puzzles/genesis-by-coin-id-with-0.clvm similarity index 100% rename from chia/wallet/puzzles/genesis-by-coin-id-with-0.clvm rename to flax/wallet/puzzles/genesis-by-coin-id-with-0.clvm diff --git a/chia/wallet/puzzles/genesis-by-coin-id-with-0.clvm.hex b/flax/wallet/puzzles/genesis-by-coin-id-with-0.clvm.hex similarity index 100% rename from chia/wallet/puzzles/genesis-by-coin-id-with-0.clvm.hex rename to flax/wallet/puzzles/genesis-by-coin-id-with-0.clvm.hex diff --git a/chia/wallet/puzzles/genesis-by-coin-id-with-0.clvm.hex.sha256tree b/flax/wallet/puzzles/genesis-by-coin-id-with-0.clvm.hex.sha256tree similarity index 100% rename from chia/wallet/puzzles/genesis-by-coin-id-with-0.clvm.hex.sha256tree rename to flax/wallet/puzzles/genesis-by-coin-id-with-0.clvm.hex.sha256tree diff --git a/chia/wallet/puzzles/genesis-by-puzzle-hash-with-0.clvm b/flax/wallet/puzzles/genesis-by-puzzle-hash-with-0.clvm similarity index 100% rename from chia/wallet/puzzles/genesis-by-puzzle-hash-with-0.clvm rename to flax/wallet/puzzles/genesis-by-puzzle-hash-with-0.clvm diff --git a/chia/wallet/puzzles/genesis-by-puzzle-hash-with-0.clvm.hex b/flax/wallet/puzzles/genesis-by-puzzle-hash-with-0.clvm.hex similarity index 100% rename from chia/wallet/puzzles/genesis-by-puzzle-hash-with-0.clvm.hex rename to flax/wallet/puzzles/genesis-by-puzzle-hash-with-0.clvm.hex diff --git a/chia/wallet/puzzles/genesis-by-puzzle-hash-with-0.clvm.hex.sha256tree b/flax/wallet/puzzles/genesis-by-puzzle-hash-with-0.clvm.hex.sha256tree similarity index 100% rename from chia/wallet/puzzles/genesis-by-puzzle-hash-with-0.clvm.hex.sha256tree rename to flax/wallet/puzzles/genesis-by-puzzle-hash-with-0.clvm.hex.sha256tree diff --git a/chia/wallet/puzzles/genesis_by_coin_id_with_0.py b/flax/wallet/puzzles/genesis_by_coin_id_with_0.py similarity index 84% rename from chia/wallet/puzzles/genesis_by_coin_id_with_0.py rename to flax/wallet/puzzles/genesis_by_coin_id_with_0.py index 3b473d64c..2e715d097 100644 --- a/chia/wallet/puzzles/genesis_by_coin_id_with_0.py +++ b/flax/wallet/puzzles/genesis_by_coin_id_with_0.py @@ -1,9 +1,9 @@ from typing import Optional -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.program import Program -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.wallet.puzzles.load_clvm import load_clvm +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.program import Program +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.wallet.puzzles.load_clvm import load_clvm MOD = load_clvm("genesis-by-coin-id-with-0.clvm", package_or_requirement=__name__) diff --git a/chia/wallet/puzzles/genesis_by_puzzle_hash_with_0.py b/flax/wallet/puzzles/genesis_by_puzzle_hash_with_0.py similarity index 85% rename from chia/wallet/puzzles/genesis_by_puzzle_hash_with_0.py rename to flax/wallet/puzzles/genesis_by_puzzle_hash_with_0.py index 538299024..ce8d3c4d2 100644 --- a/chia/wallet/puzzles/genesis_by_puzzle_hash_with_0.py +++ b/flax/wallet/puzzles/genesis_by_puzzle_hash_with_0.py @@ -1,9 +1,9 @@ from typing import Optional -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.program import Program -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.wallet.puzzles.load_clvm import load_clvm +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.program import Program +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.wallet.puzzles.load_clvm import load_clvm MOD = load_clvm("genesis-by-puzzle-hash-with-0.clvm", package_or_requirement=__name__) diff --git a/chia/wallet/puzzles/load_clvm.py b/flax/wallet/puzzles/load_clvm.py similarity index 95% rename from chia/wallet/puzzles/load_clvm.py rename to flax/wallet/puzzles/load_clvm.py index cb9b89f84..c15a1d5b1 100644 --- a/chia/wallet/puzzles/load_clvm.py +++ b/flax/wallet/puzzles/load_clvm.py @@ -3,7 +3,7 @@ import pkg_resources from clvm_tools.clvmc import compile_clvm -from chia.types.blockchain_format.program import Program, SerializedProgram +from flax.types.blockchain_format.program import Program, SerializedProgram def load_serialized_clvm(clvm_filename, package_or_requirement=__name__) -> SerializedProgram: diff --git a/chia/wallet/puzzles/lock.inner.puzzle.clvm b/flax/wallet/puzzles/lock.inner.puzzle.clvm similarity index 100% rename from chia/wallet/puzzles/lock.inner.puzzle.clvm rename to flax/wallet/puzzles/lock.inner.puzzle.clvm diff --git a/chia/wallet/puzzles/lock.inner.puzzle.clvm.hex b/flax/wallet/puzzles/lock.inner.puzzle.clvm.hex similarity index 100% rename from chia/wallet/puzzles/lock.inner.puzzle.clvm.hex rename to flax/wallet/puzzles/lock.inner.puzzle.clvm.hex diff --git a/chia/wallet/puzzles/lock.inner.puzzle.clvm.hex.sha256tree b/flax/wallet/puzzles/lock.inner.puzzle.clvm.hex.sha256tree similarity index 100% rename from chia/wallet/puzzles/lock.inner.puzzle.clvm.hex.sha256tree rename to flax/wallet/puzzles/lock.inner.puzzle.clvm.hex.sha256tree diff --git a/chia/wallet/puzzles/p2_conditions.clvm b/flax/wallet/puzzles/p2_conditions.clvm similarity index 100% rename from chia/wallet/puzzles/p2_conditions.clvm rename to flax/wallet/puzzles/p2_conditions.clvm diff --git a/chia/wallet/puzzles/p2_conditions.clvm.hex b/flax/wallet/puzzles/p2_conditions.clvm.hex similarity index 100% rename from chia/wallet/puzzles/p2_conditions.clvm.hex rename to flax/wallet/puzzles/p2_conditions.clvm.hex diff --git a/chia/wallet/puzzles/p2_conditions.clvm.hex.sha256tree b/flax/wallet/puzzles/p2_conditions.clvm.hex.sha256tree similarity index 100% rename from chia/wallet/puzzles/p2_conditions.clvm.hex.sha256tree rename to flax/wallet/puzzles/p2_conditions.clvm.hex.sha256tree diff --git a/chia/wallet/puzzles/p2_conditions.py b/flax/wallet/puzzles/p2_conditions.py similarity index 91% rename from chia/wallet/puzzles/p2_conditions.py rename to flax/wallet/puzzles/p2_conditions.py index f43bdecd9..82351e3a1 100644 --- a/chia/wallet/puzzles/p2_conditions.py +++ b/flax/wallet/puzzles/p2_conditions.py @@ -10,7 +10,7 @@ the doctor ordered. """ -from chia.types.blockchain_format.program import Program +from flax.types.blockchain_format.program import Program from .load_clvm import load_clvm diff --git a/chia/wallet/puzzles/p2_delegated_conditions.clvm b/flax/wallet/puzzles/p2_delegated_conditions.clvm similarity index 100% rename from chia/wallet/puzzles/p2_delegated_conditions.clvm rename to flax/wallet/puzzles/p2_delegated_conditions.clvm diff --git a/chia/wallet/puzzles/p2_delegated_conditions.clvm.hex b/flax/wallet/puzzles/p2_delegated_conditions.clvm.hex similarity index 100% rename from chia/wallet/puzzles/p2_delegated_conditions.clvm.hex rename to flax/wallet/puzzles/p2_delegated_conditions.clvm.hex diff --git a/chia/wallet/puzzles/p2_delegated_conditions.clvm.hex.sha256tree b/flax/wallet/puzzles/p2_delegated_conditions.clvm.hex.sha256tree similarity index 100% rename from chia/wallet/puzzles/p2_delegated_conditions.clvm.hex.sha256tree rename to flax/wallet/puzzles/p2_delegated_conditions.clvm.hex.sha256tree diff --git a/chia/wallet/puzzles/p2_delegated_conditions.py b/flax/wallet/puzzles/p2_delegated_conditions.py similarity index 87% rename from chia/wallet/puzzles/p2_delegated_conditions.py rename to flax/wallet/puzzles/p2_delegated_conditions.py index f17522b17..ea2d1a6f6 100644 --- a/chia/wallet/puzzles/p2_delegated_conditions.py +++ b/flax/wallet/puzzles/p2_delegated_conditions.py @@ -6,7 +6,7 @@ """ -from chia.types.blockchain_format.program import Program +from flax.types.blockchain_format.program import Program from .load_clvm import load_clvm diff --git a/chia/wallet/puzzles/p2_delegated_puzzle.clvm b/flax/wallet/puzzles/p2_delegated_puzzle.clvm similarity index 100% rename from chia/wallet/puzzles/p2_delegated_puzzle.clvm rename to flax/wallet/puzzles/p2_delegated_puzzle.clvm diff --git a/chia/wallet/puzzles/p2_delegated_puzzle.clvm.hex b/flax/wallet/puzzles/p2_delegated_puzzle.clvm.hex similarity index 100% rename from chia/wallet/puzzles/p2_delegated_puzzle.clvm.hex rename to flax/wallet/puzzles/p2_delegated_puzzle.clvm.hex diff --git a/chia/wallet/puzzles/p2_delegated_puzzle.clvm.hex.sha256tree b/flax/wallet/puzzles/p2_delegated_puzzle.clvm.hex.sha256tree similarity index 100% rename from chia/wallet/puzzles/p2_delegated_puzzle.clvm.hex.sha256tree rename to flax/wallet/puzzles/p2_delegated_puzzle.clvm.hex.sha256tree diff --git a/chia/wallet/puzzles/p2_delegated_puzzle.py b/flax/wallet/puzzles/p2_delegated_puzzle.py similarity index 94% rename from chia/wallet/puzzles/p2_delegated_puzzle.py rename to flax/wallet/puzzles/p2_delegated_puzzle.py index a1bb20a50..df3773b8a 100644 --- a/chia/wallet/puzzles/p2_delegated_puzzle.py +++ b/flax/wallet/puzzles/p2_delegated_puzzle.py @@ -12,7 +12,7 @@ This roughly corresponds to bitcoin's graftroot. """ -from chia.types.blockchain_format.program import Program +from flax.types.blockchain_format.program import Program from . import p2_conditions from .load_clvm import load_clvm diff --git a/chia/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.clvm b/flax/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.clvm similarity index 100% rename from chia/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.clvm rename to flax/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.clvm diff --git a/chia/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.clvm.hex b/flax/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.clvm.hex similarity index 100% rename from chia/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.clvm.hex rename to flax/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.clvm.hex diff --git a/chia/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.clvm.hex.sha256tree b/flax/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.clvm.hex.sha256tree similarity index 100% rename from chia/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.clvm.hex.sha256tree rename to flax/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.clvm.hex.sha256tree diff --git a/chia/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.py b/flax/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.py similarity index 96% rename from chia/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.py rename to flax/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.py index 1308234c2..376456589 100644 --- a/chia/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.py +++ b/flax/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.py @@ -19,8 +19,8 @@ from blspy import G1Element, PrivateKey from clvm.casts import int_from_bytes -from chia.types.blockchain_format.program import Program -from chia.types.blockchain_format.sized_bytes import bytes32 +from flax.types.blockchain_format.program import Program +from flax.types.blockchain_format.sized_bytes import bytes32 from .load_clvm import load_clvm from .p2_conditions import puzzle_for_conditions diff --git a/chia/wallet/puzzles/p2_m_of_n_delegate_direct.clvm b/flax/wallet/puzzles/p2_m_of_n_delegate_direct.clvm similarity index 100% rename from chia/wallet/puzzles/p2_m_of_n_delegate_direct.clvm rename to flax/wallet/puzzles/p2_m_of_n_delegate_direct.clvm diff --git a/chia/wallet/puzzles/p2_m_of_n_delegate_direct.clvm.hex b/flax/wallet/puzzles/p2_m_of_n_delegate_direct.clvm.hex similarity index 100% rename from chia/wallet/puzzles/p2_m_of_n_delegate_direct.clvm.hex rename to flax/wallet/puzzles/p2_m_of_n_delegate_direct.clvm.hex diff --git a/chia/wallet/puzzles/p2_m_of_n_delegate_direct.clvm.hex.sha256tree b/flax/wallet/puzzles/p2_m_of_n_delegate_direct.clvm.hex.sha256tree similarity index 100% rename from chia/wallet/puzzles/p2_m_of_n_delegate_direct.clvm.hex.sha256tree rename to flax/wallet/puzzles/p2_m_of_n_delegate_direct.clvm.hex.sha256tree diff --git a/chia/wallet/puzzles/p2_m_of_n_delegate_direct.py b/flax/wallet/puzzles/p2_m_of_n_delegate_direct.py similarity index 90% rename from chia/wallet/puzzles/p2_m_of_n_delegate_direct.py rename to flax/wallet/puzzles/p2_m_of_n_delegate_direct.py index 6d8f18aec..ae17ca74d 100644 --- a/chia/wallet/puzzles/p2_m_of_n_delegate_direct.py +++ b/flax/wallet/puzzles/p2_m_of_n_delegate_direct.py @@ -5,7 +5,7 @@ it includes N public keys, any M of which needs to sign the delegated puzzle. """ -from chia.types.blockchain_format.program import Program +from flax.types.blockchain_format.program import Program from .load_clvm import load_clvm diff --git a/chia/wallet/puzzles/p2_puzzle_hash.clvm b/flax/wallet/puzzles/p2_puzzle_hash.clvm similarity index 100% rename from chia/wallet/puzzles/p2_puzzle_hash.clvm rename to flax/wallet/puzzles/p2_puzzle_hash.clvm diff --git a/chia/wallet/puzzles/p2_puzzle_hash.clvm.hex b/flax/wallet/puzzles/p2_puzzle_hash.clvm.hex similarity index 100% rename from chia/wallet/puzzles/p2_puzzle_hash.clvm.hex rename to flax/wallet/puzzles/p2_puzzle_hash.clvm.hex diff --git a/chia/wallet/puzzles/p2_puzzle_hash.clvm.hex.sha256tree b/flax/wallet/puzzles/p2_puzzle_hash.clvm.hex.sha256tree similarity index 100% rename from chia/wallet/puzzles/p2_puzzle_hash.clvm.hex.sha256tree rename to flax/wallet/puzzles/p2_puzzle_hash.clvm.hex.sha256tree diff --git a/chia/wallet/puzzles/p2_puzzle_hash.py b/flax/wallet/puzzles/p2_puzzle_hash.py similarity index 84% rename from chia/wallet/puzzles/p2_puzzle_hash.py rename to flax/wallet/puzzles/p2_puzzle_hash.py index fcb0de2c1..7846c4af6 100644 --- a/chia/wallet/puzzles/p2_puzzle_hash.py +++ b/flax/wallet/puzzles/p2_puzzle_hash.py @@ -5,8 +5,8 @@ hash along with its solution. """ -from chia.types.blockchain_format.program import Program -from chia.types.blockchain_format.sized_bytes import bytes32 +from flax.types.blockchain_format.program import Program +from flax.types.blockchain_format.sized_bytes import bytes32 from .load_clvm import load_clvm diff --git a/chia/wallet/puzzles/prefarm/make_prefarm_ph.py b/flax/wallet/puzzles/prefarm/make_prefarm_ph.py similarity index 66% rename from chia/wallet/puzzles/prefarm/make_prefarm_ph.py rename to flax/wallet/puzzles/prefarm/make_prefarm_ph.py index a611c3762..16e735128 100644 --- a/chia/wallet/puzzles/prefarm/make_prefarm_ph.py +++ b/flax/wallet/puzzles/prefarm/make_prefarm_ph.py @@ -1,15 +1,15 @@ from clvm.casts import int_from_bytes from clvm_tools import binutils -from chia.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward -from chia.types.blockchain_format.program import Program -from chia.types.condition_opcodes import ConditionOpcode -from chia.util.bech32m import decode_puzzle_hash, encode_puzzle_hash -from chia.util.condition_tools import parse_sexp_to_conditions -from chia.util.ints import uint32 +from flax.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward +from flax.types.blockchain_format.program import Program +from flax.types.condition_opcodes import ConditionOpcode +from flax.util.bech32m import decode_puzzle_hash, encode_puzzle_hash +from flax.util.condition_tools import parse_sexp_to_conditions +from flax.util.ints import uint32 -address1 = "txch15gx26ndmacfaqlq8m0yajeggzceu7cvmaz4df0hahkukes695rss6lej7h" # Gene wallet (m/12381/8444/2/42): -address2 = "txch1c2cguswhvmdyz9hr3q6hak2h6p9dw4rz82g4707k2xy2sarv705qcce4pn" # Mariano address (m/12381/8444/2/0) +address1 = "txfx15gx26ndmacfaqlq8m0yajeggzceu7cvmaz4df0hahkukes695rss6lej7h" # Gene wallet (m/12381/8444/2/42): +address2 = "txfx1c2cguswhvmdyz9hr3q6hak2h6p9dw4rz82g4707k2xy2sarv705qcce4pn" # Mariano address (m/12381/8444/2/0) ph1 = decode_puzzle_hash(address1) ph2 = decode_puzzle_hash(address2) @@ -30,32 +30,32 @@ def make_puzzle(amount: int) -> int: puzzle_hash = puzzle_prog.get_tree_hash() solution = "()" - prefix = "xch" + prefix = "xfx" print("PH", puzzle_hash) print(f"Address: {encode_puzzle_hash(puzzle_hash, prefix)}") result = puzzle_prog.run(solution) error, result_human = parse_sexp_to_conditions(result) - total_chia = 0 + total_flax = 0 if error: print(f"Error: {error}") else: assert result_human is not None for cvp in result_human: assert len(cvp.vars) == 2 - total_chia += int_from_bytes(cvp.vars[1]) + total_flax += int_from_bytes(cvp.vars[1]) print( f"{ConditionOpcode(cvp.opcode).name}: {encode_puzzle_hash(cvp.vars[0], prefix)}," f" amount: {int_from_bytes(cvp.vars[1])}" ) - return total_chia + return total_flax -total_chia = 0 +total_flax = 0 print("Pool address: ") -total_chia += make_puzzle(pool_amounts) +total_flax += make_puzzle(pool_amounts) print("\nFarmer address: ") -total_chia += make_puzzle(farmer_amounts) +total_flax += make_puzzle(farmer_amounts) -assert total_chia == calculate_base_farmer_reward(uint32(0)) + calculate_pool_reward(uint32(0)) +assert total_flax == calculate_base_farmer_reward(uint32(0)) + calculate_pool_reward(uint32(0)) diff --git a/chia/wallet/puzzles/prefarm/spend_prefarm.py b/flax/wallet/puzzles/prefarm/spend_prefarm.py similarity index 77% rename from chia/wallet/puzzles/prefarm/spend_prefarm.py rename to flax/wallet/puzzles/prefarm/spend_prefarm.py index 62cb94b38..aeae10532 100644 --- a/chia/wallet/puzzles/prefarm/spend_prefarm.py +++ b/flax/wallet/puzzles/prefarm/spend_prefarm.py @@ -3,15 +3,15 @@ from blspy import G2Element from clvm_tools import binutils -from chia.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward -from chia.rpc.full_node_rpc_client import FullNodeRpcClient -from chia.types.blockchain_format.program import Program -from chia.types.coin_solution import CoinSolution -from chia.types.spend_bundle import SpendBundle -from chia.util.bech32m import decode_puzzle_hash -from chia.util.config import load_config -from chia.util.default_root import DEFAULT_ROOT_PATH -from chia.util.ints import uint32, uint16 +from flax.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward +from flax.rpc.full_node_rpc_client import FullNodeRpcClient +from flax.types.blockchain_format.program import Program +from flax.types.coin_solution import CoinSolution +from flax.types.spend_bundle import SpendBundle +from flax.util.bech32m import decode_puzzle_hash +from flax.util.config import load_config +from flax.util.default_root import DEFAULT_ROOT_PATH +from flax.util.ints import uint32, uint16 async def main() -> None: @@ -29,8 +29,8 @@ async def main() -> None: print(farmer_prefarm.amount, farmer_amounts) assert farmer_amounts == farmer_prefarm.amount // 2 assert pool_amounts == pool_prefarm.amount // 2 - address1 = "xch1rdatypul5c642jkeh4yp933zu3hw8vv8tfup8ta6zfampnyhjnusxdgns6" # Key 1 - address2 = "xch1duvy5ur5eyj7lp5geetfg84cj2d7xgpxt7pya3lr2y6ke3696w9qvda66e" # Key 2 + address1 = "xfx1rdatypul5c642jkeh4yp933zu3hw8vv8tfup8ta6zfampnyhjnusxdgns6" # Key 1 + address2 = "xfx1duvy5ur5eyj7lp5geetfg84cj2d7xgpxt7pya3lr2y6ke3696w9qvda66e" # Key 2 ph1 = decode_puzzle_hash(address1) ph2 = decode_puzzle_hash(address2) diff --git a/chia/wallet/puzzles/puzzle_utils.py b/flax/wallet/puzzles/puzzle_utils.py similarity index 96% rename from chia/wallet/puzzles/puzzle_utils.py rename to flax/wallet/puzzles/puzzle_utils.py index 961b9aefb..1a44a92b5 100644 --- a/chia/wallet/puzzles/puzzle_utils.py +++ b/flax/wallet/puzzles/puzzle_utils.py @@ -1,4 +1,4 @@ -from chia.util.condition_tools import ConditionOpcode +from flax.util.condition_tools import ConditionOpcode def make_create_coin_condition(puzzle_hash, amount): diff --git a/chia/wallet/puzzles/recompile-all.sh b/flax/wallet/puzzles/recompile-all.sh old mode 100755 new mode 100644 similarity index 100% rename from chia/wallet/puzzles/recompile-all.sh rename to flax/wallet/puzzles/recompile-all.sh diff --git a/chia/wallet/puzzles/rl.clvm b/flax/wallet/puzzles/rl.clvm similarity index 100% rename from chia/wallet/puzzles/rl.clvm rename to flax/wallet/puzzles/rl.clvm diff --git a/chia/wallet/puzzles/rl.clvm.hex b/flax/wallet/puzzles/rl.clvm.hex similarity index 100% rename from chia/wallet/puzzles/rl.clvm.hex rename to flax/wallet/puzzles/rl.clvm.hex diff --git a/chia/wallet/puzzles/rl.clvm.hex.sha256tree b/flax/wallet/puzzles/rl.clvm.hex.sha256tree similarity index 100% rename from chia/wallet/puzzles/rl.clvm.hex.sha256tree rename to flax/wallet/puzzles/rl.clvm.hex.sha256tree diff --git a/chia/wallet/puzzles/rl_aggregation.clvm b/flax/wallet/puzzles/rl_aggregation.clvm similarity index 100% rename from chia/wallet/puzzles/rl_aggregation.clvm rename to flax/wallet/puzzles/rl_aggregation.clvm diff --git a/chia/wallet/puzzles/rl_aggregation.clvm.hex b/flax/wallet/puzzles/rl_aggregation.clvm.hex similarity index 100% rename from chia/wallet/puzzles/rl_aggregation.clvm.hex rename to flax/wallet/puzzles/rl_aggregation.clvm.hex diff --git a/chia/wallet/puzzles/rl_aggregation.clvm.hex.sha256tree b/flax/wallet/puzzles/rl_aggregation.clvm.hex.sha256tree similarity index 100% rename from chia/wallet/puzzles/rl_aggregation.clvm.hex.sha256tree rename to flax/wallet/puzzles/rl_aggregation.clvm.hex.sha256tree diff --git a/chia/wallet/puzzles/rom_bootstrap_generator.clvm b/flax/wallet/puzzles/rom_bootstrap_generator.clvm similarity index 96% rename from chia/wallet/puzzles/rom_bootstrap_generator.clvm rename to flax/wallet/puzzles/rom_bootstrap_generator.clvm index ca5038232..c6254019f 100644 --- a/chia/wallet/puzzles/rom_bootstrap_generator.clvm +++ b/flax/wallet/puzzles/rom_bootstrap_generator.clvm @@ -1,7 +1,7 @@ (mod (block_decompresser_program (historical_blocks_tree)) (defconstant local_deserialize_mod - ;; this monstrosity is the assembly output of `chialisp_deserialisation.clvm` + ;; this monstrosity is the assembly output of `flaxlisp_deserialisation.clvm` ;; it's pasted in here because the compiler doesn't yet support nested `mod` ;; my apologies -- RK diff --git a/chia/wallet/puzzles/rom_bootstrap_generator.clvm.hex b/flax/wallet/puzzles/rom_bootstrap_generator.clvm.hex similarity index 100% rename from chia/wallet/puzzles/rom_bootstrap_generator.clvm.hex rename to flax/wallet/puzzles/rom_bootstrap_generator.clvm.hex diff --git a/chia/wallet/puzzles/rom_bootstrap_generator.clvm.hex.sha256tree b/flax/wallet/puzzles/rom_bootstrap_generator.clvm.hex.sha256tree similarity index 100% rename from chia/wallet/puzzles/rom_bootstrap_generator.clvm.hex.sha256tree rename to flax/wallet/puzzles/rom_bootstrap_generator.clvm.hex.sha256tree diff --git a/chia/wallet/puzzles/rom_bootstrap_generator.py b/flax/wallet/puzzles/rom_bootstrap_generator.py similarity index 71% rename from chia/wallet/puzzles/rom_bootstrap_generator.py rename to flax/wallet/puzzles/rom_bootstrap_generator.py index f714719a1..cd8bb04ae 100644 --- a/chia/wallet/puzzles/rom_bootstrap_generator.py +++ b/flax/wallet/puzzles/rom_bootstrap_generator.py @@ -1,4 +1,4 @@ -from chia.types.blockchain_format.program import SerializedProgram +from flax.types.blockchain_format.program import SerializedProgram from .load_clvm import load_clvm diff --git a/chia/wallet/puzzles/sha256tree_module.clvm b/flax/wallet/puzzles/sha256tree_module.clvm similarity index 100% rename from chia/wallet/puzzles/sha256tree_module.clvm rename to flax/wallet/puzzles/sha256tree_module.clvm diff --git a/chia/wallet/puzzles/sha256tree_module.clvm.hex b/flax/wallet/puzzles/sha256tree_module.clvm.hex similarity index 100% rename from chia/wallet/puzzles/sha256tree_module.clvm.hex rename to flax/wallet/puzzles/sha256tree_module.clvm.hex diff --git a/chia/wallet/puzzles/sha256tree_module.clvm.hex.sha256tree b/flax/wallet/puzzles/sha256tree_module.clvm.hex.sha256tree similarity index 100% rename from chia/wallet/puzzles/sha256tree_module.clvm.hex.sha256tree rename to flax/wallet/puzzles/sha256tree_module.clvm.hex.sha256tree diff --git a/chia/wallet/puzzles/singleton_top_layer.clvm b/flax/wallet/puzzles/singleton_top_layer.clvm similarity index 100% rename from chia/wallet/puzzles/singleton_top_layer.clvm rename to flax/wallet/puzzles/singleton_top_layer.clvm diff --git a/chia/wallet/puzzles/singleton_top_layer.clvm.hex b/flax/wallet/puzzles/singleton_top_layer.clvm.hex similarity index 100% rename from chia/wallet/puzzles/singleton_top_layer.clvm.hex rename to flax/wallet/puzzles/singleton_top_layer.clvm.hex diff --git a/chia/wallet/puzzles/singleton_top_layer.clvm.hex.sha256tree b/flax/wallet/puzzles/singleton_top_layer.clvm.hex.sha256tree similarity index 100% rename from chia/wallet/puzzles/singleton_top_layer.clvm.hex.sha256tree rename to flax/wallet/puzzles/singleton_top_layer.clvm.hex.sha256tree diff --git a/chia/wallet/puzzles/test_cc.py b/flax/wallet/puzzles/test_cc.py similarity index 92% rename from chia/wallet/puzzles/test_cc.py rename to flax/wallet/puzzles/test_cc.py index d88a5d1b9..ef9042c85 100644 --- a/chia/wallet/puzzles/test_cc.py +++ b/flax/wallet/puzzles/test_cc.py @@ -5,22 +5,22 @@ from blspy import G2Element -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.program import Program -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.condition_opcodes import ConditionOpcode -from chia.types.spend_bundle import CoinSolution, SpendBundle -from chia.util.ints import uint64 -from chia.wallet.cc_wallet.cc_utils import ( +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.program import Program +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.condition_opcodes import ConditionOpcode +from flax.types.spend_bundle import CoinSolution, SpendBundle +from flax.util.ints import uint64 +from flax.wallet.cc_wallet.cc_utils import ( CC_MOD, cc_puzzle_for_inner_puzzle, cc_puzzle_hash_for_inner_puzzle_hash, spend_bundle_for_spendable_ccs, spendable_cc_list_from_coin_solution, ) -from chia.wallet.cc_wallet.debug_spend_bundle import debug_spend_bundle -from chia.wallet.puzzles.genesis_by_coin_id_with_0 import create_genesis_or_zero_coin_checker -from chia.wallet.puzzles.genesis_by_puzzle_hash_with_0 import create_genesis_puzzle_or_zero_coin_checker +from flax.wallet.cc_wallet.debug_spend_bundle import debug_spend_bundle +from flax.wallet.puzzles.genesis_by_coin_id_with_0 import create_genesis_or_zero_coin_checker +from flax.wallet.puzzles.genesis_by_puzzle_hash_with_0 import create_genesis_puzzle_or_zero_coin_checker CONDITIONS = dict((k, bytes(v)[0]) for k, v in ConditionOpcode.__members__.items()) # pylint: disable=E1101 @@ -199,7 +199,7 @@ def test_spend_zero_coin(mod_code: Program, coin_checker_for_farmed_coin): assert len(eve_cc_list) == 1 eve_cc_spendable = eve_cc_list[0] - # farm regular chia + # farm regular flax farmed_coin = generate_farmed_coin(2, eve_inner_puzzle_hash, amount=500) diff --git a/chia/wallet/puzzles/test_generator_deserialize.clvm b/flax/wallet/puzzles/test_generator_deserialize.clvm similarity index 100% rename from chia/wallet/puzzles/test_generator_deserialize.clvm rename to flax/wallet/puzzles/test_generator_deserialize.clvm diff --git a/chia/wallet/puzzles/test_generator_deserialize.clvm.hex b/flax/wallet/puzzles/test_generator_deserialize.clvm.hex similarity index 100% rename from chia/wallet/puzzles/test_generator_deserialize.clvm.hex rename to flax/wallet/puzzles/test_generator_deserialize.clvm.hex diff --git a/chia/wallet/puzzles/test_generator_deserialize.clvm.hex.sha256tree b/flax/wallet/puzzles/test_generator_deserialize.clvm.hex.sha256tree similarity index 100% rename from chia/wallet/puzzles/test_generator_deserialize.clvm.hex.sha256tree rename to flax/wallet/puzzles/test_generator_deserialize.clvm.hex.sha256tree diff --git a/chia/wallet/puzzles/test_multiple_generator_input_arguments.clvm b/flax/wallet/puzzles/test_multiple_generator_input_arguments.clvm similarity index 100% rename from chia/wallet/puzzles/test_multiple_generator_input_arguments.clvm rename to flax/wallet/puzzles/test_multiple_generator_input_arguments.clvm diff --git a/chia/wallet/puzzles/test_multiple_generator_input_arguments.clvm.hex b/flax/wallet/puzzles/test_multiple_generator_input_arguments.clvm.hex similarity index 100% rename from chia/wallet/puzzles/test_multiple_generator_input_arguments.clvm.hex rename to flax/wallet/puzzles/test_multiple_generator_input_arguments.clvm.hex diff --git a/chia/wallet/puzzles/test_multiple_generator_input_arguments.clvm.hex.sha256tree b/flax/wallet/puzzles/test_multiple_generator_input_arguments.clvm.hex.sha256tree similarity index 100% rename from chia/wallet/puzzles/test_multiple_generator_input_arguments.clvm.hex.sha256tree rename to flax/wallet/puzzles/test_multiple_generator_input_arguments.clvm.hex.sha256tree diff --git a/chia/wallet/rl_wallet/__init__.py b/flax/wallet/rl_wallet/__init__.py similarity index 100% rename from chia/wallet/rl_wallet/__init__.py rename to flax/wallet/rl_wallet/__init__.py diff --git a/chia/wallet/rl_wallet/rl_wallet.py b/flax/wallet/rl_wallet/rl_wallet.py similarity index 96% rename from chia/wallet/rl_wallet/rl_wallet.py rename to flax/wallet/rl_wallet/rl_wallet.py index c718e2f19..87aa2b9e2 100644 --- a/chia/wallet/rl_wallet/rl_wallet.py +++ b/flax/wallet/rl_wallet/rl_wallet.py @@ -8,17 +8,17 @@ from blspy import AugSchemeMPL, G1Element, PrivateKey -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.program import Program -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.coin_solution import CoinSolution -from chia.types.spend_bundle import SpendBundle -from chia.util.byte_types import hexstr_to_bytes -from chia.util.ints import uint8, uint32, uint64, uint128 -from chia.util.streamable import Streamable, streamable -from chia.wallet.derivation_record import DerivationRecord -from chia.wallet.derive_keys import master_sk_to_wallet_sk -from chia.wallet.rl_wallet.rl_wallet_puzzles import ( +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.program import Program +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.coin_solution import CoinSolution +from flax.types.spend_bundle import SpendBundle +from flax.util.byte_types import hexstr_to_bytes +from flax.util.ints import uint8, uint32, uint64, uint128 +from flax.util.streamable import Streamable, streamable +from flax.wallet.derivation_record import DerivationRecord +from flax.wallet.derive_keys import master_sk_to_wallet_sk +from flax.wallet.rl_wallet.rl_wallet_puzzles import ( make_clawback_solution, rl_make_aggregation_puzzle, rl_make_aggregation_solution, @@ -26,12 +26,12 @@ rl_puzzle_for_pk, solution_for_rl, ) -from chia.wallet.transaction_record import TransactionRecord -from chia.wallet.util.transaction_type import TransactionType -from chia.wallet.util.wallet_types import WalletType -from chia.wallet.wallet import Wallet -from chia.wallet.wallet_coin_record import WalletCoinRecord -from chia.wallet.wallet_info import WalletInfo +from flax.wallet.transaction_record import TransactionRecord +from flax.wallet.util.transaction_type import TransactionType +from flax.wallet.util.wallet_types import WalletType +from flax.wallet.wallet import Wallet +from flax.wallet.wallet_coin_record import WalletCoinRecord +from flax.wallet.wallet_info import WalletInfo @dataclass(frozen=True) diff --git a/chia/wallet/rl_wallet/rl_wallet_puzzles.py b/flax/wallet/rl_wallet/rl_wallet_puzzles.py similarity index 91% rename from chia/wallet/rl_wallet/rl_wallet_puzzles.py rename to flax/wallet/rl_wallet/rl_wallet_puzzles.py index 9a921588d..3f424cbc7 100644 --- a/chia/wallet/rl_wallet/rl_wallet_puzzles.py +++ b/flax/wallet/rl_wallet/rl_wallet_puzzles.py @@ -3,12 +3,12 @@ from clvm_tools import binutils -from chia.types.blockchain_format.program import Program -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.condition_opcodes import ConditionOpcode -from chia.util.ints import uint64 -from chia.wallet.chialisp import sexp -from chia.wallet.puzzles.load_clvm import load_clvm +from flax.types.blockchain_format.program import Program +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.condition_opcodes import ConditionOpcode +from flax.util.ints import uint64 +from flax.wallet.flaxlisp import sexp +from flax.wallet.puzzles.load_clvm import load_clvm RATE_LIMITED_MODE = 1 AGGREGATION_MODE = 2 @@ -27,7 +27,7 @@ def rl_puzzle_for_pk( (1 my_parent_id, my_puzzlehash, my_amount, outgoing_puzzle_hash, outgoing_amount, min_block_time, parent_parent_id, parent_amount, fee) RATE LIMIT LOGIC: - M - chia_per_interval + M - flax_per_interval N - interval_blocks V - amount being spent MIN_BLOCK_AGE = V / (M / N) diff --git a/chia/wallet/secret_key_store.py b/flax/wallet/secret_key_store.py similarity index 100% rename from chia/wallet/secret_key_store.py rename to flax/wallet/secret_key_store.py diff --git a/chia/wallet/settings/default_settings.py b/flax/wallet/settings/default_settings.py similarity index 70% rename from chia/wallet/settings/default_settings.py rename to flax/wallet/settings/default_settings.py index 1456a345d..1dba3d95c 100644 --- a/chia/wallet/settings/default_settings.py +++ b/flax/wallet/settings/default_settings.py @@ -1,4 +1,4 @@ -from chia.wallet.settings.settings_objects import BackupInitialized +from flax.wallet.settings.settings_objects import BackupInitialized default_backup_initialized = BackupInitialized(False, False, False, True) diff --git a/chia/wallet/settings/settings_objects.py b/flax/wallet/settings/settings_objects.py similarity index 90% rename from chia/wallet/settings/settings_objects.py rename to flax/wallet/settings/settings_objects.py index 9878a2c4e..ba1e2ad84 100644 --- a/chia/wallet/settings/settings_objects.py +++ b/flax/wallet/settings/settings_objects.py @@ -1,6 +1,6 @@ from dataclasses import dataclass -from chia.util.streamable import Streamable, streamable +from flax.util.streamable import Streamable, streamable @dataclass(frozen=True) diff --git a/chia/wallet/settings/user_settings.py b/flax/wallet/settings/user_settings.py similarity index 91% rename from chia/wallet/settings/user_settings.py rename to flax/wallet/settings/user_settings.py index e8363b1d3..6e4da6ab1 100644 --- a/chia/wallet/settings/user_settings.py +++ b/flax/wallet/settings/user_settings.py @@ -1,8 +1,8 @@ from typing import Any, Dict -from chia.wallet.key_val_store import KeyValStore -from chia.wallet.settings.default_settings import default_settings -from chia.wallet.settings.settings_objects import BackupInitialized +from flax.wallet.key_val_store import KeyValStore +from flax.wallet.settings.default_settings import default_settings +from flax.wallet.settings.settings_objects import BackupInitialized class UserSettings: diff --git a/chia/wallet/sign_coin_solutions.py b/flax/wallet/sign_coin_solutions.py similarity index 91% rename from chia/wallet/sign_coin_solutions.py rename to flax/wallet/sign_coin_solutions.py index d2cfdd9ff..e78591c3e 100644 --- a/chia/wallet/sign_coin_solutions.py +++ b/flax/wallet/sign_coin_solutions.py @@ -3,9 +3,9 @@ import blspy from blspy import AugSchemeMPL, PrivateKey -from chia.types.coin_solution import CoinSolution -from chia.types.spend_bundle import SpendBundle -from chia.util.condition_tools import conditions_dict_for_solution, pkm_pairs_for_conditions_dict +from flax.types.coin_solution import CoinSolution +from flax.types.spend_bundle import SpendBundle +from flax.util.condition_tools import conditions_dict_for_solution, pkm_pairs_for_conditions_dict async def sign_coin_solutions( diff --git a/chia/wallet/trade_manager.py b/flax/wallet/trade_manager.py similarity index 91% rename from chia/wallet/trade_manager.py rename to flax/wallet/trade_manager.py index 20878350f..5f261bed2 100644 --- a/chia/wallet/trade_manager.py +++ b/flax/wallet/trade_manager.py @@ -7,34 +7,34 @@ from blspy import AugSchemeMPL -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.program import Program -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.spend_bundle import SpendBundle -from chia.types.coin_solution import CoinSolution -from chia.util.byte_types import hexstr_to_bytes -from chia.util.db_wrapper import DBWrapper -from chia.util.hash import std_hash -from chia.util.ints import uint32, uint64 -from chia.wallet.cc_wallet import cc_utils -from chia.wallet.cc_wallet.cc_utils import CC_MOD, SpendableCC, spend_bundle_for_spendable_ccs, uncurry_cc -from chia.wallet.cc_wallet.cc_wallet import CCWallet -from chia.wallet.puzzles.genesis_by_coin_id_with_0 import genesis_coin_id_for_genesis_coin_checker -from chia.wallet.trade_record import TradeRecord -from chia.wallet.trading.trade_status import TradeStatus -from chia.wallet.trading.trade_store import TradeStore -from chia.wallet.transaction_record import TransactionRecord -from chia.wallet.util.trade_utils import ( +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.program import Program +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.spend_bundle import SpendBundle +from flax.types.coin_solution import CoinSolution +from flax.util.byte_types import hexstr_to_bytes +from flax.util.db_wrapper import DBWrapper +from flax.util.hash import std_hash +from flax.util.ints import uint32, uint64 +from flax.wallet.cc_wallet import cc_utils +from flax.wallet.cc_wallet.cc_utils import CC_MOD, SpendableCC, spend_bundle_for_spendable_ccs, uncurry_cc +from flax.wallet.cc_wallet.cc_wallet import CCWallet +from flax.wallet.puzzles.genesis_by_coin_id_with_0 import genesis_coin_id_for_genesis_coin_checker +from flax.wallet.trade_record import TradeRecord +from flax.wallet.trading.trade_status import TradeStatus +from flax.wallet.trading.trade_store import TradeStore +from flax.wallet.transaction_record import TransactionRecord +from flax.wallet.util.trade_utils import ( get_discrepancies_for_spend_bundle, get_output_amount_for_puzzle_and_solution, get_output_discrepancy_for_puzzle_and_solution, ) -from chia.wallet.util.transaction_type import TransactionType -from chia.wallet.util.wallet_types import WalletType -from chia.wallet.wallet import Wallet -from chia.wallet.wallet_coin_record import WalletCoinRecord +from flax.wallet.util.transaction_type import TransactionType +from flax.wallet.util.wallet_types import WalletType +from flax.wallet.wallet import Wallet +from flax.wallet.wallet_coin_record import WalletCoinRecord -# from chia.wallet.cc_wallet.debug_spend_bundle import debug_spend_bundle +# from flax.wallet.cc_wallet.debug_spend_bundle import debug_spend_bundle class TradeManager: @@ -280,7 +280,7 @@ async def _create_offer_for_ids(self, offer: Dict[int, int]) -> Tuple[bool, Opti to_exclude = [] else: to_exclude = spend_bundle.removals() - new_spend_bundle = await wallet.create_spend_bundle_relative_chia(amount, to_exclude) + new_spend_bundle = await wallet.create_spend_bundle_relative_flax(amount, to_exclude) else: return False, None, "unsupported wallet type" if new_spend_bundle is None or new_spend_bundle.removals() == []: @@ -338,7 +338,7 @@ async def maybe_create_wallets_for_offer(self, file_path: Path) -> bool: for key, value in result.items(): wsm = self.wallet_state_manager wallet: Wallet = wsm.main_wallet - if key == "chia": + if key == "flax": continue self.log.info(f"value is {key}") exists = await wsm.get_wallet_for_colour(key) @@ -366,7 +366,7 @@ async def respond_to_offer(self, file_path: Path) -> Tuple[bool, Optional[TradeR cc_coinsol_outamounts: Dict[bytes32, List[Tuple[CoinSolution, int]]] = dict() aggsig = offer_spend_bundle.aggregated_signature cc_discrepancies: Dict[bytes32, int] = dict() - chia_discrepancy = None + flax_discrepancy = None wallets: Dict[bytes32, Any] = dict() # colour to wallet dict for coinsol in offer_spend_bundle.coin_solutions: @@ -399,24 +399,24 @@ async def respond_to_offer(self, file_path: Path) -> Tuple[bool, Optional[TradeR cc_coinsol_outamounts[colour] = [(coinsol, total)] else: - # standard chia coin + # standard flax coin unspent = await self.wallet_state_manager.get_spendable_coins_for_wallet(1) if coinsol.coin in [record.coin for record in unspent]: return False, None, "can't respond to own offer" - if chia_discrepancy is None: - chia_discrepancy = get_output_discrepancy_for_puzzle_and_solution(coinsol.coin, puzzle, solution) + if flax_discrepancy is None: + flax_discrepancy = get_output_discrepancy_for_puzzle_and_solution(coinsol.coin, puzzle, solution) else: - chia_discrepancy += get_output_discrepancy_for_puzzle_and_solution(coinsol.coin, puzzle, solution) + flax_discrepancy += get_output_discrepancy_for_puzzle_and_solution(coinsol.coin, puzzle, solution) coinsols.append(coinsol) - chia_spend_bundle: Optional[SpendBundle] = None - if chia_discrepancy is not None: - chia_spend_bundle = await self.wallet_state_manager.main_wallet.create_spend_bundle_relative_chia( - chia_discrepancy, [] + flax_spend_bundle: Optional[SpendBundle] = None + if flax_discrepancy is not None: + flax_spend_bundle = await self.wallet_state_manager.main_wallet.create_spend_bundle_relative_flax( + flax_discrepancy, [] ) - if chia_spend_bundle is not None: + if flax_spend_bundle is not None: for coinsol in coinsols: - chia_spend_bundle.coin_solutions.append(coinsol) + flax_spend_bundle.coin_solutions.append(coinsol) zero_spend_list: List[SpendBundle] = [] spend_bundle = None @@ -426,10 +426,10 @@ async def respond_to_offer(self, file_path: Path) -> Tuple[bool, Optional[TradeR if cc_discrepancies[colour] < 0: my_cc_spends = await wallets[colour].select_coins(abs(cc_discrepancies[colour])) else: - if chia_spend_bundle is None: + if flax_spend_bundle is None: to_exclude: List = [] else: - to_exclude = chia_spend_bundle.removals() + to_exclude = flax_spend_bundle.removals() my_cc_spends = await wallets[colour].select_coins(0) if my_cc_spends is None or my_cc_spends == set(): zero_spend_bundle: SpendBundle = await wallets[colour].generate_zero_val_coin(False, to_exclude) @@ -437,7 +437,7 @@ async def respond_to_offer(self, file_path: Path) -> Tuple[bool, Optional[TradeR return ( False, None, - "Unable to generate zero value coin. Confirm that you have chia available", + "Unable to generate zero value coin. Confirm that you have flax available", ) zero_spend_list.append(zero_spend_bundle) @@ -531,50 +531,50 @@ async def respond_to_offer(self, file_path: Path) -> Tuple[bool, Optional[TradeR # Add transaction history for this trade now = uint64(int(time.time())) - if chia_spend_bundle is not None: - spend_bundle = SpendBundle.aggregate([spend_bundle, chia_spend_bundle]) + if flax_spend_bundle is not None: + spend_bundle = SpendBundle.aggregate([spend_bundle, flax_spend_bundle]) # debug_spend_bundle(spend_bundle) - if chia_discrepancy < 0: + if flax_discrepancy < 0: tx_record = TransactionRecord( confirmed_at_height=uint32(0), created_at_time=now, to_puzzle_hash=token_bytes(), - amount=uint64(abs(chia_discrepancy)), + amount=uint64(abs(flax_discrepancy)), fee_amount=uint64(0), confirmed=False, sent=uint32(10), - spend_bundle=chia_spend_bundle, - additions=chia_spend_bundle.additions(), - removals=chia_spend_bundle.removals(), + spend_bundle=flax_spend_bundle, + additions=flax_spend_bundle.additions(), + removals=flax_spend_bundle.removals(), wallet_id=uint32(1), sent_to=[], trade_id=std_hash(spend_bundle.name() + bytes(now)), type=uint32(TransactionType.OUTGOING_TRADE.value), - name=chia_spend_bundle.name(), + name=flax_spend_bundle.name(), ) else: tx_record = TransactionRecord( confirmed_at_height=uint32(0), created_at_time=uint64(int(time.time())), to_puzzle_hash=token_bytes(), - amount=uint64(abs(chia_discrepancy)), + amount=uint64(abs(flax_discrepancy)), fee_amount=uint64(0), confirmed=False, sent=uint32(10), - spend_bundle=chia_spend_bundle, - additions=chia_spend_bundle.additions(), - removals=chia_spend_bundle.removals(), + spend_bundle=flax_spend_bundle, + additions=flax_spend_bundle.additions(), + removals=flax_spend_bundle.removals(), wallet_id=uint32(1), sent_to=[], trade_id=std_hash(spend_bundle.name() + bytes(now)), type=uint32(TransactionType.INCOMING_TRADE.value), - name=chia_spend_bundle.name(), + name=flax_spend_bundle.name(), ) my_tx_records.append(tx_record) for colour, amount in cc_discrepancies.items(): wallet = wallets[colour] - if chia_discrepancy > 0: + if flax_discrepancy > 0: tx_record = TransactionRecord( confirmed_at_height=uint32(0), created_at_time=uint64(int(time.time())), diff --git a/chia/wallet/trade_record.py b/flax/wallet/trade_record.py similarity index 71% rename from chia/wallet/trade_record.py rename to flax/wallet/trade_record.py index 32fafe049..93bd535d5 100644 --- a/chia/wallet/trade_record.py +++ b/flax/wallet/trade_record.py @@ -1,11 +1,11 @@ from dataclasses import dataclass from typing import List, Optional, Tuple -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.spend_bundle import SpendBundle -from chia.util.ints import uint8, uint32, uint64 -from chia.util.streamable import Streamable, streamable +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.spend_bundle import SpendBundle +from flax.util.ints import uint8, uint32, uint64 +from flax.util.streamable import Streamable, streamable @dataclass(frozen=True) diff --git a/chia/wallet/trading/__init__.py b/flax/wallet/trading/__init__.py similarity index 100% rename from chia/wallet/trading/__init__.py rename to flax/wallet/trading/__init__.py diff --git a/chia/wallet/trading/trade_status.py b/flax/wallet/trading/trade_status.py similarity index 100% rename from chia/wallet/trading/trade_status.py rename to flax/wallet/trading/trade_status.py diff --git a/chia/wallet/trading/trade_store.py b/flax/wallet/trading/trade_store.py similarity index 96% rename from chia/wallet/trading/trade_store.py rename to flax/wallet/trading/trade_store.py index 5e523d432..7dc50747b 100644 --- a/chia/wallet/trading/trade_store.py +++ b/flax/wallet/trading/trade_store.py @@ -2,13 +2,13 @@ import aiosqlite -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.mempool_inclusion_status import MempoolInclusionStatus -from chia.util.db_wrapper import DBWrapper -from chia.util.errors import Err -from chia.util.ints import uint8, uint32 -from chia.wallet.trade_record import TradeRecord -from chia.wallet.trading.trade_status import TradeStatus +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.mempool_inclusion_status import MempoolInclusionStatus +from flax.util.db_wrapper import DBWrapper +from flax.util.errors import Err +from flax.util.ints import uint8, uint32 +from flax.wallet.trade_record import TradeRecord +from flax.wallet.trading.trade_status import TradeStatus class TradeStore: diff --git a/chia/wallet/transaction_record.py b/flax/wallet/transaction_record.py similarity index 81% rename from chia/wallet/transaction_record.py rename to flax/wallet/transaction_record.py index 1e6bcf6b2..734c80c79 100644 --- a/chia/wallet/transaction_record.py +++ b/flax/wallet/transaction_record.py @@ -1,14 +1,14 @@ from dataclasses import dataclass from typing import List, Optional, Tuple -from chia.consensus.coinbase import pool_parent_id, farmer_parent_id -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.mempool_inclusion_status import MempoolInclusionStatus -from chia.types.spend_bundle import SpendBundle -from chia.util.ints import uint8, uint32, uint64 -from chia.util.streamable import Streamable, streamable -from chia.wallet.util.transaction_type import TransactionType +from flax.consensus.coinbase import pool_parent_id, farmer_parent_id +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.mempool_inclusion_status import MempoolInclusionStatus +from flax.types.spend_bundle import SpendBundle +from flax.util.ints import uint8, uint32, uint64 +from flax.util.streamable import Streamable, streamable +from flax.wallet.util.transaction_type import TransactionType @dataclass(frozen=True) diff --git a/chia/wallet/util/__init__.py b/flax/wallet/util/__init__.py similarity index 100% rename from chia/wallet/util/__init__.py rename to flax/wallet/util/__init__.py diff --git a/chia/wallet/util/backup_utils.py b/flax/wallet/util/backup_utils.py similarity index 92% rename from chia/wallet/util/backup_utils.py rename to flax/wallet/util/backup_utils.py index d1cd895dd..fe6493f85 100644 --- a/chia/wallet/util/backup_utils.py +++ b/flax/wallet/util/backup_utils.py @@ -6,12 +6,12 @@ from blspy import AugSchemeMPL, PrivateKey, PublicKeyMPL, SignatureMPL from cryptography.fernet import Fernet -from chia.server.server import ssl_context_for_root -from chia.ssl.create_ssl import get_mozzila_ca_crt -from chia.util.byte_types import hexstr_to_bytes -from chia.util.hash import std_hash -from chia.wallet.derive_keys import master_sk_to_backup_sk -from chia.wallet.util.wallet_types import WalletType +from flax.server.server import ssl_context_for_root +from flax.ssl.create_ssl import get_mozzila_ca_crt +from flax.util.byte_types import hexstr_to_bytes +from flax.util.hash import std_hash +from flax.wallet.derive_keys import master_sk_to_backup_sk +from flax.wallet.util.wallet_types import WalletType def open_backup_file(file_path, private_key): diff --git a/chia/wallet/util/trade_utils.py b/flax/wallet/util/trade_utils.py similarity index 85% rename from chia/wallet/util/trade_utils.py rename to flax/wallet/util/trade_utils.py index 90111ca3d..a00ce33db 100644 --- a/chia/wallet/util/trade_utils.py +++ b/flax/wallet/util/trade_utils.py @@ -1,12 +1,12 @@ from typing import Dict, Optional, Tuple -from chia.types.blockchain_format.program import Program, INFINITE_COST -from chia.types.condition_opcodes import ConditionOpcode -from chia.types.spend_bundle import SpendBundle -from chia.util.condition_tools import conditions_dict_for_solution -from chia.wallet.cc_wallet import cc_utils -from chia.wallet.trade_record import TradeRecord -from chia.wallet.trading.trade_status import TradeStatus +from flax.types.blockchain_format.program import Program, INFINITE_COST +from flax.types.condition_opcodes import ConditionOpcode +from flax.types.spend_bundle import SpendBundle +from flax.util.condition_tools import conditions_dict_for_solution +from flax.wallet.cc_wallet import cc_utils +from flax.wallet.trade_record import TradeRecord +from flax.wallet.trading.trade_status import TradeStatus def trade_status_ui_string(status: TradeStatus): @@ -83,10 +83,10 @@ def get_discrepancies_for_spend_bundle( coin_amount = coinsol.coin.amount out_amount = get_output_amount_for_puzzle_and_solution(puzzle, solution) diff = coin_amount - out_amount - if "chia" in cc_discrepancies: - cc_discrepancies["chia"] = cc_discrepancies["chia"] + diff + if "flax" in cc_discrepancies: + cc_discrepancies["flax"] = cc_discrepancies["flax"] + diff else: - cc_discrepancies["chia"] = diff + cc_discrepancies["flax"] = diff return True, cc_discrepancies, None except Exception as e: diff --git a/chia/wallet/util/transaction_type.py b/flax/wallet/util/transaction_type.py similarity index 100% rename from chia/wallet/util/transaction_type.py rename to flax/wallet/util/transaction_type.py diff --git a/chia/wallet/util/wallet_types.py b/flax/wallet/util/wallet_types.py similarity index 100% rename from chia/wallet/util/wallet_types.py rename to flax/wallet/util/wallet_types.py diff --git a/chia/wallet/wallet.py b/flax/wallet/wallet.py similarity index 92% rename from chia/wallet/wallet.py rename to flax/wallet/wallet.py index aafcbc8ed..d067c6704 100644 --- a/chia/wallet/wallet.py +++ b/flax/wallet/wallet.py @@ -4,26 +4,26 @@ from blspy import G1Element -from chia.consensus.cost_calculator import calculate_cost_of_program, NPCResult -from chia.full_node.bundle_tools import simple_solution_generator -from chia.full_node.mempool_check_conditions import get_name_puzzle_conditions -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.program import Program, SerializedProgram -from chia.types.announcement import Announcement -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.coin_solution import CoinSolution -from chia.types.generator_types import BlockGenerator -from chia.types.spend_bundle import SpendBundle -from chia.util.ints import uint8, uint32, uint64, uint128 -from chia.util.hash import std_hash -from chia.wallet.derivation_record import DerivationRecord -from chia.wallet.puzzles.p2_delegated_puzzle_or_hidden_puzzle import ( +from flax.consensus.cost_calculator import calculate_cost_of_program, NPCResult +from flax.full_node.bundle_tools import simple_solution_generator +from flax.full_node.mempool_check_conditions import get_name_puzzle_conditions +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.program import Program, SerializedProgram +from flax.types.announcement import Announcement +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.coin_solution import CoinSolution +from flax.types.generator_types import BlockGenerator +from flax.types.spend_bundle import SpendBundle +from flax.util.ints import uint8, uint32, uint64, uint128 +from flax.util.hash import std_hash +from flax.wallet.derivation_record import DerivationRecord +from flax.wallet.puzzles.p2_delegated_puzzle_or_hidden_puzzle import ( DEFAULT_HIDDEN_PUZZLE_HASH, calculate_synthetic_secret_key, puzzle_for_pk, solution_for_conditions, ) -from chia.wallet.puzzles.puzzle_utils import ( +from flax.wallet.puzzles.puzzle_utils import ( make_assert_coin_announcement, make_assert_puzzle_announcement, make_assert_my_coin_id_condition, @@ -33,13 +33,13 @@ make_create_coin_condition, make_reserve_fee_condition, ) -from chia.wallet.secret_key_store import SecretKeyStore -from chia.wallet.sign_coin_solutions import sign_coin_solutions -from chia.wallet.transaction_record import TransactionRecord -from chia.wallet.util.transaction_type import TransactionType -from chia.wallet.util.wallet_types import WalletType -from chia.wallet.wallet_coin_record import WalletCoinRecord -from chia.wallet.wallet_info import WalletInfo +from flax.wallet.secret_key_store import SecretKeyStore +from flax.wallet.sign_coin_solutions import sign_coin_solutions +from flax.wallet.transaction_record import TransactionRecord +from flax.wallet.util.transaction_type import TransactionType +from flax.wallet.util.wallet_types import WalletType +from flax.wallet.wallet_coin_record import WalletCoinRecord +from flax.wallet.wallet_info import WalletInfo class Wallet: @@ -430,14 +430,14 @@ async def push_transaction(self, tx: TransactionRecord) -> None: await self.wallet_state_manager.add_pending_transaction(tx) # This is to be aggregated together with a coloured coin offer to ensure that the trade happens - async def create_spend_bundle_relative_chia(self, chia_amount: int, exclude: List[Coin]) -> SpendBundle: + async def create_spend_bundle_relative_flax(self, flax_amount: int, exclude: List[Coin]) -> SpendBundle: list_of_solutions = [] utxos = None # If we're losing value then get coins with at least that much value # If we're gaining value then our amount doesn't matter - if chia_amount < 0: - utxos = await self.select_coins(abs(chia_amount), exclude) + if flax_amount < 0: + utxos = await self.select_coins(abs(flax_amount), exclude) else: utxos = await self.select_coins(0, exclude) @@ -445,7 +445,7 @@ async def create_spend_bundle_relative_chia(self, chia_amount: int, exclude: Lis # Calculate output amount given sum of utxos spend_value = sum([coin.amount for coin in utxos]) - chia_amount = spend_value + chia_amount + flax_amount = spend_value + flax_amount # Create coin solutions for each utxo output_created = None @@ -453,7 +453,7 @@ async def create_spend_bundle_relative_chia(self, chia_amount: int, exclude: Lis puzzle = await self.puzzle_for_puzzle_hash(coin.puzzle_hash) if output_created is None: newpuzhash = await self.get_new_puzzlehash() - primaries = [{"puzzlehash": newpuzhash, "amount": chia_amount}] + primaries = [{"puzzlehash": newpuzhash, "amount": flax_amount}] solution = self.make_solution(primaries=primaries) output_created = coin list_of_solutions.append(CoinSolution(coin, puzzle, solution)) diff --git a/chia/wallet/wallet_action.py b/flax/wallet/wallet_action.py similarity index 92% rename from chia/wallet/wallet_action.py rename to flax/wallet/wallet_action.py index 162c9c9c7..4ea067bbd 100644 --- a/chia/wallet/wallet_action.py +++ b/flax/wallet/wallet_action.py @@ -1,8 +1,8 @@ from dataclasses import dataclass from typing import Optional -from chia.util.ints import uint32 -from chia.wallet.util.wallet_types import WalletType +from flax.util.ints import uint32 +from flax.wallet.util.wallet_types import WalletType @dataclass(frozen=True) diff --git a/chia/wallet/wallet_action_store.py b/flax/wallet/wallet_action_store.py similarity index 96% rename from chia/wallet/wallet_action_store.py rename to flax/wallet/wallet_action_store.py index 59f2c3f05..36b50b4e3 100644 --- a/chia/wallet/wallet_action_store.py +++ b/flax/wallet/wallet_action_store.py @@ -2,10 +2,10 @@ import aiosqlite -from chia.util.db_wrapper import DBWrapper -from chia.util.ints import uint32 -from chia.wallet.util.wallet_types import WalletType -from chia.wallet.wallet_action import WalletAction +from flax.util.db_wrapper import DBWrapper +from flax.util.ints import uint32 +from flax.wallet.util.wallet_types import WalletType +from flax.wallet.wallet_action import WalletAction class WalletActionStore: diff --git a/chia/wallet/wallet_block_store.py b/flax/wallet/wallet_block_store.py similarity index 96% rename from chia/wallet/wallet_block_store.py rename to flax/wallet/wallet_block_store.py index 46ed03bf3..4e4b94095 100644 --- a/chia/wallet/wallet_block_store.py +++ b/flax/wallet/wallet_block_store.py @@ -2,14 +2,14 @@ import aiosqlite -from chia.consensus.block_record import BlockRecord -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.blockchain_format.sub_epoch_summary import SubEpochSummary -from chia.types.header_block import HeaderBlock -from chia.util.db_wrapper import DBWrapper -from chia.util.ints import uint32, uint64 -from chia.util.lru_cache import LRUCache -from chia.wallet.block_record import HeaderBlockRecord +from flax.consensus.block_record import BlockRecord +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.blockchain_format.sub_epoch_summary import SubEpochSummary +from flax.types.header_block import HeaderBlock +from flax.util.db_wrapper import DBWrapper +from flax.util.ints import uint32, uint64 +from flax.util.lru_cache import LRUCache +from flax.wallet.block_record import HeaderBlockRecord class WalletBlockStore: diff --git a/chia/wallet/wallet_blockchain.py b/flax/wallet/wallet_blockchain.py similarity index 94% rename from chia/wallet/wallet_blockchain.py rename to flax/wallet/wallet_blockchain.py index 048abd44f..57243453e 100644 --- a/chia/wallet/wallet_blockchain.py +++ b/flax/wallet/wallet_blockchain.py @@ -6,25 +6,25 @@ from enum import Enum from typing import Any, Callable, Dict, List, Optional, Set, Tuple -from chia.consensus.block_header_validation import validate_finished_header_block, validate_unfinished_header_block -from chia.consensus.block_record import BlockRecord -from chia.consensus.blockchain_interface import BlockchainInterface -from chia.consensus.constants import ConsensusConstants -from chia.consensus.difficulty_adjustment import get_next_sub_slot_iters_and_difficulty -from chia.consensus.find_fork_point import find_fork_point_in_chain -from chia.consensus.full_block_to_block_record import block_to_block_record -from chia.consensus.multiprocess_validation import PreValidationResult, pre_validate_blocks_multiprocessing -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.blockchain_format.sub_epoch_summary import SubEpochSummary -from chia.types.header_block import HeaderBlock -from chia.types.unfinished_header_block import UnfinishedHeaderBlock -from chia.util.errors import Err, ValidationError -from chia.util.ints import uint32, uint64 -from chia.util.streamable import recurse_jsonify -from chia.wallet.block_record import HeaderBlockRecord -from chia.wallet.wallet_block_store import WalletBlockStore -from chia.wallet.wallet_coin_store import WalletCoinStore -from chia.wallet.wallet_transaction_store import WalletTransactionStore +from flax.consensus.block_header_validation import validate_finished_header_block, validate_unfinished_header_block +from flax.consensus.block_record import BlockRecord +from flax.consensus.blockchain_interface import BlockchainInterface +from flax.consensus.constants import ConsensusConstants +from flax.consensus.difficulty_adjustment import get_next_sub_slot_iters_and_difficulty +from flax.consensus.find_fork_point import find_fork_point_in_chain +from flax.consensus.full_block_to_block_record import block_to_block_record +from flax.consensus.multiprocess_validation import PreValidationResult, pre_validate_blocks_multiprocessing +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.blockchain_format.sub_epoch_summary import SubEpochSummary +from flax.types.header_block import HeaderBlock +from flax.types.unfinished_header_block import UnfinishedHeaderBlock +from flax.util.errors import Err, ValidationError +from flax.util.ints import uint32, uint64 +from flax.util.streamable import recurse_jsonify +from flax.wallet.block_record import HeaderBlockRecord +from flax.wallet.wallet_block_store import WalletBlockStore +from flax.wallet.wallet_coin_store import WalletCoinStore +from flax.wallet.wallet_transaction_store import WalletTransactionStore log = logging.getLogger(__name__) diff --git a/chia/wallet/wallet_coin_record.py b/flax/wallet/wallet_coin_record.py similarity index 68% rename from chia/wallet/wallet_coin_record.py rename to flax/wallet/wallet_coin_record.py index 70ba07211..54afd7ee0 100644 --- a/chia/wallet/wallet_coin_record.py +++ b/flax/wallet/wallet_coin_record.py @@ -1,9 +1,9 @@ from dataclasses import dataclass -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.ints import uint32 -from chia.wallet.util.wallet_types import WalletType +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.ints import uint32 +from flax.wallet.util.wallet_types import WalletType @dataclass(frozen=True) diff --git a/chia/wallet/wallet_coin_store.py b/flax/wallet/wallet_coin_store.py similarity index 97% rename from chia/wallet/wallet_coin_store.py rename to flax/wallet/wallet_coin_store.py index a52e9d6e7..0f0e73776 100644 --- a/chia/wallet/wallet_coin_store.py +++ b/flax/wallet/wallet_coin_store.py @@ -3,12 +3,12 @@ import aiosqlite import sqlite3 -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.db_wrapper import DBWrapper -from chia.util.ints import uint32, uint64 -from chia.wallet.util.wallet_types import WalletType -from chia.wallet.wallet_coin_record import WalletCoinRecord +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.db_wrapper import DBWrapper +from flax.util.ints import uint32, uint64 +from flax.wallet.util.wallet_types import WalletType +from flax.wallet.wallet_coin_record import WalletCoinRecord class WalletCoinStore: diff --git a/chia/wallet/wallet_info.py b/flax/wallet/wallet_info.py similarity index 90% rename from chia/wallet/wallet_info.py rename to flax/wallet/wallet_info.py index 4567540f6..8213b8998 100644 --- a/chia/wallet/wallet_info.py +++ b/flax/wallet/wallet_info.py @@ -1,8 +1,8 @@ from dataclasses import dataclass from typing import List -from chia.util.ints import uint8, uint32 -from chia.util.streamable import Streamable, streamable +from flax.util.ints import uint8, uint32 +from flax.util.streamable import Streamable, streamable @dataclass(frozen=True) diff --git a/chia/wallet/wallet_node.py b/flax/wallet/wallet_node.py similarity index 94% rename from chia/wallet/wallet_node.py rename to flax/wallet/wallet_node.py index 8a05cb709..2910928a9 100644 --- a/chia/wallet/wallet_node.py +++ b/flax/wallet/wallet_node.py @@ -9,13 +9,13 @@ from blspy import PrivateKey -from chia.consensus.block_record import BlockRecord -from chia.consensus.constants import ConsensusConstants -from chia.consensus.multiprocess_validation import PreValidationResult -from chia.protocols import wallet_protocol -from chia.protocols.full_node_protocol import RequestProofOfWeight, RespondProofOfWeight -from chia.protocols.protocol_message_types import ProtocolMessageTypes -from chia.protocols.wallet_protocol import ( +from flax.consensus.block_record import BlockRecord +from flax.consensus.constants import ConsensusConstants +from flax.consensus.multiprocess_validation import PreValidationResult +from flax.protocols import wallet_protocol +from flax.protocols.full_node_protocol import RequestProofOfWeight, RespondProofOfWeight +from flax.protocols.protocol_message_types import ProtocolMessageTypes +from flax.protocols.wallet_protocol import ( RejectAdditionsRequest, RejectRemovalsRequest, RequestAdditions, @@ -25,37 +25,37 @@ RespondHeaderBlocks, RespondRemovals, ) -from chia.server.node_discovery import WalletPeers -from chia.server.outbound_message import Message, NodeType, make_msg -from chia.server.server import ChiaServer -from chia.server.ws_connection import WSChiaConnection -from chia.types.blockchain_format.coin import Coin, hash_coin_list -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.header_block import HeaderBlock -from chia.types.peer_info import PeerInfo -from chia.util.byte_types import hexstr_to_bytes -from chia.util.errors import Err, ValidationError -from chia.util.ints import uint32, uint128 -from chia.util.keychain import Keychain -from chia.util.lru_cache import LRUCache -from chia.util.merkle_set import MerkleSet, confirm_included_already_hashed, confirm_not_included_already_hashed -from chia.util.path import mkdir, path_from_root -from chia.wallet.block_record import HeaderBlockRecord -from chia.wallet.derivation_record import DerivationRecord -from chia.wallet.settings.settings_objects import BackupInitialized -from chia.wallet.transaction_record import TransactionRecord -from chia.wallet.util.backup_utils import open_backup_file -from chia.wallet.util.wallet_types import WalletType -from chia.wallet.wallet_action import WalletAction -from chia.wallet.wallet_blockchain import ReceiveBlockResult -from chia.wallet.wallet_state_manager import WalletStateManager +from flax.server.node_discovery import WalletPeers +from flax.server.outbound_message import Message, NodeType, make_msg +from flax.server.server import FlaxServer +from flax.server.ws_connection import WSFlaxConnection +from flax.types.blockchain_format.coin import Coin, hash_coin_list +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.header_block import HeaderBlock +from flax.types.peer_info import PeerInfo +from flax.util.byte_types import hexstr_to_bytes +from flax.util.errors import Err, ValidationError +from flax.util.ints import uint32, uint128 +from flax.util.keychain import Keychain +from flax.util.lru_cache import LRUCache +from flax.util.merkle_set import MerkleSet, confirm_included_already_hashed, confirm_not_included_already_hashed +from flax.util.path import mkdir, path_from_root +from flax.wallet.block_record import HeaderBlockRecord +from flax.wallet.derivation_record import DerivationRecord +from flax.wallet.settings.settings_objects import BackupInitialized +from flax.wallet.transaction_record import TransactionRecord +from flax.wallet.util.backup_utils import open_backup_file +from flax.wallet.util.wallet_types import WalletType +from flax.wallet.wallet_action import WalletAction +from flax.wallet.wallet_blockchain import ReceiveBlockResult +from flax.wallet.wallet_state_manager import WalletStateManager class WalletNode: key_config: Dict config: Dict constants: ConsensusConstants - server: Optional[ChiaServer] + server: Optional[FlaxServer] log: logging.Logger wallet_peers: WalletPeers # Maintains the state of the wallet (blockchain and transactions), handles DB connections @@ -115,7 +115,7 @@ def __init__( def get_key_for_fingerprint(self, fingerprint: Optional[int]): private_keys = self.keychain.get_all_private_keys() if len(private_keys) == 0: - self.log.warning("No keys present. Create keys with the UI, or with the 'chia keys' program.") + self.log.warning("No keys present. Create keys with the UI, or with the 'flax keys' program.") return None private_key: Optional[PrivateKey] = None @@ -303,7 +303,7 @@ async def _messages_to_resend(self) -> List[Tuple[Message, Set[bytes32]]]: return messages - def set_server(self, server: ChiaServer): + def set_server(self, server: FlaxServer): self.server = server # TODO: perhaps use a different set of DNS seeders for wallets, to split the traffic. self.wallet_peers = WalletPeers( @@ -318,7 +318,7 @@ def set_server(self, server: ChiaServer): ) asyncio.create_task(self.wallet_peers.start()) - async def on_connect(self, peer: WSChiaConnection): + async def on_connect(self, peer: WSFlaxConnection): if self.wallet_state_manager is None or self.backup_initialized is False: return None messages_peer_ids = await self._messages_to_resend() @@ -360,7 +360,7 @@ def has_full_node(self) -> bool: return True return False - async def complete_blocks(self, header_blocks: List[HeaderBlock], peer: WSChiaConnection): + async def complete_blocks(self, header_blocks: List[HeaderBlock], peer: WSFlaxConnection): if self.wallet_state_manager is None: return None header_block_records: List[HeaderBlockRecord] = [] @@ -402,7 +402,7 @@ async def complete_blocks(self, header_blocks: List[HeaderBlock], peer: WSChiaCo else: self.log.debug(f"Result: {result}") - async def new_peak_wallet(self, peak: wallet_protocol.NewPeakWallet, peer: WSChiaConnection): + async def new_peak_wallet(self, peak: wallet_protocol.NewPeakWallet, peer: WSFlaxConnection): if self.wallet_state_manager is None: return None @@ -553,7 +553,7 @@ async def _sync(self) -> None: self.log.info("Not performing sync, already caught up.") return None - peers: List[WSChiaConnection] = self.server.get_full_node_connections() + peers: List[WSFlaxConnection] = self.server.get_full_node_connections() if len(peers) == 0: self.log.info("No peers to sync to") return None @@ -624,7 +624,7 @@ async def _sync(self) -> None: async def fetch_blocks_and_validate( self, - peer: WSChiaConnection, + peer: WSFlaxConnection, height_start: uint32, height_end: uint32, fork_point_with_peak: Optional[uint32], @@ -815,7 +815,7 @@ def validate_removals(self, coins, proofs, root): return False return True - async def get_additions(self, peer: WSChiaConnection, block_i, additions) -> Optional[List[Coin]]: + async def get_additions(self, peer: WSFlaxConnection, block_i, additions) -> Optional[List[Coin]]: if len(additions) > 0: additions_request = RequestAdditions(block_i.height, block_i.header_hash, additions) additions_res: Optional[Union[RespondAdditions, RejectAdditionsRequest]] = await peer.request_additions( @@ -846,7 +846,7 @@ async def get_additions(self, peer: WSChiaConnection, block_i, additions) -> Opt added_coins = [] return added_coins - async def get_removals(self, peer: WSChiaConnection, block_i, additions, removals) -> Optional[List[Coin]]: + async def get_removals(self, peer: WSFlaxConnection, block_i, additions, removals) -> Optional[List[Coin]]: assert self.wallet_state_manager is not None request_all_removals = False # Check if we need all removals diff --git a/chia/wallet/wallet_node_api.py b/flax/wallet/wallet_node_api.py similarity index 87% rename from chia/wallet/wallet_node_api.py rename to flax/wallet/wallet_node_api.py index af948c4ff..79bba1b83 100644 --- a/chia/wallet/wallet_node_api.py +++ b/flax/wallet/wallet_node_api.py @@ -1,10 +1,10 @@ -from chia.protocols import full_node_protocol, introducer_protocol, wallet_protocol -from chia.server.outbound_message import NodeType -from chia.server.ws_connection import WSChiaConnection -from chia.types.mempool_inclusion_status import MempoolInclusionStatus -from chia.util.api_decorators import api_request, peer_required, execute_task -from chia.util.errors import Err -from chia.wallet.wallet_node import WalletNode +from flax.protocols import full_node_protocol, introducer_protocol, wallet_protocol +from flax.server.outbound_message import NodeType +from flax.server.ws_connection import WSFlaxConnection +from flax.types.mempool_inclusion_status import MempoolInclusionStatus +from flax.util.api_decorators import api_request, peer_required, execute_task +from flax.util.errors import Err +from flax.wallet.wallet_node import WalletNode class WalletNodeAPI: @@ -23,10 +23,10 @@ def api_ready(self): @peer_required @api_request - async def respond_removals(self, response: wallet_protocol.RespondRemovals, peer: WSChiaConnection): + async def respond_removals(self, response: wallet_protocol.RespondRemovals, peer: WSFlaxConnection): pass - async def reject_removals_request(self, response: wallet_protocol.RejectRemovalsRequest, peer: WSChiaConnection): + async def reject_removals_request(self, response: wallet_protocol.RejectRemovalsRequest, peer: WSFlaxConnection): """ The full node has rejected our request for removals. """ @@ -42,7 +42,7 @@ async def reject_additions_request(self, response: wallet_protocol.RejectAdditio @execute_task @peer_required @api_request - async def new_peak_wallet(self, peak: wallet_protocol.NewPeakWallet, peer: WSChiaConnection): + async def new_peak_wallet(self, peak: wallet_protocol.NewPeakWallet, peer: WSFlaxConnection): """ The full node sent as a new peak """ @@ -61,7 +61,7 @@ async def respond_block_header(self, response: wallet_protocol.RespondBlockHeade @peer_required @api_request - async def respond_additions(self, response: wallet_protocol.RespondAdditions, peer: WSChiaConnection): + async def respond_additions(self, response: wallet_protocol.RespondAdditions, peer: WSFlaxConnection): pass @api_request @@ -70,7 +70,7 @@ async def respond_proof_of_weight(self, response: full_node_protocol.RespondProo @peer_required @api_request - async def transaction_ack(self, ack: wallet_protocol.TransactionAck, peer: WSChiaConnection): + async def transaction_ack(self, ack: wallet_protocol.TransactionAck, peer: WSFlaxConnection): """ This is an ack for our previous SendTransaction call. This removes the transaction from the send queue if we have sent it to enough nodes. @@ -94,7 +94,7 @@ async def transaction_ack(self, ack: wallet_protocol.TransactionAck, peer: WSChi @peer_required @api_request async def respond_peers_introducer( - self, request: introducer_protocol.RespondPeersIntroducer, peer: WSChiaConnection + self, request: introducer_protocol.RespondPeersIntroducer, peer: WSFlaxConnection ): if not self.wallet_node.has_full_node(): await self.wallet_node.wallet_peers.respond_peers(request, peer.get_peer_info(), False) @@ -106,7 +106,7 @@ async def respond_peers_introducer( @peer_required @api_request - async def respond_peers(self, request: full_node_protocol.RespondPeers, peer: WSChiaConnection): + async def respond_peers(self, request: full_node_protocol.RespondPeers, peer: WSFlaxConnection): if not self.wallet_node.has_full_node(): self.log.info(f"Wallet received {len(request.peer_list)} peers.") await self.wallet_node.wallet_peers.respond_peers(request, peer.get_peer_info(), True) diff --git a/chia/wallet/wallet_puzzle_store.py b/flax/wallet/wallet_puzzle_store.py similarity index 97% rename from chia/wallet/wallet_puzzle_store.py rename to flax/wallet/wallet_puzzle_store.py index 7909a8382..2f8b10276 100644 --- a/chia/wallet/wallet_puzzle_store.py +++ b/flax/wallet/wallet_puzzle_store.py @@ -5,11 +5,11 @@ import aiosqlite from blspy import G1Element -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.db_wrapper import DBWrapper -from chia.util.ints import uint32 -from chia.wallet.derivation_record import DerivationRecord -from chia.wallet.util.wallet_types import WalletType +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.db_wrapper import DBWrapper +from flax.util.ints import uint32 +from flax.wallet.derivation_record import DerivationRecord +from flax.wallet.util.wallet_types import WalletType log = logging.getLogger(__name__) diff --git a/chia/wallet/wallet_state_manager.py b/flax/wallet/wallet_state_manager.py similarity index 94% rename from chia/wallet/wallet_state_manager.py rename to flax/wallet/wallet_state_manager.py index bd42c3ce7..526a01a3a 100644 --- a/chia/wallet/wallet_state_manager.py +++ b/flax/wallet/wallet_state_manager.py @@ -12,50 +12,50 @@ from chiabip158 import PyBIP158 from cryptography.fernet import Fernet -from chia import __version__ -from chia.consensus.block_record import BlockRecord -from chia.consensus.coinbase import pool_parent_id, farmer_parent_id -from chia.consensus.constants import ConsensusConstants -from chia.consensus.find_fork_point import find_fork_point_in_chain -from chia.full_node.weight_proof import WeightProofHandler -from chia.protocols.wallet_protocol import PuzzleSolutionResponse, RespondPuzzleSolution -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.program import Program -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.full_block import FullBlock -from chia.types.header_block import HeaderBlock -from chia.types.mempool_inclusion_status import MempoolInclusionStatus -from chia.util.byte_types import hexstr_to_bytes -from chia.util.db_wrapper import DBWrapper -from chia.util.errors import Err -from chia.util.hash import std_hash -from chia.util.ints import uint32, uint64, uint128 -from chia.wallet.block_record import HeaderBlockRecord -from chia.wallet.cc_wallet.cc_wallet import CCWallet -from chia.wallet.derivation_record import DerivationRecord -from chia.wallet.derive_keys import master_sk_to_backup_sk, master_sk_to_wallet_sk -from chia.wallet.key_val_store import KeyValStore -from chia.wallet.rl_wallet.rl_wallet import RLWallet -from chia.wallet.settings.user_settings import UserSettings -from chia.wallet.trade_manager import TradeManager -from chia.wallet.transaction_record import TransactionRecord -from chia.wallet.util.backup_utils import open_backup_file -from chia.wallet.util.transaction_type import TransactionType -from chia.wallet.util.wallet_types import WalletType -from chia.wallet.wallet import Wallet -from chia.wallet.wallet_action import WalletAction -from chia.wallet.wallet_action_store import WalletActionStore -from chia.wallet.wallet_block_store import WalletBlockStore -from chia.wallet.wallet_blockchain import WalletBlockchain -from chia.wallet.wallet_coin_record import WalletCoinRecord -from chia.wallet.wallet_coin_store import WalletCoinStore -from chia.wallet.wallet_info import WalletInfo, WalletInfoBackup -from chia.wallet.wallet_puzzle_store import WalletPuzzleStore -from chia.wallet.wallet_sync_store import WalletSyncStore -from chia.wallet.wallet_transaction_store import WalletTransactionStore -from chia.wallet.wallet_user_store import WalletUserStore -from chia.server.server import ChiaServer -from chia.wallet.did_wallet.did_wallet import DIDWallet +from flax import __version__ +from flax.consensus.block_record import BlockRecord +from flax.consensus.coinbase import pool_parent_id, farmer_parent_id +from flax.consensus.constants import ConsensusConstants +from flax.consensus.find_fork_point import find_fork_point_in_chain +from flax.full_node.weight_proof import WeightProofHandler +from flax.protocols.wallet_protocol import PuzzleSolutionResponse, RespondPuzzleSolution +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.program import Program +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.full_block import FullBlock +from flax.types.header_block import HeaderBlock +from flax.types.mempool_inclusion_status import MempoolInclusionStatus +from flax.util.byte_types import hexstr_to_bytes +from flax.util.db_wrapper import DBWrapper +from flax.util.errors import Err +from flax.util.hash import std_hash +from flax.util.ints import uint32, uint64, uint128 +from flax.wallet.block_record import HeaderBlockRecord +from flax.wallet.cc_wallet.cc_wallet import CCWallet +from flax.wallet.derivation_record import DerivationRecord +from flax.wallet.derive_keys import master_sk_to_backup_sk, master_sk_to_wallet_sk +from flax.wallet.key_val_store import KeyValStore +from flax.wallet.rl_wallet.rl_wallet import RLWallet +from flax.wallet.settings.user_settings import UserSettings +from flax.wallet.trade_manager import TradeManager +from flax.wallet.transaction_record import TransactionRecord +from flax.wallet.util.backup_utils import open_backup_file +from flax.wallet.util.transaction_type import TransactionType +from flax.wallet.util.wallet_types import WalletType +from flax.wallet.wallet import Wallet +from flax.wallet.wallet_action import WalletAction +from flax.wallet.wallet_action_store import WalletActionStore +from flax.wallet.wallet_block_store import WalletBlockStore +from flax.wallet.wallet_blockchain import WalletBlockchain +from flax.wallet.wallet_coin_record import WalletCoinRecord +from flax.wallet.wallet_coin_store import WalletCoinStore +from flax.wallet.wallet_info import WalletInfo, WalletInfoBackup +from flax.wallet.wallet_puzzle_store import WalletPuzzleStore +from flax.wallet.wallet_sync_store import WalletSyncStore +from flax.wallet.wallet_transaction_store import WalletTransactionStore +from flax.wallet.wallet_user_store import WalletUserStore +from flax.server.server import FlaxServer +from flax.wallet.did_wallet.did_wallet import DIDWallet class WalletStateManager: @@ -99,7 +99,7 @@ class WalletStateManager: coin_store: WalletCoinStore sync_store: WalletSyncStore weight_proof_handler: Any - server: ChiaServer + server: FlaxServer @staticmethod async def create( @@ -107,7 +107,7 @@ async def create( config: Dict, db_path: Path, constants: ConsensusConstants, - server: ChiaServer, + server: FlaxServer, name: str = None, ): self = WalletStateManager() diff --git a/chia/wallet/wallet_sync_store.py b/flax/wallet/wallet_sync_store.py similarity index 95% rename from chia/wallet/wallet_sync_store.py rename to flax/wallet/wallet_sync_store.py index aef832278..1e5185b22 100644 --- a/chia/wallet/wallet_sync_store.py +++ b/flax/wallet/wallet_sync_store.py @@ -2,9 +2,9 @@ import logging from typing import Dict, List, Optional, Tuple -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.header_block import HeaderBlock -from chia.util.ints import uint32 +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.header_block import HeaderBlock +from flax.util.ints import uint32 log = logging.getLogger(__name__) diff --git a/chia/wallet/wallet_transaction_store.py b/flax/wallet/wallet_transaction_store.py similarity index 97% rename from chia/wallet/wallet_transaction_store.py rename to flax/wallet/wallet_transaction_store.py index 5db786345..6f4cd9a13 100644 --- a/chia/wallet/wallet_transaction_store.py +++ b/flax/wallet/wallet_transaction_store.py @@ -3,13 +3,13 @@ import aiosqlite -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.mempool_inclusion_status import MempoolInclusionStatus -from chia.util.db_wrapper import DBWrapper -from chia.util.errors import Err -from chia.util.ints import uint8, uint32 -from chia.wallet.transaction_record import TransactionRecord -from chia.wallet.util.transaction_type import TransactionType +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.mempool_inclusion_status import MempoolInclusionStatus +from flax.util.db_wrapper import DBWrapper +from flax.util.errors import Err +from flax.util.ints import uint8, uint32 +from flax.wallet.transaction_record import TransactionRecord +from flax.wallet.util.transaction_type import TransactionType class WalletTransactionStore: diff --git a/chia/wallet/wallet_user_store.py b/flax/wallet/wallet_user_store.py similarity index 94% rename from chia/wallet/wallet_user_store.py rename to flax/wallet/wallet_user_store.py index f09396450..3a1443b1e 100644 --- a/chia/wallet/wallet_user_store.py +++ b/flax/wallet/wallet_user_store.py @@ -2,10 +2,10 @@ import aiosqlite -from chia.util.db_wrapper import DBWrapper -from chia.util.ints import uint32 -from chia.wallet.util.wallet_types import WalletType -from chia.wallet.wallet_info import WalletInfo +from flax.util.db_wrapper import DBWrapper +from flax.util.ints import uint32 +from flax.wallet.util.wallet_types import WalletType +from flax.wallet.wallet_info import WalletInfo class WalletUserStore: @@ -48,7 +48,7 @@ async def create(cls, db_wrapper: DBWrapper): async def init_wallet(self): all_wallets = await self.get_all_wallet_info_entries() if len(all_wallets) == 0: - await self.create_wallet("Chia Wallet", WalletType.STANDARD_WALLET, "") + await self.create_wallet("Flax Wallet", WalletType.STANDARD_WALLET, "") async def _clear_database(self): cursor = await self.db_connection.execute("DELETE FROM users_wallets") diff --git a/install-gui.sh b/install-gui.sh index fd848b0b5..eda318c6d 100755 --- a/install-gui.sh +++ b/install-gui.sh @@ -2,17 +2,17 @@ set -e if [ -z "$VIRTUAL_ENV" ]; then - echo "This requires the chia python virtual environment." + echo "This requires the flax python virtual environment." echo "Execute '. ./activate' before running." exit 1 fi if [ "$(id -u)" = 0 ]; then - echo "The Chia Blockchain GUI can not be installed or run by the root user." + echo "The Flax Blockchain GUI can not be installed or run by the root user." exit 1 fi -# Allows overriding the branch or commit to build in chia-blockchain-gui +# Allows overriding the branch or commit to build in flax-blockchain-gui SUBMODULE_BRANCH=$1 UBUNTU=false @@ -78,7 +78,7 @@ if [ ! "$CI" ]; then echo "Running git submodule update." echo "" git submodule update - cd chia-blockchain-gui + cd flax-blockchain-gui if [ "$SUBMODULE_BRANCH" ]; then @@ -98,6 +98,6 @@ else fi echo "" -echo "Chia blockchain install-gui.sh completed." +echo "Flax blockchain install-gui.sh completed." echo "" -echo "Type 'cd chia-blockchain-gui' and then 'npm run electron &' to start the GUI." +echo "Type 'cd flax-blockchain-gui' and then 'npm run electron &' to start the GUI." diff --git a/install-timelord.sh b/install-timelord.sh old mode 100644 new mode 100755 index 3be18e7f4..94d71369b --- a/install-timelord.sh +++ b/install-timelord.sh @@ -1,7 +1,7 @@ #!/bin/bash if [ -z "$VIRTUAL_ENV" ]; then - echo "This requires the chia python virtual environment." + echo "This requires the flax python virtual environment." echo "Execute '. ./activate' before running." exit 1 fi @@ -13,7 +13,7 @@ echo "Python version: $PYTHON_VERSION" export BUILD_VDF_BENCH=Y # Installs the useful vdf_bench test of CPU squaring speed THE_PATH=$(python -c 'import pkg_resources; print( pkg_resources.get_distribution("chiavdf").location)' 2>/dev/null)/vdf_client -CHIAVDF_VERSION=$(python -c 'from setup import dependencies; t = [_ for _ in dependencies if _.startswith("chiavdf")][0]; print(t)') +FLAXVDF_VERSION=$(python -c 'from setup import dependencies; t = [_ for _ in dependencies if _.startswith("chiavdf")][0]; print(t)') ubuntu_cmake_install() { UBUNTU_PRE_2004=$(python -c 'import subprocess; process = subprocess.run(["lsb_release", "-rs"], stdout=subprocess.PIPE); print(float(process.stdout) < float(20.04))') @@ -62,30 +62,30 @@ else # Install remaining needed development tools - assumes venv and prior run of install.sh echo apt-get install libgmp-dev libboost-python-dev lib"$PYTHON_VERSION"-dev libboost-system-dev build-essential -y sudo apt-get install libgmp-dev libboost-python-dev lib"$PYTHON_VERSION"-dev libboost-system-dev build-essential -y - echo venv/bin/python -m pip install --force --no-binary chiavdf "$CHIAVDF_VERSION" - venv/bin/python -m pip install --force --no-binary chiavdf "$CHIAVDF_VERSION" + echo venv/bin/python -m pip install --force --no-binary chiavdf "$FLAXVDF_VERSION" + venv/bin/python -m pip install --force --no-binary chiavdf "$FLAXVDF_VERSION" symlink_vdf_bench "$PYTHON_VERSION" elif [ -e venv/bin/python ] && test $RHEL_BASED; then echo "Installing chiavdf from source on RedHat/CentOS/Fedora" # Install remaining needed development tools - assumes venv and prior run of install.sh echo yum install gcc gcc-c++ gmp-devel python3-devel libtool make autoconf automake openssl-devel libevent-devel boost-devel python3 -y sudo yum install gcc gcc-c++ gmp-devel python3-devel libtool make autoconf automake openssl-devel libevent-devel boost-devel python3 -y - echo venv/bin/python -m pip install --force --no-binary chiavdf "$CHIAVDF_VERSION" - venv/bin/python -m pip install --force --no-binary chiavdf "$CHIAVDF_VERSION" + echo venv/bin/python -m pip install --force --no-binary chiavdf "$FLAXVDF_VERSION" + venv/bin/python -m pip install --force --no-binary chiavdf "$FLAXVDF_VERSION" symlink_vdf_bench "$PYTHON_VERSION" elif [ -e venv/bin/python ] && test $MACOS && [ "$(brew info boost | grep -c 'Not installed')" -eq 1 ]; then echo "Installing chiavdf requirement boost for MacOS." brew install boost echo "Installing chiavdf from source." # User needs to provide required packages - echo venv/bin/python -m pip install --force --no-binary chiavdf "$CHIAVDF_VERSION" - venv/bin/python -m pip install --force --no-binary chiavdf "$CHIAVDF_VERSION" + echo venv/bin/python -m pip install --force --no-binary chiavdf "$FLAXVDF_VERSION" + venv/bin/python -m pip install --force --no-binary chiavdf "$FLAXVDF_VERSION" symlink_vdf_bench "$PYTHON_VERSION" elif [ -e venv/bin/python ]; then echo "Installing chiavdf from source." # User needs to provide required packages - echo venv/bin/python -m pip install --force --no-binary chiavdf "$CHIAVDF_VERSION" - venv/bin/python -m pip install --force --no-binary chiavdf "$CHIAVDF_VERSION" + echo venv/bin/python -m pip install --force --no-binary chiavdf "$FLAXVDF_VERSION" + venv/bin/python -m pip install --force --no-binary chiavdf "$FLAXVDF_VERSION" symlink_vdf_bench "$PYTHON_VERSION" else echo "No venv created yet, please run install.sh." diff --git a/install.sh b/install.sh old mode 100644 new mode 100755 index c53e696dd..ba86ea4be --- a/install.sh +++ b/install.sh @@ -18,9 +18,9 @@ fi if [ "$(uname -m)" = "armv7l" ]; then echo "" echo "WARNING:" - echo "The Chia Blockchain requires a 64 bit OS and this is 32 bit armv7l" + echo "The Flax Blockchain requires a 64 bit OS and this is 32 bit armv7l" echo "For more information, see" - echo "https://github.com/Chia-Network/chia-blockchain/wiki/Raspberry-Pi" + echo "https://github.com/Flax-Network/flax-blockchain/wiki/Raspberry-Pi" echo "Exiting." exit 1 fi @@ -120,13 +120,13 @@ python -m pip install --extra-index-url https://pypi.chia.net/simple/ miniupnpc= python -m pip install -e . --extra-index-url https://pypi.chia.net/simple/ echo "" -echo "Chia blockchain install.sh complete." -echo "For assistance join us on Keybase in the #testnet chat channel:" -echo "https://keybase.io/team/chia_network.public" +echo "Flax blockchain install.sh complete." +echo "For assistance join us on Discord in the #testnet chat channel:" +echo "https://discord.gg/TgJyxsEFFc" echo "" -echo "Try the Quick Start Guide to running chia-blockchain:" -echo "https://github.com/Chia-Network/chia-blockchain/wiki/Quick-Start-Guide" +echo "Try the Quick Start Guide to running flax-blockchain:" +echo "https://github.com/Flax-Network/flax-blockchain/wiki/Quick-Start-Guide" echo "" echo "To install the GUI type 'sh install-gui.sh' after '. ./activate'." echo "" -echo "Type '. ./activate' and then 'chia init' to begin." +echo "Type '. ./activate' and then 'flax init' to begin." diff --git a/run-py-tests.sh b/run-py-tests.sh old mode 100755 new mode 100644 diff --git a/setup.py b/setup.py index a7998c22f..563a7cfe2 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ # "keyrings.cryptfile==1.3.8", # Secure storage for keys on Linux (Will be replaced) # See https://github.com/frispete/keyrings.cryptfile/issues/15 "PyYAML==5.4.1", # Used for config file format - "setproctitle==1.2.2", # Gives the chia processes readable names + "setproctitle==1.2.2", # Gives the flax processes readable names "sortedcontainers==2.3.0", # For maintaining sorted mempools "websockets==8.1.0", # For use in wallet RPC and electron UI "click==7.1.2", # For the CLI @@ -41,14 +41,14 @@ ] kwargs = dict( - name="chia-blockchain", + name="flax-blockchain", author="Mariano Sorgente", - author_email="mariano@chia.net", - description="Chia blockchain full node, farmer, timelord, and wallet.", - url="https://chia.net/", + author_email="mariano@flaxnetwork.org", + description="Flax blockchain full node, farmer, timelord, and wallet.", + url="https://flaxnetwork.org/", license="Apache License", python_requires=">=3.7, <4", - keywords="chia blockchain node", + keywords="flax blockchain node", install_requires=dependencies, setup_requires=["setuptools_scm"], extras_require=dict( @@ -58,52 +58,52 @@ ), packages=[ "build_scripts", - "chia", - "chia.cmds", - "chia.consensus", - "chia.daemon", - "chia.full_node", - "chia.timelord", - "chia.farmer", - "chia.harvester", - "chia.introducer", - "chia.plotting", - "chia.protocols", - "chia.rpc", - "chia.server", - "chia.simulator", - "chia.types.blockchain_format", - "chia.types", - "chia.util", - "chia.wallet", - "chia.wallet.puzzles", - "chia.wallet.rl_wallet", - "chia.wallet.cc_wallet", - "chia.wallet.did_wallet", - "chia.wallet.settings", - "chia.wallet.trading", - "chia.wallet.util", - "chia.ssl", + "flax", + "flax.cmds", + "flax.consensus", + "flax.daemon", + "flax.full_node", + "flax.timelord", + "flax.farmer", + "flax.harvester", + "flax.introducer", + "flax.plotting", + "flax.protocols", + "flax.rpc", + "flax.server", + "flax.simulator", + "flax.types.blockchain_format", + "flax.types", + "flax.util", + "flax.wallet", + "flax.wallet.puzzles", + "flax.wallet.rl_wallet", + "flax.wallet.cc_wallet", + "flax.wallet.did_wallet", + "flax.wallet.settings", + "flax.wallet.trading", + "flax.wallet.util", + "flax.ssl", "mozilla-ca", ], entry_points={ "console_scripts": [ - "chia = chia.cmds.chia:main", - "chia_wallet = chia.server.start_wallet:main", - "chia_full_node = chia.server.start_full_node:main", - "chia_harvester = chia.server.start_harvester:main", - "chia_farmer = chia.server.start_farmer:main", - "chia_introducer = chia.server.start_introducer:main", - "chia_timelord = chia.server.start_timelord:main", - "chia_timelord_launcher = chia.timelord.timelord_launcher:main", - "chia_full_node_simulator = chia.simulator.start_simulator:main", + "flax = flax.cmds.flax:main", + "flax_wallet = flax.server.start_wallet:main", + "flax_full_node = flax.server.start_full_node:main", + "flax_harvester = flax.server.start_harvester:main", + "flax_farmer = flax.server.start_farmer:main", + "flax_introducer = flax.server.start_introducer:main", + "flax_timelord = flax.server.start_timelord:main", + "flax_timelord_launcher = flax.timelord.timelord_launcher:main", + "flax_full_node_simulator = flax.simulator.start_simulator:main", ] }, package_data={ - "chia": ["pyinstaller.spec"], - "chia.wallet.puzzles": ["*.clvm", "*.clvm.hex"], - "chia.util": ["initial-*.yaml", "english.txt"], - "chia.ssl": ["chia_ca.crt", "chia_ca.key", "dst_root_ca.pem"], + "flax": ["pyinstaller.spec"], + "flax.wallet.puzzles": ["*.clvm", "*.clvm.hex"], + "flax.util": ["initial-*.yaml", "english.txt"], + "flax.ssl": ["flax_ca.crt", "flax_ca.key", "dst_root_ca.pem"], "mozilla-ca": ["cacert.pem"], }, use_scm_version={"fallback_version": "unknown-no-.git-directory"}, diff --git a/tests/README.md b/tests/README.md index 089536efb..2dc9b115f 100644 --- a/tests/README.md +++ b/tests/README.md @@ -7,7 +7,7 @@ Tests are recognized by the file glob `test_*.py`. Changing the contents of a file does not require running `build-workflows.py`. We currently use github actions. Default runners have two vcpus. -The workflows are located in [../.github/workflows/](https://github.com/Chia-Network/chia-blockchain/tree/main/.github/workflows). +The workflows are located in [../.github/workflows/](https://github.com/Flax-Network/flax-blockchain/tree/main/.github/workflows). The inputs to `build-workflows.py` are the templates in `runner-templates`, the file `testconfig.py` in this directory, and the optional `config.py` files in some test subdirectories. Files in the template directory ending in `include.yml` are included in jobs based on the per-directory settings. @@ -21,7 +21,7 @@ The subdirectory jobs do not include the tests from their parents. ## testconfig.py -In the top tests directory, [testconfig.py](https://github.com/Chia-Network/chia-blockchain/tree/main/tests/testconfig.py) +In the top tests directory, [testconfig.py](https://github.com/Flax-Network/flax-blockchain/tree/main/tests/testconfig.py) contains the application settings and the per-directory default settings. ## config.py @@ -43,7 +43,7 @@ If you are certain that all the tests in a directory can run in parallel, set `p ### Optional job stages -Set `checkout_blocks_and_plots` to `False` to omit checking out the [test-cache](https://github.com/Chia-Network/test-cache) repo. +Set `checkout_blocks_and_plots` to `False` to omit checking out the [test-cache](https://github.com/Flax-Network/test-cache) repo. Set `install_timelord` to `False` to omit the step of installing a Time Lord for your directory's job. diff --git a/tests/blockchain/test_blockchain.py b/tests/blockchain/test_blockchain.py index de6d2d3f8..446b106fe 100644 --- a/tests/blockchain/test_blockchain.py +++ b/tests/blockchain/test_blockchain.py @@ -10,31 +10,31 @@ from blspy import AugSchemeMPL, G2Element from clvm.casts import int_to_bytes -from chia.consensus.block_rewards import calculate_base_farmer_reward -from chia.consensus.blockchain import ReceiveBlockResult -from chia.consensus.coinbase import create_farmer_coin -from chia.consensus.pot_iterations import is_overflow_block -from chia.full_node.bundle_tools import detect_potential_template_generator -from chia.types.blockchain_format.classgroup import ClassgroupElement -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.foliage import TransactionsInfo -from chia.types.blockchain_format.program import SerializedProgram -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.blockchain_format.slots import InfusedChallengeChainSubSlot -from chia.types.blockchain_format.vdf import VDFInfo, VDFProof -from chia.types.condition_opcodes import ConditionOpcode -from chia.types.condition_with_args import ConditionWithArgs -from chia.types.end_of_slot_bundle import EndOfSubSlotBundle -from chia.types.full_block import FullBlock -from chia.types.spend_bundle import SpendBundle -from chia.types.unfinished_block import UnfinishedBlock -from chia.util.block_tools import BlockTools, get_vdf_info_and_proof -from chia.util.errors import Err -from chia.util.hash import std_hash -from chia.util.ints import uint8, uint64, uint32 -from chia.util.merkle_set import MerkleSet -from chia.util.recursive_replace import recursive_replace -from chia.util.wallet_tools import WalletTool +from flax.consensus.block_rewards import calculate_base_farmer_reward +from flax.consensus.blockchain import ReceiveBlockResult +from flax.consensus.coinbase import create_farmer_coin +from flax.consensus.pot_iterations import is_overflow_block +from flax.full_node.bundle_tools import detect_potential_template_generator +from flax.types.blockchain_format.classgroup import ClassgroupElement +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.foliage import TransactionsInfo +from flax.types.blockchain_format.program import SerializedProgram +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.blockchain_format.slots import InfusedChallengeChainSubSlot +from flax.types.blockchain_format.vdf import VDFInfo, VDFProof +from flax.types.condition_opcodes import ConditionOpcode +from flax.types.condition_with_args import ConditionWithArgs +from flax.types.end_of_slot_bundle import EndOfSubSlotBundle +from flax.types.full_block import FullBlock +from flax.types.spend_bundle import SpendBundle +from flax.types.unfinished_block import UnfinishedBlock +from flax.util.block_tools import BlockTools, get_vdf_info_and_proof +from flax.util.errors import Err +from flax.util.hash import std_hash +from flax.util.ints import uint8, uint64, uint32 +from flax.util.merkle_set import MerkleSet +from flax.util.recursive_replace import recursive_replace +from flax.util.wallet_tools import WalletTool from tests.core.fixtures import default_400_blocks # noqa: F401; noqa: F401 from tests.core.fixtures import default_1000_blocks # noqa: F401 from tests.core.fixtures import default_10000_blocks # noqa: F401 diff --git a/tests/blockchain/test_blockchain_transactions.py b/tests/blockchain/test_blockchain_transactions.py index 4d30306a9..3effd2aa9 100644 --- a/tests/blockchain/test_blockchain_transactions.py +++ b/tests/blockchain/test_blockchain_transactions.py @@ -4,15 +4,15 @@ import pytest from clvm.casts import int_to_bytes -from chia.consensus.blockchain import ReceiveBlockResult -from chia.protocols import full_node_protocol -from chia.types.announcement import Announcement -from chia.types.condition_opcodes import ConditionOpcode -from chia.types.condition_with_args import ConditionWithArgs -from chia.types.spend_bundle import SpendBundle -from chia.util.errors import ConsensusError, Err -from chia.util.ints import uint64 -from chia.util.wallet_tools import WalletTool +from flax.consensus.blockchain import ReceiveBlockResult +from flax.protocols import full_node_protocol +from flax.types.announcement import Announcement +from flax.types.condition_opcodes import ConditionOpcode +from flax.types.condition_with_args import ConditionWithArgs +from flax.types.spend_bundle import SpendBundle +from flax.util.errors import ConsensusError, Err +from flax.util.ints import uint64 +from flax.util.wallet_tools import WalletTool from tests.core.full_node.test_full_node import connect_and_get_peer from tests.setup_nodes import bt, setup_two_nodes, test_constants from tests.util.generator_tools_testing import run_and_get_removals_and_additions diff --git a/tests/build-workflows.py b/tests/build-workflows.py old mode 100755 new mode 100644 index e959fd513..66b328192 --- a/tests/build-workflows.py +++ b/tests/build-workflows.py @@ -85,7 +85,7 @@ def generate_replacements(defaults, conf, dir, test_files): if not conf["checkout_blocks_and_plots"]: replacements[ "CHECKOUT_TEST_BLOCKS_AND_PLOTS" - ] = "# Omitted checking out blocks and plots repo Chia-Network/test-cache" + ] = "# Omitted checking out blocks and plots repo Flax-Network/test-cache" if not conf["install_timelord"]: replacements["INSTALL_TIMELORD"] = "# Omitted installing Timelord" if conf["parallel"]: diff --git a/tests/clvm/coin_store.py b/tests/clvm/coin_store.py index af9280bad..ab72ec5a4 100644 --- a/tests/clvm/coin_store.py +++ b/tests/clvm/coin_store.py @@ -2,17 +2,17 @@ from dataclasses import dataclass, replace from typing import Dict, Iterator, Set -from chia.full_node.mempool_check_conditions import mempool_check_conditions_dict -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.coin_record import CoinRecord -from chia.types.spend_bundle import SpendBundle -from chia.util.condition_tools import ( +from flax.full_node.mempool_check_conditions import mempool_check_conditions_dict +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.coin_record import CoinRecord +from flax.types.spend_bundle import SpendBundle +from flax.util.condition_tools import ( conditions_dict_for_solution, coin_announcement_names_for_conditions_dict, puzzle_announcement_names_for_conditions_dict, ) -from chia.util.ints import uint32, uint64 +from flax.util.ints import uint32, uint64 class BadSpendBundleError(Exception): diff --git a/tests/clvm/test_clvm_compilation.py b/tests/clvm/test_clvm_compilation.py index b9d8343df..f16ca20c8 100644 --- a/tests/clvm/test_clvm_compilation.py +++ b/tests/clvm/test_clvm_compilation.py @@ -3,43 +3,43 @@ from clvm_tools.clvmc import compile_clvm -from chia.types.blockchain_format.program import Program, SerializedProgram +from flax.types.blockchain_format.program import Program, SerializedProgram wallet_program_files = set( [ - "chia/wallet/puzzles/calculate_synthetic_public_key.clvm", - "chia/wallet/puzzles/cc.clvm", - "chia/wallet/puzzles/chialisp_deserialisation.clvm", - "chia/wallet/puzzles/rom_bootstrap_generator.clvm", - "chia/wallet/puzzles/generator_for_single_coin.clvm", - "chia/wallet/puzzles/genesis-by-coin-id-with-0.clvm", - "chia/wallet/puzzles/genesis-by-puzzle-hash-with-0.clvm", - "chia/wallet/puzzles/lock.inner.puzzle.clvm", - "chia/wallet/puzzles/p2_conditions.clvm", - "chia/wallet/puzzles/p2_delegated_conditions.clvm", - "chia/wallet/puzzles/p2_delegated_puzzle.clvm", - "chia/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.clvm", - "chia/wallet/puzzles/p2_m_of_n_delegate_direct.clvm", - "chia/wallet/puzzles/p2_puzzle_hash.clvm", - "chia/wallet/puzzles/rl_aggregation.clvm", - "chia/wallet/puzzles/rl.clvm", - "chia/wallet/puzzles/sha256tree_module.clvm", - "chia/wallet/puzzles/singleton_top_layer.clvm", - "chia/wallet/puzzles/did_innerpuz.clvm", - "chia/wallet/puzzles/decompress_puzzle.clvm", - "chia/wallet/puzzles/decompress_coin_solution_entry_with_prefix.clvm", - "chia/wallet/puzzles/decompress_coin_solution_entry.clvm", - "chia/wallet/puzzles/block_program_zero.clvm", - "chia/wallet/puzzles/test_generator_deserialize.clvm", - "chia/wallet/puzzles/test_multiple_generator_input_arguments.clvm", + "flax/wallet/puzzles/calculate_synthetic_public_key.clvm", + "flax/wallet/puzzles/cc.clvm", + "flax/wallet/puzzles/flaxlisp_deserialisation.clvm", + "flax/wallet/puzzles/rom_bootstrap_generator.clvm", + "flax/wallet/puzzles/generator_for_single_coin.clvm", + "flax/wallet/puzzles/genesis-by-coin-id-with-0.clvm", + "flax/wallet/puzzles/genesis-by-puzzle-hash-with-0.clvm", + "flax/wallet/puzzles/lock.inner.puzzle.clvm", + "flax/wallet/puzzles/p2_conditions.clvm", + "flax/wallet/puzzles/p2_delegated_conditions.clvm", + "flax/wallet/puzzles/p2_delegated_puzzle.clvm", + "flax/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.clvm", + "flax/wallet/puzzles/p2_m_of_n_delegate_direct.clvm", + "flax/wallet/puzzles/p2_puzzle_hash.clvm", + "flax/wallet/puzzles/rl_aggregation.clvm", + "flax/wallet/puzzles/rl.clvm", + "flax/wallet/puzzles/sha256tree_module.clvm", + "flax/wallet/puzzles/singleton_top_layer.clvm", + "flax/wallet/puzzles/did_innerpuz.clvm", + "flax/wallet/puzzles/decompress_puzzle.clvm", + "flax/wallet/puzzles/decompress_coin_solution_entry_with_prefix.clvm", + "flax/wallet/puzzles/decompress_coin_solution_entry.clvm", + "flax/wallet/puzzles/block_program_zero.clvm", + "flax/wallet/puzzles/test_generator_deserialize.clvm", + "flax/wallet/puzzles/test_multiple_generator_input_arguments.clvm", ] ) clvm_include_files = set( - ["chia/wallet/puzzles/create-lock-puzzlehash.clvm", "chia/wallet/puzzles/condition_codes.clvm"] + ["flax/wallet/puzzles/create-lock-puzzlehash.clvm", "flax/wallet/puzzles/condition_codes.clvm"] ) -CLVM_PROGRAM_ROOT = "chia/wallet/puzzles" +CLVM_PROGRAM_ROOT = "flax/wallet/puzzles" def list_files(dir, glob): @@ -66,7 +66,7 @@ class TestClvmCompilation(TestCase): def test_all_programs_listed(self): """ - Checks to see if a new .clvm file was added to chia/wallet/puzzles, but not added to `wallet_program_files` + Checks to see if a new .clvm file was added to flax/wallet/puzzles, but not added to `wallet_program_files` """ existing_files = list_files(CLVM_PROGRAM_ROOT, "*.clvm") existing_file_paths = set([Path(x).relative_to(CLVM_PROGRAM_ROOT) for x in existing_files]) diff --git a/tests/clvm/test_chialisp_deserialization.py b/tests/clvm/test_flaxlisp_deserialization.py similarity index 93% rename from tests/clvm/test_chialisp_deserialization.py rename to tests/clvm/test_flaxlisp_deserialization.py index 7c1909b4f..f4cbeaf92 100644 --- a/tests/clvm/test_chialisp_deserialization.py +++ b/tests/clvm/test_flaxlisp_deserialization.py @@ -1,10 +1,10 @@ from unittest import TestCase -from chia.types.blockchain_format.program import Program, INFINITE_COST -from chia.util.byte_types import hexstr_to_bytes -from chia.wallet.puzzles.load_clvm import load_clvm +from flax.types.blockchain_format.program import Program, INFINITE_COST +from flax.util.byte_types import hexstr_to_bytes +from flax.wallet.puzzles.load_clvm import load_clvm -DESERIALIZE_MOD = load_clvm("chialisp_deserialisation.clvm", package_or_requirement="chia.wallet.puzzles") +DESERIALIZE_MOD = load_clvm("flaxlisp_deserialisation.clvm", package_or_requirement="flax.wallet.puzzles") def serialized_atom_overflow(size): diff --git a/tests/clvm/test_puzzles.py b/tests/clvm/test_puzzles.py index 3aa428392..67e10bc55 100644 --- a/tests/clvm/test_puzzles.py +++ b/tests/clvm/test_puzzles.py @@ -3,13 +3,13 @@ from blspy import AugSchemeMPL, BasicSchemeMPL, G1Element, G2Element -from chia.types.blockchain_format.program import Program -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.coin_solution import CoinSolution -from chia.types.spend_bundle import SpendBundle -from chia.util.condition_tools import ConditionOpcode -from chia.util.hash import std_hash -from chia.wallet.puzzles import ( +from flax.types.blockchain_format.program import Program +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.coin_solution import CoinSolution +from flax.types.spend_bundle import SpendBundle +from flax.util.condition_tools import ConditionOpcode +from flax.util.hash import std_hash +from flax.wallet.puzzles import ( p2_conditions, p2_delegated_conditions, p2_delegated_puzzle, diff --git a/tests/clvm/test_serialized_program.py b/tests/clvm/test_serialized_program.py index e6345c2df..dca1ee565 100644 --- a/tests/clvm/test_serialized_program.py +++ b/tests/clvm/test_serialized_program.py @@ -1,7 +1,7 @@ from unittest import TestCase -from chia.types.blockchain_format.program import Program, SerializedProgram, INFINITE_COST -from chia.wallet.puzzles.load_clvm import load_clvm +from flax.types.blockchain_format.program import Program, SerializedProgram, INFINITE_COST +from flax.wallet.puzzles.load_clvm import load_clvm SHA256TREE_MOD = load_clvm("sha256tree_module.clvm") diff --git a/tests/connection_utils.py b/tests/connection_utils.py index f44f44239..75e540fd1 100644 --- a/tests/connection_utils.py +++ b/tests/connection_utils.py @@ -7,45 +7,45 @@ from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives import hashes, serialization -from chia.protocols.shared_protocol import protocol_version -from chia.server.outbound_message import NodeType -from chia.server.server import ChiaServer, ssl_context_for_client -from chia.server.ws_connection import WSChiaConnection -from chia.ssl.create_ssl import generate_ca_signed_cert -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.peer_info import PeerInfo -from chia.util.ints import uint16 +from flax.protocols.shared_protocol import protocol_version +from flax.server.outbound_message import NodeType +from flax.server.server import FlaxServer, ssl_context_for_client +from flax.server.ws_connection import WSFlaxConnection +from flax.ssl.create_ssl import generate_ca_signed_cert +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.peer_info import PeerInfo +from flax.util.ints import uint16 from tests.setup_nodes import self_hostname from tests.time_out_assert import time_out_assert log = logging.getLogger(__name__) -async def disconnect_all_and_reconnect(server: ChiaServer, reconnect_to: ChiaServer) -> bool: +async def disconnect_all_and_reconnect(server: FlaxServer, reconnect_to: FlaxServer) -> bool: cons = list(server.all_connections.values())[:] for con in cons: await con.close() return await server.start_client(PeerInfo(self_hostname, uint16(reconnect_to._port)), None) -async def add_dummy_connection(server: ChiaServer, dummy_port: int) -> Tuple[asyncio.Queue, bytes32]: +async def add_dummy_connection(server: FlaxServer, dummy_port: int) -> Tuple[asyncio.Queue, bytes32]: timeout = aiohttp.ClientTimeout(total=10) session = aiohttp.ClientSession(timeout=timeout) incoming_queue: asyncio.Queue = asyncio.Queue() dummy_crt_path = server._private_key_path.parent / "dummy.crt" dummy_key_path = server._private_key_path.parent / "dummy.key" generate_ca_signed_cert( - server.chia_ca_crt_path.read_bytes(), server.chia_ca_key_path.read_bytes(), dummy_crt_path, dummy_key_path + server.flax_ca_crt_path.read_bytes(), server.flax_ca_key_path.read_bytes(), dummy_crt_path, dummy_key_path ) ssl_context = ssl_context_for_client( - server.chia_ca_crt_path, server.chia_ca_key_path, dummy_crt_path, dummy_key_path + server.flax_ca_crt_path, server.flax_ca_key_path, dummy_crt_path, dummy_key_path ) pem_cert = x509.load_pem_x509_certificate(dummy_crt_path.read_bytes(), default_backend()) der_cert = x509.load_der_x509_certificate(pem_cert.public_bytes(serialization.Encoding.DER), default_backend()) peer_id = bytes32(der_cert.fingerprint(hashes.SHA256())) url = f"wss://{self_hostname}:{server._port}/ws" ws = await session.ws_connect(url, autoclose=True, autoping=True, ssl=ssl_context) - wsc = WSChiaConnection( + wsc = WSFlaxConnection( NodeType.FULL_NODE, ws, server._port, @@ -64,7 +64,7 @@ async def add_dummy_connection(server: ChiaServer, dummy_port: int) -> Tuple[asy return incoming_queue, peer_id -async def connect_and_get_peer(server_1: ChiaServer, server_2: ChiaServer) -> WSChiaConnection: +async def connect_and_get_peer(server_1: FlaxServer, server_2: FlaxServer) -> WSFlaxConnection: """ Connect server_2 to server_1, and get return the connection in server_1. """ diff --git a/tests/core/consensus/test_pot_iterations.py b/tests/core/consensus/test_pot_iterations.py index d7d913e3a..1243f24f2 100644 --- a/tests/core/consensus/test_pot_iterations.py +++ b/tests/core/consensus/test_pot_iterations.py @@ -1,15 +1,15 @@ from pytest import raises -from chia.consensus.default_constants import DEFAULT_CONSTANTS -from chia.consensus.pos_quality import _expected_plot_size -from chia.consensus.pot_iterations import ( +from flax.consensus.default_constants import DEFAULT_CONSTANTS +from flax.consensus.pos_quality import _expected_plot_size +from flax.consensus.pot_iterations import ( calculate_ip_iters, calculate_iterations_quality, calculate_sp_iters, is_overflow_block, ) -from chia.util.hash import std_hash -from chia.util.ints import uint8, uint64 +from flax.util.hash import std_hash +from flax.util.ints import uint8, uint64 test_constants = DEFAULT_CONSTANTS.replace(**{"NUM_SPS_SUB_SLOT": 32, "SUB_SLOT_TIME_TARGET": 300}) diff --git a/tests/core/daemon/test_daemon.py b/tests/core/daemon/test_daemon.py index b5b0b7cde..7a8054db1 100644 --- a/tests/core/daemon/test_daemon.py +++ b/tests/core/daemon/test_daemon.py @@ -3,12 +3,12 @@ import aiohttp import pytest -from chia.server.outbound_message import NodeType -from chia.server.server import ssl_context_for_server -from chia.types.peer_info import PeerInfo -from chia.util.block_tools import BlockTools -from chia.util.ints import uint16 -from chia.util.ws_message import create_payload +from flax.server.outbound_message import NodeType +from flax.server.server import ssl_context_for_server +from flax.types.peer_info import PeerInfo +from flax.util.block_tools import BlockTools +from flax.util.ints import uint16 +from flax.util.ws_message import create_payload from tests.core.node_height import node_height_at_least from tests.setup_nodes import setup_daemon, self_hostname, setup_full_system from tests.simulation.test_simulation import test_constants_modified @@ -90,7 +90,7 @@ async def reader(ws, queue): read_handler = asyncio.create_task(reader(ws, message_queue)) data = {} - payload = create_payload("get_blockchain_state", data, service_name, "chia_full_node") + payload = create_payload("get_blockchain_state", data, service_name, "flax_full_node") await ws.send_str(payload) await asyncio.sleep(5) diff --git a/tests/core/fixtures.py b/tests/core/fixtures.py index 42172573d..19ce261f8 100644 --- a/tests/core/fixtures.py +++ b/tests/core/fixtures.py @@ -6,13 +6,13 @@ import aiosqlite import pytest -from chia.consensus.blockchain import Blockchain -from chia.consensus.constants import ConsensusConstants -from chia.full_node.block_store import BlockStore -from chia.full_node.coin_store import CoinStore -from chia.types.full_block import FullBlock -from chia.util.db_wrapper import DBWrapper -from chia.util.path import mkdir +from flax.consensus.blockchain import Blockchain +from flax.consensus.constants import ConsensusConstants +from flax.full_node.block_store import BlockStore +from flax.full_node.coin_store import CoinStore +from flax.types.full_block import FullBlock +from flax.util.db_wrapper import DBWrapper +from flax.util.path import mkdir from tests.setup_nodes import bt, test_constants @@ -96,8 +96,8 @@ def persistent_blocks( ): # try loading from disc, if not create new blocks.db file # TODO hash fixtures.py and blocktool.py, add to path, delete if the files changed - block_path_dir = Path("~/.chia/blocks").expanduser() - file_path = Path(f"~/.chia/blocks/{db_name}").expanduser() + block_path_dir = Path("~/.flax/blocks").expanduser() + file_path = Path(f"~/.flax/blocks/{db_name}").expanduser() if not path.exists(block_path_dir): mkdir(block_path_dir.parent) mkdir(block_path_dir) diff --git a/tests/core/full_node/full_sync/test_full_sync.py b/tests/core/full_node/full_sync/test_full_sync.py index 53b206aed..a4fb08b3c 100644 --- a/tests/core/full_node/full_sync/test_full_sync.py +++ b/tests/core/full_node/full_sync/test_full_sync.py @@ -6,11 +6,11 @@ import pytest -from chia.protocols import full_node_protocol -from chia.types.full_block import FullBlock -from chia.types.peer_info import PeerInfo -from chia.util.hash import std_hash -from chia.util.ints import uint16 +from flax.protocols import full_node_protocol +from flax.types.full_block import FullBlock +from flax.types.peer_info import PeerInfo +from flax.util.hash import std_hash +from flax.util.ints import uint16 from tests.core.fixtures import default_400_blocks, default_1000_blocks, default_10000_blocks, empty_blockchain from tests.core.node_height import node_height_exactly from tests.setup_nodes import bt, self_hostname, setup_n_nodes, setup_two_nodes, test_constants diff --git a/tests/core/full_node/ram_db.py b/tests/core/full_node/ram_db.py index d71435649..6671a345f 100644 --- a/tests/core/full_node/ram_db.py +++ b/tests/core/full_node/ram_db.py @@ -2,11 +2,11 @@ import aiosqlite -from chia.consensus.blockchain import Blockchain -from chia.consensus.constants import ConsensusConstants -from chia.full_node.block_store import BlockStore -from chia.full_node.coin_store import CoinStore -from chia.util.db_wrapper import DBWrapper +from flax.consensus.blockchain import Blockchain +from flax.consensus.constants import ConsensusConstants +from flax.full_node.block_store import BlockStore +from flax.full_node.coin_store import CoinStore +from flax.util.db_wrapper import DBWrapper async def create_ram_blockchain(consensus_constants: ConsensusConstants) -> Tuple[aiosqlite.Connection, Blockchain]: diff --git a/tests/core/full_node/test_address_manager.py b/tests/core/full_node/test_address_manager.py index 8e72bc019..0207e15d9 100644 --- a/tests/core/full_node/test_address_manager.py +++ b/tests/core/full_node/test_address_manager.py @@ -6,9 +6,9 @@ import aiosqlite import pytest -from chia.server.address_manager import AddressManager, ExtendedPeerInfo -from chia.server.address_manager_store import AddressManagerStore -from chia.types.peer_info import PeerInfo, TimestampedPeerInfo +from flax.server.address_manager import AddressManager, ExtendedPeerInfo +from flax.server.address_manager_store import AddressManagerStore +from flax.types.peer_info import PeerInfo, TimestampedPeerInfo @pytest.fixture(scope="module") diff --git a/tests/core/full_node/test_block_store.py b/tests/core/full_node/test_block_store.py index 194fd4cea..a5c2d9875 100644 --- a/tests/core/full_node/test_block_store.py +++ b/tests/core/full_node/test_block_store.py @@ -6,10 +6,10 @@ import aiosqlite import pytest -from chia.consensus.blockchain import Blockchain -from chia.full_node.block_store import BlockStore -from chia.full_node.coin_store import CoinStore -from chia.util.db_wrapper import DBWrapper +from flax.consensus.blockchain import Blockchain +from flax.full_node.block_store import BlockStore +from flax.full_node.coin_store import CoinStore +from flax.util.db_wrapper import DBWrapper from tests.setup_nodes import bt, test_constants diff --git a/tests/core/full_node/test_coin_store.py b/tests/core/full_node/test_coin_store.py index ad92b6de0..c4305d355 100644 --- a/tests/core/full_node/test_coin_store.py +++ b/tests/core/full_node/test_coin_store.py @@ -6,20 +6,20 @@ import aiosqlite import pytest -from chia.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward -from chia.consensus.blockchain import Blockchain, ReceiveBlockResult -from chia.consensus.coinbase import create_farmer_coin, create_pool_coin -from chia.full_node.block_store import BlockStore -from chia.full_node.coin_store import CoinStore -from chia.full_node.mempool_check_conditions import get_name_puzzle_conditions -from chia.types.blockchain_format.coin import Coin -from chia.types.coin_record import CoinRecord -from chia.types.full_block import FullBlock -from chia.types.generator_types import BlockGenerator -from chia.util.generator_tools import tx_removals_and_additions -from chia.util.ints import uint64, uint32 -from chia.util.wallet_tools import WalletTool -from chia.util.db_wrapper import DBWrapper +from flax.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward +from flax.consensus.blockchain import Blockchain, ReceiveBlockResult +from flax.consensus.coinbase import create_farmer_coin, create_pool_coin +from flax.full_node.block_store import BlockStore +from flax.full_node.coin_store import CoinStore +from flax.full_node.mempool_check_conditions import get_name_puzzle_conditions +from flax.types.blockchain_format.coin import Coin +from flax.types.coin_record import CoinRecord +from flax.types.full_block import FullBlock +from flax.types.generator_types import BlockGenerator +from flax.util.generator_tools import tx_removals_and_additions +from flax.util.ints import uint64, uint32 +from flax.util.wallet_tools import WalletTool +from flax.util.db_wrapper import DBWrapper from tests.setup_nodes import bt, test_constants diff --git a/tests/core/full_node/test_conditions.py b/tests/core/full_node/test_conditions.py index 5cd784181..41696c029 100644 --- a/tests/core/full_node/test_conditions.py +++ b/tests/core/full_node/test_conditions.py @@ -14,16 +14,16 @@ from clvm_tools.binutils import assemble -from chia.consensus.blockchain import ReceiveBlockResult -from chia.consensus.constants import ConsensusConstants -from chia.types.announcement import Announcement -from chia.types.blockchain_format.program import Program -from chia.types.coin_solution import CoinSolution -from chia.types.condition_opcodes import ConditionOpcode -from chia.types.full_block import FullBlock -from chia.types.spend_bundle import SpendBundle -from chia.util.block_tools import BlockTools, test_constants -from chia.util.errors import Err +from flax.consensus.blockchain import ReceiveBlockResult +from flax.consensus.constants import ConsensusConstants +from flax.types.announcement import Announcement +from flax.types.blockchain_format.program import Program +from flax.types.coin_solution import CoinSolution +from flax.types.condition_opcodes import ConditionOpcode +from flax.types.full_block import FullBlock +from flax.types.spend_bundle import SpendBundle +from flax.util.block_tools import BlockTools, test_constants +from flax.util.errors import Err from .ram_db import create_ram_blockchain diff --git a/tests/core/full_node/test_full_node.py b/tests/core/full_node/test_full_node.py index e1629d3e1..ac2df538d 100644 --- a/tests/core/full_node/test_full_node.py +++ b/tests/core/full_node/test_full_node.py @@ -9,38 +9,38 @@ import pytest -from chia.consensus.pot_iterations import is_overflow_block -from chia.full_node.bundle_tools import detect_potential_template_generator -from chia.full_node.full_node_api import FullNodeAPI -from chia.full_node.signage_point import SignagePoint -from chia.protocols import full_node_protocol as fnp, full_node_protocol -from chia.protocols import timelord_protocol -from chia.protocols.full_node_protocol import RespondTransaction -from chia.protocols.protocol_message_types import ProtocolMessageTypes -from chia.server.address_manager import AddressManager -from chia.server.outbound_message import Message -from chia.simulator.simulator_protocol import FarmNewBlockProtocol -from chia.types.blockchain_format.classgroup import ClassgroupElement -from chia.types.blockchain_format.program import SerializedProgram -from chia.types.blockchain_format.vdf import CompressibleVDFField, VDFProof -from chia.types.condition_opcodes import ConditionOpcode -from chia.types.condition_with_args import ConditionWithArgs -from chia.types.full_block import FullBlock -from chia.types.mempool_inclusion_status import MempoolInclusionStatus -from chia.types.peer_info import PeerInfo, TimestampedPeerInfo -from chia.types.spend_bundle import SpendBundle -from chia.types.unfinished_block import UnfinishedBlock -from chia.util.block_tools import get_signage_point -from chia.util.clvm import int_to_bytes -from chia.util.errors import Err -from chia.util.hash import std_hash -from chia.util.ints import uint8, uint16, uint32, uint64 -from chia.util.recursive_replace import recursive_replace -from chia.util.vdf_prover import get_vdf_info_and_proof -from chia.util.wallet_tools import WalletTool +from flax.consensus.pot_iterations import is_overflow_block +from flax.full_node.bundle_tools import detect_potential_template_generator +from flax.full_node.full_node_api import FullNodeAPI +from flax.full_node.signage_point import SignagePoint +from flax.protocols import full_node_protocol as fnp, full_node_protocol +from flax.protocols import timelord_protocol +from flax.protocols.full_node_protocol import RespondTransaction +from flax.protocols.protocol_message_types import ProtocolMessageTypes +from flax.server.address_manager import AddressManager +from flax.server.outbound_message import Message +from flax.simulator.simulator_protocol import FarmNewBlockProtocol +from flax.types.blockchain_format.classgroup import ClassgroupElement +from flax.types.blockchain_format.program import SerializedProgram +from flax.types.blockchain_format.vdf import CompressibleVDFField, VDFProof +from flax.types.condition_opcodes import ConditionOpcode +from flax.types.condition_with_args import ConditionWithArgs +from flax.types.full_block import FullBlock +from flax.types.mempool_inclusion_status import MempoolInclusionStatus +from flax.types.peer_info import PeerInfo, TimestampedPeerInfo +from flax.types.spend_bundle import SpendBundle +from flax.types.unfinished_block import UnfinishedBlock +from flax.util.block_tools import get_signage_point +from flax.util.clvm import int_to_bytes +from flax.util.errors import Err +from flax.util.hash import std_hash +from flax.util.ints import uint8, uint16, uint32, uint64 +from flax.util.recursive_replace import recursive_replace +from flax.util.vdf_prover import get_vdf_info_and_proof +from flax.util.wallet_tools import WalletTool from tests.core.fixtures import empty_blockchain # noqa: F401 -from chia.wallet.cc_wallet.cc_wallet import CCWallet -from chia.wallet.transaction_record import TransactionRecord +from flax.wallet.cc_wallet.cc_wallet import CCWallet +from flax.wallet.transaction_record import TransactionRecord from tests.connection_utils import add_dummy_connection, connect_and_get_peer from tests.core.full_node.test_coin_store import get_future_reward_coins diff --git a/tests/core/full_node/test_full_node_store.py b/tests/core/full_node/test_full_node_store.py index 7a5e9d1dd..2a13b94dd 100644 --- a/tests/core/full_node/test_full_node_store.py +++ b/tests/core/full_node/test_full_node_store.py @@ -5,19 +5,19 @@ import pytest -from chia.consensus.blockchain import ReceiveBlockResult -from chia.consensus.multiprocess_validation import PreValidationResult -from chia.consensus.pot_iterations import is_overflow_block -from chia.full_node.full_node_store import FullNodeStore -from chia.full_node.signage_point import SignagePoint -from chia.protocols import timelord_protocol -from chia.protocols.timelord_protocol import NewInfusionPointVDF -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.unfinished_block import UnfinishedBlock -from chia.util.block_cache import BlockCache -from chia.util.block_tools import get_signage_point -from chia.util.hash import std_hash -from chia.util.ints import uint8, uint32, uint64, uint128 +from flax.consensus.blockchain import ReceiveBlockResult +from flax.consensus.multiprocess_validation import PreValidationResult +from flax.consensus.pot_iterations import is_overflow_block +from flax.full_node.full_node_store import FullNodeStore +from flax.full_node.signage_point import SignagePoint +from flax.protocols import timelord_protocol +from flax.protocols.timelord_protocol import NewInfusionPointVDF +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.unfinished_block import UnfinishedBlock +from flax.util.block_cache import BlockCache +from flax.util.block_tools import get_signage_point +from flax.util.hash import std_hash +from flax.util.ints import uint8, uint32, uint64, uint128 from tests.core.fixtures import default_1000_blocks, empty_blockchain # noqa: F401 from tests.setup_nodes import bt, test_constants diff --git a/tests/core/full_node/test_initial_freeze.py b/tests/core/full_node/test_initial_freeze.py index 6bebab3d3..3b9fc00a1 100644 --- a/tests/core/full_node/test_initial_freeze.py +++ b/tests/core/full_node/test_initial_freeze.py @@ -3,18 +3,18 @@ import pytest -from chia.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward -from chia.consensus.blockchain import ReceiveBlockResult -from chia.protocols import full_node_protocol, wallet_protocol -from chia.protocols.protocol_message_types import ProtocolMessageTypes -from chia.server.outbound_message import Message -from chia.simulator.full_node_simulator import FullNodeSimulator -from chia.simulator.simulator_protocol import FarmNewBlockProtocol -from chia.types.mempool_inclusion_status import MempoolInclusionStatus -from chia.types.peer_info import PeerInfo -from chia.util.errors import Err -from chia.util.ints import uint16, uint32 -from chia.wallet.transaction_record import TransactionRecord +from flax.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward +from flax.consensus.blockchain import ReceiveBlockResult +from flax.protocols import full_node_protocol, wallet_protocol +from flax.protocols.protocol_message_types import ProtocolMessageTypes +from flax.server.outbound_message import Message +from flax.simulator.full_node_simulator import FullNodeSimulator +from flax.simulator.simulator_protocol import FarmNewBlockProtocol +from flax.types.mempool_inclusion_status import MempoolInclusionStatus +from flax.types.peer_info import PeerInfo +from flax.util.errors import Err +from flax.util.ints import uint16, uint32 +from flax.wallet.transaction_record import TransactionRecord from tests.core.full_node.test_full_node import add_dummy_connection from tests.setup_nodes import bt, self_hostname, setup_simulators_and_wallets from tests.time_out_assert import time_out_assert diff --git a/tests/core/full_node/test_mempool.py b/tests/core/full_node/test_mempool.py index 88acce184..6b8ff7dc9 100644 --- a/tests/core/full_node/test_mempool.py +++ b/tests/core/full_node/test_mempool.py @@ -5,25 +5,25 @@ import pytest -from chia.full_node.mempool import Mempool -from chia.protocols import full_node_protocol -from chia.simulator.simulator_protocol import FarmNewBlockProtocol -from chia.types.announcement import Announcement -from chia.types.blockchain_format.coin import Coin -from chia.types.coin_solution import CoinSolution -from chia.types.condition_opcodes import ConditionOpcode -from chia.types.condition_with_args import ConditionWithArgs -from chia.types.spend_bundle import SpendBundle -from chia.util.clvm import int_to_bytes -from chia.util.condition_tools import conditions_for_solution -from chia.util.errors import Err -from chia.util.ints import uint64 +from flax.full_node.mempool import Mempool +from flax.protocols import full_node_protocol +from flax.simulator.simulator_protocol import FarmNewBlockProtocol +from flax.types.announcement import Announcement +from flax.types.blockchain_format.coin import Coin +from flax.types.coin_solution import CoinSolution +from flax.types.condition_opcodes import ConditionOpcode +from flax.types.condition_with_args import ConditionWithArgs +from flax.types.spend_bundle import SpendBundle +from flax.util.clvm import int_to_bytes +from flax.util.condition_tools import conditions_for_solution +from flax.util.errors import Err +from flax.util.ints import uint64 from tests.connection_utils import connect_and_get_peer from tests.core.node_height import node_height_at_least from tests.setup_nodes import bt, setup_simulators_and_wallets from tests.time_out_assert import time_out_assert -from chia.types.blockchain_format.program import Program, INFINITE_COST +from flax.types.blockchain_format.program import Program, INFINITE_COST BURN_PUZZLE_HASH = b"0" * 32 BURN_PUZZLE_HASH_2 = b"1" * 32 diff --git a/tests/core/full_node/test_mempool_performance.py b/tests/core/full_node/test_mempool_performance.py index e92d78bec..bf1b0007e 100644 --- a/tests/core/full_node/test_mempool_performance.py +++ b/tests/core/full_node/test_mempool_performance.py @@ -6,10 +6,10 @@ import pytest import logging -from chia.protocols import full_node_protocol -from chia.types.peer_info import PeerInfo -from chia.util.ints import uint16 -from chia.wallet.transaction_record import TransactionRecord +from flax.protocols import full_node_protocol +from flax.types.peer_info import PeerInfo +from flax.util.ints import uint16 +from flax.wallet.transaction_record import TransactionRecord from tests.connection_utils import connect_and_get_peer from tests.setup_nodes import bt, self_hostname, setup_simulators_and_wallets from tests.time_out_assert import time_out_assert diff --git a/tests/core/full_node/test_node_load.py b/tests/core/full_node/test_node_load.py index 27a680b75..965ca167c 100644 --- a/tests/core/full_node/test_node_load.py +++ b/tests/core/full_node/test_node_load.py @@ -3,9 +3,9 @@ import pytest -from chia.protocols import full_node_protocol -from chia.types.peer_info import PeerInfo -from chia.util.ints import uint16 +from flax.protocols import full_node_protocol +from flax.types.peer_info import PeerInfo +from flax.util.ints import uint16 from tests.connection_utils import connect_and_get_peer from tests.setup_nodes import bt, self_hostname, setup_two_nodes, test_constants from tests.time_out_assert import time_out_assert diff --git a/tests/core/full_node/test_performance.py b/tests/core/full_node/test_performance.py index 45484b5f4..b7f23fe9b 100644 --- a/tests/core/full_node/test_performance.py +++ b/tests/core/full_node/test_performance.py @@ -9,15 +9,15 @@ import pytest import cProfile -from chia.consensus.block_record import BlockRecord -from chia.full_node.full_node_api import FullNodeAPI -from chia.protocols import full_node_protocol as fnp -from chia.types.condition_opcodes import ConditionOpcode -from chia.types.condition_with_args import ConditionWithArgs -from chia.types.unfinished_block import UnfinishedBlock -from chia.util.clvm import int_to_bytes -from chia.util.ints import uint64 -from chia.util.wallet_tools import WalletTool +from flax.consensus.block_record import BlockRecord +from flax.full_node.full_node_api import FullNodeAPI +from flax.protocols import full_node_protocol as fnp +from flax.types.condition_opcodes import ConditionOpcode +from flax.types.condition_with_args import ConditionWithArgs +from flax.types.unfinished_block import UnfinishedBlock +from flax.util.clvm import int_to_bytes +from flax.util.ints import uint64 +from flax.util.wallet_tools import WalletTool from tests.core.fixtures import empty_blockchain # noqa: F401 from tests.connection_utils import add_dummy_connection, connect_and_get_peer diff --git a/tests/core/full_node/test_sync_store.py b/tests/core/full_node/test_sync_store.py index 6f818e21a..cbd65fb73 100644 --- a/tests/core/full_node/test_sync_store.py +++ b/tests/core/full_node/test_sync_store.py @@ -2,8 +2,8 @@ import pytest -from chia.full_node.sync_store import SyncStore -from chia.util.hash import std_hash +from flax.full_node.sync_store import SyncStore +from flax.util.hash import std_hash @pytest.fixture(scope="module") diff --git a/tests/core/full_node/test_transactions.py b/tests/core/full_node/test_transactions.py index 05d77725f..a814312ee 100644 --- a/tests/core/full_node/test_transactions.py +++ b/tests/core/full_node/test_transactions.py @@ -4,13 +4,13 @@ import pytest -from chia.consensus.block_record import BlockRecord -from chia.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward -from chia.full_node.full_node_api import FullNodeAPI -from chia.protocols import full_node_protocol -from chia.simulator.simulator_protocol import FarmNewBlockProtocol -from chia.types.peer_info import PeerInfo -from chia.util.ints import uint16, uint32 +from flax.consensus.block_record import BlockRecord +from flax.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward +from flax.full_node.full_node_api import FullNodeAPI +from flax.protocols import full_node_protocol +from flax.simulator.simulator_protocol import FarmNewBlockProtocol +from flax.types.peer_info import PeerInfo +from flax.util.ints import uint16, uint32 from tests.setup_nodes import self_hostname, setup_simulators_and_wallets from tests.time_out_assert import time_out_assert diff --git a/tests/core/make_block_generator.py b/tests/core/make_block_generator.py index 30bff7d58..d08efac30 100644 --- a/tests/core/make_block_generator.py +++ b/tests/core/make_block_generator.py @@ -2,15 +2,15 @@ import blspy -from chia.full_node.bundle_tools import simple_solution_generator -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.program import Program -from chia.types.coin_solution import CoinSolution -from chia.types.condition_opcodes import ConditionOpcode -from chia.types.generator_types import BlockGenerator -from chia.types.spend_bundle import SpendBundle -from chia.util.ints import uint64 -from chia.wallet.puzzles.p2_delegated_puzzle_or_hidden_puzzle import puzzle_for_pk, solution_for_conditions +from flax.full_node.bundle_tools import simple_solution_generator +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.program import Program +from flax.types.coin_solution import CoinSolution +from flax.types.condition_opcodes import ConditionOpcode +from flax.types.generator_types import BlockGenerator +from flax.types.spend_bundle import SpendBundle +from flax.util.ints import uint64 +from flax.wallet.puzzles.p2_delegated_puzzle_or_hidden_puzzle import puzzle_for_pk, solution_for_conditions GROUP_ORDER = 0x73EDA753299D7D483339D80809A1D80553BDA402FFFE5BFEFFFFFFFF00000001 diff --git a/tests/core/server/test_dos.py b/tests/core/server/test_dos.py index e86527c42..4b5e80cae 100644 --- a/tests/core/server/test_dos.py +++ b/tests/core/server/test_dos.py @@ -5,15 +5,15 @@ import pytest from aiohttp import ClientSession, ClientTimeout, ServerDisconnectedError, WSCloseCode, WSMessage, WSMsgType -from chia.full_node.full_node_api import FullNodeAPI -from chia.protocols import full_node_protocol -from chia.protocols.protocol_message_types import ProtocolMessageTypes -from chia.server.outbound_message import make_msg -from chia.server.rate_limits import RateLimiter -from chia.server.server import ssl_context_for_client -from chia.server.ws_connection import WSChiaConnection -from chia.types.peer_info import PeerInfo -from chia.util.ints import uint16, uint64 +from flax.full_node.full_node_api import FullNodeAPI +from flax.protocols import full_node_protocol +from flax.protocols.protocol_message_types import ProtocolMessageTypes +from flax.server.outbound_message import make_msg +from flax.server.rate_limits import RateLimiter +from flax.server.server import ssl_context_for_client +from flax.server.ws_connection import WSFlaxConnection +from flax.types.peer_info import PeerInfo +from flax.util.ints import uint16, uint64 from tests.setup_nodes import self_hostname, setup_simulators_and_wallets from tests.time_out_assert import time_out_assert @@ -60,7 +60,7 @@ async def test_large_message_disconnect_and_ban(self, setup_two_nodes): url = f"wss://{self_hostname}:{server_1._port}/ws" ssl_context = ssl_context_for_client( - server_2.chia_ca_crt_path, server_2.chia_ca_key_path, server_2.p2p_crt_path, server_2.p2p_key_path + server_2.flax_ca_crt_path, server_2.flax_ca_key_path, server_2.p2p_crt_path, server_2.p2p_key_path ) ws = await session.ws_connect( url, autoclose=True, autoping=True, heartbeat=60, ssl=ssl_context, max_msg_size=100 * 1024 * 1024 @@ -109,7 +109,7 @@ async def test_bad_handshake_and_ban(self, setup_two_nodes): url = f"wss://{self_hostname}:{server_1._port}/ws" ssl_context = ssl_context_for_client( - server_2.chia_ca_crt_path, server_2.chia_ca_key_path, server_2.p2p_crt_path, server_2.p2p_key_path + server_2.flax_ca_crt_path, server_2.flax_ca_key_path, server_2.p2p_crt_path, server_2.p2p_key_path ) ws = await session.ws_connect( url, autoclose=True, autoping=True, heartbeat=60, ssl=ssl_context, max_msg_size=100 * 1024 * 1024 @@ -153,8 +153,8 @@ async def test_spam_tx(self, setup_two_nodes): assert len(server_1.all_connections) == 1 - ws_con: WSChiaConnection = list(server_1.all_connections.values())[0] - ws_con_2: WSChiaConnection = list(server_2.all_connections.values())[0] + ws_con: WSFlaxConnection = list(server_1.all_connections.values())[0] + ws_con_2: WSFlaxConnection = list(server_2.all_connections.values())[0] ws_con.peer_host = "1.2.3.4" ws_con_2.peer_host = "1.2.3.4" @@ -206,8 +206,8 @@ async def test_spam_message_non_tx(self, setup_two_nodes): assert len(server_1.all_connections) == 1 - ws_con: WSChiaConnection = list(server_1.all_connections.values())[0] - ws_con_2: WSChiaConnection = list(server_2.all_connections.values())[0] + ws_con: WSFlaxConnection = list(server_1.all_connections.values())[0] + ws_con_2: WSFlaxConnection = list(server_2.all_connections.values())[0] ws_con.peer_host = "1.2.3.4" ws_con_2.peer_host = "1.2.3.4" @@ -255,8 +255,8 @@ async def test_spam_message_too_large(self, setup_two_nodes): assert len(server_1.all_connections) == 1 - ws_con: WSChiaConnection = list(server_1.all_connections.values())[0] - ws_con_2: WSChiaConnection = list(server_2.all_connections.values())[0] + ws_con: WSFlaxConnection = list(server_1.all_connections.values())[0] + ws_con_2: WSFlaxConnection = list(server_2.all_connections.values())[0] ws_con.peer_host = "1.2.3.4" ws_con_2.peer_host = "1.2.3.4" diff --git a/tests/core/server/test_rate_limits.py b/tests/core/server/test_rate_limits.py index a1011fbd2..fb704df2d 100644 --- a/tests/core/server/test_rate_limits.py +++ b/tests/core/server/test_rate_limits.py @@ -2,9 +2,9 @@ import pytest -from chia.protocols.protocol_message_types import ProtocolMessageTypes -from chia.server.outbound_message import make_msg -from chia.server.rate_limits import RateLimiter, NON_TX_FREQ +from flax.protocols.protocol_message_types import ProtocolMessageTypes +from flax.server.outbound_message import make_msg +from flax.server.rate_limits import RateLimiter, NON_TX_FREQ from tests.setup_nodes import test_constants diff --git a/tests/core/ssl/test_ssl.py b/tests/core/ssl/test_ssl.py index 79423650e..852959e44 100644 --- a/tests/core/ssl/test_ssl.py +++ b/tests/core/ssl/test_ssl.py @@ -3,14 +3,14 @@ import aiohttp import pytest -from chia.protocols.shared_protocol import protocol_version -from chia.server.outbound_message import NodeType -from chia.server.server import ChiaServer, ssl_context_for_client -from chia.server.ws_connection import WSChiaConnection -from chia.ssl.create_ssl import generate_ca_signed_cert -from chia.types.peer_info import PeerInfo -from chia.util.block_tools import test_constants -from chia.util.ints import uint16 +from flax.protocols.shared_protocol import protocol_version +from flax.server.outbound_message import NodeType +from flax.server.server import FlaxServer, ssl_context_for_client +from flax.server.ws_connection import WSFlaxConnection +from flax.ssl.create_ssl import generate_ca_signed_cert +from flax.types.peer_info import PeerInfo +from flax.util.block_tools import test_constants +from flax.util.ints import uint16 from tests.setup_nodes import ( bt, self_hostname, @@ -21,14 +21,14 @@ ) -async def establish_connection(server: ChiaServer, dummy_port: int, ssl_context) -> bool: +async def establish_connection(server: FlaxServer, dummy_port: int, ssl_context) -> bool: timeout = aiohttp.ClientTimeout(total=10) session = aiohttp.ClientSession(timeout=timeout) try: incoming_queue: asyncio.Queue = asyncio.Queue() url = f"wss://{self_hostname}:{server._port}/ws" ws = await session.ws_connect(url, autoclose=False, autoping=True, ssl=ssl_context) - wsc = WSChiaConnection( + wsc = WSFlaxConnection( NodeType.FULL_NODE, ws, server._port, @@ -75,7 +75,7 @@ async def timelord(self): async def test_public_connections(self, wallet_node): full_nodes, wallets = wallet_node full_node_api = full_nodes[0] - server_1: ChiaServer = full_node_api.full_node.server + server_1: FlaxServer = full_node_api.full_node.server wallet_node, server_2 = wallets[0] success = await server_2.start_client(PeerInfo(self_hostname, uint16(server_1._port)), None) @@ -105,10 +105,10 @@ async def test_farmer(self, harvester_farmer): pub_crt = farmer_server._private_key_path.parent / "non_valid.crt" pub_key = farmer_server._private_key_path.parent / "non_valid.key" generate_ca_signed_cert( - farmer_server.chia_ca_crt_path.read_bytes(), farmer_server.chia_ca_key_path.read_bytes(), pub_crt, pub_key + farmer_server.flax_ca_crt_path.read_bytes(), farmer_server.flax_ca_key_path.read_bytes(), pub_crt, pub_key ) ssl_context = ssl_context_for_client( - farmer_server.chia_ca_crt_path, farmer_server.chia_ca_crt_path, pub_crt, pub_key + farmer_server.flax_ca_crt_path, farmer_server.flax_ca_crt_path, pub_crt, pub_key ) connected = await establish_connection(farmer_server, 12312, ssl_context) assert connected is False @@ -128,13 +128,13 @@ async def test_full_node(self, wallet_node): pub_crt = full_node_server._private_key_path.parent / "p2p.crt" pub_key = full_node_server._private_key_path.parent / "p2p.key" generate_ca_signed_cert( - full_node_server.chia_ca_crt_path.read_bytes(), - full_node_server.chia_ca_key_path.read_bytes(), + full_node_server.flax_ca_crt_path.read_bytes(), + full_node_server.flax_ca_key_path.read_bytes(), pub_crt, pub_key, ) ssl_context = ssl_context_for_client( - full_node_server.chia_ca_crt_path, full_node_server.chia_ca_crt_path, pub_crt, pub_key + full_node_server.flax_ca_crt_path, full_node_server.flax_ca_crt_path, pub_crt, pub_key ) connected = await establish_connection(full_node_server, 12312, ssl_context) assert connected is True @@ -148,10 +148,10 @@ async def test_wallet(self, wallet_node): pub_crt = wallet_server._private_key_path.parent / "p2p.crt" pub_key = wallet_server._private_key_path.parent / "p2p.key" generate_ca_signed_cert( - wallet_server.chia_ca_crt_path.read_bytes(), wallet_server.chia_ca_key_path.read_bytes(), pub_crt, pub_key + wallet_server.flax_ca_crt_path.read_bytes(), wallet_server.flax_ca_key_path.read_bytes(), pub_crt, pub_key ) ssl_context = ssl_context_for_client( - wallet_server.chia_ca_crt_path, wallet_server.chia_ca_crt_path, pub_crt, pub_key + wallet_server.flax_ca_crt_path, wallet_server.flax_ca_crt_path, pub_crt, pub_key ) connected = await establish_connection(wallet_server, 12312, ssl_context) assert connected is False @@ -180,13 +180,13 @@ async def test_harvester(self, harvester_farmer): pub_crt = harvester_server._private_key_path.parent / "p2p.crt" pub_key = harvester_server._private_key_path.parent / "p2p.key" generate_ca_signed_cert( - harvester_server.chia_ca_crt_path.read_bytes(), - harvester_server.chia_ca_key_path.read_bytes(), + harvester_server.flax_ca_crt_path.read_bytes(), + harvester_server.flax_ca_key_path.read_bytes(), pub_crt, pub_key, ) ssl_context = ssl_context_for_client( - harvester_server.chia_ca_crt_path, harvester_server.chia_ca_crt_path, pub_crt, pub_key + harvester_server.flax_ca_crt_path, harvester_server.flax_ca_crt_path, pub_crt, pub_key ) connected = await establish_connection(harvester_server, 12312, ssl_context) assert connected is False @@ -211,16 +211,16 @@ async def test_introducer(self, introducer): introducer_api, introducer_server = introducer # Create not authenticated cert - pub_crt = introducer_server.chia_ca_key_path.parent / "p2p.crt" - pub_key = introducer_server.chia_ca_key_path.parent / "p2p.key" + pub_crt = introducer_server.flax_ca_key_path.parent / "p2p.crt" + pub_key = introducer_server.flax_ca_key_path.parent / "p2p.key" generate_ca_signed_cert( - introducer_server.chia_ca_crt_path.read_bytes(), - introducer_server.chia_ca_key_path.read_bytes(), + introducer_server.flax_ca_crt_path.read_bytes(), + introducer_server.flax_ca_key_path.read_bytes(), pub_crt, pub_key, ) ssl_context = ssl_context_for_client( - introducer_server.chia_ca_crt_path, introducer_server.chia_ca_crt_path, pub_crt, pub_key + introducer_server.flax_ca_crt_path, introducer_server.flax_ca_crt_path, pub_crt, pub_key ) connected = await establish_connection(introducer_server, 12312, ssl_context) assert connected is True @@ -233,13 +233,13 @@ async def test_timelord(self, timelord): pub_crt = timelord_server._private_key_path.parent / "p2p.crt" pub_key = timelord_server._private_key_path.parent / "p2p.key" generate_ca_signed_cert( - timelord_server.chia_ca_crt_path.read_bytes(), - timelord_server.chia_ca_key_path.read_bytes(), + timelord_server.flax_ca_crt_path.read_bytes(), + timelord_server.flax_ca_key_path.read_bytes(), pub_crt, pub_key, ) ssl_context = ssl_context_for_client( - timelord_server.chia_ca_crt_path, timelord_server.chia_ca_crt_path, pub_crt, pub_key + timelord_server.flax_ca_crt_path, timelord_server.flax_ca_crt_path, pub_crt, pub_key ) connected = await establish_connection(timelord_server, 12312, ssl_context) assert connected is False diff --git a/tests/core/test_cost_calculation.py b/tests/core/test_cost_calculation.py index f0b1b6ea3..c926b6f21 100644 --- a/tests/core/test_cost_calculation.py +++ b/tests/core/test_cost_calculation.py @@ -6,13 +6,13 @@ import pytest from clvm_tools import binutils -from chia.consensus.condition_costs import ConditionCost -from chia.consensus.cost_calculator import NPCResult, calculate_cost_of_program -from chia.full_node.bundle_tools import simple_solution_generator -from chia.full_node.mempool_check_conditions import get_name_puzzle_conditions, get_puzzle_and_solution_for_coin -from chia.types.blockchain_format.program import Program, SerializedProgram -from chia.types.generator_types import BlockGenerator -from chia.wallet.puzzles import p2_delegated_puzzle_or_hidden_puzzle +from flax.consensus.condition_costs import ConditionCost +from flax.consensus.cost_calculator import NPCResult, calculate_cost_of_program +from flax.full_node.bundle_tools import simple_solution_generator +from flax.full_node.mempool_check_conditions import get_name_puzzle_conditions, get_puzzle_and_solution_for_coin +from flax.types.blockchain_format.program import Program, SerializedProgram +from flax.types.generator_types import BlockGenerator +from flax.wallet.puzzles import p2_delegated_puzzle_or_hidden_puzzle from tests.setup_nodes import bt, test_constants from .make_block_generator import make_block_generator @@ -46,7 +46,7 @@ def large_block_generator(size): except FileNotFoundError: generator = make_block_generator(size) blob = bytes(generator.program) - # TODO: Re-enable large-block*.hex but cache in ~/.chia/subdir + # TODO: Re-enable large-block*.hex but cache in ~/.flax/subdir # with open(hex_path, "w") as f: # f.write(blob.hex()) return blob diff --git a/tests/core/test_farmer_harvester_rpc.py b/tests/core/test_farmer_harvester_rpc.py index 8b9f3fe31..f91310338 100644 --- a/tests/core/test_farmer_harvester_rpc.py +++ b/tests/core/test_farmer_harvester_rpc.py @@ -4,21 +4,21 @@ from blspy import AugSchemeMPL from chiapos import DiskPlotter -from chia.consensus.coinbase import create_puzzlehash_for_pk -from chia.plotting.plot_tools import stream_plot_info_ph, stream_plot_info_pk -from chia.protocols import farmer_protocol -from chia.rpc.farmer_rpc_api import FarmerRpcApi -from chia.rpc.farmer_rpc_client import FarmerRpcClient -from chia.rpc.harvester_rpc_api import HarvesterRpcApi -from chia.rpc.harvester_rpc_client import HarvesterRpcClient -from chia.rpc.rpc_server import start_rpc_server -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.bech32m import decode_puzzle_hash, encode_puzzle_hash -from chia.util.block_tools import get_plot_dir -from chia.util.config import load_config -from chia.util.hash import std_hash -from chia.util.ints import uint8, uint16, uint32, uint64 -from chia.wallet.derive_keys import master_sk_to_wallet_sk +from flax.consensus.coinbase import create_puzzlehash_for_pk +from flax.plotting.plot_tools import stream_plot_info_ph, stream_plot_info_pk +from flax.protocols import farmer_protocol +from flax.rpc.farmer_rpc_api import FarmerRpcApi +from flax.rpc.farmer_rpc_client import FarmerRpcClient +from flax.rpc.harvester_rpc_api import HarvesterRpcApi +from flax.rpc.harvester_rpc_client import HarvesterRpcClient +from flax.rpc.rpc_server import start_rpc_server +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.bech32m import decode_puzzle_hash, encode_puzzle_hash +from flax.util.block_tools import get_plot_dir +from flax.util.config import load_config +from flax.util.hash import std_hash +from flax.util.ints import uint8, uint16, uint32, uint64 +from flax.wallet.derive_keys import master_sk_to_wallet_sk from tests.setup_nodes import bt, self_hostname, setup_farmer_harvester, test_constants from tests.time_out_assert import time_out_assert @@ -191,7 +191,7 @@ async def have_plots(): master_sk_to_wallet_sk(bt.pool_master_sk, uint32(472)).get_g1() ) - await client.set_reward_targets(encode_puzzle_hash(new_ph, "xch"), encode_puzzle_hash(new_ph_2, "xch")) + await client.set_reward_targets(encode_puzzle_hash(new_ph, "xfx"), encode_puzzle_hash(new_ph_2, "xfx")) targets_3 = await client.get_reward_targets(True) assert decode_puzzle_hash(targets_3["farmer_target"]) == new_ph assert decode_puzzle_hash(targets_3["pool_target"]) == new_ph_2 @@ -200,7 +200,7 @@ async def have_plots(): new_ph_3: bytes32 = create_puzzlehash_for_pk( master_sk_to_wallet_sk(bt.pool_master_sk, uint32(1888)).get_g1() ) - await client.set_reward_targets(None, encode_puzzle_hash(new_ph_3, "xch")) + await client.set_reward_targets(None, encode_puzzle_hash(new_ph_3, "xfx")) targets_4 = await client.get_reward_targets(True) assert decode_puzzle_hash(targets_4["farmer_target"]) == new_ph assert decode_puzzle_hash(targets_4["pool_target"]) == new_ph_3 @@ -208,10 +208,10 @@ async def have_plots(): root_path = farmer_api.farmer._root_path config = load_config(root_path, "config.yaml") - assert config["farmer"]["xch_target_address"] == encode_puzzle_hash(new_ph, "xch") - assert config["pool"]["xch_target_address"] == encode_puzzle_hash(new_ph_3, "xch") + assert config["farmer"]["xfx_target_address"] == encode_puzzle_hash(new_ph, "xfx") + assert config["pool"]["xfx_target_address"] == encode_puzzle_hash(new_ph_3, "xfx") - new_ph_3_encoded = encode_puzzle_hash(new_ph_3, "xch") + new_ph_3_encoded = encode_puzzle_hash(new_ph_3, "xfx") added_char = new_ph_3_encoded + "a" with pytest.raises(ValueError): await client.set_reward_targets(None, added_char) diff --git a/tests/core/test_full_node_rpc.py b/tests/core/test_full_node_rpc.py index f46dbcd91..02ab98fc5 100644 --- a/tests/core/test_full_node_rpc.py +++ b/tests/core/test_full_node_rpc.py @@ -1,17 +1,17 @@ import pytest from blspy import AugSchemeMPL -from chia.consensus.pot_iterations import is_overflow_block -from chia.protocols import full_node_protocol -from chia.rpc.full_node_rpc_api import FullNodeRpcApi -from chia.rpc.full_node_rpc_client import FullNodeRpcClient -from chia.rpc.rpc_server import start_rpc_server -from chia.simulator.simulator_protocol import FarmNewBlockProtocol -from chia.types.spend_bundle import SpendBundle -from chia.types.unfinished_block import UnfinishedBlock -from chia.util.hash import std_hash -from chia.util.ints import uint16 -from chia.util.wallet_tools import WalletTool +from flax.consensus.pot_iterations import is_overflow_block +from flax.protocols import full_node_protocol +from flax.rpc.full_node_rpc_api import FullNodeRpcApi +from flax.rpc.full_node_rpc_client import FullNodeRpcClient +from flax.rpc.rpc_server import start_rpc_server +from flax.simulator.simulator_protocol import FarmNewBlockProtocol +from flax.types.spend_bundle import SpendBundle +from flax.types.unfinished_block import UnfinishedBlock +from flax.util.hash import std_hash +from flax.util.ints import uint16 +from flax.util.wallet_tools import WalletTool from tests.setup_nodes import bt, self_hostname, setup_simulators_and_wallets, test_constants from tests.time_out_assert import time_out_assert diff --git a/tests/core/test_merkle_set.py b/tests/core/test_merkle_set.py index 3a00e13d5..6f6d8daee 100644 --- a/tests/core/test_merkle_set.py +++ b/tests/core/test_merkle_set.py @@ -3,7 +3,7 @@ import pytest -from chia.util.merkle_set import MerkleSet, confirm_included_already_hashed +from flax.util.merkle_set import MerkleSet, confirm_included_already_hashed from tests.setup_nodes import bt diff --git a/tests/core/test_setproctitle.py b/tests/core/test_setproctitle.py index 1d1ad4ddb..2dafd7188 100644 --- a/tests/core/test_setproctitle.py +++ b/tests/core/test_setproctitle.py @@ -1,8 +1,8 @@ import unittest -from chia.util.setproctitle import setproctitle +from flax.util.setproctitle import setproctitle class TestSetProcTitle(unittest.TestCase): def test_does_not_crash(self): - setproctitle("chia test title") + setproctitle("flax test title") diff --git a/tests/core/types/test_coin.py b/tests/core/types/test_coin.py index 35dd3be08..0c23bcebd 100644 --- a/tests/core/types/test_coin.py +++ b/tests/core/types/test_coin.py @@ -1,7 +1,7 @@ -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.ints import uint64 -from chia.util.hash import std_hash +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.ints import uint64 +from flax.util.hash import std_hash import io diff --git a/tests/core/types/test_proof_of_space.py b/tests/core/types/test_proof_of_space.py index b718a76ea..71181fc49 100644 --- a/tests/core/types/test_proof_of_space.py +++ b/tests/core/types/test_proof_of_space.py @@ -1,7 +1,7 @@ from secrets import token_bytes -from chia.consensus.default_constants import DEFAULT_CONSTANTS -from chia.types.blockchain_format.proof_of_space import ProofOfSpace # pylint: disable=E0401 +from flax.consensus.default_constants import DEFAULT_CONSTANTS +from flax.types.blockchain_format.proof_of_space import ProofOfSpace # pylint: disable=E0401 class TestProofOfSpace: diff --git a/tests/core/util/test_keychain.py b/tests/core/util/test_keychain.py index 81e96175b..adfc1be41 100644 --- a/tests/core/util/test_keychain.py +++ b/tests/core/util/test_keychain.py @@ -4,7 +4,7 @@ from blspy import AugSchemeMPL, PrivateKey -from chia.util.keychain import Keychain, bytes_from_mnemonic, bytes_to_mnemonic, generate_mnemonic, mnemonic_to_seed +from flax.util.keychain import Keychain, bytes_from_mnemonic, bytes_to_mnemonic, generate_mnemonic, mnemonic_to_seed class TesKeychain(unittest.TestCase): diff --git a/tests/core/util/test_lru_cache.py b/tests/core/util/test_lru_cache.py index eec3710d5..dd61ffa16 100644 --- a/tests/core/util/test_lru_cache.py +++ b/tests/core/util/test_lru_cache.py @@ -1,6 +1,6 @@ import unittest -from chia.util.lru_cache import LRUCache +from flax.util.lru_cache import LRUCache class TestLRUCache(unittest.TestCase): diff --git a/tests/core/util/test_significant_bits.py b/tests/core/util/test_significant_bits.py index d863dd8bf..863172ee9 100644 --- a/tests/core/util/test_significant_bits.py +++ b/tests/core/util/test_significant_bits.py @@ -1,6 +1,6 @@ import unittest -from chia.util.significant_bits import count_significant_bits, truncate_to_significant_bits +from flax.util.significant_bits import count_significant_bits, truncate_to_significant_bits class TestSignificantBits(unittest.TestCase): diff --git a/tests/core/util/test_streamable.py b/tests/core/util/test_streamable.py index 5914eee42..347d02bd0 100644 --- a/tests/core/util/test_streamable.py +++ b/tests/core/util/test_streamable.py @@ -6,14 +6,14 @@ from clvm_tools import binutils from pytest import raises -from chia.protocols.wallet_protocol import RespondRemovals -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.program import Program -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.full_block import FullBlock -from chia.types.weight_proof import SubEpochChallengeSegment -from chia.util.ints import uint8, uint32 -from chia.util.streamable import ( +from flax.protocols.wallet_protocol import RespondRemovals +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.program import Program +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.full_block import FullBlock +from flax.types.weight_proof import SubEpochChallengeSegment +from flax.util.ints import uint8, uint32 +from flax.util.streamable import ( Streamable, streamable, parse_bool, diff --git a/tests/core/util/test_type_checking.py b/tests/core/util/test_type_checking.py index bfc599715..5808dfd6f 100644 --- a/tests/core/util/test_type_checking.py +++ b/tests/core/util/test_type_checking.py @@ -2,8 +2,8 @@ from dataclasses import dataclass from typing import Dict, List, Optional, Tuple -from chia.util.ints import uint8 -from chia.util.type_checking import is_type_List, is_type_SpecificOptional, strictdataclass +from flax.util.ints import uint8 +from flax.util.type_checking import is_type_List, is_type_SpecificOptional, strictdataclass class TestIsTypeList(unittest.TestCase): diff --git a/tests/chia-start-sim b/tests/flax-start-sim old mode 100755 new mode 100644 similarity index 65% rename from tests/chia-start-sim rename to tests/flax-start-sim index 656d1af9d..c9e60ce72 --- a/tests/chia-start-sim +++ b/tests/flax-start-sim @@ -1,5 +1,5 @@ _kill_servers() { - PROCS=`ps -e | grep -E 'chia|vdf_client' -v "chia-start-sim" | awk '!/grep/' | awk '{print $1}'` + PROCS=`ps -e | grep -E 'flax|vdf_client' -v "flax-start-sim" | awk '!/grep/' | awk '{print $1}'` if [ -n "$PROCS" ]; then echo "$PROCS" | xargs -L1 kill -KILL fi @@ -22,21 +22,21 @@ _term() { _kill_servers } -echo "Starting local blockchain simulation. Runs a local introducer and chia system." +echo "Starting local blockchain simulation. Runs a local introducer and flax system." echo "Note that this simulation will not work if connected to external nodes." # Starts a harvester, farmer, timelord, introducer, and 3 full nodes, locally. # Please note that the simulation is meant to be run locally and not connected to external nodes. # NOTE: you must run install.sh when changing this file - _run_bg_cmd chia_farmer --logging.log_stdout=True --logging.log_level=INFO - _run_bg_cmd chia_harvester --logging.log_stdout=True --logging.log_level=INFO - _run_bg_cmd chia_timelord --logging.log_stdout=True --logging.log_level=INFO - _run_bg_cmd chia_timelord_launcher --logging.log_stdout=True --logging.log_level=INFO -_run_bg_cmd chia_introducer --logging.log_stdout=True --logging.log_level=INFO -_run_bg_cmd chia_full_node --port=8444 --database_path="simulation_1.db" --rpc_port=8555 --introducer_peer.host="127.0.0.1" --introducer_peer.port=8445 --logging.log_stdout=True --logging.log_level=INFO --logging.log_level=INFO + _run_bg_cmd flax_farmer --logging.log_stdout=True --logging.log_level=INFO + _run_bg_cmd flax_harvester --logging.log_stdout=True --logging.log_level=INFO + _run_bg_cmd flax_timelord --logging.log_stdout=True --logging.log_level=INFO + _run_bg_cmd flax_timelord_launcher --logging.log_stdout=True --logging.log_level=INFO +_run_bg_cmd flax_introducer --logging.log_stdout=True --logging.log_level=INFO +_run_bg_cmd flax_full_node --port=8444 --database_path="simulation_1.db" --rpc_port=8555 --introducer_peer.host="127.0.0.1" --introducer_peer.port=8445 --logging.log_stdout=True --logging.log_level=INFO --logging.log_level=INFO sleep 1 -_run_bg_cmd chia_full_node --port=8002 --database_path="simulation_2.db" --rpc_port=8556 --introducer_peer.host="127.0.0.1" --introducer_peer.port=8445 --logging.log_stdout=True --logging.log_level=INFO - _run_bg_cmd python -m chia.daemon.server --logging.log_stdout=True --logging.log_level=INFO +_run_bg_cmd flax_full_node --port=8002 --database_path="simulation_2.db" --rpc_port=8556 --introducer_peer.host="127.0.0.1" --introducer_peer.port=8445 --logging.log_stdout=True --logging.log_level=INFO + _run_bg_cmd python -m flax.daemon.server --logging.log_stdout=True --logging.log_level=INFO wait diff --git a/tests/generator/test_compression.py b/tests/generator/test_compression.py index aec2e6bd3..810917eed 100644 --- a/tests/generator/test_compression.py +++ b/tests/generator/test_compression.py @@ -3,7 +3,7 @@ from typing import List, Any from unittest import TestCase -from chia.full_node.bundle_tools import ( +from flax.full_node.bundle_tools import ( bundle_suitable_for_compression, compressed_coin_solution_entry_list, compressed_spend_bundle_solution, @@ -11,13 +11,13 @@ simple_solution_generator, spend_bundle_to_serialized_coin_solution_entry_list, ) -from chia.full_node.generator import run_generator, create_generator_args -from chia.types.blockchain_format.program import Program, SerializedProgram, INFINITE_COST -from chia.types.generator_types import BlockGenerator, CompressorArg, GeneratorArg -from chia.types.spend_bundle import SpendBundle -from chia.util.byte_types import hexstr_to_bytes -from chia.util.ints import uint32 -from chia.wallet.puzzles.load_clvm import load_clvm +from flax.full_node.generator import run_generator, create_generator_args +from flax.types.blockchain_format.program import Program, SerializedProgram, INFINITE_COST +from flax.types.generator_types import BlockGenerator, CompressorArg, GeneratorArg +from flax.types.spend_bundle import SpendBundle +from flax.util.byte_types import hexstr_to_bytes +from flax.util.ints import uint32 +from flax.wallet.puzzles.load_clvm import load_clvm from tests.core.make_block_generator import make_spend_bundle @@ -27,17 +27,17 @@ from clvm_tools import binutils -TEST_GEN_DESERIALIZE = load_clvm("test_generator_deserialize.clvm", package_or_requirement="chia.wallet.puzzles") -DESERIALIZE_MOD = load_clvm("chialisp_deserialisation.clvm", package_or_requirement="chia.wallet.puzzles") +TEST_GEN_DESERIALIZE = load_clvm("test_generator_deserialize.clvm", package_or_requirement="flax.wallet.puzzles") +DESERIALIZE_MOD = load_clvm("flaxlisp_deserialisation.clvm", package_or_requirement="flax.wallet.puzzles") -DECOMPRESS_PUZZLE = load_clvm("decompress_puzzle.clvm", package_or_requirement="chia.wallet.puzzles") -DECOMPRESS_CSE = load_clvm("decompress_coin_solution_entry.clvm", package_or_requirement="chia.wallet.puzzles") +DECOMPRESS_PUZZLE = load_clvm("decompress_puzzle.clvm", package_or_requirement="flax.wallet.puzzles") +DECOMPRESS_CSE = load_clvm("decompress_coin_solution_entry.clvm", package_or_requirement="flax.wallet.puzzles") DECOMPRESS_CSE_WITH_PREFIX = load_clvm( - "decompress_coin_solution_entry_with_prefix.clvm", package_or_requirement="chia.wallet.puzzles" + "decompress_coin_solution_entry_with_prefix.clvm", package_or_requirement="flax.wallet.puzzles" ) -DECOMPRESS_BLOCK = load_clvm("block_program_zero.clvm", package_or_requirement="chia.wallet.puzzles") -TEST_MULTIPLE = load_clvm("test_multiple_generator_input_arguments.clvm", package_or_requirement="chia.wallet.puzzles") +DECOMPRESS_BLOCK = load_clvm("block_program_zero.clvm", package_or_requirement="flax.wallet.puzzles") +TEST_MULTIPLE = load_clvm("test_multiple_generator_input_arguments.clvm", package_or_requirement="flax.wallet.puzzles") Nil = Program.from_bytes(b"\x80") diff --git a/tests/generator/test_generator_types.py b/tests/generator/test_generator_types.py index 3cf219982..b834d3dcc 100644 --- a/tests/generator/test_generator_types.py +++ b/tests/generator/test_generator_types.py @@ -1,10 +1,10 @@ from typing import Dict from unittest import TestCase -from chia.types.blockchain_format.program import Program, SerializedProgram -from chia.types.generator_types import GeneratorBlockCacheInterface -from chia.full_node.generator import create_block_generator, create_generator_args -from chia.util.ints import uint32 +from flax.types.blockchain_format.program import Program, SerializedProgram +from flax.types.generator_types import GeneratorBlockCacheInterface +from flax.full_node.generator import create_block_generator, create_generator_args +from flax.util.ints import uint32 gen0 = SerializedProgram.from_bytes( bytes.fromhex( diff --git a/tests/generator/test_rom.py b/tests/generator/test_rom.py index e93350a11..05db65c7e 100644 --- a/tests/generator/test_rom.py +++ b/tests/generator/test_rom.py @@ -3,22 +3,22 @@ from clvm_tools import binutils from clvm_tools.clvmc import compile_clvm_text -from chia.full_node.generator import run_generator -from chia.full_node.mempool_check_conditions import get_name_puzzle_conditions -from chia.types.blockchain_format.program import Program, SerializedProgram -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.condition_with_args import ConditionWithArgs -from chia.types.name_puzzle_condition import NPC -from chia.types.generator_types import BlockGenerator, GeneratorArg -from chia.util.clvm import int_to_bytes -from chia.util.condition_tools import ConditionOpcode -from chia.util.ints import uint32 -from chia.wallet.puzzles.load_clvm import load_clvm +from flax.full_node.generator import run_generator +from flax.full_node.mempool_check_conditions import get_name_puzzle_conditions +from flax.types.blockchain_format.program import Program, SerializedProgram +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.condition_with_args import ConditionWithArgs +from flax.types.name_puzzle_condition import NPC +from flax.types.generator_types import BlockGenerator, GeneratorArg +from flax.util.clvm import int_to_bytes +from flax.util.condition_tools import ConditionOpcode +from flax.util.ints import uint32 +from flax.wallet.puzzles.load_clvm import load_clvm MAX_COST = int(1e15) -DESERIALIZE_MOD = load_clvm("chialisp_deserialisation.clvm", package_or_requirement="chia.wallet.puzzles") +DESERIALIZE_MOD = load_clvm("flaxlisp_deserialisation.clvm", package_or_requirement="flax.wallet.puzzles") GENERATOR_CODE = """ diff --git a/tests/generator/test_scan.py b/tests/generator/test_scan.py index 0a35d57e3..d34e49787 100644 --- a/tests/generator/test_scan.py +++ b/tests/generator/test_scan.py @@ -1,9 +1,9 @@ from unittest import TestCase -from chia.full_node.bundle_tools import ( +from flax.full_node.bundle_tools import ( match_standard_transaction_at_any_index, match_standard_transaction_exactly_and_return_pubkey, ) -from chia.util.byte_types import hexstr_to_bytes +from flax.util.byte_types import hexstr_to_bytes gen1 = hexstr_to_bytes( diff --git a/tests/runner-templates/build-test-macos b/tests/runner-templates/build-test-macos index 22414aba7..7bb78153a 100644 --- a/tests/runner-templates/build-test-macos +++ b/tests/runner-templates/build-test-macos @@ -58,9 +58,9 @@ CHECKOUT_TEST_BLOCKS_AND_PLOTS - name: Link home directory run: | cd $HOME - ln -s $GITHUB_WORKSPACE/.chia - echo "$HOME/.chia" - ls -al $HOME/.chia + ln -s $GITHUB_WORKSPACE/.flax + echo "$HOME/.flax" + ls -al $HOME/.flax - name: Run install script env: diff --git a/tests/runner-templates/build-test-ubuntu b/tests/runner-templates/build-test-ubuntu index d59eb5f30..675908e9c 100644 --- a/tests/runner-templates/build-test-ubuntu +++ b/tests/runner-templates/build-test-ubuntu @@ -65,9 +65,9 @@ CHECKOUT_TEST_BLOCKS_AND_PLOTS - name: Link home directory run: | cd $HOME - ln -s $GITHUB_WORKSPACE/.chia - echo "$HOME/.chia" - ls -al $HOME/.chia + ln -s $GITHUB_WORKSPACE/.flax + echo "$HOME/.flax" + ls -al $HOME/.flax - name: Install ubuntu dependencies run: | diff --git a/tests/runner-templates/checkout-test-plots.include.yml b/tests/runner-templates/checkout-test-plots.include.yml index f036a97a3..871398cd0 100644 --- a/tests/runner-templates/checkout-test-plots.include.yml +++ b/tests/runner-templates/checkout-test-plots.include.yml @@ -1,8 +1,8 @@ - name: Checkout test blocks and plots uses: actions/checkout@v2 with: - repository: 'Chia-Network/test-cache' - path: '.chia' + repository: 'Flax-Network/test-cache' + path: '.flax' ref: '0.26.0' fetch-depth: 1 diff --git a/tests/setup_nodes.py b/tests/setup_nodes.py index c72946cba..2f3b1f9d3 100644 --- a/tests/setup_nodes.py +++ b/tests/setup_nodes.py @@ -4,24 +4,24 @@ from secrets import token_bytes from typing import Dict, List, Optional -from chia.consensus.constants import ConsensusConstants -from chia.daemon.server import WebSocketServer, create_server_for_daemon, daemon_launch_lock_path, singleton -from chia.full_node.full_node_api import FullNodeAPI -from chia.server.start_farmer import service_kwargs_for_farmer -from chia.server.start_full_node import service_kwargs_for_full_node -from chia.server.start_harvester import service_kwargs_for_harvester -from chia.server.start_introducer import service_kwargs_for_introducer -from chia.server.start_service import Service -from chia.server.start_timelord import service_kwargs_for_timelord -from chia.server.start_wallet import service_kwargs_for_wallet -from chia.simulator.start_simulator import service_kwargs_for_full_node_simulator -from chia.timelord.timelord_launcher import kill_processes, spawn_process -from chia.types.peer_info import PeerInfo -from chia.util.bech32m import encode_puzzle_hash -from chia.util.block_tools import BlockTools, test_constants -from chia.util.hash import std_hash -from chia.util.ints import uint16, uint32 -from chia.util.keychain import Keychain, bytes_to_mnemonic +from flax.consensus.constants import ConsensusConstants +from flax.daemon.server import WebSocketServer, create_server_for_daemon, daemon_launch_lock_path, singleton +from flax.full_node.full_node_api import FullNodeAPI +from flax.server.start_farmer import service_kwargs_for_farmer +from flax.server.start_full_node import service_kwargs_for_full_node +from flax.server.start_harvester import service_kwargs_for_harvester +from flax.server.start_introducer import service_kwargs_for_introducer +from flax.server.start_service import Service +from flax.server.start_timelord import service_kwargs_for_timelord +from flax.server.start_wallet import service_kwargs_for_wallet +from flax.simulator.start_simulator import service_kwargs_for_full_node_simulator +from flax.timelord.timelord_launcher import kill_processes, spawn_process +from flax.types.peer_info import PeerInfo +from flax.util.bech32m import encode_puzzle_hash +from flax.util.block_tools import BlockTools, test_constants +from flax.util.hash import std_hash +from flax.util.ints import uint16, uint32 +from flax.util.keychain import Keychain, bytes_to_mnemonic from tests.time_out_assert import time_out_assert_custom_interval bt = BlockTools(constants=test_constants) @@ -207,10 +207,10 @@ async def setup_farmer( config = bt.config["farmer"] config_pool = bt.config["pool"] - config["xch_target_address"] = encode_puzzle_hash(b_tools.farmer_ph, "xch") + config["xfx_target_address"] = encode_puzzle_hash(b_tools.farmer_ph, "xfx") config["pool_public_keys"] = [bytes(pk).hex() for pk in b_tools.pool_pubkeys] config["port"] = port - config_pool["xch_target_address"] = encode_puzzle_hash(b_tools.pool_ph, "xch") + config_pool["xfx_target_address"] = encode_puzzle_hash(b_tools.pool_ph, "xfx") if full_node_port: config["full_node_peer"]["host"] = self_hostname diff --git a/tests/simulation/test_simulation.py b/tests/simulation/test_simulation.py index 01335bf30..50fcc03ae 100644 --- a/tests/simulation/test_simulation.py +++ b/tests/simulation/test_simulation.py @@ -1,8 +1,8 @@ import pytest -from chia.types.peer_info import PeerInfo -from chia.util.block_tools import BlockTools -from chia.util.ints import uint16 +from flax.types.peer_info import PeerInfo +from flax.util.block_tools import BlockTools +from flax.util.ints import uint16 from tests.core.node_height import node_height_at_least from tests.setup_nodes import self_hostname, setup_full_node, setup_full_system, test_constants from tests.time_out_assert import time_out_assert diff --git a/tests/time_out_assert.py b/tests/time_out_assert.py index f379b5290..815c23363 100644 --- a/tests/time_out_assert.py +++ b/tests/time_out_assert.py @@ -3,7 +3,7 @@ import time from typing import Callable -from chia.protocols.protocol_message_types import ProtocolMessageTypes +from flax.protocols.protocol_message_types import ProtocolMessageTypes log = logging.getLogger(__name__) diff --git a/tests/util/alert_server.py b/tests/util/alert_server.py index fbf25bf50..a552bde31 100644 --- a/tests/util/alert_server.py +++ b/tests/util/alert_server.py @@ -73,7 +73,7 @@ def main(): if port is None or file_path is None: print( "Missing arguments, example usage:\n\n" - "python chia/util/alert_server.py -p 4000 -file_path /home/user/alert.txt\n" + "python flax/util/alert_server.py -p 4000 -file_path /home/user/alert.txt\n" ) quit() diff --git a/tests/util/benchmark_cost.py b/tests/util/benchmark_cost.py index 412d6ddfe..d2723cc5b 100644 --- a/tests/util/benchmark_cost.py +++ b/tests/util/benchmark_cost.py @@ -4,14 +4,14 @@ from blspy import AugSchemeMPL, PrivateKey from clvm_tools import binutils -from chia.consensus.default_constants import DEFAULT_CONSTANTS -from chia.types.blockchain_format.program import Program, INFINITE_COST -from chia.types.condition_opcodes import ConditionOpcode -from chia.types.condition_with_args import ConditionWithArgs -from chia.util.ints import uint32 -from chia.util.wallet_tools import WalletTool -from chia.wallet.derive_keys import master_sk_to_wallet_sk -from chia.wallet.puzzles.p2_delegated_puzzle import puzzle_for_pk +from flax.consensus.default_constants import DEFAULT_CONSTANTS +from flax.types.blockchain_format.program import Program, INFINITE_COST +from flax.types.condition_opcodes import ConditionOpcode +from flax.types.condition_with_args import ConditionWithArgs +from flax.util.ints import uint32 +from flax.util.wallet_tools import WalletTool +from flax.wallet.derive_keys import master_sk_to_wallet_sk +from flax.wallet.puzzles.p2_delegated_puzzle import puzzle_for_pk def float_to_str(f): @@ -29,7 +29,7 @@ def float_to_str(f): return float_string -def run_and_return_cost_time(chialisp): +def run_and_return_cost_time(flaxlisp): start = time.time() clvm_loop = "((c (q ((c (f (a)) (c (f (a)) (c (f (r (a))) (c (f (r (r (a))))" @@ -37,7 +37,7 @@ def run_and_return_cost_time(chialisp): " (c (- (f (r (a))) (q 1)) (c (f (r (r (a)))) (q ()))))))" " ((c (f (r (r (a)))) (q ()))))) (q (q ()))) (a)))) (a))))" loop_program = Program.to(binutils.assemble(clvm_loop)) - clvm_loop_solution = f"(1000 {chialisp})" + clvm_loop_solution = f"(1000 {flaxlisp})" solution_program = Program.to(binutils.assemble(clvm_loop_solution)) cost, sexp = loop_program.run_with_cost(solution_program, INFINITE_COST) diff --git a/tests/util/generator_tools_testing.py b/tests/util/generator_tools_testing.py index 1e39e5176..ce792a58b 100644 --- a/tests/util/generator_tools_testing.py +++ b/tests/util/generator_tools_testing.py @@ -1,11 +1,11 @@ from typing import List, Tuple -from chia.full_node.mempool_check_conditions import get_name_puzzle_conditions -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.full_block import FullBlock -from chia.types.generator_types import BlockGenerator -from chia.util.generator_tools import additions_for_npc +from flax.full_node.mempool_check_conditions import get_name_puzzle_conditions +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.full_block import FullBlock +from flax.types.generator_types import BlockGenerator +from flax.util.generator_tools import additions_for_npc def run_and_get_removals_and_additions( diff --git a/tests/util/key_tool.py b/tests/util/key_tool.py index 4914f1659..ed2923178 100644 --- a/tests/util/key_tool.py +++ b/tests/util/key_tool.py @@ -2,11 +2,11 @@ from blspy import AugSchemeMPL, G2Element, PrivateKey -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.coin_solution import CoinSolution -from chia.util.condition_tools import conditions_by_opcode, conditions_for_solution, pkm_pairs_for_conditions_dict +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.coin_solution import CoinSolution +from flax.util.condition_tools import conditions_by_opcode, conditions_for_solution, pkm_pairs_for_conditions_dict from tests.core.make_block_generator import GROUP_ORDER, int_to_public_key -from chia.util.block_tools import test_constants +from flax.util.block_tools import test_constants class KeyTool(dict): diff --git a/tests/util/misc.py b/tests/util/misc.py index 468c740e2..03901ebc7 100644 --- a/tests/util/misc.py +++ b/tests/util/misc.py @@ -1,5 +1,5 @@ import pytest -from chia.util.misc import format_minutes +from flax.util.misc import format_minutes class TestMisc: diff --git a/tests/wallet/cc_wallet/test_cc_wallet.py b/tests/wallet/cc_wallet/test_cc_wallet.py index dcab54c11..2d6973b10 100644 --- a/tests/wallet/cc_wallet/test_cc_wallet.py +++ b/tests/wallet/cc_wallet/test_cc_wallet.py @@ -3,18 +3,18 @@ import pytest -from chia.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward -from chia.full_node.mempool_manager import MempoolManager -from chia.simulator.simulator_protocol import FarmNewBlockProtocol -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.peer_info import PeerInfo -from chia.util.ints import uint16, uint32, uint64 -from chia.wallet.cc_wallet.cc_utils import cc_puzzle_hash_for_inner_puzzle_hash -from chia.wallet.cc_wallet.cc_wallet import CCWallet -from chia.wallet.puzzles.cc_loader import CC_MOD -from chia.wallet.transaction_record import TransactionRecord -from chia.wallet.wallet_coin_record import WalletCoinRecord +from flax.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward +from flax.full_node.mempool_manager import MempoolManager +from flax.simulator.simulator_protocol import FarmNewBlockProtocol +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.peer_info import PeerInfo +from flax.util.ints import uint16, uint32, uint64 +from flax.wallet.cc_wallet.cc_utils import cc_puzzle_hash_for_inner_puzzle_hash +from flax.wallet.cc_wallet.cc_wallet import CCWallet +from flax.wallet.puzzles.cc_loader import CC_MOD +from flax.wallet.transaction_record import TransactionRecord +from flax.wallet.wallet_coin_record import WalletCoinRecord from tests.setup_nodes import setup_simulators_and_wallets from tests.time_out_assert import time_out_assert diff --git a/tests/wallet/cc_wallet/test_trades.py b/tests/wallet/cc_wallet/test_trades.py index f8bb1d1f6..4ab1914d9 100644 --- a/tests/wallet/cc_wallet/test_trades.py +++ b/tests/wallet/cc_wallet/test_trades.py @@ -5,12 +5,12 @@ import pytest -from chia.simulator.simulator_protocol import FarmNewBlockProtocol -from chia.types.peer_info import PeerInfo -from chia.util.ints import uint16, uint64 -from chia.wallet.cc_wallet.cc_wallet import CCWallet -from chia.wallet.trade_manager import TradeManager -from chia.wallet.trading.trade_status import TradeStatus +from flax.simulator.simulator_protocol import FarmNewBlockProtocol +from flax.types.peer_info import PeerInfo +from flax.util.ints import uint16, uint64 +from flax.wallet.cc_wallet.cc_wallet import CCWallet +from flax.wallet.trade_manager import TradeManager +from flax.wallet.trading.trade_status import TradeStatus from tests.setup_nodes import setup_simulators_and_wallets @@ -131,7 +131,7 @@ async def test_cc_trade(self, wallets_prefarm): assert success is True assert offer is not None - assert offer["chia"] == -10 + assert offer["flax"] == -10 assert offer[colour] == 30 success, trade, reason = await trade_manager_1.respond_to_offer(file_path) @@ -197,7 +197,7 @@ async def test_cc_trade_accept_with_zero(self, wallets_prefarm): assert cc_wallet.get_colour() == cc_wallet_2.get_colour() - assert offer["chia"] == -10 + assert offer["flax"] == -10 assert offer[colour] == 30 success, trade, reason = await trade_manager_1.respond_to_offer(file_path) @@ -272,7 +272,7 @@ async def test_cc_trade_with_multiple_colours(self, wallets_prefarm): assert error is None assert success is True assert offer is not None - assert offer["chia"] == -1000 + assert offer["flax"] == -1000 colour_2 = cc_a_2.get_colour() colour_3 = cc_a_3.get_colour() @@ -375,20 +375,20 @@ async def test_cc_trade_cancel_insecure(self, wallets_prefarm): if file_path.exists(): file_path.unlink() - spendable_chia = await wallet_a.get_spendable_balance() + spendable_flax = await wallet_a.get_spendable_balance() offer_dict = {1: 10, 2: -30, 3: 30} success, trade_offer, error = await trade_manager_a.create_offer_for_ids(offer_dict, file) - spendable_chia_after = await wallet_a.get_spendable_balance() + spendable_flax_after = await wallet_a.get_spendable_balance() locked_coin = await trade_manager_a.get_locked_coins(wallet_a.id()) locked_sum = 0 for name, record in locked_coin.items(): locked_sum += record.coin.amount - assert spendable_chia == spendable_chia_after + locked_sum + assert spendable_flax == spendable_flax_after + locked_sum assert success is True assert trade_offer is not None @@ -397,7 +397,7 @@ async def test_cc_trade_cancel_insecure(self, wallets_prefarm): spendable_after_cancel_1 = await wallet_a.get_spendable_balance() # Spendable should be the same as it was before making offer 1 - assert spendable_chia == spendable_after_cancel_1 + assert spendable_flax == spendable_after_cancel_1 trade_a = await trade_manager_a.get_trade_by_id(trade_offer.trade_id) assert trade_a is not None @@ -421,20 +421,20 @@ async def test_cc_trade_cancel_secure(self, wallets_prefarm): if file_path.exists(): file_path.unlink() - spendable_chia = await wallet_a.get_spendable_balance() + spendable_flax = await wallet_a.get_spendable_balance() offer_dict = {1: 10, 2: -30, 3: 30} success, trade_offer, error = await trade_manager_a.create_offer_for_ids(offer_dict, file) - spendable_chia_after = await wallet_a.get_spendable_balance() + spendable_flax_after = await wallet_a.get_spendable_balance() locked_coin = await trade_manager_a.get_locked_coins(wallet_a.id()) locked_sum = 0 for name, record in locked_coin.items(): locked_sum += record.coin.amount - assert spendable_chia == spendable_chia_after + locked_sum + assert spendable_flax == spendable_flax_after + locked_sum assert success is True assert trade_offer is not None @@ -444,7 +444,7 @@ async def test_cc_trade_cancel_secure(self, wallets_prefarm): for i in range(0, buffer_blocks): await full_node.farm_new_transaction_block(FarmNewBlockProtocol(token_bytes())) - await time_out_assert(15, wallet_a.get_spendable_balance, spendable_chia) + await time_out_assert(15, wallet_a.get_spendable_balance, spendable_flax) # Spendable should be the same as it was before making offer 1 diff --git a/tests/wallet/did_wallet/test_did.py b/tests/wallet/did_wallet/test_did.py index eeb4d001b..5b687e8ce 100644 --- a/tests/wallet/did_wallet/test_did.py +++ b/tests/wallet/did_wallet/test_did.py @@ -1,25 +1,25 @@ import asyncio import time import pytest -from chia.simulator.simulator_protocol import FarmNewBlockProtocol -from chia.types.peer_info import PeerInfo -from chia.util.ints import uint16, uint32, uint64 +from flax.simulator.simulator_protocol import FarmNewBlockProtocol +from flax.types.peer_info import PeerInfo +from flax.util.ints import uint16, uint32, uint64 from tests.setup_nodes import setup_simulators_and_wallets -from chia.wallet.did_wallet.did_wallet import DIDWallet -from chia.wallet.did_wallet import did_wallet_puzzles +from flax.wallet.did_wallet.did_wallet import DIDWallet +from flax.wallet.did_wallet import did_wallet_puzzles from clvm_tools import binutils -from chia.types.blockchain_format.program import Program -from chia.wallet.derivation_record import DerivationRecord -from chia.types.coin_solution import CoinSolution +from flax.types.blockchain_format.program import Program +from flax.wallet.derivation_record import DerivationRecord +from flax.types.coin_solution import CoinSolution from blspy import AugSchemeMPL -from chia.types.spend_bundle import SpendBundle -from chia.wallet.transaction_record import TransactionRecord -from chia.wallet.derive_keys import master_sk_to_wallet_sk -from chia.consensus.block_rewards import calculate_pool_reward, calculate_base_farmer_reward +from flax.types.spend_bundle import SpendBundle +from flax.wallet.transaction_record import TransactionRecord +from flax.wallet.derive_keys import master_sk_to_wallet_sk +from flax.consensus.block_rewards import calculate_pool_reward, calculate_base_farmer_reward from tests.time_out_assert import time_out_assert from secrets import token_bytes -from chia.wallet.util.transaction_type import TransactionType -from chia.consensus.default_constants import DEFAULT_CONSTANTS +from flax.wallet.util.transaction_type import TransactionType +from flax.consensus.default_constants import DEFAULT_CONSTANTS @pytest.fixture(scope="module") diff --git a/tests/wallet/rl_wallet/test_rl_rpc.py b/tests/wallet/rl_wallet/test_rl_rpc.py index d1491b415..6e0b070f1 100644 --- a/tests/wallet/rl_wallet/test_rl_rpc.py +++ b/tests/wallet/rl_wallet/test_rl_rpc.py @@ -2,15 +2,15 @@ import pytest -from chia.rpc.wallet_rpc_api import WalletRpcApi -from chia.simulator.simulator_protocol import FarmNewBlockProtocol -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.mempool_inclusion_status import MempoolInclusionStatus -from chia.types.peer_info import PeerInfo -from chia.util.bech32m import encode_puzzle_hash -from chia.util.ints import uint16 -from chia.wallet.util.wallet_types import WalletType +from flax.rpc.wallet_rpc_api import WalletRpcApi +from flax.simulator.simulator_protocol import FarmNewBlockProtocol +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.mempool_inclusion_status import MempoolInclusionStatus +from flax.types.peer_info import PeerInfo +from flax.util.bech32m import encode_puzzle_hash +from flax.util.ints import uint16 +from flax.wallet.util.wallet_types import WalletType from tests.setup_nodes import self_hostname, setup_simulators_and_wallets from tests.time_out_assert import time_out_assert @@ -112,7 +112,7 @@ async def check_balance(api, wallet_id): await time_out_assert(15, check_balance, 100, api_user, user_wallet_id) receiving_wallet = wallet_node_2.wallet_state_manager.main_wallet - address = encode_puzzle_hash(await receiving_wallet.get_new_puzzlehash(), "xch") + address = encode_puzzle_hash(await receiving_wallet.get_new_puzzlehash(), "xfx") assert await receiving_wallet.get_spendable_balance() == 0 val = await api_user.send_transaction({"wallet_id": user_wallet_id, "amount": 3, "fee": 2, "address": address}) assert "transaction_id" in val @@ -143,7 +143,7 @@ async def is_transaction_in_mempool(api, tx_id: bytes32) -> bool: await time_out_assert(15, check_balance, 195, api_user, user_wallet_id) # test spending - puzzle_hash = encode_puzzle_hash(await receiving_wallet.get_new_puzzlehash(), "xch") + puzzle_hash = encode_puzzle_hash(await receiving_wallet.get_new_puzzlehash(), "xfx") val = await api_user.send_transaction( { "wallet_id": user_wallet_id, diff --git a/tests/wallet/rl_wallet/test_rl_wallet.py b/tests/wallet/rl_wallet/test_rl_wallet.py index 7bcd0409e..61dd06627 100644 --- a/tests/wallet/rl_wallet/test_rl_wallet.py +++ b/tests/wallet/rl_wallet/test_rl_wallet.py @@ -2,10 +2,10 @@ import pytest -from chia.simulator.simulator_protocol import FarmNewBlockProtocol -from chia.types.peer_info import PeerInfo -from chia.util.ints import uint16, uint64 -from chia.wallet.rl_wallet.rl_wallet import RLWallet +from flax.simulator.simulator_protocol import FarmNewBlockProtocol +from flax.types.peer_info import PeerInfo +from flax.util.ints import uint16, uint64 +from flax.wallet.rl_wallet.rl_wallet import RLWallet from tests.setup_nodes import self_hostname, setup_simulators_and_wallets from tests.time_out_assert import time_out_assert diff --git a/tests/wallet/rpc/test_wallet_rpc.py b/tests/wallet/rpc/test_wallet_rpc.py index 7cbf2070f..c4097eb7b 100644 --- a/tests/wallet/rpc/test_wallet_rpc.py +++ b/tests/wallet/rpc/test_wallet_rpc.py @@ -4,18 +4,18 @@ import pytest -from chia.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward -from chia.rpc.full_node_rpc_api import FullNodeRpcApi -from chia.rpc.full_node_rpc_client import FullNodeRpcClient -from chia.rpc.rpc_server import start_rpc_server -from chia.rpc.wallet_rpc_api import WalletRpcApi -from chia.rpc.wallet_rpc_client import WalletRpcClient -from chia.simulator.simulator_protocol import FarmNewBlockProtocol -from chia.types.blockchain_format.coin import Coin -from chia.types.peer_info import PeerInfo -from chia.types.spend_bundle import SpendBundle -from chia.util.bech32m import encode_puzzle_hash -from chia.util.ints import uint16, uint32 +from flax.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward +from flax.rpc.full_node_rpc_api import FullNodeRpcApi +from flax.rpc.full_node_rpc_client import FullNodeRpcClient +from flax.rpc.rpc_server import start_rpc_server +from flax.rpc.wallet_rpc_api import WalletRpcApi +from flax.rpc.wallet_rpc_client import WalletRpcClient +from flax.simulator.simulator_protocol import FarmNewBlockProtocol +from flax.types.blockchain_format.coin import Coin +from flax.types.peer_info import PeerInfo +from flax.types.spend_bundle import SpendBundle +from flax.util.bech32m import encode_puzzle_hash +from flax.util.ints import uint16, uint32 from tests.setup_nodes import bt, setup_simulators_and_wallets, self_hostname from tests.time_out_assert import time_out_assert @@ -96,7 +96,7 @@ def stop_node_cb(): client = await WalletRpcClient.create(self_hostname, test_rpc_port, bt.root_path, config) client_node = await FullNodeRpcClient.create(self_hostname, test_rpc_port_node, bt.root_path, config) try: - addr = encode_puzzle_hash(await wallet_node_2.wallet_state_manager.main_wallet.get_new_puzzlehash(), "xch") + addr = encode_puzzle_hash(await wallet_node_2.wallet_state_manager.main_wallet.get_new_puzzlehash(), "xfx") tx_amount = 15600000 try: await client.send_transaction("1", 100000000000000001, addr) @@ -147,7 +147,7 @@ async def eventual_balance(): ] == initial_funds_eventually - tx_amount for i in range(0, 5): - await client.farm_block(encode_puzzle_hash(ph_2, "xch")) + await client.farm_block(encode_puzzle_hash(ph_2, "xfx")) await asyncio.sleep(0.5) await time_out_assert(5, eventual_balance, initial_funds_eventually - tx_amount - signed_tx_amount) @@ -179,7 +179,7 @@ async def eventual_balance(): push_res = await client_node.push_tx(SpendBundle.from_json_dict(tx_res["signed_tx"]["spend_bundle"])) assert push_res["success"] for i in range(0, 5): - await client.farm_block(encode_puzzle_hash(ph_2, "xch")) + await client.farm_block(encode_puzzle_hash(ph_2, "xfx")) await asyncio.sleep(0.5) await time_out_assert( diff --git a/tests/wallet/sync/test_wallet_sync.py b/tests/wallet/sync/test_wallet_sync.py index bc3740e56..5b51c57c2 100644 --- a/tests/wallet/sync/test_wallet_sync.py +++ b/tests/wallet/sync/test_wallet_sync.py @@ -3,12 +3,12 @@ import pytest -from chia.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward -from chia.protocols import full_node_protocol -from chia.simulator.simulator_protocol import FarmNewBlockProtocol -from chia.types.peer_info import PeerInfo -from chia.util.ints import uint16, uint32 -from chia.wallet.wallet_state_manager import WalletStateManager +from flax.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward +from flax.protocols import full_node_protocol +from flax.simulator.simulator_protocol import FarmNewBlockProtocol +from flax.types.peer_info import PeerInfo +from flax.util.ints import uint16, uint32 +from flax.wallet.wallet_state_manager import WalletStateManager from tests.connection_utils import disconnect_all_and_reconnect from tests.core.fixtures import default_400_blocks, default_1000_blocks from tests.setup_nodes import bt, self_hostname, setup_node_and_wallet, setup_simulators_and_wallets, test_constants diff --git a/tests/wallet/test_backup.py b/tests/wallet/test_backup.py index 0449df11b..b0ae94cf6 100644 --- a/tests/wallet/test_backup.py +++ b/tests/wallet/test_backup.py @@ -4,12 +4,12 @@ # # import pytest # -# from chia.consensus.block_rewards import calculate_pool_reward, calculate_base_farmer_reward -# from chia.simulator.simulator_protocol import FarmNewBlockProtocol -# from chia.types.peer_info import PeerInfo -# from chia.util.ints import uint16, uint32, uint64 +# from flax.consensus.block_rewards import calculate_pool_reward, calculate_base_farmer_reward +# from flax.simulator.simulator_protocol import FarmNewBlockProtocol +# from flax.types.peer_info import PeerInfo +# from flax.util.ints import uint16, uint32, uint64 # from tests.setup_nodes import setup_simulators_and_wallets -# from chia.wallet.cc_wallet.cc_wallet import CCWallet +# from flax.wallet.cc_wallet.cc_wallet import CCWallet # from tests.time_out_assert import time_out_assert # # diff --git a/tests/wallet/test_bech32m.py b/tests/wallet/test_bech32m.py index 7b1ef6ae8..8a3e94d1b 100644 --- a/tests/wallet/test_bech32m.py +++ b/tests/wallet/test_bech32m.py @@ -1,7 +1,7 @@ # Based on this specification from Pieter Wuille: # https://github.com/sipa/bips/blob/bip-bech32m/bip-bech32m.mediawiki -from chia.util.bech32m import bech32_decode +from flax.util.bech32m import bech32_decode def test_valid_imports(): diff --git a/tests/wallet/test_chialisp.py b/tests/wallet/test_flaxlisp.py similarity index 97% rename from tests/wallet/test_chialisp.py rename to tests/wallet/test_flaxlisp.py index f3822cf46..6651f6e2f 100644 --- a/tests/wallet/test_chialisp.py +++ b/tests/wallet/test_flaxlisp.py @@ -1,6 +1,6 @@ import pytest -from chia.wallet.chialisp import ( +from flax.wallet.flaxlisp import ( apply, args, cons, @@ -17,7 +17,7 @@ ) -class TestChialisp: +class TestFlaxlisp: def test_sexp(self): assert sexp() == "()" assert sexp(1) == "(1)" diff --git a/tests/wallet/test_puzzle_store.py b/tests/wallet/test_puzzle_store.py index 976c4f147..2c88660a4 100644 --- a/tests/wallet/test_puzzle_store.py +++ b/tests/wallet/test_puzzle_store.py @@ -6,11 +6,11 @@ import pytest from blspy import AugSchemeMPL -from chia.util.db_wrapper import DBWrapper -from chia.util.ints import uint32 -from chia.wallet.derivation_record import DerivationRecord -from chia.wallet.util.wallet_types import WalletType -from chia.wallet.wallet_puzzle_store import WalletPuzzleStore +from flax.util.db_wrapper import DBWrapper +from flax.util.ints import uint32 +from flax.wallet.derivation_record import DerivationRecord +from flax.wallet.util.wallet_types import WalletType +from flax.wallet.wallet_puzzle_store import WalletPuzzleStore @pytest.fixture(scope="module") diff --git a/tests/wallet/test_singleton.py b/tests/wallet/test_singleton.py index e9dacbcd6..d0201f13b 100644 --- a/tests/wallet/test_singleton.py +++ b/tests/wallet/test_singleton.py @@ -1,5 +1,5 @@ -from chia.wallet.puzzles.load_clvm import load_clvm -from chia.types.blockchain_format.program import Program, INFINITE_COST +from flax.wallet.puzzles.load_clvm import load_clvm +from flax.types.blockchain_format.program import Program, INFINITE_COST DID_CORE_MOD = load_clvm("singleton_top_layer.clvm") diff --git a/tests/wallet/test_taproot.py b/tests/wallet/test_taproot.py index 318db153e..80099779e 100644 --- a/tests/wallet/test_taproot.py +++ b/tests/wallet/test_taproot.py @@ -1,4 +1,4 @@ -from chia.wallet.puzzles.p2_delegated_puzzle_or_hidden_puzzle import ( +from flax.wallet.puzzles.p2_delegated_puzzle_or_hidden_puzzle import ( DEFAULT_HIDDEN_PUZZLE, calculate_synthetic_offset, calculate_synthetic_public_key, diff --git a/tests/wallet/test_wallet.py b/tests/wallet/test_wallet.py index ae96b11f8..f7bb469ce 100644 --- a/tests/wallet/test_wallet.py +++ b/tests/wallet/test_wallet.py @@ -1,16 +1,16 @@ import asyncio import pytest import time -from chia.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward -from chia.protocols.full_node_protocol import RespondBlock -from chia.server.server import ChiaServer -from chia.simulator.simulator_protocol import FarmNewBlockProtocol, ReorgProtocol -from chia.types.peer_info import PeerInfo -from chia.util.ints import uint16, uint32, uint64 -from chia.wallet.util.transaction_type import TransactionType -from chia.wallet.transaction_record import TransactionRecord -from chia.wallet.wallet_node import WalletNode -from chia.wallet.wallet_state_manager import WalletStateManager +from flax.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward +from flax.protocols.full_node_protocol import RespondBlock +from flax.server.server import FlaxServer +from flax.simulator.simulator_protocol import FarmNewBlockProtocol, ReorgProtocol +from flax.types.peer_info import PeerInfo +from flax.util.ints import uint16, uint32, uint64 +from flax.wallet.util.transaction_type import TransactionType +from flax.wallet.transaction_record import TransactionRecord +from flax.wallet.wallet_node import WalletNode +from flax.wallet.wallet_state_manager import WalletStateManager from tests.setup_nodes import self_hostname, setup_simulators_and_wallets from tests.time_out_assert import time_out_assert, time_out_assert_not_none from tests.wallet.cc_wallet.test_cc_wallet import tx_in_pool @@ -48,7 +48,7 @@ async def test_wallet_coinbase(self, wallet_node): num_blocks = 10 full_nodes, wallets = wallet_node full_node_api = full_nodes[0] - server_1: ChiaServer = full_node_api.full_node.server + server_1: FlaxServer = full_node_api.full_node.server wallet_node, server_2 = wallets[0] wallet = wallet_node.wallet_state_manager.main_wallet @@ -318,7 +318,7 @@ async def test_wallet_make_transaction_hop(self, two_wallet_nodes_five_freeze): # introducer, introducer_server = await node_iters[2].__anext__() # # async def has_full_node(): - # outbound: List[WSChiaConnection] = wallet.server.get_outgoing_connections() + # outbound: List[WSFlaxConnection] = wallet.server.get_outgoing_connections() # for connection in outbound: # if connection.connection_type is NodeType.FULL_NODE: # return True diff --git a/tests/wallet/test_wallet_store.py b/tests/wallet/test_wallet_store.py index dddb3c3ff..d0899c328 100644 --- a/tests/wallet/test_wallet_store.py +++ b/tests/wallet/test_wallet_store.py @@ -4,10 +4,10 @@ # from secrets import token_bytes # import aiosqlite # import pytest -# from chia.util.ints import uint32, uint64, uint128 -# from chia.wallet.wallet_coin_record import WalletCoinRecord -# from chia.wallet.util.wallet_types import WalletType -# from chia.types.coin import Coin +# from flax.util.ints import uint32, uint64, uint128 +# from flax.wallet.wallet_coin_record import WalletCoinRecord +# from flax.wallet.util.wallet_types import WalletType +# from flax.types.coin import Coin # # # @pytest.fixture(scope="module") diff --git a/tests/weight_proof/test_weight_proof.py b/tests/weight_proof/test_weight_proof.py index 77ce3ac66..7fd518fde 100644 --- a/tests/weight_proof/test_weight_proof.py +++ b/tests/weight_proof/test_weight_proof.py @@ -6,22 +6,22 @@ import aiosqlite import pytest -from chia.consensus.block_header_validation import validate_finished_header_block -from chia.consensus.block_record import BlockRecord -from chia.consensus.blockchain import Blockchain -from chia.consensus.default_constants import DEFAULT_CONSTANTS -from chia.consensus.difficulty_adjustment import get_next_sub_slot_iters_and_difficulty -from chia.consensus.full_block_to_block_record import block_to_block_record -from chia.full_node.block_store import BlockStore -from chia.full_node.coin_store import CoinStore -from chia.server.start_full_node import SERVICE_NAME -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.blockchain_format.sub_epoch_summary import SubEpochSummary -from chia.util.block_cache import BlockCache -from chia.util.block_tools import test_constants -from chia.util.config import load_config -from chia.util.default_root import DEFAULT_ROOT_PATH -from chia.util.generator_tools import get_block_header +from flax.consensus.block_header_validation import validate_finished_header_block +from flax.consensus.block_record import BlockRecord +from flax.consensus.blockchain import Blockchain +from flax.consensus.default_constants import DEFAULT_CONSTANTS +from flax.consensus.difficulty_adjustment import get_next_sub_slot_iters_and_difficulty +from flax.consensus.full_block_to_block_record import block_to_block_record +from flax.full_node.block_store import BlockStore +from flax.full_node.coin_store import CoinStore +from flax.server.start_full_node import SERVICE_NAME +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.blockchain_format.sub_epoch_summary import SubEpochSummary +from flax.util.block_cache import BlockCache +from flax.util.block_tools import test_constants +from flax.util.config import load_config +from flax.util.default_root import DEFAULT_ROOT_PATH +from flax.util.generator_tools import get_block_header from tests.setup_nodes import bt try: @@ -30,16 +30,16 @@ pass -from chia.consensus.pot_iterations import calculate_iterations_quality -from chia.full_node.weight_proof import ( # type: ignore +from flax.consensus.pot_iterations import calculate_iterations_quality +from flax.full_node.weight_proof import ( # type: ignore WeightProofHandler, _map_sub_epoch_summaries, _validate_sub_epoch_segments, _validate_summaries_weight, ) -from chia.types.full_block import FullBlock -from chia.types.header_block import HeaderBlock -from chia.util.ints import uint32, uint64 +from flax.types.full_block import FullBlock +from flax.types.header_block import HeaderBlock +from flax.util.ints import uint32, uint64 from tests.core.fixtures import ( default_400_blocks, default_1000_blocks,