From 03f22c54738e94e9cfd0309a02a3e5d314528990 Mon Sep 17 00:00:00 2001 From: Flaxseed Date: Wed, 29 Jun 2022 20:32:54 -0700 Subject: [PATCH] Version 0.1.9 --- .coveragerc | 2 +- .github/ISSUE_TEMPLATE/bug_report.md | 34 + .github/ISSUE_TEMPLATE/bug_report.yaml | 52 - .github/ISSUE_TEMPLATE/config.yml | 10 +- .github/dependabot.yml | 31 - .github/linters/.flake8 | 4 + .github/linters/.isort.cfg | 20 + .github/linters/.markdown-lint.yml | 38 + .github/linters/.python-black | 2 + .github/linters/.python-lint | 564 +++++ .github/workflows/benchmarks.yml | 77 - .../workflows/build-linux-arm64-installer.yml | 107 +- .../workflows/build-linux-installer-deb.yml | 105 +- .../workflows/build-linux-installer-rpm.yml | 105 +- .github/workflows/build-macos-installer.yml | 111 +- .../workflows/build-macos-m1-installer.yml | 204 -- .../workflows/build-test-macos-blockchain.yml | 117 - .github/workflows/build-test-macos-clvm.yml | 103 - .../workflows/build-test-macos-core-cmds.yml | 103 - .../build-test-macos-core-consensus.yml | 103 - .../build-test-macos-core-custom_types.yml | 103 - .../build-test-macos-core-daemon.yml | 121 - ...ld-test-macos-core-full_node-full_sync.yml | 117 - ...build-test-macos-core-full_node-stores.yml | 117 - .../build-test-macos-core-full_node.yml | 117 - .../build-test-macos-core-server.yml | 117 - .../workflows/build-test-macos-core-ssl.yml | 117 - .../workflows/build-test-macos-core-util.yml | 117 - .github/workflows/build-test-macos-core.yml | 117 - .../build-test-macos-farmer_harvester.yml | 117 - .../workflows/build-test-macos-generator.yml | 103 - .../workflows/build-test-macos-plot_sync.yml | 117 - .../workflows/build-test-macos-plotting.yml | 117 - .github/workflows/build-test-macos-pools.yml | 117 - .../workflows/build-test-macos-simulation.yml | 121 - .github/workflows/build-test-macos-tools.yml | 103 - .github/workflows/build-test-macos-util.yml | 103 - .../build-test-macos-wallet-cat_wallet.yml | 117 - .../build-test-macos-wallet-did_wallet.yml | 117 - .../build-test-macos-wallet-nft_wallet.yml | 117 - .../build-test-macos-wallet-rl_wallet.yml | 103 - .../workflows/build-test-macos-wallet-rpc.yml | 117 - .../build-test-macos-wallet-simple_sync.yml | 117 - .../build-test-macos-wallet-sync.yml | 117 - .github/workflows/build-test-macos-wallet.yml | 117 - .../build-test-macos-weight_proof.yml | 117 - .../build-test-ubuntu-blockchain.yml | 119 - .github/workflows/build-test-ubuntu-clvm.yml | 105 - .../workflows/build-test-ubuntu-core-cmds.yml | 105 - .../build-test-ubuntu-core-consensus.yml | 105 - .../build-test-ubuntu-core-custom_types.yml | 105 - .../build-test-ubuntu-core-daemon.yml | 123 - ...d-test-ubuntu-core-full_node-full_sync.yml | 119 - ...uild-test-ubuntu-core-full_node-stores.yml | 122 - .../build-test-ubuntu-core-full_node.yml | 122 - .../build-test-ubuntu-core-server.yml | 119 - .../workflows/build-test-ubuntu-core-ssl.yml | 119 - .../workflows/build-test-ubuntu-core-util.yml | 119 - .github/workflows/build-test-ubuntu-core.yml | 119 - .../build-test-ubuntu-farmer_harvester.yml | 119 - .../workflows/build-test-ubuntu-generator.yml | 105 - .../workflows/build-test-ubuntu-plot_sync.yml | 119 - .../workflows/build-test-ubuntu-plotting.yml | 119 - .github/workflows/build-test-ubuntu-pools.yml | 119 - .../build-test-ubuntu-simulation.yml | 123 - .github/workflows/build-test-ubuntu-tools.yml | 105 - .github/workflows/build-test-ubuntu-util.yml | 105 - .../build-test-ubuntu-wallet-cat_wallet.yml | 119 - .../build-test-ubuntu-wallet-did_wallet.yml | 119 - .../build-test-ubuntu-wallet-nft_wallet.yml | 119 - .../build-test-ubuntu-wallet-rl_wallet.yml | 105 - .../build-test-ubuntu-wallet-rpc.yml | 119 - .../build-test-ubuntu-wallet-simple_sync.yml | 119 - .../build-test-ubuntu-wallet-sync.yml | 119 - .../workflows/build-test-ubuntu-wallet.yml | 119 - .../build-test-ubuntu-weight_proof.yml | 119 - .github/workflows/build-windows-installer.yml | 107 +- .../workflows/check_wheel_availability.yaml | 73 - .github/workflows/codeql-analysis.yml | 75 - .github/workflows/conflict-check.yml | 21 - .github/workflows/mozilla-ca-cert.yml | 33 - .github/workflows/pre-commit.yml | 22 - .github/workflows/stale-issue.yml | 37 - .github/workflows/start-release.yml | 23 - .github/workflows/super-linter.yml | 91 - .github/workflows/test-install-scripts.yml | 258 -- .github/workflows/trigger-docker-dev.yml | 35 - .github/workflows/trigger-docker-main.yml | 21 - .github/workflows/upload-pypi-source.yml | 90 - .gitignore | 14 +- .gitmodules | 8 +- .isort.cfg | 260 +- BUILD_TIMELORD.md | 4 +- CHANGELOG.md | 2185 ----------------- CODE_OF_CONDUCT.md | 2 +- CONTRIBUTING.md | 32 +- INSTALL.md | 4 +- Install-gui.ps1 | 10 +- Install.ps1 | 14 +- README.md | 57 +- benchmarks/block_ref.py | 20 +- benchmarks/block_store.py | 24 +- benchmarks/clvm_generator.bin | Bin 121543 -> 121543 bytes benchmarks/coin_store.py | 10 +- benchmarks/streamable.py | 8 +- benchmarks/utils.py | 28 +- build_scripts/assets/deb/control.j2 | 10 +- build_scripts/assets/deb/postinst.sh | 4 +- build_scripts/assets/deb/prerm.sh | 4 +- build_scripts/build_dmg.js | 4 +- build_scripts/build_linux_deb.sh | 46 +- build_scripts/build_linux_rpm.sh | 54 +- build_scripts/build_macos.sh | 46 +- build_scripts/build_macos_m1.sh | 46 +- build_scripts/build_windows.ps1 | 42 +- build_scripts/clean-runner.sh | 12 +- build_scripts/deb-options.json | 4 +- chia-blockchain-gui | 1 - chia/cmds/plotnft.py | 223 -- chia/ssl/chia_ca.crt | 19 - chia/ssl/chia_ca.key | 27 - chia/util/default_root.py | 9 - chia/util/service_groups.py | 33 - chia/wallet/cat_wallet/cat_constants.py | 30 - chia/wallet/util/json_clvm_utils.py | 17 - flax-blockchain-gui | 1 + {chia => flax}/__init__.py | 4 +- {chia => flax}/clvm/__init__.py | 0 {chia => flax}/clvm/singleton.py | 2 +- {chia => flax}/clvm/spend_sim.py | 48 +- {chia => flax}/cmds/__init__.py | 0 {chia => flax}/cmds/cmds_util.py | 8 +- {chia => flax}/cmds/configure.py | 20 +- {chia => flax}/cmds/db.py | 4 +- {chia => flax}/cmds/db_upgrade_func.py | 8 +- {chia => flax}/cmds/db_validate_func.py | 12 +- {chia => flax}/cmds/farm.py | 0 {chia => flax}/cmds/farm_funcs.py | 34 +- chia/cmds/chia.py => flax/cmds/flax.py | 56 +- {chia => flax}/cmds/init.py | 24 +- {chia => flax}/cmds/init_funcs.py | 106 +- {chia => flax}/cmds/keys.py | 12 +- {chia => flax}/cmds/keys_funcs.py | 26 +- {chia => flax}/cmds/netspace.py | 0 {chia => flax}/cmds/netspace_funcs.py | 12 +- {chia => flax}/cmds/passphrase.py | 0 {chia => flax}/cmds/passphrase_funcs.py | 16 +- flax/cmds/plotnft.py | 19 + {chia => flax}/cmds/plotnft_funcs.py | 50 +- {chia => flax}/cmds/plots.py | 22 +- {chia => flax}/cmds/plotters.py | 2 +- {chia => flax}/cmds/rpc.py | 8 +- {chia => flax}/cmds/show.py | 26 +- {chia => flax}/cmds/start.py | 2 +- {chia => flax}/cmds/start_funcs.py | 16 +- {chia => flax}/cmds/stop.py | 6 +- {chia => flax}/cmds/units.py | 2 +- {chia => flax}/cmds/wallet.py | 26 +- {chia => flax}/cmds/wallet_funcs.py | 94 +- {chia => flax}/consensus/__init__.py | 0 .../consensus/block_body_validation.py | 48 +- {chia => flax}/consensus/block_creation.py | 48 +- .../consensus/block_header_validation.py | 38 +- {chia => flax}/consensus/block_record.py | 16 +- {chia => flax}/consensus/block_rewards.py | 30 +- .../consensus/block_root_validation.py | 6 +- {chia => flax}/consensus/blockchain.py | 70 +- .../consensus/blockchain_interface.py | 14 +- {chia => flax}/consensus/coinbase.py | 8 +- {chia => flax}/consensus/condition_costs.py | 0 {chia => flax}/consensus/constants.py | 11 +- {chia => flax}/consensus/cost_calculator.py | 6 +- {chia => flax}/consensus/default_constants.py | 13 +- {chia => flax}/consensus/deficit.py | 6 +- .../consensus/difficulty_adjustment.py | 12 +- {chia => flax}/consensus/find_fork_point.py | 6 +- .../consensus/full_block_to_block_record.py | 30 +- .../consensus/get_block_challenge.py | 18 +- .../consensus/make_sub_epoch_summary.py | 20 +- .../consensus/multiprocess_validation.py | 48 +- {chia => flax}/consensus/network_type.py | 0 {chia => flax}/consensus/pos_quality.py | 2 +- {chia => flax}/consensus/pot_iterations.py | 10 +- .../consensus/vdf_info_computation.py | 14 +- {chia => flax}/daemon/__init__.py | 0 {chia => flax}/daemon/client.py | 8 +- {chia => flax}/daemon/keychain_proxy.py | 14 +- {chia => flax}/daemon/keychain_server.py | 4 +- {chia => flax}/daemon/server.py | 92 +- {chia => flax}/daemon/windows_signal.py | 0 {chia => flax}/farmer/__init__.py | 0 {chia => flax}/farmer/farmer.py | 68 +- {chia => flax}/farmer/farmer_api.py | 52 +- {chia => flax}/full_node/__init__.py | 0 {chia => flax}/full_node/block_height_map.py | 12 +- {chia => flax}/full_node/block_store.py | 24 +- {chia => flax}/full_node/bundle_tools.py | 14 +- {chia => flax}/full_node/coin_store.py | 14 +- {chia => flax}/full_node/full_node.py | 179 +- {chia => flax}/full_node/full_node_api.py | 108 +- {chia => flax}/full_node/full_node_store.py | 42 +- {chia => flax}/full_node/generator.py | 18 +- {chia => flax}/full_node/hint_management.py | 6 +- {chia => flax}/full_node/hint_store.py | 4 +- {chia => flax}/full_node/lock_queue.py | 0 {chia => flax}/full_node/mempool.py | 6 +- .../full_node/mempool_check_conditions.py | 27 +- {chia => flax}/full_node/mempool_manager.py | 58 +- {chia => flax}/full_node/pending_tx_cache.py | 4 +- {chia => flax}/full_node/signage_point.py | 4 +- {chia => flax}/full_node/sync_store.py | 4 +- {chia => flax}/full_node/weight_proof.py | 46 +- {chia => flax}/harvester/__init__.py | 0 {chia => flax}/harvester/harvester.py | 14 +- {chia => flax}/harvester/harvester_api.py | 32 +- {chia => flax}/introducer/__init__.py | 0 {chia => flax}/introducer/introducer.py | 10 +- {chia => flax}/introducer/introducer_api.py | 18 +- {chia => flax}/plot_sync/__init__.py | 0 {chia => flax}/plot_sync/delta.py | 2 +- {chia => flax}/plot_sync/exceptions.py | 8 +- {chia => flax}/plot_sync/receiver.py | 24 +- {chia => flax}/plot_sync/sender.py | 20 +- {chia => flax}/plot_sync/util.py | 0 {chia => flax}/plotters/__init__.py | 0 {chia => flax}/plotters/bladebit.py | 8 +- {chia => flax}/plotters/chiapos.py | 12 +- {chia => flax}/plotters/install_plotter.py | 8 +- {chia => flax}/plotters/madmax.py | 12 +- {chia => flax}/plotters/plotters.py | 24 +- {chia => flax}/plotters/plotters_util.py | 0 {chia => flax}/plotting/__init__.py | 0 {chia => flax}/plotting/cache.py | 14 +- {chia => flax}/plotting/check_plots.py | 16 +- {chia => flax}/plotting/create_plots.py | 20 +- {chia => flax}/plotting/manager.py | 8 +- {chia => flax}/plotting/util.py | 4 +- {chia => flax}/pools/__init__.py | 0 {chia => flax}/pools/pool_config.py | 8 +- {chia => flax}/pools/pool_puzzles.py | 24 +- {chia => flax}/pools/pool_wallet.py | 42 +- {chia => flax}/pools/pool_wallet_info.py | 14 +- {chia => flax}/protocols/__init__.py | 0 {chia => flax}/protocols/farmer_protocol.py | 10 +- .../protocols/full_node_protocol.py | 20 +- .../protocols/harvester_protocol.py | 8 +- .../protocols/introducer_protocol.py | 4 +- {chia => flax}/protocols/pool_protocol.py | 8 +- .../protocols/protocol_message_types.py | 0 .../protocols/protocol_state_machine.py | 4 +- {chia => flax}/protocols/protocol_timing.py | 0 {chia => flax}/protocols/shared_protocol.py | 6 +- {chia => flax}/protocols/timelord_protocol.py | 16 +- {chia => flax}/protocols/wallet_protocol.py | 14 +- {chia => flax}/py.typed | 0 {chia => flax}/pyinstaller.spec | 46 +- {chia => flax}/rpc/__init__.py | 0 {chia => flax}/rpc/crawler_rpc_api.py | 6 +- {chia => flax}/rpc/farmer_rpc_api.py | 18 +- {chia => flax}/rpc/farmer_rpc_client.py | 12 +- {chia => flax}/rpc/full_node_rpc_api.py | 36 +- {chia => flax}/rpc/full_node_rpc_client.py | 28 +- {chia => flax}/rpc/harvester_rpc_api.py | 6 +- {chia => flax}/rpc/harvester_rpc_client.py | 6 +- {chia => flax}/rpc/rpc_client.py | 14 +- {chia => flax}/rpc/rpc_server.py | 18 +- {chia => flax}/rpc/timelord_rpc_api.py | 6 +- {chia => flax}/rpc/util.py | 2 +- {chia => flax}/rpc/wallet_rpc_api.py | 88 +- {chia => flax}/rpc/wallet_rpc_client.py | 26 +- {chia => flax}/seeder/__init__.py | 0 {chia => flax}/seeder/crawl_store.py | 2 +- {chia => flax}/seeder/crawler.py | 30 +- {chia => flax}/seeder/crawler_api.py | 22 +- {chia => flax}/seeder/dns_server.py | 8 +- {chia => flax}/seeder/peer_record.py | 4 +- {chia => flax}/seeder/start_crawler.py | 18 +- {chia => flax}/server/__init__.py | 0 {chia => flax}/server/address_manager.py | 6 +- .../server/address_manager_sqlite_store.py | 4 +- .../server/address_manager_store.py | 10 +- {chia => flax}/server/connection_utils.py | 12 +- {chia => flax}/server/introducer_peers.py | 4 +- {chia => flax}/server/node_discovery.py | 38 +- {chia => flax}/server/outbound_message.py | 6 +- {chia => flax}/server/peer_store_resolver.py | 0 {chia => flax}/server/rate_limits.py | 4 +- {chia => flax}/server/reconnect_task.py | 8 +- {chia => flax}/server/server.py | 74 +- {chia => flax}/server/ssl_context.py | 6 +- {chia => flax}/server/start_farmer.py | 22 +- {chia => flax}/server/start_full_node.py | 18 +- {chia => flax}/server/start_harvester.py | 20 +- {chia => flax}/server/start_introducer.py | 12 +- {chia => flax}/server/start_service.py | 32 +- {chia => flax}/server/start_timelord.py | 20 +- {chia => flax}/server/start_wallet.py | 22 +- {chia => flax}/server/upnp.py | 4 +- {chia => flax}/server/ws_connection.py | 42 +- .../simulator/SimulatorFullNodeRpcApi.py | 6 +- {chia => flax}/simulator/__init__.py | 0 .../simulator/full_node_simulator.py | 16 +- .../simulator/simulator_constants.py | 2 +- .../simulator/simulator_protocol.py | 6 +- {chia => flax}/simulator/start_simulator.py | 16 +- {chia => flax}/ssl/__init__.py | 0 {chia => flax}/ssl/create_ssl.py | 20 +- {chia => flax}/ssl/dst_root_ca.pem | 0 flax/ssl/flax_ca.crt | 19 + flax/ssl/flax_ca.key | 27 + {chia => flax}/timelord/__init__.py | 0 {chia => flax}/timelord/iters_from_block.py | 8 +- {chia => flax}/timelord/timelord.py | 44 +- {chia => flax}/timelord/timelord_api.py | 8 +- {chia => flax}/timelord/timelord_launcher.py | 12 +- {chia => flax}/timelord/timelord_state.py | 20 +- {chia => flax}/timelord/types.py | 0 {chia => flax}/types/__init__.py | 0 {chia => flax}/types/announcement.py | 4 +- {chia => flax}/types/block_protocol.py | 6 +- .../types/blockchain_format/__init__.py | 0 .../types/blockchain_format/classgroup.py | 6 +- .../types/blockchain_format/coin.py | 8 +- .../types/blockchain_format/foliage.py | 10 +- .../types/blockchain_format/pool_target.py | 6 +- .../types/blockchain_format/program.py | 8 +- .../types/blockchain_format/proof_of_space.py | 10 +- .../blockchain_format/reward_chain_block.py | 10 +- .../types/blockchain_format/sized_bytes.py | 2 +- .../types/blockchain_format/slots.py | 10 +- .../blockchain_format/sub_epoch_summary.py | 6 +- .../types/blockchain_format/tree_hash.py | 4 +- {chia => flax}/types/blockchain_format/vdf.py | 10 +- {chia => flax}/types/coin_record.py | 10 +- {chia => flax}/types/coin_solution.py | 0 {chia => flax}/types/coin_spend.py | 8 +- {chia => flax}/types/condition_opcodes.py | 2 +- {chia => flax}/types/condition_with_args.py | 4 +- {chia => flax}/types/end_of_slot_bundle.py | 4 +- {chia => flax}/types/full_block.py | 18 +- {chia => flax}/types/generator_types.py | 6 +- {chia => flax}/types/header_block.py | 10 +- .../types/mempool_inclusion_status.py | 0 {chia => flax}/types/mempool_item.py | 14 +- .../types/mempool_submission_status.py | 6 +- {chia => flax}/types/peer_info.py | 4 +- {chia => flax}/types/spend_bundle.py | 10 +- .../types/spend_bundle_conditions.py | 6 +- .../types/transaction_queue_entry.py | 8 +- {chia => flax}/types/unfinished_block.py | 14 +- .../types/unfinished_header_block.py | 10 +- {chia => flax}/types/weight_proof.py | 16 +- {chia => flax}/util/__init__.py | 0 {chia => flax}/util/api_decorators.py | 2 +- {chia => flax}/util/bech32m.py | 2 +- {chia => flax}/util/block_cache.py | 14 +- {chia => flax}/util/byte_types.py | 0 {chia => flax}/util/cached_bls.py | 6 +- {chia => flax}/util/chain_utils.py | 10 +- {chia => flax}/util/check_fork_next_block.py | 4 +- {chia => flax}/util/chunks.py | 0 {chia => flax}/util/condition_tools.py | 20 +- {chia => flax}/util/config.py | 6 +- {chia => flax}/util/create_alert_file.py | 6 +- {chia => flax}/util/db_synchronous.py | 0 {chia => flax}/util/db_version.py | 0 {chia => flax}/util/db_wrapper.py | 0 flax/util/default_root.py | 9 + {chia => flax}/util/dump_keyring.py | 8 +- {chia => flax}/util/english.txt | 0 {chia => flax}/util/errors.py | 0 {chia => flax}/util/file_keyring.py | 6 +- {chia => flax}/util/files.py | 0 .../util/flax_logging.py | 2 +- {chia => flax}/util/full_block_utils.py | 2 +- {chia => flax}/util/generator_tools.py | 14 +- {chia => flax}/util/hash.py | 2 +- {chia => flax}/util/initial-config.yaml | 177 +- {chia => flax}/util/inline_executor.py | 0 {chia => flax}/util/ints.py | 2 +- {chia => flax}/util/json_util.py | 2 +- {chia => flax}/util/keychain.py | 18 +- {chia => flax}/util/keyring_wrapper.py | 34 +- {chia => flax}/util/lock.py | 2 +- {chia => flax}/util/log_exceptions.py | 0 {chia => flax}/util/lru_cache.py | 0 {chia => flax}/util/make_test_constants.py | 4 +- {chia => flax}/util/merkle_set.py | 2 +- {chia => flax}/util/misc.py | 2 +- {chia => flax}/util/network.py | 22 +- {chia => flax}/util/paginator.py | 0 {chia => flax}/util/partial_func.py | 0 {chia => flax}/util/path.py | 0 {chia => flax}/util/permissions.py | 0 {chia => flax}/util/pip_import.py | 0 {chia => flax}/util/prev_transaction_block.py | 6 +- {chia => flax}/util/profiler.py | 12 +- {chia => flax}/util/recursive_replace.py | 0 {chia => flax}/util/safe_cancel_task.py | 0 flax/util/service_groups.py | 33 + {chia => flax}/util/setproctitle.py | 0 {chia => flax}/util/significant_bits.py | 0 {chia => flax}/util/ssl_check.py | 16 +- {chia => flax}/util/streamable.py | 8 +- {chia => flax}/util/struct_stream.py | 0 {chia => flax}/util/validate_alert.py | 4 +- {chia => flax}/util/vdf_prover.py | 10 +- {chia => flax}/util/ws_message.py | 2 +- {chia => flax}/wallet/__init__.py | 0 {chia => flax}/wallet/block_record.py | 6 +- {chia => flax}/wallet/cat_wallet/__init__.py | 0 flax/wallet/cat_wallet/cat_constants.py | 3 + {chia => flax}/wallet/cat_wallet/cat_info.py | 8 +- .../wallet/cat_wallet/cat_outer_puzzle.py | 16 +- {chia => flax}/wallet/cat_wallet/cat_utils.py | 16 +- .../wallet/cat_wallet/cat_wallet.py | 164 +- .../wallet/cat_wallet/lineage_store.py | 6 +- {chia => flax}/wallet/coin_selection.py | 8 +- {chia => flax}/wallet/derivation_record.py | 6 +- {chia => flax}/wallet/derive_keys.py | 8 +- {chia => flax}/wallet/did_wallet/__init__.py | 0 {chia => flax}/wallet/did_wallet/did_info.py | 14 +- .../wallet/did_wallet/did_wallet.py | 82 +- .../wallet/did_wallet/did_wallet_puzzles.py | 20 +- .../chialisp.py => flax/wallet/flaxlisp.py | 0 {chia => flax}/wallet/key_val_store.py | 2 +- {chia => flax}/wallet/lineage_proof.py | 8 +- {chia => flax}/wallet/nft_wallet/__init__.py | 0 .../nft_wallet/metadata_outer_puzzle.py | 12 +- {chia => flax}/wallet/nft_wallet/nft_info.py | 14 +- .../wallet/nft_wallet/nft_puzzles.py | 20 +- .../wallet/nft_wallet/nft_wallet.py | 92 +- .../nft_wallet/ownership_outer_puzzle.py | 8 +- .../nft_wallet/singleton_outer_puzzle.py | 16 +- .../nft_wallet/transfer_program_puzzle.py | 12 +- .../wallet/nft_wallet/uncurry_nft.py | 10 +- {chia => flax}/wallet/outer_puzzles.py | 16 +- {chia => flax}/wallet/payment.py | 6 +- {chia => flax}/wallet/puzzle_drivers.py | 2 +- {chia => flax}/wallet/puzzles/__init__.py | 0 .../wallet/puzzles/block_program_zero.clvm | 0 .../puzzles/block_program_zero.clvm.hex | 0 .../block_program_zero.clvm.hex.sha256tree | 0 .../calculate_synthetic_public_key.clvm | 0 .../calculate_synthetic_public_key.clvm.hex | 0 ...e_synthetic_public_key.clvm.hex.sha256tree | 0 {chia => flax}/wallet/puzzles/cat.clvm | 0 {chia => flax}/wallet/puzzles/cat.clvm.hex | 0 .../wallet/puzzles/cat.clvm.hex.sha256tree | 0 {chia => flax}/wallet/puzzles/cat_loader.py | 2 +- {chia => flax}/wallet/puzzles/cat_truths.clib | 0 .../wallet/puzzles/condition_codes.clvm | 2 +- .../wallet/puzzles/condition_codes.clvm.hex | 0 .../wallet/puzzles/counter.clvm.hex | 0 .../puzzles/create-lock-puzzlehash.clvm | 0 .../puzzles/create-lock-puzzlehash.clvm.hex | 0 ...create-lock-puzzlehash.clvm.hex.sha256tree | 0 .../wallet/puzzles/curry-and-treehash.clinc | 0 .../puzzles/decompress_coin_spend_entry.clvm | 0 .../decompress_coin_spend_entry.clvm.hex | 0 ...press_coin_spend_entry.clvm.hex.sha256tree | 0 ...compress_coin_spend_entry_with_prefix.clvm | 0 ...ress_coin_spend_entry_with_prefix.clvm.hex | 0 ...pend_entry_with_prefix.clvm.hex.sha256tree | 0 .../wallet/puzzles/decompress_puzzle.clvm | 0 .../wallet/puzzles/decompress_puzzle.clvm.hex | 0 .../decompress_puzzle.clvm.hex.sha256tree | 0 .../wallet/puzzles/delegated_tail.clvm | 0 .../wallet/puzzles/delegated_tail.clvm.hex | 0 .../delegated_tail.clvm.hex.sha256tree | 0 .../wallet/puzzles/did_innerpuz.clvm | 0 .../wallet/puzzles/did_innerpuz.clvm.hex | 0 .../puzzles/did_innerpuz.clvm.hex.sha256tree | 0 .../puzzles/everything_with_signature.clvm | 0 .../everything_with_signature.clvm.hex | 0 ...rything_with_signature.clvm.hex.sha256tree | 0 .../puzzles/flaxlisp_deserialisation.clvm | 0 .../puzzles/flaxlisp_deserialisation.clvm.hex | 0 ...axlisp_deserialisation.clvm.hex.sha256tree | 0 .../puzzles/generator_for_single_coin.clvm | 2 +- .../generator_for_single_coin.clvm.hex | 0 ...erator_for_single_coin.clvm.hex.sha256tree | 0 .../wallet/puzzles/generator_loader.py | 2 +- .../wallet/puzzles/genesis_by_coin_id.clvm | 0 .../puzzles/genesis_by_coin_id.clvm.hex | 0 .../genesis_by_coin_id.clvm.hex.sha256tree | 0 .../puzzles/genesis_by_puzzle_hash.clvm | 0 .../puzzles/genesis_by_puzzle_hash.clvm.hex | 0 ...genesis_by_puzzle_hash.clvm.hex.sha256tree | 0 .../wallet/puzzles/index_lock.clvm.hex | 0 {chia => flax}/wallet/puzzles/json.clib | 0 {chia => flax}/wallet/puzzles/load_clvm.py | 4 +- .../wallet/puzzles/lock.inner.puzzle.clvm | 0 .../wallet/puzzles/lock.inner.puzzle.clvm.hex | 0 .../lock.inner.puzzle.clvm.hex.sha256tree | 0 .../nft_metadata_updater.clvm.hex.sha256tree | 0 .../puzzles/nft_metadata_updater_default.clvm | 0 .../nft_metadata_updater_default.clvm.hex | 0 ...tadata_updater_default.clvm.hex.sha256tree | 0 .../nft_metadata_updater_updateable.clvm | 0 .../nft_metadata_updater_updateable.clvm.hex | 0 ...ata_updater_updateable.clvm.hex.sha256tree | 0 .../wallet/puzzles/nft_ownership_layer.clvm | 0 .../puzzles/nft_ownership_layer.clvm.hex | 0 .../nft_ownership_layer.clvm.hex.sha256tree | 0 ..._program_one_way_claim_with_royalties.clvm | 2 +- ...gram_one_way_claim_with_royalties.clvm.hex | 0 ...y_claim_with_royalties.clvm.hex.sha256tree | 0 .../wallet/puzzles/nft_state_layer.clvm | 0 .../wallet/puzzles/nft_state_layer.clvm.hex | 0 .../nft_state_layer.clvm.hex.sha256tree | 0 .../wallet/puzzles/p2_conditions.clvm | 0 .../wallet/puzzles/p2_conditions.clvm.hex | 0 .../puzzles/p2_conditions.clvm.hex.sha256tree | 0 .../wallet/puzzles/p2_conditions.py | 2 +- .../puzzles/p2_delegated_conditions.clvm | 0 .../puzzles/p2_delegated_conditions.clvm.hex | 0 ...2_delegated_conditions.clvm.hex.sha256tree | 0 .../wallet/puzzles/p2_delegated_conditions.py | 2 +- .../wallet/puzzles/p2_delegated_puzzle.clvm | 0 .../puzzles/p2_delegated_puzzle.clvm.hex | 0 .../p2_delegated_puzzle.clvm.hex.sha256tree | 0 .../wallet/puzzles/p2_delegated_puzzle.py | 2 +- .../p2_delegated_puzzle_or_hidden_puzzle.clvm | 0 ...delegated_puzzle_or_hidden_puzzle.clvm.hex | 0 ...uzzle_or_hidden_puzzle.clvm.hex.sha256tree | 0 .../p2_delegated_puzzle_or_hidden_puzzle.py | 12 +- .../puzzles/p2_m_of_n_delegate_direct.clvm | 0 .../p2_m_of_n_delegate_direct.clvm.hex | 0 ...m_of_n_delegate_direct.clvm.hex.sha256tree | 0 .../puzzles/p2_m_of_n_delegate_direct.py | 2 +- .../wallet/puzzles/p2_puzzle_hash.clvm | 0 .../wallet/puzzles/p2_puzzle_hash.clvm.hex | 0 .../p2_puzzle_hash.clvm.hex.sha256tree | 0 .../wallet/puzzles/p2_puzzle_hash.py | 4 +- .../wallet/puzzles/p2_singleton.clvm | 0 .../wallet/puzzles/p2_singleton.clvm.hex | 0 .../puzzles/p2_singleton.clvm.hex.sha256tree | 0 .../p2_singleton_or_delayed_puzhash.clvm | 0 .../p2_singleton_or_delayed_puzhash.clvm.hex | 0 ...ton_or_delayed_puzhash.clvm.hex.sha256tree | 0 .../wallet/puzzles/pool_member_innerpuz.clvm | 0 .../puzzles/pool_member_innerpuz.clvm.hex | 0 .../pool_member_innerpuz.clvm.hex.sha256tree | 0 .../puzzles/pool_waitingroom_innerpuz.clvm | 0 .../pool_waitingroom_innerpuz.clvm.hex | 0 ...l_waitingroom_innerpuz.clvm.hex.sha256tree | 0 .../wallet/puzzles/prefarm/__init__.py | 0 .../wallet/puzzles/prefarm/make_prefarm_ph.py | 34 +- .../wallet/puzzles/prefarm/spend_prefarm.py | 26 +- {chia => flax}/wallet/puzzles/puzzle_utils.py | 2 +- .../wallet/puzzles/recompile-all.sh | 0 {chia => flax}/wallet/puzzles/rl.clvm | 0 {chia => flax}/wallet/puzzles/rl.clvm.hex | 0 .../wallet/puzzles/rl.clvm.hex.sha256tree | 0 .../wallet/puzzles/rl_aggregation.clvm | 0 .../wallet/puzzles/rl_aggregation.clvm.hex | 0 .../rl_aggregation.clvm.hex.sha256tree | 0 .../puzzles/rom_bootstrap_generator.clvm | 2 +- .../puzzles/rom_bootstrap_generator.clvm.hex | 0 ...om_bootstrap_generator.clvm.hex.sha256tree | 0 .../wallet/puzzles/rom_bootstrap_generator.py | 2 +- .../wallet/puzzles/settlement_payments.clvm | 0 .../puzzles/settlement_payments.clvm.hex | 0 .../settlement_payments.clvm.hex.sha256tree | 0 {chia => flax}/wallet/puzzles/sha256tree.clib | 0 .../wallet/puzzles/sha256tree_module.clvm | 0 .../wallet/puzzles/sha256tree_module.clvm.hex | 0 .../sha256tree_module.clvm.hex.sha256tree | 0 .../wallet/puzzles/singleton_launcher.clvm | 0 .../puzzles/singleton_launcher.clvm.hex | 0 .../singleton_launcher.clvm.hex.sha256tree | 0 .../wallet/puzzles/singleton_top_layer.clvm | 0 .../puzzles/singleton_top_layer.clvm.hex | 0 .../singleton_top_layer.clvm.hex.sha256tree | 0 .../wallet/puzzles/singleton_top_layer.py | 18 +- .../puzzles/singleton_top_layer_v1_1.clvm | 0 .../puzzles/singleton_top_layer_v1_1.clvm.hex | 0 ...ngleton_top_layer_v1_1.clvm.hex.sha256tree | 0 .../puzzles/singleton_top_layer_v1_1.py | 18 +- .../wallet/puzzles/singleton_truths.clib | 0 {chia => flax}/wallet/puzzles/tails.py | 22 +- .../puzzles/test_generator_deserialize.clvm | 0 .../test_generator_deserialize.clvm.hex | 0 ..._generator_deserialize.clvm.hex.sha256tree | 0 ...st_multiple_generator_input_arguments.clvm | 0 ...ultiple_generator_input_arguments.clvm.hex | 0 ...erator_input_arguments.clvm.hex.sha256tree | 0 .../wallet/puzzles/utility_macros.clib | 0 {chia => flax}/wallet/rl_wallet/__init__.py | 0 {chia => flax}/wallet/rl_wallet/rl_wallet.py | 36 +- .../wallet/rl_wallet/rl_wallet_puzzles.py | 14 +- {chia => flax}/wallet/secret_key_store.py | 0 {chia => flax}/wallet/settings/__init__.py | 0 .../wallet/settings/default_settings.py | 2 +- .../wallet/settings/settings_objects.py | 2 +- .../wallet/settings/user_settings.py | 6 +- {chia => flax}/wallet/sign_coin_spends.py | 6 +- {chia => flax}/wallet/trade_manager.py | 52 +- {chia => flax}/wallet/trade_record.py | 12 +- {chia => flax}/wallet/trading/__init__.py | 0 {chia => flax}/wallet/trading/offer.py | 32 +- {chia => flax}/wallet/trading/trade_status.py | 0 {chia => flax}/wallet/trading/trade_store.py | 14 +- {chia => flax}/wallet/transaction_record.py | 18 +- {chia => flax}/wallet/transaction_sorting.py | 0 {chia => flax}/wallet/util/__init__.py | 0 {chia => flax}/wallet/util/compute_hints.py | 8 +- {chia => flax}/wallet/util/compute_memos.py | 10 +- .../wallet/util/debug_spend_bundle.py | 12 +- flax/wallet/util/json_clvm_utils.py | 17 + {chia => flax}/wallet/util/new_peak_queue.py | 10 +- .../wallet/util/peer_request_cache.py | 10 +- .../wallet/util/puzzle_compression.py | 8 +- .../wallet/util/transaction_type.py | 0 .../wallet/util/wallet_sync_utils.py | 36 +- {chia => flax}/wallet/util/wallet_types.py | 4 +- {chia => flax}/wallet/wallet.py | 58 +- {chia => flax}/wallet/wallet_action.py | 4 +- {chia => flax}/wallet/wallet_action_store.py | 8 +- {chia => flax}/wallet/wallet_blockchain.py | 28 +- {chia => flax}/wallet/wallet_coin_record.py | 8 +- {chia => flax}/wallet/wallet_coin_store.py | 12 +- {chia => flax}/wallet/wallet_info.py | 4 +- .../wallet/wallet_interested_store.py | 6 +- {chia => flax}/wallet/wallet_nft_store.py | 14 +- {chia => flax}/wallet/wallet_node.py | 114 +- {chia => flax}/wallet/wallet_node_api.py | 30 +- {chia => flax}/wallet/wallet_pool_store.py | 6 +- {chia => flax}/wallet/wallet_puzzle_store.py | 10 +- {chia => flax}/wallet/wallet_state_manager.py | 135 +- {chia => flax}/wallet/wallet_sync_store.py | 6 +- .../wallet/wallet_transaction_store.py | 16 +- {chia => flax}/wallet/wallet_user_store.py | 10 +- .../wallet/wallet_weight_proof_handler.py | 16 +- install-gui.sh | 24 +- install-timelord.sh | 20 +- install.sh | 22 +- installhelper.py | 12 +- lgtm.yml | 2 +- mypy.ini | 4 +- pyproject.toml | 2 +- run-py-tests.sh | 0 setup.py | 106 +- start-gui.sh | 6 +- tests/README.md | 6 +- tests/block_tools.py | 114 +- tests/blockchain/blockchain_test_utils.py | 10 +- tests/blockchain/test_blockchain.py | 58 +- .../test_blockchain_transactions.py | 14 +- tests/build-init-files.py | 4 +- tests/build-workflows.py | 2 +- tests/check_pytest_monitor_output.py | 0 tests/check_sql_statements.py | 8 +- tests/clvm/benchmark_costs.py | 14 +- tests/clvm/coin_store.py | 18 +- tests/clvm/test_clvm_compilation.py | 86 +- ...on.py => test_flaxlisp_deserialization.py} | 8 +- tests/clvm/test_program.py | 2 +- tests/clvm/test_puzzle_compression.py | 20 +- tests/clvm/test_puzzle_drivers.py | 4 +- tests/clvm/test_puzzles.py | 14 +- tests/clvm/test_serialized_program.py | 4 +- tests/clvm/test_singletons.py | 40 +- tests/clvm/test_spend_sim.py | 10 +- tests/conftest.py | 18 +- tests/connection_utils.py | 30 +- tests/core/cmds/test_keys.py | 104 +- tests/core/cmds/test_wallet.py | 30 +- tests/core/consensus/test_pot_iterations.py | 10 +- tests/core/custom_types/test_coin.py | 8 +- .../core/custom_types/test_proof_of_space.py | 4 +- tests/core/custom_types/test_spend_bundle.py | 2 +- tests/core/daemon/test_daemon.py | 14 +- .../full_node/full_sync/test_full_sync.py | 14 +- tests/core/full_node/ram_db.py | 12 +- .../core/full_node/stores/test_block_store.py | 18 +- .../core/full_node/stores/test_coin_store.py | 30 +- .../full_node/stores/test_full_node_store.py | 26 +- .../core/full_node/stores/test_hint_store.py | 16 +- .../core/full_node/stores/test_sync_store.py | 4 +- tests/core/full_node/test_address_manager.py | 8 +- tests/core/full_node/test_block_height_map.py | 12 +- tests/core/full_node/test_conditions.py | 18 +- tests/core/full_node/test_full_node.py | 56 +- tests/core/full_node/test_generator_tools.py | 10 +- tests/core/full_node/test_hint_management.py | 18 +- tests/core/full_node/test_mempool.py | 64 +- .../full_node/test_mempool_performance.py | 10 +- tests/core/full_node/test_node_load.py | 6 +- .../full_node/test_peer_store_resolver.py | 2 +- tests/core/full_node/test_performance.py | 16 +- tests/core/full_node/test_transactions.py | 14 +- tests/core/make_block_generator.py | 20 +- tests/core/server/test_dos.py | 40 +- tests/core/server/test_rate_limits.py | 6 +- tests/core/ssl/test_ssl.py | 56 +- tests/core/test_coins.py | 6 +- tests/core/test_cost_calculation.py | 16 +- tests/core/test_crawler_rpc.py | 4 +- tests/core/test_daemon_rpc.py | 4 +- tests/core/test_db_conversion.py | 18 +- tests/core/test_db_validation.py | 24 +- tests/core/test_farmer_harvester_rpc.py | 48 +- tests/core/test_full_node_rpc.py | 24 +- tests/core/test_merkle_set.py | 4 +- tests/core/test_setproctitle.py | 4 +- tests/core/util/test_cached_bls.py | 6 +- tests/core/util/test_config.py | 18 +- tests/core/util/test_db_wrapper.py | 2 +- .../util/test_file_keyring_synchronization.py | 6 +- tests/core/util/test_files.py | 4 +- tests/core/util/test_jsonify.py | 6 +- tests/core/util/test_keychain.py | 6 +- tests/core/util/test_keyring_wrapper.py | 2 +- tests/core/util/test_lru_cache.py | 2 +- tests/core/util/test_significant_bits.py | 2 +- tests/core/util/test_streamable.py | 16 +- .../farmer_harvester/test_farmer_harvester.py | 4 +- tests/{chia-start-sim => flax-start-sim} | 20 +- tests/generator/test_compression.py | 32 +- tests/generator/test_generator_types.py | 8 +- tests/generator/test_list_to_batches.py | 2 +- tests/generator/test_rom.py | 20 +- tests/generator/test_scan.py | 4 +- tests/plot_sync/test_delta.py | 8 +- tests/plot_sync/test_plot_sync.py | 32 +- tests/plot_sync/test_receiver.py | 18 +- tests/plot_sync/test_sender.py | 12 +- tests/plot_sync/test_sync_simulated.py | 30 +- tests/plot_sync/util.py | 20 +- tests/plotting/test_plot_manager.py | 10 +- tests/pools/test_pool_cmdline.py | 4 +- tests/pools/test_pool_config.py | 6 +- tests/pools/test_pool_puzzles_lifecycle.py | 30 +- tests/pools/test_pool_rpc.py | 58 +- tests/pools/test_pool_wallet.py | 12 +- tests/pools/test_wallet_pool_store.py | 16 +- tests/runner_templates/build-test-macos | 14 +- tests/runner_templates/build-test-ubuntu | 6 +- .../checkout-test-plots.include.yml | 10 +- tests/setup_nodes.py | 10 +- tests/setup_services.py | 36 +- tests/simulation/test_simulation.py | 4 +- tests/time_out_assert.py | 2 +- tests/tools/test_run_block.py | 6 +- tests/util/alert_server.py | 2 +- tests/util/benchmark_cost.py | 18 +- tests/util/blockchain.py | 18 +- tests/util/build_network_protocol_files.py | 4 +- tests/util/db_connection.py | 2 +- tests/util/gen_ssl_certs.py | 10 +- tests/util/generator_tools_testing.py | 14 +- tests/util/key_tool.py | 4 +- tests/util/keyring.py | 12 +- tests/util/misc.py | 2 +- tests/util/network_protocol_data.py | 42 +- tests/util/test_chunks.py | 2 +- tests/util/test_full_block_utils.py | 20 +- tests/util/test_lock_queue.py | 2 +- tests/util/test_misc.py | 4 +- tests/util/test_network.py | 2 +- tests/util/test_network_protocol_files.py | 2 +- tests/util/test_paginator.py | 2 +- tests/util/test_struct_stream.py | 4 +- tests/wallet/cat_wallet/test_cat_lifecycle.py | 24 +- .../cat_wallet/test_cat_outer_puzzle.py | 16 +- tests/wallet/cat_wallet/test_cat_wallet.py | 28 +- .../wallet/cat_wallet/test_offer_lifecycle.py | 58 +- tests/wallet/cat_wallet/test_trades.py | 116 +- tests/wallet/did_wallet/test_did.py | 18 +- tests/wallet/nft_wallet/test_nft_1_offers.py | 114 +- tests/wallet/nft_wallet/test_nft_lifecycle.py | 28 +- tests/wallet/nft_wallet/test_nft_offers.py | 82 +- tests/wallet/nft_wallet/test_nft_puzzles.py | 18 +- tests/wallet/nft_wallet/test_nft_wallet.py | 80 +- .../nft_wallet/test_ownership_outer_puzzle.py | 14 +- tests/wallet/rl_wallet/test_rl_rpc.py | 24 +- tests/wallet/rl_wallet/test_rl_wallet.py | 8 +- tests/wallet/rpc/test_wallet_rpc.py | 102 +- .../simple_sync/test_simple_sync_protocol.py | 34 +- tests/wallet/sync/test_wallet_sync.py | 10 +- tests/wallet/test_bech32m.py | 2 +- tests/wallet/test_coin_selection.py | 16 +- .../{test_chialisp.py => test_flaxlisp.py} | 4 +- tests/wallet/test_nft_store.py | 16 +- tests/wallet/test_puzzle_store.py | 10 +- tests/wallet/test_singleton.py | 10 +- tests/wallet/test_singleton_lifecycle.py | 20 +- tests/wallet/test_singleton_lifecycle_fast.py | 18 +- tests/wallet/test_taproot.py | 2 +- tests/wallet/test_wallet.py | 60 +- tests/wallet/test_wallet_blockchain.py | 16 +- tests/wallet/test_wallet_interested_store.py | 8 +- tests/wallet/test_wallet_key_val_store.py | 8 +- tests/wallet/test_wallet_retry.py | 14 +- tests/wallet/test_wallet_store.py | 8 +- tests/wallet/test_wallet_user_store.py | 6 +- tests/wallet_tools.py | 28 +- tests/weight_proof/test_weight_proof.py | 26 +- tools/analyze-chain.py | 10 +- tools/generate_chain.py | 10 +- tools/run_benchmark.sh | 0 tools/run_block.py | 44 +- tools/test_constants.py | 2 +- tools/test_full_sync.py | 26 +- 806 files changed, 5547 insertions(+), 15878 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md delete mode 100644 .github/ISSUE_TEMPLATE/bug_report.yaml delete mode 100644 .github/dependabot.yml create mode 100644 .github/linters/.flake8 create mode 100644 .github/linters/.isort.cfg create mode 100644 .github/linters/.markdown-lint.yml create mode 100644 .github/linters/.python-black create mode 100644 .github/linters/.python-lint delete mode 100644 .github/workflows/benchmarks.yml delete mode 100644 .github/workflows/build-macos-m1-installer.yml delete mode 100644 .github/workflows/build-test-macos-blockchain.yml delete mode 100644 .github/workflows/build-test-macos-clvm.yml delete mode 100644 .github/workflows/build-test-macos-core-cmds.yml delete mode 100644 .github/workflows/build-test-macos-core-consensus.yml delete mode 100644 .github/workflows/build-test-macos-core-custom_types.yml delete mode 100644 .github/workflows/build-test-macos-core-daemon.yml delete mode 100644 .github/workflows/build-test-macos-core-full_node-full_sync.yml delete mode 100644 .github/workflows/build-test-macos-core-full_node-stores.yml delete mode 100644 .github/workflows/build-test-macos-core-full_node.yml delete mode 100644 .github/workflows/build-test-macos-core-server.yml delete mode 100644 .github/workflows/build-test-macos-core-ssl.yml delete mode 100644 .github/workflows/build-test-macos-core-util.yml delete mode 100644 .github/workflows/build-test-macos-core.yml delete mode 100644 .github/workflows/build-test-macos-farmer_harvester.yml delete mode 100644 .github/workflows/build-test-macos-generator.yml delete mode 100644 .github/workflows/build-test-macos-plot_sync.yml delete mode 100644 .github/workflows/build-test-macos-plotting.yml delete mode 100644 .github/workflows/build-test-macos-pools.yml delete mode 100644 .github/workflows/build-test-macos-simulation.yml delete mode 100644 .github/workflows/build-test-macos-tools.yml delete mode 100644 .github/workflows/build-test-macos-util.yml delete mode 100644 .github/workflows/build-test-macos-wallet-cat_wallet.yml delete mode 100644 .github/workflows/build-test-macos-wallet-did_wallet.yml delete mode 100644 .github/workflows/build-test-macos-wallet-nft_wallet.yml delete mode 100644 .github/workflows/build-test-macos-wallet-rl_wallet.yml delete mode 100644 .github/workflows/build-test-macos-wallet-rpc.yml delete mode 100644 .github/workflows/build-test-macos-wallet-simple_sync.yml delete mode 100644 .github/workflows/build-test-macos-wallet-sync.yml delete mode 100644 .github/workflows/build-test-macos-wallet.yml delete mode 100644 .github/workflows/build-test-macos-weight_proof.yml delete mode 100644 .github/workflows/build-test-ubuntu-blockchain.yml delete mode 100644 .github/workflows/build-test-ubuntu-clvm.yml delete mode 100644 .github/workflows/build-test-ubuntu-core-cmds.yml delete mode 100644 .github/workflows/build-test-ubuntu-core-consensus.yml delete mode 100644 .github/workflows/build-test-ubuntu-core-custom_types.yml delete mode 100644 .github/workflows/build-test-ubuntu-core-daemon.yml delete mode 100644 .github/workflows/build-test-ubuntu-core-full_node-full_sync.yml delete mode 100644 .github/workflows/build-test-ubuntu-core-full_node-stores.yml delete mode 100644 .github/workflows/build-test-ubuntu-core-full_node.yml delete mode 100644 .github/workflows/build-test-ubuntu-core-server.yml delete mode 100644 .github/workflows/build-test-ubuntu-core-ssl.yml delete mode 100644 .github/workflows/build-test-ubuntu-core-util.yml delete mode 100644 .github/workflows/build-test-ubuntu-core.yml delete mode 100644 .github/workflows/build-test-ubuntu-farmer_harvester.yml delete mode 100644 .github/workflows/build-test-ubuntu-generator.yml delete mode 100644 .github/workflows/build-test-ubuntu-plot_sync.yml delete mode 100644 .github/workflows/build-test-ubuntu-plotting.yml delete mode 100644 .github/workflows/build-test-ubuntu-pools.yml delete mode 100644 .github/workflows/build-test-ubuntu-simulation.yml delete mode 100644 .github/workflows/build-test-ubuntu-tools.yml delete mode 100644 .github/workflows/build-test-ubuntu-util.yml delete mode 100644 .github/workflows/build-test-ubuntu-wallet-cat_wallet.yml delete mode 100644 .github/workflows/build-test-ubuntu-wallet-did_wallet.yml delete mode 100644 .github/workflows/build-test-ubuntu-wallet-nft_wallet.yml delete mode 100644 .github/workflows/build-test-ubuntu-wallet-rl_wallet.yml delete mode 100644 .github/workflows/build-test-ubuntu-wallet-rpc.yml delete mode 100644 .github/workflows/build-test-ubuntu-wallet-simple_sync.yml delete mode 100644 .github/workflows/build-test-ubuntu-wallet-sync.yml delete mode 100644 .github/workflows/build-test-ubuntu-wallet.yml delete mode 100644 .github/workflows/build-test-ubuntu-weight_proof.yml delete mode 100644 .github/workflows/check_wheel_availability.yaml delete mode 100644 .github/workflows/codeql-analysis.yml delete mode 100644 .github/workflows/conflict-check.yml delete mode 100644 .github/workflows/mozilla-ca-cert.yml delete mode 100644 .github/workflows/pre-commit.yml delete mode 100644 .github/workflows/stale-issue.yml delete mode 100644 .github/workflows/start-release.yml delete mode 100644 .github/workflows/super-linter.yml delete mode 100644 .github/workflows/test-install-scripts.yml delete mode 100644 .github/workflows/trigger-docker-dev.yml delete mode 100644 .github/workflows/trigger-docker-main.yml delete mode 100644 .github/workflows/upload-pypi-source.yml delete mode 100644 CHANGELOG.md delete mode 160000 chia-blockchain-gui delete mode 100644 chia/cmds/plotnft.py delete mode 100644 chia/ssl/chia_ca.crt delete mode 100644 chia/ssl/chia_ca.key delete mode 100644 chia/util/default_root.py delete mode 100644 chia/util/service_groups.py delete mode 100644 chia/wallet/cat_wallet/cat_constants.py delete mode 100644 chia/wallet/util/json_clvm_utils.py create mode 160000 flax-blockchain-gui rename {chia => flax}/__init__.py (59%) rename {chia => flax}/clvm/__init__.py (100%) rename {chia => flax}/clvm/singleton.py (76%) rename {chia => flax}/clvm/spend_sim.py (92%) rename {chia => flax}/cmds/__init__.py (100%) rename {chia => flax}/cmds/cmds_util.py (57%) rename {chia => flax}/cmds/configure.py (95%) rename {chia => flax}/cmds/db.py (94%) rename {chia => flax}/cmds/db_upgrade_func.py (98%) rename {chia => flax}/cmds/db_validate_func.py (96%) rename {chia => flax}/cmds/farm.py (100%) rename {chia => flax}/cmds/farm_funcs.py (92%) rename chia/cmds/chia.py => flax/cmds/flax.py (75%) rename {chia => flax}/cmds/init.py (69%) rename {chia => flax}/cmds/init_funcs.py (86%) rename {chia => flax}/cmds/keys.py (96%) rename {chia => flax}/cmds/keys_funcs.py (97%) rename {chia => flax}/cmds/netspace.py (100%) rename {chia => flax}/cmds/netspace_funcs.py (91%) rename {chia => flax}/cmds/passphrase.py (100%) rename {chia => flax}/cmds/passphrase_funcs.py (95%) create mode 100644 flax/cmds/plotnft.py rename {chia => flax}/cmds/plotnft_funcs.py (92%) rename {chia => flax}/cmds/plots.py (91%) rename {chia => flax}/cmds/plotters.py (86%) rename {chia => flax}/cmds/rpc.py (96%) rename {chia => flax}/cmds/show.py (95%) rename {chia => flax}/cmds/start.py (90%) rename {chia => flax}/cmds/start_funcs.py (86%) rename {chia => flax}/cmds/stop.py (88%) rename {chia => flax}/cmds/units.py (78%) rename {chia => flax}/cmds/wallet.py (97%) rename {chia => flax}/cmds/wallet_funcs.py (93%) rename {chia => flax}/consensus/__init__.py (100%) rename {chia => flax}/consensus/block_body_validation.py (94%) rename {chia => flax}/consensus/block_creation.py (93%) rename {chia => flax}/consensus/block_header_validation.py (97%) rename {chia => flax}/consensus/block_record.py (88%) rename {chia => flax}/consensus/block_rewards.py (61%) rename {chia => flax}/consensus/block_root_validation.py (89%) rename {chia => flax}/consensus/blockchain.py (95%) rename {chia => flax}/consensus/blockchain_interface.py (85%) rename {chia => flax}/consensus/coinbase.py (81%) rename {chia => flax}/consensus/condition_costs.py (100%) rename {chia => flax}/consensus/constants.py (92%) rename {chia => flax}/consensus/cost_calculator.py (66%) rename {chia => flax}/consensus/default_constants.py (87%) rename {chia => flax}/consensus/deficit.py (93%) rename {chia => flax}/consensus/difficulty_adjustment.py (98%) rename {chia => flax}/consensus/find_fork_point.py (86%) rename {chia => flax}/consensus/full_block_to_block_record.py (87%) rename {chia => flax}/consensus/get_block_challenge.py (89%) rename {chia => flax}/consensus/make_sub_epoch_summary.py (92%) rename {chia => flax}/consensus/multiprocess_validation.py (92%) rename {chia => flax}/consensus/network_type.py (100%) rename {chia => flax}/consensus/pos_quality.py (95%) rename {chia => flax}/consensus/pot_iterations.py (90%) rename {chia => flax}/consensus/vdf_info_computation.py (94%) rename {chia => flax}/daemon/__init__.py (100%) rename {chia => flax}/daemon/client.py (97%) rename {chia => flax}/daemon/keychain_proxy.py (97%) rename {chia => flax}/daemon/keychain_server.py (98%) rename {chia => flax}/daemon/server.py (96%) rename {chia => flax}/daemon/windows_signal.py (100%) rename {chia => flax}/farmer/__init__.py (100%) rename {chia => flax}/farmer/farmer.py (94%) rename {chia => flax}/farmer/farmer_api.py (95%) rename {chia => flax}/full_node/__init__.py (100%) rename {chia => flax}/full_node/block_height_map.py (96%) rename {chia => flax}/full_node/block_store.py (97%) rename {chia => flax}/full_node/bundle_tools.py (93%) rename {chia => flax}/full_node/coin_store.py (98%) rename {chia => flax}/full_node/full_node.py (95%) rename {chia => flax}/full_node/full_node_api.py (96%) rename {chia => flax}/full_node/full_node_store.py (96%) rename {chia => flax}/full_node/generator.py (86%) rename {chia => flax}/full_node/hint_management.py (93%) rename {chia => flax}/full_node/hint_store.py (95%) rename {chia => flax}/full_node/lock_queue.py (100%) rename {chia => flax}/full_node/mempool.py (95%) rename {chia => flax}/full_node/mempool_check_conditions.py (77%) rename {chia => flax}/full_node/mempool_manager.py (94%) rename {chia => flax}/full_node/pending_tx_cache.py (90%) rename {chia => flax}/full_node/signage_point.py (68%) rename {chia => flax}/full_node/sync_store.py (98%) rename {chia => flax}/full_node/weight_proof.py (98%) rename {chia => flax}/harvester/__init__.py (100%) rename {chia => flax}/harvester/harvester.py (94%) rename {chia => flax}/harvester/harvester_api.py (94%) rename {chia => flax}/introducer/__init__.py (100%) rename {chia => flax}/introducer/introducer.py (93%) rename {chia => flax}/introducer/introducer_api.py (75%) rename {chia => flax}/plot_sync/__init__.py (100%) rename {chia => flax}/plot_sync/delta.py (97%) rename {chia => flax}/plot_sync/exceptions.py (91%) rename {chia => flax}/plot_sync/receiver.py (95%) rename {chia => flax}/plot_sync/sender.py (96%) rename {chia => flax}/plot_sync/util.py (100%) rename {chia => flax}/plotters/__init__.py (100%) rename {chia => flax}/plotters/bladebit.py (97%) rename {chia => flax}/plotters/chiapos.py (81%) rename {chia => flax}/plotters/install_plotter.py (85%) rename {chia => flax}/plotters/madmax.py (96%) rename {chia => flax}/plotters/plotters.py (94%) rename {chia => flax}/plotters/plotters_util.py (100%) rename {chia => flax}/plotting/__init__.py (100%) rename {chia => flax}/plotting/cache.py (94%) rename {chia => flax}/plotting/check_plots.py (96%) rename {chia => flax}/plotting/create_plots.py (94%) rename {chia => flax}/plotting/manager.py (98%) rename {chia => flax}/plotting/util.py (98%) rename {chia => flax}/pools/__init__.py (100%) rename {chia => flax}/pools/pool_config.py (94%) rename {chia => flax}/pools/pool_puzzles.py (96%) rename {chia => flax}/pools/pool_wallet.py (97%) rename {chia => flax}/pools/pool_wallet_info.py (91%) rename {chia => flax}/protocols/__init__.py (100%) rename {chia => flax}/protocols/farmer_protocol.py (83%) rename {chia => flax}/protocols/full_node_protocol.py (87%) rename {chia => flax}/protocols/harvester_protocol.py (94%) rename {chia => flax}/protocols/introducer_protocol.py (80%) rename {chia => flax}/protocols/pool_protocol.py (94%) rename {chia => flax}/protocols/protocol_message_types.py (100%) rename {chia => flax}/protocols/protocol_state_machine.py (95%) rename {chia => flax}/protocols/protocol_timing.py (100%) rename {chia => flax}/protocols/shared_protocol.py (80%) rename {chia => flax}/protocols/timelord_protocol.py (84%) rename {chia => flax}/protocols/wallet_protocol.py (92%) rename {chia => flax}/py.typed (100%) rename {chia => flax}/pyinstaller.spec (74%) rename {chia => flax}/rpc/__init__.py (100%) rename {chia => flax}/rpc/crawler_rpc_api.py (94%) rename {chia => flax}/rpc/farmer_rpc_api.py (96%) rename {chia => flax}/rpc/farmer_rpc_client.py (91%) rename {chia => flax}/rpc/full_node_rpc_api.py (97%) rename {chia => flax}/rpc/full_node_rpc_client.py (93%) rename {chia => flax}/rpc/harvester_rpc_api.py (94%) rename {chia => flax}/rpc/harvester_rpc_client.py (89%) rename {chia => flax}/rpc/rpc_client.py (88%) rename {chia => flax}/rpc/rpc_server.py (96%) rename {chia => flax}/rpc/timelord_rpc_api.py (80%) rename {chia => flax}/rpc/util.py (94%) rename {chia => flax}/rpc/wallet_rpc_api.py (97%) rename {chia => flax}/rpc/wallet_rpc_client.py (97%) rename {chia => flax}/seeder/__init__.py (100%) rename {chia => flax}/seeder/crawl_store.py (99%) rename {chia => flax}/seeder/crawler.py (95%) rename {chia => flax}/seeder/crawler_api.py (87%) rename {chia => flax}/seeder/dns_server.py (98%) rename {chia => flax}/seeder/peer_record.py (98%) rename {chia => flax}/seeder/start_crawler.py (77%) rename {chia => flax}/server/__init__.py (100%) rename {chia => flax}/server/address_manager.py (99%) rename {chia => flax}/server/address_manager_sqlite_store.py (95%) rename {chia => flax}/server/address_manager_store.py (97%) rename {chia => flax}/server/connection_utils.py (79%) rename {chia => flax}/server/introducer_peers.py (96%) rename {chia => flax}/server/node_discovery.py (97%) rename {chia => flax}/server/outbound_message.py (86%) rename {chia => flax}/server/peer_store_resolver.py (100%) rename {chia => flax}/server/rate_limits.py (99%) rename {chia => flax}/server/reconnect_task.py (85%) rename {chia => flax}/server/server.py (94%) rename {chia => flax}/server/ssl_context.py (80%) rename {chia => flax}/server/start_farmer.py (76%) rename {chia => flax}/server/start_full_node.py (77%) rename {chia => flax}/server/start_harvester.py (73%) rename {chia => flax}/server/start_introducer.py (75%) rename {chia => flax}/server/start_service.py (92%) rename {chia => flax}/server/start_timelord.py (74%) rename {chia => flax}/server/start_wallet.py (82%) rename {chia => flax}/server/upnp.py (94%) rename {chia => flax}/server/ws_connection.py (95%) rename {chia => flax}/simulator/SimulatorFullNodeRpcApi.py (77%) rename {chia => flax}/simulator/__init__.py (100%) rename {chia => flax}/simulator/full_node_simulator.py (93%) rename {chia => flax}/simulator/simulator_constants.py (88%) rename {chia => flax}/simulator/simulator_protocol.py (64%) rename {chia => flax}/simulator/start_simulator.py (84%) rename {chia => flax}/ssl/__init__.py (100%) rename {chia => flax}/ssl/create_ssl.py (86%) rename {chia => flax}/ssl/dst_root_ca.pem (100%) create mode 100644 flax/ssl/flax_ca.crt create mode 100644 flax/ssl/flax_ca.key rename {chia => flax}/timelord/__init__.py (100%) rename {chia => flax}/timelord/iters_from_block.py (85%) rename {chia => flax}/timelord/timelord.py (97%) rename {chia => flax}/timelord/timelord_api.py (95%) rename {chia => flax}/timelord/timelord_launcher.py (92%) rename {chia => flax}/timelord/timelord_state.py (95%) rename {chia => flax}/timelord/types.py (100%) rename {chia => flax}/types/__init__.py (100%) rename {chia => flax}/types/announcement.py (85%) rename {chia => flax}/types/block_protocol.py (69%) rename {chia => flax}/types/blockchain_format/__init__.py (100%) rename {chia => flax}/types/blockchain_format/classgroup.py (84%) rename {chia => flax}/types/blockchain_format/coin.py (90%) rename {chia => flax}/types/blockchain_format/foliage.py (88%) rename {chia => flax}/types/blockchain_format/pool_target.py (56%) rename {chia => flax}/types/blockchain_format/program.py (97%) rename {chia => flax}/types/blockchain_format/proof_of_space.py (94%) rename {chia => flax}/types/blockchain_format/reward_chain_block.py (85%) rename {chia => flax}/types/blockchain_format/sized_bytes.py (87%) rename {chia => flax}/types/blockchain_format/slots.py (84%) rename {chia => flax}/types/blockchain_format/sub_epoch_summary.py (75%) rename {chia => flax}/types/blockchain_format/tree_hash.py (94%) rename {chia => flax}/types/blockchain_format/vdf.py (89%) rename {chia => flax}/types/coin_record.py (78%) rename {chia => flax}/types/coin_solution.py (100%) rename {chia => flax}/types/coin_spend.py (80%) rename {chia => flax}/types/condition_opcodes.py (96%) rename {chia => flax}/types/condition_with_args.py (75%) rename {chia => flax}/types/end_of_slot_bundle.py (79%) rename {chia => flax}/types/full_block.py (85%) rename {chia => flax}/types/generator_types.py (82%) rename {chia => flax}/types/header_block.py (86%) rename {chia => flax}/types/mempool_inclusion_status.py (100%) rename {chia => flax}/types/mempool_item.py (62%) rename {chia => flax}/types/mempool_submission_status.py (84%) rename {chia => flax}/types/peer_info.py (94%) rename {chia => flax}/types/spend_bundle.py (92%) rename {chia => flax}/types/spend_bundle_conditions.py (81%) rename {chia => flax}/types/transaction_queue_entry.py (76%) rename {chia => flax}/types/unfinished_block.py (78%) rename {chia => flax}/types/unfinished_header_block.py (78%) rename {chia => flax}/types/weight_proof.py (85%) rename {chia => flax}/util/__init__.py (100%) rename {chia => flax}/util/api_decorators.py (97%) rename {chia => flax}/util/bech32m.py (98%) rename {chia => flax}/util/block_cache.py (89%) rename {chia => flax}/util/byte_types.py (100%) rename {chia => flax}/util/cached_bls.py (94%) rename {chia => flax}/util/chain_utils.py (78%) rename {chia => flax}/util/check_fork_next_block.py (91%) rename {chia => flax}/util/chunks.py (100%) rename {chia => flax}/util/condition_tools.py (88%) rename {chia => flax}/util/config.py (98%) rename {chia => flax}/util/create_alert_file.py (96%) rename {chia => flax}/util/db_synchronous.py (100%) rename {chia => flax}/util/db_version.py (100%) rename {chia => flax}/util/db_wrapper.py (100%) create mode 100644 flax/util/default_root.py rename {chia => flax}/util/dump_keyring.py (94%) mode change 100755 => 100644 rename {chia => flax}/util/english.txt (100%) rename {chia => flax}/util/errors.py (100%) rename {chia => flax}/util/file_keyring.py (99%) rename {chia => flax}/util/files.py (100%) rename chia/util/chia_logging.py => flax/util/flax_logging.py (98%) rename {chia => flax}/util/full_block_utils.py (99%) rename {chia => flax}/util/generator_tools.py (87%) rename {chia => flax}/util/hash.py (71%) rename {chia => flax}/util/initial-config.yaml (74%) rename {chia => flax}/util/inline_executor.py (100%) rename {chia => flax}/util/ints.py (94%) rename {chia => flax}/util/json_util.py (95%) rename {chia => flax}/util/keychain.py (98%) rename {chia => flax}/util/keyring_wrapper.py (95%) rename {chia => flax}/util/lock.py (95%) rename {chia => flax}/util/log_exceptions.py (100%) rename {chia => flax}/util/lru_cache.py (100%) rename {chia => flax}/util/make_test_constants.py (58%) rename {chia => flax}/util/merkle_set.py (99%) rename {chia => flax}/util/misc.py (98%) rename {chia => flax}/util/network.py (84%) rename {chia => flax}/util/paginator.py (100%) rename {chia => flax}/util/partial_func.py (100%) rename {chia => flax}/util/path.py (100%) rename {chia => flax}/util/permissions.py (100%) rename {chia => flax}/util/pip_import.py (100%) rename {chia => flax}/util/prev_transaction_block.py (77%) rename {chia => flax}/util/profiler.py (93%) rename {chia => flax}/util/recursive_replace.py (100%) rename {chia => flax}/util/safe_cancel_task.py (100%) create mode 100644 flax/util/service_groups.py rename {chia => flax}/util/setproctitle.py (100%) rename {chia => flax}/util/significant_bits.py (100%) rename {chia => flax}/util/ssl_check.py (95%) rename {chia => flax}/util/streamable.py (99%) rename {chia => flax}/util/struct_stream.py (100%) rename {chia => flax}/util/validate_alert.py (95%) rename {chia => flax}/util/vdf_prover.py (71%) rename {chia => flax}/util/ws_message.py (96%) rename {chia => flax}/wallet/__init__.py (100%) rename {chia => flax}/wallet/block_record.py (83%) rename {chia => flax}/wallet/cat_wallet/__init__.py (100%) create mode 100644 flax/wallet/cat_wallet/cat_constants.py rename {chia => flax}/wallet/cat_wallet/cat_info.py (75%) rename {chia => flax}/wallet/cat_wallet/cat_outer_puzzle.py (91%) rename {chia => flax}/wallet/cat_wallet/cat_utils.py (90%) rename {chia => flax}/wallet/cat_wallet/cat_wallet.py (88%) rename {chia => flax}/wallet/cat_wallet/lineage_store.py (95%) rename {chia => flax}/wallet/coin_selection.py (94%) rename {chia => flax}/wallet/derivation_record.py (73%) rename {chia => flax}/wallet/derive_keys.py (95%) rename {chia => flax}/wallet/did_wallet/__init__.py (100%) rename {chia => flax}/wallet/did_wallet/did_info.py (67%) rename {chia => flax}/wallet/did_wallet/did_wallet.py (96%) rename {chia => flax}/wallet/did_wallet/did_wallet_puzzles.py (93%) rename chia/wallet/chialisp.py => flax/wallet/flaxlisp.py (100%) rename {chia => flax}/wallet/key_val_store.py (98%) rename {chia => flax}/wallet/lineage_proof.py (78%) rename {chia => flax}/wallet/nft_wallet/__init__.py (100%) rename {chia => flax}/wallet/nft_wallet/metadata_outer_puzzle.py (92%) rename {chia => flax}/wallet/nft_wallet/nft_info.py (84%) rename {chia => flax}/wallet/nft_wallet/nft_puzzles.py (95%) rename {chia => flax}/wallet/nft_wallet/nft_wallet.py (94%) rename {chia => flax}/wallet/nft_wallet/ownership_outer_puzzle.py (94%) rename {chia => flax}/wallet/nft_wallet/singleton_outer_puzzle.py (89%) rename {chia => flax}/wallet/nft_wallet/transfer_program_puzzle.py (89%) rename {chia => flax}/wallet/nft_wallet/uncurry_nft.py (96%) rename {chia => flax}/wallet/outer_puzzles.py (87%) rename {chia => flax}/wallet/payment.py (85%) rename {chia => flax}/wallet/puzzle_drivers.py (98%) rename {chia => flax}/wallet/puzzles/__init__.py (100%) rename {chia => flax}/wallet/puzzles/block_program_zero.clvm (100%) rename {chia => flax}/wallet/puzzles/block_program_zero.clvm.hex (100%) rename {chia => flax}/wallet/puzzles/block_program_zero.clvm.hex.sha256tree (100%) rename {chia => flax}/wallet/puzzles/calculate_synthetic_public_key.clvm (100%) rename {chia => flax}/wallet/puzzles/calculate_synthetic_public_key.clvm.hex (100%) rename {chia => flax}/wallet/puzzles/calculate_synthetic_public_key.clvm.hex.sha256tree (100%) rename {chia => flax}/wallet/puzzles/cat.clvm (100%) rename {chia => flax}/wallet/puzzles/cat.clvm.hex (100%) rename {chia => flax}/wallet/puzzles/cat.clvm.hex.sha256tree (100%) rename {chia => flax}/wallet/puzzles/cat_loader.py (74%) rename {chia => flax}/wallet/puzzles/cat_truths.clib (100%) rename {chia => flax}/wallet/puzzles/condition_codes.clvm (96%) rename {chia => flax}/wallet/puzzles/condition_codes.clvm.hex (100%) rename {chia => flax}/wallet/puzzles/counter.clvm.hex (100%) rename {chia => flax}/wallet/puzzles/create-lock-puzzlehash.clvm (100%) rename {chia => flax}/wallet/puzzles/create-lock-puzzlehash.clvm.hex (100%) rename {chia => flax}/wallet/puzzles/create-lock-puzzlehash.clvm.hex.sha256tree (100%) rename {chia => flax}/wallet/puzzles/curry-and-treehash.clinc (100%) rename {chia => flax}/wallet/puzzles/decompress_coin_spend_entry.clvm (100%) rename {chia => flax}/wallet/puzzles/decompress_coin_spend_entry.clvm.hex (100%) rename {chia => flax}/wallet/puzzles/decompress_coin_spend_entry.clvm.hex.sha256tree (100%) rename {chia => flax}/wallet/puzzles/decompress_coin_spend_entry_with_prefix.clvm (100%) rename {chia => flax}/wallet/puzzles/decompress_coin_spend_entry_with_prefix.clvm.hex (100%) rename {chia => flax}/wallet/puzzles/decompress_coin_spend_entry_with_prefix.clvm.hex.sha256tree (100%) rename {chia => flax}/wallet/puzzles/decompress_puzzle.clvm (100%) rename {chia => flax}/wallet/puzzles/decompress_puzzle.clvm.hex (100%) rename {chia => flax}/wallet/puzzles/decompress_puzzle.clvm.hex.sha256tree (100%) rename {chia => flax}/wallet/puzzles/delegated_tail.clvm (100%) rename {chia => flax}/wallet/puzzles/delegated_tail.clvm.hex (100%) rename {chia => flax}/wallet/puzzles/delegated_tail.clvm.hex.sha256tree (100%) rename {chia => flax}/wallet/puzzles/did_innerpuz.clvm (100%) rename {chia => flax}/wallet/puzzles/did_innerpuz.clvm.hex (100%) rename {chia => flax}/wallet/puzzles/did_innerpuz.clvm.hex.sha256tree (100%) rename {chia => flax}/wallet/puzzles/everything_with_signature.clvm (100%) rename {chia => flax}/wallet/puzzles/everything_with_signature.clvm.hex (100%) rename {chia => flax}/wallet/puzzles/everything_with_signature.clvm.hex.sha256tree (100%) rename chia/wallet/puzzles/chialisp_deserialisation.clvm => flax/wallet/puzzles/flaxlisp_deserialisation.clvm (100%) rename chia/wallet/puzzles/chialisp_deserialisation.clvm.hex => flax/wallet/puzzles/flaxlisp_deserialisation.clvm.hex (100%) rename chia/wallet/puzzles/chialisp_deserialisation.clvm.hex.sha256tree => flax/wallet/puzzles/flaxlisp_deserialisation.clvm.hex.sha256tree (100%) rename {chia => flax}/wallet/puzzles/generator_for_single_coin.clvm (96%) rename {chia => flax}/wallet/puzzles/generator_for_single_coin.clvm.hex (100%) rename {chia => flax}/wallet/puzzles/generator_for_single_coin.clvm.hex.sha256tree (100%) rename {chia => flax}/wallet/puzzles/generator_loader.py (65%) rename {chia => flax}/wallet/puzzles/genesis_by_coin_id.clvm (100%) rename {chia => flax}/wallet/puzzles/genesis_by_coin_id.clvm.hex (100%) rename {chia => flax}/wallet/puzzles/genesis_by_coin_id.clvm.hex.sha256tree (100%) rename {chia => flax}/wallet/puzzles/genesis_by_puzzle_hash.clvm (100%) rename {chia => flax}/wallet/puzzles/genesis_by_puzzle_hash.clvm.hex (100%) rename {chia => flax}/wallet/puzzles/genesis_by_puzzle_hash.clvm.hex.sha256tree (100%) rename {chia => flax}/wallet/puzzles/index_lock.clvm.hex (100%) rename {chia => flax}/wallet/puzzles/json.clib (100%) rename {chia => flax}/wallet/puzzles/load_clvm.py (97%) rename {chia => flax}/wallet/puzzles/lock.inner.puzzle.clvm (100%) rename {chia => flax}/wallet/puzzles/lock.inner.puzzle.clvm.hex (100%) rename {chia => flax}/wallet/puzzles/lock.inner.puzzle.clvm.hex.sha256tree (100%) rename {chia => flax}/wallet/puzzles/nft_metadata_updater.clvm.hex.sha256tree (100%) rename {chia => flax}/wallet/puzzles/nft_metadata_updater_default.clvm (100%) rename {chia => flax}/wallet/puzzles/nft_metadata_updater_default.clvm.hex (100%) rename {chia => flax}/wallet/puzzles/nft_metadata_updater_default.clvm.hex.sha256tree (100%) rename {chia => flax}/wallet/puzzles/nft_metadata_updater_updateable.clvm (100%) rename {chia => flax}/wallet/puzzles/nft_metadata_updater_updateable.clvm.hex (100%) rename {chia => flax}/wallet/puzzles/nft_metadata_updater_updateable.clvm.hex.sha256tree (100%) rename {chia => flax}/wallet/puzzles/nft_ownership_layer.clvm (100%) rename {chia => flax}/wallet/puzzles/nft_ownership_layer.clvm.hex (100%) rename {chia => flax}/wallet/puzzles/nft_ownership_layer.clvm.hex.sha256tree (100%) rename {chia => flax}/wallet/puzzles/nft_ownership_transfer_program_one_way_claim_with_royalties.clvm (99%) rename {chia => flax}/wallet/puzzles/nft_ownership_transfer_program_one_way_claim_with_royalties.clvm.hex (100%) rename {chia => flax}/wallet/puzzles/nft_ownership_transfer_program_one_way_claim_with_royalties.clvm.hex.sha256tree (100%) rename {chia => flax}/wallet/puzzles/nft_state_layer.clvm (100%) rename {chia => flax}/wallet/puzzles/nft_state_layer.clvm.hex (100%) rename {chia => flax}/wallet/puzzles/nft_state_layer.clvm.hex.sha256tree (100%) rename {chia => flax}/wallet/puzzles/p2_conditions.clvm (100%) rename {chia => flax}/wallet/puzzles/p2_conditions.clvm.hex (100%) rename {chia => flax}/wallet/puzzles/p2_conditions.clvm.hex.sha256tree (100%) rename {chia => flax}/wallet/puzzles/p2_conditions.py (91%) rename {chia => flax}/wallet/puzzles/p2_delegated_conditions.clvm (100%) rename {chia => flax}/wallet/puzzles/p2_delegated_conditions.clvm.hex (100%) rename {chia => flax}/wallet/puzzles/p2_delegated_conditions.clvm.hex.sha256tree (100%) rename {chia => flax}/wallet/puzzles/p2_delegated_conditions.py (87%) rename {chia => flax}/wallet/puzzles/p2_delegated_puzzle.clvm (100%) rename {chia => flax}/wallet/puzzles/p2_delegated_puzzle.clvm.hex (100%) rename {chia => flax}/wallet/puzzles/p2_delegated_puzzle.clvm.hex.sha256tree (100%) rename {chia => flax}/wallet/puzzles/p2_delegated_puzzle.py (94%) rename {chia => flax}/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.clvm (100%) rename {chia => flax}/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.clvm.hex (100%) rename {chia => flax}/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.clvm.hex.sha256tree (100%) rename {chia => flax}/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.py (94%) rename {chia => flax}/wallet/puzzles/p2_m_of_n_delegate_direct.clvm (100%) rename {chia => flax}/wallet/puzzles/p2_m_of_n_delegate_direct.clvm.hex (100%) rename {chia => flax}/wallet/puzzles/p2_m_of_n_delegate_direct.clvm.hex.sha256tree (100%) rename {chia => flax}/wallet/puzzles/p2_m_of_n_delegate_direct.py (90%) rename {chia => flax}/wallet/puzzles/p2_puzzle_hash.clvm (100%) rename {chia => flax}/wallet/puzzles/p2_puzzle_hash.clvm.hex (100%) rename {chia => flax}/wallet/puzzles/p2_puzzle_hash.clvm.hex.sha256tree (100%) rename {chia => flax}/wallet/puzzles/p2_puzzle_hash.py (84%) rename {chia => flax}/wallet/puzzles/p2_singleton.clvm (100%) rename {chia => flax}/wallet/puzzles/p2_singleton.clvm.hex (100%) rename {chia => flax}/wallet/puzzles/p2_singleton.clvm.hex.sha256tree (100%) rename {chia => flax}/wallet/puzzles/p2_singleton_or_delayed_puzhash.clvm (100%) rename {chia => flax}/wallet/puzzles/p2_singleton_or_delayed_puzhash.clvm.hex (100%) rename {chia => flax}/wallet/puzzles/p2_singleton_or_delayed_puzhash.clvm.hex.sha256tree (100%) rename {chia => flax}/wallet/puzzles/pool_member_innerpuz.clvm (100%) rename {chia => flax}/wallet/puzzles/pool_member_innerpuz.clvm.hex (100%) rename {chia => flax}/wallet/puzzles/pool_member_innerpuz.clvm.hex.sha256tree (100%) rename {chia => flax}/wallet/puzzles/pool_waitingroom_innerpuz.clvm (100%) rename {chia => flax}/wallet/puzzles/pool_waitingroom_innerpuz.clvm.hex (100%) rename {chia => flax}/wallet/puzzles/pool_waitingroom_innerpuz.clvm.hex.sha256tree (100%) rename {chia => flax}/wallet/puzzles/prefarm/__init__.py (100%) rename {chia => flax}/wallet/puzzles/prefarm/make_prefarm_ph.py (66%) rename {chia => flax}/wallet/puzzles/prefarm/spend_prefarm.py (80%) rename {chia => flax}/wallet/puzzles/puzzle_utils.py (97%) rename {chia => flax}/wallet/puzzles/recompile-all.sh (100%) mode change 100755 => 100644 rename {chia => flax}/wallet/puzzles/rl.clvm (100%) rename {chia => flax}/wallet/puzzles/rl.clvm.hex (100%) rename {chia => flax}/wallet/puzzles/rl.clvm.hex.sha256tree (100%) rename {chia => flax}/wallet/puzzles/rl_aggregation.clvm (100%) rename {chia => flax}/wallet/puzzles/rl_aggregation.clvm.hex (100%) rename {chia => flax}/wallet/puzzles/rl_aggregation.clvm.hex.sha256tree (100%) rename {chia => flax}/wallet/puzzles/rom_bootstrap_generator.clvm (96%) rename {chia => flax}/wallet/puzzles/rom_bootstrap_generator.clvm.hex (100%) rename {chia => flax}/wallet/puzzles/rom_bootstrap_generator.clvm.hex.sha256tree (100%) rename {chia => flax}/wallet/puzzles/rom_bootstrap_generator.py (71%) rename {chia => flax}/wallet/puzzles/settlement_payments.clvm (100%) rename {chia => flax}/wallet/puzzles/settlement_payments.clvm.hex (100%) rename {chia => flax}/wallet/puzzles/settlement_payments.clvm.hex.sha256tree (100%) rename {chia => flax}/wallet/puzzles/sha256tree.clib (100%) rename {chia => flax}/wallet/puzzles/sha256tree_module.clvm (100%) rename {chia => flax}/wallet/puzzles/sha256tree_module.clvm.hex (100%) rename {chia => flax}/wallet/puzzles/sha256tree_module.clvm.hex.sha256tree (100%) rename {chia => flax}/wallet/puzzles/singleton_launcher.clvm (100%) rename {chia => flax}/wallet/puzzles/singleton_launcher.clvm.hex (100%) rename {chia => flax}/wallet/puzzles/singleton_launcher.clvm.hex.sha256tree (100%) rename {chia => flax}/wallet/puzzles/singleton_top_layer.clvm (100%) rename {chia => flax}/wallet/puzzles/singleton_top_layer.clvm.hex (100%) rename {chia => flax}/wallet/puzzles/singleton_top_layer.clvm.hex.sha256tree (100%) rename {chia => flax}/wallet/puzzles/singleton_top_layer.py (96%) rename {chia => flax}/wallet/puzzles/singleton_top_layer_v1_1.clvm (100%) rename {chia => flax}/wallet/puzzles/singleton_top_layer_v1_1.clvm.hex (100%) rename {chia => flax}/wallet/puzzles/singleton_top_layer_v1_1.clvm.hex.sha256tree (100%) rename {chia => flax}/wallet/puzzles/singleton_top_layer_v1_1.py (96%) rename {chia => flax}/wallet/puzzles/singleton_truths.clib (100%) rename {chia => flax}/wallet/puzzles/tails.py (92%) rename {chia => flax}/wallet/puzzles/test_generator_deserialize.clvm (100%) rename {chia => flax}/wallet/puzzles/test_generator_deserialize.clvm.hex (100%) rename {chia => flax}/wallet/puzzles/test_generator_deserialize.clvm.hex.sha256tree (100%) rename {chia => flax}/wallet/puzzles/test_multiple_generator_input_arguments.clvm (100%) rename {chia => flax}/wallet/puzzles/test_multiple_generator_input_arguments.clvm.hex (100%) rename {chia => flax}/wallet/puzzles/test_multiple_generator_input_arguments.clvm.hex.sha256tree (100%) rename {chia => flax}/wallet/puzzles/utility_macros.clib (100%) rename {chia => flax}/wallet/rl_wallet/__init__.py (100%) rename {chia => flax}/wallet/rl_wallet/rl_wallet.py (96%) rename {chia => flax}/wallet/rl_wallet/rl_wallet_puzzles.py (91%) rename {chia => flax}/wallet/secret_key_store.py (100%) rename {chia => flax}/wallet/settings/__init__.py (100%) rename {chia => flax}/wallet/settings/default_settings.py (70%) rename {chia => flax}/wallet/settings/settings_objects.py (90%) rename {chia => flax}/wallet/settings/user_settings.py (84%) rename {chia => flax}/wallet/sign_coin_spends.py (94%) rename {chia => flax}/wallet/trade_manager.py (95%) rename {chia => flax}/wallet/trade_record.py (83%) rename {chia => flax}/wallet/trading/__init__.py (100%) rename {chia => flax}/wallet/trading/offer.py (96%) rename {chia => flax}/wallet/trading/trade_status.py (100%) rename {chia => flax}/wallet/trading/trade_store.py (97%) rename {chia => flax}/wallet/transaction_record.py (87%) rename {chia => flax}/wallet/transaction_sorting.py (100%) rename {chia => flax}/wallet/util/__init__.py (100%) rename {chia => flax}/wallet/util/compute_hints.py (71%) rename {chia => flax}/wallet/util/compute_memos.py (81%) rename {chia => flax}/wallet/util/debug_spend_bundle.py (95%) create mode 100644 flax/wallet/util/json_clvm_utils.py rename {chia => flax}/wallet/util/new_peak_queue.py (91%) rename {chia => flax}/wallet/util/peer_request_cache.py (94%) rename {chia => flax}/wallet/util/puzzle_compression.py (91%) rename {chia => flax}/wallet/util/transaction_type.py (100%) rename {chia => flax}/wallet/util/wallet_sync_utils.py (93%) rename {chia => flax}/wallet/util/wallet_types.py (82%) rename {chia => flax}/wallet/wallet.py (93%) rename {chia => flax}/wallet/wallet_action.py (92%) rename {chia => flax}/wallet/wallet_action_store.py (95%) rename {chia => flax}/wallet/wallet_blockchain.py (93%) rename {chia => flax}/wallet/wallet_coin_record.py (68%) rename {chia => flax}/wallet/wallet_coin_store.py (97%) rename {chia => flax}/wallet/wallet_info.py (90%) rename {chia => flax}/wallet/wallet_interested_store.py (97%) rename {chia => flax}/wallet/wallet_nft_store.py (93%) rename {chia => flax}/wallet/wallet_node.py (95%) rename {chia => flax}/wallet/wallet_node_api.py (88%) rename {chia => flax}/wallet/wallet_pool_store.py (97%) rename {chia => flax}/wallet/wallet_puzzle_store.py (98%) rename {chia => flax}/wallet/wallet_state_manager.py (94%) rename {chia => flax}/wallet/wallet_sync_store.py (95%) rename {chia => flax}/wallet/wallet_transaction_store.py (98%) rename {chia => flax}/wallet/wallet_user_store.py (95%) rename {chia => flax}/wallet/wallet_weight_proof_handler.py (94%) mode change 100644 => 100755 install-timelord.sh mode change 100755 => 100644 run-py-tests.sh mode change 100755 => 100644 tests/build-init-files.py mode change 100755 => 100644 tests/build-workflows.py mode change 100755 => 100644 tests/check_pytest_monitor_output.py mode change 100755 => 100644 tests/check_sql_statements.py rename tests/clvm/{test_chialisp_deserialization.py => test_flaxlisp_deserialization.py} (93%) rename tests/{chia-start-sim => flax-start-sim} (65%) mode change 100755 => 100644 rename tests/wallet/{test_chialisp.py => test_flaxlisp.py} (97%) mode change 100755 => 100644 tools/analyze-chain.py mode change 100755 => 100644 tools/run_benchmark.sh mode change 100755 => 100644 tools/test_full_sync.py diff --git a/.coveragerc b/.coveragerc index 574fbb4b7..169e31746 100644 --- a/.coveragerc +++ b/.coveragerc @@ -2,7 +2,7 @@ branch=True relative_files=True source= - chia + flax tests concurrency=multiprocessing parallel=True diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 000000000..ecc1bbd50 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,34 @@ +--- +name: Bug report +about: Create a report to help us improve +title: "[BUG]" +labels: bug +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. (If what you are experiencing is NOT a bug but instead a support issue, please open a Discussion instead!) + +**To Reproduce** +Steps to reproduce the behavior: + +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** + +- OS: [e.g. Linux] +- OS Version/Flavor: [e.g. CentOS 7.2] +- CPU: [e.g. Intel Xeon 8175M] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml deleted file mode 100644 index 72d803bc0..000000000 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ /dev/null @@ -1,52 +0,0 @@ -name: Bug Report -description: File a bug report -title: "[Bug] " -labels: ["bug"] -#assignees: -body: - - type: markdown - attributes: - value: | - Please fill out a clear and concise description of what the bug is. (If what you are experiencing is NOT a bug but instead a support issue, please open a Discussion instead!) - - type: textarea - id: what-happened - attributes: - label: What happened? - description: A clear and concise description of what happened, how to reproduce it, and what you expected to happen. - validations: - required: true - - type: input - id: version - attributes: - label: Version - description: What version of Chia are you running? - validations: - required: true - - type: dropdown - id: platform - attributes: - label: What platform are you using? - multiple: false - options: - - Windows - - macOS - - Linux - - Pi4 - validations: - required: true - - type: dropdown - id: ui - attributes: - label: What ui mode are you using? - multiple: false - options: - - GUI - - CLI - validations: - required: true - - type: textarea - id: logs - attributes: - label: Relevant log output - description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks. - render: shell 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/linters/.flake8 b/.github/linters/.flake8 new file mode 100644 index 000000000..ea38e9cb9 --- /dev/null +++ b/.github/linters/.flake8 @@ -0,0 +1,4 @@ +[flake8] +max-line-length = 120 +exclude = ./typings/**/* +ignore = E203,W503 diff --git a/.github/linters/.isort.cfg b/.github/linters/.isort.cfg new file mode 100644 index 000000000..d21b9f236 --- /dev/null +++ b/.github/linters/.isort.cfg @@ -0,0 +1,20 @@ +[settings] +profile= + +; vertical hanging indent mode also used in black configuration +multi_line_output = 3 + +; necessary because black expect the trailing comma +include_trailing_comma = true + +; black compatibility +force_grid_wrap = 0 + +; black compatibility +use_parentheses = True + +; black compatibility +ensure_newline_before_comments = True + +; we chose 120 as line length +line_length = 120 diff --git a/.github/linters/.markdown-lint.yml b/.github/linters/.markdown-lint.yml new file mode 100644 index 000000000..54a2067a9 --- /dev/null +++ b/.github/linters/.markdown-lint.yml @@ -0,0 +1,38 @@ +--- +########################### +########################### +## Markdown Linter rules ## +########################### +########################### + +# Linter rules doc: +# - https://github.com/DavidAnson/markdownlint +# +# Note: +# To comment out a single error: +# +# any violations you want +# +# + +############### +# Rules by id # +############### +MD004: false # Unordered list style +MD007: + indent: 2 # Unordered list indentation +MD013: + line_length: 808 # Line length +MD024: + allow_different_nesting: true +MD026: + punctuation: ".,;:!。,;:" # List of not allowed +MD029: false # Ordered list item prefix +MD033: false # Allow inline HTML +MD036: false # Emphasis used instead of a heading +MD041: false # Allow file to start without h1 + +################# +# Rules by tags # +################# +blank_lines: false # Error on blank lines diff --git a/.github/linters/.python-black b/.github/linters/.python-black new file mode 100644 index 000000000..aa709bfe0 --- /dev/null +++ b/.github/linters/.python-black @@ -0,0 +1,2 @@ +[tool.black] +line_length = 120 diff --git a/.github/linters/.python-lint b/.github/linters/.python-lint new file mode 100644 index 000000000..0e6ea29a8 --- /dev/null +++ b/.github/linters/.python-lint @@ -0,0 +1,564 @@ +[MASTER] +errors-only= + +# A comma-separated list of package or module names from where C extensions may +# be loaded. Extensions are loading into the active Python interpreter and may +# run arbitrary code +extension-pkg-whitelist= + +# Add files or directories to the blacklist. They should be base names, not +# paths. +ignore=CVS + +# Add files or directories matching the regex patterns to the blacklist. The +# regex matches against base names, not paths. +ignore-patterns= + +# Python code to execute, usually for sys.path manipulation such as +# pygtk.require(). +#init-hook= + +# Use multiple processes to speed up Pylint. +jobs=1 + +# List of plugins (as comma separated values of python modules names) to load, +# usually to register additional checkers. +load-plugins= + +# Pickle collected data for later comparisons. +persistent=yes + +# Specify a configuration file. +#rcfile= + +# When enabled, pylint would attempt to guess common misconfiguration and emit +# user-friendly hints instead of false-positive error messages +suggestion-mode=yes + +# Allow loading of arbitrary C extensions. Extensions are imported into the +# active Python interpreter and may run arbitrary code. +unsafe-load-any-extension=no + + +[MESSAGES CONTROL] + +# Only show warnings with the listed confidence levels. Leave empty to show +# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED +confidence= + +# Disable the message, report, category or checker with the given id(s). You +# can either give multiple identifiers separated by comma (,) or put this +# option multiple times (only on the command line, not in the configuration +# file where it should appear only once).You can also use "--disable=all" to +# disable everything first and then reenable specific checks. For example, if +# you want to run only the similarities checker, you can use "--disable=all +# --enable=similarities". If you want to run only the classes checker, but have +# no Warning level messages displayed, use"--disable=all --enable=classes +# --disable=W" +disable=print-statement, + parameter-unpacking, + unpacking-in-except, + old-raise-syntax, + backtick, + long-suffix, + old-ne-operator, + old-octal-literal, + import-star-module-level, + non-ascii-bytes-literal, + raw-checker-failed, + bad-inline-option, + locally-disabled, + locally-enabled, + file-ignored, + suppressed-message, + useless-suppression, + deprecated-pragma, + apply-builtin, + basestring-builtin, + buffer-builtin, + cmp-builtin, + coerce-builtin, + execfile-builtin, + file-builtin, + long-builtin, + raw_input-builtin, + reduce-builtin, + standarderror-builtin, + unicode-builtin, + xrange-builtin, + coerce-method, + delslice-method, + getslice-method, + setslice-method, + no-absolute-import, + old-division, + dict-iter-method, + dict-view-method, + next-method-called, + metaclass-assignment, + indexing-exception, + raising-string, + reload-builtin, + oct-method, + hex-method, + nonzero-method, + cmp-method, + input-builtin, + round-builtin, + intern-builtin, + unichr-builtin, + map-builtin-not-iterating, + zip-builtin-not-iterating, + range-builtin-not-iterating, + filter-builtin-not-iterating, + using-cmp-argument, + eq-without-hash, + div-method, + idiv-method, + rdiv-method, + exception-message-attribute, + invalid-str-codec, + sys-max-int, + bad-python3-import, + deprecated-string-function, + deprecated-str-translate-call, + deprecated-itertools-function, + deprecated-types-field, + next-method-defined, + dict-items-not-iterating, + dict-keys-not-iterating, + dict-values-not-iterating, + import-error + +# Enable the message, report, category or checker with the given id(s). You can +# either give multiple identifier separated by comma (,) or put this option +# multiple time (only on the command line, not in the configuration file where +# it should appear only once). See also the "--disable" option for examples. +enable=c-extension-no-member + + +[REPORTS] + +# Python expression which should return a note less than 10 (10 is the highest +# note). You have access to the variables errors warning, statement which +# respectively contain the number of errors / warnings messages and the total +# number of statements analyzed. This is used by the global evaluation report +# (RP0004). +evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) + +# Template used to display messages. This is a python new-style format string +# used to format the message information. See doc for all details +#msg-template= + +# Set the output format. Available formats are text, parseable, colorized, json +# and msvs (visual studio).You can also give a reporter class, eg +# mypackage.mymodule.MyReporterClass. +output-format=text + +# Tells whether to display a full report or only the messages +reports=no + +# Activate the evaluation score. +score=no + + +[REFACTORING] + +# Maximum number of nested blocks for function / method body +max-nested-blocks=5 + +# Complete name of functions that never returns. When checking for +# inconsistent-return-statements if a never returning function is called then +# it will be considered as an explicit return statement and no message will be +# printed. +never-returning-functions=optparse.Values,sys.exit + + +[VARIABLES] + +# List of additional names supposed to be defined in builtins. Remember that +# you should avoid to define new builtins when possible. +additional-builtins=cls + +# Tells whether unused global variables should be treated as a violation. +allow-global-unused-variables=yes + +# List of strings which can identify a callback function by name. A callback +# name must start or end with one of those strings. +callbacks=cb_, + _cb + +# A regular expression matching the name of dummy variables (i.e. expectedly +# not used). +dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_ + +# Argument names that match this expression will be ignored. Default to name +# with leading underscore +ignored-argument-names=_.*|^ignored_|^unused_ + +# Tells whether we should check for unused import in __init__ files. +init-import=no + +# List of qualified module names which can have objects that can redefine +# builtins. +redefining-builtins-modules=six.moves,past.builtins,future.builtins + + +[LOGGING] + +# Logging modules to check that the string format arguments are in logging +# function parameter format +logging-modules=logging + + +[TYPECHECK] + +# List of decorators that produce context managers, such as +# contextlib.contextmanager. Add to this list to register other decorators that +# produce valid context managers. +contextmanager-decorators=contextlib.contextmanager + +# List of members which are set dynamically and missed by pylint inference +# system, and so shouldn't trigger E1101 when accessed. Python regular +# expressions are accepted. +generated-members= + +# Tells whether missing members accessed in mixin class should be ignored. A +# mixin class is detected if its name ends with "mixin" (case insensitive). +ignore-mixin-members=yes + +# This flag controls whether pylint should warn about no-member and similar +# checks whenever an opaque object is returned when inferring. The inference +# can return multiple potential results while evaluating a Python object, but +# some branches might not be evaluated, which results in partial inference. In +# that case, it might be useful to still emit no-member and other checks for +# the rest of the inferred objects. +ignore-on-opaque-inference=yes + +# List of class names for which member attributes should not be checked (useful +# for classes with dynamically set attributes). This supports the use of +# qualified names. +ignored-classes=optparse.Values,thread._local,_thread._local + +# List of module names for which member attributes should not be checked +# (useful for modules/projects where namespaces are manipulated during runtime +# and thus existing member attributes cannot be deduced by static analysis. It +# supports qualified module names, as well as Unix pattern matching. +ignored-modules=blspy, + chiabip158, + chiapos, + chiavdf, + cryptography, + aiohttp, + websockets, + keyring, + keyrings.cryptfile, + bitstring, + clvm_tools, + setproctitle, + clvm, + colorlog, + concurrent_log_handler, + aiosqlite, + sortedcontainers, + aiter, + miniupnpc, + pytest, + setuptools_scm + +# Show a hint with possible names when a member name was not found. The aspect +# of finding the hint is based on edit distance. +missing-member-hint=yes + +# The minimum edit distance a name should have in order to be considered a +# similar match for a missing member name. +missing-member-hint-distance=1 + +# The total number of similar names that should be taken in consideration when +# showing a hint for a missing member. +missing-member-max-choices=1 + + +[MISCELLANEOUS] + +# List of note tags to take in consideration, separated by a comma. +notes=FIXME, + XXX, + TODO + + +[BASIC] + +# Naming style matching correct argument names +argument-naming-style=snake_case + +# Regular expression matching correct argument names. Overrides argument- +# naming-style +#argument-rgx= + +# Naming style matching correct attribute names +attr-naming-style=snake_case + +# Regular expression matching correct attribute names. Overrides attr-naming- +# style +#attr-rgx= + +# Bad variable names which should always be refused, separated by a comma +bad-names=foo, + bar, + baz, + toto, + tutu, + tata + +# Naming style matching correct class attribute names +class-attribute-naming-style=any + +# Regular expression matching correct class attribute names. Overrides class- +# attribute-naming-style +#class-attribute-rgx= + +# Naming style matching correct class names +class-naming-style=PascalCase + +# Regular expression matching correct class names. Overrides class-naming-style +#class-rgx= + +# Naming style matching correct constant names +const-naming-style=UPPER_CASE + +# Regular expression matching correct constant names. Overrides const-naming- +# style +#const-rgx= + +# Minimum line length for functions/classes that require docstrings, shorter +# ones are exempt. +docstring-min-length=-1 + +# Naming style matching correct function names +function-naming-style=snake_case + +# Regular expression matching correct function names. Overrides function- +# naming-style +#function-rgx= + +# Good variable names which should always be accepted, separated by a comma +good-names=i, + j, + k, + ex, + Run, + _ + +# Include a hint for the correct naming format with invalid-name +include-naming-hint=no + +# Naming style matching correct inline iteration names +inlinevar-naming-style=any + +# Regular expression matching correct inline iteration names. Overrides +# inlinevar-naming-style +#inlinevar-rgx= + +# Naming style matching correct method names +method-naming-style=snake_case + +# Regular expression matching correct method names. Overrides method-naming- +# style +#method-rgx= + +# Naming style matching correct module names +module-naming-style=snake_case + +# Regular expression matching correct module names. Overrides module-naming- +# style +#module-rgx= + +# Colon-delimited sets of names that determine each other's naming style when +# the name regexes allow several styles. +name-group= + +# Regular expression which should only match function or class names that do +# not require a docstring. +no-docstring-rgx=^_ + +# List of decorators that produce properties, such as abc.abstractproperty. Add +# to this list to register other decorators that produce valid properties. +property-classes=abc.abstractproperty + +# Naming style matching correct variable names +variable-naming-style=snake_case + +# Regular expression matching correct variable names. Overrides variable- +# naming-style +#variable-rgx= + + +[SPELLING] + +# Limits count of emitted suggestions for spelling mistakes +max-spelling-suggestions=4 + +# Spelling dictionary name. Available dictionaries: none. To make it working +# install python-enchant package. +spelling-dict= + +# List of comma separated words that should not be checked. +spelling-ignore-words= + +# A path to a file that contains private dictionary; one word per line. +spelling-private-dict-file= + +# Tells whether to store unknown words to indicated private dictionary in +# --spelling-private-dict-file option instead of raising a message. +spelling-store-unknown-words=no + + +[FORMAT] + +# Expected format of line ending, e.g. empty (any line ending), LF or CRLF. +expected-line-ending-format= + +# Regexp for a line that is allowed to be longer than the limit. +ignore-long-lines=^\s*(# )??$ + +# Number of spaces of indent required inside a hanging or continued line. +indent-after-paren=4 + +# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 +# tab). +indent-string=' ' + +# Maximum number of characters on a single line. +max-line-length=100 + +# Maximum number of lines in a module +max-module-lines=1000 + +# List of optional constructs for which whitespace checking is disabled. `dict- +# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}. +# `trailing-comma` allows a space between comma and closing bracket: (a, ). +# `empty-line` allows space-only lines. +no-space-check=trailing-comma, + dict-separator + +# Allow the body of a class to be on the same line as the declaration if body +# contains single statement. +single-line-class-stmt=no + +# Allow the body of an if to be on the same line as the test if there is no +# else. +single-line-if-stmt=no + + +[SIMILARITIES] + +# Ignore comments when computing similarities. +ignore-comments=yes + +# Ignore docstrings when computing similarities. +ignore-docstrings=yes + +# Ignore imports when computing similarities. +ignore-imports=no + +# Minimum lines number of a similarity. +min-similarity-lines=4 + + +[DESIGN] + +# Maximum number of arguments for function / method +max-args=5 + +# Maximum number of attributes for a class (see R0902). +max-attributes=7 + +# Maximum number of boolean expressions in a if statement +max-bool-expr=5 + +# Maximum number of branch for function / method body +max-branches=12 + +# Maximum number of locals for function / method body +max-locals=15 + +# Maximum number of parents for a class (see R0901). +max-parents=7 + +# Maximum number of public methods for a class (see R0904). +max-public-methods=20 + +# Maximum number of return / yield for function / method body +max-returns=6 + +# Maximum number of statements in function / method body +max-statements=50 + +# Minimum number of public methods for a class (see R0903). +min-public-methods=2 + + +[IMPORTS] + +# Allow wildcard imports from modules that define __all__. +allow-wildcard-with-all=no + +# Analyse import fallback blocks. This can be used to support both Python 2 and +# 3 compatible code, which means that the block might have code that exists +# only in one or another interpreter, leading to false positives when analysed. +analyse-fallback-blocks=no + +# Deprecated modules which should not be used, separated by a comma +deprecated-modules=regsub, + TERMIOS, + Bastion, + rexec + +# Create a graph of external dependencies in the given file (report RP0402 must +# not be disabled) +ext-import-graph= + +# Create a graph of every (i.e. internal and external) dependencies in the +# given file (report RP0402 must not be disabled) +import-graph= + +# Create a graph of internal dependencies in the given file (report RP0402 must +# not be disabled) +int-import-graph= + +# Force import order to recognize a module as part of the standard +# compatibility libraries. +known-standard-library= + +# Force import order to recognize a module as part of a third party library. +known-third-party=enchant + + +[CLASSES] + +# List of method names used to declare (i.e. assign) instance attributes. +defining-attr-methods=__init__, + __new__, + setUp + +# List of member names, which should be excluded from the protected access +# warning. +exclude-protected=_asdict, + _fields, + _replace, + _source, + _make + +# List of valid names for the first argument in a class method. +valid-classmethod-first-arg=cls + +# List of valid names for the first argument in a metaclass class method. +valid-metaclass-classmethod-first-arg=mcs + + +[EXCEPTIONS] + +# Exceptions that will emit a warning when being caught. Defaults to +# "Exception" +overgeneral-exceptions=Exception diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml deleted file mode 100644 index 2939a7ce0..000000000 --- a/.github/workflows/benchmarks.yml +++ /dev/null @@ -1,77 +0,0 @@ -name: Benchmarks - -on: - push: - branches: - - 'long_lived/**' - - main - - 'release/**' - tags: - - '**' - pull_request: - branches: - - '**' - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -jobs: - build: - name: Benchmarks - runs-on: benchmark - timeout-minutes: 30 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: [ 3.9 ] - env: - CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet - - steps: - - name: Clean workspace - uses: Chia-Network/actions/clean-workspace@main - - - name: Checkout Code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v3 - 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@v3 - 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@v3 - with: - repository: 'Chia-Network/test-cache' - path: '.chia' - ref: '0.29.0' - fetch-depth: 1 - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: | - sh install.sh -d - - - name: pytest - run: | - . ./activate - ./venv/bin/py.test -n 0 -m benchmark tests diff --git a/.github/workflows/build-linux-arm64-installer.yml b/.github/workflows/build-linux-arm64-installer.yml index 09810e770..e73391c1e 100644 --- a/.github/workflows/build-linux-arm64-installer.yml +++ b/.github/workflows/build-linux-arm64-installer.yml @@ -28,12 +28,9 @@ jobs: max-parallel: 4 matrix: python-version: [3.8] + os: [ARM64] steps: - - uses: Chia-Network/actions/clean-workspace@main - - - name: Add safe git directory - uses: Chia-Network/actions/git-mark-workspace-safe@main - name: Checkout Code uses: actions/checkout@v3 @@ -41,8 +38,6 @@ jobs: fetch-depth: 0 submodules: recursive - - uses: Chia-Network/actions/git-ssh-to-https@main - - name: Cleanup any leftovers that exist from previous runs run: bash build_scripts/clean-runner.sh || true @@ -53,19 +48,9 @@ jobs: python3 -m venv ../venv . ../venv/bin/activate pip3 install setuptools_scm - echo "::set-output name=CHIA_INSTALLER_VERSION::$(python3 ./build_scripts/installer-version.py)" + echo "::set-output name=FLAX_INSTALLER_VERSION::$(python3 ./build_scripts/installer-version.py)" deactivate - - 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.INSTALLER_UPLOAD_SECRET }}" - # Get the most recent release from chia-plotter-madmax - uses: actions/github-script@v6 id: 'latest-madmax' @@ -82,10 +67,10 @@ jobs: - name: Get latest madmax plotter run: | mkdir "$GITHUB_WORKSPACE/madmax" - wget -O "$GITHUB_WORKSPACE/madmax/chia_plot" https://github.com/Chia-Network/chia-plotter-madmax/releases/download/${{ steps.latest-madmax.outputs.result }}/chia_plot-${{ steps.latest-madmax.outputs.result }}-arm64 - wget -O "$GITHUB_WORKSPACE/madmax/chia_plot_k34" https://github.com/Chia-Network/chia-plotter-madmax/releases/download/${{ steps.latest-madmax.outputs.result }}/chia_plot_k34-${{ steps.latest-madmax.outputs.result }}-arm64 - chmod +x "$GITHUB_WORKSPACE/madmax/chia_plot" - chmod +x "$GITHUB_WORKSPACE/madmax/chia_plot_k34" + wget -O "$GITHUB_WORKSPACE/madmax/flax_plot" https://github.com/Chia-Network/chia-plotter-madmax/releases/download/${{ steps.latest-madmax.outputs.result }}/chia_plot-${{ steps.latest-madmax.outputs.result }}-arm64 + wget -O "$GITHUB_WORKSPACE/madmax/flax_plot_k34" https://github.com/Chia-Network/chia-plotter-madmax/releases/download/${{ steps.latest-madmax.outputs.result }}/chia_plot_k34-${{ steps.latest-madmax.outputs.result }}-arm64 + chmod +x "$GITHUB_WORKSPACE/madmax/flax_plot" + chmod +x "$GITHUB_WORKSPACE/madmax/flax_plot_k34" # Get the most recent release from bladebit - uses: actions/github-script@v6 @@ -115,10 +100,10 @@ jobs: - name: Build arm64 .deb package env: - CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }} + FLAX_INSTALLER_VERSION: ${{ steps.version_number.outputs.FLAX_INSTALLER_VERSION }} run: | ldd --version - git -C ./chia-blockchain-gui status + git -C ./flax-blockchain-gui status . ./activate cd ./build_scripts sh build_linux_deb.sh arm64 @@ -126,86 +111,18 @@ jobs: - name: Upload Linux artifacts uses: actions/upload-artifact@v3 with: - name: chia-installers-linux-deb-arm64 + name: flax-installers-linux-deb-arm64 path: ${{ github.workspace }}/build_scripts/final_installer/ - - name: Configure AWS Credentials - if: steps.check_secrets.outputs.HAS_SECRET - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.INSTALLER_UPLOAD_KEY }} - aws-secret-access-key: ${{ secrets.INSTALLER_UPLOAD_SECRET }} - aws-region: us-west-2 - - - name: Upload to s3 - env: - CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }} - if: steps.check_secrets.outputs.HAS_SECRET - run: | - GIT_SHORT_HASH=$(echo "${GITHUB_SHA}" | cut -c1-8) - CHIA_DEV_BUILD=${CHIA_INSTALLER_VERSION}-$GIT_SHORT_HASH - echo "CHIA_DEV_BUILD=$CHIA_DEV_BUILD" >>$GITHUB_ENV - aws s3 cp "$GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_arm64.deb" "s3://download.chia.net/dev/chia-blockchain_${CHIA_DEV_BUILD}_arm64.deb" - aws s3 cp "$GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_arm64.deb" "s3://download.chia.net/dev/chia-blockchain-cli_${CHIA_DEV_BUILD}-1_arm64.deb" - - name: Create Checksums if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main' env: - CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }} - run: | - ls $GITHUB_WORKSPACE/build_scripts/final_installer/ - sha256sum $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_arm64.deb > $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_arm64.deb.sha256 - sha256sum $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_arm64.deb > $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_arm64.deb.sha256 - ls $GITHUB_WORKSPACE/build_scripts/final_installer/ - - - name: Install py3createtorrent - if: startsWith(github.ref, 'refs/tags/') - run: | - pip3 install py3createtorrent - - - name: Create torrent - if: startsWith(github.ref, 'refs/tags/') - env: - CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }} + FLAX_INSTALLER_VERSION: ${{ steps.version_number.outputs.FLAX_INSTALLER_VERSION }} run: | - py3createtorrent -f -t udp://tracker.opentrackr.org:1337/announce $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_arm64.deb -o $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_arm64.deb.torrent --webseed https://download.chia.net/install/chia-blockchain_${CHIA_INSTALLER_VERSION}_arm64.deb - py3createtorrent -f -t udp://tracker.opentrackr.org:1337/announce $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_arm64.deb -o $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_arm64.deb.torrent --webseed https://download.chia.net/install/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_arm64.deb ls $GITHUB_WORKSPACE/build_scripts/final_installer/ - - - name: Upload Beta Installer - if: steps.check_secrets.outputs.HAS_SECRET && github.ref == 'refs/heads/main' - env: - CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }} - run: | - aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_arm64.deb s3://download.chia.net/beta/chia-blockchain_arm64_latest_beta.deb - aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_arm64.deb.sha256 s3://download.chia.net/beta/chia-blockchain_arm64_latest_beta.deb.sha256 - aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_arm64.deb s3://download.chia.net/beta/chia-blockchain-cli_arm64_latest_beta.deb - aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_arm64.deb.sha256 s3://download.chia.net/beta/chia-blockchain-cli_arm64_latest_beta.deb.sha256 - - - name: Upload Release Files - if: steps.check_secrets.outputs.HAS_SECRET && startsWith(github.ref, 'refs/tags/') - env: - CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }} - run: | + sha256sum $GITHUB_WORKSPACE/build_scripts/final_installer/flax-blockchain_${FLAX_INSTALLER_VERSION}_arm64.deb > $GITHUB_WORKSPACE/build_scripts/final_installer/flax-blockchain_${FLAX_INSTALLER_VERSION}_arm64.deb.sha256 + sha256sum $GITHUB_WORKSPACE/build_scripts/final_installer/flax-blockchain-cli_${FLAX_INSTALLER_VERSION}-1_arm64.deb > $GITHUB_WORKSPACE/build_scripts/final_installer/flax-blockchain-cli_${FLAX_INSTALLER_VERSION}-1_arm64.deb.sha256 ls $GITHUB_WORKSPACE/build_scripts/final_installer/ - aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_arm64.deb s3://download.chia.net/install/ - aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_arm64.deb.sha256 s3://download.chia.net/install/ - aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_arm64.deb.torrent s3://download.chia.net/torrents/ - aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_arm64.deb s3://download.chia.net/install/ - aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_arm64.deb.sha256 s3://download.chia.net/install/ - aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_arm64.deb.torrent s3://download.chia.net/torrents/ - - - name: Get tag name - if: startsWith(github.ref, 'refs/tags/') - id: tag-name - run: | - echo "::set-output name=TAG_NAME::$(echo ${{ github.ref }} | cut -d'/' -f 3)" - echo "::set-output name=REPO_NAME::$(echo ${{ github.repository }} | cut -d'/' -f 2)" - - - name: Mark installer complete - if: startsWith(github.ref, 'refs/tags/') - run: | - curl -s -XPOST -H "Authorization: Bearer ${{ secrets.GLUE_ACCESS_TOKEN }}" --data '{"chia_ref": "${{ steps.tag-name.outputs.TAG_NAME }}"}' ${{ secrets.GLUE_API_URL }}/api/v1/${{ steps.tag-name.outputs.REPO_NAME }}/${{ steps.tag-name.outputs.TAG_NAME }}/success/build-arm - name: Clean up on self hosted runner run: | diff --git a/.github/workflows/build-linux-installer-deb.yml b/.github/workflows/build-linux-installer-deb.yml index 3677c877c..2bfa23d44 100644 --- a/.github/workflows/build-linux-installer-deb.yml +++ b/.github/workflows/build-linux-installer-deb.yml @@ -37,14 +37,9 @@ jobs: fetch-depth: 0 submodules: recursive - - uses: Chia-Network/actions/git-ssh-to-https@main - - name: Cleanup any leftovers that exist from previous runs run: bash build_scripts/clean-runner.sh || true - - uses: Chia-Network/actions/enforce-semver@main - if: startsWith(github.ref, 'refs/tags/') - - name: Setup Python environment uses: actions/setup-python@v3 with: @@ -84,19 +79,9 @@ jobs: python3 -m venv ../venv . ../venv/bin/activate pip3 install setuptools_scm - echo "::set-output name=CHIA_INSTALLER_VERSION::$(python3 ./build_scripts/installer-version.py)" + echo "::set-output name=FLAX_INSTALLER_VERSION::$(python3 ./build_scripts/installer-version.py)" deactivate - - 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.INSTALLER_UPLOAD_SECRET }}" - # Get the most recent release from chia-plotter-madmax - uses: actions/github-script@v6 id: 'latest-madmax' @@ -113,10 +98,10 @@ jobs: - name: Get latest madmax plotter run: | mkdir "$GITHUB_WORKSPACE/madmax" - wget -O "$GITHUB_WORKSPACE/madmax/chia_plot" https://github.com/Chia-Network/chia-plotter-madmax/releases/download/${{ steps.latest-madmax.outputs.result }}/chia_plot-${{ steps.latest-madmax.outputs.result }}-x86-64 - wget -O "$GITHUB_WORKSPACE/madmax/chia_plot_k34" https://github.com/Chia-Network/chia-plotter-madmax/releases/download/${{ steps.latest-madmax.outputs.result }}/chia_plot_k34-${{ steps.latest-madmax.outputs.result }}-x86-64 - chmod +x "$GITHUB_WORKSPACE/madmax/chia_plot" - chmod +x "$GITHUB_WORKSPACE/madmax/chia_plot_k34" + wget -O "$GITHUB_WORKSPACE/madmax/flax_plot" https://github.com/Chia-Network/chia-plotter-madmax/releases/download/${{ steps.latest-madmax.outputs.result }}/chia_plot-${{ steps.latest-madmax.outputs.result }}-x86-64 + wget -O "$GITHUB_WORKSPACE/madmax/flax_plot_k34" https://github.com/Chia-Network/chia-plotter-madmax/releases/download/${{ steps.latest-madmax.outputs.result }}/chia_plot_k34-${{ steps.latest-madmax.outputs.result }}-x86-64 + chmod +x "$GITHUB_WORKSPACE/madmax/flax_plot" + chmod +x "$GITHUB_WORKSPACE/madmax/flax_plot_k34" # Get the most recent release from bladebit - uses: actions/github-script@v6 @@ -155,10 +140,10 @@ jobs: - name: Build .deb package env: - CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }} + FLAX_INSTALLER_VERSION: ${{ steps.version_number.outputs.FLAX_INSTALLER_VERSION }} run: | ldd --version - git -C ./chia-blockchain-gui status + git -C ./flax-blockchain-gui status . ./activate cd ./build_scripts sh build_linux_deb.sh amd64 @@ -166,83 +151,15 @@ jobs: - name: Upload Linux artifacts uses: actions/upload-artifact@v3 with: - name: chia-installers-linux-deb-intel + name: flax-installers-linux-deb-intel path: ${{ github.workspace }}/build_scripts/final_installer/ - - name: Configure AWS Credentials - if: steps.check_secrets.outputs.HAS_SECRET - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.INSTALLER_UPLOAD_KEY }} - aws-secret-access-key: ${{ secrets.INSTALLER_UPLOAD_SECRET }} - aws-region: us-west-2 - - - name: Upload to s3 - if: steps.check_secrets.outputs.HAS_SECRET - env: - CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }} - run: | - GIT_SHORT_HASH=$(echo "${GITHUB_SHA}" | cut -c1-8) - CHIA_DEV_BUILD=${CHIA_INSTALLER_VERSION}-$GIT_SHORT_HASH - echo "CHIA_DEV_BUILD=$CHIA_DEV_BUILD" >>$GITHUB_ENV - ls ${{ github.workspace }}/build_scripts/final_installer/ - aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_amd64.deb s3://download.chia.net/dev/chia-blockchain_${CHIA_DEV_BUILD}_amd64.deb - aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_amd64.deb s3://download.chia.net/dev/chia-blockchain-cli_${CHIA_DEV_BUILD}-1_amd64.deb - - name: Create Checksums if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main' env: - CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }} + FLAX_INSTALLER_VERSION: ${{ steps.version_number.outputs.FLAX_INSTALLER_VERSION }} run: | ls ${{ github.workspace }}/build_scripts/final_installer/ - sha256sum ${{ github.workspace }}/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_amd64.deb > ${{ github.workspace }}/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_amd64.deb.sha256 - sha256sum ${{ github.workspace }}/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_amd64.deb > ${{ github.workspace }}/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_amd64.deb.sha256 + sha256sum ${{ github.workspace }}/build_scripts/final_installer/flax-blockchain_${FLAX_INSTALLER_VERSION}_amd64.deb > ${{ github.workspace }}/build_scripts/final_installer/flax-blockchain_${FLAX_INSTALLER_VERSION}_amd64.deb.sha256 + sha256sum ${{ github.workspace }}/build_scripts/final_installer/flax-blockchain-cli_${FLAX_INSTALLER_VERSION}-1_amd64.deb > ${{ github.workspace }}/build_scripts/final_installer/flax-blockchain-cli_${FLAX_INSTALLER_VERSION}-1_amd64.deb.sha256 ls ${{ github.workspace }}/build_scripts/final_installer/ - - - name: Install py3createtorrent - if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main' - run: | - pip3 install py3createtorrent - - - name: Create .deb torrent - env: - CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }} - if: startsWith(github.ref, 'refs/tags/') - run: | - py3createtorrent -f -t udp://tracker.opentrackr.org:1337/announce ${{ github.workspace }}/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_amd64.deb -o ${{ github.workspace }}/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_amd64.deb.torrent --webseed https://download.chia.net/install/chia-blockchain_${CHIA_INSTALLER_VERSION}_amd64.deb - py3createtorrent -f -t udp://tracker.opentrackr.org:1337/announce ${{ github.workspace }}/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_amd64.deb -o ${{ github.workspace }}/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_amd64.deb.torrent --webseed https://download.chia.net/install/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_amd64.deb - ls - - - name: Upload Beta Installer - if: steps.check_secrets.outputs.HAS_SECRET && github.ref == 'refs/heads/main' - env: - CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }} - run: | - aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_amd64.deb s3://download.chia.net/beta/chia-blockchain_amd64_latest_beta.deb - aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_amd64.deb.sha256 s3://download.chia.net/beta/chia-blockchain_amd64_latest_beta.deb.sha256 - aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_amd64.deb s3://download.chia.net/beta/chia-blockchain-cli_amd64_latest_beta.deb - aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_amd64.deb.sha256 s3://download.chia.net/beta/chia-blockchain-cli_amd64_latest_beta.deb.sha256 - - - name: Upload Release Files - env: - CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }} - if: steps.check_secrets.outputs.HAS_SECRET && startsWith(github.ref, 'refs/tags/') - run: | - aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_amd64.deb s3://download.chia.net/install/ - aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_amd64.deb.sha256 s3://download.chia.net/install/ - aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_amd64.deb.torrent s3://download.chia.net/torrents/ - aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_amd64.deb s3://download.chia.net/install/ - aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_amd64.deb.sha256 s3://download.chia.net/install/ - aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_amd64.deb.torrent s3://download.chia.net/torrents/ - - - name: Get tag name - if: startsWith(github.ref, 'refs/tags/') - id: tag-name - run: | - echo "::set-output name=TAG_NAME::$(echo ${{ github.ref }} | cut -d'/' -f 3)" - echo "::set-output name=REPO_NAME::$(echo ${{ github.repository }} | cut -d'/' -f 2)" - - - name: Mark installer complete - if: startsWith(github.ref, 'refs/tags/') - run: | - curl -s -XPOST -H "Authorization: Bearer ${{ secrets.GLUE_ACCESS_TOKEN }}" --data '{"chia_ref": "${{ steps.tag-name.outputs.TAG_NAME }}"}' ${{ secrets.GLUE_API_URL }}/api/v1/${{ steps.tag-name.outputs.REPO_NAME }}/${{ steps.tag-name.outputs.TAG_NAME }}/success/build-linux-deb diff --git a/.github/workflows/build-linux-installer-rpm.yml b/.github/workflows/build-linux-installer-rpm.yml index be00aef7b..b95b088b9 100644 --- a/.github/workflows/build-linux-installer-rpm.yml +++ b/.github/workflows/build-linux-installer-rpm.yml @@ -38,14 +38,9 @@ jobs: fetch-depth: 0 submodules: recursive - - uses: Chia-Network/actions/git-ssh-to-https@main - - name: Cleanup any leftovers that exist from previous runs run: bash build_scripts/clean-runner.sh || true - - uses: Chia-Network/actions/enforce-semver@main - if: startsWith(github.ref, 'refs/tags/') - # Create our own venv outside of the git directory JUST for getting the ACTUAL version so that install can't break it - name: Get version number id: version_number @@ -53,19 +48,9 @@ jobs: python3 -m venv ../venv . ../venv/bin/activate pip3 install setuptools_scm - echo "::set-output name=CHIA_INSTALLER_VERSION::$(python3 ./build_scripts/installer-version.py)" + echo "::set-output name=FLAX_INSTALLER_VERSION::$(python3 ./build_scripts/installer-version.py)" deactivate - - 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.INSTALLER_UPLOAD_SECRET }}" - # Get the most recent release from chia-plotter-madmax - uses: actions/github-script@v6 id: 'latest-madmax' @@ -82,10 +67,10 @@ jobs: - name: Get latest madmax plotter run: | mkdir "$GITHUB_WORKSPACE/madmax" - wget -O "$GITHUB_WORKSPACE/madmax/chia_plot" https://github.com/Chia-Network/chia-plotter-madmax/releases/download/${{ steps.latest-madmax.outputs.result }}/chia_plot-${{ steps.latest-madmax.outputs.result }}-x86-64 - wget -O "$GITHUB_WORKSPACE/madmax/chia_plot_k34" https://github.com/Chia-Network/chia-plotter-madmax/releases/download/${{ steps.latest-madmax.outputs.result }}/chia_plot_k34-${{ steps.latest-madmax.outputs.result }}-x86-64 - chmod +x "$GITHUB_WORKSPACE/madmax/chia_plot" - chmod +x "$GITHUB_WORKSPACE/madmax/chia_plot_k34" + wget -O "$GITHUB_WORKSPACE/madmax/flax_plot" https://github.com/Chia-Network/chia-plotter-madmax/releases/download/${{ steps.latest-madmax.outputs.result }}/chia_plot-${{ steps.latest-madmax.outputs.result }}-x86-64 + wget -O "$GITHUB_WORKSPACE/madmax/flax_plot_k34" https://github.com/Chia-Network/chia-plotter-madmax/releases/download/${{ steps.latest-madmax.outputs.result }}/chia_plot_k34-${{ steps.latest-madmax.outputs.result }}-x86-64 + chmod +x "$GITHUB_WORKSPACE/madmax/flax_plot" + chmod +x "$GITHUB_WORKSPACE/madmax/flax_plot_k34" # Get the most recent release from bladebit - uses: actions/github-script@v6 @@ -115,10 +100,10 @@ jobs: - name: Build .rpm package env: - CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }} + FLAX_INSTALLER_VERSION: ${{ steps.version_number.outputs.FLAX_INSTALLER_VERSION }} run: | ldd --version - git -C ./chia-blockchain-gui status + git -C ./flax-blockchain-gui status . ./activate cd ./build_scripts bash build_linux_rpm.sh amd64 @@ -126,83 +111,15 @@ jobs: - name: Upload Linux artifacts uses: actions/upload-artifact@v3 with: - name: chia-installers-linux-rpm-intel + name: flax-installers-linux-rpm-intel path: ${{ github.workspace }}/build_scripts/final_installer/ - - name: Configure AWS Credentials - if: steps.check_secrets.outputs.HAS_SECRET - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.INSTALLER_UPLOAD_KEY }} - aws-secret-access-key: ${{ secrets.INSTALLER_UPLOAD_SECRET }} - aws-region: us-west-2 - - - name: Upload to s3 - if: steps.check_secrets.outputs.HAS_SECRET - env: - CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }} - run: | - GIT_SHORT_HASH=$(echo "${GITHUB_SHA}" | cut -c1-8) - CHIA_DEV_BUILD=${CHIA_INSTALLER_VERSION}-$GIT_SHORT_HASH - echo "CHIA_DEV_BUILD=$CHIA_DEV_BUILD" >>$GITHUB_ENV - ls $GITHUB_WORKSPACE/build_scripts/final_installer/ - aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm s3://download.chia.net/dev/chia-blockchain-${CHIA_DEV_BUILD}-1.x86_64.rpm - aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm s3://download.chia.net/dev/chia-blockchain-cli-${CHIA_DEV_BUILD}-1.x86_64.rpm - - name: Create Checksums if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main' env: - CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }} + FLAX_INSTALLER_VERSION: ${{ steps.version_number.outputs.FLAX_INSTALLER_VERSION }} run: | ls $GITHUB_WORKSPACE/build_scripts/final_installer/ - sha256sum $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm > $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm.sha256 - sha256sum $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm > $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm.sha256 + sha256sum $GITHUB_WORKSPACE/build_scripts/final_installer/flax-blockchain-${FLAX_INSTALLER_VERSION}-1.x86_64.rpm > $GITHUB_WORKSPACE/build_scripts/final_installer/flax-blockchain-${FLAX_INSTALLER_VERSION}-1.x86_64.rpm.sha256 + sha256sum $GITHUB_WORKSPACE/build_scripts/final_installer/flax-blockchain-cli-${FLAX_INSTALLER_VERSION}-1.x86_64.rpm > $GITHUB_WORKSPACE/build_scripts/final_installer/flax-blockchain-cli-${FLAX_INSTALLER_VERSION}-1.x86_64.rpm.sha256 ls $GITHUB_WORKSPACE/build_scripts/final_installer/ - - - name: Install py3createtorrent - if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main' - run: | - pip3 install py3createtorrent - - - name: Create .rpm torrent - if: startsWith(github.ref, 'refs/tags/') - env: - CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }} - run: | - py3createtorrent -f -t udp://tracker.opentrackr.org:1337/announce $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm -o $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm.torrent --webseed https://download.chia.net/install/chia-blockchain-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm - py3createtorrent -f -t udp://tracker.opentrackr.org:1337/announce $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm -o $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm.torrent --webseed https://download.chia.net/install/chia-blockchain-cli-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm - ls - - - name: Upload Beta Installer - if: steps.check_secrets.outputs.HAS_SECRET && github.ref == 'refs/heads/main' - env: - CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }} - run: | - aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm s3://download.chia.net/beta/chia-blockchain-1.x86_64_latest_beta.rpm - aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm.sha256 s3://download.chia.net/beta/chia-blockchain-1.x86_64_latest_beta.rpm.sha256 - aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm s3://download.chia.net/beta/chia-blockchain-cli-1.x86_64_latest_beta.rpm - aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm.sha256 s3://download.chia.net/beta/chia-blockchain-cli-1.x86_64_latest_beta.rpm.sha256 - - - name: Upload Release Files - if: steps.check_secrets.outputs.HAS_SECRET && startsWith(github.ref, 'refs/tags/') - env: - CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }} - run: | - aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm s3://download.chia.net/install/ - aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm.sha256 s3://download.chia.net/install/ - aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm.torrent s3://download.chia.net/torrents/ - aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm s3://download.chia.net/install/ - aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm.sha256 s3://download.chia.net/install/ - aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli-${CHIA_INSTALLER_VERSION}-1.x86_64.rpm.torrent s3://download.chia.net/torrents/ - - - name: Get tag name - if: startsWith(github.ref, 'refs/tags/') - id: tag-name - run: | - echo "::set-output name=TAG_NAME::$(echo ${{ github.ref }} | cut -d'/' -f 3)" - echo "::set-output name=REPO_NAME::$(echo ${{ github.repository }} | cut -d'/' -f 2)" - - - name: Mark installer complete - if: startsWith(github.ref, 'refs/tags/') - run: | - curl -s -XPOST -H "Authorization: Bearer ${{ secrets.GLUE_ACCESS_TOKEN }}" --data '{"chia_ref": "${{ steps.tag-name.outputs.TAG_NAME }}"}' ${{ secrets.GLUE_API_URL }}/api/v1/${{ steps.tag-name.outputs.REPO_NAME }}/${{ steps.tag-name.outputs.TAG_NAME }}/success/build-linux-rpm diff --git a/.github/workflows/build-macos-installer.yml b/.github/workflows/build-macos-installer.yml index 3b2195b95..ee5644740 100644 --- a/.github/workflows/build-macos-installer.yml +++ b/.github/workflows/build-macos-installer.yml @@ -36,36 +36,9 @@ jobs: fetch-depth: 0 submodules: recursive - - uses: Chia-Network/actions/git-ssh-to-https@main - - name: Cleanup any leftovers that exist from previous runs run: bash build_scripts/clean-runner.sh || true - - name: Test for secrets access - id: check_secrets - shell: bash - run: | - unset HAS_APPLE_SECRET - unset HAS_AWS_SECRET - - if [ -n "$APPLE_SECRET" ]; then HAS_APPLE_SECRET='true' ; fi - echo ::set-output name=HAS_APPLE_SECRET::${HAS_APPLE_SECRET} - - if [ -n "$AWS_SECRET" ]; then HAS_AWS_SECRET='true' ; fi - echo ::set-output name=HAS_AWS_SECRET::${HAS_AWS_SECRET} - env: - APPLE_SECRET: "${{ secrets.APPLE_DEV_ID_APP }}" - AWS_SECRET: "${{ secrets.INSTALLER_UPLOAD_KEY }}" - - - name: Create installer version number - id: version_number - run: | - python3 -m venv ../venv - . ../venv/bin/activate - pip install setuptools_scm - echo "::set-output name=CHIA_INSTALLER_VERSION::$(python3 ./build_scripts/installer-version.py)" - deactivate - - name: Setup Python environment uses: actions/setup-python@v3 with: @@ -98,13 +71,6 @@ jobs: restore-keys: | ${{ runner.os }}-pip- - - name: Import Apple app signing certificate - if: steps.check_secrets.outputs.HAS_APPLE_SECRET - uses: Apple-Actions/import-codesign-certs@v1 - with: - p12-file-base64: ${{ secrets.APPLE_DEV_ID_APP }} - p12-password: ${{ secrets.APPLE_DEV_ID_APP_PASS }} - # Get the most recent release from chia-plotter-madmax - uses: actions/github-script@v6 id: 'latest-madmax' @@ -121,10 +87,10 @@ jobs: - name: Get latest madmax plotter run: | mkdir "$GITHUB_WORKSPACE/madmax" - wget -O "$GITHUB_WORKSPACE/madmax/chia_plot" https://github.com/Chia-Network/chia-plotter-madmax/releases/download/${{ steps.latest-madmax.outputs.result }}/chia_plot-${{ steps.latest-madmax.outputs.result }}-macos-intel - wget -O "$GITHUB_WORKSPACE/madmax/chia_plot_k34" https://github.com/Chia-Network/chia-plotter-madmax/releases/download/${{ steps.latest-madmax.outputs.result }}/chia_plot_k34-${{ steps.latest-madmax.outputs.result }}-macos-intel - chmod +x "$GITHUB_WORKSPACE/madmax/chia_plot" - chmod +x "$GITHUB_WORKSPACE/madmax/chia_plot_k34" + wget -O "$GITHUB_WORKSPACE/madmax/flax_plot" https://github.com/Chia-Network/chia-plotter-madmax/releases/download/${{ steps.latest-madmax.outputs.result }}/chia_plot-${{ steps.latest-madmax.outputs.result }}-macos-intel + wget -O "$GITHUB_WORKSPACE/madmax/flax_plot_k34" https://github.com/Chia-Network/chia-plotter-madmax/releases/download/${{ steps.latest-madmax.outputs.result }}/chia_plot_k34-${{ steps.latest-madmax.outputs.result }}-macos-intel + chmod +x "$GITHUB_WORKSPACE/madmax/flax_plot" + chmod +x "$GITHUB_WORKSPACE/madmax/flax_plot_k34" - name: Run install script env: @@ -139,12 +105,12 @@ jobs: - name: Build MacOS DMG env: - CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }} + FLAX_INSTALLER_VERSION: ${{ steps.version_number.outputs.FLAX_INSTALLER_VERSION }} NOTARIZE: ${{ steps.check_secrets.outputs.HAS_APPLE_SECRET }} APPLE_NOTARIZE_USERNAME: "${{ secrets.APPLE_NOTARIZE_USERNAME }}" APPLE_NOTARIZE_PASSWORD: "${{ secrets.APPLE_NOTARIZE_PASSWORD }}" run: | - git -C ./chia-blockchain-gui status + git -C ./flax-blockchain-gui status . ./activate cd ./build_scripts sh build_macos.sh @@ -152,68 +118,5 @@ jobs: - name: Upload MacOS artifacts uses: actions/upload-artifact@v3 with: - name: chia-installers-macos-dmg-intel + name: flax-installers-macos-dmg-intel path: ${{ github.workspace }}/build_scripts/final_installer/ - - - name: Create Checksums - run: | - ls - shasum -a 256 ${{ github.workspace }}/build_scripts/final_installer/Chia-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}.dmg > ${{ github.workspace }}/build_scripts/final_installer/Chia-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}.dmg.sha256 - - - name: Upload to s3 - if: steps.check_secrets.outputs.HAS_AWS_SECRET - env: - AWS_ACCESS_KEY_ID: ${{ secrets.INSTALLER_UPLOAD_KEY }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.INSTALLER_UPLOAD_SECRET }} - AWS_REGION: us-west-2 - CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }} - run: | - GIT_SHORT_HASH=$(echo "${GITHUB_SHA}" | cut -c1-8) - CHIA_DEV_BUILD=${CHIA_INSTALLER_VERSION}-$GIT_SHORT_HASH - echo "CHIA_DEV_BUILD=$CHIA_DEV_BUILD" >>$GITHUB_ENV - aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/Chia-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}.dmg s3://download.chia.net/dev/Chia-${CHIA_DEV_BUILD}.dmg - - - name: Install py3createtorrent - if: startsWith(github.ref, 'refs/tags/') - run: | - pip install py3createtorrent - - - name: Create torrent - if: startsWith(github.ref, 'refs/tags/') - run: | - py3createtorrent -f -t udp://tracker.opentrackr.org:1337/announce ${{ github.workspace }}/build_scripts/final_installer/Chia-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}.dmg -o ${{ github.workspace }}/build_scripts/final_installer/Chia-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}.dmg.torrent --webseed https://download.chia.net/install/Chia-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}.dmg - ls ${{ github.workspace }}/build_scripts/final_installer/ - - - name: Upload Beta Installer - if: steps.check_secrets.outputs.HAS_AWS_SECRET && github.ref == 'refs/heads/main' - env: - CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }} - AWS_ACCESS_KEY_ID: ${{ secrets.INSTALLER_UPLOAD_KEY }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.INSTALLER_UPLOAD_SECRET }} - AWS_REGION: us-west-2 - run: | - aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/Chia-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}.dmg s3://download.chia.net/beta/Chia-intel_latest_beta.dmg - aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/Chia-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}.dmg.sha256 s3://download.chia.net/beta/Chia-intel_latest_beta.dmg.sha256 - - - name: Upload Release Files - if: steps.check_secrets.outputs.HAS_AWS_SECRET && startsWith(github.ref, 'refs/tags/') - env: - AWS_ACCESS_KEY_ID: ${{ secrets.INSTALLER_UPLOAD_KEY }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.INSTALLER_UPLOAD_SECRET }} - AWS_REGION: us-west-2 - run: | - aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/Chia-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}.dmg s3://download.chia.net/install/ - aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/Chia-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}.dmg.sha256 s3://download.chia.net/install/ - aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/Chia-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}.dmg.torrent s3://download.chia.net/torrents/ - - - name: Get tag name - if: startsWith(github.ref, 'refs/tags/') - id: tag-name - run: | - echo "::set-output name=TAG_NAME::$(echo ${{ github.ref }} | cut -d'/' -f 3)" - echo "::set-output name=REPO_NAME::$(echo ${{ github.repository }} | cut -d'/' -f 2)" - - - name: Mark installer complete - if: startsWith(github.ref, 'refs/tags/') - run: | - curl -s -XPOST -H "Authorization: Bearer ${{ secrets.GLUE_ACCESS_TOKEN }}" --data '{"chia_ref": "${{ steps.tag-name.outputs.TAG_NAME }}"}' ${{ secrets.GLUE_API_URL }}/api/v1/${{ steps.tag-name.outputs.REPO_NAME }}/${{ steps.tag-name.outputs.TAG_NAME }}/success/build-macos diff --git a/.github/workflows/build-macos-m1-installer.yml b/.github/workflows/build-macos-m1-installer.yml deleted file mode 100644 index 1e45825a2..000000000 --- a/.github/workflows/build-macos-m1-installer.yml +++ /dev/null @@ -1,204 +0,0 @@ -name: Build Installer - MacOS arm64 - -on: - push: - branches: - - 'long_lived/**' - - main - - 'release/**' - tags: - - '**' - pull_request: - branches: - - '**' - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -jobs: - build: - name: MacOS arm64 installer - runs-on: [m1] - timeout-minutes: 40 - strategy: - fail-fast: false - matrix: - python-version: [3.9] - - steps: - - uses: Chia-Network/actions/clean-workspace@main - - - name: Checkout Code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - submodules: recursive - - - uses: Chia-Network/actions/git-ssh-to-https@main - - - name: Cleanup any leftovers that exist from previous runs - run: bash build_scripts/clean-runner.sh || true - - - name: Test for secrets access - id: check_secrets - shell: bash - run: | - unset HAS_APPLE_SECRET - unset HAS_AWS_SECRET - - if [ -n "$APPLE_SECRET" ]; then HAS_APPLE_SECRET='true' ; fi - echo ::set-output name=HAS_APPLE_SECRET::${HAS_APPLE_SECRET} - - if [ -n "$AWS_SECRET" ]; then HAS_AWS_SECRET='true' ; fi - echo ::set-output name=HAS_AWS_SECRET::${HAS_AWS_SECRET} - env: - APPLE_SECRET: "${{ secrets.APPLE_DEV_ID_APP }}" - AWS_SECRET: "${{ secrets.INSTALLER_UPLOAD_KEY }}" - - - name: Create installer version number - id: version_number - run: | - arch -arm64 python3 -m venv ../venv - . ../venv/bin/activate - arch -arm64 pip install setuptools_scm - echo "::set-output name=CHIA_INSTALLER_VERSION::$(arch -arm64 python3 ./build_scripts/installer-version.py)" - deactivate - - # This will be recreated in the next step - # Done now and at the end of the workflow in case the last workflow fails, and this is still around - - name: Delete keychain if it already exists - run: - security delete-keychain signing_temp.keychain || true - - - name: Import Apple app signing certificate - if: steps.check_secrets.outputs.HAS_APPLE_SECRET - uses: Apple-Actions/import-codesign-certs@v1 - with: - p12-file-base64: ${{ secrets.APPLE_DEV_ID_APP }} - p12-password: ${{ secrets.APPLE_DEV_ID_APP_PASS }} - - # Get the most recent release from chia-plotter-madmax - - uses: actions/github-script@v6 - id: 'latest-madmax' - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - result-encoding: string - script: | - const release = await github.rest.repos.getLatestRelease({ - owner: 'Chia-Network', - repo: 'chia-plotter-madmax', - }); - return release.data.tag_name; - - - name: Get latest madmax plotter - run: | - mkdir "$GITHUB_WORKSPACE/madmax" - wget -O "$GITHUB_WORKSPACE/madmax/chia_plot" https://github.com/Chia-Network/chia-plotter-madmax/releases/download/${{ steps.latest-madmax.outputs.result }}/chia_plot-${{ steps.latest-madmax.outputs.result }}-macos-m1 - wget -O "$GITHUB_WORKSPACE/madmax/chia_plot_k34" https://github.com/Chia-Network/chia-plotter-madmax/releases/download/${{ steps.latest-madmax.outputs.result }}/chia_plot_k34-${{ steps.latest-madmax.outputs.result }}-macos-m1 - chmod +x "$GITHUB_WORKSPACE/madmax/chia_plot" - chmod +x "$GITHUB_WORKSPACE/madmax/chia_plot_k34" - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: | - arch -arm64 sh install.sh -d - - - name: Install node 16.x - run: | - arch -arm64 brew install node@16 - - - name: Build MacOS DMG - env: - CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }} - NOTARIZE: ${{ steps.check_secrets.outputs.HAS_APPLE_SECRET }} - APPLE_NOTARIZE_USERNAME: "${{ secrets.APPLE_NOTARIZE_USERNAME }}" - APPLE_NOTARIZE_PASSWORD: "${{ secrets.APPLE_NOTARIZE_PASSWORD }}" - run: | - export PATH=$(brew --prefix node@16)/bin:$PATH - git -C ./chia-blockchain-gui status - . ./activate - cd ./build_scripts - arch -arm64 sh build_macos_m1.sh - - - name: Upload MacOS artifacts - uses: actions/upload-artifact@v3 - with: - name: chia-installers-macos-dmg-arm64 - path: ${{ github.workspace }}/build_scripts/final_installer/ - - - name: Install AWS CLI - if: steps.check_secrets.outputs.HAS_AWS_SECRET - run: | - arch -arm64 brew install awscli - - - name: Create Checksums - run: | - ls - arch -arm64 shasum -a 256 ${{ github.workspace }}/build_scripts/final_installer/Chia-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}-arm64.dmg > ${{ github.workspace }}/build_scripts/final_installer/Chia-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}-arm64.dmg.sha256 - - - name: Upload to s3 - if: steps.check_secrets.outputs.HAS_AWS_SECRET - env: - AWS_ACCESS_KEY_ID: ${{ secrets.INSTALLER_UPLOAD_KEY }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.INSTALLER_UPLOAD_SECRET }} - AWS_REGION: us-west-2 - CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }} - run: | - GIT_SHORT_HASH=$(echo "${GITHUB_SHA}" | cut -c1-8) - CHIA_DEV_BUILD=${CHIA_INSTALLER_VERSION}-$GIT_SHORT_HASH - echo "CHIA_DEV_BUILD=$CHIA_DEV_BUILD" >>$GITHUB_ENV - arch -arm64 aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/Chia-${CHIA_INSTALLER_VERSION}-arm64.dmg s3://download.chia.net/dev/Chia-${CHIA_DEV_BUILD}-arm64.dmg - - - name: Install py3createtorrent - if: startsWith(github.ref, 'refs/tags/') - run: | - arch -arm64 pip install py3createtorrent - - - name: Create torrent - if: startsWith(github.ref, 'refs/tags/') - run: | - arch -arm64 py3createtorrent -f -t udp://tracker.opentrackr.org:1337/announce ${{ github.workspace }}/build_scripts/final_installer/Chia-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}-arm64.dmg -o ${{ github.workspace }}/build_scripts/final_installer/Chia-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}-arm64.dmg.torrent --webseed https://download.chia.net/install/Chia-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}-arm64.dmg - ls ${{ github.workspace }}/build_scripts/final_installer/ - - - name: Upload Beta Installer - if: steps.check_secrets.outputs.HAS_AWS_SECRET && github.ref == 'refs/heads/main' - env: - CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }} - AWS_ACCESS_KEY_ID: ${{ secrets.INSTALLER_UPLOAD_KEY }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.INSTALLER_UPLOAD_SECRET }} - AWS_REGION: us-west-2 - run: | - arch -arm64 aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/Chia-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}-arm64.dmg s3://download.chia.net/beta/Chia-arm64_latest_beta.dmg - arch -arm64 aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/Chia-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}-arm64.dmg.sha256 s3://download.chia.net/beta/Chia-arm64_latest_beta.dmg.sha256 - - - name: Upload Release Files - if: steps.check_secrets.outputs.HAS_AWS_SECRET && startsWith(github.ref, 'refs/tags/') - env: - AWS_ACCESS_KEY_ID: ${{ secrets.INSTALLER_UPLOAD_KEY }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.INSTALLER_UPLOAD_SECRET }} - AWS_REGION: us-west-2 - run: | - arch -arm64 aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/Chia-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}-arm64.dmg s3://download.chia.net/install/ - arch -arm64 aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/Chia-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}-arm64.dmg.sha256 s3://download.chia.net/install/ - arch -arm64 aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/Chia-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}-arm64.dmg.torrent s3://download.chia.net/torrents/ - - - name: Get tag name - if: startsWith(github.ref, 'refs/tags/') - id: tag-name - run: | - echo "::set-output name=TAG_NAME::$(echo ${{ github.ref }} | cut -d'/' -f 3)" - echo "::set-output name=REPO_NAME::$(echo ${{ github.repository }} | cut -d'/' -f 2)" - - - name: Mark installer complete - if: startsWith(github.ref, 'refs/tags/') - run: | - curl -s -XPOST -H "Authorization: Bearer ${{ secrets.GLUE_ACCESS_TOKEN }}" --data '{"chia_ref": "${{ steps.tag-name.outputs.TAG_NAME }}"}' ${{ secrets.GLUE_API_URL }}/api/v1/${{ steps.tag-name.outputs.REPO_NAME }}/${{ steps.tag-name.outputs.TAG_NAME }}/success/build-mac-m1 - - # We want to delete this no matter what happened in the previous steps (failures, success, etc) - - name: Delete signing keychain - if: always() - run: - security delete-keychain signing_temp.keychain || true diff --git a/.github/workflows/build-test-macos-blockchain.yml b/.github/workflows/build-test-macos-blockchain.yml deleted file mode 100644 index 37e70785a..000000000 --- a/.github/workflows/build-test-macos-blockchain.yml +++ /dev/null @@ -1,117 +0,0 @@ -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# -name: MacOS blockchain Test - -on: - push: - branches: - - 'long_lived/**' - - main - - 'release/**' - tags: - - '**' - pull_request: - branches: - - '**' - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -jobs: - build: - name: MacOS blockchain Tests - runs-on: ${{ matrix.os }} - timeout-minutes: 60 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: ['3.9', '3.10'] - os: [macOS-latest] - env: - CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet - JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_blockchain - - steps: - - name: Checkout Code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - - name: Create keychain for CI use - run: | - security create-keychain -p foo chiachain - security default-keychain -s chiachain - security unlock-keychain -p foo chiachain - security set-keychain-settings -t 7200 -u chiachain - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v3 - 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: Cache test blocks and plots - uses: actions/cache@v2 - id: test-blocks-plots - with: - path: | - ${{ github.workspace }}/.chia/blocks - ${{ github.workspace }}/.chia/test-plots - key: 0.29.0 - - - name: Checkout test blocks and plots - if: steps.test-blocks-plots.outputs.cache-hit != 'true' - run: | - wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf - - mkdir ${{ github.workspace }}/.chia - mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: | - brew install boost - sh install.sh -d - -# Omitted installing Timelord - - - name: Test blockchain code with pytest - run: | - . ./activate - venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/blockchain/test_blockchain.py tests/blockchain/test_blockchain_transactions.py - - - name: Process coverage data - run: | - venv/bin/coverage combine --rcfile=.coveragerc .coverage.* - venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml - mkdir coverage_reports - cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}" - cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml" - venv/bin/coverage report --rcfile=.coveragerc --show-missing - - - name: Publish coverage - uses: actions/upload-artifact@v3 - with: - name: coverage - path: coverage_reports/* - if-no-files-found: error -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# diff --git a/.github/workflows/build-test-macos-clvm.yml b/.github/workflows/build-test-macos-clvm.yml deleted file mode 100644 index 1a2ca35e6..000000000 --- a/.github/workflows/build-test-macos-clvm.yml +++ /dev/null @@ -1,103 +0,0 @@ -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# -name: MacOS clvm Test - -on: - push: - branches: - - 'long_lived/**' - - main - - 'release/**' - tags: - - '**' - pull_request: - branches: - - '**' - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -jobs: - build: - name: MacOS clvm Tests - runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: ['3.9', '3.10'] - os: [macOS-latest] - env: - CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet - JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_clvm - - steps: - - name: Checkout Code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - - name: Create keychain for CI use - run: | - security create-keychain -p foo chiachain - security default-keychain -s chiachain - security unlock-keychain -p foo chiachain - security set-keychain-settings -t 7200 -u chiachain - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v3 - 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: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: | - brew install boost - sh install.sh -d - -# Omitted installing Timelord - - - name: Test clvm code with pytest - run: | - . ./activate - venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/clvm/test_chialisp_deserialization.py tests/clvm/test_clvm_compilation.py tests/clvm/test_clvm_step.py tests/clvm/test_program.py tests/clvm/test_puzzle_compression.py tests/clvm/test_puzzle_drivers.py tests/clvm/test_puzzles.py tests/clvm/test_serialized_program.py tests/clvm/test_singletons.py tests/clvm/test_spend_sim.py - - - name: Process coverage data - run: | - venv/bin/coverage combine --rcfile=.coveragerc .coverage.* - venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml - mkdir coverage_reports - cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}" - cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml" - venv/bin/coverage report --rcfile=.coveragerc --show-missing - - - name: Publish coverage - uses: actions/upload-artifact@v3 - with: - name: coverage - path: coverage_reports/* - if-no-files-found: error -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# diff --git a/.github/workflows/build-test-macos-core-cmds.yml b/.github/workflows/build-test-macos-core-cmds.yml deleted file mode 100644 index 97954cb52..000000000 --- a/.github/workflows/build-test-macos-core-cmds.yml +++ /dev/null @@ -1,103 +0,0 @@ -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# -name: MacOS core-cmds Test - -on: - push: - branches: - - 'long_lived/**' - - main - - 'release/**' - tags: - - '**' - pull_request: - branches: - - '**' - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -jobs: - build: - name: MacOS core-cmds Tests - runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: ['3.9', '3.10'] - os: [macOS-latest] - env: - CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet - JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_core-cmds - - steps: - - name: Checkout Code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - - name: Create keychain for CI use - run: | - security create-keychain -p foo chiachain - security default-keychain -s chiachain - security unlock-keychain -p foo chiachain - security set-keychain-settings -t 7200 -u chiachain - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v3 - 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: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: | - brew install boost - sh install.sh -d - -# Omitted installing Timelord - - - name: Test core-cmds code with pytest - run: | - . ./activate - venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/core/cmds/test_keys.py tests/core/cmds/test_wallet.py - - - name: Process coverage data - run: | - venv/bin/coverage combine --rcfile=.coveragerc .coverage.* - venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml - mkdir coverage_reports - cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}" - cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml" - venv/bin/coverage report --rcfile=.coveragerc --show-missing - - - name: Publish coverage - uses: actions/upload-artifact@v3 - with: - name: coverage - path: coverage_reports/* - if-no-files-found: error -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# 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 9e491ca41..000000000 --- a/.github/workflows/build-test-macos-core-consensus.yml +++ /dev/null @@ -1,103 +0,0 @@ -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# -name: MacOS core-consensus Test - -on: - push: - branches: - - 'long_lived/**' - - main - - 'release/**' - tags: - - '**' - pull_request: - branches: - - '**' - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -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.9', '3.10'] - os: [macOS-latest] - env: - CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet - JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_core-consensus - - steps: - - name: Checkout Code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - - name: Create keychain for CI use - run: | - security create-keychain -p foo chiachain - security default-keychain -s chiachain - security unlock-keychain -p foo chiachain - security set-keychain-settings -t 7200 -u chiachain - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v3 - 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: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: | - brew install boost - sh install.sh -d - -# Omitted installing Timelord - - - name: Test core-consensus code with pytest - run: | - . ./activate - venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/core/consensus/test_pot_iterations.py - - - name: Process coverage data - run: | - venv/bin/coverage combine --rcfile=.coveragerc .coverage.* - venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml - mkdir coverage_reports - cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}" - cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml" - venv/bin/coverage report --rcfile=.coveragerc --show-missing - - - name: Publish coverage - uses: actions/upload-artifact@v3 - with: - name: coverage - path: coverage_reports/* - if-no-files-found: error -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# diff --git a/.github/workflows/build-test-macos-core-custom_types.yml b/.github/workflows/build-test-macos-core-custom_types.yml deleted file mode 100644 index 0ba62ebbb..000000000 --- a/.github/workflows/build-test-macos-core-custom_types.yml +++ /dev/null @@ -1,103 +0,0 @@ -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# -name: MacOS core-custom_types Test - -on: - push: - branches: - - 'long_lived/**' - - main - - 'release/**' - tags: - - '**' - pull_request: - branches: - - '**' - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -jobs: - build: - name: MacOS core-custom_types Tests - runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: ['3.9', '3.10'] - os: [macOS-latest] - env: - CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet - JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_core-custom_types - - steps: - - name: Checkout Code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - - name: Create keychain for CI use - run: | - security create-keychain -p foo chiachain - security default-keychain -s chiachain - security unlock-keychain -p foo chiachain - security set-keychain-settings -t 7200 -u chiachain - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v3 - 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: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: | - brew install boost - sh install.sh -d - -# Omitted installing Timelord - - - name: Test core-custom_types code with pytest - run: | - . ./activate - venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/core/custom_types/test_coin.py tests/core/custom_types/test_proof_of_space.py tests/core/custom_types/test_spend_bundle.py - - - name: Process coverage data - run: | - venv/bin/coverage combine --rcfile=.coveragerc .coverage.* - venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml - mkdir coverage_reports - cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}" - cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml" - venv/bin/coverage report --rcfile=.coveragerc --show-missing - - - name: Publish coverage - uses: actions/upload-artifact@v3 - with: - name: coverage - path: coverage_reports/* - if-no-files-found: error -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# diff --git a/.github/workflows/build-test-macos-core-daemon.yml b/.github/workflows/build-test-macos-core-daemon.yml deleted file mode 100644 index 0749983cd..000000000 --- a/.github/workflows/build-test-macos-core-daemon.yml +++ /dev/null @@ -1,121 +0,0 @@ -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# -name: MacOS core-daemon Test - -on: - push: - branches: - - 'long_lived/**' - - main - - 'release/**' - tags: - - '**' - pull_request: - branches: - - '**' - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -jobs: - build: - name: MacOS core-daemon Tests - runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: ['3.9', '3.10'] - os: [macOS-latest] - env: - CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet - JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_core-daemon - - steps: - - name: Checkout Code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - - name: Create keychain for CI use - run: | - security create-keychain -p foo chiachain - security default-keychain -s chiachain - security unlock-keychain -p foo chiachain - security set-keychain-settings -t 7200 -u chiachain - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v3 - 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: Cache test blocks and plots - uses: actions/cache@v2 - id: test-blocks-plots - with: - path: | - ${{ github.workspace }}/.chia/blocks - ${{ github.workspace }}/.chia/test-plots - key: 0.29.0 - - - name: Checkout test blocks and plots - if: steps.test-blocks-plots.outputs.cache-hit != 'true' - run: | - wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf - - mkdir ${{ github.workspace }}/.chia - mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: | - brew install boost - sh install.sh -d - - - name: Install timelord - run: | - . ./activate - sh install-timelord.sh -n - ./vdf_bench square_asm 400000 - - - name: Test core-daemon code with pytest - run: | - . ./activate - venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 0 -m "not benchmark" tests/core/daemon/test_daemon.py - - - name: Process coverage data - run: | - venv/bin/coverage combine --rcfile=.coveragerc .coverage.* - venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml - mkdir coverage_reports - cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}" - cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml" - venv/bin/coverage report --rcfile=.coveragerc --show-missing - - - name: Publish coverage - uses: actions/upload-artifact@v3 - with: - name: coverage - path: coverage_reports/* - if-no-files-found: error -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# 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 35f02d99c..000000000 --- a/.github/workflows/build-test-macos-core-full_node-full_sync.yml +++ /dev/null @@ -1,117 +0,0 @@ -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# -name: MacOS core-full_node-full_sync Test - -on: - push: - branches: - - 'long_lived/**' - - main - - 'release/**' - tags: - - '**' - pull_request: - branches: - - '**' - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -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.9', '3.10'] - os: [macOS-latest] - env: - CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet - JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_core-full_node-full_sync - - steps: - - name: Checkout Code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - - name: Create keychain for CI use - run: | - security create-keychain -p foo chiachain - security default-keychain -s chiachain - security unlock-keychain -p foo chiachain - security set-keychain-settings -t 7200 -u chiachain - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v3 - 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: Cache test blocks and plots - uses: actions/cache@v2 - id: test-blocks-plots - with: - path: | - ${{ github.workspace }}/.chia/blocks - ${{ github.workspace }}/.chia/test-plots - key: 0.29.0 - - - name: Checkout test blocks and plots - if: steps.test-blocks-plots.outputs.cache-hit != 'true' - run: | - wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf - - mkdir ${{ github.workspace }}/.chia - mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: | - brew install boost - sh install.sh -d - -# Omitted installing Timelord - - - name: Test core-full_node-full_sync code with pytest - run: | - . ./activate - venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/core/full_node/full_sync/test_full_sync.py - - - name: Process coverage data - run: | - venv/bin/coverage combine --rcfile=.coveragerc .coverage.* - venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml - mkdir coverage_reports - cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}" - cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml" - venv/bin/coverage report --rcfile=.coveragerc --show-missing - - - name: Publish coverage - uses: actions/upload-artifact@v3 - with: - name: coverage - path: coverage_reports/* - if-no-files-found: error -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# diff --git a/.github/workflows/build-test-macos-core-full_node-stores.yml b/.github/workflows/build-test-macos-core-full_node-stores.yml deleted file mode 100644 index a69f72c10..000000000 --- a/.github/workflows/build-test-macos-core-full_node-stores.yml +++ /dev/null @@ -1,117 +0,0 @@ -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# -name: MacOS core-full_node-stores Test - -on: - push: - branches: - - 'long_lived/**' - - main - - 'release/**' - tags: - - '**' - pull_request: - branches: - - '**' - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -jobs: - build: - name: MacOS core-full_node-stores Tests - runs-on: ${{ matrix.os }} - timeout-minutes: 40 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: ['3.9', '3.10'] - os: [macOS-latest] - env: - CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet - JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_core-full_node-stores - - steps: - - name: Checkout Code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - - name: Create keychain for CI use - run: | - security create-keychain -p foo chiachain - security default-keychain -s chiachain - security unlock-keychain -p foo chiachain - security set-keychain-settings -t 7200 -u chiachain - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v3 - 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: Cache test blocks and plots - uses: actions/cache@v2 - id: test-blocks-plots - with: - path: | - ${{ github.workspace }}/.chia/blocks - ${{ github.workspace }}/.chia/test-plots - key: 0.29.0 - - - name: Checkout test blocks and plots - if: steps.test-blocks-plots.outputs.cache-hit != 'true' - run: | - wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf - - mkdir ${{ github.workspace }}/.chia - mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: | - brew install boost - sh install.sh -d - -# Omitted installing Timelord - - - name: Test core-full_node-stores code with pytest - run: | - . ./activate - venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/core/full_node/stores/test_block_store.py tests/core/full_node/stores/test_coin_store.py tests/core/full_node/stores/test_full_node_store.py tests/core/full_node/stores/test_hint_store.py tests/core/full_node/stores/test_sync_store.py - - - name: Process coverage data - run: | - venv/bin/coverage combine --rcfile=.coveragerc .coverage.* - venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml - mkdir coverage_reports - cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}" - cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml" - venv/bin/coverage report --rcfile=.coveragerc --show-missing - - - name: Publish coverage - uses: actions/upload-artifact@v3 - with: - name: coverage - path: coverage_reports/* - if-no-files-found: error -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# 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 ce8ff7e64..000000000 --- a/.github/workflows/build-test-macos-core-full_node.yml +++ /dev/null @@ -1,117 +0,0 @@ -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# -name: MacOS core-full_node Test - -on: - push: - branches: - - 'long_lived/**' - - main - - 'release/**' - tags: - - '**' - pull_request: - branches: - - '**' - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -jobs: - build: - name: MacOS core-full_node Tests - runs-on: ${{ matrix.os }} - timeout-minutes: 50 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: ['3.9', '3.10'] - os: [macOS-latest] - env: - CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet - JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_core-full_node - - steps: - - name: Checkout Code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - - name: Create keychain for CI use - run: | - security create-keychain -p foo chiachain - security default-keychain -s chiachain - security unlock-keychain -p foo chiachain - security set-keychain-settings -t 7200 -u chiachain - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v3 - 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: Cache test blocks and plots - uses: actions/cache@v2 - id: test-blocks-plots - with: - path: | - ${{ github.workspace }}/.chia/blocks - ${{ github.workspace }}/.chia/test-plots - key: 0.29.0 - - - name: Checkout test blocks and plots - if: steps.test-blocks-plots.outputs.cache-hit != 'true' - run: | - wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf - - mkdir ${{ github.workspace }}/.chia - mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: | - brew install boost - sh install.sh -d - -# Omitted installing Timelord - - - name: Test core-full_node code with pytest - run: | - . ./activate - venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/core/full_node/test_address_manager.py tests/core/full_node/test_block_height_map.py tests/core/full_node/test_conditions.py tests/core/full_node/test_full_node.py tests/core/full_node/test_generator_tools.py tests/core/full_node/test_hint_management.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_peer_store_resolver.py tests/core/full_node/test_performance.py tests/core/full_node/test_transactions.py - - - name: Process coverage data - run: | - venv/bin/coverage combine --rcfile=.coveragerc .coverage.* - venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml - mkdir coverage_reports - cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}" - cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml" - venv/bin/coverage report --rcfile=.coveragerc --show-missing - - - name: Publish coverage - uses: actions/upload-artifact@v3 - with: - name: coverage - path: coverage_reports/* - if-no-files-found: error -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# 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 98fec323d..000000000 --- a/.github/workflows/build-test-macos-core-server.yml +++ /dev/null @@ -1,117 +0,0 @@ -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# -name: MacOS core-server Test - -on: - push: - branches: - - 'long_lived/**' - - main - - 'release/**' - tags: - - '**' - pull_request: - branches: - - '**' - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -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.9', '3.10'] - os: [macOS-latest] - env: - CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet - JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_core-server - - steps: - - name: Checkout Code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - - name: Create keychain for CI use - run: | - security create-keychain -p foo chiachain - security default-keychain -s chiachain - security unlock-keychain -p foo chiachain - security set-keychain-settings -t 7200 -u chiachain - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v3 - 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: Cache test blocks and plots - uses: actions/cache@v2 - id: test-blocks-plots - with: - path: | - ${{ github.workspace }}/.chia/blocks - ${{ github.workspace }}/.chia/test-plots - key: 0.29.0 - - - name: Checkout test blocks and plots - if: steps.test-blocks-plots.outputs.cache-hit != 'true' - run: | - wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf - - mkdir ${{ github.workspace }}/.chia - mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: | - brew install boost - sh install.sh -d - -# Omitted installing Timelord - - - name: Test core-server code with pytest - run: | - . ./activate - venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 0 -m "not benchmark" tests/core/server/test_dos.py tests/core/server/test_rate_limits.py - - - name: Process coverage data - run: | - venv/bin/coverage combine --rcfile=.coveragerc .coverage.* - venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml - mkdir coverage_reports - cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}" - cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml" - venv/bin/coverage report --rcfile=.coveragerc --show-missing - - - name: Publish coverage - uses: actions/upload-artifact@v3 - with: - name: coverage - path: coverage_reports/* - if-no-files-found: error -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# 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 e26b19e2a..000000000 --- a/.github/workflows/build-test-macos-core-ssl.yml +++ /dev/null @@ -1,117 +0,0 @@ -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# -name: MacOS core-ssl Test - -on: - push: - branches: - - 'long_lived/**' - - main - - 'release/**' - tags: - - '**' - pull_request: - branches: - - '**' - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -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.9', '3.10'] - os: [macOS-latest] - env: - CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet - JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_core-ssl - - steps: - - name: Checkout Code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - - name: Create keychain for CI use - run: | - security create-keychain -p foo chiachain - security default-keychain -s chiachain - security unlock-keychain -p foo chiachain - security set-keychain-settings -t 7200 -u chiachain - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v3 - 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: Cache test blocks and plots - uses: actions/cache@v2 - id: test-blocks-plots - with: - path: | - ${{ github.workspace }}/.chia/blocks - ${{ github.workspace }}/.chia/test-plots - key: 0.29.0 - - - name: Checkout test blocks and plots - if: steps.test-blocks-plots.outputs.cache-hit != 'true' - run: | - wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf - - mkdir ${{ github.workspace }}/.chia - mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: | - brew install boost - sh install.sh -d - -# Omitted installing Timelord - - - name: Test core-ssl code with pytest - run: | - . ./activate - venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/core/ssl/test_ssl.py - - - name: Process coverage data - run: | - venv/bin/coverage combine --rcfile=.coveragerc .coverage.* - venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml - mkdir coverage_reports - cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}" - cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml" - venv/bin/coverage report --rcfile=.coveragerc --show-missing - - - name: Publish coverage - uses: actions/upload-artifact@v3 - with: - name: coverage - path: coverage_reports/* - if-no-files-found: error -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# 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 48c7953f3..000000000 --- a/.github/workflows/build-test-macos-core-util.yml +++ /dev/null @@ -1,117 +0,0 @@ -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# -name: MacOS core-util Test - -on: - push: - branches: - - 'long_lived/**' - - main - - 'release/**' - tags: - - '**' - pull_request: - branches: - - '**' - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -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.9', '3.10'] - os: [macOS-latest] - env: - CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet - JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_core-util - - steps: - - name: Checkout Code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - - name: Create keychain for CI use - run: | - security create-keychain -p foo chiachain - security default-keychain -s chiachain - security unlock-keychain -p foo chiachain - security set-keychain-settings -t 7200 -u chiachain - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v3 - 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: Cache test blocks and plots - uses: actions/cache@v2 - id: test-blocks-plots - with: - path: | - ${{ github.workspace }}/.chia/blocks - ${{ github.workspace }}/.chia/test-plots - key: 0.29.0 - - - name: Checkout test blocks and plots - if: steps.test-blocks-plots.outputs.cache-hit != 'true' - run: | - wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf - - mkdir ${{ github.workspace }}/.chia - mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: | - brew install boost - sh install.sh -d - -# Omitted installing Timelord - - - name: Test core-util code with pytest - run: | - . ./activate - venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/core/util/test_cached_bls.py tests/core/util/test_config.py tests/core/util/test_db_wrapper.py tests/core/util/test_file_keyring_synchronization.py tests/core/util/test_files.py tests/core/util/test_jsonify.py tests/core/util/test_keychain.py tests/core/util/test_keyring_wrapper.py tests/core/util/test_lru_cache.py tests/core/util/test_significant_bits.py tests/core/util/test_streamable.py - - - name: Process coverage data - run: | - venv/bin/coverage combine --rcfile=.coveragerc .coverage.* - venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml - mkdir coverage_reports - cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}" - cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml" - venv/bin/coverage report --rcfile=.coveragerc --show-missing - - - name: Publish coverage - uses: actions/upload-artifact@v3 - with: - name: coverage - path: coverage_reports/* - if-no-files-found: error -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# diff --git a/.github/workflows/build-test-macos-core.yml b/.github/workflows/build-test-macos-core.yml deleted file mode 100644 index 31d2bf58f..000000000 --- a/.github/workflows/build-test-macos-core.yml +++ /dev/null @@ -1,117 +0,0 @@ -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# -name: MacOS core Test - -on: - push: - branches: - - 'long_lived/**' - - main - - 'release/**' - tags: - - '**' - pull_request: - branches: - - '**' - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -jobs: - build: - name: MacOS core Tests - runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: ['3.9', '3.10'] - os: [macOS-latest] - env: - CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet - JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_core - - steps: - - name: Checkout Code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - - name: Create keychain for CI use - run: | - security create-keychain -p foo chiachain - security default-keychain -s chiachain - security unlock-keychain -p foo chiachain - security set-keychain-settings -t 7200 -u chiachain - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v3 - 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: Cache test blocks and plots - uses: actions/cache@v2 - id: test-blocks-plots - with: - path: | - ${{ github.workspace }}/.chia/blocks - ${{ github.workspace }}/.chia/test-plots - key: 0.29.0 - - - name: Checkout test blocks and plots - if: steps.test-blocks-plots.outputs.cache-hit != 'true' - run: | - wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf - - mkdir ${{ github.workspace }}/.chia - mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: | - brew install boost - sh install.sh -d - -# Omitted installing Timelord - - - name: Test core code with pytest - run: | - . ./activate - venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/core/test_coins.py tests/core/test_cost_calculation.py tests/core/test_crawler_rpc.py tests/core/test_daemon_rpc.py tests/core/test_db_conversion.py tests/core/test_db_validation.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 - - - name: Process coverage data - run: | - venv/bin/coverage combine --rcfile=.coveragerc .coverage.* - venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml - mkdir coverage_reports - cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}" - cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml" - venv/bin/coverage report --rcfile=.coveragerc --show-missing - - - name: Publish coverage - uses: actions/upload-artifact@v3 - with: - name: coverage - path: coverage_reports/* - if-no-files-found: error -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# diff --git a/.github/workflows/build-test-macos-farmer_harvester.yml b/.github/workflows/build-test-macos-farmer_harvester.yml deleted file mode 100644 index a8bf468ca..000000000 --- a/.github/workflows/build-test-macos-farmer_harvester.yml +++ /dev/null @@ -1,117 +0,0 @@ -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# -name: MacOS farmer_harvester Test - -on: - push: - branches: - - 'long_lived/**' - - main - - 'release/**' - tags: - - '**' - pull_request: - branches: - - '**' - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -jobs: - build: - name: MacOS farmer_harvester Tests - runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: ['3.9', '3.10'] - os: [macOS-latest] - env: - CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet - JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_farmer_harvester - - steps: - - name: Checkout Code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - - name: Create keychain for CI use - run: | - security create-keychain -p foo chiachain - security default-keychain -s chiachain - security unlock-keychain -p foo chiachain - security set-keychain-settings -t 7200 -u chiachain - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v3 - 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: Cache test blocks and plots - uses: actions/cache@v2 - id: test-blocks-plots - with: - path: | - ${{ github.workspace }}/.chia/blocks - ${{ github.workspace }}/.chia/test-plots - key: 0.29.0 - - - name: Checkout test blocks and plots - if: steps.test-blocks-plots.outputs.cache-hit != 'true' - run: | - wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf - - mkdir ${{ github.workspace }}/.chia - mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: | - brew install boost - sh install.sh -d - -# Omitted installing Timelord - - - name: Test farmer_harvester code with pytest - run: | - . ./activate - venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 0 -m "not benchmark" tests/farmer_harvester/test_farmer_harvester.py - - - name: Process coverage data - run: | - venv/bin/coverage combine --rcfile=.coveragerc .coverage.* - venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml - mkdir coverage_reports - cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}" - cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml" - venv/bin/coverage report --rcfile=.coveragerc --show-missing - - - name: Publish coverage - uses: actions/upload-artifact@v3 - with: - name: coverage - path: coverage_reports/* - if-no-files-found: error -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# diff --git a/.github/workflows/build-test-macos-generator.yml b/.github/workflows/build-test-macos-generator.yml deleted file mode 100644 index 47401e2b3..000000000 --- a/.github/workflows/build-test-macos-generator.yml +++ /dev/null @@ -1,103 +0,0 @@ -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# -name: MacOS generator Test - -on: - push: - branches: - - 'long_lived/**' - - main - - 'release/**' - tags: - - '**' - pull_request: - branches: - - '**' - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -jobs: - build: - name: MacOS generator Tests - runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: ['3.9', '3.10'] - os: [macOS-latest] - env: - CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet - JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_generator - - steps: - - name: Checkout Code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - - name: Create keychain for CI use - run: | - security create-keychain -p foo chiachain - security default-keychain -s chiachain - security unlock-keychain -p foo chiachain - security set-keychain-settings -t 7200 -u chiachain - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v3 - 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: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: | - brew install boost - sh install.sh -d - -# Omitted installing Timelord - - - name: Test generator code with pytest - run: | - . ./activate - venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/generator/test_compression.py tests/generator/test_generator_types.py tests/generator/test_list_to_batches.py tests/generator/test_rom.py tests/generator/test_scan.py - - - name: Process coverage data - run: | - venv/bin/coverage combine --rcfile=.coveragerc .coverage.* - venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml - mkdir coverage_reports - cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}" - cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml" - venv/bin/coverage report --rcfile=.coveragerc --show-missing - - - name: Publish coverage - uses: actions/upload-artifact@v3 - with: - name: coverage - path: coverage_reports/* - if-no-files-found: error -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# diff --git a/.github/workflows/build-test-macos-plot_sync.yml b/.github/workflows/build-test-macos-plot_sync.yml deleted file mode 100644 index 996ddd583..000000000 --- a/.github/workflows/build-test-macos-plot_sync.yml +++ /dev/null @@ -1,117 +0,0 @@ -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# -name: MacOS plot_sync Test - -on: - push: - branches: - - 'long_lived/**' - - main - - 'release/**' - tags: - - '**' - pull_request: - branches: - - '**' - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -jobs: - build: - name: MacOS plot_sync Tests - runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: ['3.9', '3.10'] - os: [macOS-latest] - env: - CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet - JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_plot_sync - - steps: - - name: Checkout Code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - - name: Create keychain for CI use - run: | - security create-keychain -p foo chiachain - security default-keychain -s chiachain - security unlock-keychain -p foo chiachain - security set-keychain-settings -t 7200 -u chiachain - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v3 - 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: Cache test blocks and plots - uses: actions/cache@v2 - id: test-blocks-plots - with: - path: | - ${{ github.workspace }}/.chia/blocks - ${{ github.workspace }}/.chia/test-plots - key: 0.29.0 - - - name: Checkout test blocks and plots - if: steps.test-blocks-plots.outputs.cache-hit != 'true' - run: | - wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf - - mkdir ${{ github.workspace }}/.chia - mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: | - brew install boost - sh install.sh -d - -# Omitted installing Timelord - - - name: Test plot_sync code with pytest - run: | - . ./activate - venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/plot_sync/test_delta.py tests/plot_sync/test_plot_sync.py tests/plot_sync/test_receiver.py tests/plot_sync/test_sender.py tests/plot_sync/test_sync_simulated.py - - - name: Process coverage data - run: | - venv/bin/coverage combine --rcfile=.coveragerc .coverage.* - venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml - mkdir coverage_reports - cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}" - cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml" - venv/bin/coverage report --rcfile=.coveragerc --show-missing - - - name: Publish coverage - uses: actions/upload-artifact@v3 - with: - name: coverage - path: coverage_reports/* - if-no-files-found: error -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# diff --git a/.github/workflows/build-test-macos-plotting.yml b/.github/workflows/build-test-macos-plotting.yml deleted file mode 100644 index d5f29ba51..000000000 --- a/.github/workflows/build-test-macos-plotting.yml +++ /dev/null @@ -1,117 +0,0 @@ -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# -name: MacOS plotting Test - -on: - push: - branches: - - 'long_lived/**' - - main - - 'release/**' - tags: - - '**' - pull_request: - branches: - - '**' - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -jobs: - build: - name: MacOS plotting Tests - runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: ['3.9', '3.10'] - os: [macOS-latest] - env: - CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet - JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_plotting - - steps: - - name: Checkout Code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - - name: Create keychain for CI use - run: | - security create-keychain -p foo chiachain - security default-keychain -s chiachain - security unlock-keychain -p foo chiachain - security set-keychain-settings -t 7200 -u chiachain - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v3 - 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: Cache test blocks and plots - uses: actions/cache@v2 - id: test-blocks-plots - with: - path: | - ${{ github.workspace }}/.chia/blocks - ${{ github.workspace }}/.chia/test-plots - key: 0.29.0 - - - name: Checkout test blocks and plots - if: steps.test-blocks-plots.outputs.cache-hit != 'true' - run: | - wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf - - mkdir ${{ github.workspace }}/.chia - mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: | - brew install boost - sh install.sh -d - -# Omitted installing Timelord - - - name: Test plotting code with pytest - run: | - . ./activate - venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/plotting/test_plot_manager.py - - - name: Process coverage data - run: | - venv/bin/coverage combine --rcfile=.coveragerc .coverage.* - venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml - mkdir coverage_reports - cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}" - cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml" - venv/bin/coverage report --rcfile=.coveragerc --show-missing - - - name: Publish coverage - uses: actions/upload-artifact@v3 - with: - name: coverage - path: coverage_reports/* - if-no-files-found: error -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# diff --git a/.github/workflows/build-test-macos-pools.yml b/.github/workflows/build-test-macos-pools.yml deleted file mode 100644 index a55b3b0dc..000000000 --- a/.github/workflows/build-test-macos-pools.yml +++ /dev/null @@ -1,117 +0,0 @@ -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# -name: MacOS pools Test - -on: - push: - branches: - - 'long_lived/**' - - main - - 'release/**' - tags: - - '**' - pull_request: - branches: - - '**' - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -jobs: - build: - name: MacOS pools Tests - runs-on: ${{ matrix.os }} - timeout-minutes: 60 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: ['3.9', '3.10'] - os: [macOS-latest] - env: - CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet - JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_pools - - steps: - - name: Checkout Code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - - name: Create keychain for CI use - run: | - security create-keychain -p foo chiachain - security default-keychain -s chiachain - security unlock-keychain -p foo chiachain - security set-keychain-settings -t 7200 -u chiachain - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v3 - 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: Cache test blocks and plots - uses: actions/cache@v2 - id: test-blocks-plots - with: - path: | - ${{ github.workspace }}/.chia/blocks - ${{ github.workspace }}/.chia/test-plots - key: 0.29.0 - - - name: Checkout test blocks and plots - if: steps.test-blocks-plots.outputs.cache-hit != 'true' - run: | - wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf - - mkdir ${{ github.workspace }}/.chia - mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: | - brew install boost - sh install.sh -d - -# Omitted installing Timelord - - - name: Test pools code with pytest - run: | - . ./activate - venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 2 -m "not benchmark" tests/pools/test_pool_cmdline.py tests/pools/test_pool_config.py tests/pools/test_pool_puzzles_lifecycle.py tests/pools/test_pool_rpc.py tests/pools/test_pool_wallet.py tests/pools/test_wallet_pool_store.py - - - name: Process coverage data - run: | - venv/bin/coverage combine --rcfile=.coveragerc .coverage.* - venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml - mkdir coverage_reports - cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}" - cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml" - venv/bin/coverage report --rcfile=.coveragerc --show-missing - - - name: Publish coverage - uses: actions/upload-artifact@v3 - with: - name: coverage - path: coverage_reports/* - if-no-files-found: error -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# diff --git a/.github/workflows/build-test-macos-simulation.yml b/.github/workflows/build-test-macos-simulation.yml deleted file mode 100644 index 1e1559b55..000000000 --- a/.github/workflows/build-test-macos-simulation.yml +++ /dev/null @@ -1,121 +0,0 @@ -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# -name: MacOS simulation Test - -on: - push: - branches: - - 'long_lived/**' - - main - - 'release/**' - tags: - - '**' - pull_request: - branches: - - '**' - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -jobs: - build: - name: MacOS simulation Tests - runs-on: ${{ matrix.os }} - timeout-minutes: 60 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: ['3.9', '3.10'] - os: [macOS-latest] - env: - CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet - JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_simulation - - steps: - - name: Checkout Code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - - name: Create keychain for CI use - run: | - security create-keychain -p foo chiachain - security default-keychain -s chiachain - security unlock-keychain -p foo chiachain - security set-keychain-settings -t 7200 -u chiachain - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v3 - 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: Cache test blocks and plots - uses: actions/cache@v2 - id: test-blocks-plots - with: - path: | - ${{ github.workspace }}/.chia/blocks - ${{ github.workspace }}/.chia/test-plots - key: 0.29.0 - - - name: Checkout test blocks and plots - if: steps.test-blocks-plots.outputs.cache-hit != 'true' - run: | - wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf - - mkdir ${{ github.workspace }}/.chia - mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: | - brew install boost - sh install.sh -d - - - name: Install timelord - run: | - . ./activate - sh install-timelord.sh -n - ./vdf_bench square_asm 400000 - - - name: Test simulation code with pytest - run: | - . ./activate - venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 0 -m "not benchmark" tests/simulation/test_simulation.py - - - name: Process coverage data - run: | - venv/bin/coverage combine --rcfile=.coveragerc .coverage.* - venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml - mkdir coverage_reports - cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}" - cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml" - venv/bin/coverage report --rcfile=.coveragerc --show-missing - - - name: Publish coverage - uses: actions/upload-artifact@v3 - with: - name: coverage - path: coverage_reports/* - if-no-files-found: error -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# diff --git a/.github/workflows/build-test-macos-tools.yml b/.github/workflows/build-test-macos-tools.yml deleted file mode 100644 index 023631963..000000000 --- a/.github/workflows/build-test-macos-tools.yml +++ /dev/null @@ -1,103 +0,0 @@ -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# -name: MacOS tools Test - -on: - push: - branches: - - 'long_lived/**' - - main - - 'release/**' - tags: - - '**' - pull_request: - branches: - - '**' - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -jobs: - build: - name: MacOS tools Tests - runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: ['3.9', '3.10'] - os: [macOS-latest] - env: - CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet - JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_tools - - steps: - - name: Checkout Code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - - name: Create keychain for CI use - run: | - security create-keychain -p foo chiachain - security default-keychain -s chiachain - security unlock-keychain -p foo chiachain - security set-keychain-settings -t 7200 -u chiachain - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v3 - 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: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: | - brew install boost - sh install.sh -d - -# Omitted installing Timelord - - - name: Test tools code with pytest - run: | - . ./activate - venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/tools/test_full_sync.py tests/tools/test_run_block.py - - - name: Process coverage data - run: | - venv/bin/coverage combine --rcfile=.coveragerc .coverage.* - venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml - mkdir coverage_reports - cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}" - cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml" - venv/bin/coverage report --rcfile=.coveragerc --show-missing - - - name: Publish coverage - uses: actions/upload-artifact@v3 - with: - name: coverage - path: coverage_reports/* - if-no-files-found: error -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# diff --git a/.github/workflows/build-test-macos-util.yml b/.github/workflows/build-test-macos-util.yml deleted file mode 100644 index 86ed0355b..000000000 --- a/.github/workflows/build-test-macos-util.yml +++ /dev/null @@ -1,103 +0,0 @@ -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# -name: MacOS util Test - -on: - push: - branches: - - 'long_lived/**' - - main - - 'release/**' - tags: - - '**' - pull_request: - branches: - - '**' - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -jobs: - build: - name: MacOS util Tests - runs-on: ${{ matrix.os }} - timeout-minutes: 60 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: ['3.9', '3.10'] - os: [macOS-latest] - env: - CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet - JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_util - - steps: - - name: Checkout Code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - - name: Create keychain for CI use - run: | - security create-keychain -p foo chiachain - security default-keychain -s chiachain - security unlock-keychain -p foo chiachain - security set-keychain-settings -t 7200 -u chiachain - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v3 - 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: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: | - brew install boost - sh install.sh -d - -# Omitted installing Timelord - - - name: Test util code with pytest - run: | - . ./activate - venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/util/test_chunks.py tests/util/test_full_block_utils.py tests/util/test_lock_queue.py tests/util/test_misc.py tests/util/test_network.py tests/util/test_network_protocol_files.py tests/util/test_paginator.py tests/util/test_struct_stream.py - - - name: Process coverage data - run: | - venv/bin/coverage combine --rcfile=.coveragerc .coverage.* - venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml - mkdir coverage_reports - cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}" - cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml" - venv/bin/coverage report --rcfile=.coveragerc --show-missing - - - name: Publish coverage - uses: actions/upload-artifact@v3 - with: - name: coverage - path: coverage_reports/* - if-no-files-found: error -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# diff --git a/.github/workflows/build-test-macos-wallet-cat_wallet.yml b/.github/workflows/build-test-macos-wallet-cat_wallet.yml deleted file mode 100644 index 5446268e9..000000000 --- a/.github/workflows/build-test-macos-wallet-cat_wallet.yml +++ /dev/null @@ -1,117 +0,0 @@ -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# -name: MacOS wallet-cat_wallet Test - -on: - push: - branches: - - 'long_lived/**' - - main - - 'release/**' - tags: - - '**' - pull_request: - branches: - - '**' - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -jobs: - build: - name: MacOS wallet-cat_wallet Tests - runs-on: ${{ matrix.os }} - timeout-minutes: 50 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: ['3.9', '3.10'] - os: [macOS-latest] - env: - CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet - JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_wallet-cat_wallet - - steps: - - name: Checkout Code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - - name: Create keychain for CI use - run: | - security create-keychain -p foo chiachain - security default-keychain -s chiachain - security unlock-keychain -p foo chiachain - security set-keychain-settings -t 7200 -u chiachain - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v3 - 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: Cache test blocks and plots - uses: actions/cache@v2 - id: test-blocks-plots - with: - path: | - ${{ github.workspace }}/.chia/blocks - ${{ github.workspace }}/.chia/test-plots - key: 0.29.0 - - - name: Checkout test blocks and plots - if: steps.test-blocks-plots.outputs.cache-hit != 'true' - run: | - wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf - - mkdir ${{ github.workspace }}/.chia - mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: | - brew install boost - sh install.sh -d - -# Omitted installing Timelord - - - name: Test wallet-cat_wallet code with pytest - run: | - . ./activate - venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 0 -m "not benchmark" tests/wallet/cat_wallet/test_cat_lifecycle.py tests/wallet/cat_wallet/test_cat_outer_puzzle.py tests/wallet/cat_wallet/test_cat_wallet.py tests/wallet/cat_wallet/test_offer_lifecycle.py tests/wallet/cat_wallet/test_trades.py - - - name: Process coverage data - run: | - venv/bin/coverage combine --rcfile=.coveragerc .coverage.* - venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml - mkdir coverage_reports - cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}" - cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml" - venv/bin/coverage report --rcfile=.coveragerc --show-missing - - - name: Publish coverage - uses: actions/upload-artifact@v3 - with: - name: coverage - path: coverage_reports/* - if-no-files-found: error -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# diff --git a/.github/workflows/build-test-macos-wallet-did_wallet.yml b/.github/workflows/build-test-macos-wallet-did_wallet.yml deleted file mode 100644 index 145cb3374..000000000 --- a/.github/workflows/build-test-macos-wallet-did_wallet.yml +++ /dev/null @@ -1,117 +0,0 @@ -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# -name: MacOS wallet-did_wallet Test - -on: - push: - branches: - - 'long_lived/**' - - main - - 'release/**' - tags: - - '**' - pull_request: - branches: - - '**' - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -jobs: - build: - name: MacOS wallet-did_wallet Tests - runs-on: ${{ matrix.os }} - timeout-minutes: 50 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: ['3.9', '3.10'] - os: [macOS-latest] - env: - CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet - JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_wallet-did_wallet - - steps: - - name: Checkout Code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - - name: Create keychain for CI use - run: | - security create-keychain -p foo chiachain - security default-keychain -s chiachain - security unlock-keychain -p foo chiachain - security set-keychain-settings -t 7200 -u chiachain - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v3 - 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: Cache test blocks and plots - uses: actions/cache@v2 - id: test-blocks-plots - with: - path: | - ${{ github.workspace }}/.chia/blocks - ${{ github.workspace }}/.chia/test-plots - key: 0.29.0 - - - name: Checkout test blocks and plots - if: steps.test-blocks-plots.outputs.cache-hit != 'true' - run: | - wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf - - mkdir ${{ github.workspace }}/.chia - mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: | - brew install boost - sh install.sh -d - -# Omitted installing Timelord - - - name: Test wallet-did_wallet code with pytest - run: | - . ./activate - venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 0 -m "not benchmark" tests/wallet/did_wallet/test_did.py - - - name: Process coverage data - run: | - venv/bin/coverage combine --rcfile=.coveragerc .coverage.* - venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml - mkdir coverage_reports - cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}" - cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml" - venv/bin/coverage report --rcfile=.coveragerc --show-missing - - - name: Publish coverage - uses: actions/upload-artifact@v3 - with: - name: coverage - path: coverage_reports/* - if-no-files-found: error -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# diff --git a/.github/workflows/build-test-macos-wallet-nft_wallet.yml b/.github/workflows/build-test-macos-wallet-nft_wallet.yml deleted file mode 100644 index c99981883..000000000 --- a/.github/workflows/build-test-macos-wallet-nft_wallet.yml +++ /dev/null @@ -1,117 +0,0 @@ -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# -name: MacOS wallet-nft_wallet Test - -on: - push: - branches: - - 'long_lived/**' - - main - - 'release/**' - tags: - - '**' - pull_request: - branches: - - '**' - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -jobs: - build: - name: MacOS wallet-nft_wallet Tests - runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: ['3.9', '3.10'] - os: [macOS-latest] - env: - CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet - JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_wallet-nft_wallet - - steps: - - name: Checkout Code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - - name: Create keychain for CI use - run: | - security create-keychain -p foo chiachain - security default-keychain -s chiachain - security unlock-keychain -p foo chiachain - security set-keychain-settings -t 7200 -u chiachain - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v3 - 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: Cache test blocks and plots - uses: actions/cache@v2 - id: test-blocks-plots - with: - path: | - ${{ github.workspace }}/.chia/blocks - ${{ github.workspace }}/.chia/test-plots - key: 0.29.0 - - - name: Checkout test blocks and plots - if: steps.test-blocks-plots.outputs.cache-hit != 'true' - run: | - wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf - - mkdir ${{ github.workspace }}/.chia - mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: | - brew install boost - sh install.sh -d - -# Omitted installing Timelord - - - name: Test wallet-nft_wallet code with pytest - run: | - . ./activate - venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 0 -m "not benchmark" tests/wallet/nft_wallet/test_nft_1_offers.py tests/wallet/nft_wallet/test_nft_lifecycle.py tests/wallet/nft_wallet/test_nft_offers.py tests/wallet/nft_wallet/test_nft_puzzles.py tests/wallet/nft_wallet/test_nft_wallet.py tests/wallet/nft_wallet/test_ownership_outer_puzzle.py - - - name: Process coverage data - run: | - venv/bin/coverage combine --rcfile=.coveragerc .coverage.* - venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml - mkdir coverage_reports - cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}" - cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml" - venv/bin/coverage report --rcfile=.coveragerc --show-missing - - - name: Publish coverage - uses: actions/upload-artifact@v3 - with: - name: coverage - path: coverage_reports/* - if-no-files-found: error -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# 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 acd2a84f3..000000000 --- a/.github/workflows/build-test-macos-wallet-rl_wallet.yml +++ /dev/null @@ -1,103 +0,0 @@ -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# -name: MacOS wallet-rl_wallet Test - -on: - push: - branches: - - 'long_lived/**' - - main - - 'release/**' - tags: - - '**' - pull_request: - branches: - - '**' - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -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.9', '3.10'] - os: [macOS-latest] - env: - CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet - JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_wallet-rl_wallet - - steps: - - name: Checkout Code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - - name: Create keychain for CI use - run: | - security create-keychain -p foo chiachain - security default-keychain -s chiachain - security unlock-keychain -p foo chiachain - security set-keychain-settings -t 7200 -u chiachain - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v3 - 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: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: | - brew install boost - sh install.sh -d - -# Omitted installing Timelord - - - name: Test wallet-rl_wallet code with pytest - run: | - . ./activate - venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 0 -m "not benchmark" tests/wallet/rl_wallet/test_rl_rpc.py tests/wallet/rl_wallet/test_rl_wallet.py - - - name: Process coverage data - run: | - venv/bin/coverage combine --rcfile=.coveragerc .coverage.* - venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml - mkdir coverage_reports - cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}" - cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml" - venv/bin/coverage report --rcfile=.coveragerc --show-missing - - - name: Publish coverage - uses: actions/upload-artifact@v3 - with: - name: coverage - path: coverage_reports/* - if-no-files-found: error -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# 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 ce3dde668..000000000 --- a/.github/workflows/build-test-macos-wallet-rpc.yml +++ /dev/null @@ -1,117 +0,0 @@ -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# -name: MacOS wallet-rpc Test - -on: - push: - branches: - - 'long_lived/**' - - main - - 'release/**' - tags: - - '**' - pull_request: - branches: - - '**' - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -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.9', '3.10'] - os: [macOS-latest] - env: - CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet - JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_wallet-rpc - - steps: - - name: Checkout Code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - - name: Create keychain for CI use - run: | - security create-keychain -p foo chiachain - security default-keychain -s chiachain - security unlock-keychain -p foo chiachain - security set-keychain-settings -t 7200 -u chiachain - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v3 - 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: Cache test blocks and plots - uses: actions/cache@v2 - id: test-blocks-plots - with: - path: | - ${{ github.workspace }}/.chia/blocks - ${{ github.workspace }}/.chia/test-plots - key: 0.29.0 - - - name: Checkout test blocks and plots - if: steps.test-blocks-plots.outputs.cache-hit != 'true' - run: | - wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf - - mkdir ${{ github.workspace }}/.chia - mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: | - brew install boost - sh install.sh -d - -# Omitted installing Timelord - - - name: Test wallet-rpc code with pytest - run: | - . ./activate - venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 0 -m "not benchmark" tests/wallet/rpc/test_wallet_rpc.py - - - name: Process coverage data - run: | - venv/bin/coverage combine --rcfile=.coveragerc .coverage.* - venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml - mkdir coverage_reports - cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}" - cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml" - venv/bin/coverage report --rcfile=.coveragerc --show-missing - - - name: Publish coverage - uses: actions/upload-artifact@v3 - with: - name: coverage - path: coverage_reports/* - if-no-files-found: error -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# diff --git a/.github/workflows/build-test-macos-wallet-simple_sync.yml b/.github/workflows/build-test-macos-wallet-simple_sync.yml deleted file mode 100644 index 4d0fdad6b..000000000 --- a/.github/workflows/build-test-macos-wallet-simple_sync.yml +++ /dev/null @@ -1,117 +0,0 @@ -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# -name: MacOS wallet-simple_sync Test - -on: - push: - branches: - - 'long_lived/**' - - main - - 'release/**' - tags: - - '**' - pull_request: - branches: - - '**' - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -jobs: - build: - name: MacOS wallet-simple_sync Tests - runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: ['3.9', '3.10'] - os: [macOS-latest] - env: - CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet - JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_wallet-simple_sync - - steps: - - name: Checkout Code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - - name: Create keychain for CI use - run: | - security create-keychain -p foo chiachain - security default-keychain -s chiachain - security unlock-keychain -p foo chiachain - security set-keychain-settings -t 7200 -u chiachain - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v3 - 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: Cache test blocks and plots - uses: actions/cache@v2 - id: test-blocks-plots - with: - path: | - ${{ github.workspace }}/.chia/blocks - ${{ github.workspace }}/.chia/test-plots - key: 0.29.0 - - - name: Checkout test blocks and plots - if: steps.test-blocks-plots.outputs.cache-hit != 'true' - run: | - wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf - - mkdir ${{ github.workspace }}/.chia - mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: | - brew install boost - sh install.sh -d - -# Omitted installing Timelord - - - name: Test wallet-simple_sync code with pytest - run: | - . ./activate - venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 0 -m "not benchmark" tests/wallet/simple_sync/test_simple_sync_protocol.py - - - name: Process coverage data - run: | - venv/bin/coverage combine --rcfile=.coveragerc .coverage.* - venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml - mkdir coverage_reports - cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}" - cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml" - venv/bin/coverage report --rcfile=.coveragerc --show-missing - - - name: Publish coverage - uses: actions/upload-artifact@v3 - with: - name: coverage - path: coverage_reports/* - if-no-files-found: error -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# 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 87170bc8f..000000000 --- a/.github/workflows/build-test-macos-wallet-sync.yml +++ /dev/null @@ -1,117 +0,0 @@ -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# -name: MacOS wallet-sync Test - -on: - push: - branches: - - 'long_lived/**' - - main - - 'release/**' - tags: - - '**' - pull_request: - branches: - - '**' - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -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.9', '3.10'] - os: [macOS-latest] - env: - CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet - JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_wallet-sync - - steps: - - name: Checkout Code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - - name: Create keychain for CI use - run: | - security create-keychain -p foo chiachain - security default-keychain -s chiachain - security unlock-keychain -p foo chiachain - security set-keychain-settings -t 7200 -u chiachain - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v3 - 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: Cache test blocks and plots - uses: actions/cache@v2 - id: test-blocks-plots - with: - path: | - ${{ github.workspace }}/.chia/blocks - ${{ github.workspace }}/.chia/test-plots - key: 0.29.0 - - - name: Checkout test blocks and plots - if: steps.test-blocks-plots.outputs.cache-hit != 'true' - run: | - wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf - - mkdir ${{ github.workspace }}/.chia - mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: | - brew install boost - sh install.sh -d - -# Omitted installing Timelord - - - name: Test wallet-sync code with pytest - run: | - . ./activate - venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 0 -m "not benchmark" tests/wallet/sync/test_wallet_sync.py - - - name: Process coverage data - run: | - venv/bin/coverage combine --rcfile=.coveragerc .coverage.* - venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml - mkdir coverage_reports - cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}" - cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml" - venv/bin/coverage report --rcfile=.coveragerc --show-missing - - - name: Publish coverage - uses: actions/upload-artifact@v3 - with: - name: coverage - path: coverage_reports/* - if-no-files-found: error -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# diff --git a/.github/workflows/build-test-macos-wallet.yml b/.github/workflows/build-test-macos-wallet.yml deleted file mode 100644 index 29ad69d0e..000000000 --- a/.github/workflows/build-test-macos-wallet.yml +++ /dev/null @@ -1,117 +0,0 @@ -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# -name: MacOS wallet Test - -on: - push: - branches: - - 'long_lived/**' - - main - - 'release/**' - tags: - - '**' - pull_request: - branches: - - '**' - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -jobs: - build: - name: MacOS wallet Tests - runs-on: ${{ matrix.os }} - timeout-minutes: 40 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: ['3.9', '3.10'] - os: [macOS-latest] - env: - CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet - JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_wallet - - steps: - - name: Checkout Code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - - name: Create keychain for CI use - run: | - security create-keychain -p foo chiachain - security default-keychain -s chiachain - security unlock-keychain -p foo chiachain - security set-keychain-settings -t 7200 -u chiachain - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v3 - 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: Cache test blocks and plots - uses: actions/cache@v2 - id: test-blocks-plots - with: - path: | - ${{ github.workspace }}/.chia/blocks - ${{ github.workspace }}/.chia/test-plots - key: 0.29.0 - - - name: Checkout test blocks and plots - if: steps.test-blocks-plots.outputs.cache-hit != 'true' - run: | - wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf - - mkdir ${{ github.workspace }}/.chia - mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: | - brew install boost - sh install.sh -d - -# Omitted installing Timelord - - - name: Test wallet code with pytest - run: | - . ./activate - venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/wallet/test_bech32m.py tests/wallet/test_chialisp.py tests/wallet/test_coin_selection.py tests/wallet/test_nft_store.py tests/wallet/test_puzzle_store.py tests/wallet/test_singleton.py tests/wallet/test_singleton_lifecycle.py tests/wallet/test_singleton_lifecycle_fast.py tests/wallet/test_taproot.py tests/wallet/test_wallet.py tests/wallet/test_wallet_blockchain.py tests/wallet/test_wallet_interested_store.py tests/wallet/test_wallet_key_val_store.py tests/wallet/test_wallet_retry.py tests/wallet/test_wallet_store.py tests/wallet/test_wallet_user_store.py - - - name: Process coverage data - run: | - venv/bin/coverage combine --rcfile=.coveragerc .coverage.* - venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml - mkdir coverage_reports - cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}" - cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml" - venv/bin/coverage report --rcfile=.coveragerc --show-missing - - - name: Publish coverage - uses: actions/upload-artifact@v3 - with: - name: coverage - path: coverage_reports/* - if-no-files-found: error -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# diff --git a/.github/workflows/build-test-macos-weight_proof.yml b/.github/workflows/build-test-macos-weight_proof.yml deleted file mode 100644 index 099b37529..000000000 --- a/.github/workflows/build-test-macos-weight_proof.yml +++ /dev/null @@ -1,117 +0,0 @@ -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# -name: MacOS weight_proof Test - -on: - push: - branches: - - 'long_lived/**' - - main - - 'release/**' - tags: - - '**' - pull_request: - branches: - - '**' - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -jobs: - build: - name: MacOS weight_proof Tests - runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: ['3.9', '3.10'] - os: [macOS-latest] - env: - CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet - JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_weight_proof - - steps: - - name: Checkout Code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - - name: Create keychain for CI use - run: | - security create-keychain -p foo chiachain - security default-keychain -s chiachain - security unlock-keychain -p foo chiachain - security set-keychain-settings -t 7200 -u chiachain - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v3 - 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: Cache test blocks and plots - uses: actions/cache@v2 - id: test-blocks-plots - with: - path: | - ${{ github.workspace }}/.chia/blocks - ${{ github.workspace }}/.chia/test-plots - key: 0.29.0 - - - name: Checkout test blocks and plots - if: steps.test-blocks-plots.outputs.cache-hit != 'true' - run: | - wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf - - mkdir ${{ github.workspace }}/.chia - mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: | - brew install boost - sh install.sh -d - -# Omitted installing Timelord - - - name: Test weight_proof code with pytest - run: | - . ./activate - venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/weight_proof/test_weight_proof.py - - - name: Process coverage data - run: | - venv/bin/coverage combine --rcfile=.coveragerc .coverage.* - venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml - mkdir coverage_reports - cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}" - cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml" - venv/bin/coverage report --rcfile=.coveragerc --show-missing - - - name: Publish coverage - uses: actions/upload-artifact@v3 - with: - name: coverage - path: coverage_reports/* - if-no-files-found: error -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# diff --git a/.github/workflows/build-test-ubuntu-blockchain.yml b/.github/workflows/build-test-ubuntu-blockchain.yml deleted file mode 100644 index 44ae181ad..000000000 --- a/.github/workflows/build-test-ubuntu-blockchain.yml +++ /dev/null @@ -1,119 +0,0 @@ -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# -name: Ubuntu blockchain Test - -on: - push: - branches: - - 'long_lived/**' - - main - - 'release/**' - tags: - - '**' - pull_request: - branches: - - '**' - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -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', '3.10'] - os: [ubuntu-latest] - env: - CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet - JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_blockchain - - steps: - - name: Checkout Code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - - name: Cache npm - uses: actions/cache@v3 - 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@v3 - with: - path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: Cache test blocks and plots - uses: actions/cache@v2 - id: test-blocks-plots - with: - path: | - ${{ github.workspace }}/.chia/blocks - ${{ github.workspace }}/.chia/test-plots - key: 0.29.0 - - - name: Checkout test blocks and plots - if: steps.test-blocks-plots.outputs.cache-hit != 'true' - run: | - wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf - - mkdir ${{ github.workspace }}/.chia - mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: | - sh install.sh -d - -# Omitted installing Timelord - - - name: Test blockchain code with pytest - run: | - . ./activate - venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/blockchain/test_blockchain.py tests/blockchain/test_blockchain_transactions.py - - - name: Process coverage data - run: | - venv/bin/coverage combine --rcfile=.coveragerc .coverage.* - venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml - mkdir coverage_reports - cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}" - cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml" - venv/bin/coverage report --rcfile=.coveragerc --show-missing - - - name: Publish coverage - uses: actions/upload-artifact@v3 - with: - name: coverage - path: coverage_reports/* - if-no-files-found: error - -# Omitted resource usage check - -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# diff --git a/.github/workflows/build-test-ubuntu-clvm.yml b/.github/workflows/build-test-ubuntu-clvm.yml deleted file mode 100644 index ee7c24ea9..000000000 --- a/.github/workflows/build-test-ubuntu-clvm.yml +++ /dev/null @@ -1,105 +0,0 @@ -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# -name: Ubuntu clvm Test - -on: - push: - branches: - - 'long_lived/**' - - main - - 'release/**' - tags: - - '**' - pull_request: - branches: - - '**' - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -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', '3.10'] - os: [ubuntu-latest] - env: - CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet - JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_clvm - - steps: - - name: Checkout Code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - - name: Cache npm - uses: actions/cache@v3 - 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@v3 - 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: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: | - sh install.sh -d - -# Omitted installing Timelord - - - name: Test clvm code with pytest - run: | - . ./activate - venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/clvm/test_chialisp_deserialization.py tests/clvm/test_clvm_compilation.py tests/clvm/test_clvm_step.py tests/clvm/test_program.py tests/clvm/test_puzzle_compression.py tests/clvm/test_puzzle_drivers.py tests/clvm/test_puzzles.py tests/clvm/test_serialized_program.py tests/clvm/test_singletons.py tests/clvm/test_spend_sim.py - - - name: Process coverage data - run: | - venv/bin/coverage combine --rcfile=.coveragerc .coverage.* - venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml - mkdir coverage_reports - cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}" - cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml" - venv/bin/coverage report --rcfile=.coveragerc --show-missing - - - name: Publish coverage - uses: actions/upload-artifact@v3 - with: - name: coverage - path: coverage_reports/* - if-no-files-found: error - -# Omitted resource usage check - -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# diff --git a/.github/workflows/build-test-ubuntu-core-cmds.yml b/.github/workflows/build-test-ubuntu-core-cmds.yml deleted file mode 100644 index ef7e77acd..000000000 --- a/.github/workflows/build-test-ubuntu-core-cmds.yml +++ /dev/null @@ -1,105 +0,0 @@ -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# -name: Ubuntu core-cmds Test - -on: - push: - branches: - - 'long_lived/**' - - main - - 'release/**' - tags: - - '**' - pull_request: - branches: - - '**' - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -jobs: - build: - name: Ubuntu core-cmds Test - runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: ['3.7', '3.8', '3.9', '3.10'] - os: [ubuntu-latest] - env: - CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet - JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_core-cmds - - steps: - - name: Checkout Code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - - name: Cache npm - uses: actions/cache@v3 - 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@v3 - 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: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: | - sh install.sh -d - -# Omitted installing Timelord - - - name: Test core-cmds code with pytest - run: | - . ./activate - venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/core/cmds/test_keys.py tests/core/cmds/test_wallet.py - - - name: Process coverage data - run: | - venv/bin/coverage combine --rcfile=.coveragerc .coverage.* - venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml - mkdir coverage_reports - cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}" - cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml" - venv/bin/coverage report --rcfile=.coveragerc --show-missing - - - name: Publish coverage - uses: actions/upload-artifact@v3 - with: - name: coverage - path: coverage_reports/* - if-no-files-found: error - -# Omitted resource usage check - -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# 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 3f3ceba22..000000000 --- a/.github/workflows/build-test-ubuntu-core-consensus.yml +++ /dev/null @@ -1,105 +0,0 @@ -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# -name: Ubuntu core-consensus Test - -on: - push: - branches: - - 'long_lived/**' - - main - - 'release/**' - tags: - - '**' - pull_request: - branches: - - '**' - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -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', '3.10'] - os: [ubuntu-latest] - env: - CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet - JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_core-consensus - - steps: - - name: Checkout Code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - - name: Cache npm - uses: actions/cache@v3 - 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@v3 - 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: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: | - sh install.sh -d - -# Omitted installing Timelord - - - name: Test core-consensus code with pytest - run: | - . ./activate - venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/core/consensus/test_pot_iterations.py - - - name: Process coverage data - run: | - venv/bin/coverage combine --rcfile=.coveragerc .coverage.* - venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml - mkdir coverage_reports - cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}" - cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml" - venv/bin/coverage report --rcfile=.coveragerc --show-missing - - - name: Publish coverage - uses: actions/upload-artifact@v3 - with: - name: coverage - path: coverage_reports/* - if-no-files-found: error - -# Omitted resource usage check - -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# diff --git a/.github/workflows/build-test-ubuntu-core-custom_types.yml b/.github/workflows/build-test-ubuntu-core-custom_types.yml deleted file mode 100644 index e0bc3b06a..000000000 --- a/.github/workflows/build-test-ubuntu-core-custom_types.yml +++ /dev/null @@ -1,105 +0,0 @@ -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# -name: Ubuntu core-custom_types Test - -on: - push: - branches: - - 'long_lived/**' - - main - - 'release/**' - tags: - - '**' - pull_request: - branches: - - '**' - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -jobs: - build: - name: Ubuntu core-custom_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', '3.10'] - os: [ubuntu-latest] - env: - CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet - JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_core-custom_types - - steps: - - name: Checkout Code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - - name: Cache npm - uses: actions/cache@v3 - 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@v3 - 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: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: | - sh install.sh -d - -# Omitted installing Timelord - - - name: Test core-custom_types code with pytest - run: | - . ./activate - venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/core/custom_types/test_coin.py tests/core/custom_types/test_proof_of_space.py tests/core/custom_types/test_spend_bundle.py - - - name: Process coverage data - run: | - venv/bin/coverage combine --rcfile=.coveragerc .coverage.* - venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml - mkdir coverage_reports - cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}" - cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml" - venv/bin/coverage report --rcfile=.coveragerc --show-missing - - - name: Publish coverage - uses: actions/upload-artifact@v3 - with: - name: coverage - path: coverage_reports/* - if-no-files-found: error - -# Omitted resource usage check - -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# diff --git a/.github/workflows/build-test-ubuntu-core-daemon.yml b/.github/workflows/build-test-ubuntu-core-daemon.yml deleted file mode 100644 index fe5be278b..000000000 --- a/.github/workflows/build-test-ubuntu-core-daemon.yml +++ /dev/null @@ -1,123 +0,0 @@ -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# -name: Ubuntu core-daemon Test - -on: - push: - branches: - - 'long_lived/**' - - main - - 'release/**' - tags: - - '**' - pull_request: - branches: - - '**' - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -jobs: - build: - name: Ubuntu core-daemon Test - runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: ['3.7', '3.8', '3.9', '3.10'] - os: [ubuntu-latest] - env: - CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet - JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_core-daemon - - steps: - - name: Checkout Code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - - name: Cache npm - uses: actions/cache@v3 - 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@v3 - with: - path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: Cache test blocks and plots - uses: actions/cache@v2 - id: test-blocks-plots - with: - path: | - ${{ github.workspace }}/.chia/blocks - ${{ github.workspace }}/.chia/test-plots - key: 0.29.0 - - - name: Checkout test blocks and plots - if: steps.test-blocks-plots.outputs.cache-hit != 'true' - run: | - wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf - - mkdir ${{ github.workspace }}/.chia - mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: | - sh install.sh -d - - - name: Install timelord - run: | - . ./activate - sh install-timelord.sh -n - ./vdf_bench square_asm 400000 - - - name: Test core-daemon code with pytest - run: | - . ./activate - venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 0 -m "not benchmark" tests/core/daemon/test_daemon.py - - - name: Process coverage data - run: | - venv/bin/coverage combine --rcfile=.coveragerc .coverage.* - venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml - mkdir coverage_reports - cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}" - cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml" - venv/bin/coverage report --rcfile=.coveragerc --show-missing - - - name: Publish coverage - uses: actions/upload-artifact@v3 - with: - name: coverage - path: coverage_reports/* - if-no-files-found: error - -# Omitted resource usage check - -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# 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 ac4553c55..000000000 --- a/.github/workflows/build-test-ubuntu-core-full_node-full_sync.yml +++ /dev/null @@ -1,119 +0,0 @@ -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# -name: Ubuntu core-full_node-full_sync Test - -on: - push: - branches: - - 'long_lived/**' - - main - - 'release/**' - tags: - - '**' - pull_request: - branches: - - '**' - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -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', '3.10'] - os: [ubuntu-latest] - env: - CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet - JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_core-full_node-full_sync - - steps: - - name: Checkout Code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - - name: Cache npm - uses: actions/cache@v3 - 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@v3 - with: - path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: Cache test blocks and plots - uses: actions/cache@v2 - id: test-blocks-plots - with: - path: | - ${{ github.workspace }}/.chia/blocks - ${{ github.workspace }}/.chia/test-plots - key: 0.29.0 - - - name: Checkout test blocks and plots - if: steps.test-blocks-plots.outputs.cache-hit != 'true' - run: | - wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf - - mkdir ${{ github.workspace }}/.chia - mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: | - sh install.sh -d - -# Omitted installing Timelord - - - name: Test core-full_node-full_sync code with pytest - run: | - . ./activate - venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" tests/core/full_node/full_sync/test_full_sync.py - - - name: Process coverage data - run: | - venv/bin/coverage combine --rcfile=.coveragerc .coverage.* - venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml - mkdir coverage_reports - cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}" - cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml" - venv/bin/coverage report --rcfile=.coveragerc --show-missing - - - name: Publish coverage - uses: actions/upload-artifact@v3 - with: - name: coverage - path: coverage_reports/* - if-no-files-found: error - -# Omitted resource usage check - -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# diff --git a/.github/workflows/build-test-ubuntu-core-full_node-stores.yml b/.github/workflows/build-test-ubuntu-core-full_node-stores.yml deleted file mode 100644 index 9a86369c9..000000000 --- a/.github/workflows/build-test-ubuntu-core-full_node-stores.yml +++ /dev/null @@ -1,122 +0,0 @@ -# -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme -# -name: Ubuntu core-full_node-stores Test - -on: - push: - branches: - - 'long_lived/**' - - main - - 'release/**' - tags: - - '**' - pull_request: - branches: - - '**' - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -jobs: - build: - name: Ubuntu core-full_node-stores Test - runs-on: ${{ matrix.os }} - timeout-minutes: 40 - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: ['3.7', '3.8', '3.9', '3.10'] - os: [ubuntu-latest] - env: - CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet - JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_core-full_node-stores - - steps: - - name: Checkout Code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - - name: Cache npm - uses: actions/cache@v3 - 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@v3 - with: - path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: Cache test blocks and plots - uses: actions/cache@v2 - id: test-blocks-plots - with: - path: | - ${{ github.workspace }}/.chia/blocks - ${{ github.workspace }}/.chia/test-plots - key: 0.29.0 - - - name: Checkout test blocks and plots - if: steps.test-blocks-plots.outputs.cache-hit != 'true' - run: | - wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf - - mkdir ${{ github.workspace }}/.chia - mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: | - sh install.sh -d - -# Omitted installing Timelord - - - name: Test core-full_node-stores code with pytest - run: | - . ./activate - venv/bin/coverage run --rcfile=.coveragerc --module pytest --durations=10 -n 4 -m "not benchmark" -p monitor tests/core/full_node/stores/test_block_store.py tests/core/full_node/stores/test_coin_store.py tests/core/full_node/stores/test_full_node_store.py tests/core/full_node/stores/test_hint_store.py tests/core/full_node/stores/test_sync_store.py - - - name: Process coverage data - run: | - venv/bin/coverage combine --rcfile=.coveragerc .coverage.* - venv/bin/coverage xml --rcfile=.coveragerc -o coverage.xml - mkdir coverage_reports - cp .coverage "coverage_reports/.coverage.${{ env.JOB_FILE_NAME }}" - cp coverage.xml "coverage_reports/coverage.${{ env.JOB_FILE_NAME }}.xml" - venv/bin/coverage report --rcfile=.coveragerc --show-missing - - - name: Publish coverage - uses: actions/upload-artifact@v3 - with: - name: coverage - path: coverage_reports/* - if-no-files-found: error - - - name: Check resource usage - run: | - sqlite3 -readonly -separator " " .pymon "select item,cpu_usage,total_time,mem_usage from TEST_METRICS order by mem_usage desc;" >metrics.out - ./tests/check_pytest_monitor_output.py metrics.out - ./tests/check_pytest_monitor_output.py ${{ github.workspace }}\chia-blockchain-gui\release-builds\windows-installer\ChiaSetup-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}.exe.sha256 - ls ${{ github.workspace }}\chia-blockchain-gui\release-builds\windows-installer\ - - - name: Install py3createtorrent - if: startsWith(github.ref, 'refs/tags/') - run: | - pip3 install py3createtorrent - - - name: Create torrent - if: startsWith(github.ref, 'refs/tags/') - run: | - py3createtorrent -f -t udp://tracker.opentrackr.org:1337/announce ${{ github.workspace }}\chia-blockchain-gui\release-builds\windows-installer\ChiaSetup-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}.exe -o ${{ github.workspace }}\chia-blockchain-gui\release-builds\windows-installer\ChiaSetup-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}.exe.torrent --webseed https://download.chia.net/install/ChiaSetup-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}.exe - ls - - - name: Upload Beta Installer - if: steps.check_secrets.outputs.HAS_AWS_SECRET && github.ref == 'refs/heads/main' - env: - CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }} - run: | - aws s3 cp ${{ github.workspace }}\chia-blockchain-gui\release-builds\windows-installer\ChiaSetup-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}.exe s3://download.chia.net/beta/ChiaSetup-latest-beta.exe - aws s3 cp ${{ github.workspace }}\chia-blockchain-gui\release-builds\windows-installer\ChiaSetup-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}.exe.sha256 s3://download.chia.net/beta/ChiaSetup-latest-beta.exe.sha256 - - - name: Upload Release Files - if: steps.check_secrets.outputs.HAS_AWS_SECRET && startsWith(github.ref, 'refs/tags/') - env: - AWS_ACCESS_KEY_ID: ${{ secrets.INSTALLER_UPLOAD_KEY }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.INSTALLER_UPLOAD_SECRET }} - run: | - aws s3 cp ${{ github.workspace }}\chia-blockchain-gui\release-builds\windows-installer\ChiaSetup-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}.exe s3://download.chia.net/install/ - aws s3 cp ${{ github.workspace }}\chia-blockchain-gui\release-builds\windows-installer\ChiaSetup-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}.exe.sha256 s3://download.chia.net/install/ - aws s3 cp ${{ github.workspace }}\chia-blockchain-gui\release-builds\windows-installer\ChiaSetup-${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}.exe.torrent s3://download.chia.net/torrents/ - - - name: Get tag name - if: startsWith(github.ref, 'refs/tags/') - id: tag-name - run: | - echo "::set-output name=TAG_NAME::$(echo ${{ github.ref }} | cut -d'/' -f 3)" - echo "::set-output name=REPO_NAME::$(echo ${{ github.repository }} | cut -d'/' -f 2)" - - - name: Mark installer complete - if: startsWith(github.ref, 'refs/tags/') + FLAX_INSTALLER_VERSION: ${{ steps.version_number.outputs.FLAX_INSTALLER_VERSION }} run: | - $headers = @{ - Authorization="Bearer ${{ secrets.GLUE_ACCESS_TOKEN }}" - } - $data = @{ - chia_ref='${{ steps.tag-name.outputs.TAG_NAME }}' - } - $json = $data | ConvertTo-Json - $response = Invoke-RestMethod '${{ secrets.GLUE_API_URL }}/api/v1/${{ steps.tag-name.outputs.REPO_NAME }}/${{ steps.tag-name.outputs.TAG_NAME }}/success/build-windows' -Method Post -Body $json -ContentType 'application/json' -Headers $headers + certutil.exe -hashfile ${{ github.workspace }}\flax-blockchain-gui\release-builds\windows-installer\FlaxSetup-${{ steps.version_number.outputs.FLAX_INSTALLER_VERSION }}.exe SHA256 > ${{ github.workspace }}\flax-blockchain-gui\release-builds\windows-installer\FlaxSetup-${{ steps.version_number.outputs.FLAX_INSTALLER_VERSION }}.exe.sha256 + ls ${{ github.workspace }}\flax-blockchain-gui\release-builds\windows-installer\ diff --git a/.github/workflows/check_wheel_availability.yaml b/.github/workflows/check_wheel_availability.yaml deleted file mode 100644 index c184cea71..000000000 --- a/.github/workflows/check_wheel_availability.yaml +++ /dev/null @@ -1,73 +0,0 @@ -name: Check Dependency Artifacts - -on: - push: - branches: - - 'long_lived/**' - - main - - 'release/**' - tags: - - '**' - pull_request: - branches: - - '**' - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -jobs: - check_dependency_artifacts: - name: ${{ matrix.os.name }} ${{ matrix.arch.name }} ${{ matrix.python-version }} - runs-on: ${{ matrix.os.runs-on[matrix.arch.matrix] }} - strategy: - fail-fast: false - matrix: - os: - - name: Linux - matrix: linux - runs-on: - intel: ubuntu-latest - arm: [linux, arm64] - - name: macOS - matrix: macos - runs-on: - intel: macos-latest - arm: [macos, arm64] - - name: Windows - matrix: windows - runs-on: - intel: windows-latest - arch: - - name: ARM64 - matrix: arm - - name: Intel - matrix: intel - python-version: ['3.7', '3.8', '3.9', '3.10'] - exclude: - - os: - matrix: macos - python-version: '3.7' - - os: - matrix: macos - arch: - matrix: arm - python-version: '3.8' - - os: - matrix: windows - arch: - matrix: arm - - steps: - - uses: Chia-Network/actions/clean-workspace@main - - - name: Checkout Code - uses: actions/checkout@v3 - - - uses: Chia-Network/actions/setup-python@main - with: - python-version: ${{ matrix.python-version }} - - - name: Check Wheel Availability - run: python build_scripts/check_dependency_artifacts.py diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index ef10b9689..000000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,75 +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: - - 'long_lived/**' - - main - - 'release/**' - pull_request: - # The branches below must be a subset of the branches above - branches: [ main ] - schedule: - - cron: '34 14 * * 3' - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -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@v3 - - # 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/conflict-check.yml b/.github/workflows/conflict-check.yml deleted file mode 100644 index 75db53f10..000000000 --- a/.github/workflows/conflict-check.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: "Conflict Check" -on: - # So that PRs touching the same files as the push are updated - push: - # So that the `dirtyLabel` is removed if conflicts are resolve - # We recommend `pull_request_target` so that github secrets are available. - # In `pull_request` we wouldn't be able to change labels of fork PRs - pull_request_target: - types: [synchronize] - -jobs: - main: - runs-on: ubuntu-latest - steps: - - name: check if prs are behind main - uses: eps1lon/actions-label-merge-conflict@v2.0.0 - with: - dirtyLabel: "merge_conflict" - repoToken: "${{ secrets.GITHUB_TOKEN }}" - commentOnDirty: "This pull request has conflicts, please resolve those before we can evaluate the pull request." - commentOnClean: "Conflicts have been resolved. A maintainer will review the pull request shortly." diff --git a/.github/workflows/mozilla-ca-cert.yml b/.github/workflows/mozilla-ca-cert.yml deleted file mode 100644 index c616df40f..000000000 --- a/.github/workflows/mozilla-ca-cert.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: "Update Mozilla CA sub module" -on: - workflow_dispatch: - branches: - - $default-branch - -jobs: - update_ca_module: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - ref: "${{ github.event.inputs.chia_ref }}" - repository: chia-network/chia-blockchain - submodules: recursive - token: "${{ secrets.GITHUB_TOKEN }}" - - name: "Add changes to new branch" - run: | - cd ./mozilla-ca - git pull origin main - - name: "Create Pull Request" - uses: peter-evans/create-pull-request@v4 - with: - base: main - body: "Newest Mozilla CA cert" - branch: mozilla-ca-updates - commit-message: "adding ca updates" - delete-branch: true - reviewers: "wjblanke,emlowe" - assignees: "wallentx" - title: "CA Cert updates" - token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml deleted file mode 100644 index ef02b4a13..000000000 --- a/.github/workflows/pre-commit.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: pre-commit - -on: - pull_request: - push: - branches: - - 'long_lived/**' - - main - - 'release/**' - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -jobs: - pre-commit: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v3 - - uses: pre-commit/action@v2.0.3 diff --git a/.github/workflows/stale-issue.yml b/.github/workflows/stale-issue.yml deleted file mode 100644 index 76c816c4e..000000000 --- a/.github/workflows/stale-issue.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: 'Close stale issues' -on: - schedule: - - cron: '0 11 * * *' - -jobs: - stale: - runs-on: ubuntu-latest - steps: - - uses: chia-network/stale@main - with: - operations-per-run: 10000 - ascending: true - days-before-issue-stale: 14 - days-before-issue-close: 7 - days-before-pr-stale: 45 - days-before-pr-close: -1 - exempt-all-pr-milestones: true - exempt-all-issue-milestones: true - exempt-all-assignees: true - stale-issue-label: stale-issue - stale-pr-label: stale-pr - remove-stale-when-updated: true - stale-issue-message: >- - This issue has not been updated in 14 days and is now flagged - as stale. If this issue is still affecting you and in need - of further review, please comment on it with an update to - keep it from auto closing in 7 days. - close-issue-message: >- - This issue was automatically closed because it has been - flagged as stale, and subsequently passed 7 days with no - further activity from the submitter or watchers. - stale-pr-message: >- - This PR has been flagged as stale due to no activity for over - 60 days. It will not be automatically closed, but it has been - given a stale-pr label and should be manually reviewed by the - relevant parties. diff --git a/.github/workflows/start-release.yml b/.github/workflows/start-release.yml deleted file mode 100644 index 40aaac1ff..000000000 --- a/.github/workflows/start-release.yml +++ /dev/null @@ -1,23 +0,0 @@ -# Starts a release for the given ref on the Glue API -name: Start Release -on: - workflow_dispatch: - push: - tags: - - '**' - -jobs: - start_release: - name: Starts release process in Glue API - runs-on: [glue-notify] - steps: - - name: Get tag name - if: startsWith(github.ref, 'refs/tags/') - id: tag-name - run: | - echo "::set-output name=TAG_NAME::$(echo ${{ github.ref }} | cut -d'/' -f 3)" - echo "::set-output name=REPO_NAME::$(echo ${{ github.repository }} | cut -d'/' -f 2)" - - name: Start release - if: startsWith(github.ref, 'refs/tags/') - run: | - curl -s -XPOST -H "Authorization: Bearer ${{ secrets.GLUE_ACCESS_TOKEN }}" --data '{"chia_ref": "${{ steps.tag-name.outputs.TAG_NAME }}"}' ${{ secrets.GLUE_API_URL }}/api/v1/${{ steps.tag-name.outputs.REPO_NAME }}/${{ steps.tag-name.outputs.TAG_NAME }}/start diff --git a/.github/workflows/super-linter.yml b/.github/workflows/super-linter.yml deleted file mode 100644 index bab2be8bc..000000000 --- a/.github/workflows/super-linter.yml +++ /dev/null @@ -1,91 +0,0 @@ ---- -########################### -########################### -## Linter GitHub Actions ## -########################### -########################### -name: GitHub 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: - - 'long_lived/**' - - main - - 'release/**' - tags: - - '**' - pull_request: - branches: - - '**' - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -############### -# 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@v3 - - ################################ - # Run Linter against code base # - ################################ - - name: Lint Code Base - uses: github/super-linter@v4.9.2 -# uses: docker://github/super-linter:v3.10.2 - env: - VALIDATE_ALL_CODEBASE: true - DEFAULT_BRANCH: main - LINTER_RULES_PATH: . - MARKDOWN_CONFIG_FILE: .markdown-lint.yml - PYTHON_FLAKE8_CONFIG_FILE: .flake8 - PYTHON_ISORT_CONFIG_FILE: .isort.cfg - PYTHON_PYLINT_CONFIG_FILE: pylintrc - 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_PYLINT: true - VALIDATE_PYTHON_FLAKE8: 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/test-install-scripts.yml b/.github/workflows/test-install-scripts.yml deleted file mode 100644 index 58a86d14c..000000000 --- a/.github/workflows/test-install-scripts.yml +++ /dev/null @@ -1,258 +0,0 @@ -name: Test Install Scripts - -on: - push: - branches: - - 'long_lived/**' - - main - - 'release/**' - tags: - - '**' - pull_request: - branches: - - '**' - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -jobs: - test_scripts: - name: Test Install Scripts - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - max-parallel: 4 - matrix: - python-version: [3.9] - os: [macOS-latest, ubuntu-latest] - - steps: - - name: Checkout Code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Python environment - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: sh install.sh - - - name: Run install-gui script - run: | - . ./activate - sh install-gui.sh - - test_scripts_in_docker: - name: Test Install Scripts ${{ matrix.distribution.name }} - runs-on: ${{ matrix.os }} - container: ${{ matrix.distribution.url }} - strategy: - fail-fast: false - max-parallel: 4 - matrix: - os: [ubuntu-latest] - distribution: - - name: amazonlinux:2 - type: amazon - url: "docker://amazonlinux:2" - - name: arch:latest - type: arch - url: "docker://archlinux:latest" - - name: centos:7 - type: centos - url: "docker://centos:7" -# commented out until we decide what to do with this, it fails consistently -# - name: centos:8 -# type: centos -# url: "docker://centos:8" - - name: debian:buster - type: debian - # https://packages.debian.org/buster/python/python3 (3.7) - url: "docker://debian:buster" - - name: debian:bullseye - type: debian - # https://packages.debian.org/bullseye/python/python3 (3.9) - url: "docker://debian:bullseye" - - name: debian:bookworm - type: debian - # https://packages.debian.org/bookworm/python/python3 (3.10) - url: "docker://debian:bookworm" - - name: fedora:34 - type: fedora - # (34, 3.9) https://packages.fedoraproject.org/search?query=python3&releases=Fedora+34&start=0 - url: "docker://fedora:34" - - name: fedora:35 - type: fedora - # (35, 3.10) https://packages.fedoraproject.org/search?query=python3&releases=Fedora+35&start=0 - url: "docker://fedora:35" - - name: fedora:36 - type: fedora - # (36, 3.10) https://packages.fedoraproject.org/search?query=python3&releases=Fedora+36&start=0 - url: "docker://fedora:36" - - name: rockylinux:8 - type: rocky - url: "docker://rockylinux:8" - - name: ubuntu:bionic (18.04) - type: ubuntu - # https://packages.ubuntu.com/bionic/python3.7 (18.04, 3.7) - url: "docker://ubuntu:bionic" - - name: ubuntu:focal (20.04) - type: ubuntu - # https://packages.ubuntu.com/focal/python3 (20.04, 3.8) - url: "docker://ubuntu:focal" - - name: ubuntu:hirsute (21.04) - type: ubuntu - # https://packages.ubuntu.com/hirsute/python3 (21.04, 3.9) - url: "docker://ubuntu:hirsute" - - name: ubuntu:impish (21.10) - type: ubuntu - # https://packages.ubuntu.com/impish/python3 (21.10, 3.9) - url: "docker://ubuntu:impish" - - name: ubuntu:jammy (22.04) - type: ubuntu - # https://packages.ubuntu.com/jammy/python3 (22.04, 3.10) - url: "docker://ubuntu:jammy" - - name: linuxmintd/mint19.1-amd64 (Tessa) - type: mint - # 3.6 default with an option for 3.7 - url: "docker://linuxmintd/mint19.1-amd64" - - name: linuxmintd/mint19.2-amd64 (Tina) - type: mint - # 3.6 default with an option for 3.7 - url: "docker://linuxmintd/mint19.2-amd64" - - name: linuxmintd/mint19.3-amd64 (Tricia) - type: mint - # 3.6 default with an option for 3.7 - url: "docker://linuxmintd/mint19.3-amd64" - - name: linuxmintd/mint20-amd64 (Ulyana) - type: mint - # 3.8 - url: "docker://linuxmintd/mint20-amd64" - - name: linuxmintd/mint20.1-amd64 (Ulyssa) - type: mint - # 3.8 - url: "docker://linuxmintd/mint20.1-amd64" - - name: linuxmintd/mint20.2-amd64 (Uma) - type: mint - # 3.8 - url: "docker://linuxmintd/mint20.2-amd64" - - name: linuxmintd/mint20.3-amd64 (Una) - type: mint - # 3.8 - url: "docker://linuxmintd/mint20.3-amd64" -# The Linux Mint 21 docker image reports as 20.3 but has different Python. -# Uncomment after adapting to handle this or upstream fixing it. -# Also, Linux Mint 21 is not released as of this change. -# - name: linuxmintd/mint21-amd64 -# type: linuxmint -# # 3.10 default with an option for 3.9 -# url: "docker://linuxmintd/mint21-amd64" - - steps: - - name: Prepare Amazon Linux - if: ${{ matrix.distribution.type == 'amazon' }} - run: | - yum install --assumeyes git sudo - - - name: Prepare Arch - if: ${{ matrix.distribution.type == 'arch' }} - run: | - pacman --noconfirm --refresh base --sync git sudo - # The behavior we follow in install.sh is unique with Arch in that - # we leave it to the user to install the appropriate version of python, - # so we need to install python here in order for the test to succeed. - pacman --noconfirm -U --needed https://archive.archlinux.org/packages/p/python/python-3.9.9-1-x86_64.pkg.tar.zst - - - name: Prepare CentOS - if: ${{ matrix.distribution.type == 'centos' }} - # Installing Git from yum brings git@1.x which doesn't work on actions/checkout. - # So install git@2.x from source - run: | - if [ "$(rpm --eval %{centos_ver})" = "8" ]; then - sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-Linux-*; - fi - yum update -y - yum install -y sudo gcc autoconf make wget curl-devel expat-devel gettext-devel openssl-devel perl-devel zlib-devel - wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.29.0.tar.gz - tar zxf git-2.29.0.tar.gz - pushd git-2.29.0 - make configure - ./configure --prefix=/usr/local - make all - make install - popd - - - name: Prepare Debian - if: ${{ matrix.distribution.type == 'debian' }} - env: - DEBIAN_FRONTEND: noninteractive - run: | - apt-get --yes update - apt-get install --yes git lsb-release sudo - - - name: Prepare Fedora - if: ${{ matrix.distribution.type == 'fedora' }} - run: | - yum install --assumeyes git - - - name: Prepare Rocky - if: ${{ matrix.distribution.type == 'rocky' }} - run: | - yum install --assumeyes git sudo - - - name: Prepare Ubuntu - if: ${{ matrix.distribution.type == 'ubuntu' }} - env: - DEBIAN_FRONTEND: noninteractive - run: | - # for bionic - apt-get --yes update - apt-get install --yes software-properties-common - add-apt-repository --yes ppa:git-core/ppa - apt-get --yes update - apt-get install --yes git lsb-release sudo - - - name: Prepare Linux Mint - if: ${{ matrix.distribution.type == 'mint' }} - env: - DEBIAN_FRONTEND: noninteractive - run: | - # for 19.* - apt-get --yes update - # for 19.3 to avoid - # Setting up software-properties-common (2.0.0.2) ... - # Traceback (most recent call last): - # File "/usr/lib/linuxmint/mintSources/mintSources.py", line 11, in - # import requests - # ModuleNotFoundError: No module named 'requests' - apt-get install --yes python3-requests - apt-get install --yes software-properties-common - add-apt-repository --yes ppa:git-core/ppa - apt-get --yes update - apt-get install --yes git lsb-release sudo - - - name: Add safe git directory - run: git config --global --add safe.directory $GITHUB_WORKSPACE - - # after installing git so we use that copy - - name: Checkout Code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Run install script - env: - INSTALL_PYTHON_VERSION: ${{ matrix.python-version }} - run: sh install.sh -a - - - name: Run chia --help - run: | - . ./activate - chia --help diff --git a/.github/workflows/trigger-docker-dev.yml b/.github/workflows/trigger-docker-dev.yml deleted file mode 100644 index 7fd1c70fe..000000000 --- a/.github/workflows/trigger-docker-dev.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Trigger Dev Docker Build - -on: - push: - branches: - - 'long_lived/**' - - 'release/**' - pull_request: - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -jobs: - trigger: - name: Trigger building a new dev tag for the chia-docker image - runs-on: ubuntu-latest - steps: - - name: Test for secrets access - id: check_secrets - shell: bash - run: | - unset HAS_SECRET - - if [ -n "$GLUE_ACCESS_TOKEN" ]; then HAS_SECRET='true' ; fi - echo ::set-output name=HAS_SECRET::${HAS_SECRET} - env: - GLUE_ACCESS_TOKEN: "${{ secrets.GLUE_ACCESS_TOKEN }}" - - - name: Trigger docker dev workflow via github-glue - if: steps.check_secrets.outputs.HAS_SECRET - run: | - curl -s -XPOST -H "Authorization: Bearer ${{ secrets.GLUE_ACCESS_TOKEN }}" --data '{"sha":"${{ github.sha }}"}' ${{ secrets.GLUE_API_URL }}/api/v1/docker-build-dev/${{ github.sha }}/start - curl -s -XPOST -H "Authorization: Bearer ${{ secrets.GLUE_ACCESS_TOKEN }}" --data '{"sha":"${{ github.sha }}"}' ${{ secrets.GLUE_API_URL }}/api/v1/docker-build-dev/${{ github.sha }}/success/build-dev diff --git a/.github/workflows/trigger-docker-main.yml b/.github/workflows/trigger-docker-main.yml deleted file mode 100644 index 932f853ec..000000000 --- a/.github/workflows/trigger-docker-main.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Trigger Main Docker Build - -on: - push: - branches: - - main - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -jobs: - trigger: - name: Trigger building a new `main` tag for the chia-docker image - runs-on: ubuntu-latest - steps: - - name: Trigger docker main workflow via github-glue - run: | - curl -s -XPOST -H "Authorization: Bearer ${{ secrets.GLUE_ACCESS_TOKEN }}" --data '{}' ${{ secrets.GLUE_API_URL }}/api/v1/docker-build-main/${{ github.sha }}/start - curl -s -XPOST -H "Authorization: Bearer ${{ secrets.GLUE_ACCESS_TOKEN }}" --data '{}' ${{ secrets.GLUE_API_URL }}/api/v1/docker-build-main/${{ github.sha }}/success/build-main diff --git a/.github/workflows/upload-pypi-source.yml b/.github/workflows/upload-pypi-source.yml deleted file mode 100644 index 2795699b0..000000000 --- a/.github/workflows/upload-pypi-source.yml +++ /dev/null @@ -1,90 +0,0 @@ -name: Lint and upload source distribution - -on: - push: - branches: - - 'long_lived/**' - - main - - 'release/**' - tags: - - '**' - pull_request: - branches: - - '**' - -concurrency: - # SHA is added to the end if on `main` to let all main workflows run - group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }} - cancel-in-progress: true - -jobs: - upload_source_dist: - name: Lint and Upload source distribution - runs-on: [ubuntu-latest] - timeout-minutes: 30 - - steps: - - name: Checkout Code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - submodules: recursive - - - uses: actions/setup-python@v3 - 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 setuptools wheel - python -m pip install .[dev] - - - name: Lint source with black - run: | - black --check --diff . - - - name: Lint source with flake8 - run: | - flake8 chia tests - - - name: Lint source with mypy - run: | - mypy - - - name: Build source distribution - run: | - python -m build --sdist --outdir dist . - - - name: Upload artifacts - uses: actions/upload-artifact@v3 - with: - name: dist - path: ./dist - - - 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 f70408d1f..048fd6db4 100644 --- a/.gitignore +++ b/.gitignore @@ -24,7 +24,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 @@ -50,7 +50,7 @@ activate .idea # Packaging -chia-blockchain.tar.gz +flax-blockchain.tar.gz # Timelord utilities vdf_bench @@ -76,18 +76,18 @@ main.sym *.pstats # 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 -# chia-blockchain wheel build folder +# flax-blockchain wheel build folder build/ # Temporal `n` (node version manager) directory diff --git a/.gitmodules b/.gitmodules index 0f84cbc8b..98a684682 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,8 +1,6 @@ -[submodule "chia-blockchain-gui"] - path = chia-blockchain-gui - url = https://github.com/Chia-Network/chia-blockchain-gui.git - branch = pools [submodule "mozilla-ca"] path = mozilla-ca url = https://github.com/Chia-Network/mozilla-ca.git - branch = main +[submodule "flax-blockchain-gui"] + path = flax-blockchain-gui + url = https://github.com/Flax-Network/flax-blockchain-gui.git diff --git a/.isort.cfg b/.isort.cfg index 1105b2c5c..87ed221de 100644 --- a/.isort.cfg +++ b/.isort.cfg @@ -4,135 +4,135 @@ profile=black skip_gitignore=true # venv/bin/isort --check . |& sed -n "s;ERROR: ${PWD}/\(.*\) Imports are.*; \1;p" | sort | uniq extend_skip= - chia/clvm/spend_sim.py - chia/cmds/chia.py - chia/cmds/db.py - chia/cmds/db_upgrade_func.py - chia/cmds/farm_funcs.py - chia/cmds/farm.py - chia/cmds/init_funcs.py - chia/cmds/init.py - chia/cmds/keys_funcs.py - chia/cmds/keys.py - chia/cmds/netspace.py - chia/cmds/passphrase_funcs.py - chia/cmds/passphrase.py - chia/cmds/plotnft_funcs.py - chia/cmds/plotnft.py - chia/cmds/plotters.py - chia/cmds/show.py - chia/cmds/start_funcs.py - chia/cmds/start.py - chia/cmds/wallet_funcs.py - chia/cmds/wallet.py - chia/daemon/keychain_proxy.py - chia/daemon/keychain_server.py - chia/daemon/server.py - chia/full_node/block_height_map.py - chia/full_node/block_store.py - chia/full_node/bundle_tools.py - chia/full_node/coin_store.py - chia/full_node/full_node_api.py - chia/full_node/full_node.py - chia/full_node/generator.py - chia/full_node/hint_store.py - chia/full_node/lock_queue.py - chia/full_node/mempool_check_conditions.py - chia/full_node/mempool_manager.py - chia/full_node/weight_proof.py - chia/introducer/introducer.py - chia/plotters/bladebit.py - chia/plotters/chiapos.py - chia/plotters/install_plotter.py - chia/plotters/madmax.py - chia/plotters/plotters.py - chia/pools/pool_puzzles.py - chia/pools/pool_wallet_info.py - chia/pools/pool_wallet.py - chia/protocols/pool_protocol.py - chia/protocols/protocol_state_machine.py - chia/rpc/full_node_rpc_client.py - chia/rpc/rpc_client.py - chia/rpc/wallet_rpc_api.py - chia/rpc/wallet_rpc_client.py - chia/seeder/crawler.py - chia/seeder/crawl_store.py - chia/seeder/dns_server.py - chia/server/address_manager_sqlite_store.py - chia/server/address_manager_store.py - chia/server/introducer_peers.py - chia/server/node_discovery.py - chia/server/peer_store_resolver.py - chia/server/reconnect_task.py - chia/server/start_service.py - chia/server/start_wallet.py - chia/simulator/simulator_constants.py - chia/simulator/start_simulator.py - chia/ssl/create_ssl.py - chia/timelord/timelord_launcher.py - chia/types/blockchain_format/program.py - chia/types/blockchain_format/proof_of_space.py - chia/types/blockchain_format/vdf.py - chia/types/coin_solution.py - chia/types/coin_spend.py - chia/types/full_block.py - chia/types/generator_types.py - chia/types/name_puzzle_condition.py - chia/types/spend_bundle.py - chia/util/bech32m.py - chia/util/byte_types.py - chia/util/chain_utils.py - chia/util/check_fork_next_block.py - chia/util/chia_logging.py - chia/util/condition_tools.py - chia/util/dump_keyring.py - chia/util/file_keyring.py - chia/util/files.py - chia/util/generator_tools.py - chia/util/keychain.py - chia/util/keyring_wrapper.py - chia/util/log_exceptions.py - chia/util/network.py - chia/util/profiler.py - chia/util/service_groups.py - chia/util/ssl_check.py - chia/util/ws_message.py - chia/wallet/cat_wallet/cat_info.py - chia/wallet/cat_wallet/cat_utils.py - chia/wallet/cat_wallet/cat_wallet.py - chia/wallet/derive_keys.py - chia/wallet/did_wallet/did_info.py - chia/wallet/did_wallet/did_wallet_puzzles.py - chia/wallet/did_wallet/did_wallet.py - chia/wallet/lineage_proof.py - chia/wallet/payment.py - chia/wallet/puzzles/load_clvm.py - chia/wallet/puzzles/prefarm/make_prefarm_ph.py - chia/wallet/puzzles/prefarm/spend_prefarm.py - chia/wallet/puzzles/puzzle_utils.py - chia/wallet/puzzles/singleton_top_layer.py - chia/wallet/puzzles/tails.py - chia/wallet/rl_wallet/rl_wallet.py - chia/wallet/sign_coin_spends.py - chia/wallet/trade_manager.py - chia/wallet/trade_record.py - chia/wallet/trading/offer.py - chia/wallet/trading/trade_store.py - chia/wallet/transaction_record.py - chia/wallet/util/compute_hints.py - chia/wallet/util/compute_memos.py - chia/wallet/util/debug_spend_bundle.py - chia/wallet/util/puzzle_compression.py - chia/wallet/util/wallet_sync_utils.py - chia/wallet/wallet_blockchain.py - chia/wallet/wallet_coin_store.py - chia/wallet/wallet_interested_store.py - chia/wallet/wallet_node_api.py - chia/wallet/wallet_node.py - chia/wallet/wallet_pool_store.py - chia/wallet/wallet.py - chia/wallet/wallet_state_manager.py - chia/wallet/wallet_weight_proof_handler.py + flax/clvm/spend_sim.py + flax/cmds/flax.py + flax/cmds/db.py + flax/cmds/db_upgrade_func.py + flax/cmds/farm_funcs.py + flax/cmds/farm.py + flax/cmds/init_funcs.py + flax/cmds/init.py + flax/cmds/keys_funcs.py + flax/cmds/keys.py + flax/cmds/netspace.py + flax/cmds/passphrase_funcs.py + flax/cmds/passphrase.py + flax/cmds/plotnft_funcs.py + flax/cmds/plotnft.py + flax/cmds/plotters.py + flax/cmds/show.py + flax/cmds/start_funcs.py + flax/cmds/start.py + flax/cmds/wallet_funcs.py + flax/cmds/wallet.py + flax/daemon/keychain_proxy.py + flax/daemon/keychain_server.py + flax/daemon/server.py + flax/full_node/block_height_map.py + flax/full_node/block_store.py + flax/full_node/bundle_tools.py + flax/full_node/coin_store.py + flax/full_node/full_node_api.py + flax/full_node/full_node.py + flax/full_node/generator.py + flax/full_node/hint_store.py + flax/full_node/lock_queue.py + flax/full_node/mempool_check_conditions.py + flax/full_node/mempool_manager.py + flax/full_node/weight_proof.py + flax/introducer/introducer.py + flax/plotters/bladebit.py + flax/plotters/chiapos.py + flax/plotters/install_plotter.py + flax/plotters/madmax.py + flax/plotters/plotters.py + flax/pools/pool_puzzles.py + flax/pools/pool_wallet_info.py + flax/pools/pool_wallet.py + flax/protocols/pool_protocol.py + flax/protocols/protocol_state_machine.py + flax/rpc/full_node_rpc_client.py + flax/rpc/rpc_client.py + flax/rpc/wallet_rpc_api.py + flax/rpc/wallet_rpc_client.py + flax/seeder/crawler.py + flax/seeder/crawl_store.py + flax/seeder/dns_server.py + flax/server/address_manager_sqlite_store.py + flax/server/address_manager_store.py + flax/server/introducer_peers.py + flax/server/node_discovery.py + flax/server/peer_store_resolver.py + flax/server/reconnect_task.py + flax/server/start_service.py + flax/server/start_wallet.py + flax/simulator/simulator_constants.py + flax/simulator/start_simulator.py + flax/ssl/create_ssl.py + flax/timelord/timelord_launcher.py + flax/types/blockchain_format/program.py + flax/types/blockchain_format/proof_of_space.py + flax/types/blockchain_format/vdf.py + flax/types/coin_solution.py + flax/types/coin_spend.py + flax/types/full_block.py + flax/types/generator_types.py + flax/types/name_puzzle_condition.py + flax/types/spend_bundle.py + flax/util/bech32m.py + flax/util/byte_types.py + flax/util/chain_utils.py + flax/util/check_fork_next_block.py + flax/util/flax_logging.py + flax/util/condition_tools.py + flax/util/dump_keyring.py + flax/util/file_keyring.py + flax/util/files.py + flax/util/generator_tools.py + flax/util/keychain.py + flax/util/keyring_wrapper.py + flax/util/log_exceptions.py + flax/util/network.py + flax/util/profiler.py + flax/util/service_groups.py + flax/util/ssl_check.py + flax/util/ws_message.py + flax/wallet/cat_wallet/cat_info.py + flax/wallet/cat_wallet/cat_utils.py + flax/wallet/cat_wallet/cat_wallet.py + flax/wallet/derive_keys.py + flax/wallet/did_wallet/did_info.py + flax/wallet/did_wallet/did_wallet_puzzles.py + flax/wallet/did_wallet/did_wallet.py + flax/wallet/lineage_proof.py + flax/wallet/payment.py + flax/wallet/puzzles/load_clvm.py + flax/wallet/puzzles/prefarm/make_prefarm_ph.py + flax/wallet/puzzles/prefarm/spend_prefarm.py + flax/wallet/puzzles/puzzle_utils.py + flax/wallet/puzzles/singleton_top_layer.py + flax/wallet/puzzles/tails.py + flax/wallet/rl_wallet/rl_wallet.py + flax/wallet/sign_coin_spends.py + flax/wallet/trade_manager.py + flax/wallet/trade_record.py + flax/wallet/trading/offer.py + flax/wallet/trading/trade_store.py + flax/wallet/transaction_record.py + flax/wallet/util/compute_hints.py + flax/wallet/util/compute_memos.py + flax/wallet/util/debug_spend_bundle.py + flax/wallet/util/puzzle_compression.py + flax/wallet/util/wallet_sync_utils.py + flax/wallet/wallet_blockchain.py + flax/wallet/wallet_coin_store.py + flax/wallet/wallet_interested_store.py + flax/wallet/wallet_node_api.py + flax/wallet/wallet_node.py + flax/wallet/wallet_pool_store.py + flax/wallet/wallet.py + flax/wallet/wallet_state_manager.py + flax/wallet/wallet_weight_proof_handler.py tests/blockchain/test_blockchain.py tests/blockchain/test_blockchain_transactions.py tests/block_tools.py @@ -140,7 +140,7 @@ extend_skip= tests/build-workflows.py tests/clvm/benchmark_costs.py tests/clvm/coin_store.py - tests/clvm/test_chialisp_deserialization.py + tests/clvm/test_flaxlisp_deserialization.py tests/clvm/test_program.py tests/clvm/test_puzzle_compression.py tests/clvm/test_serialized_program.py diff --git a/BUILD_TIMELORD.md b/BUILD_TIMELORD.md index 51ba6064a..1d0f9e4ae 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. @@ -14,7 +14,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 deleted file mode 100644 index 53efa8ebc..000000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,2185 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. - -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. - -## [Unreleased] - -### What's Changed - -## 1.4.0 Chia blockchain 2022-6-29 - -### Added - -- Added support for NFTs!!! :party: -- Added `chia wallet nft` command (see https://docs.chia.net/docs/13cli/did_cli) -- Added `chia wallet did` command (see https://docs.chia.net/docs/12rpcs/nft_rpcs) -- Added RPCs for DID (see https://docs.chia.net/docs/12rpcs/did_rpcs) -- Added RPCs for NFT (see https://docs.chia.net/docs/12rpcs/nft_rpcs) -- Enable stricter mempool rule when dealing with multiple extra arguments -- Added a retry when loading pool info from a pool at 2 minute intervals -- Added CLI options `--sort-by-height` and –sort-by-relevance` to `chia wallet get_transactions` -- Harvester: Introduce `recursive_plot_scan` -- Add libgmp-dev to Bladebit installation - thanks to @TheLastCicada -- Add support for multiple of the same CAT in aggregate offers - Thanks to @roseiliend - -### Changed - -- New coin selection algorithm based on bitcoin knapsack. Previously chia selected the largest coin -- Updated chiapos to 1.0.10 -- Updated chiavdf to 1.0.6 -- Updated blspy to 1.0.13 -- Updated setproctitle to 1.2.3 -- Updated PyYAML to 6.0 -- Updated pyinstaller to 5.0 -- Bump clvm_tools_rs version to 0.1.9 for clvm stepper and add a test -- Modest speedup of syncing by batching coin lookups -- Cmds: Use the new `plot_count` of `get_pool_state` in `plotnft show` -- Set mempool size back to the original size at launch -- Plotting|tests|setup: Improve `PlotManager` cache -- Wallet: Drop unused `WalletStateManager.get_derivation_index` -- Harvester: Tweak `get_plots` RPC -- Remove explicit multidict version from setup.py -- Simplify install.sh ubuntu version tracking -- Optimize BLS verification when public key is repeated -- Use Install.ps1 in build_windows.ps1 -- Updated warning about `CHIA_ROOT` being set when running init -- Cmds: Adjust stop daemon output -- Remove unused functions on MerkleSet -- Optimize `hash_coin_list()` -- Update CONTRIBUTING.md -- Remove outdated 3.8 upgrade comment -- Hint refactor -- Replace MerkleSet with the rust implementation -- Simplify SizedBytes and StructStream -- Allow services to set a non-default max request body size limit -- Reduce the redundant computations of coin_ids in block_body_validation -- Uses the new `from_bytes_unchecked` method in blspy, to improve perfo… -- Remove the cache from CoinStore -- Keep daemon websocket alive during keyring unlock -- Support searching derived addresses on testnet. -- Optimize code to not perform useless subgroup checks -- Restore missing hints being stored as None (instead of 0-length bytes) -- Coin simplification -- Harvester: Use a set instead of a list to speed up availability checks -- Improved performance of debug log output -- Update plotters installation to include an `apt update` - thanks to @TheLastCicada -- Early return from `_set_spent function` - Thanks @neurosis69 -- Remove redundant condition in `get_coin_records` - Thanks @neurosis69 -- Write python version error to stderr - thanks to @LuaKT - -### Fixed - -- Fixed issues with harvesters not reconnecting properly - fixes #11466 -- Return not synced if there are no connections - fixes #12090 -- Fix issues with wallet resending transactions on various mempool and node errors - fixes #10873 -- Fix some issues with `plotnft show` (#11897) -- Handle ephemeral ports and dual stack (ipv4 & ipv6) -- Fix issues when wallet syncing and rolling back too far in the past -- Fixes issues with the Farmer Reward dialog incorrectly reporting there is no private key (#11036) -- Fix race condition, blockchain can change between two calls to get_peak -- Wallet: Fix `CATLineageStore` creation in `create_new_cat_wallet` -- Fix incorrect return in "rollback_to_block" -- Wallet: Some rollback fixes -- Fix issue with missing coins -- Fix Newer block issue -- Fix jsonify bool -- Fix wallet introducers for testnet -- Correct wallet CLI sent/received indication -- Correct "Older block not found" error message -- Print MempoolInclusionStatus as string -- Optimize Program.curry() -- Improve detection of disconnected websocket between services -- Correct install.sh usage short options list -- Make sure we set the sync to height correctly when we roll back - -## 1.3.5 Chia blockchain 2022-5-11 - -### Added - -- Added Support for Python 3.10 -- Performance improvements in harvesters during plot refresh. Large farmers likely no longer need to specify a very high plot refresh interval in config.yaml -- Added CLI only `.rpm` and `.deb` packages to official release channels -- Fixed an issue where some coins would be missing after a full sync -- Enabled paginated plot loading and improved plot state reporting -- Updated the farming GUI tab to fix several bugs -- Fix infinite loop with timelord closing -- Simplified install.sh ubuntu version tracking -- Fixed memory leak on the farm page -- Fixed list of plot files "in progress" -- Various farmer rpc improvements -- Improvements to the harvester `get_plots` RPC - -### Known Issues - -There is a known issue where harvesters will not reconnect to the farmer automatically unless you restart the harvester. This bug was introduced in 1.3.4 and we plan to patch it in a coming release. - -## 1.3.4 Chia blockchain 2022-4-19 - -### Added - -- Creating an offer now allows you to edit the exchange between two tokens that will auto calculate either the sending token amount or the receiving token amount -- When making an offer, makers can now create an offer including a fee to help get the transaction into the mempool when an offer is accepted -- Implemented `chia rpc` command -- New RPC `get_coin_records_by_hint` - Get coins for a given hint (Thanks @freddiecoleman) -- Add maker fee to remaining offer RPCs -- Add healthcheck endpoint to rpc services -- Optional wallet type parameter for `get_wallets` and `wallet show` -- Add `select_coins` RPC method by (Thanks @ftruzzi) -- Added `-n`/`--new-address` option to `chia wallet get_address` -- New DBWrapper supporting concurrent readers -- Added `config.yaml` option to run the `full_node` in single-threaded mode -- Build cli only version of debs -- Add `/get_stray_cats` API for accessing unknown CATs - -### Changed - -- Left navigation bar in the GUI has been reorganized and icons have been updated -- Settings has been moved to the new left hand nav bar -- Token selection has been changed to a permanent column in the GUI instead of the drop down list along -- Manage token option has been added at the bottom of the Token column to all users to show/hide token wallets -- Users can show/hide token wallets. If you have auto-discover cats in config.yaml turned off, new tokens will still show up there, but those wallets won’t get created until the token has been toggled on for the first time -- CATs now have a link to Taildatabase.com to look up the Asset ID -- Ongoing improvements to the internal test framework for speed and reliability. -- Significant harvester protocol update: You will need to update your farmer and all your harvesters as this is a breaking change in the harvester protocol. The new protocol solves many scaling issues. In particular, the protocol supports sending delta changes to the farmer - so for example, adding plots to a farm results in only the new plots being reported. We recommend you update your farmer first. -- Updated clvm_tools to 0.4.4 -- Updated clvm_tools_rs to 0.1.7 -- Changed code to use by default the Rust implementation of clvm_tools (clvm_tools_rs) -- Consolidated socket library to aiohttp and removed websockets dependency -- During node startup, missing blocks in the DB will throw an exception -- Updated cryptography to 36.0.2 -- The rust implementation of CLVM is now called `chia_rs` instead of `clvm_rs`. -- Updated code to use improved rust interface `run_generator2` -- Code improvements to prefer connecting to a local trusted node over untrusted nodes - -### Fixed - -- Fixed issues with claiming self-pool rewards with and without a fee -- Fixed wallet creation in edge cases around chain reorgs -- Harvester: Reuse legacy refresh interval if new params aren't available -- Fixed typos `lastest` > `latest` (Thanks @daverof) -- Fixed typo in command line argument parsing for `chia db validate` -- Improved backwards compatibility for node RPC calls `get_blockchain_state` and `get_additions_and_removals` -- Fixed issue where `--root_path` option was not honored by `chia configure` CLI command -- Fixed cases where node DB was not created initially using v2 format -- Improved error messages from `chia db upgrade` -- Capitalized display of `Rpc` -> `RPC` in `chia show -s` by (Thanks @hugepants) -- Improved handling of chain reorgs with atomic rollback for the wallet -- Handled cases where one node doesn't have the coin we are looking for -- Fixed timelord installation for Debian -- Checked for requesting items when creating an offer -- Minor output formatting/enhancements for `chia wallet show` -- Fixed typo and index issues in wallet database -- Used the rust clvm version instead of python in more places -- Fixed trailing bytes shown in CAT asset ID row when using `chia wallet show` -- Maintain all chain state during reorg until the new fork has been fully validated -- Improved performance of `get_coin_records_by_names` by using proper index (Thanks @roseiliend) -- Improved handling of unknown pending balances -- Improved plot load times - -### Known Issues - -- You cannot install and run chia blockchain using the macOS packaged DMG on macOS Mojave (10.14). -- Pending transactions are not retried correctly and so can be stuck in the pending state unless manually removed and re-submitted - -## 1.3.3 Chia blockchain 2022-4-02 - -### Fixed - -- In version 1.3.2 our patch for the OpenSSL vulnerability was not complete for the Windows installer. Thank you @xsmolasses of Core-Pool. -- MacOS would not update openssl when installing via `install.sh` -- Some debugging information remained in `install.sh` - -## 1.3.2 Chia blockchain 2022-4-01 - -### Fixed - -- Fixed OpenSSL vulnerability CVE-2022-0778 - -## 1.3.1 Chia blockchain 2022-3-16 - -### Fixed - -- Improved config.yaml update concurrency to prevent some cases of the wrong pool being used for a PlotNFT. -- Fixed `chia keys show` displaying non-observer-derived wallet address. -- Fixed `plotnft claim` returning an error. -- Fixed invalid DB commit that prevented rollback of coin store changes. -- Fixed locking issue with `PlotManager.plots` that caused high lookup times on plots. -- Fixed exception when `chia keys migrate` is run without needing migration. -- Fixed farmer rewards dialog (GUI). -- Fixed display of pool payout address (GUI). -- Fixed display of harvesters status when harvesters are restarted (GUI). -- Fixed wallet RPC `get_offers_count` returning an error when there are no trades (Thanks, @dkackman!) -- Fixed spelling of "genrated" (Thanks again, @dkackman!) -- Fixed typo "log_maxbytessrotation" in initial-config (@skweee made their first contribution!) - -### Added - -- Added checks to ensure wallet address prefixes are either `xch` or `txch`. -- Added a better TLS1.3 check to handle cases where python is using a non-openssl TLS library. - -### Changed - -- Update the database queries for the `block_count_metrics` RPC endpoint to utilize indexes effectively for V2 DBs. -- Several improvements to tests. - -## 1.3.0 Chia blockchain 2022-3-07 - -### Added: - -- CAT wallet support - add wallets for your favorite CATs. -- Offers - make, take, and share your offers. -- Integrated lite wallet sync - to get you synced up faster while your full node syncs. -- Wallet mode - Access just the wallet features to make and receive transactions. -- Farmer mode - All your farming tools, and full node, while getting all the benefits of the upgraded wallet features. -- New v2 DB - improved compression for smaller footprint (the v2 DB is created alongside the v1 DB. Please be sure to have enough disk space before executing the DB upgrade command). -- Key derivation tool via CLI - lets you derive wallet addresses, child keys, and also search your keys for arbitrary wallet addresses/keys. -- Lite wallet data migration - CAT wallets you set up and your offer history will be carried over. -- The farmer will report version info in User-Agent field for pool protocol (Thanks @FazendaPool). -- Added new RPC, get_version, to the daemon to return the version of Chia (Thanks @dkackman). -- Added new config.yaml setting, reserved_cores, to specify how many cores Chia will not use when launching process pools. Using 0 will allow Chia to use all cores for process pools. Set the default to 0 to allow Chia to use all cores. This can result in faster syncing and better performance overall especially on lower-end CPUs like the Raspberry Pi4. -- Added new RPC, get_logged_in_fingerprint, to the wallet to return the currently logged in fingerprint. -- Added new CLI option, chia keys derive, to allow deriving any number of keys in various ways. This is particularly useful to do an exhaustive search for a given address using chia keys derive search. -- Div soft fork block height set to 2,300,000. -- Added the ability to add an optional fee for creating and changing plot NFTs. -- Added *multiprocessing_start_method:* entry in config.yaml that allows setting the python *start method* for multiprocessing (default is *spawn* on Windows & MacOS, *fork* on Unix). -- Added option to "Cancel transaction" accepted offers that are stuck in "pending". - -### Changed: - -- Lite wallet client sync updated to only require 3 peers instead of 5. -- Only CATs from the default CAT list will be automatically added, all other unknown CATs will need to be manually added (thanks to @ojura, this behavior can be toggled in config.yaml). -- New sorting pattern for offer history - Open/pending offers sorted on top ordered by creation date > confirmation block height > trade id, and then Confirmed and Cancelled offers sorted by the same order. -- When plotting multiple plots with the GUI, new items are taken from the top of the list instead of the bottom. -- CA certificate store update. -- VDF, chiapos, and blspy workflows updated to support python 3.10 wheels. -- We now store peers and peer information in a serialized format instead of sqlite. The new files are called peers.dat and wallet_peers.dat. New settings peers_file_path and wallet_peers_file_path added to config.yaml. -- CLI option chia show will display the currently selected network (mainnet or testnet). -- CLI option chia plots check will display the Pool Contract Address for Portable (PlotNFT) plots. -- Thanks to @cross for adding the ability to resolve IPv6 from hostnames in config.yaml. Added new config option prefer_ipv6 to toggle whether to resolve to IPv6 or IPv4. Default is false (IPv4). -- The default timeout when syncing the node was increased from 10 seconds to 30 seconds to avoid timing out when syncing from slower peers. -- TLS 1.2 is now the minimum required for all communication including peer-to-peer. The TLS 1.2 allowed cipher list is set to: "ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256". -- In a future release the minimum TLS version will be set to TLS 1.3. A warning in the log will be emitted if the version of openssl in use does not support TLS 1.3. If supported, all local connections will be restricted to TLS 1.3. -- The new testnet is testnet10. -- Switch to using npm ci from npm install in the GUI install scripts. -- Improved sync performance of the full node by doing BLS validation in separate processes. -- Default log rotation was changed to 50MiB from 20MiB - added config.yaml setting log_maxbytesrotation to configure this. -- Thanks to @cross for an optimization to chiapos to use rename instead of copy if the tmp2 and final files are on the same filesystem. -- Updated to use chiapos 1.0.9. -- Updated to use blspy 1.0.8. -- Implemented a limit to the number of PlotNFTs a user can create - with the limit set to 20. This is to prevent users from incorrectly creating multiple PlotNFTs. This limit can be overridden for those users who have specific use cases that require more than 20 PlotNFTs. -- Removed the option to display "All" rows per page on the transactions page of the GUI. -- Updated the background image for the MacOS installer. -- Changed the behavior of what info is displayed if the database is still syncing. - - It should not be expected that wallet info, such as payout address, should not reflect what their desired values until everything has completed syncing. - - The payout instructions may not be editable via the GUI until syncing has completed. - -### Fixed: - -- Offer history limit has been fixed to show all offers now instead of limiting to just 49 offers. -- Fixed issues with using madmax CLI options -w, -G, -2, -t and -d (Issue 9163) (thanks @randomisresistance and @lasers8oclockday1). -- Fixed issues with CLI option –passhrase-file (Issue 9032) (thanks @moonlitbugs). -- Fixed issues with displaying IPv6 address in CLI with chia show -c. -- Thanks to @chuwt for fix to looping logic during node synching. -- Fixed the chia-blockchain RPM to set the permission of chrome-sandbox properly. -- Fixed issues where the wallet code would not generate enough addresses when looking for coins, which can result in missed coins due to the address not being checked. Deprecated the config setting initial_num_public_keys_new_wallet. The config setting initial_num_public_keys is now used in all cases. -- Thanks to @risner for fixes related to using colorlog. -- Fixed issues in reading the pool_list from config if set to null. -- Fixed display info in CLI chia show -c when No Info should be displayed. -- Thanks to @madMAx43v3r for fixes in chiapos related to a possible race condition when multiple threads call Verifier::ValidateProof. -- Thanks to @PastaPastaPasta for some compiler warning fixes in bls-signatures. -- Thanks to @random-zebra for fixing a bug in the bls-signature copy assignment operator. -- Thanks to @lourkeur for fixes in blspy related to pybind11 2.8+. -- Thanks to @nioos-ledger with a fix to the python implementation of bls-signatures. -- Thanks to @yan74 for help debugging a race condition writing to config.yaml during beta. -- Fixed issue where the DB could lose the peak of the chain when receiving a compressed block. -- Fixed showing inbound transaction after an offer is cancelled. -- Fixed blockchain fee "Value seems high" message showing up when it shouldn't. -- Bugs in pool farming where auth key was being set incorrectly, leading to invalid signature bugs. -- Memory leak in the full node sync store where peak hashes were stored without being pruned. -- Fixed a timelord issue which could cause a few blocks to not be infused on chain if a certain proof of space signs conflicting blocks. - -### Known Issues: - -- When you are adding plots and you choose the option to “create a Plot NFT”, you will get an error message “Initial_target_state” and the plots will not get created. - - Workaround: Create the Plot NFT first in the “Pool” tab, and then add your plots and choose the created plot NFT in the drop down. -- When you close the Chia app, regardless if you are in farmer mode or wallet, the content on the exit dialog isn’t correct. -- If you start with wallet mode and then switch to farmer mode and back to wallet mode, the full node will continue to sync in the background. To get the full node to stop syncing after switching to wallet mode, you will need to close the Chia and relaunch the Chia app. -- Wallets with large number of transactions or large number of coins will take longer to sync (more than a few minutes), but should take less time than a full node sync. It could fail in some cases. -- Huge numbers cannot be put into amount/fee input for transactions in the GUI. -- Some Linux systems experience excessive memory usage with the value *default*/*python_default*/*fork* configured for *multiprocessing_start_method:*. Setting this value to *spawn* may produce better results, but in some uncommon cases, is know to cause crashes. -- Sending a TX with too low of a fee can cause an infinite spinner in the GUI when the mempool is full. - - Workaround: Restart the GUI, or clear unconfirmed TX. -- Claiming rewards when self-pooling using CLI will show an error message, but it will actually create the transaction. - -## 1.2.11 Chia blockchain 2021-11-4 - -Farmers rejoice: today's release integrates two plotters in broad use in the Chia community: Bladebit, created by @harold-b, and Madmax, created by @madMAx43v3r. Both of these plotters bring significant improvements in plotting time. More plotting info [here](https://github.com/Chia-Network/chia-blockchain/wiki/Alternative--Plotters). -This release also includes several important performance improvements as a result of last weekends "Dust Storm", with two goals in mind: make sure everyone can farm at all times, and improve how many transactions per second each node can accept, especially for low-end hardware. Please know that these optimizations are only the first wave in a series of many over the next few releases to help address this going forward. While the changes we have implemented in this update may not necessarily solve for _every_ possible congestion scenario, they should go a long way towards helping low-end systems perform closer to expectations if this happens again. - -### Added - -- Performance improvements for nodes to support higher transaction volumes, especially for low powered devices like RaspBerry Pi. Full details at [#9050](https://github.com/Chia-Network/chia-blockchain/pull/9050). - - Improved multi-core usage through process pools. - - Prioritized block validation. - - Added transaction queues for more efficient handling of incoming transactions. - - Increased BLS pairing cache. -- Integrated the Bladebit plotter to CLI and GUI. Thanks @harold-b for all your hard work on this, and welcome again to the Chia Network team! -- Added the Madmax plotter to CLI and GUI. Thanks @madMAx43v3r for your support! -- Added option to configure your node to testnet using to `chia init --testnet`. - -### Changed - -- Improved the wallet GUI's startup loading time by loading the default private key's fingerprint. -- Upgraded from clvm_rs 0.1.14 to 0.1.15. - -### Fixed - -- Minor verbiage and syntax changes in CLI and GUI. -- Partial version to fix launcher name definition. -- Fix harvester plot loading perfomance issues. -- Fixed a packaging failure when passphrase is being used. Thanks @ForkFarmer for reporting this defect. -- Fixed launcher name definition, which resolved an issue for some users in which wallet-node couldn't sync. -- Fixed a bug in the GUI that prevented some users from switching their plotNFT. - -### Known Issues - -- PlotNFT transactions via CLI (e.g. `chia plotnft join`) now accept a fee parameter, but it is not yet operable. - - -## 1.2.10 Chia blockchain 2021-10-25 - -We have some great improvements in this release: We launched our migration of keys to a common encrypted keyring.yaml file, and we secure this with an optional passphrase in both GUI and CLI. We've added a passphrase hint in case you forget your passphrase. More info on our [wiki](https://github.com/Chia-Network/chia-blockchain/wiki/Passphrase-Protected-Chia-Keys-and-Key-Storage-Migration). We also launched a new Chialisp compiler in clvm_tools_rs which substantially improves compile time for Chialisp developers. We also addressed a widely reported issue in which a system failure, such as a power outage, would require some farmers to sync their full node from zero. This release also includes several other improvements and fixes. - -### Added - -- Added support for keyring migration from keychain, and the addition of passphrase support. Learn more at our [wiki](https://github.com/Chia-Network/chia-blockchain/wiki/Passphrase-Protected-Chia-Keys-and-Key-Storage-Migration). -- Enabled experimental use of a new Chialisp compiler in clvm_tools_rs in chia-blockchain, which is off by default, and substantially improves compile time. -- Added Windows PowerShell scripts to support installation from source. -- Added a test to check that we don't reorg subslots unless there is a new peak. -- Added harvester info to farmer logging. -- Add 'points found 24h' to CLI reporting. -- Added an alternative to pkm_pairs_for_conditions_dict() which is a bit more straightforward and returns the public keys and messages in the forms we need them to validate them. -- Added ability to see unopenable plots at the end of plots check. -- Added Program.at utility function. - -### Changed - -- Truncate points_[found,acknowledged]_24h to 24 hours at each signage point. -- Improved reliability of test_farmer_harvester_rpc.py, by increasing the interval between harvester checks, which should avoid spamming logs with excessive plot refreshing and cache updates. -- Thanks @cross for change that allows using IPv6 address in config.yaml for remote harvesters and other chia services. -- Change to stop creating unused indexes in block_records and full_blocks tables. -- Removed unnecessary index in CoinStore & add additional benchmarks. -- Changed db_sync setting to default to FULL. In a prior release, this setting caused some users to have to resync their full node from zero if the node went offline, such as in a power outage. Users can change this to OFF in config.yaml. -- Updated the coin_store benchmark to enable synchronous mode when talking to the DB, since that's the default now, and improves the output a bit. -- Updated the old comment on chia/util/streamable.py with newer developer documentation. -- Minor GUI changes based on community feedback. -- Thanks @jack60612 for your help in improving our GUI code, including upgrading to electron 13, migration to electron remote, updating the latest dependencies, and more. - -### Fixed - -- Corrected a super-linter name typo to GitHub -- Thanks @sharjeelaziz for correcting our typo in your name. Our apologies for the error! -- In macOS builds, changed the export value of NOTARIZE to fix some build failures. -- Fix log output for duplicated plots. -- Removed a flaky mtime check for plots that resolved an issue where file_path.stat() shows multiple copies of plots and slows performance of the farmer. Thanks @timporter for the assist on this one. -- Thanks @jcteng for fixing a bug on the Chia DID wallet that showed 'mojo:'' instead of 'mojo'. - -## 1.2.9 Chia blockchain 2021-10-01 - -### Changed - -- Changed "About" section in client to indicate correct release version. - -## 1.2.8 Chia blockchain 2021-09-30 - -### Added - -- Added RPC updates to support keyring migration and to support adding a passphrase for wallets in an upcoming release. -- Added plot memo caching in PlotManager, speeding initial loading and cached loading, by enabling harvester to save the parsed plot memo on disk on shutdown, then load it back into memory on startup so that it can skip key parsing calculations for all already known plots. -- Added a debug option to log all SQL commands. -- Added support for DID, our decentralized identity solution, as a building block toward Chia's broader set of DID capabilities. -- Thanks @olivernyc for the addition of a query in CoinStore to special case height 0 to avoid querying all unspent coins. -- Starting logging the timing of applying additions and removals to the coin store. -- Made max message size configurable in config.yaml, as a possible workaround for very large farms where reporting plot information exceeds the maximum message size. -- Added a config option for peer_connect_timeout. -- Added support for unhardened key derivations. -- Various CoinStore benchmark and performance improvements. -- Beta builds are built on every merge to main, and are now available from . -- Thanks @Radexito for adding support for Raspberry Pi 4 64Bit to the GUI installation script. -- Added macOS keyring.yaml support, migrating keys from macOS Keychain to keyring.yaml to support an upcoming release in which we'll add an optional passphrase to wallets. -- We have made many full node changes to support our upcoming Chia Asset Token (CAT) standard and our upcoming standalone light wallet, which will use Chia's new electrum-style protocol to enable faster wallet syncing. -- We have many new translations added in this release. Thanks to the following community members for their contributions: Albanian @ATSHOOTER; Arabic @younes.huawei.test; Belarusian @LUXDAD; Catalan @Poliwhirl; Chinese Traditional @MongWu-NeiTherHwoGer-Long, @danielrangel6; Chinese, Simplified @SupperDog; Croatian @vjukopila5 @marko.anti12; Czech @HansCZ; Danish @loppefaaret; Dutch @netlob;English @sharjeelaziz @darkflare; English, Australia @nzjake; English, New Zealand @nzjake @sharjeelaziz; Finnish @f00b4r; French @burnt; Hungarian @SirGeoff; Hebrew @Arielzikri; Indonesian @lespau;Lithuanian @Mariusxz; Polish @bartlomiej.tokarzewski; Portuguese @darkflare; Portuguese, Brazilian @fsavaget; Sinhala @HelaBasa;Slovak @atomsymbol; Spanish @needNRG; Spanish, Argentina @juands1644 @gdestribats; Spanish, Mexico @danielrangel6; Swedish @MrDyngrak; Thai @3bb.pintakam.7m1 @taweesak0803650558 @taweesak.25may1993 @3bb.pintakam.7m1; Turkish @baturman @ExtremeSTRAUSSER. - -### Changed - -- Bluebox proofs are now randomized instead of looking at the oldest part of the blockchain first to find uncompacted proofs. -- Bumped sortedcontainers to version 2.4.0. -- Dropped some redundant code in plotting/manager.py -- Updated some hooks: Update `flake8` to 3.9.2, `pre-commit-hooks` to 4.0.1, `black` to 21.8b0 -- Bump clvm_rs to 0.1.14. -- Added tests for invalid list terminators in conditions. -- Updated blspy to 1.0.6. -- Made a change to allow the host to be configurable for the timelord launcher. -- Thanks @dkackman for adding the ability to collect the IDs of plots as they are queued and return them with the response. -- Made the SpendBundle.debug use the default genesis challenge by default. -- Changes in full node to execute sqlite pragmas only once, at the level where the database is opened, and changed pragma synchronous=FULL to OFF to improve disk I/O performance. Also removed redundant database pragmas in wallet. -- Made a change to remove CoinStore's dependency on FullBlock to just pass in the parts of the block necessary to add the block. -- Improved log formatting. -- A change to logging to only log warnings when more than 10 seconds has passed, to reduce the number of warning logs. -- Improved and fixed some outdated messages in CLI. Thanks @jack60612 for the assist! -- We previously added a Rust condition checker, to replace our existing Python-based condition checker. In this release, we're removing the old Python code. -- Several clvm_rs updates to support our upcoming Chia Asset Token (CAT) standard. - -### Fixed - -- Thanks @mgraczyk for the fix to keyring_path. -- Fixed an issue blocking the Ubuntu installer that required manual installation of Python 3.9 as a workaround. -- Fixed an issue where the config.yaml and keyring.yaml are only partially written out to, if another process is attempting to read the config while it's being written. -- Fixed rmtree call in create_pool_plot. -- Thanks @Knight1 for fixing an issue in which fix-ssl-permissions shows the current 'mode' not the 'updated mode'. -- Fixed Mypy issues on Python 3.9.7 that generated many errors when running mypy. -- Thanks @olivernyc for fixing an edge case with negative inputs to 'truncate_to_significant_bits'. -- Added a fix for Windows installs that were seeing exceptions when writing to the keyring. - -## 1.2.7 Chia blockchain 2021-09-16 - -### Fixed - -- Thanks to @jack60612 for fixing a bug that displayed 25 words instead of 24 words in some instances in the GUI. - -## 1.2.6 Chia blockchain 2021-09-09 - -Today we’re releasing version 1.2.6 to address a resource bug with nodes, and we want to stress the importance of updating to it at the earliest convenience. The fix prevents a node from consuming excessive memory when many Bluebox Timelords are active on the chain. - -### Changed - -- Updated to BLS 1.0.6. -- Updates to the Rust conditions parser. -- Adjusted plot refresh parameter to improve plot loading times. - -### Fixed - -- Fixed memory utilization issue related to how the node handles compact VDFs generated from blueboxes. We recommend everyone update to this version to avoid memory issues that can impact farming and harvesting. -- Fixed issues with reloading plot files detected as bad (this can happen during plot copying). - -## 1.2.5 Chia blockchain 2021-08-27 - -### Fixed - -- Fixed errors in the Linux GUI install script, which impacted only Linux users. - -## 1.2.4 Chia blockchain 2021-08-26 - -### Added - -- Enable the rust condition checker unconditionally in testnet. -- Added support for multiple wallets. -- Added a change to config.yaml to tolerate fields that replace network constants in config.yaml that don't exist, but print warning. -- Improvements to sync full nodes faster by improving the concurrency for downloading and validating blocks. -- Added new call for logging peer_host: get_peer_logging that will use the peer_host value, typically an IP address, when the peername cannot be retrieved. -- Added documentation for treehash params. -- Added a py.typed file that allows other projects that pip install chia-blockchain to type check using our functions with mypy. -- Added an RPC for coin records by multiple coin names. -- Enabled querying AAAA records for DNS Introducer. -- We now set the version for the GUI when doing a manual install using the install-gui.sh script. Uses a python helper to get the version of the chia install and then converts it into proper npm format and puts that into package.json. -- Added some new class methods to the Program objects to improve ease of use. -- Added an option to sign bytes as well as UTF-8 strings, which is particularly helpful if you're writing Chialisp puzzles that require signatures and you want to test them without necessarily writing a whole python script for signing the relevant data. -- Added a first version of .pre-commit-config.yaml and applied the changes required by the following initial hooks in separate commits. To use this you need to install pre-commit, see . -- We have added many new translations in this release based on community -submissions. Thanks to @RuiZhe for Chinese, Traditional; @HansCZ for Czech; -@LUXDAD for English, Australia; @f00b4r for Finnish; @jimkoen, @ruvado for German; @Arielzikri for Hebrew; @A-Caccese for Italian; @Hodokami for Japanese; @LUXDAD for Latvian; @vaexperience for Lithuanian; @LUXDAD for Russian; @juands1644 for Spanish, Argentina; @MrDyngrak, @ordtrogen for Swedish; @richeyphu for Thai; @Ansugo, @baturman for Turkish. - -### Changed - -- Thanks @altendky for Correct * to ** kwargs unpacking in time_out_assert(). -- Thanks @altendky for changing the default to paginate to chia wallet get_transactions to address cases such as piping and output redirection to a file where the command previously just hung while waiting for the user to press c for the next page. -- Removed commented-out debug breakpoints. -- Enabled Rust condition checker to add the ability to parse the output conditions from a generator program in Rust. It also validates some of the conditions in Rust. -- Switched IP address lookup to first use Chia's service ip.chia.net. -- Made changes so that when creating SSL certificate and private key files, we ensure that files are written with the proper file permissions. -- Define a new encrypted keyring format to be used to store keys, and which is optionally encrypted to a user-supplied passphrase. GUI for the passphrase will come in an upcoming release. -- Removed initial transaction freeze put in place at mainnet launch as it is no longer necessary. -- Separate locking and non-locking cases for get_confirmed_balance_for_wallet, which will allow calling a few wallet_state_manager methods while already under the wallet_state_manager lock, for example during DID wallet creation. -- Thanks to @Playwo for removing the index on coin_record spent column to speed up querying. -- Made a change to the conditions parser to either ignore or fail when it encounters unknown conditions. It also removes the UNKNOWN enum value from ConditionOpcodes. -- Renamed folder tests/core/types to tests/core/custom_types to address conflicts in debugger in PyCharm. -- Disabled DID wallet tests while DID wallet is under construction. -- Added pairing cache for faster aggregate signature verification. -- Added block height assertions after block farming. -- Added assertions for tx confirmation. - -### Fixed - -- Fix single coin generator. -- Fixed an issue with duplicate plotnft names. -- Fixed an issue during node shutdown in which some AttributeErrors could be thrown if the shutdown happens before the node fully started up. -- Fixed mempool TX cache cost, where the cost of the mempool TX cache (for spend bundles that can't be included in a block yet) would not be reset when the cache was emptied. -- Fixed a failure to create a keychain_proxy for local keychains. -- Thanks to @mgraczyk for fixing type annotation in sync_store. -- Thanks to @darkverbito for fixing an issue on initial creation of a coloured coin where code always falls into default else clause due to lack of type conversion. -- Fixed NPM publish in clvm_rs. -- Thanks to @skweee for his investigation work on fixing mempool TX cache cost, where the cost of the mempool TX cache (for spend bundles that can't be included in a block yet) would not be reset when the cache was emptied. - -## 1.2.3 Chia blockchain 2021-07-26 - -### Added - -- Added ability to change payout instructions in the GUI. -- Added an option to revert to sequential read. There are some systems (primarily macos+exfat) where the parallel read features results in very long lookup times. This addition makes the parallel feature the default, but adds the ability to disable it and revert back to sequential reads. -- Added backwards compatibility for Coin Solutions in push_tx since renaming it to CoinSpend. -- Added an option to set the default constants on the simulator. -- Added a warning to user to not send money to the pool contract address. -- Added capability to enable use of a backup key in future, to claim funds that were sent to p2_singleton_puzzle_hash, which today are just ignored. -- Thanks @aarcro for adding timing metrics to plot check. -- Thanks @chadwick2143 for adding the ability to set the port to use for the harvester. -- Added more friendly error reporting for peername errors. -- We have added many new translations in this release. Thanks to @L3Sota, @hodokami and @L3Sota for Japanese; @danielrangel6, @memph1x and @dvd101x for Spanish (Mexico); @fsavaget, @semnosao and @ygalvao for Portuguese (Brazilian); @juands1644 for Spanish (Argentina); @darkflare for Portuguese; @wong8888, @RuiZhe, @LM_MA, @ezio20121225, @GRIP123, @11221206 and @nicko1122 for Chinese Traditional; @atomsymbol for Slovak; @SirGeoff and @rolandfarkasCOM for Hungarian; @ordtrogen for Swedish; @HansCZ and @kafkic for Czech; @SupperDog for Chinese Simplified; @baturman and @Ansugo for Turkish; @thebacktrack for Russian; @itservicelukaswinter for German; @saeed508, @Amirr_ezA and @themehran for Persian; @hgthtung for Vietnamese; @f00b4r for Finnish; @IMIMIM for Latvian; @Rothnita and @vanntha85 for Khmer; @Rothnita and @Gammaubl for Thai; @marcin1990 for Polish; @mydienst for Bosnian; @dvd101x and @darkflare for Spanish; @ATSHOOTER for Albanian; @Munyuk81 for Indonesian; @loppefaaret for Danish; @sharjeelaziz and @nzjake for English; @nzjake for English (New Zealand). We apologize if we missed anyone and welcome corrections. - -### Changed - -- Updated blspy to 1.0.5. -- Updated chiapos to 1.0.4. -- Included all Chialisp files in source distribution. -- Removed left-over debug logging from test_wallet_pool_store. -- Made changes to allow us to use the name coin_spend everywhere in our code, without changing it in the API requests, both outgoing and incoming. Enables us to decide at a later date when to cut over completely to the coin_spend name. -- Thanks @mishan for your change to 'chia plotnft show' to display Percent Successful Points. -- Thanks @Playwo for your change to make pool payout instructions case insensitive. -- GUI sees update when plots or harvesters change. -- Increased the cache interval to help large farmers. -- Removed proof limit for mainnet, but not testnet. This helps with pools that have very low difficulties. Thanks to @AlexSSD7 for pointing out the issue. -- We now also allow hex strings prefixed with 0x which is required because we currently prefix the strings in JSON conversion. -- Thanks to @opayen for your help in updating our MacOS icon. - -### Fixed - -- Thanks to @dfaranha for helping fix a parsing error in Relic inputs for BLS signatures. -- Fixed error type in wallet_blockchain.py. -- Thanks to @seraphik for a fix on our Linux installer that required root privileges. -- Thanks @felixbrucker for helping fix invalid content-type header issues in pool API requests. -- The wallet ignores coins sent by accident to the pool contract address and allows self pooling rewards to be claimed in this case. -- Thanks @mgraczyk for fixing the use of print_exc in farmer. - -## 1.2.2 Chia blockchain 2021-07-13 - -### Fixed - -- Converted test_rom.py to use pytest and fixed test_singleton. -- Thanks to @yshklarov for help fixing [#7273](https://github.com/Chia-Network/chia-blockchain/issues/7273), which bundled CA store to support pools for some farming systems, including M1 Apple computers. This enables those machines to properly connect to pools, and fixes the issue. - -## 1.2.1 Chia blockchain 2021-07-12 - -### Added - -- Thanks @feldsam for adding support for Fedora in install-gui script - -### Fixed - -- Fix harvester cache updates. Prior to this commit the farmer called the `request_plots` every second for each harvester as long as they failed to respond properly. Since the rate limit was 10/minute this lead to hitting the rate limit if the harvester didn't responds for 10 tries in a row for whatever reason. This commit changes the behavior to always keep track of request attempts even if they end up in a timeout to really only re-try every 60s no matter what. -- Fix M1 installed torrent and installer version number -- Thanks to @x-Rune for helping find and test a lot of 1.2.0 bugs with the harvester. -- Fixed issue for Debian users where the wallet crashes on start for them since last release - -## 1.2.0 Chia blockchain 2021-07-07 - -### Added - -- Portable pooled plots are now available using our new plot NFT. These allow you to plot new plots to an NFT that can either self farm or join and leave pools. During development there were changes to the plot NFT so portable pool plots (those made with `-c` option to `chia plots create`) using code from before June 25th are invalid on mainnet. -OG plots made before this release can continue to be farmed side by side with the new portable pool plots but can not join pools using the official pooling protocol. You can learn more as a farmer by checking out the [pool user guide](https://github.com/Chia-Network/chia-blockchain/wiki/Pooling-User-Guide). Pool operators and those wanting to understand how the official pooling protocol operates should check out our [pooling implementation reference repository](https://github.com/Chia-Network/pool-reference). If you plan to use plot NFT, all your farmers and harvesters must be on 1.2.0 to function properly for portable pool plots. -- The exact commit after which Plot NFTs should be valid is the 89f7a4b3d6329493cd2b4bc5f346a819c99d3e7b commit (in which `pools.testnet9` branch was merged to main) or 5d62b3d1481c1e225d8354a012727ab263342c0a within the `pools.testnet9` branch. -- `chia farm summary` and the GUI now use a new RPC endpoint to properly show plots for local and remote harvesters. This should address issues #6563, #5881, #3875, #1461. -- `chia configure` now supports command line updates to peer count and target peer count. -- Thank you @gldecurtins for adding logging support for remote syslog. -- Thanks to @maran and @Animazing for adding farmer and pool public key display to the RPC. -- We have added translations for Hungarian, Belarusian, Catalan, and Albanian. For Hungarian thanks to @SirGeoff, @azazio @onokaxxx, @rolandfarkasCOM, @HUNDavid , @horvathpalzsolt, @stishun74, @tusdavgaming, @idotitusz, @rasocsabi, @mail.kope, @gsprblnt, @mbudahazi, @csiberius, @tomatos83, @zok42, @ocel0t, @rwtoptomi, @djxpitke, @ftamas85, @zotya0330, @fnni, @kapabeates, @zamery, @viktor.gonczi, @pal.suta, @miv, and @Joeman_. For Belarusian thanks to @shurix83, @haxycgm, and @metalomaniax. For Catalan thank you to @Poliwhirl, @Pep-33, @marqmarti, @meuca, @Guiwdin, @carlescampi, @jairobtx, @Neoares, @darknsis, @augustfarrerasgimeno, and @fornons. Finally for Albanian thanks to @ATSHOOTER and @lakedeejay. We apologize if we missed anyone and welcome corrections. -- Our release process is now fully automated from tagging a release to publishing installers to all of the appropriate locations and now makes the release artifacts available via torrents as well. -- All Chia repositories now automatically build M1 wheels and create a new MacOS M1 native installer. -- New CLI command `chia plotnft` to manage pools. -- We have added a new RPC `get_harvesters` to the farmer. This returns information about remote harvesters and plots. -- We have added a new RPC `check_delete_key` to the wallet, to check keys prior to deleting them. -- We have added a new RPC `delete_unconfirmed_transactions` to the wallet which deletes these transactions for a given wallet ID. -- We have added a new RPC `get_puzzle_and_solution` to the full node, which takes in a coin ID. -- We have added a new RPC `get_recent_signage_point_or_eos` to the full node, to support pooling. -- We have added a new RPC `send_transaction_multi` to the wallet, which sends a payment with multiple payees. - -### Changed - -- We have made a host of changes to the GUI to support pooling and to improve the wallet experience. -- We updated chiapos to version 1.0.3. This adds parallel reads to GetFullProof. Thanks to @marcoabreu ! We now print target/final directory early in the logs refs and log process ID. Thanks to @grayfallstown ! We are now using Gulrak 1.5.6. -@683280 optimized code in phase1.hpp. @jespino and @mrhacky started migrating to flags instead of booleans parameters for `show_progress` and `nobitfield`. If you are providing third-party tools you may need to make adjustments if relying on the chiapos log. -- Updated chiavdf to version 1.0.2 to fix certain tests. -- Windows builds now rely upon Python 3.9 which obviates the fix in 1.1.7. -- We are now using miniupnpc version 2.2.2 so that we can support Python 3.9 on Windows. -- We updated to clvm 0.9.6 and clvm_rs 0.1.8. CLVMObject now lazily converts python types to CLVM types as elements are inspected in clvm. cvlm_rs now returns python objects rather than a serialized object. -- We now have rudimentary checks to makes sure that fees are less than the amount being spent. -- The harvester API no longer relies upon time:time with thanks to @x1957. -- We have increased the strictness of validating Chialisp in the mempool and clvm. -- Thanks to @ruslanskorb for improvements to the human-readable forms in the CLI. -- Thanks to @etr2460 for improvements to the plotting progress bar in the GUI and enhancements to human-readable sizes. -- @dkackman changed the way that configuration was found on startup. -- We now delay peer start for wallet until after backup init and make sure only one copy is started. -- Wallets now trust the local node more for enhanced wallet sync speed. -- We now store tasks used to initiate peer connections to ensure they are kept alive and to be able to wait for them if we hit the upper limit on number of pending outgoing connections. -- We improved weight proof validation. -- @cvet changed the wallet to take `override` instead of `confirm`. - -### Fixed - -- The delete plots button in the Windows GUI has been fixed and re-enabled. -- Sometimes upon startup, the GUI takes a while to load the plots to display. We've made a temporary improvement that adds a "Refresh Plots" button whenever the GUI has not yet found plots. -- Correctly display private key in `chia keys show`. -- Thanks to @gldecurtins for removing a default printout of the private key mnemonic in `chia keys show`. -- Shutting down the full node is cleaner and manages uPnP better. -- DNS introducer could fail. -- Fixed a potential timelord bug that could lead to a chain stall. -- Add an explicit error message when mnemonic words are not in the dictionary; should help users self-service issues like #3425 faster. Thank you to @elliotback for this PR. -- Thank you to @Nikolaj-K for various typo corrections around the Mozilla CA, code simplifications and improvements in converting to human-readable size estimations, and clean up in the RPCs and logging. -- Thank you to @ChiaMineJP for various improvements. -- @asdf2014 removed some useless code in the wallet node API. -- Thanks to @willi123yao for a fix to under development pool wallets. -- `chia farm summary` better handles wallet errors. -- @Hoinor fixed formatting issues around the Chinese translation in the GUI. -- Sometimes the GUI would stop refreshing certain fields. -- We have better error handling for misbehaving peers from naive forks/clones. -- We have fixed an error where the wallet could get corrupted, which previously required restarting the application. -- We have fixed an error where transactions were not being resubmitted from the wallet. - -### Known Issues - -- If you resync your wallet, transactions made with your plot NFTs will show incorrectly in the GUI. The internal accounting, and total balance displayed is correct. - -### 1.1.7 Chia 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 - -### 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 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 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. -- Added Persian language support. Thank you to the following community members for their translation contributions: @ali.tavanaie, @soheils13, @zanaei, @parham_saeedi, @HYNazism, @IGSkyGuy, @mmbtmp, @esfandani, @amirhh00, @Alirezabayatorg, @dotMahdi, @amirisatisss, @Navidnkh, @tgmgfe, @babooshios, @mahbodius, @amiragheli, @pouyanagazadeh97, @yaghout.ad, @faramarz1985, @inert1a, @want3d, @avion.raid, @hadiamirnejad, @iziran, @hamidreza13771393, @ebrahimfalamarzi, @navidnr, @behzadmosaffa. -- Added Serbian language support. Thank you to the following community members for their translation contributions: @mihailokg, @Cheli0S, @stevica.canadi, @ukica92, @stefanmih, @acko83. -- Added Spanish (Argentina) language support. Thank you to the following community members for their translation contributions: @franpepper94, @gdestribats, @omar17, @tomigambi, @doldraug. -- Added Spanish (Mexico) language support. Thank you to the following community members for their translation contributions: @javieriv, @dvd101x, @cdgraff, @danielrangel6. -- Thanks to @proea for adding RockyLinux support for install-gui.sh. -- And thank you to @etr2460 for various GUI contributions. - -### Changed - -- Performance improvement of speeding up outbound connections. -- Performance improvements to block_store. -- Optimized Streamable parsing by avoiding extra post-init checks, making parsing block records from database up to 40% faster. -- Made the serialization of Coin follow the normal protocol of implementing stream(). -- Minor improvements to add_spendbundle and weight proofs. -- We now use version 1.0.2 of chiapos. We now reopen files on read or write failure with thanks to @mreid-moz! We also prevent chiapos prover crashing for more bad plots. -- Disabled deletion of running plot for Windows users as the crash/lockup bug has returned. -- We more clearly prohibit root from installing/running the GUI. -- Thanks to @sargonas for improvements to the template for creating Issues. -- Thanks to @aisk for continuing to add more types. -- Thanks for @dkackman for improving the remote harvester setup by having init -c only copy the right certs. -- And thank you to @vidschofelix, @meawoppl, and @rongou for various other changes and improvements. - -### Fixed - -- Fixed a bug where multiple wallets running at the same time would all issue a transaction. -- Fixed issues with signage points: duplicate signage point spikes, and bugs in signage point cache. -- Fixed a blank screen error during Centos install. -- Thanks to @linnik for fixing a TypeError exception in case of unresponsive service. -- 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 - -### 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 - -### Changed - -- Secret wallet key is hidden by default in `chia keys show`. Use `chia keys show --show-mnemonic-seed` for private keys. -- Performance improvement while parsing variable length field in transaction blocks. - -### Fixed - -- Spends are now sorted in the mempool by fee/cost. -- Resolved pending transaction issue during reorgs. -- Fixed bug in message send retry logic. -- 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 - -### Added - -- Significant speed improvements have been added to the Node during P2P operations. This is mostly a performance improvement to make sure there is plenty of overhead in Node for transaction processing. Smaller machines like the Pi 4 are strongly advised to update to this release before Monday 5/3/21 at 10AM PDT when transactions start. -- Significant syncing speed improvements have been added. However, there is a lot of low hanging fruit to continue to increase overall chain sync speed in subsequent releases. - -### Changed - -- 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. -- 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. -- Standard transactions now all have announcements. -- VDF verification during sync and normal operations are now cached to enhance node performance. -- Target peer count has been increased from 60 to 80 to increase the number of peer Nodes available to connect to. Outbound connections were lowered from 10 to 8. -- The streamables class has had significant performance improvements. -- If a proof of space lookup takes longer than 5 seconds we will now log an error at WARNING level. -- Allow configuration of the plot loading interval (default is 2 minutes) in config.yaml. -- CLI wallet UI was improved and shows syncing status of wallet. -- @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. -- 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. - -### Fixed - -- We fixed excess memory use when displaying plot logs in GUI. This was causing the GUI application to fail in many "fun" ways after plotting a lot of plots in parallel. -- Fixed plot update issues in the GUI. -- Long syncing will now correctly show "Syncing" around the application. -- Nonce collisions in request IDs is fixed. -- Some duplicate plots were not being caught and logged by harvester on loading. -- We have removed many places where Node was making duplicate requests of other nodes. -- Daemon now waits for services to end to attempt to avoid zombie processes. -- Node is less likely to lose sync due to state inconsistency. -- A large thank you to @sargonas for diagnosing why so many technical support questions were flooding GitHub issues, PRing a fix, and mass migrating issues to Discussions. -- Thanks to @jeolcho for fixing a bug in full_node_rpc_api.py. -- 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 - -### Changed - -- Weight proof time outs have been increased from 3 minutes to 6 minutes. - -### Fixed - -- 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 - -### Added - -- This is a bug fix release for 1.1.0. It is not required to upgrade from 1.1.0 if you are not experiencing the specific issue that it addresses. You are required to upgrade from any 1.0.x version before Monday evening PDT to continue farming. - -### Changed - -- Logging now includes year, month, and date. Thanks and apologies for not tipping the hat sooner to @alfonsoperez for the PR. - -### Fixed - -- 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 - -### 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. -- 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. -- When adding plots we attempt to detect a duplicate and not load it. - -### Changed - -- We have changed how transactions will unlock from a blockheight to a timestamp. As noted above that timestamp is 5/3/2021 at 10AM PDT. -- We have temporarily disabled the "Delete Plots" button in the Windows GUI as we are still working on debugging upstream issues that are causing it. -- There are various optimizations in node and wallet to increase sync speed and lower work to stay in sync. We expect to add additional significant performance improvements in the next release also. -- Transactions now add the agg_sig_me of the genesis block for chain compatibility reasons. -- Wallet is far less chatty to unload the classic introducers. DNS introducers will be coming shortly to replace the classic introducers that are still deployed. -- Netspace is now calculated across the previous 4068 blocks (generally the past 24 hours) in the GUI and cli. - -### Fixed - -- Performance of streamable has been increased, which should help the full node use less CPU - especially when syncing. -- 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 - -### Added - -- This is a maintenance release for 1.0.4 to fix a few mostly cosmetic issues. Please refer to the 1.0.4 notes for the substantive plotting changes - for example - in that release. - -### Changed - -- The GUI now calls it an Estimated Time to Win and has enhanced explanations in the tool tip that the estimated time is often not be the actual time. We have some additional improvements we plan to make here in future releases. -- Development installers now handle semver development versions correctly. - -### Fixed - -- Temp space sizes needed for k = 33 and higher were accidentally under-reported. The values we have placed into the GUI may be conservative in being too large and appreciate feedback from the community on the new optimal temp space needed and RAM choices. -- The GUI plotting progress bar was reaching 100% too early. Thanks to @davidbb for the PR. -- 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 - -### Added - -- Starting approximately April 21, 2021, the GUI will notify you that this version will stop working at block height 193,536 and will persistently warn you from that block on that you can not use this version (or any earlier version) to farm. This is to support the upgrade to the transaction fork. -- We now have translations for Brazilian Portuguese, Australian English, and Pirate. Thanks to @fsavaget, @darkflare, @maahhh, @harold_257, @kontin, and @GunnlaugurCalvi. Yarr - don't be losing your 24 word treasure map... - -### 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 weight proof timeout can now be configured in config.yaml. -- Peer discovery is now retried more often after you receive initial peers. - -### Fixed - -- We have made significant improvements and bug fixes to stop blockchain and wallet database corruption issues. -- We now pass the environment into the Daemon and this should solve some Windows and MacOS startup bugs. -- The ARM64 .deb installer will now work well on Raspberry Pi OS 64 bit and Ubuntu 18.04 LTS or newer. -- We have made improvements in weight proof generation and saving. -- 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 - -### 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. - -### Fixed - -- An incorrect merge brought in unreleased features and broke `chia 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 - -### 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. -- @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). -- 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. -- 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`. -- @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. -- "Broken pipe" error was decreased to a warning. -- Many non critical log messages were decreased from warning to info log level. -- Harvester should now log the plot file name if it finds a bad plot at error log level. - -### Fixed - -- Peer ips were being written to the database on a per ip basis. This caused a lot of wasted disk activity and was costing full node performance. -- We fixed an issue where the last block wasn't fetched by the GUI. -- There was an edge case with full node store that can stall syncing. -- 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 - -### 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`. -- 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/). - -### Changed - -- The mainnet genesis is now in the initial config.yaml and the green flag components have been removed. -- Our release process and branching strategy has changed. CONTRIBUTING.md will be updated in the main branch soon with details. -- This mainnet release does not migrate previous testnet configuration files. - -### 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. -- Sometimes the GUI had an error regarding MainWindow. - -## 1.0.0 First Release of Chia 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. -- 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). -- 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. - -### Changed - -- Weight proof request timeout was increased to 180 seconds. -- Mainnet uses port 8444 and other constants and service names were changed for mainnet. -- GUI locales are now extracted and compiled in `npm run build`. -- Daemon now logs to STDERR also. - -### Fixed - -- GUI plotting on some Macs was not working due to locale issues with Click. -- Thank you @L3Sota for bringing this log back into 2021. -- The errant warning on Electron startup has been removed. Thanks @dkackman. - -## 1.0rc9 aka Release Candidate 9 - 2021-03-16 - -### Changed - -- This is a hard fork/breaking change from RC6/7/8. The current plan is to drop the flag at noon pacific time, today 3/16. -- Using the real prefarm keys for this test - -### Fixed - -- 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 - -## 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. -- 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. - -### Changed - -- We now use Python 3.9 to build MacOS installers. -- 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. -- 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. -- 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. - -## 1.0rc7 aka Release Candidate 7 - 2021-03-13 - -### Changed - -- 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. -- The installer build process was spruced up some. - -### Fixed - -- Setting difficulty way too low on the testnet_6 launch revealed a Timelord edge case. The full node was hardcoding the default difficulty if block height is < EPOCH_BLOCKS. However there were many overlapping blocks, so none of the blocks reached the height, and therefore the timelord infused the wrong difficulty. -- Fixed a race condition in the Timelord, where it took time to update the state, so it ignored the new_peak_timelord form the full_node, which should have reset the timelord to a good state. -- 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. - -### 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) - -## 1.0rc6 aka Release Candidate 6 - 2021-03-11 - -### Added - -- This is a hard fork/breaking change from RC5. TXCH Coins will **not** be moved forward but your plots and keys and parts of your configuration do. We will be testing the final mainnet release strategy with the launch of RC6. For the test, those who are comfortable running the dev branch will update and start up their farms. All harvesters and plots will load and until the green flag drops, peers will be gossiped so your farm can establish good network connectivity. When the flag drops, each node will pull down the signed genesis challenge and start farming. Block 1 will be broadcast to anyone who hasn't seen the flag drop yet. The only difference for mainnet is that there will be 1.0 installers and a main branch release more than 24 hours before the real green flag. -- There is now basic plot queueing functionality in the GUI. By default, plotting works as it has in the past. However you can now name a queue in Step 2 Advanced Options. Chose something like `first`. Everything you add to the `first` queue will start up like it has in the past but now you can go through the steps again and create a queue named `second` and it will immediately start plotting as if it is unaware of and parallel with `first`. A great use case is that you would set `first` to plot 5 plots sequentially and then you'd set `second` to plot 5 sequentially and that would give you two parallel queues of 5 plot's each. We will be returning to plotting speed and UI soon. Thanks @jespino for this clever work around for now. -- There is now an option on the Farm page to manage your farming rewards receive addresses. This makes it easy to send your farming rewards to an offline wallet. This also checks your existing rewards addresses and warns if you do not have the matching private key. That is expected if you are using an offline wallet of course. -- Functionally has been added to the farmer rpc including checking and changing your farming rewards target addresses. -- Added the ability to translate material-ui components like `Row 1 of 10`. Thanks @jespino. -- Arch linux support has been added to `sh install.sh`. Thanks @jespino. -- Update FullBlock to Allow Generator References - a list of block heights of generators to be made available to the block program of the current block at generator runtime. This sets the stage for smart coins calling existing "libraries" already on the chain to lower fees and increase the scale of complex smart coins. - -## 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. -- 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. -- 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. -- At the top of the plotting wizard we have added text pointing out that you can plot without being in sync or on the internet. -- Wallet no longer automatically creates a new hierarchical deterministic wallet receive address on each start. You can and still should choose a new one with the `NEW ADDRESS` button for each new transaction for privacy. -- The network maximum k size is now set to k=50. We think that may be more storage than atoms in the solar system so it should be ok. But we will probably be hated for it in 200 years... -- The formula for computing iterations is simplified, so that only one division is necessary, and inverting the (1-x) into just x. -- 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. -- 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. -- 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. - -## 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. -- 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. -- Wallet cached transactions incorrectly in some cases. - -## 1.0rc5 aka Release Candidate 5 - 2021-03-04 - -### 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. -- 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)`. - -## 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. -- 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. -- In chiavdf we changed n-Wesolowski proofs to include B instead of y in segments. Proof segments now have the form (iters, B, proof) instead of (iters, y, proof). This reduces proof segment size from 208 to 141 bytes. -- 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. -- 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. - -### 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. -- 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. -- 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. -- Coloured coin announcements had a bug that would allow counterfeiting. - -## 1.0rc4 aka Release Candidate 4 - 2021-02-25 - -### Fixed - -- This is a bug fix release for RC3. There was an unexpected interaction between the GUI and the Click cli tool regarding Windows that made GUI plotting not start on all GUIs. - -## 1.0rc3 aka Release Candidate 3 - 2021-02-25 - -### 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. -- 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. -- 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. -- 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. -- 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. -- 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. -- 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`. -- 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. - -### Fixed - -- The GUI was often getting stuck on connecting to wallet. We beleive we have resolved this. -- We identified and fixed an issue where harvester would crash, especially when loading plots or checking a large amount of plots. -- The software now reports not synced in the GUI if not synced or being behind by 7 minutes or more. -- Difficulty was set too high for the RC1/2 chain. This lead to odd rewards behaviour as well as difficulty artificially could not fall as low as it should. -- Don't load plots that don't need to be loaded. -- 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. -- 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. -- Recursive replace was being called from the test suite. - -## 1.0rc2 aka Release Candidate 2 - 2021-02-18 - -### 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. -- 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. -- @eFishCent didn't get correct credit in the RC 1 release notes. They have been updated below to be correct. - -## 1.0rc1 aka Release Candidate 1 - 2021-02-18 - -### 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. -- 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 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! -- 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! - -### 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. -- Transactions have been further sped up. -- The blockchain database has more careful validation. -- The GUI is now using bech32m. - -### Fixed - -- We updated chiapos to hopefully address some harvester crashes when moving plot files. -- Many of the cards on the Farming page have had bugs addressed including last block farmed, block rewards, and user fees. -- Improved validation of overflow blocks. - -## [1.0beta27] aka Beta 1.27 - 2021-02-11 - -### Added - -- The Beta 27 chain is a hard fork. All TXCH from previous releases has been reset on this chain. Your keys and plots of k=32 or larger continue to work just fine on this new chain. -- 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. -- 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. -- 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. - -### Changed - -- 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. -- 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. -- We no longer replace addresses in the config. **IMPORTANT** - This means if you change the target address in config.yml, you have to make sure you control the correct keys. -- We now only migrate Beta 19 and newer installations. -- We have removed cbor2 as a dependency. -- We updated various dependencies including cryptography, packaging, portalocker, and pyyaml - most of which are only development dependencies. - -### Fixed - -- The function that estimated total farming space was counting space at twice the actual rate. Netspace will display half of the previous space estimate which is now a correct estimate of the actual space currently being farmed. -- We fixed many sync and stay in sync issue for both node and wallet including that both would send peaks to other peers multiple times and would validate the same transaction multiple times. -- 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. -- 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. - -## [1.0beta26] aka Beta 1.26 - 2021-02-05 - -### Added - -- 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. - -### 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. -- 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. -- 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). -- 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). -- 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. -- There was a potential bug in Python 3.9.0 that required us to update blspy, chiapos, chiavdf, and chiabip158. -- An off by one issue could cause syncing to ask for 1 sub block when it should ask for e.g. 32. -- Short sync and backtrack sync both had various issues. -- There was an edge case in bip158 handling. - -### Known issues - -- There is a remaining sync disconnect issue where your synced node will stop hearing responses from the network even though it still gets a few peaks and then stalls. Restarting node should let you quickly short sync back to the blockchain tip. - -## [1.0beta25] aka Beta 1.25 - -### Skipped - -## [1.0beta24] aka Beta 1.24 - -### Skipped - -## [1.0beta23] aka Beta 1.23 - 2021-01-26 - -### 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! -- 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. - -### Changed - -- 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. -- We have updated development dependencies for setuptools, yarl, idna, multidict, and chardet. -- Updated some copyright dates to 2021. - -### Fixed - -- We upgraded our fork of aiosqlite to version 16.0 which has significant performance improvements. Our fixes to aiosqlite are waiting to be upstreamed. -- The Plots tab in the GUI will no longer show red/error when the node is still syncing. -- 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. - -## [1.0beta22] aka Beta 1.22 - 2021-01-19 - -### Added - -- 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 - -### 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! - -### 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`. -- Pull requests from forks won't have failures on CI. - -## [1.0beta21] aka Beta 1.21 - 2021-01-16 - -### 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. -- If a peer gives a bad weight proof it will now be disconnected. - -### Changed - -- Harvester now only checks every 2 minutes for new files and otherwise caches the plot listing in memory and logs how long it took to load all plot files at INFO level. -- Harvester multithreading is now configureable in config.yaml. -- Websocket heartbeat timeout was increased from 30 seconds to 300 seconds. -- Bumped Colorlog to 4.7.2, and pyinstaller to 4.2. - -### Fixed - -- 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. - -## [1.0beta20] aka Beta 1.20 - 2021-01-14 - -### Added - -- Plotting now checks to see if there are MacOS created `._` plot files and ignores them. -- Mnemonics now autocomplete in the GUI. - -### Changed - -- Node sync is now multithreaded and much quicker. -- Peer gossip is faster and smarter. It also will no longer accidentally gossip a private IP address to another peer. -- When syncing in the GUI, estimated time to win just shows syncing until synced. -- If harvester hits an exception it will be caught, logged and skipped. This normally happens if it attempts to harvest a plot file you are still copying in. -- The Rate Limited wallet has been updated to work in new consensus. - -### Fixed - -- There was a bug in block reorg code that would keep a peer with a lower weight chain from validating and syncing to a higher weight chain when the node thought it had a double spend in the other chain. This caused a persistent chain split. -- The Farm page in the GUI should not report just error when initially starting to sync. - -## [1.0beta19] aka Beta 1.19 - 2021-01-12 - -### Added - -- 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. -- 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. -- Total transaction throughput is still targeted at 2.1x Bitcoin's throughput per hour but you will get more confirmations on a transaction much faster. This release has the errata that it doesn't limit transaction block size correctly. -- For testing purposes this chain is quickly halving block rewards. By the time you're reading this and using the chain, farmers and pools will be receiving less than 1 TXCH for each block won as if it were 15-20 years from now. Block rewards are given in two components, 7/8's to the pool key and 1/8 to the farmer. The farmer also receives any transaction fees from the block. -- 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! -- 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. -- We now fully support Python 3.9. - -### Changed - -- The Plot tab on the GUI is now the Plots tab. It starts out with a much more friendly new user wizard and otherwise keeps all of your farming plots listed here. Use the "+ ADD A PLOT" button in the top right to plot your second or later plot. -- 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. -- 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/` -- 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. -- 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. -- 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. -- 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. - -### Fixed - -- There was a regression in Beta 18 where the plotter took 499GiB of temp space for a k32 when it used to only use 332GiB. The plotter should now use just slightly less than it did in Beta 17. -- 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. - -## [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. - -### Changed - -- We have moved from using gulrak/filesystem across all platforms to only using it on MacOS. It's required on MacOS as we are still targeting Mojave compatibility. This should resolve Windows path issues. -- We upgraded to cbor 5.2.0 but expect to deprecate cbor in a future release. - -### 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). -- 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. -- 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 - -### Changed - -- Bumped aiohttp to 3.6.3 - -### 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 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. - -## [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! -- 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). -- 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. -- Updated to clvm 0.5.3. This fixed a bug in the `point_add` operator, that was causing taproot issues. This also removed the `SExp.is_legit_list` function. There were significant refactoring of various smart transactions for simplicity and efficiency. -- WalletTool was generally removed. -- Deprecated pep517.build for the new standard `python -m build --sdist --outdir dist .` - -### Fixed - -- A bug in bls-singatures/blspy could cause a stack overflow if too many signatures were verified at once. This caused the block of death at 11997 of the Beta 15 chain. Updated to 0.2.4 to address the issue. -- GUI Wallet now correctly updates around reorgs. -- chiapos 0.12.32 fixed a an out of bounds read that could crash the plotter. It also contains a fix to better handle the case of drive letters on Windows. -- Node would fail to start on Windows Server 2016 with lots of cores. This [python issue explains]( https://bugs.python.org/issue26903) the problem. - -### Known Issues - -- On NTFS, plotting and farming can't use a path that includes a non root mountpoint. This is fixed in an upcoming version but did not have enough testing time for this release. - -## [1.0beta15] aka Beta 1.15 - 2020-10-07 - -### Added - -- Choosing a larger k size in the GUI also increases the default memory buffer. - -### Changed - -- The development tool WalletTool was refactored out. -- Update to clvm 0.5.3. -- As k=30 and k=31 are now ruled out for mainnet, the GUI defaults to a plot size of k=32. - -### Fixed - -- Over time the new peer gossip protocol could slowly disconnect all peers and take your node offline. -- Sometimes on restart the peer connections database could cause fullnode to crash. - -## [1.0beta14] aka Beta 1.14 - 2020-10-01 - -### Added - -- Node peers are now gossiped between nodes with logic to keep connected nodes on disparate internet networks to partially protect from eclipse attacks. This is the second to last step to remove our temporary introducer and migrate to DNS introducers with peer gossip modeled directly off of Bitcoin. This adds a new database of valid peer nodes that will persist across node restarts. This also makes changes to config.yaml's contents. -- For 'git clone' installs there is now a separate install-gui.sh which speeds up running install.sh for those who wish to run headless and makes docker and other automation simpler. -- The rate limited wallet library now supports coin aggregation for adding additional funds after the time of creation. -- Fees are now used in all applicable rate limited wallet calls -- New parameters for plotting: -r (number of threads) -s (stripe size) -u (number of buckets) in cli and GUI -- chiavdf now has full IFMA optimizations for processors that support it. - -### Changed - -- Multithreading support in chiapos, as well as a new algorithm which is faster and does 70% less IO. This is a significant improvement in speed, much lower total writing, and configurability for different hardware environments. -- Default -b changed to 3072 to improve performance -- The correct amount of memory is used for plotting -- `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. -- 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 -- Fixed working space estimates so they are exact -- Log all errors in chiapos -- Fixed a bug that was causing Bluebox vdfs to fail. - -## [1.0beta13] aka Beta 1.13 - 2020-09-15 - -### Added - -### Changed - -- Long_description_content_type is now set to improve chia-blockchian'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 - -- When starting the GUI from an installer or the command line on Linux, if you had not previously generated a key on your machine, the generate new key GUI would not launch and you would be stuck with a spinner. -- Farmer display now correctly displays balance. - -## [1.0beta12] aka Beta 1.12 - 2020-09-14 - -### 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. -- 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. -- 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. -- We have ruled out k=30 for mainnet minimum plot size. k=31 may still make mainnet. k=32 and larger will be viable on mainnet. -- We moved to react-styleguidist to develop reusable components in isolation and better document the UI. Thanks to @embiem for this pull request. -- 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. - -### Fixed - -- `chia 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. - -## [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) - -### 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. -- 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. - -### Fixed - -- 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. - -## [1.0beta10] aka Beta 1.10 - 2020-08-18 - -### Added - -- 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. - -### 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. -- 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. -- Minor improvements to the Coloured Coin wallet were integrated in advance of an upcoming re-factor. -- Smart wallet backup was upgraded to encrypt and sign the contents of the backup. - -### 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) -- 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. -- Updated keyring, various GitHub actions, colorlog, cbor2, and clvm_tools. - -## [1.0beta9] aka Beta 1.9 - 2020-07-27 - -### Added - -- See wallet balances in command line: `chia 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. -- 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. -- See and remove plot directories from the UI and command line. -- You can now specify the memory buffer in UI. -- Optimized MPIR for Sandybridge and Ivybridge CPUs under Windows - -### Changed - -- `chia start wallet-server` changed to `chia 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. - -### Fixed - -- Fixed open_connection not being cancelled when node exits. -- Increase the robustness of node and wallet shutdown. -- Handle disconnection and reconnection of hard drives properly. -- Addressed pre-Haswell Windows signatures failing. -- MacOS, Linux x64, and Linux aarch64 were not correctly compiling libsodium in -the blspy/bls-signatures library. -- Removed outdated "200 plots" language from Plot tab. -- Fixed spelling error for "folder" on Plot tab. -- Various node dependency security vulnerabilities have been fixed. -- Request peers was not returning currently connected peers older than 1 day. -- Fixed timeout exception inheritance changes under python 3.8 (pull 13528) - -### Deprecated - -- Removed legacy scripts such as chia-stop-server, chia-restart-harvester, etc. - -## [1.0beta8] aka Beta 1.8 - 2020-07-16 - -### Added - -- We have released a new plot file format. We believe that plots made in this -format and with these IETF BLS keys will work without significant changes on -mainnet at launch. -- We now use [chacha8](https://cr.yp.to/chacha.html) and -[blake3](https://github.com/BLAKE3-team/BLAKE3) for proof of space instead of -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 -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, -set timelord.fast_algorithm = True in the config file. -- Added a new type of timelord helper - blue boxes, which generate compact -proofs of time for existing proven blocks. This helps reducing the database -size and speeds up syncing a node for new users joining the network. Full nodes -send 100 random un-compact blocks per hour to blue boxes, and if -timelord.sanitizer_mode = True, the blue box timelord will work on those -challenges. Unlike the main timelord, average machines can run blue boxes -and contribute to the chain. Expect improvements to the install method for -blue boxes in future releases. -- From the UI you can add a directory that harvester will always check for -existing and new plots. Harvester will only look in the specific directory you -specify so you'll have to add any subfolders you want to also contain plots. -- The UI now asks for confirmation before closing and shows shutdown progress. -- UI now tries to shut down servers gracefully before exiting, and also closes -the daemon before starting. -- The various sub repositories (chiapos, chiavdf, etc.) now build ARM64 binary -wheels for Linux with Python 3.8. This makes installing on Ubuntu 20.04 lts on -a Raspberry Pi 3 or 4 easy. -- Ci's check to see if they have secret access and attempt to fail cleanly so -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\` -in Windows or -`/Applications/Chia.app/Contents/Resources/app.asar.unpacked/daemon` on MacOS. - -### Changed - -- Minor changes have been made across the repositories to better support -compiling on OpenBSD. HT @n1000. -- Changed XCH units to TXCH units for testnet. -- A push to a branch will cancel all ci runs still running for that branch. -- Ci's now cache pip and npm caches between runs. -- Improve test speed with smaller discriminants, less blocks, less keys, and -smaller plots. -- RPC servers and clients were refactored. -- The keychain no longer supports old keys that don't have mnemonics. -- The keychain uses BIP39 for seed derivation, using the "" passphrase, and -also stores public keys. -- Plots.yaml has been replaced. Plot secret keys are stored in the plots, - and a list of directories that harvester can find plots in are in config.yaml. -You can move plots around to any directory in config.yaml as long as the farmer -has the correct farmer's secret key too. -- Auto scanning of plot directories for .plot files. -- The block header format was changed (puzzle hashes and pool signature). -- Coinbase and fees coin are now in merkle set, and bip158 filter. -- New harvester protocol with 2/2 harvester and farmer signatures, and modified -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". -- 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. -- Keys are now derived with the EIP 2334 (m/12381/8444/a/b). -- Removed the ability to pass in sk_seed to plotting, to increase security. -- Linux builds of chiavdf and blspy now use a fresh build of gmp 6.2.1. - -### Fixed - -- uPnP now works on Windows. -- Log rotation should now properly rotate every 20MB and keep 7 historical logs. -- Node had a significant memory leak under load due to an extraneous fork -in the network code. -- Skylake processors on Windows without AVX would fail to run. -- Harvester no longer runs into 512 maximum file handles open issue on Windows. -- The version generator for new installers incorrectly handled the "dev" -versions after a release tag. -- Due to a python bug, ssl connections could randomly fail. Worked around -[Python issue 29288](https://bugs.python.org/issue29288) -- Removed websocket max message limit, allowing for more plots -- Daemon was crashing when websocket gets improperly closed - -### Deprecated - -- All keys generated before Beta 1.8 are of an old format and no longer useful. -- All plots generated before Beta 1.8 are no longer compatible with testnet and -should be deleted. - -### Known Issues - -- For Windows users on pre Haswell CPUs there is a known issue that causes -"Given G1 element failed g1_is_valid check" when attempting to generate -keys. This is a regression from our previous fix when it was upstreamed into -relic. We will make a patch available for these systems shortly. - -## [1.0beta7] aka Beta 1.7 - 2020-06-08 - -### Added - -- Added ability to add plot from filesystem (you will need pool_pk and sk from plots.yaml.) -- 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. - -### 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. -- 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. - -### Fixed - -- Having spaces in the path to a plot or temporary directory caused plotting to fail. -- Changing keys will no longer interrupt plotting log. -- 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. - -## [1.0beta6] aka Beta 1.6 - 2020-06-01 - -### Added - -- 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 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 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. - -### Changed - -- Due to an issue with aggsig and aggsig-me, the beta 1.6 blockchain is not compatible with earlier chains. -- 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 - 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. -- The Full node RPC response formats have been changed. All API calls now return a dict with success, and an additional value, for example {"success": True, "block": block}. -- chiapos is now easier to compile with MSVC. -- create plots now takes in an optional sk_seed, it is no longer read in from keys.yaml. If not passed in, it is randomly generated. The -i argument can now only be used when you provide an sk_seed. -- Moved to PyYAML 5.3.1 which prevents arbitrary code execution during python/object/new constructor. -- Moved to Python cryptography 2.9.2 which deprecates OpenSSL 1.0.1 and now relies upon OpenSSL 1.1.1g. -- Moved to aiosqlite 0.13.0 which adds official support for Python 3.8 and fixes a possible hung thread if a connection failed. - -### Fixed - -- 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. -- 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. -- The `install-timelord.sh` script now correctly determines which version of python it is running under and correctly builds vdf_client and correctly links to vdf_bench. It also handles upgrading CMake on Ubuntu's older than 20.04LTS do satisfy the new CMake 3.14+ requirement to build Timelord. -- An issue in asyncio was not being caught correctly and that could cause nodes to crash. -- The build status shield layout is fixed in README.md -- Raspberry Pi 3/4 with Ubuntu 20.04LTS 64 bit should compile again. - -## [1.0beta5] aka Beta 1.5 - 2020-05-05 - -### 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`. - -### 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`. -- 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 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 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." - -### Known issues - -- 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. -- Currently, there is no way to restore a Coloured Coin Wallet. - -## [1.0beta4] aka Beta 1.4 - 2020-04-29 - -### 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 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. -- 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) -- 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. -- 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. - -### Deprecated - -- This release breaks the wire protocol so it comes with a new chain. As we merged in Coloured coins we found that we needed to change how certain hashes were managed. Your 1.0beta3 coin balances will be lost when you upgrade but your plots will continue to work on the 1.0beta4 chain. Since we had to make a breaking wire protocol change we accelerated changing our hash to prime function for starting proofs of time. That was also going to be a future breaking change. - -### 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). -- 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. - -## [1.0beta3] aka Beta 1.3 - 2020-04-08 - -### Added - -- 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. -- 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`. - -### 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. -- 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. -- We increase the default farmer propagate threshold to reduce chain stall probability. - -### Deprecated - -- You should not copy over any prior Wallet database as they are not compatible with Beta3. Your existing full node will not have to re-sync and its database remains compatible. - -#### Fixed - -- Among a lot of bug fixes was removing a regression that slowed plotting on MacOS by 3 times and may have had smaller impacts on plotting speed on other platforms. -- We've removed some race conditions in the Wallet -- We resolved the "invalid blocks could disconnect farmers" bug -- We and upped the default tls certificate size to 2048 for some unhappy operating systems. - -### Known issues - -- 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 - -## [1.0beta2] aka Beta 1.2 - 2020-04-04 [YANKED] - -## [1.0beta1] aka Beta 1.0 - 2020-04-02 - -### 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. -- 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. -- We have continued to make improvements to the speed of VDF squaring, creating a VDF proof, and verifying a VDF proof. - -### 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 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). -- 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`. -- 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. -- `install-timelord.sh` has been pulled out from `install.sh`. This script downloads the source python package for chiavdf and compiles it locally for timelords. vdf_client can be included or excluded to make building normal user wheels easier. - -### 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. -- We have removed the inkfish vdf implementation and replaced it with the pybind11 C++ version. - -### Known Issues - -- Wallet currently has limited support for restoring from a paper wallet. Wallet uses hierarchically deterministic keys, and assumes that any keys that are at index "higher than one" have not been used yet. If you have received a payment to an address associated with a key at a higher index and you want it to appear in Wallet, the current work around is to press the "NEW ADDRESS" button multiple times shortly after sync start. That will make wallet "aware of" addresses at higher indexes. Full support for paper wallet restoration will be added soon. -- We. Don't... Have.. Windows.... Native. YET!?! But the entire project is compiling on Windows 10 natively. Assistance would be more than appreciated if you have experience building binary python wheels for Windows. We are pushing some limits like uint-128, avx-2, avx-512, and AES-NI so it's not as easy as it looks... - -## [Alpha 1.5.1] - 2020-03-24 - -### Fixed - -- Fixed a bug in harvester that caused plots not to be farmed. - -## [Alpha 1.5] - 2020-03-08 - -### Added - -- You can now provide an index to create_plots using the -i flag to create an arbitrary new plot derived from an existing plot key. Thanks @xorinox. -- There is a new restart_harvester.sh in scripts/ to easily restart a harvester when you want to add a newly completed plot to the farm without restarting farmer, fullnode, timelord, etc. -- Harvesters now log errors if they encounter a malformed or corrupted plot file. Again thanks @xorinox. -- New AJAX based full node UI. To access go to [http://127.0.0.1:8555/index.html](http://127.0.0.1:8555/index.html) with any modern web browser on the same machine as the full node. -- If you want to benchmark your CPU as a VDF you can use vdf_bench square_asm 500000 for the assembly optimized test or just vdf_bench square 500000 for the plain C++ code path. This tool is found in lib/chiavdf/fast_vdf/. -- Improvements to shutting down services in all of the scripts in scripts/. Another @xorinox HT. - -### Changed - -- VDF verification code is improved and is now more paranoid. -- Timelords can now be run as a cluster of VDF client instances around a central Timelord instance.. Instructions are available in the Cluster Timelord section of the repo wiki. - -### Fixed - -- Thanks @dkackman for clean ups to the proof of space code. -- Thanks to @davision for some typo fixes. - -## [Alpha 1.4.1] - 2020-03-06 - -### Fixed - -- Stack overflow in verifier - -## [Alpha 1.4] - 2020-02-19 - -### Added - -- Compiling and execution now detect AES-NI, or a lack of it, and fall back to a software AES implementation. -- Software AES adds support for Raspberry Pi 4, related ARM processors and Celeron processors. -- Added install instructions for CentOS/RHEL 8.1. -- Plotting working directory and final directory can both be specified in config.yaml -- Proof of space binary and create_plots scripts now allows passing in temp and final directories. -- Plotting now logs a timestamp at each major step. -- Added support for Python 3.8. - -### Changed - -- 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. -- uvloop is now an optional add on. -- Harvester/farmer will not try to farm plots that they don’t have the key for. - -### Fixed - -- Thanks to @A-Caccese for fixes to Windows WSL instructions. -- Thanks @dkackman who also fixed some compiler warnings. - -## [Alpha 1.3] - 2020-01-21 - -### 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. -- 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. - -### 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. -- Clarified the minimum version of boost required to build timelord/VDFs. Hat tip @AdrianScott -- Consensus and related documentation moved to the repository wiki. - -### Fixed - -- Fixed a bug where the node may not sync if it restarts close to a tip. -- Fixed a typo in the UI. Hat tip to @lvcivs for the pr. -- Fixed a memory leak in qfb_nudupl. -- Lots of smaller bug and documentation fixes. - -### Removed - -- Mongodb removed and replaced with SQLite for the blockchain database. This will require nodes to re-sync with the network. Luckily this is now faster. - -## [Alpha 1.2] - 2020-01-08 - -### Added - -- Performance improvements - - Removes database access from blockchain, and handles headers instead of blocks - - Avoid processing blocks and unfinished blocks that we have already seen. - - Also adds test for load. - -### Changed - -- Improvements to plotting via lookup table - as much as 15% faster - -### Fixed - -- Fixed a blockchain initialization bug - -## [Alpha 1.1.1] - 2019-12-25 - -### Added - -- Added install instructions for Windows using WSL and Ubuntu. -- Added install instructions for CentOS 7.7. -- Added install instructions for Amazon Linux 2. -- New install_timelord.sh. - -### Changed - -- Installation is now separated into everything except timelord/vdf and timelord/vdf. -- replaced VDF server compilation scripts with Makefile - -### Fixed - -- setuptools_scm was corrupting .zip downloads of the repository. - -## [Alpha 1.1] - 2019-12-12 - -### Added - -- Introducer now makes sure it only sends peer addresses to peers of peers that it can reach on port 8444 or their UPnP port. -- We are now using setuptools_scm for versioning. - -### Changed - -- Timelord VDF submission and management logic upgraded. - -### Fixed - -- FullNode: A long running or low ulimit situation could cause an “out of files” issue which would stop new connection creation. Removed the underlying socket leak. -- FullNode: Multiple SSH UI bugs fixed. -- Harvester: Farming a plot of k = 30 or greater could lead to a segfault in the harvester. -- Updated blspy requirement to address an issue in the underlying bls-signatures library. - -## [Alpha 1.0] - 2019-12-05 - -### 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 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 f93c6f72e..aa27d160d 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/yEWaF6CQcA), 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 `latest`. +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 `latest`. ## 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.3.x` to main). @@ -53,7 +53,7 @@ to configure how the tests are run. For example, for more logging: change the lo ```bash sh install.sh -d . ./activate -black . && isort benchmarks build_scripts chia tests tools *.py && mypy && flake8 benchmarks build_scripts chia tests tools *.py +black . && isort benchmarks build_scripts flax tests tools *.py && mypy && flake8 benchmarks build_scripts flax tests tools *.py py.test tests -v --durations 0 ``` @@ -66,7 +66,7 @@ If you want verbose logging for tests, edit the `tests/pytest.ini` file. ## Pre-Commit -We provide a [pre-commit configuration](https://github.com/Chia-Network/chia-blockchain/blob/main/.pre-commit-config.yaml) which triggers several useful +We provide a [pre-commit configuration](https://github.com/Flax-Network/flax-blockchain/blob/main/.pre-commit-config.yaml) which triggers several useful hooks (including linters/formatter) before each commit you make if you installed and set up [pre-commit](https://pre-commit.com/). This will help to reduce the time you spend on failed CI jobs. @@ -82,7 +82,7 @@ provided configuration with `pre-commit install`. 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 @@ -98,19 +98,19 @@ workflow. It's also especially efficient for git branching, cherry-picking, comm ## Testnets and review environments -The current official testnet is testnet10. Look at `chia/util/initial_config.yaml` to see the configuration parameters +The current official testnet is testnet10. Look at `flax/util/initial_config.yaml` to see the configuration parameters for each testnet. Information on how to use the testnet can be found in the wiki. 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/Install-gui.ps1 b/Install-gui.ps1 index 86ecab8b6..4b359a5f4 100644 --- a/Install-gui.ps1 +++ b/Install-gui.ps1 @@ -2,7 +2,7 @@ $ErrorActionPreference = "Stop" if ($null -eq (Get-ChildItem env:VIRTUAL_ENV -ErrorAction SilentlyContinue)) { - Write-Output "This script requires that the Chia Python virtual environment is activated." + Write-Output "This script requires that the Flax Python virtual environment is activated." Write-Output "Execute '.\venv\Scripts\Activate.ps1' before running." Exit 1 } @@ -19,18 +19,18 @@ git submodule update --init --recursive Push-Location try { - Set-Location chia-blockchain-gui + Set-Location flax-blockchain-gui $ErrorActionPreference = "SilentlyContinue" - npm ci --loglevel=error + npm install --loglevel=error npm audit fix npm run build py ..\installhelper.py Write-Output "" - Write-Output "Chia blockchain Install-gui.ps1 completed." + Write-Output "Flax blockchain Install-gui.ps1 completed." Write-Output "" - Write-Output "Type 'cd chia-blockchain-gui' and then 'npm run electron' to start the GUI." + Write-Output "Type 'cd flax-blockchain-gui' and then 'npm run electron' to start the GUI." } finally { Pop-Location } diff --git a/Install.ps1 b/Install.ps1 index 89acb6928..25eba8950 100644 --- a/Install.ps1 +++ b/Install.ps1 @@ -13,7 +13,7 @@ if ($d) if ([Environment]::Is64BitOperatingSystem -eq $false) { - Write-Output "Chia requires a 64-bit Windows installation" + Write-Output "Flax requires a 64-bit Windows installation" Exit 1 } @@ -107,13 +107,13 @@ venv\scripts\pip install --extra-index-url https://pypi.chia.net/simple/ miniupn venv\scripts\pip install --editable ".$extras_cli" --extra-index-url https://pypi.chia.net/simple/ Write-Output "" -Write-Output "Chia blockchain .\Install.ps1 complete." -Write-Output "For assistance join us on Keybase in the #support chat channel:" -Write-Output "https://keybase.io/team/chia_network.public" +Write-Output "Flax blockchain .\Install.ps1 complete." +Write-Output "For assistance join us on Discord in the #support chat channel:" +Write-Output "https://discord.gg/yEWaF6CQcA" Write-Output "" -Write-Output "Try the Quick Start Guide to running chia-blockchain:" -Write-Output "https://github.com/Chia-Network/chia-blockchain/wiki/Quick-Start-Guide" +Write-Output "Try the Quick Start Guide to running flax-blockchain:" +Write-Output "https://github.com/Flax-Network/flax-blockchain/wiki/Quick-Start-Guide" Write-Output "" Write-Output "To install the GUI type '.\Install-gui.ps1' after '.\venv\scripts\Activate.ps1'." Write-Output "" -Write-Output "Type '.\venv\Scripts\Activate.ps1' and then 'chia init' to begin." +Write-Output "Type '.\venv\Scripts\Activate.ps1' and then 'flax init' to begin." diff --git a/README.md b/README.md index cb97e5d8d..221695e4f 100644 --- a/README.md +++ b/README.md @@ -1,54 +1,3 @@ -# chia-blockchain - -![Alt text](https://www.chia.net/img/chia_logo.svg) - -| 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) -* [Chia seeder](https://github.com/Chia-Network/chia-blockchain/wiki/Chia-Seeder-User-Guide), which maintains a list of reliable nodes within the Chia network via a built-in DNS server. -* 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://github.com/Chia-Network/chia-blockchain/wiki/Pooling-User-Guide) 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. -Setting up a seeder is best left to more advanced users. -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). +# flax-blockchain + +**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. diff --git a/benchmarks/block_ref.py b/benchmarks/block_ref.py index 3b9044fbf..1d8c76beb 100644 --- a/benchmarks/block_ref.py +++ b/benchmarks/block_ref.py @@ -9,16 +9,16 @@ import aiosqlite import click -from chia.consensus.blockchain import Blockchain -from chia.consensus.default_constants import DEFAULT_CONSTANTS -from chia.full_node.block_store import BlockStore -from chia.full_node.coin_store import CoinStore -from chia.full_node.hint_store import HintStore -from chia.types.blockchain_format.program import SerializedProgram -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.db_version import lookup_db_version -from chia.util.db_wrapper import DBWrapper2 -from chia.util.ints import uint32 +from flax.consensus.blockchain import Blockchain +from flax.consensus.default_constants import DEFAULT_CONSTANTS +from flax.full_node.block_store import BlockStore +from flax.full_node.coin_store import CoinStore +from flax.full_node.hint_store import HintStore +from flax.types.blockchain_format.program import SerializedProgram +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.db_version import lookup_db_version +from flax.util.db_wrapper import DBWrapper2 +from flax.util.ints import uint32 # the first transaction block. Each byte in transaction_height_delta is the # number of blocks to skip forward to get to the next transaction block diff --git a/benchmarks/block_store.py b/benchmarks/block_store.py index 2afca92d6..ea4d3355e 100644 --- a/benchmarks/block_store.py +++ b/benchmarks/block_store.py @@ -18,18 +18,18 @@ ) from benchmarks.utils import clvm_generator -from chia.consensus.block_record import BlockRecord -from chia.full_node.block_store import BlockStore -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.program import SerializedProgram -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.sub_epoch_summary import SubEpochSummary -from chia.types.full_block import FullBlock -from chia.util.db_wrapper import DBWrapper2 -from chia.util.ints import uint8, uint32, uint64, uint128 +from flax.consensus.block_record import BlockRecord +from flax.full_node.block_store import BlockStore +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.program import SerializedProgram +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.sub_epoch_summary import SubEpochSummary +from flax.types.full_block import FullBlock +from flax.util.db_wrapper import DBWrapper2 +from flax.util.ints import uint8, uint32, uint64, uint128 NUM_ITERS = 20000 diff --git a/benchmarks/clvm_generator.bin b/benchmarks/clvm_generator.bin index 140b6edea47cecd7608bf2d7544799e9925087c4..9d25906dafce20c825e52b43b74eed0e86d7dbd9 100644 GIT binary patch delta 22 ecmX@UmHqfu_J%EtTo+l=auO@H^Ic@z$q4{)2?-wn delta 22 ecmX@UmHqfu_J%EtTo+lAGcpsm^Ic@z$q4{(W(f%Z diff --git a/benchmarks/coin_store.py b/benchmarks/coin_store.py index d5e89fdeb..754bb89aa 100644 --- a/benchmarks/coin_store.py +++ b/benchmarks/coin_store.py @@ -8,11 +8,11 @@ from utils import rand_hash, rewards, setup_db -from chia.full_node.coin_store import CoinStore -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.db_wrapper import DBWrapper2 -from chia.util.ints import uint32, uint64 +from flax.full_node.coin_store import CoinStore +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.db_wrapper import DBWrapper2 +from flax.util.ints import uint32, uint64 NUM_ITERS = 200 diff --git a/benchmarks/streamable.py b/benchmarks/streamable.py index d940a421a..d759b5904 100644 --- a/benchmarks/streamable.py +++ b/benchmarks/streamable.py @@ -9,10 +9,10 @@ import click from utils import EnumType, get_commit_hash, rand_bytes, rand_full_block, rand_hash -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.full_block import FullBlock -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.types.full_block import FullBlock +from flax.util.ints import uint8, uint64 +from flax.util.streamable import Streamable, streamable _version = 1 diff --git a/benchmarks/utils.py b/benchmarks/utils.py index 2f9b8481f..1638b5150 100644 --- a/benchmarks/utils.py +++ b/benchmarks/utils.py @@ -10,20 +10,20 @@ import click from blspy import AugSchemeMPL, G1Element, G2Element -from chia.consensus.coinbase import create_farmer_coin, create_pool_coin -from chia.consensus.default_constants import DEFAULT_CONSTANTS -from chia.types.blockchain_format.classgroup import ClassgroupElement -from chia.types.blockchain_format.coin import Coin -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.program import SerializedProgram -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, bytes100 -from chia.types.blockchain_format.vdf import VDFInfo, VDFProof -from chia.types.full_block import FullBlock -from chia.util.db_wrapper import DBWrapper2 -from chia.util.ints import uint8, uint32, uint64, uint128 +from flax.consensus.coinbase import create_farmer_coin, create_pool_coin +from flax.consensus.default_constants import DEFAULT_CONSTANTS +from flax.types.blockchain_format.classgroup import ClassgroupElement +from flax.types.blockchain_format.coin import Coin +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.program import SerializedProgram +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, bytes100 +from flax.types.blockchain_format.vdf import VDFInfo, VDFProof +from flax.types.full_block import FullBlock +from flax.util.db_wrapper import DBWrapper2 +from flax.util.ints import uint8, uint32, uint64, uint128 # farmer puzzle hash ph = bytes32(b"a" * 32) diff --git a/build_scripts/assets/deb/control.j2 b/build_scripts/assets/deb/control.j2 index 29e9d2678..fe29e1541 100644 --- a/build_scripts/assets/deb/control.j2 +++ b/build_scripts/assets/deb/control.j2 @@ -1,6 +1,6 @@ -Package: chia-blockchain-cli -Version: {{ CHIA_INSTALLER_VERSION }} +Package: flax-blockchain-cli +Version: {{ FLAX_INSTALLER_VERSION }} Architecture: {{ PLATFORM }} -Maintainer: Chia Network Inc -Description: Chia Blockchain - Chia is a modern cryptocurrency built from scratch, designed to be efficient, decentralized, and secure. +Maintainer: Flax Network Inc +Description: Flax Blockchain + Flax is a modern cryptocurrency built from scratch, designed to be efficient, decentralized, and secure. diff --git a/build_scripts/assets/deb/postinst.sh b/build_scripts/assets/deb/postinst.sh index 01be34115..739bb4bc9 100644 --- a/build_scripts/assets/deb/postinst.sh +++ b/build_scripts/assets/deb/postinst.sh @@ -3,5 +3,5 @@ set -e -ln -s /usr/lib/chia-blockchain/resources/app.asar.unpacked/daemon/chia /usr/bin/chia || true -ln -s /usr/lib/chia-blockchain/resources/app.asar.unpacked/daemon /opt/chia || true +ln -s /usr/lib/flax-blockchain/resources/app.asar.unpacked/daemon/flax /usr/bin/flax || true +ln -s /usr/lib/flax-blockchain/resources/app.asar.unpacked/daemon /opt/flax || true diff --git a/build_scripts/assets/deb/prerm.sh b/build_scripts/assets/deb/prerm.sh index 9e34e2602..37c5f1b70 100644 --- a/build_scripts/assets/deb/prerm.sh +++ b/build_scripts/assets/deb/prerm.sh @@ -3,5 +3,5 @@ set -e -unlink /usr/bin/chia || true -unlink /opt/chia || true +unlink /usr/bin/flax || true +unlink /opt/flax || true diff --git a/build_scripts/build_dmg.js b/build_scripts/build_dmg.js index e7bbd96b4..20ac0f326 100644 --- a/build_scripts/build_dmg.js +++ b/build_scripts/build_dmg.js @@ -44,8 +44,8 @@ async function main(opts) { console.log('Finished'); } -const appName = 'Chia'; -const dmgIcon = '../chia-blockchain-gui/packages/gui/src/assets/img/Chia.icns'; +const appName = 'Flax'; +const dmgIcon = '../flax-blockchain-gui/packages/gui/src/assets/img/Flax.icns'; const dmgBackground = './assets/dmg/background.tiff'; const outputDir = './final_installer'; const appPath = process.argv[2]; // required diff --git a/build_scripts/build_linux_deb.sh b/build_scripts/build_linux_deb.sh index 27e24ba38..275a185e4 100644 --- a/build_scripts/build_linux_deb.sh +++ b/build_scripts/build_linux_deb.sh @@ -7,26 +7,26 @@ if [ ! "$1" ]; then exit 1 elif [ "$1" = "amd64" ]; then PLATFORM="$1" - 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 export PLATFORM # If the env variable NOTARIZE and the username and password variables are # set, this will attempt to Notarize the signed DMG -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" -export CHIA_INSTALLER_VERSION +echo "Flax Installer Version is: $FLAX_INSTALLER_VERSION" +export FLAX_INSTALLER_VERSION echo "Installing npm and electron packagers" cd npm_linux_deb || exit -npm ci +npm install PATH=$(npm bin):$PATH cd .. || exit @@ -35,7 +35,7 @@ rm -rf dist mkdir dist echo "Create executables with pyinstaller" -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 @@ -46,23 +46,23 @@ fi # Builds CLI only .deb # need j2 for templating the control file pip install j2cli -CLI_DEB_BASE="chia-blockchain-cli_$CHIA_INSTALLER_VERSION-1_$PLATFORM" -mkdir -p "dist/$CLI_DEB_BASE/opt/chia" +CLI_DEB_BASE="flax-blockchain-cli_$FLAX_INSTALLER_VERSION-1_$PLATFORM" +mkdir -p "dist/$CLI_DEB_BASE/opt/flax" mkdir -p "dist/$CLI_DEB_BASE/usr/bin" mkdir -p "dist/$CLI_DEB_BASE/DEBIAN" j2 -o "dist/$CLI_DEB_BASE/DEBIAN/control" assets/deb/control.j2 -cp -r dist/daemon/* "dist/$CLI_DEB_BASE/opt/chia/" -ln -s ../../opt/chia/chia "dist/$CLI_DEB_BASE/usr/bin/chia" +cp -r dist/daemon/* "dist/$CLI_DEB_BASE/opt/flax/" +ln -s ../../opt/flax/flax "dist/$CLI_DEB_BASE/usr/bin/flax" dpkg-deb --build --root-owner-group "dist/$CLI_DEB_BASE" # CLI only .deb done -cp -r dist/daemon ../chia-blockchain-gui/packages/gui +cp -r dist/daemon ../flax-blockchain-gui/packages/gui cd .. || exit -cd chia-blockchain-gui || exit +cd flax-blockchain-gui || exit echo "npm build" lerna clean -y -npm ci +npm install # Audit fix does not currently work with Lerna. See https://github.com/lerna/lerna/issues/1663 # npm audit fix npm run build @@ -75,13 +75,13 @@ fi # Change to the gui package cd packages/gui || exit -# sets the version for chia-blockchain in package.json +# sets the version for flax-blockchain in package.json cp package.json package.json.orig -jq --arg VER "$CHIA_INSTALLER_VERSION" '.version=$VER' package.json > temp.json && mv temp.json package.json +jq --arg VER "$FLAX_INSTALLER_VERSION" '.version=$VER' package.json > temp.json && mv temp.json package.json -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 --executable-name=chia-blockchain +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 --executable-name=flax-blockchain LAST_EXIT_CODE=$? # reset the package.json to the original @@ -95,12 +95,12 @@ 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/" \ --arch "$PLATFORM" \ - --options.version "$CHIA_INSTALLER_VERSION" \ + --options.version "$FLAX_INSTALLER_VERSION" \ --config deb-options.json LAST_EXIT_CODE=$? if [ "$LAST_EXIT_CODE" -ne 0 ]; then diff --git a/build_scripts/build_linux_rpm.sh b/build_scripts/build_linux_rpm.sh index 60829b193..caf07c56c 100644 --- a/build_scripts/build_linux_rpm.sh +++ b/build_scripts/build_linux_rpm.sh @@ -8,24 +8,24 @@ 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 # If the env variable NOTARIZE and the username and password variables are # set, this will attempt to Notarize the signed DMG -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" cd npm_linux_rpm || exit -npm ci +npm install GLOBAL_NPM_ROOT=$(pwd)/node_modules PATH=$(npm bin):$PATH cd .. || exit @@ -35,7 +35,7 @@ rm -rf dist mkdir dist echo "Create executables with pyinstaller" -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 @@ -44,11 +44,11 @@ if [ "$LAST_EXIT_CODE" -ne 0 ]; then fi # Builds CLI only rpm -CLI_RPM_BASE="chia-blockchain-cli-$CHIA_INSTALLER_VERSION-1.$REDHAT_PLATFORM" -mkdir -p "dist/$CLI_RPM_BASE/opt/chia" +CLI_RPM_BASE="flax-blockchain-cli-$FLAX_INSTALLER_VERSION-1.$REDHAT_PLATFORM" +mkdir -p "dist/$CLI_RPM_BASE/opt/flax" mkdir -p "dist/$CLI_RPM_BASE/usr/bin" -cp -r dist/daemon/* "dist/$CLI_RPM_BASE/opt/chia/" -ln -s ../../opt/chia/chia "dist/$CLI_RPM_BASE/usr/bin/chia" +cp -r dist/daemon/* "dist/$CLI_RPM_BASE/opt/flax/" +ln -s ../../opt/flax/flax "dist/$CLI_RPM_BASE/usr/bin/flax" # This is built into the base build image # shellcheck disable=SC1091 . /etc/profile.d/rvm.sh @@ -59,22 +59,22 @@ rvm use ruby-3 fpm -s dir -t rpm \ -C "dist/$CLI_RPM_BASE" \ -p "dist/$CLI_RPM_BASE.rpm" \ - --name chia-blockchain-cli \ + --name flax-blockchain-cli \ --license Apache-2.0 \ - --version "$CHIA_INSTALLER_VERSION" \ + --version "$FLAX_INSTALLER_VERSION" \ --architecture "$REDHAT_PLATFORM" \ - --description "Chia is a modern cryptocurrency built from scratch, designed to be efficient, decentralized, and secure." \ + --description "Flax is a modern cryptocurrency built from scratch, designed to be efficient, decentralized, and secure." \ --depends /usr/lib64/libcrypt.so.1 \ . # CLI only rpm done -cp -r dist/daemon ../chia-blockchain-gui/packages/gui +cp -r dist/daemon ../flax-blockchain-gui/packages/gui cd .. || exit -cd chia-blockchain-gui || exit +cd flax-blockchain-gui || exit echo "npm build" lerna clean -y -npm ci +npm install # Audit fix does not currently work with Lerna. See https://github.com/lerna/lerna/issues/1663 # npm audit fix npm run build @@ -87,13 +87,13 @@ fi # Change to the gui package cd packages/gui || exit -# sets the version for chia-blockchain in package.json +# sets the version for flax-blockchain in package.json cp package.json package.json.orig -jq --arg VER "$CHIA_INSTALLER_VERSION" '.version=$VER' package.json > temp.json && mv temp.json package.json +jq --arg VER "$FLAX_INSTALLER_VERSION" '.version=$VER' package.json > temp.json && mv temp.json package.json -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 --executable-name=chia-blockchain +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 --executable-name=flax-blockchain LAST_EXIT_CODE=$? # reset the package.json to the original @@ -108,9 +108,9 @@ mv $DIR_NAME ../../../build_scripts/dist/ cd ../../../build_scripts || exit if [ "$REDHAT_PLATFORM" = "x86_64" ]; then - echo "Create chia-blockchain-$CHIA_INSTALLER_VERSION.rpm" + echo "Create flax-blockchain-$FLAX_INSTALLER_VERSION.rpm" - # Disables build links from the generated rpm so that we dont conflict with other packages. See https://github.com/Chia-Network/chia-blockchain/issues/3846 + # Disables build links from the generated rpm so that we dont conflict with other packages. See https://github.com/Flax-Network/flax-blockchain/issues/3846 # shellcheck disable=SC2086 sed -i '1s/^/%define _build_id_links none\n%global _enable_debug_package 0\n%global debug_package %{nil}\n%global __os_install_post \/usr\/lib\/rpm\/brp-compress %{nil}\n/' "$GLOBAL_NPM_ROOT/electron-installer-redhat/resources/spec.ejs" @@ -125,8 +125,8 @@ if [ "$REDHAT_PLATFORM" = "x86_64" ]; then sed -i "s#throw new Error('Please upgrade to RPM 4.13.*#console.warn('You are using RPM < 4.13')\n return { requires: [ 'gtk3', 'libnotify', 'nss', 'libXScrnSaver', 'libXtst', 'xdg-utils', 'at-spi2-core', 'libdrm', 'mesa-libgbm', 'libxcb' ] }#g" $GLOBAL_NPM_ROOT/electron-installer-redhat/src/dependencies.js electron-installer-redhat --src dist/$DIR_NAME/ --dest final_installer/ \ - --arch "$REDHAT_PLATFORM" --options.version $CHIA_INSTALLER_VERSION \ - --license ../LICENSE --options.bin chia-blockchain --options.name chia-blockchain + --arch "$REDHAT_PLATFORM" --options.version $FLAX_INSTALLER_VERSION \ + --license ../LICENSE --options.bin flax-blockchain --options.name flax-blockchain LAST_EXIT_CODE=$? if [ "$LAST_EXIT_CODE" -ne 0 ]; then echo >&2 "electron-installer-redhat failed!" diff --git a/build_scripts/build_macos.sh b/build_scripts/build_macos.sh index 35aedaef9..26642f0f6 100644 --- a/build_scripts/build_macos.sh +++ b/build_scripts/build_macos.sh @@ -5,15 +5,15 @@ set -o errexit -o nounset # If the env variable NOTARIZE and the username and password variables are # set, this will attempt to Notarize the signed DMG. -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" cd npm_macos || exit -npm ci +npm install PATH=$(npm bin):$PATH cd .. || exit @@ -22,20 +22,20 @@ sudo rm -rf dist mkdir dist echo "Create executables with pyinstaller" -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/packages/gui +cp -r dist/daemon ../flax-blockchain-gui/packages/gui cd .. || exit -cd chia-blockchain-gui || exit +cd flax-blockchain-gui || exit echo "npm build" lerna clean -y -npm ci +npm install # Audit fix does not currently work with Lerna. See https://github.com/lerna/lerna/issues/1663 # npm audit fix npm run build @@ -48,14 +48,14 @@ fi # Change to the gui package cd packages/gui || exit -# sets the version for chia-blockchain in package.json +# sets the version for flax-blockchain in package.json brew install jq cp package.json package.json.orig -jq --arg VER "$CHIA_INSTALLER_VERSION" '.version=$VER' package.json > temp.json && mv temp.json package.json +jq --arg VER "$FLAX_INSTALLER_VERSION" '.version=$VER' package.json > temp.json && mv temp.json package.json -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=$? # reset the package.json to the original @@ -67,8 +67,8 @@ if [ "$LAST_EXIT_CODE" -ne 0 ]; then fi if [ "$NOTARIZE" == true ]; 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 @@ -78,13 +78,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 -NODE_PATH=./npm_macos/node_modules node build_dmg.js dist/Chia-darwin-x64/Chia.app $CHIA_INSTALLER_VERSION +NODE_PATH=./npm_macos/node_modules node build_dmg.js dist/Flax-darwin-x64/Flax.app $FLAX_INSTALLER_VERSION LAST_EXIT_CODE=$? if [ "$LAST_EXIT_CODE" -ne 0 ]; then echo >&2 "electron-installer-dmg failed!" @@ -94,7 +94,7 @@ fi if [ "$NOTARIZE" == true ]; 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 @@ -105,7 +105,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". @@ -113,7 +113,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_macos_m1.sh b/build_scripts/build_macos_m1.sh index 95582cb9f..fd7b74354 100644 --- a/build_scripts/build_macos_m1.sh +++ b/build_scripts/build_macos_m1.sh @@ -5,15 +5,15 @@ set -o errexit -o nounset # If the env variable NOTARIZE and the username and password variables are # set, this will attempt to Notarize the signed DMG. -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" cd npm_macos_m1 || exit -npm ci +npm install PATH=$(npm bin):$PATH cd .. || exit @@ -22,20 +22,20 @@ sudo rm -rf dist mkdir dist echo "Create executables with pyinstaller" -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/packages/gui +cp -r dist/daemon ../flax-blockchain-gui/packages/gui cd .. || exit -cd chia-blockchain-gui || exit +cd flax-blockchain-gui || exit echo "npm build" lerna clean -y -npm ci +npm install # Audit fix does not currently work with Lerna. See https://github.com/lerna/lerna/issues/1663 # npm audit fix npm run build @@ -48,14 +48,14 @@ fi # Change to the gui package cd packages/gui || exit -# sets the version for chia-blockchain in package.json +# sets the version for flax-blockchain in package.json brew install jq cp package.json package.json.orig -jq --arg VER "$CHIA_INSTALLER_VERSION" '.version=$VER' package.json > temp.json && mv temp.json package.json +jq --arg VER "$FLAX_INSTALLER_VERSION" '.version=$VER' package.json > temp.json && mv temp.json package.json -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=$? # reset the package.json to the original @@ -67,8 +67,8 @@ if [ "$LAST_EXIT_CODE" -ne 0 ]; then fi if [ "$NOTARIZE" ]; then - electron-osx-sign Chia-darwin-arm64/Chia.app --platform=darwin \ - --hardened-runtime=true --provisioning-profile=chiablockchain.provisionprofile \ + electron-osx-sign Flax-darwin-arm64/Flax.app --platform=darwin \ + --hardened-runtime=true --provisioning-profile=flaxblockchain.provisionprofile \ --entitlements=entitlements.mac.plist --entitlements-inherit=entitlements.mac.plist \ --no-gatekeeper-assess fi @@ -78,13 +78,13 @@ if [ "$LAST_EXIT_CODE" -ne 0 ]; then exit $LAST_EXIT_CODE fi -mv Chia-darwin-arm64 ../../../build_scripts/dist/ +mv Flax-darwin-arm64 ../../../build_scripts/dist/ cd ../../../build_scripts || exit -DMG_NAME="Chia-$CHIA_INSTALLER_VERSION-arm64.dmg" +DMG_NAME="Flax-$FLAX_INSTALLER_VERSION-arm64.dmg" echo "Create $DMG_NAME" mkdir final_installer -NODE_PATH=./npm_macos_m1/node_modules node build_dmg.js dist/Chia-darwin-arm64/Chia.app $CHIA_INSTALLER_VERSION-arm64 +NODE_PATH=./npm_macos_m1/node_modules node build_dmg.js dist/Flax-darwin-arm64/Flax.app $FLAX_INSTALLER_VERSION-arm64 LAST_EXIT_CODE=$? if [ "$LAST_EXIT_CODE" -ne 0 ]; then echo >&2 "electron-installer-dmg failed!" @@ -96,7 +96,7 @@ ls -lh final_installer 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 @@ -107,7 +107,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". @@ -115,7 +115,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 34d82643a..60cdc7d1d 100644 --- a/build_scripts/build_windows.ps1 +++ b/build_scripts/build_windows.ps1 @@ -6,33 +6,33 @@ mkdir build_scripts\win_build git status -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 "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\packages\gui\" -Recurse +Copy-Item "dist\daemon" -Destination "..\flax-blockchain-gui\packages\gui\" -Recurse Write-Output " ---" Write-Output "Setup npm packager" Write-Output " ---" Set-Location -Path ".\npm_windows" -PassThru -npm ci +npm install $Env:Path = $(npm bin) + ";" + $Env:Path Set-Location -Path "..\" -PassThru -Set-Location -Path "..\chia-blockchain-gui" -PassThru +Set-Location -Path "..\flax-blockchain-gui" -PassThru # We need the code sign cert in the gui subdirectory so we can actually sign the UI package If ($env:HAS_SECRET) { Copy-Item "win_code_sign_cert.p12" -Destination "packages\gui\" @@ -46,7 +46,7 @@ Write-Output " ---" $Env:NODE_OPTIONS = "--max-old-space-size=3000" lerna clean -y -npm ci +npm install # Audit fix does not currently work with Lerna. See https://github.com/lerna/lerna/issues/1663 # npm audit fix @@ -64,13 +64,13 @@ If ($LastExitCode -gt 0){ Set-Location -Path "packages\gui" -PassThru 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" @@ -78,14 +78,14 @@ Write-Output " ---" Write-Output "fix version in package.json" choco install jq cp package.json package.json.orig -jq --arg VER "$env:CHIA_INSTALLER_VERSION" '.version=$VER' package.json > temp.json +jq --arg VER "$env:FLAX_INSTALLER_VERSION" '.version=$VER' package.json > temp.json rm package.json mv temp.json package.json Write-Output " ---" 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 " ---" @@ -99,8 +99,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" } @@ -110,8 +110,8 @@ git status Write-Output " ---" Write-Output "Moving final installers to expected location" Write-Output " ---" -Copy-Item ".\Chia-win32-x64" -Destination "$env:GITHUB_WORKSPACE\chia-blockchain-gui\" -Recurse -Copy-Item ".\release-builds" -Destination "$env:GITHUB_WORKSPACE\chia-blockchain-gui\" -Recurse +Copy-Item ".\Flax-win32-x64" -Destination "$env:GITHUB_WORKSPACE\flax-blockchain-gui\" -Recurse +Copy-Item ".\release-builds" -Destination "$env:GITHUB_WORKSPACE\flax-blockchain-gui\" -Recurse Write-Output " ---" Write-Output "Windows Installer complete" diff --git a/build_scripts/clean-runner.sh b/build_scripts/clean-runner.sh index 6aba280b1..b1a874a58 100644 --- a/build_scripts/clean-runner.sh +++ b/build_scripts/clean-runner.sh @@ -7,15 +7,15 @@ PWD=$(pwd) rm -rf ../venv || true rm -rf venv || true -rm -rf chia_blockchain.egg-info || true +rm -rf flax_blockchain.egg-info || true rm -rf build_scripts/final_installer || true rm -rf build_scripts/dist || true rm -rf build_scripts/pyinstaller || true -rm -rf chia-blockchain-gui/build || true -rm -rf chia-blockchain-gui/daemon || true -rm -rf chia-blockchain-gui/node_modules || true -rm chia-blockchain-gui/temp.json || true -( cd "$PWD/chia-blockchain-gui" && git checkout HEAD -- package-lock.json ) || true +rm -rf flax-blockchain-gui/build || true +rm -rf flax-blockchain-gui/daemon || true +rm -rf flax-blockchain-gui/node_modules || true +rm flax-blockchain-gui/temp.json || true +( cd "$PWD/flax-blockchain-gui" && git checkout HEAD -- package-lock.json ) || true cd "$PWD" || true # Clean up old globally installed node_modules that might conflict with the current build diff --git a/build_scripts/deb-options.json b/build_scripts/deb-options.json index da5ef86f0..7313fe62d 100644 --- a/build_scripts/deb-options.json +++ b/build_scripts/deb-options.json @@ -1,7 +1,7 @@ { "dest": "final_installer/", - "bin": "chia-blockchain", - "name": "chia-blockchain", + "bin": "flax-blockchain", + "name": "flax-blockchain", "scripts": { "postinst": "assets/deb/postinst.sh", "prerm": "assets/deb/prerm.sh" diff --git a/chia-blockchain-gui b/chia-blockchain-gui deleted file mode 160000 index f62c216cc..000000000 --- a/chia-blockchain-gui +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f62c216cce6b89ef23a1b2b0a2dd6fc2a439649a diff --git a/chia/cmds/plotnft.py b/chia/cmds/plotnft.py deleted file mode 100644 index 1433f2c94..000000000 --- a/chia/cmds/plotnft.py +++ /dev/null @@ -1,223 +0,0 @@ -from decimal import Decimal -from typing import Optional - -import click - - -MAX_CMDLINE_FEE = Decimal(0.5) - - -def validate_fee(ctx, param, value): - try: - fee = Decimal(value) - except ValueError: - raise click.BadParameter("Fee must be decimal dotted value in XCH (e.g. 0.00005)") - if fee < 0 or fee > MAX_CMDLINE_FEE: - raise click.BadParameter(f"Fee must be in the range 0 to {MAX_CMDLINE_FEE}") - return value - - -@click.group("plotnft", short_help="Manage your plot NFTs") -def plotnft_cmd() -> None: - pass - - -@plotnft_cmd.command("show", short_help="Show plotnft information") -@click.option( - "-wp", - "--wallet-rpc-port", - help="Set the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml", - type=int, - default=None, -) -@click.option("-i", "--id", help="ID of the wallet to use", type=int, default=None, show_default=True, required=False) -@click.option("-f", "--fingerprint", help="Set the fingerprint to specify which wallet to use", type=int) -def show_cmd(wallet_rpc_port: Optional[int], fingerprint: int, id: int) -> None: - import asyncio - from .wallet_funcs import execute_with_wallet - from .plotnft_funcs import show - - asyncio.run(execute_with_wallet(wallet_rpc_port, fingerprint, {"id": id}, show)) - - -@plotnft_cmd.command( - "get_login_link", short_help="Create a login link for a pool. To get the launcher id, use plotnft show." -) -@click.option("-l", "--launcher_id", help="Launcher ID of the plotnft", type=str, required=True) -def get_login_link_cmd(launcher_id: str) -> None: - import asyncio - from .plotnft_funcs import get_login_link - - asyncio.run(get_login_link(launcher_id)) - - -@plotnft_cmd.command("create", short_help="Create a plot NFT") -@click.option("-y", "--yes", help="No prompts", is_flag=True) -@click.option("-f", "--fingerprint", help="Set the fingerprint to specify which wallet to use", type=int) -@click.option("-u", "--pool_url", help="HTTPS host:port of the pool to join", type=str, required=False) -@click.option("-s", "--state", help="Initial state of Plot NFT: local or pool", type=str, required=True) -@click.option( - "-m", - "--fee", - help="Set the fees per transaction, in XCH. Fee is used TWICE: once to create the singleton, once for init.", - type=str, - default="0", - show_default=True, - required=True, - callback=validate_fee, -) -@click.option( - "-wp", - "--wallet-rpc-port", - help="Set the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml", - type=int, - default=None, -) -def create_cmd( - wallet_rpc_port: Optional[int], - fingerprint: int, - pool_url: str, - state: str, - fee: int, - yes: bool, -) -> None: - import asyncio - from .wallet_funcs import execute_with_wallet - from .plotnft_funcs import create - - if pool_url is not None and state.lower() == "local": - print(f" pool_url argument [{pool_url}] is not allowed when creating in 'local' state") - return - if pool_url in [None, ""] and state.lower() == "pool": - print(" pool_url argument (-u) is required for pool starting state") - return - valid_initial_states = {"pool": "FARMING_TO_POOL", "local": "SELF_POOLING"} - extra_params = { - "pool_url": pool_url, - "state": valid_initial_states[state], - "fee": fee, - "yes": yes, - } - asyncio.run(execute_with_wallet(wallet_rpc_port, fingerprint, extra_params, create)) - - -@plotnft_cmd.command("join", short_help="Join a plot NFT to a Pool") -@click.option("-y", "--yes", help="No prompts", is_flag=True) -@click.option("-i", "--id", help="ID of the wallet to use", type=int, default=None, show_default=True, required=True) -@click.option("-f", "--fingerprint", help="Set the fingerprint to specify which wallet to use", type=int) -@click.option("-u", "--pool_url", help="HTTPS host:port of the pool to join", type=str, required=True) -@click.option( - "-m", - "--fee", - help="Set the fees per transaction, in XCH. Fee is used TWICE: once to leave pool, once to join.", - type=str, - default="0", - show_default=True, - required=True, - callback=validate_fee, -) -@click.option( - "-wp", - "--wallet-rpc-port", - help="Set the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml", - type=int, - default=None, -) -def join_cmd(wallet_rpc_port: Optional[int], fingerprint: int, id: int, fee: int, pool_url: str, yes: bool) -> None: - import asyncio - from .wallet_funcs import execute_with_wallet - from .plotnft_funcs import join_pool - - extra_params = {"pool_url": pool_url, "id": id, "fee": fee, "yes": yes} - asyncio.run(execute_with_wallet(wallet_rpc_port, fingerprint, extra_params, join_pool)) - - -@plotnft_cmd.command("leave", short_help="Leave a pool and return to self-farming") -@click.option("-y", "--yes", help="No prompts", is_flag=True) -@click.option("-i", "--id", help="ID of the wallet to use", type=int, default=None, show_default=True, required=True) -@click.option("-f", "--fingerprint", help="Set the fingerprint to specify which wallet to use", type=int) -@click.option( - "-m", - "--fee", - help="Set the fees per transaction, in XCH. Fee is charged TWICE.", - type=str, - default="0", - show_default=True, - required=True, - callback=validate_fee, -) -@click.option( - "-wp", - "--wallet-rpc-port", - help="Set the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml", - type=int, - default=None, -) -def self_pool_cmd(wallet_rpc_port: Optional[int], fingerprint: int, id: int, fee: int, yes: bool) -> None: - import asyncio - from .wallet_funcs import execute_with_wallet - from .plotnft_funcs import self_pool - - extra_params = {"id": id, "fee": fee, "yes": yes} - asyncio.run(execute_with_wallet(wallet_rpc_port, fingerprint, extra_params, self_pool)) - - -@plotnft_cmd.command("inspect", short_help="Get Detailed plotnft information as JSON") -@click.option("-i", "--id", help="ID of the wallet to use", type=int, default=None, show_default=True, required=True) -@click.option("-f", "--fingerprint", help="Set the fingerprint to specify which wallet to use", type=int) -@click.option( - "-wp", - "--wallet-rpc-port", - help="Set the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml", - type=int, - default=None, -) -def inspect(wallet_rpc_port: Optional[int], fingerprint: int, id: int) -> None: - import asyncio - from .wallet_funcs import execute_with_wallet - from .plotnft_funcs import inspect_cmd - - extra_params = {"id": id} - asyncio.run(execute_with_wallet(wallet_rpc_port, fingerprint, extra_params, inspect_cmd)) - - -@plotnft_cmd.command("claim", short_help="Claim rewards from a plot NFT") -@click.option("-i", "--id", help="ID of the wallet to use", type=int, default=None, show_default=True, required=True) -@click.option("-f", "--fingerprint", help="Set the fingerprint to specify which wallet to use", type=int) -@click.option( - "-m", - "--fee", - help="Set the fees per transaction, in XCH.", - type=str, - default="0", - show_default=True, - required=True, - callback=validate_fee, -) -@click.option( - "-wp", - "--wallet-rpc-port", - help="Set the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml", - type=int, - default=None, -) -def claim(wallet_rpc_port: Optional[int], fingerprint: int, id: int, fee: int) -> None: - import asyncio - from .wallet_funcs import execute_with_wallet - from .plotnft_funcs import claim_cmd - - extra_params = {"id": id, "fee": fee} - asyncio.run(execute_with_wallet(wallet_rpc_port, fingerprint, extra_params, claim_cmd)) - - -@plotnft_cmd.command( - "change_payout_instructions", - short_help="Change the payout instructions for a pool. To get the launcher id, use plotnft show.", -) -@click.option("-l", "--launcher_id", help="Launcher ID of the plotnft", type=str, required=True) -@click.option("-a", "--address", help="New address for payout instructions", type=str, required=True) -def change_payout_instructions_cmd(launcher_id: str, address: str) -> None: - import asyncio - from .plotnft_funcs import change_payout_instructions - - asyncio.run(change_payout_instructions(launcher_id, address)) 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 699804448..000000000 --- a/chia/util/default_root.py +++ /dev/null @@ -1,9 +0,0 @@ -import os -from pathlib import Path - -DEFAULT_ROOT_PATH = Path(os.path.expanduser(os.getenv("CHIA_ROOT", "~/.chia/mainnet"))).resolve() -STANDALONE_ROOT_PATH = Path( - os.path.expanduser(os.getenv("CHIA_STANDALONE_WALLET_ROOT", "~/.chia/standalone_wallet")) -).resolve() - -DEFAULT_KEYS_ROOT_PATH = Path(os.path.expanduser(os.getenv("CHIA_KEYS_ROOT", "~/.chia_keys"))).resolve() diff --git a/chia/util/service_groups.py b/chia/util/service_groups.py deleted file mode 100644 index 7ed895be6..000000000 --- a/chia/util/service_groups.py +++ /dev/null @@ -1,33 +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".split(), - "introducer": "chia_introducer".split(), - "simulator": "chia_full_node_simulator".split(), - "crawler": "chia_crawler".split(), - "seeder": "chia_crawler chia_seeder".split(), - "seeder-only": "chia_seeder".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/wallet/cat_wallet/cat_constants.py b/chia/wallet/cat_wallet/cat_constants.py deleted file mode 100644 index 25a1c370c..000000000 --- a/chia/wallet/cat_wallet/cat_constants.py +++ /dev/null @@ -1,30 +0,0 @@ -SPACEBUCKS = { - "asset_id": "78ad32a8c9ea70f27d73e9306fc467bab2a6b15b30289791e37ab6e8612212b1", - "name": "Spacebucks", - "symbol": "SBX", -} - -MARMOT = { - "asset_id": "8ebf855de6eb146db5602f0456d2f0cbe750d57f821b6f91a8592ee9f1d4cf31", - "name": "Marmot", - "symbol": "MRMT", -} - -STABLY_USDS = { - "asset_id": "6d95dae356e32a71db5ddcb42224754a02524c615c5fc35f568c2af04774e589", - "name": "Stably USD", - "symbol": "USDS", -} - -CHIA_HOLIDAY_TOKEN = { - "asset_id": "509deafe3cd8bbfbb9ccce1d930e3d7b57b40c964fa33379b18d628175eb7a8f", - "name": "Chia Holiday 2021 Token", - "symbol": "CH21", -} - -DEFAULT_CATS = { - SPACEBUCKS["asset_id"]: SPACEBUCKS, - MARMOT["asset_id"]: MARMOT, - STABLY_USDS["asset_id"]: STABLY_USDS, - CHIA_HOLIDAY_TOKEN["asset_id"]: CHIA_HOLIDAY_TOKEN, -} diff --git a/chia/wallet/util/json_clvm_utils.py b/chia/wallet/util/json_clvm_utils.py deleted file mode 100644 index b3eff0c8e..000000000 --- a/chia/wallet/util/json_clvm_utils.py +++ /dev/null @@ -1,17 +0,0 @@ -from typing import Any - -from chia.types.blockchain_format.program import Program - - -def json_to_chialisp(json_data: Any) -> Any: - list_for_chialisp = [] - if isinstance(json_data, list): - for value in json_data: - list_for_chialisp.append(json_to_chialisp(value)) - else: - if isinstance(json_data, dict): - for key, value in json_data: - list_for_chialisp.append((key, json_to_chialisp(value))) - else: - list_for_chialisp = json_data - return Program.to(list_for_chialisp) diff --git a/flax-blockchain-gui b/flax-blockchain-gui new file mode 160000 index 000000000..d82a115a3 --- /dev/null +++ b/flax-blockchain-gui @@ -0,0 +1 @@ +Subproject commit d82a115a3b2d0bfbfb3b609d1c0f8a60b09d244b 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/clvm/__init__.py b/flax/clvm/__init__.py similarity index 100% rename from chia/clvm/__init__.py rename to flax/clvm/__init__.py diff --git a/chia/clvm/singleton.py b/flax/clvm/singleton.py similarity index 76% rename from chia/clvm/singleton.py rename to flax/clvm/singleton.py index 21b347784..33e5c4ee5 100644 --- a/chia/clvm/singleton.py +++ b/flax/clvm/singleton.py @@ -1,4 +1,4 @@ -from chia.wallet.puzzles.load_clvm import load_clvm +from flax.wallet.puzzles.load_clvm import load_clvm P2_SINGLETON_MOD = load_clvm("p2_singleton.clvm") SINGLETON_TOP_LAYER_MOD = load_clvm("singleton_top_layer.clvm") diff --git a/chia/clvm/spend_sim.py b/flax/clvm/spend_sim.py similarity index 92% rename from chia/clvm/spend_sim.py rename to flax/clvm/spend_sim.py index 784b18000..9fca0b9d7 100644 --- a/chia/clvm/spend_sim.py +++ b/flax/clvm/spend_sim.py @@ -4,36 +4,36 @@ from dataclasses import dataclass from typing import Optional, List, Dict, Tuple, Any -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.program import Program, SerializedProgram -from chia.util.ints import uint64, uint32 -from chia.util.hash import std_hash -from chia.util.errors import Err, ValidationError -from chia.util.db_wrapper import DBWrapper2 -from chia.util.streamable import Streamable, streamable -from chia.types.coin_record import CoinRecord -from chia.types.spend_bundle import SpendBundle -from chia.types.generator_types import BlockGenerator -from chia.types.mempool_inclusion_status import MempoolInclusionStatus -from chia.types.coin_spend import CoinSpend -from chia.full_node.bundle_tools import simple_solution_generator -from chia.full_node.mempool_manager import MempoolManager -from chia.full_node.coin_store import CoinStore -from chia.full_node.mempool_check_conditions import get_puzzle_and_solution_for_coin -from chia.consensus.constants import ConsensusConstants -from chia.consensus.default_constants import DEFAULT_CONSTANTS -from chia.consensus.coinbase import create_pool_coin, create_farmer_coin -from chia.consensus.block_rewards import calculate_pool_reward, calculate_base_farmer_reward -from chia.consensus.cost_calculator import NPCResult +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.program import Program, SerializedProgram +from flax.util.ints import uint64, uint32 +from flax.util.hash import std_hash +from flax.util.errors import Err, ValidationError +from flax.util.db_wrapper import DBWrapper2 +from flax.util.streamable import Streamable, streamable +from flax.types.coin_record import CoinRecord +from flax.types.spend_bundle import SpendBundle +from flax.types.generator_types import BlockGenerator +from flax.types.mempool_inclusion_status import MempoolInclusionStatus +from flax.types.coin_spend import CoinSpend +from flax.full_node.bundle_tools import simple_solution_generator +from flax.full_node.mempool_manager import MempoolManager +from flax.full_node.coin_store import CoinStore +from flax.full_node.mempool_check_conditions import get_puzzle_and_solution_for_coin +from flax.consensus.constants import ConsensusConstants +from flax.consensus.default_constants import DEFAULT_CONSTANTS +from flax.consensus.coinbase import create_pool_coin, create_farmer_coin +from flax.consensus.block_rewards import calculate_pool_reward, calculate_base_farmer_reward +from flax.consensus.cost_calculator import NPCResult """ -The purpose of this file is to provide a lightweight simulator for the testing of Chialisp smart contracts. +The purpose of this file is to provide a lightweight simulator for the testing of Flaxlisp smart contracts. The Node object uses actual MempoolManager, Mempool and CoinStore objects, while substituting FullBlock and BlockRecord objects for trimmed down versions. -There is also a provided NodeClient object which implements many of the methods from chia.rpc.full_node_rpc_client +There is also a provided NodeClient object which implements many of the methods from flax.rpc.full_node_rpc_client and is designed so that you could test with it and then swap in a real rpc client that uses the same code you tested. """ 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/cmds_util.py b/flax/cmds/cmds_util.py similarity index 57% rename from chia/cmds/cmds_util.py rename to flax/cmds/cmds_util.py index f2c764bfc..2319dfa4f 100644 --- a/chia/cmds/cmds_util.py +++ b/flax/cmds/cmds_util.py @@ -1,6 +1,6 @@ -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.mempool_submission_status import MempoolSubmissionStatus -from chia.wallet.transaction_record import TransactionRecord +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.mempool_submission_status import MempoolSubmissionStatus +from flax.wallet.transaction_record import TransactionRecord def transaction_submitted_msg(tx: TransactionRecord) -> str: @@ -9,4 +9,4 @@ def transaction_submitted_msg(tx: TransactionRecord) -> str: def transaction_status_msg(fingerprint: int, tx_id: bytes32) -> str: - return f"Run 'chia wallet get_transaction -f {fingerprint} -tx 0x{tx_id}' to get status" + return f"Run 'flax wallet get_transaction -f {fingerprint} -tx 0x{tx_id}' to get status" diff --git a/chia/cmds/configure.py b/flax/cmds/configure.py similarity index 95% rename from chia/cmds/configure.py rename to flax/cmds/configure.py index b42e0a8aa..bc60b157c 100644 --- a/chia/cmds/configure.py +++ b/flax/cmds/configure.py @@ -3,7 +3,7 @@ import click -from chia.util.config import lock_and_load_config, save_config, str2bool +from flax.util.config import lock_and_load_config, save_config, str2bool def configure( @@ -95,10 +95,10 @@ def configure( if testnet: if testnet == "true" or testnet == "t": print("Setting Testnet") - testnet_port = "58444" - testnet_introducer = "introducer-testnet10.chia.net" - testnet_dns_introducer = "dns-introducer-testnet10.chia.net" - bootstrap_peers = ["testnet10-node.chia.net"] + testnet_port = "56888" + testnet_introducer = "introducer-testnet10.flaxnetwork.org" + testnet_dns_introducer = "dns-introducer-testnet10.flaxnetwork.org" + bootstrap_peers = ["testnet10-node.flaxnetwork.org"] testnet = "testnet10" config["full_node"]["port"] = int(testnet_port) config["full_node"]["introducer_peer"]["port"] = int(testnet_port) @@ -132,10 +132,10 @@ def configure( elif testnet == "false" or testnet == "f": print("Setting Mainnet") - mainnet_port = "8444" - mainnet_introducer = "introducer.chia.net" - mainnet_dns_introducer = "dns-introducer.chia.net" - bootstrap_peers = ["node.chia.net"] + mainnet_port = "6888" + mainnet_introducer = "introducer.flaxnetwork.org" + mainnet_dns_introducer = "dns-introducer.flaxnetwork.org" + bootstrap_peers = ["node.flaxnetwork.org"] net = "mainnet" config["full_node"]["port"] = int(mainnet_port) config["full_node"]["introducer_peer"]["port"] = int(mainnet_port) @@ -190,7 +190,7 @@ def configure( change_made = True 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) diff --git a/chia/cmds/db.py b/flax/cmds/db.py similarity index 94% rename from chia/cmds/db.py rename to flax/cmds/db.py index f907d394e..a9f39ede9 100644 --- a/chia/cmds/db.py +++ b/flax/cmds/db.py @@ -1,7 +1,7 @@ from pathlib import Path import click -from chia.cmds.db_upgrade_func import db_upgrade_func -from chia.cmds.db_validate_func import db_validate_func +from flax.cmds.db_upgrade_func import db_upgrade_func +from flax.cmds.db_validate_func import db_validate_func @click.group("db", short_help="Manage the blockchain database") diff --git a/chia/cmds/db_upgrade_func.py b/flax/cmds/db_upgrade_func.py similarity index 98% rename from chia/cmds/db_upgrade_func.py rename to flax/cmds/db_upgrade_func.py index e12ca79f3..77ec4482a 100644 --- a/chia/cmds/db_upgrade_func.py +++ b/flax/cmds/db_upgrade_func.py @@ -7,10 +7,10 @@ import textwrap import os -from chia.util.config import load_config, lock_and_load_config, save_config -from chia.util.path import mkdir, path_from_root -from chia.util.ints import uint32 -from chia.types.blockchain_format.sized_bytes import bytes32 +from flax.util.config import load_config, lock_and_load_config, save_config +from flax.util.path import mkdir, path_from_root +from flax.util.ints import uint32 +from flax.types.blockchain_format.sized_bytes import bytes32 # if either the input database or output database file is specified, the diff --git a/chia/cmds/db_validate_func.py b/flax/cmds/db_validate_func.py similarity index 96% rename from chia/cmds/db_validate_func.py rename to flax/cmds/db_validate_func.py index d5d3bdb36..75b04a6fb 100644 --- a/chia/cmds/db_validate_func.py +++ b/flax/cmds/db_validate_func.py @@ -1,12 +1,12 @@ from pathlib import Path from typing import Any, Dict, Optional -from chia.consensus.block_record import BlockRecord -from chia.consensus.default_constants import DEFAULT_CONSTANTS -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.full_block import FullBlock -from chia.util.config import load_config -from chia.util.path import path_from_root +from flax.consensus.block_record import BlockRecord +from flax.consensus.default_constants import DEFAULT_CONSTANTS +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.full_block import FullBlock +from flax.util.config import load_config +from flax.util.path import path_from_root def db_validate_func( 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 57862887d..d8db9de9e 100644 --- a/chia/cmds/farm_funcs.py +++ b/flax/cmds/farm_funcs.py @@ -2,17 +2,17 @@ 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.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_bytes -from chia.util.misc import format_minutes -from chia.util.network import is_localhost +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.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_bytes +from flax.util.misc import format_minutes +from flax.util.network import is_localhost SECONDS_PER_BLOCK = (24 * 3600) / 4608 @@ -212,9 +212,9 @@ async def summary( 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']}") class PlotStats: @@ -273,8 +273,8 @@ def process_harvesters(harvester_peers_in: dict): if amounts is None: if wallet_not_running: - print("For details on farmed rewards and fees you should run 'chia start wallet' and 'chia wallet show'") + print("For details on farmed rewards and fees you should run 'flax start wallet' and 'flax wallet show'") elif wallet_not_ready: - print("For details on farmed rewards and fees you should run 'chia wallet show'") + print("For details on farmed rewards and fees you should run 'flax wallet show'") else: - 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 75% rename from chia/cmds/chia.py rename to flax/cmds/flax.py index 00fe6e6fb..ddd985b91 100644 --- a/chia/cmds/chia.py +++ b/flax/cmds/flax.py @@ -1,30 +1,29 @@ from io import TextIOWrapper 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.passphrase import passphrase_cmd -from chia.cmds.plots import plots_cmd -from chia.cmds.rpc import rpc_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.cmds.plotnft import plotnft_cmd -from chia.cmds.plotters import plotters_cmd -from chia.cmds.db import db_cmd -from chia.util.default_root import DEFAULT_KEYS_ROOT_PATH, DEFAULT_ROOT_PATH -from chia.util.keychain import ( +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.passphrase import passphrase_cmd +from flax.cmds.plots import plots_cmd +from flax.cmds.rpc import rpc_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.cmds.plotters import plotters_cmd +from flax.cmds.db import db_cmd +from flax.util.default_root import DEFAULT_KEYS_ROOT_PATH, DEFAULT_ROOT_PATH +from flax.util.keychain import ( Keychain, KeyringCurrentPassphraseIsInvalid, set_keys_root_path, supports_keyring_passphrase, ) -from chia.util.ssl_check import check_ssl +from flax.util.ssl_check import check_ssl from typing import Optional CONTEXT_SETTINGS = dict(help_option_names=["-h", "--help"]) @@ -47,8 +46,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) @@ -74,7 +73,7 @@ def cli( set_keys_root_path(Path(keys_root_path)) if passphrase_file is not None: - from chia.cmds.passphrase_funcs import cache_passphrase, read_passphrase_from_file + from flax.cmds.passphrase_funcs import cache_passphrase, read_passphrase_from_file from sys import exit try: @@ -96,30 +95,30 @@ def cli( if not supports_keyring_passphrase(): - from chia.cmds.passphrase_funcs import remove_passphrase_options_from_cmd + from flax.cmds.passphrase_funcs import remove_passphrase_options_from_cmd # TODO: Remove once keyring passphrase management is rolled out to all platforms remove_passphrase_options_from_cmd(cli) -@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.option( "--wait-for-unlock", help="If the keyring is passphrase-protected, the daemon will wait for an unlock command before accessing keys", default=False, is_flag=True, - hidden=True, # --wait-for-unlock is only set when launched by chia start + hidden=True, # --wait-for-unlock is only set when launched by flax start ) @click.pass_context def run_daemon_cmd(ctx: click.Context, wait_for_unlock: bool) -> None: import asyncio - from chia.daemon.server import async_run_daemon - from chia.util.keychain import Keychain + from flax.daemon.server import async_run_daemon + from flax.util.keychain import Keychain wait_for_unlock = wait_for_unlock and Keychain.is_keyring_locked() @@ -129,7 +128,6 @@ def run_daemon_cmd(ctx: click.Context, wait_for_unlock: bool) -> None: cli.add_command(keys_cmd) cli.add_command(plots_cmd) cli.add_command(wallet_cmd) -cli.add_command(plotnft_cmd) cli.add_command(configure_cmd) cli.add_command(init_cmd) cli.add_command(rpc_cmd) diff --git a/chia/cmds/init.py b/flax/cmds/init.py similarity index 69% rename from chia/cmds/init.py rename to flax/cmds/init.py index f0d622b91..dff1ea301 100644 --- a/chia/cmds/init.py +++ b/flax/cmds/init.py @@ -1,5 +1,5 @@ import click -from chia.util.keychain import supports_keyring_passphrase +from flax.util.keychain import supports_keyring_passphrase @click.command("init", short_help="Create or migrate the configuration") @@ -15,7 +15,7 @@ is_flag=True, help="Attempt to fix SSL certificate/key file permissions", ) -@click.option("--testnet", is_flag=True, help="Configure this chia install to connect to the testnet") +@click.option("--testnet", is_flag=True, help="Configure this flax install to connect to the testnet") @click.option("--set-passphrase", "-s", is_flag=True, help="Protect your keyring with a passphrase") @click.option( "--v1-db", @@ -29,16 +29,16 @@ def init_cmd(ctx: click.Context, create_certs: str, fix_ssl_permissions: bool, t \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 - from chia.cmds.passphrase_funcs import initialize_passphrase + from flax.cmds.passphrase_funcs import initialize_passphrase set_passphrase = kwargs.get("set_passphrase") if set_passphrase: @@ -54,14 +54,14 @@ def init_cmd(ctx: click.Context, create_certs: str, fix_ssl_permissions: bool, t if not supports_keyring_passphrase(): - from chia.cmds.passphrase_funcs import remove_passphrase_options_from_cmd + from flax.cmds.passphrase_funcs import remove_passphrase_options_from_cmd # TODO: Remove once keyring passphrase management is rolled out to all platforms remove_passphrase_options_from_cmd(init_cmd) 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 86% rename from chia/cmds/init_funcs.py rename to flax/cmds/init_funcs.py index a3bd26b7e..0ddd94d98 100644 --- a/chia/cmds/init_funcs.py +++ b/flax/cmds/init_funcs.py @@ -6,28 +6,28 @@ import yaml -from chia import __version__ -from chia.consensus.coinbase import create_puzzlehash_for_pk -from chia.ssl.create_ssl import ( +from flax import __version__ +from flax.consensus.coinbase import create_puzzlehash_for_pk +from flax.ssl.create_ssl import ( ensure_ssl_dirs, generate_ca_signed_cert, - get_chia_ca_crt_key, + get_flax_ca_crt_key, make_ca_cert, write_ssl_cert_and_key, ) -from chia.util.bech32m import encode_puzzle_hash -from chia.util.config import ( - create_default_chia_config, +from flax.util.bech32m import encode_puzzle_hash +from flax.util.config import ( + create_default_flax_config, initial_config_file, load_config, lock_and_load_config, save_config, unflatten_properties, ) -from chia.util.db_version import set_db_version -from chia.util.keychain import Keychain -from chia.util.path import mkdir, path_from_root -from chia.util.ssl_check import ( +from flax.util.db_version import set_db_version +from flax.util.keychain import Keychain +from flax.util.path import mkdir, path_from_root +from flax.util.ssl_check import ( DEFAULT_PERMISSIONS_CERT_FILE, DEFAULT_PERMISSIONS_KEY_FILE, RESTRICT_MASK_CERT_FILE, @@ -35,14 +35,14 @@ check_and_fix_permissions_for_ssl_file, fix_ssl, ) -from chia.wallet.derive_keys import ( +from flax.wallet.derive_keys import ( master_sk_to_pool_sk, master_sk_to_wallet_sk_intermediate, master_sk_to_wallet_sk_unhardened_intermediate, _derive_path, _derive_path_unhardened, ) -from chia.cmds.configure import configure +from flax.cmds.configure import configure private_node_names: List[str] = ["full_node", "wallet", "farmer", "harvester", "timelord", "crawler", "daemon"] public_node_names: List[str] = ["full_node", "wallet", "farmer", "introducer", "timelord"] @@ -74,14 +74,14 @@ def check_keys(new_root: Path, keychain: Optional[Keychain] = None) -> None: 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 with lock_and_load_config(new_root, "config.yaml") as config: 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 = 50 selected = config["selected_network"] prefix = config["network_overrides"]["config"][selected]["address_prefix"] @@ -108,46 +108,46 @@ def check_keys(new_root: Path, keychain: Optional[Keychain] = None) -> None: all_targets.append( encode_puzzle_hash(create_puzzlehash_for_pk(_derive_path(intermediate_n, [i]).get_g1()), prefix) ) - if all_targets[-1] == config["farmer"].get("xch_target_address") or all_targets[-2] == config[ + if all_targets[-1] == config["farmer"].get("xfx_target_address") or all_targets[-2] == config[ "farmer" - ].get("xch_target_address"): + ].get("xfx_target_address"): stop_searching_for_farmer = True - if all_targets[-1] == config["pool"].get("xch_target_address") or all_targets[-2] == config["pool"].get( - "xch_target_address" + if all_targets[-1] == config["pool"].get("xfx_target_address") or all_targets[-2] == config["pool"].get( + "xfx_target_address" ): stop_searching_for_pool = True # Set the destinations, if necessary updated_target: bool = False - if "xch_target_address" not in config["farmer"]: + if "xfx_target_address" not in config["farmer"]: print( - f"Setting the xch destination for the farmer reward (1/8 plus fees, solo and pooling)" + f"Setting the xfx destination for the farmer reward (1/8 plus fees, solo and pooling)" f" to {all_targets[0]}" ) - config["farmer"]["xch_target_address"] = all_targets[0] + config["farmer"]["xfx_target_address"] = all_targets[0] updated_target = True - elif config["farmer"]["xch_target_address"] not in all_targets: + elif config["farmer"]["xfx_target_address"] not in all_targets: print( f"WARNING: using a farmer address which we might not 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 pool reward (7/8 for solo only) to {all_targets[0]}") - config["pool"]["xch_target_address"] = all_targets[0] + if "xfx_target_address" not in config["pool"]: + print(f"Setting the xfx destination address for pool reward (7/8 for solo only) to {all_targets[0]}") + config["pool"]["xfx_target_address"] = all_targets[0] updated_target = True - elif config["pool"]["xch_target_address"] not in all_targets: + elif config["pool"]["xfx_target_address"] not in all_targets: print( f"WARNING: using a pool address which we might not 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]}" ) if updated_target: print( - f"To change the XCH destination addresses, edit the `xch_target_address` entries in" + f"To change the XFX destination addresses, edit the `xfx_target_address` entries in" f" {(new_root / 'config' / 'config.yaml').absolute()}." ) @@ -234,10 +234,10 @@ def create_all_ssl( 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" - write_ssl_cert_and_key(chia_ca_crt_path, chia_ca_crt, chia_ca_key_path, 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" + write_ssl_cert_and_key(flax_ca_crt_path, flax_ca_crt, flax_ca_key_path, flax_ca_key) # If Private CA crt/key are passed-in, write them out if private_ca_crt_and_key is not None: @@ -263,11 +263,11 @@ def create_all_ssl( ssl_dir, ca_crt, ca_key, prefix="private", nodes=private_node_names, node_certs_and_keys=node_certs_and_keys ) - chia_ca_crt, chia_ca_key = get_chia_ca_crt_key() + flax_ca_crt, flax_ca_key = get_flax_ca_crt_key() generate_ssl_for_nodes( ssl_dir, - chia_ca_crt, - chia_ca_key, + flax_ca_crt, + flax_ca_key, prefix="public", nodes=public_node_names, overwrite=False, @@ -338,7 +338,7 @@ def init( print(f"** {root_path} does not exist. Executing core init **") # sanity check here to prevent infinite recursion if ( - chia_init( + flax_init( root_path, fix_ssl_permissions=fix_ssl_permissions, testnet=testnet, @@ -352,10 +352,10 @@ def init( print(f"** {root_path} was not created. Exiting **") return -1 else: - return chia_init(root_path, fix_ssl_permissions=fix_ssl_permissions, testnet=testnet, v1_db=v1_db) + return flax_init(root_path, fix_ssl_permissions=fix_ssl_permissions, testnet=testnet, v1_db=v1_db) -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("+") @@ -403,18 +403,18 @@ 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( +def flax_init( root_path: Path, *, should_check_keys: bool = True, @@ -430,13 +430,13 @@ def chia_init( protected Keychain. When launching the daemon from the GUI, we want the GUI to handle unlocking the keychain. """ - chia_root = os.environ.get("CHIA_ROOT", None) - if chia_root is not None: - print(f"CHIA_ROOT is set to {chia_root}") + flax_root = os.environ.get("FLAX_ROOT", None) + if flax_root is not None: + print(f"FLAX_ROOT is set to {flax_root}") - 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. if testnet: configure( @@ -463,7 +463,7 @@ def chia_init( print(f"{root_path} already exists, no migration action taken") return -1 - create_default_chia_config(root_path) + create_default_flax_config(root_path) if testnet: configure( root_path, @@ -515,6 +515,6 @@ def chia_init( set_db_version(connection, 2) 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 96% rename from chia/cmds/keys.py rename to flax/cmds/keys.py index d7d109468..5e1fdb1e5 100644 --- a/chia/cmds/keys.py +++ b/flax/cmds/keys.py @@ -11,7 +11,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") @@ -32,7 +32,7 @@ def generate_cmd(ctx: click.Context): "--non-observer-derivation", "-d", help=( - "Show the first wallet address using non-observer derivation. Older Chia versions use " + "Show the first wallet address using non-observer derivation. Older Flax versions use " "non-observer derivation when generating wallet addresses." ), default=False, @@ -91,7 +91,7 @@ def delete_cmd(ctx: click.Context, fingerprint: int): @keys_cmd.command("delete_all", short_help="Delete all private keys in keychain") def delete_all_cmd(): - from chia.util.keychain import Keychain + from flax.util.keychain import Keychain Keychain().delete_all_keys() @@ -147,7 +147,7 @@ def verify_cmd(message: str, public_key: str, signature: str): verify(message, public_key, signature) -@keys_cmd.command("migrate", short_help="Attempt to migrate keys to the Chia keyring") +@keys_cmd.command("migrate", short_help="Attempt to migrate keys to the Flax keyring") @click.pass_context def migrate_cmd(ctx: click.Context): from .keys_funcs import migrate_keys @@ -215,7 +215,7 @@ def derive_cmd(ctx: click.Context, fingerprint: Optional[int], filename: Optiona "non-observer derivation should be used at that index. Example HD path: m/12381n/8444n/2/", type=str, ) -@click.option("--prefix", "-x", help="Address prefix (xch for mainnet, txch for testnet)", default=None, type=str) +@click.option("--prefix", "-x", help="Address prefix (xfx for mainnet, txfx for testnet)", default=None, type=str) @click.pass_context def search_cmd( ctx: click.Context, @@ -259,7 +259,7 @@ def search_cmd( "--index", "-i", help="Index of the first wallet address to derive. Index 0 is the first wallet address.", default=0 ) @click.option("--count", "-n", help="Number of wallet addresses to derive, starting at index.", default=1) -@click.option("--prefix", "-x", help="Address prefix (xch for mainnet, txch for testnet)", default=None, type=str) +@click.option("--prefix", "-x", help="Address prefix (xfx for mainnet, txfx for testnet)", default=None, type=str) @click.option( "--non-observer-derivation", "-d", diff --git a/chia/cmds/keys_funcs.py b/flax/cmds/keys_funcs.py similarity index 97% rename from chia/cmds/keys_funcs.py rename to flax/cmds/keys_funcs.py index 0e59f6f6e..ea18e20f7 100644 --- a/chia/cmds/keys_funcs.py +++ b/flax/cmds/keys_funcs.py @@ -6,13 +6,13 @@ from pathlib import Path from typing import Any, Dict, List, Optional, Tuple, Union -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, mnemonic_to_seed, unlocks_keyring -from chia.wallet.derive_keys import ( +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, mnemonic_to_seed, unlocks_keyring +from flax.wallet.derive_keys import ( master_sk_to_farmer_sk, master_sk_to_pool_sk, master_sk_to_wallet_sk, @@ -28,7 +28,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 @@ -126,7 +126,7 @@ def derive_sk_from_hd_path(master_sk: PrivateKey, hd_path_root: str) -> Tuple[Pr and returns the derived key and the HD path that was used to derive it. """ - from chia.wallet.derive_keys import _derive_path, _derive_path_unhardened + from flax.wallet.derive_keys import _derive_path, _derive_path_unhardened class DerivationType(Enum): NONOBSERVER = 0 @@ -184,8 +184,8 @@ def verify(message: str, public_key: str, signature: str): def migrate_keys(): - from chia.util.keyring_wrapper import KeyringWrapper - from chia.util.misc import prompt_yes_no + from flax.util.keyring_wrapper import KeyringWrapper + from flax.util.misc import prompt_yes_no # Check if the keyring needs a full migration (i.e. if it's using the old keyring) if Keychain.needs_migration(): @@ -252,7 +252,7 @@ def _search_derived( the provided search terms. """ - from chia.wallet.derive_keys import _derive_path, _derive_path_unhardened + from flax.wallet.derive_keys import _derive_path, _derive_path_unhardened class DerivedSearchResultType(Enum): PUBLIC_KEY = "public key" @@ -553,7 +553,7 @@ def derive_child_key( Derive child keys from the provided master key. """ - from chia.wallet.derive_keys import _derive_path, _derive_path_unhardened + from flax.wallet.derive_keys import _derive_path, _derive_path_unhardened derivation_root_sk: Optional[PrivateKey] = None hd_path_root: Optional[str] = None 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 91% rename from chia/cmds/netspace_funcs.py rename to flax/cmds/netspace_funcs.py index e18a47fa0..77ac6644c 100644 --- a/chia/cmds/netspace_funcs.py +++ b/flax/cmds/netspace_funcs.py @@ -2,12 +2,12 @@ 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 chia.util.misc import format_bytes +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 +from flax.util.misc import format_bytes async def netstorge_async(rpc_port: Optional[int], delta_block_height: str, start: str) -> None: diff --git a/chia/cmds/passphrase.py b/flax/cmds/passphrase.py similarity index 100% rename from chia/cmds/passphrase.py rename to flax/cmds/passphrase.py diff --git a/chia/cmds/passphrase_funcs.py b/flax/cmds/passphrase_funcs.py similarity index 95% rename from chia/cmds/passphrase_funcs.py rename to flax/cmds/passphrase_funcs.py index f266f4de3..3743b3538 100644 --- a/chia/cmds/passphrase_funcs.py +++ b/flax/cmds/passphrase_funcs.py @@ -3,11 +3,11 @@ import os import sys -from chia.daemon.client import acquire_connection_to_daemon -from chia.util.keychain import Keychain, obtain_current_passphrase, supports_os_passphrase_storage -from chia.util.keyring_wrapper import DEFAULT_PASSPHRASE_IF_NO_MASTER_PASSPHRASE -from chia.util.misc import prompt_yes_no -from chia.util.ws_message import WsRpcMessage +from flax.daemon.client import acquire_connection_to_daemon +from flax.util.keychain import Keychain, obtain_current_passphrase, supports_os_passphrase_storage +from flax.util.keyring_wrapper import DEFAULT_PASSPHRASE_IF_NO_MASTER_PASSPHRASE +from flax.util.misc import prompt_yes_no +from flax.util.ws_message import WsRpcMessage from getpass import getpass from io import TextIOWrapper from pathlib import Path @@ -82,7 +82,7 @@ def prompt_to_save_passphrase() -> bool: print( "\n" "Your passphrase can be stored in your system's secure credential store. " - "Other Chia processes will be able to access your keys without prompting for your passphrase." + "Other Flax processes will be able to access your keys without prompting for your passphrase." ) if warning is not None: colorama.init() @@ -119,7 +119,7 @@ def prompt_for_new_passphrase() -> Tuple[str, bool]: def read_passphrase_from_file(passphrase_file: TextIOWrapper) -> str: - passphrase = passphrase_file.read().rstrip(os.environ.get("CHIA_PASSPHRASE_STRIP_TRAILING_CHARS", "\r\n")) + passphrase = passphrase_file.read().rstrip(os.environ.get("FLAX_PASSPHRASE_STRIP_TRAILING_CHARS", "\r\n")) passphrase_file.close() return passphrase @@ -127,7 +127,7 @@ def read_passphrase_from_file(passphrase_file: TextIOWrapper) -> str: def initialize_passphrase() -> None: if Keychain.has_master_passphrase(): print("Keyring is already protected by a passphrase") - print("\nUse 'chia passphrase set' or 'chia passphrase remove' to update or remove your passphrase") + print("\nUse 'flax passphrase set' or 'flax passphrase remove' to update or remove your passphrase") sys.exit(1) # We'll rely on Keyring initialization to leverage the cached passphrase for diff --git a/flax/cmds/plotnft.py b/flax/cmds/plotnft.py new file mode 100644 index 000000000..b013d4d94 --- /dev/null +++ b/flax/cmds/plotnft.py @@ -0,0 +1,19 @@ +from decimal import Decimal +from typing import Optional + +import click + + +MAX_CMDLINE_FEE = Decimal(0.5) + + +def validate_fee(ctx, param, value): + try: + fee = Decimal(value) + except ValueError: + raise click.BadParameter("Fee must be decimal dotted value in XFX (e.g. 0.00005)") + if fee < 0 or fee > MAX_CMDLINE_FEE: + raise click.BadParameter(f"Fee must be in the range 0 to {MAX_CMDLINE_FEE}") + return value + + diff --git a/chia/cmds/plotnft_funcs.py b/flax/cmds/plotnft_funcs.py similarity index 92% rename from chia/cmds/plotnft_funcs.py rename to flax/cmds/plotnft_funcs.py index 809b993c8..00a3d5551 100644 --- a/chia/cmds/plotnft_funcs.py +++ b/flax/cmds/plotnft_funcs.py @@ -10,24 +10,24 @@ from pprint import pprint from typing import Any, List, Dict, Optional, Callable -from chia.cmds.units import units -from chia.cmds.wallet_funcs import print_balance, wallet_coin_unit -from chia.pools.pool_config import load_pool_config, PoolWalletConfig, update_pool_config -from chia.pools.pool_wallet_info import PoolWalletInfo, PoolSingletonState -from chia.protocols.pool_protocol import POOL_PROTOCOL_VERSION -from chia.rpc.farmer_rpc_client import FarmerRpcClient -from chia.rpc.wallet_rpc_client import WalletRpcClient -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.server.server import ssl_context_for_root -from chia.ssl.create_ssl import get_mozilla_ca_crt -from chia.util.bech32m import encode_puzzle_hash, decode_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, uint32, uint64 -from chia.cmds.cmds_util import transaction_submitted_msg, transaction_status_msg -from chia.wallet.transaction_record import TransactionRecord -from chia.wallet.util.wallet_types import WalletType +from flax.cmds.units import units +from flax.cmds.wallet_funcs import print_balance, wallet_coin_unit +from flax.pools.pool_config import load_pool_config, PoolWalletConfig, update_pool_config +from flax.pools.pool_wallet_info import PoolWalletInfo, PoolSingletonState +from flax.protocols.pool_protocol import POOL_PROTOCOL_VERSION +from flax.rpc.farmer_rpc_client import FarmerRpcClient +from flax.rpc.wallet_rpc_client import WalletRpcClient +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.server.server import ssl_context_for_root +from flax.ssl.create_ssl import get_mozilla_ca_crt +from flax.util.bech32m import encode_puzzle_hash, decode_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, uint32, uint64 +from flax.cmds.cmds_util import transaction_submitted_msg, transaction_status_msg +from flax.wallet.transaction_record import TransactionRecord +from flax.wallet.util.wallet_types import WalletType async def create_pool_args(pool_url: str) -> Dict: @@ -57,7 +57,7 @@ async def create(args: dict, wallet_client: WalletRpcClient, fingerprint: int) - state = args["state"] prompt = not args.get("yes", False) fee = Decimal(args.get("fee", 0)) - fee_mojos = uint64(int(fee * units["chia"])) + fee_mojos = uint64(int(fee * units["flax"])) target_puzzle_hash: Optional[bytes32] # Could use initial_pool_state_from_dict to simplify if state == "SELF_POOLING": @@ -104,7 +104,7 @@ async def create(args: dict, wallet_client: WalletRpcClient, fingerprint: int) - print(transaction_status_msg(fingerprint, tx_record.name)) return None except Exception as e: - print(f"Error creating plot NFT: {e}\n Please start both farmer and wallet with: chia start -r farmer") + print(f"Error creating plot NFT: {e}\n Please start both farmer and wallet with: flax start -r farmer") return print("Aborting.") @@ -186,7 +186,7 @@ async def show(args: dict, wallet_client: WalletRpcClient, fingerprint: int) -> if isinstance(e, aiohttp.ClientConnectorError): print( f"Connection error. Check if farmer is running at {farmer_rpc_port}." - f" You can run the farmer by:\n chia start farmer-only" + f" You can run the farmer by:\n flax start farmer-only" ) else: print(f"Exception from 'wallet' {e}") @@ -248,7 +248,7 @@ async def get_login_link(launcher_id_str: str) -> None: if isinstance(e, aiohttp.ClientConnectorError): print( f"Connection error. Check if farmer is running at {farmer_rpc_port}." - f" You can run the farmer by:\n chia start farmer-only" + f" You can run the farmer by:\n flax start farmer-only" ) else: print(f"Exception from 'farmer' {e}") @@ -289,7 +289,7 @@ async def join_pool(args: dict, wallet_client: WalletRpcClient, fingerprint: int enforce_https = config["full_node"]["selected_network"] == "mainnet" pool_url: str = args["pool_url"] fee = Decimal(args.get("fee", 0)) - fee_mojos = uint64(int(fee * units["chia"])) + fee_mojos = uint64(int(fee * units["flax"])) if enforce_https and not pool_url.startswith("https://"): print(f"Pool URLs must be HTTPS on mainnet {pool_url}. Aborting.") @@ -333,7 +333,7 @@ async def self_pool(args: dict, wallet_client: WalletRpcClient, fingerprint: int wallet_id = args.get("id", None) prompt = not args.get("yes", False) fee = Decimal(args.get("fee", 0)) - fee_mojos = uint64(int(fee * units["chia"])) + fee_mojos = uint64(int(fee * units["flax"])) msg = f"Will start self-farming with Plot NFT on wallet id {wallet_id} fingerprint {fingerprint}." func = functools.partial(wallet_client.pw_self_pool, wallet_id, fee_mojos) @@ -356,7 +356,7 @@ async def inspect_cmd(args: dict, wallet_client: WalletRpcClient, fingerprint: i async def claim_cmd(args: dict, wallet_client: WalletRpcClient, fingerprint: int) -> None: wallet_id = args.get("id", None) fee = Decimal(args.get("fee", 0)) - fee_mojos = uint64(int(fee * units["chia"])) + fee_mojos = uint64(int(fee * units["flax"])) msg = f"\nWill claim rewards for wallet ID: {wallet_id}." func = functools.partial( wallet_client.pw_absorb_rewards, diff --git a/chia/cmds/plots.py b/flax/cmds/plots.py similarity index 91% rename from chia/cmds/plots.py rename to flax/cmds/plots.py index 8286842c2..b74354d5e 100644 --- a/chia/cmds/plots.py +++ b/flax/cmds/plots.py @@ -5,21 +5,21 @@ import click -from chia.plotting.util import add_plot_directory, validate_plot_size +from flax.plotting.util import add_plot_directory, validate_plot_size DEFAULT_STRIPE_SIZE = 65536 log = logging.getLogger(__name__) def show_plots(root_path: Path): - from chia.plotting.util import get_plot_directories + from flax.plotting.util 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): @@ -30,11 +30,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) @@ -114,7 +114,7 @@ def create_cmd( exclude_final_dir: bool, connect_to_daemon: bool, ): - from chia.plotting.create_plots import create_plots, resolve_plot_keys + from flax.plotting.create_plots import create_plots, resolve_plot_keys class Params(object): def __init__(self): @@ -171,7 +171,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) @@ -187,7 +187,7 @@ def check_cmd( ) @click.pass_context def add_cmd(ctx: click.Context, final_dir: str): - from chia.plotting.util import add_plot_directory + from flax.plotting.util import add_plot_directory add_plot_directory(ctx.obj["root_path"], final_dir) @@ -203,7 +203,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.util import remove_plot_directory + from flax.plotting.util import remove_plot_directory remove_plot_directory(ctx.obj["root_path"], final_dir) diff --git a/chia/cmds/plotters.py b/flax/cmds/plotters.py similarity index 86% rename from chia/cmds/plotters.py rename to flax/cmds/plotters.py index 84fe4367d..cc03d3b22 100644 --- a/chia/cmds/plotters.py +++ b/flax/cmds/plotters.py @@ -1,5 +1,5 @@ import click -from chia.plotters.plotters import call_plotters +from flax.plotters.plotters import call_plotters @click.command( diff --git a/chia/cmds/rpc.py b/flax/cmds/rpc.py similarity index 96% rename from chia/cmds/rpc.py rename to flax/cmds/rpc.py index ddb43f47c..9d1cd1b34 100644 --- a/chia/cmds/rpc.py +++ b/flax/cmds/rpc.py @@ -6,15 +6,15 @@ import click from aiohttp import ClientResponseError -from chia.util.config import load_config -from chia.util.default_root import DEFAULT_ROOT_PATH -from chia.util.ints import uint16 +from flax.util.config import load_config +from flax.util.default_root import DEFAULT_ROOT_PATH +from flax.util.ints import uint16 services: List[str] = ["crawler", "farmer", "full_node", "harvester", "timelord", "wallet"] async def call_endpoint(service: str, endpoint: str, request: Dict[str, Any], config: Dict[str, Any]) -> Dict[str, Any]: - from chia.rpc.rpc_client import RpcClient + from flax.rpc.rpc_client import RpcClient port: uint16 if service == "crawler": diff --git a/chia/cmds/show.py b/flax/cmds/show.py similarity index 95% rename from chia/cmds/show.py rename to flax/cmds/show.py index 47dcef7f9..f3045d21a 100644 --- a/chia/cmds/show.py +++ b/flax/cmds/show.py @@ -1,9 +1,9 @@ from typing import Any, Optional, Union, Dict -from chia.types.blockchain_format.sized_bytes import bytes32 +from flax.types.blockchain_format.sized_bytes import bytes32 import click -from chia.util.network import is_trusted_inner +from flax.util.network import is_trusted_inner async def print_connections(client, time, NodeType, trusted_peers: Dict): @@ -71,16 +71,16 @@ async def show_async( import traceback import 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 chia.util.misc import format_bytes + 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 + from flax.util.misc import format_bytes try: config = load_config(DEFAULT_ROOT_PATH, "config.yaml") @@ -127,7 +127,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 90% rename from chia/cmds/start.py rename to flax/cmds/start.py index 0dd5acebe..aec823381 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 86% rename from chia/cmds/start_funcs.py rename to flax/cmds/start_funcs.py index 1df727f1d..fc91e077d 100644 --- a/chia/cmds/start_funcs.py +++ b/flax/cmds/start_funcs.py @@ -7,17 +7,17 @@ from pathlib import Path from typing import Optional -from chia.cmds.passphrase_funcs import get_current_passphrase -from chia.daemon.client import DaemonProxy, connect_to_daemon_and_validate -from chia.util.keychain import Keychain, KeyringMaxUnlockAttempts -from chia.util.service_groups import services_for_groups +from flax.cmds.passphrase_funcs import get_current_passphrase +from flax.daemon.client import DaemonProxy, connect_to_daemon_and_validate +from flax.util.keychain import Keychain, KeyringMaxUnlockAttempts +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 --wait-for-unlock".split(), stdout=subprocess.PIPE) + flax = sys.argv[0] + process = subprocess.Popen(f"{flax} run_daemon --wait-for-unlock".split(), stdout=subprocess.PIPE) return process @@ -57,7 +57,7 @@ async def async_start(root_path: Path, group: str, restart: bool) -> None: return None 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 88% rename from chia/cmds/stop.py rename to flax/cmds/stop.py index 54312c60b..9e7d5c988 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 78% rename from chia/cmds/units.py rename to flax/cmds/units.py index 55e3e506b..c9096a1fd 100644 --- a/chia/cmds/units.py +++ b/flax/cmds/units.py @@ -3,7 +3,7 @@ # The rest of the codebase uses mojos everywhere. # Only use 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 (XFX) is 1,000,000,000,000 mojo (1 trillion) "mojo": 1, "cat": 10 ** 3, # 1 CAT is 1000 CAT 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 8a3184846..96430643d 100644 --- a/chia/cmds/wallet.py +++ b/flax/cmds/wallet.py @@ -3,9 +3,9 @@ import click -from chia.cmds.plotnft import validate_fee -from chia.wallet.util.wallet_types import WalletType -from chia.wallet.transaction_sorting import SortKey +from flax.cmds.plotnft import validate_fee +from flax.wallet.util.wallet_types import WalletType +from flax.wallet.transaction_sorting import SortKey @click.group("wallet", short_help="Manage your wallet") @@ -121,7 +121,7 @@ def get_transactions_cmd( sys.stdout.close() -@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", @@ -131,18 +131,18 @@ def get_transactions_cmd( ) @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 XFX", type=str, required=True) @click.option("-e", "--memo", help="Additional memo for the transaction", type=str, default=None) @click.option( "-m", "--fee", - help="Set the fees for the transaction, in XCH", + help="Set the fees for the transaction, in XFX", type=str, default="0", show_default=True, required=True, ) -@click.option("-t", "--address", help="Address to send the XCH", type=str, required=True) +@click.option("-t", "--address", help="Address to send the XFX", type=str, required=True) @click.option( "-o", "--override", help="Submits transaction without checking for unusual values", is_flag=True, default=False ) @@ -271,7 +271,7 @@ def add_token_cmd(wallet_rpc_port: Optional[int], asset_id: str, token_name: str asyncio.run(execute_with_wallet(wallet_rpc_port, fingerprint, extra_params, add_token)) -@wallet_cmd.command("make_offer", short_help="Create an offer of XCH/CATs for XCH/CATs") +@wallet_cmd.command("make_offer", short_help="Create an offer of XFX/CATs for XFX/CATs") @click.option( "-wp", "--wallet-rpc-port", @@ -420,7 +420,7 @@ def did_cmd(): @click.option( "-m", "--fee", - help="Set the fees per transaction, in XCH.", + help="Set the fees per transaction, in XFX.", type=str, default="0", show_default=True, @@ -523,7 +523,7 @@ def nft_wallet_create_cmd( @click.option( "-m", "--fee", - help="Set the fees per transaction, in XCH.", + help="Set the fees per transaction, in XFX.", type=str, default="0", show_default=True, @@ -604,7 +604,7 @@ def nft_mint_cmd( @click.option( "-m", "--fee", - help="Set the fees per transaction, in XCH.", + help="Set the fees per transaction, in XFX.", type=str, default="0", show_default=True, @@ -649,7 +649,7 @@ def nft_add_uri_cmd( @click.option( "-m", "--fee", - help="Set the fees per transaction, in XCH.", + help="Set the fees per transaction, in XFX.", type=str, default="0", show_default=True, @@ -708,7 +708,7 @@ def nft_list_cmd(wallet_rpc_port: Optional[int], fingerprint: int, id: int) -> N @click.option( "-m", "--fee", - help="Set the fees per transaction, in XCH.", + help="Set the fees per transaction, in XFX.", type=str, default="0", show_default=True, diff --git a/chia/cmds/wallet_funcs.py b/flax/cmds/wallet_funcs.py similarity index 93% rename from chia/cmds/wallet_funcs.py rename to flax/cmds/wallet_funcs.py index 6669bd458..c01fb1f26 100644 --- a/chia/cmds/wallet_funcs.py +++ b/flax/cmds/wallet_funcs.py @@ -8,25 +8,25 @@ import aiohttp -from chia.cmds.show import print_connections -from chia.cmds.units import units -from chia.rpc.wallet_rpc_client import WalletRpcClient -from chia.server.outbound_message import NodeType -from chia.server.start_wallet import SERVICE_NAME -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.bech32m import bech32_decode, decode_puzzle_hash, encode_puzzle_hash -from chia.util.config import load_config -from chia.util.default_root import DEFAULT_ROOT_PATH -from chia.util.ints import uint16, uint32, uint64 -from chia.cmds.cmds_util import transaction_submitted_msg, transaction_status_msg -from chia.wallet.did_wallet.did_info import DID_HRP -from chia.wallet.nft_wallet.nft_info import NFT_HRP, NFTInfo -from chia.wallet.trade_record import TradeRecord -from chia.wallet.trading.offer import Offer -from chia.wallet.trading.trade_status import TradeStatus -from chia.wallet.transaction_record import TransactionRecord -from chia.wallet.util.transaction_type import TransactionType -from chia.wallet.util.wallet_types import WalletType +from flax.cmds.show import print_connections +from flax.cmds.units import units +from flax.rpc.wallet_rpc_client import WalletRpcClient +from flax.server.outbound_message import NodeType +from flax.server.start_wallet import SERVICE_NAME +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.bech32m import bech32_decode, decode_puzzle_hash, encode_puzzle_hash +from flax.util.config import load_config +from flax.util.default_root import DEFAULT_ROOT_PATH +from flax.util.ints import uint16, uint32, uint64 +from flax.cmds.cmds_util import transaction_submitted_msg, transaction_status_msg +from flax.wallet.did_wallet.did_info import DID_HRP +from flax.wallet.nft_wallet.nft_info import NFT_HRP, NFTInfo +from flax.wallet.trade_record import TradeRecord +from flax.wallet.trading.offer import Offer +from flax.wallet.trading.trade_status import TradeStatus +from flax.wallet.transaction_record import TransactionRecord +from flax.wallet.util.transaction_type import TransactionType +from flax.wallet.util.wallet_types import WalletType CATNameResolver = Callable[[bytes32], Awaitable[Optional[Tuple[Optional[uint32], str]]]] @@ -49,12 +49,12 @@ def print_transaction(tx: TransactionRecord, verbose: bool, name, address_prefix if verbose: print(tx) else: - chia_amount = Decimal(int(tx.amount)) / mojo_per_unit + flax_amount = Decimal(int(tx.amount)) / mojo_per_unit to_address = encode_puzzle_hash(tx.to_puzzle_hash, address_prefix) print(f"Transaction {tx.name}") print(f"Status: {'Confirmed' if tx.confirmed else ('In mempool' if tx.is_in_mempool() else 'Pending')}") description = transaction_description_from_type(tx) - print(f"Amount {description}: {chia_amount} {name}") + print(f"Amount {description}: {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("") @@ -63,7 +63,7 @@ def print_transaction(tx: TransactionRecord, verbose: bool, name, address_prefix def get_mojo_per_unit(wallet_type: WalletType) -> int: mojo_per_unit: int if wallet_type == WalletType.STANDARD_WALLET or wallet_type == WalletType.POOLING_WALLET: - mojo_per_unit = units["chia"] + mojo_per_unit = units["flax"] elif wallet_type == WalletType.CAT: mojo_per_unit = units["cat"] else: @@ -211,10 +211,10 @@ async def send(args: dict, wallet_client: WalletRpcClient, fingerprint: int) -> print(f"Wallet id: {wallet_id} not found.") return - final_fee = uint64(int(fee * units["chia"])) + final_fee = uint64(int(fee * units["flax"])) final_amount: uint64 if typ == WalletType.STANDARD_WALLET: - final_amount = uint64(int(amount * units["chia"])) + final_amount = uint64(int(amount * units["flax"])) print("Submitting transaction...") res = await wallet_client.send_transaction(str(wallet_id), final_amount, address, final_fee, memos) elif typ == WalletType.CAT: @@ -236,7 +236,7 @@ async def send(args: dict, wallet_client: WalletRpcClient, fingerprint: int) -> 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: @@ -278,7 +278,7 @@ async def make_offer(args: dict, wallet_client: WalletRpcClient, fingerprint: in offers: List[str] = args["offers"] requests: List[str] = args["requests"] filepath: str = args["filepath"] - fee: int = int(Decimal(args["fee"]) * units["chia"]) + fee: int = int(Decimal(args["fee"]) * units["flax"]) if [] in [offers, requests]: print("Not creating offer: Must be offering and requesting at least one asset") @@ -331,8 +331,8 @@ async def make_offer(args: dict, wallet_client: WalletRpcClient, fingerprint: in except ValueError: id = uint32(int(name)) if id == 1: - name = "XCH" - unit = units["chia"] + name = "XFX" + unit = units["flax"] else: name = await wallet_client.get_cat_name(str(id)) unit = units["cat"] @@ -378,7 +378,7 @@ async def make_offer(args: dict, wallet_client: WalletRpcClient, fingerprint: in with open(pathlib.Path(filepath), "w") as file: file.write(offer.to_bech32()) print(f"Created offer with ID {trade_record.trade_id}") - print(f"Use chia wallet get_offers --id {trade_record.trade_id} -f {fingerprint} to view status") + print(f"Use flax wallet get_offers --id {trade_record.trade_id} -f {fingerprint} to view status") else: print("Error creating offer") @@ -390,11 +390,11 @@ def timestamp_to_time(timestamp): async def print_offer_summary(cat_name_resolver: CATNameResolver, sum_dict: Dict[str, int], has_fee: bool = False): for asset_id, amount in sum_dict.items(): description: str = "" - unit: int = units["chia"] - wid: str = "1" if asset_id == "xch" else "" + unit: int = units["flax"] + wid: str = "1" if asset_id == "xfx" else "" mojo_amount: int = int(Decimal(amount)) - name: str = "XCH" - if asset_id != "xch": + name: str = "XFX" + if asset_id != "xfx": name = asset_id if asset_id == "unknown": name = "Unknown" @@ -441,7 +441,7 @@ async def print_trade_record(record, wallet_client: WalletRpcClient, summaries: await print_offer_summary(cat_name_resolver, requested) print("Pending Outbound Balances:") await print_offer_summary(cat_name_resolver, outbound_balances, has_fee=(fees > 0)) - print(f"Included Fees: {fees / units['chia']}") + print(f"Included Fees: {fees / units['flax']}") print("---------------") @@ -500,7 +500,7 @@ async def take_offer(args: dict, wallet_client: WalletRpcClient, fingerprint: in offer_hex = args["file"] examine_only: bool = args["examine_only"] - fee: int = int(Decimal(args["fee"]) * units["chia"]) + fee: int = int(Decimal(args["fee"]) * units["flax"]) try: offer = Offer.from_bech32(offer_hex) @@ -515,20 +515,20 @@ async def take_offer(args: dict, wallet_client: WalletRpcClient, fingerprint: in await print_offer_summary(cat_name_resolver, offered) print(" REQUESTED:") await print_offer_summary(cat_name_resolver, requested) - print(f"Included Fees: {Decimal(offer.bundle.fees()) / units['chia']}") + print(f"Included Fees: {Decimal(offer.bundle.fees()) / units['flax']}") if not examine_only: confirmation = input("Would you like to take this offer? (y/n): ") if confirmation in ["y", "yes"]: trade_record = await wallet_client.take_offer(offer, fee=fee) print(f"Accepted offer with ID {trade_record.trade_id}") - print(f"Use chia wallet get_offers --id {trade_record.trade_id} -f {fingerprint} to view its status") + print(f"Use flax wallet get_offers --id {trade_record.trade_id} -f {fingerprint} to view its status") async def cancel_offer(args: dict, wallet_client: WalletRpcClient, fingerprint: int) -> None: id = bytes32.from_hexstr(args["id"]) secure: bool = not args["insecure"] - fee: int = int(Decimal(args["fee"]) * units["chia"]) + fee: int = int(Decimal(args["fee"]) * units["flax"]) trade_record = await wallet_client.get_offer(id, file_contents=True) await print_trade_record(trade_record, wallet_client, summaries=True) @@ -538,14 +538,14 @@ async def cancel_offer(args: dict, wallet_client: WalletRpcClient, fingerprint: await wallet_client.cancel_offer(id, secure=secure, fee=fee) print(f"Cancelled offer with ID {trade_record.trade_id}") if secure: - print(f"Use chia wallet get_offers --id {trade_record.trade_id} -f {fingerprint} to view cancel status") + print(f"Use flax wallet get_offers --id {trade_record.trade_id} -f {fingerprint} to view cancel status") def wallet_coin_unit(typ: WalletType, address_prefix: str) -> Tuple[str, int]: if typ == WalletType.CAT: return "", units["cat"] if typ in [WalletType.STANDARD_WALLET, WalletType.POOLING_WALLET, WalletType.MULTI_SIG, WalletType.RATE_LIMITED]: - return address_prefix, units["chia"] + return address_prefix, units["flax"] return "", units["mojo"] @@ -626,7 +626,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] @@ -703,7 +703,7 @@ async def execute_with_wallet( if isinstance(e, aiohttp.ClientConnectorError): print( f"Connection error. Check if the wallet is running at {wallet_rpc_port}. " - "You can run the wallet via:\n\tchia start wallet" + "You can run the wallet via:\n\tflax start wallet" ) else: print(f"Exception from 'wallet' {e}") @@ -713,7 +713,7 @@ async def execute_with_wallet( async def create_did_wallet(args: Dict, wallet_client: WalletRpcClient, fingerprint: int) -> None: amount = args["amount"] - fee: int = int(Decimal(args["fee"]) * units["chia"]) + fee: int = int(Decimal(args["fee"]) * units["flax"]) name = args["name"] try: response = await wallet_client.create_new_did_wallet(amount, fee, name) @@ -771,7 +771,7 @@ async def mint_nft(args: Dict, wallet_client: WalletRpcClient, fingerprint: int) license_uris = args["license_uris"] series_total = args["series_total"] series_number = args["series_number"] - fee: int = int(Decimal(args["fee"]) * units["chia"]) + fee: int = int(Decimal(args["fee"]) * units["flax"]) royalty_percentage = args["royalty_percentage"] try: response = await wallet_client.get_nft_wallet_did(wallet_id) @@ -830,7 +830,7 @@ async def add_uri_to_nft(args: Dict, wallet_client: WalletRpcClient, fingerprint uri_value = license_uri else: raise ValueError("You must provide at least one of the URI flags") - fee: int = int(Decimal(args["fee"]) * units["chia"]) + fee: int = int(Decimal(args["fee"]) * units["flax"]) response = await wallet_client.add_uri_to_nft(wallet_id, nft_coin_id, key, uri_value, fee) spend_bundle = response["spend_bundle"] print(f"URI added successfully with spend bundle: {spend_bundle}") @@ -843,7 +843,7 @@ async def transfer_nft(args: Dict, wallet_client: WalletRpcClient, fingerprint: wallet_id = args["wallet_id"] nft_coin_id = args["nft_coin_id"] target_address = args["target_address"] - fee: int = int(Decimal(args["fee"]) * units["chia"]) + fee: int = int(Decimal(args["fee"]) * units["flax"]) response = await wallet_client.transfer_nft(wallet_id, nft_coin_id, target_address, fee) spend_bundle = response["spend_bundle"] print(f"NFT transferred successfully with spend bundle: {spend_bundle}") @@ -905,7 +905,7 @@ async def set_nft_did(args: Dict, wallet_client: WalletRpcClient, fingerprint: i wallet_id = args["wallet_id"] did_id = args["did_id"] nft_coin_id = args["nft_coin_id"] - fee: int = int(Decimal(args["fee"]) * units["chia"]) + fee: int = int(Decimal(args["fee"]) * units["flax"]) try: response = await wallet_client.set_nft_did(wallet_id, did_id, nft_coin_id, fee) spend_bundle = response["spend_bundle"] 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 94% rename from chia/consensus/block_body_validation.py rename to flax/consensus/block_body_validation.py index e9fd24b2c..e0d035279 100644 --- a/chia/consensus/block_body_validation.py +++ b/flax/consensus/block_body_validation.py @@ -4,30 +4,30 @@ 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.block_root_validation import validate_block_merkle_roots -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 -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, mempool_check_time_locks -from chia.types.block_protocol import BlockInfo -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.sized_bytes import bytes32, bytes48 -from chia.types.coin_record import CoinRecord -from chia.types.full_block import FullBlock -from chia.types.generator_types import BlockGenerator -from chia.types.unfinished_block import UnfinishedBlock -from chia.util import cached_bls -from chia.util.condition_tools import pkm_pairs -from chia.util.errors import Err -from chia.util.generator_tools import tx_removals_and_additions -from chia.util.hash import std_hash -from chia.util.ints import uint32, uint64 +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.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 +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, mempool_check_time_locks +from flax.types.block_protocol import BlockInfo +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.sized_bytes import bytes32, bytes48 +from flax.types.coin_record import CoinRecord +from flax.types.full_block import FullBlock +from flax.types.generator_types import BlockGenerator +from flax.types.unfinished_block import UnfinishedBlock +from flax.util import cached_bls +from flax.util.condition_tools import pkm_pairs +from flax.util.errors import Err +from flax.util.generator_tools import tx_removals_and_additions +from flax.util.hash import std_hash +from flax.util.ints import uint32, uint64 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 398bebec0..d2d1166d2 100644 --- a/chia/consensus/block_creation.py +++ b/flax/consensus/block_creation.py @@ -8,29 +8,29 @@ from chia_rs import compute_merkle_set_root 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 -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_ids -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.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 +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_ids +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.prev_transaction_block import get_prev_transaction_block +from flax.util.recursive_replace import recursive_replace log = logging.getLogger(__name__) @@ -85,7 +85,7 @@ def create_foliage( random.seed(seed) # Use the extension data to create different blocks based on header hash - extension_data: bytes32 = bytes32(random.randint(0, 100000000).to_bytes(32, "big")) + extension_data: bytes32 = random.randint(9, 100000000).to_bytes(32, "big") if prev_block is None: height: uint32 = uint32(0) else: 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 ee9974a43..6192368e8 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 0f75d90b1..f3324e5ef 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 @streamable 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 89% rename from chia/consensus/block_root_validation.py rename to flax/consensus/block_root_validation.py index a2fe15010..a89f87afc 100644 --- a/chia/consensus/block_root_validation.py +++ b/flax/consensus/block_root_validation.py @@ -2,9 +2,9 @@ from chia_rs import compute_merkle_set_root -from chia.types.blockchain_format.coin import Coin, hash_coin_ids -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.errors import Err +from flax.types.blockchain_format.coin import Coin, hash_coin_ids +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.errors import Err 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 b32fe0724..bcabbd0c2 100644 --- a/chia/consensus/blockchain.py +++ b/flax/consensus/blockchain.py @@ -10,45 +10,45 @@ from pathlib import Path from typing import Any, Dict, List, Optional, Set, Tuple -from chia.consensus.block_body_validation import validate_block_body -from chia.consensus.block_header_validation import 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 ( +from flax.consensus.block_body_validation import validate_block_body +from flax.consensus.block_header_validation import 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, _run_generator, pre_validate_blocks_multiprocessing, ) -from chia.full_node.block_height_map import BlockHeightMap -from chia.full_node.block_store import BlockStore -from chia.full_node.coin_store import CoinStore -from chia.full_node.hint_store import HintStore -from chia.full_node.mempool_check_conditions import get_name_puzzle_conditions -from chia.types.block_protocol import BlockInfo -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.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 -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 ConsensusError, Err -from chia.util.generator_tools import get_block_header, tx_removals_and_additions -from chia.util.inline_executor import InlineExecutor -from chia.util.ints import uint16, uint32, uint64, uint128 -from chia.util.setproctitle import getproctitle, setproctitle -from chia.util.streamable import recurse_jsonify +from flax.full_node.block_height_map import BlockHeightMap +from flax.full_node.block_store import BlockStore +from flax.full_node.coin_store import CoinStore +from flax.full_node.hint_store import HintStore +from flax.full_node.mempool_check_conditions import get_name_puzzle_conditions +from flax.types.block_protocol import BlockInfo +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.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 +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 ConsensusError, Err +from flax.util.generator_tools import get_block_header, tx_removals_and_additions +from flax.util.inline_executor import InlineExecutor +from flax.util.ints import uint16, uint32, uint64, uint128 +from flax.util.setproctitle import getproctitle, setproctitle +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 dccc6d426..0a009a34a 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 715f08f10..79e57fdea 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 f92f16d55..560b5846a 100644 --- a/chia/consensus/constants.py +++ b/flax/consensus/constants.py @@ -2,9 +2,9 @@ import logging from typing import Any -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 log = logging.getLogger(__name__) @@ -38,14 +38,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 @@ -60,7 +60,6 @@ class ConsensusConstants: MAX_GENERATOR_SIZE: uint32 MAX_GENERATOR_REF_LIST_SIZE: uint32 POOL_SUB_SLOT_ITERS: uint64 - SOFT_FORK_HEIGHT: uint32 def replace(self, **changes: object) -> "ConsensusConstants": return dataclasses.replace(self, **changes) diff --git a/chia/consensus/cost_calculator.py b/flax/consensus/cost_calculator.py similarity index 66% rename from chia/consensus/cost_calculator.py rename to flax/consensus/cost_calculator.py index 34577a82c..ae9bae089 100644 --- a/chia/consensus/cost_calculator.py +++ b/flax/consensus/cost_calculator.py @@ -1,9 +1,9 @@ from dataclasses import dataclass from typing import Optional -from chia.types.spend_bundle_conditions import SpendBundleConditions -from chia.util.ints import uint16, uint64 -from chia.util.streamable import Streamable, streamable +from flax.types.spend_bundle_conditions import SpendBundleConditions +from flax.util.ints import uint16, uint64 +from flax.util.streamable import Streamable, streamable @streamable diff --git a/chia/consensus/default_constants.py b/flax/consensus/default_constants.py similarity index 87% rename from chia/consensus/default_constants.py rename to flax/consensus/default_constants.py index a4eed66e0..4de659a9a 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 @@ -54,7 +54,6 @@ "MAX_GENERATOR_SIZE": 1000000, "MAX_GENERATOR_REF_LIST_SIZE": 512, # Number of references allowed in the block generator ref list "POOL_SUB_SLOT_ITERS": 37600000000, # iters limit * NUM_SPS - "SOFT_FORK_HEIGHT": 2300000, } 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 5db520fee..ec772505e 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 cabe631ff..ea8dc4802 100644 --- a/chia/consensus/full_block_to_block_record.py +++ b/flax/consensus/full_block_to_block_record.py @@ -1,20 +1,20 @@ 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.errors import Err -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.errors import Err +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 258508626..54b0ee892 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 81dd8ddd2..52dcdaa5e 100644 --- a/chia/consensus/multiprocess_validation.py +++ b/flax/consensus/multiprocess_validation.py @@ -7,30 +7,30 @@ from blspy import AugSchemeMPL, G1Element -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.block_protocol import BlockInfo -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.full_block import FullBlock -from chia.types.generator_types import BlockGenerator -from chia.types.header_block import HeaderBlock -from chia.types.unfinished_block import UnfinishedBlock -from chia.util.block_cache import BlockCache -from chia.util.condition_tools import pkm_pairs -from chia.util.errors import Err, ValidationError -from chia.util.generator_tools import get_block_header, tx_removals_and_additions -from chia.util.ints import uint16, uint32, uint64 -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.block_protocol import BlockInfo +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.full_block import FullBlock +from flax.types.generator_types import BlockGenerator +from flax.types.header_block import HeaderBlock +from flax.types.unfinished_block import UnfinishedBlock +from flax.util.block_cache import BlockCache +from flax.util.condition_tools import pkm_pairs +from flax.util.errors import Err, ValidationError +from flax.util.generator_tools import get_block_header, tx_removals_and_additions +from flax.util.ints import uint16, uint32, uint64 +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 6e4ef8477..a4649d6ac 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 77408aa0c..95102f511 100644 --- a/chia/consensus/vdf_info_computation.py +++ b/flax/consensus/vdf_info_computation.py @@ -1,12 +1,12 @@ 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.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 97% rename from chia/daemon/client.py rename to flax/daemon/client.py index b4c83c07f..1aa65b211 100644 --- a/chia/daemon/client.py +++ b/flax/daemon/client.py @@ -7,9 +7,9 @@ import aiohttp -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.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: @@ -167,7 +167,7 @@ async def connect_to_daemon_and_validate(root_path: Path, quiet: bool = False) - Connect to the local daemon and do a ping to ensure that something is really there and running. """ - from chia.server.server import ssl_context_for_client + from flax.server.server import ssl_context_for_client try: net_config = load_config(root_path, "config.yaml") diff --git a/chia/daemon/keychain_proxy.py b/flax/daemon/keychain_proxy.py similarity index 97% rename from chia/daemon/keychain_proxy.py rename to flax/daemon/keychain_proxy.py index abc24438e..362da795b 100644 --- a/chia/daemon/keychain_proxy.py +++ b/flax/daemon/keychain_proxy.py @@ -2,24 +2,24 @@ import ssl from blspy import AugSchemeMPL, PrivateKey -from chia.cmds.init_funcs import check_keys -from chia.daemon.client import DaemonProxy -from chia.daemon.keychain_server import ( +from flax.cmds.init_funcs import check_keys +from flax.daemon.client import DaemonProxy +from flax.daemon.keychain_server import ( KEYCHAIN_ERR_KEYERROR, KEYCHAIN_ERR_LOCKED, KEYCHAIN_ERR_MALFORMED_REQUEST, KEYCHAIN_ERR_NO_KEYS, ) -from chia.server.server import ssl_context_for_client -from chia.util.config import load_config -from chia.util.keychain import ( +from flax.server.server import ssl_context_for_client +from flax.util.config import load_config +from flax.util.keychain import ( Keychain, KeyringIsLocked, bytes_to_mnemonic, mnemonic_to_seed, supports_keyring_passphrase, ) -from chia.util.ws_message import WsRpcMessage +from flax.util.ws_message import WsRpcMessage from pathlib import Path from typing import Any, Dict, List, Optional, Tuple diff --git a/chia/daemon/keychain_server.py b/flax/daemon/keychain_server.py similarity index 98% rename from chia/daemon/keychain_server.py rename to flax/daemon/keychain_server.py index 3c3116552..5398b25bd 100644 --- a/chia/daemon/keychain_server.py +++ b/flax/daemon/keychain_server.py @@ -1,8 +1,8 @@ import logging from blspy import PrivateKey -from chia.cmds.init_funcs import check_keys -from chia.util.keychain import Keychain +from flax.cmds.init_funcs import check_keys +from flax.util.keychain import Keychain from pathlib import Path from typing import Any, Dict, List, Optional, cast diff --git a/chia/daemon/server.py b/flax/daemon/server.py similarity index 96% rename from chia/daemon/server.py rename to flax/daemon/server.py index cf98d9369..8baa2d7ca 100644 --- a/chia/daemon/server.py +++ b/flax/daemon/server.py @@ -14,19 +14,19 @@ from pathlib import Path from typing import Any, Dict, List, Optional, TextIO, Tuple, cast -from chia import __version__ -from chia.cmds.init_funcs import check_keys, chia_init -from chia.cmds.passphrase_funcs import default_passphrase, using_default_passphrase -from chia.daemon.keychain_server import KeychainServer, keychain_commands -from chia.daemon.windows_signal import kill -from chia.plotters.plotters import get_available_plotters -from chia.plotting.util import add_plot_directory -from chia.server.server import ssl_context_for_root, ssl_context_for_server -from chia.ssl.create_ssl import get_mozilla_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.keychain import ( +from flax import __version__ +from flax.cmds.init_funcs import check_keys, flax_init +from flax.cmds.passphrase_funcs import default_passphrase, using_default_passphrase +from flax.daemon.keychain_server import KeychainServer, keychain_commands +from flax.daemon.windows_signal import kill +from flax.plotters.plotters import get_available_plotters +from flax.plotting.util import add_plot_directory +from flax.server.server import ssl_context_for_root, ssl_context_for_server +from flax.ssl.create_ssl import get_mozilla_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.keychain import ( Keychain, KeyringCurrentPassphraseIsInvalid, KeyringRequiresMigration, @@ -34,10 +34,10 @@ supports_keyring_passphrase, supports_os_passphrase_storage, ) -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.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() @@ -45,7 +45,7 @@ from aiohttp import ClientSession, WSMsgType, web from aiohttp.web_ws import WebSocketResponse 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: @@ -57,7 +57,7 @@ log = logging.getLogger(__name__) -service_plotter = "chia_plotter" +service_plotter = "flax_plotter" async def fetch(url: str): @@ -90,17 +90,17 @@ 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", - "chia_seeder": "start_seeder", - "chia_crawler": "start_crawler", + "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", + "flax_seeder": "start_seeder", + "flax_crawler": "start_crawler", } def executable_for_service(service_name: str) -> str: @@ -170,7 +170,7 @@ async def start(self): self.log.warning( ( "Deprecation Warning: Your version of SSL (%s) does not support TLS1.3. " - "A future version of Chia will require TLS1.3." + "A future version of Flax will require TLS1.3." ), ssl.OPENSSL_VERSION, ) @@ -421,7 +421,7 @@ async def unlock_keyring(self, request: Dict[str, Any]) -> Dict[str, Any]: else: self.log.debug("Skipping legacy key migration (previously attempted).") except Exception: - self.log.exception("Failed to migrate keys silently. Run `chia keys migrate` manually.") + self.log.exception("Failed to migrate keys silently. Run `flax keys migrate` manually.") # Inform the GUI of keyring status changes self.keyring_status_changed(await self.keyring_status(), "wallet_ui") @@ -848,7 +848,7 @@ def _madmax_plotting_command_args(self, request: Any, ignoreCount: bool, index: def _build_plotting_command_args(self, request: Any, ignoreCount: bool, index: int) -> List[str]: plotter: str = request.get("plotter", "chiapos") - command_args: List[str] = ["chia", "plotters", plotter] + command_args: List[str] = ["flax", "plotters", plotter] command_args.extend(self._common_plotting_command_args(request, ignoreCount)) @@ -1153,7 +1153,7 @@ async def exit(self) -> None: if self.websocket_runner is not None: await self.websocket_runner.cleanup() self.shutdown_event.set() - log.info("chia daemon exiting") + log.info("flax daemon exiting") async def register_service(self, websocket: WebSocketResponse, request: Dict[str, Any]) -> Dict[str, Any]: self.log.info(f"Register service {request}") @@ -1207,8 +1207,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 @@ -1257,21 +1257,21 @@ 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']}") # Insert proper e service_array = service_command.split() service_executable = executable_for_service(service_array[0]) service_array[0] = service_executable - if service_command == "chia_full_node_simulator": + if service_command == "flax_full_node_simulator": # Set the -D/--connect_to_daemon flag to signify that the child should connect # to the daemon to access the keychain service_array.append("-D") @@ -1376,11 +1376,11 @@ def singleton(lockfile: Path, text: str = "semaphore") -> Optional[TextIO]: async def async_run_daemon(root_path: Path, wait_for_unlock: bool = False) -> int: - # When wait_for_unlock is true, we want to skip the check_keys() call in chia_init + # When wait_for_unlock is true, we want to skip the check_keys() call in flax_init # since it might be necessary to wait for the GUI to unlock the keyring first. - chia_init(root_path, should_check_keys=(not wait_for_unlock)) + flax_init(root_path, should_check_keys=(not wait_for_unlock)) 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"] @@ -1428,8 +1428,8 @@ def run_daemon(root_path: Path, wait_for_unlock: bool = False) -> int: def main() -> int: - from chia.util.default_root import DEFAULT_ROOT_PATH - from chia.util.keychain import Keychain + from flax.util.default_root import DEFAULT_ROOT_PATH + from flax.util.keychain import Keychain wait_for_unlock = "--wait-for-unlock" in sys.argv[1:] and Keychain.is_keyring_locked() return run_daemon(DEFAULT_ROOT_PATH, wait_for_unlock) 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 94% rename from chia/farmer/farmer.py rename to flax/farmer/farmer.py index e56d9766e..c825bbacb 100644 --- a/chia/farmer/farmer.py +++ b/flax/farmer/farmer.py @@ -9,19 +9,19 @@ import aiohttp from blspy import AugSchemeMPL, G1Element, G2Element, PrivateKey -import chia.server.ws_connection as ws # lgtm [py/import-and-import-from] -from chia.consensus.constants import ConsensusConstants -from chia.daemon.keychain_proxy import ( +import flax.server.ws_connection as ws # lgtm [py/import-and-import-from] +from flax.consensus.constants import ConsensusConstants +from flax.daemon.keychain_proxy import ( KeychainProxy, KeychainProxyConnectionFailure, connect_to_keychain_and_validate, wrap_local_keychain, ) -from chia.plot_sync.delta import Delta -from chia.plot_sync.receiver import Receiver -from chia.pools.pool_config import PoolWalletConfig, add_auth_key, load_pool_config -from chia.protocols import farmer_protocol, harvester_protocol -from chia.protocols.pool_protocol import ( +from flax.plot_sync.delta import Delta +from flax.plot_sync.receiver import Receiver +from flax.pools.pool_config import PoolWalletConfig, add_auth_key, load_pool_config +from flax.protocols import farmer_protocol, harvester_protocol +from flax.protocols.pool_protocol import ( AuthenticationPayload, ErrorResponse, GetFarmerResponse, @@ -32,27 +32,27 @@ PutFarmerRequest, get_current_authentication_token, ) -from chia.protocols.protocol_message_types import ProtocolMessageTypes -from chia.server.outbound_message import NodeType, make_msg -from chia.server.server import ssl_context_for_root -from chia.server.ws_connection import WSChiaConnection -from chia.ssl.create_ssl import get_mozilla_ca_crt -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.byte_types import hexstr_to_bytes -from chia.util.config import config_path_for_filename, load_config, lock_and_load_config, save_config -from chia.util.hash import std_hash -from chia.util.ints import uint8, uint16, uint32, uint64 -from chia.util.keychain import Keychain -from chia.wallet.derive_keys import ( +from flax.protocols.protocol_message_types import ProtocolMessageTypes +from flax.server.outbound_message import NodeType, make_msg +from flax.server.server import ssl_context_for_root +from flax.server.ws_connection import WSFlaxConnection +from flax.ssl.create_ssl import get_mozilla_ca_crt +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.byte_types import hexstr_to_bytes +from flax.util.config import config_path_for_filename, load_config, lock_and_load_config, save_config +from flax.util.hash import std_hash +from flax.util.ints import uint8, uint16, uint32, uint64 +from flax.util.keychain import Keychain +from flax.wallet.derive_keys import ( find_authentication_sk, find_owner_sk, master_sk_to_farmer_sk, master_sk_to_pool_sk, match_address_to_sk, ) -from chia.wallet.puzzles.singleton_top_layer import SINGLETON_MOD +from flax.wallet.puzzles.singleton_top_layer import SINGLETON_MOD singleton_mod_hash = SINGLETON_MOD.get_tree_hash() @@ -133,7 +133,7 @@ async def get_all_private_keys(self): return await keychain_proxy.get_all_private_keys() async def setup_keys(self) -> bool: - no_keys_error_str = "No keys exist. Please run 'chia keys generate' or open the UI." + no_keys_error_str = "No keys exist. Please run 'flax keys generate' or open the UI." self.all_root_sks: List[PrivateKey] = [sk for sk, _ in await self.get_all_private_keys()] self._private_keys = [master_sk_to_farmer_sk(sk) for sk in self.all_root_sks] + [ master_sk_to_pool_sk(sk) for sk in self.all_root_sks @@ -144,22 +144,22 @@ async def setup_keys(self) -> bool: return False config = load_config(self._root_path, "config.yaml") - if "xch_target_address" not in self.config: + if "xfx_target_address" not in self.config: self.config = config["farmer"] - if "xch_target_address" not in self.pool_config: + if "xfx_target_address" not in self.pool_config: self.pool_config = config["pool"] - if "xch_target_address" not in self.config or "xch_target_address" not in self.pool_config: - log.debug("xch_target_address missing in the config") + if "xfx_target_address" not in self.config or "xfx_target_address" not in self.pool_config: + log.debug("xfx_target_address missing in the config") return False # 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 self pooling configuration, which is only used for original self-pooled plots - self.pool_target_encoded = self.pool_config["xch_target_address"] + self.pool_target_encoded = self.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(): @@ -206,7 +206,7 @@ async def _await_closed(self, shutting_down: bool = True): 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): self.state_changed("add_connection", {}) async def handshake_task(): @@ -251,7 +251,7 @@ def handle_failed_pool_response(self, p2_singleton_puzzle_hash: bytes32, error_m ErrorResponse(uint16(PoolErrorCode.REQUEST_FAILED.value), error_message).to_json_dict() ) - def on_disconnect(self, connection: ws.WSChiaConnection): + def on_disconnect(self, connection: ws.WSFlaxConnection): self.log.info(f"peer disconnected {connection.get_peer_logging()}") self.state_changed("close_connection", {}) if connection.connection_type is NodeType.HARVESTER: @@ -587,11 +587,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 set_payout_instructions(self, launcher_id: bytes32, payout_instructions: str): 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 6982d6305..0150593e6 100644 --- a/chia/farmer/farmer_api.py +++ b/flax/farmer/farmer_api.py @@ -5,33 +5,33 @@ import aiohttp from blspy import AugSchemeMPL, G2Element, PrivateKey -import chia.server.ws_connection as ws -from chia import __version__ -from chia.consensus.network_type import NetworkType -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.harvester_protocol import ( +import flax.server.ws_connection as ws +from flax import __version__ +from flax.consensus.network_type import NetworkType +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.harvester_protocol import ( PlotSyncDone, PlotSyncPathList, PlotSyncPlotList, PlotSyncStart, PoolDifficulty, ) -from chia.protocols.pool_protocol import ( +from flax.protocols.pool_protocol import ( PoolErrorCode, PostPartialPayload, PostPartialRequest, get_current_authentication_token, ) -from chia.protocols.protocol_message_types import ProtocolMessageTypes -from chia.server.outbound_message import NodeType, make_msg -from chia.server.server import ssl_context_for_root -from chia.ssl.create_ssl import get_mozilla_ca_crt -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 +from flax.protocols.protocol_message_types import ProtocolMessageTypes +from flax.server.outbound_message import NodeType, make_msg +from flax.server.server import ssl_context_for_root +from flax.ssl.create_ssl import get_mozilla_ca_crt +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 def strip_old_entries(pairs: List[Tuple[float, Any]], before: float) -> List[Tuple[float, Any]]: @@ -53,7 +53,7 @@ def __init__(self, farmer) -> None: @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 @@ -240,7 +240,7 @@ async def new_proof_of_space( f"{pool_url}/partial", json=post_partial_request.to_json_dict(), ssl=ssl_context_for_root(get_mozilla_ca_crt(), log=self.farmer.log), - headers={"User-Agent": f"Chia Blockchain v.{__version__}"}, + headers={"User-Agent": f"Flax Blockchain v.{__version__}"}, ) as resp: if resp.ok: pool_response: Dict = json.loads(await resp.text()) @@ -530,40 +530,40 @@ async def farming_info(self, request: farmer_protocol.FarmingInfo): @api_request @peer_required - async def respond_plots(self, _: harvester_protocol.RespondPlots, peer: ws.WSChiaConnection): + async def respond_plots(self, _: harvester_protocol.RespondPlots, peer: ws.WSFlaxConnection): self.farmer.log.warning(f"Respond plots came too late from: {peer.get_peer_logging()}") @api_request @peer_required - async def plot_sync_start(self, message: PlotSyncStart, peer: ws.WSChiaConnection): + async def plot_sync_start(self, message: PlotSyncStart, peer: ws.WSFlaxConnection): await self.farmer.plot_sync_receivers[peer.peer_node_id].sync_started(message) @api_request @peer_required - async def plot_sync_loaded(self, message: PlotSyncPlotList, peer: ws.WSChiaConnection): + async def plot_sync_loaded(self, message: PlotSyncPlotList, peer: ws.WSFlaxConnection): await self.farmer.plot_sync_receivers[peer.peer_node_id].process_loaded(message) @api_request @peer_required - async def plot_sync_removed(self, message: PlotSyncPathList, peer: ws.WSChiaConnection): + async def plot_sync_removed(self, message: PlotSyncPathList, peer: ws.WSFlaxConnection): await self.farmer.plot_sync_receivers[peer.peer_node_id].process_removed(message) @api_request @peer_required - async def plot_sync_invalid(self, message: PlotSyncPathList, peer: ws.WSChiaConnection): + async def plot_sync_invalid(self, message: PlotSyncPathList, peer: ws.WSFlaxConnection): await self.farmer.plot_sync_receivers[peer.peer_node_id].process_invalid(message) @api_request @peer_required - async def plot_sync_keys_missing(self, message: PlotSyncPathList, peer: ws.WSChiaConnection): + async def plot_sync_keys_missing(self, message: PlotSyncPathList, peer: ws.WSFlaxConnection): await self.farmer.plot_sync_receivers[peer.peer_node_id].process_keys_missing(message) @api_request @peer_required - async def plot_sync_duplicates(self, message: PlotSyncPathList, peer: ws.WSChiaConnection): + async def plot_sync_duplicates(self, message: PlotSyncPathList, peer: ws.WSFlaxConnection): await self.farmer.plot_sync_receivers[peer.peer_node_id].process_duplicates(message) @api_request @peer_required - async def plot_sync_done(self, message: PlotSyncDone, peer: ws.WSChiaConnection): + async def plot_sync_done(self, message: PlotSyncDone, peer: ws.WSFlaxConnection): await self.farmer.plot_sync_receivers[peer.peer_node_id].sync_done(message) 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_height_map.py b/flax/full_node/block_height_map.py similarity index 96% rename from chia/full_node/block_height_map.py rename to flax/full_node/block_height_map.py index e381fc868..03c5ddde3 100644 --- a/chia/full_node/block_height_map.py +++ b/flax/full_node/block_height_map.py @@ -1,14 +1,14 @@ import logging from typing import Dict, List, Optional, Tuple -from chia.util.ints import uint32 -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.blockchain_format.sub_epoch_summary import SubEpochSummary +from flax.util.ints import uint32 +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.blockchain_format.sub_epoch_summary import SubEpochSummary from pathlib import Path import aiofiles from dataclasses import dataclass -from chia.util.streamable import Streamable, streamable -from chia.util.files import write_file_async -from chia.util.db_wrapper import DBWrapper2 +from flax.util.streamable import Streamable, streamable +from flax.util.files import write_file_async +from flax.util.db_wrapper import DBWrapper2 log = logging.getLogger(__name__) 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 aad306cf6..c09af2b02 100644 --- a/chia/full_node/block_store.py +++ b/flax/full_node/block_store.py @@ -3,16 +3,16 @@ import zstd -from chia.consensus.block_record import BlockRecord -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.full_block import FullBlock -from chia.types.blockchain_format.program import SerializedProgram -from chia.types.weight_proof import SubEpochChallengeSegment, SubEpochSegments -from chia.util.errors import Err -from chia.util.db_wrapper import DBWrapper2 -from chia.util.ints import uint32 -from chia.util.lru_cache import LRUCache -from chia.util.full_block_utils import generator_from_block +from flax.consensus.block_record import BlockRecord +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.full_block import FullBlock +from flax.types.blockchain_format.program import SerializedProgram +from flax.types.weight_proof import SubEpochChallengeSegment, SubEpochSegments +from flax.util.errors import Err +from flax.util.db_wrapper import DBWrapper2 +from flax.util.ints import uint32 +from flax.util.lru_cache import LRUCache +from flax.util.full_block_utils import generator_from_block log = logging.getLogger(__name__) @@ -54,7 +54,7 @@ async def create(cls, db_wrapper: DBWrapper2): await conn.execute("CREATE TABLE IF NOT EXISTS current_peak(key int PRIMARY KEY, hash blob)") # If any of these indices are altered, they should also be altered - # in the chia/cmds/db_upgrade.py file + # in the flax/cmds/db_upgrade.py file await conn.execute("CREATE INDEX IF NOT EXISTS height on full_blocks(height)") # Sub epoch segments for weight proofs @@ -65,7 +65,7 @@ async def create(cls, db_wrapper: DBWrapper2): ) # If any of these indices are altered, they should also be altered - # in the chia/cmds/db_upgrade.py file + # in the flax/cmds/db_upgrade.py file await conn.execute( "CREATE INDEX IF NOT EXISTS is_fully_compactified ON" " full_blocks(is_fully_compactified, in_main_chain) WHERE in_main_chain=1" 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 5ddf59736..ef773a233 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_spend import CoinSpend -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_spend import CoinSpend +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_spend_entry_list(bundle: SpendBundle) -> bytes: diff --git a/chia/full_node/coin_store.py b/flax/full_node/coin_store.py similarity index 98% rename from chia/full_node/coin_store.py rename to flax/full_node/coin_store.py index 4bdf119de..f852665fd 100644 --- a/chia/full_node/coin_store.py +++ b/flax/full_node/coin_store.py @@ -2,13 +2,13 @@ from aiosqlite import Cursor -from chia.protocols.wallet_protocol import CoinState -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.util.db_wrapper import DBWrapper2 -from chia.util.ints import uint32, uint64 -from chia.util.chunks import chunks +from flax.protocols.wallet_protocol import CoinState +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.util.db_wrapper import DBWrapper2 +from flax.util.ints import uint32, uint64 +from flax.util.chunks import chunks import time import logging diff --git a/chia/full_node/full_node.py b/flax/full_node/full_node.py similarity index 95% rename from chia/full_node/full_node.py rename to flax/full_node/full_node.py index 489f7bd6a..564c7fac8 100644 --- a/chia/full_node/full_node.py +++ b/flax/full_node/full_node.py @@ -14,69 +14,69 @@ import sqlite3 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, StateChangeSummary -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.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.hint_management import get_hints_and_subscription_coin_ids -from chia.full_node.lock_queue import LockQueue, LockClient -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, FullNodeStorePeakResult -from chia.full_node.hint_store import HintStore -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, StateChangeSummary +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.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.hint_management import get_hints_and_subscription_coin_ids +from flax.full_node.lock_queue import LockQueue, LockClient +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, FullNodeStorePeakResult +from flax.full_node.hint_store import HintStore +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 ( RequestBlocks, RespondBlock, RespondBlocks, RespondSignagePoint, ) -from chia.protocols.protocol_message_types import ProtocolMessageTypes -from chia.protocols.wallet_protocol import CoinState, CoinStateUpdate -from chia.server.node_discovery import FullNodePeers -from chia.server.outbound_message import Message, NodeType, make_msg -from chia.server.peer_store_resolver import PeerStoreResolver -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.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.header_block import HeaderBlock -from chia.types.mempool_inclusion_status import MempoolInclusionStatus -from chia.types.spend_bundle import SpendBundle -from chia.types.transaction_queue_entry import TransactionQueueEntry -from chia.types.unfinished_block import UnfinishedBlock -from chia.util import cached_bls -from chia.util.bech32m import encode_puzzle_hash -from chia.util.check_fork_next_block import check_fork_next_block -from chia.util.condition_tools import pkm_pairs -from chia.util.config import PEER_DB_PATH_KEY_DEPRECATED, process_config_start_method -from chia.util.db_wrapper import DBWrapper2 -from chia.util.errors import ConsensusError, Err, ValidationError -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.protocols.wallet_protocol import CoinState, CoinStateUpdate +from flax.server.node_discovery import FullNodePeers +from flax.server.outbound_message import Message, NodeType, make_msg +from flax.server.peer_store_resolver import PeerStoreResolver +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.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.header_block import HeaderBlock +from flax.types.mempool_inclusion_status import MempoolInclusionStatus +from flax.types.spend_bundle import SpendBundle +from flax.types.transaction_queue_entry import TransactionQueueEntry +from flax.types.unfinished_block import UnfinishedBlock +from flax.util import cached_bls +from flax.util.bech32m import encode_puzzle_hash +from flax.util.check_fork_next_block import check_fork_next_block +from flax.util.condition_tools import pkm_pairs +from flax.util.config import PEER_DB_PATH_KEY_DEPRECATED, process_config_start_method +from flax.util.db_wrapper import DBWrapper2 +from flax.util.errors import ConsensusError, Err, ValidationError +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 from datetime import datetime -from chia.util.db_synchronous import db_synchronous_on -from chia.util.db_version import lookup_db_version, set_db_version_async +from flax.util.db_synchronous import db_synchronous_on +from flax.util.db_version import lookup_db_version, set_db_version_async # This is the result of calling peak_post_processing, which is then fed into peak_post_processing_2 @@ -197,10 +197,11 @@ def sql_trace_callback(req: str): await c.set_trace_callback(sql_trace_callback) await self.db_wrapper.add_connection(c) - await (await db_connection.execute("pragma journal_mode=wal")).close() - db_sync = db_synchronous_on(self.config.get("db_sync", "auto"), self.db_path) - self.log.info(f"opening blockchain DB: synchronous={db_sync}") - await (await db_connection.execute("pragma synchronous={}".format(db_sync))).close() + # Never use pragma synchronous=OFF in Flax. + # await (await db_connection.execute("pragma journal_mode=wal")).close() + # db_sync = db_synchronous_on(self.config.get("db_sync", "auto"), self.db_path) + # self.log.info(f"opening blockchain DB: synchronous={db_sync}") + # await (await db_connection.execute("pragma synchronous={}".format(db_sync))).close() if db_version != 2: async with self.db_wrapper.read_db() as conn: @@ -214,7 +215,7 @@ def sql_trace_callback(req: str): await set_db_version_async(w_conn, 2) self.db_wrapper.db_version = 2 except sqlite3.OperationalError: - # it could be a database created with "chia init", which is + # it could be a database created with "flax init", which is # empty except it has the database_version table pass @@ -348,7 +349,7 @@ 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 = [] try: @@ -359,9 +360,9 @@ def set_server(self, server: ChiaServer): default_port = None 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, @@ -392,7 +393,7 @@ def _state_changed(self, change: str, change_data: Dict[str, Any] = None): if self.state_changed_callback is not None: self.state_changed_callback(change, change_data) - 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. @@ -475,7 +476,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 @@ -531,7 +532,7 @@ async def _refresh_ui_connections(self, sleep_before: float = 0): await asyncio.sleep(sleep_before) self._state_changed("peer_changed_peak") - 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. @@ -608,7 +609,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 @@ -681,7 +682,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. @@ -732,7 +733,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_logging()}") self._state_changed("close_connection") self._state_changed("sync_mode") @@ -740,7 +741,7 @@ def on_disconnect(self, connection: ws.WSChiaConnection): self.sync_store.peer_disconnected(connection.peer_node_id) self.remove_subscriptions(connection) - def remove_subscriptions(self, peer: ws.WSChiaConnection): + def remove_subscriptions(self, peer: ws.WSFlaxConnection): # Remove all ph | coin id subscription for this peer node_id = peer.peer_node_id if node_id in self.peer_puzzle_hash: @@ -949,7 +950,7 @@ async def sync_from_fork_point( ) batch_size = self.constants.MAX_BLOCK_COUNT_PER_REQUESTS - async def fetch_block_batches(batch_queue: asyncio.Queue, peers_with_peak: List[ws.WSChiaConnection]): + async def fetch_block_batches(batch_queue: asyncio.Queue, peers_with_peak: List[ws.WSFlaxConnection]): try: for start_height in range(fork_point_height, target_peak_sb_height, batch_size): end_height = min(target_peak_sb_height, start_height + batch_size) @@ -1012,7 +1013,7 @@ async def validate_block_batches(inner_batch_queue: asyncio.Queue): await self.send_peak_to_wallets() self.blockchain.clean_block_record(end_height - self.constants.BLOCKS_CACHE_SIZE) - batch_queue: asyncio.Queue[Tuple[ws.WSChiaConnection, List[FullBlock]]] = asyncio.Queue(maxsize=buffer_size) + batch_queue: asyncio.Queue[Tuple[ws.WSFlaxConnection, List[FullBlock]]] = asyncio.Queue(maxsize=buffer_size) fetch_task = asyncio.Task(fetch_block_batches(batch_queue, peers_with_peak)) validate_task = asyncio.Task(validate_block_batches(batch_queue)) try: @@ -1077,7 +1078,7 @@ async def update_wallets( for peer, changes in changes_for_peer.items(): if peer not in self.server.all_connections: continue - ws_peer: ws.WSChiaConnection = self.server.all_connections[peer] + ws_peer: ws.WSFlaxConnection = self.server.all_connections[peer] state = CoinStateUpdate( state_change_summary.peak.height, state_change_summary.fork_height, @@ -1090,7 +1091,7 @@ async def update_wallets( 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, Optional[StateChangeSummary]]: @@ -1213,7 +1214,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( @@ -1273,7 +1274,7 @@ async def peak_post_processing( self, block: FullBlock, state_change_summary: StateChangeSummary, - peer: Optional[ws.WSChiaConnection], + peer: Optional[ws.WSFlaxConnection], ) -> PeakPostProcessingResult: """ Must be called under self.blockchain.lock. This updates the internal state of the full node with the @@ -1379,7 +1380,7 @@ async def peak_post_processing( async def peak_post_processing_2( self, block: FullBlock, - peer: Optional[ws.WSChiaConnection], + peer: Optional[ws.WSFlaxConnection], state_change_summary: StateChangeSummary, ppp_result: PeakPostProcessingResult, ): @@ -1457,7 +1458,7 @@ async def peak_post_processing_2( async def respond_block( self, respond_block: full_node_protocol.RespondBlock, - peer: Optional[ws.WSChiaConnection] = None, + peer: Optional[ws.WSFlaxConnection] = None, raise_on_disconnected: bool = False, ) -> Optional[Message]: """ @@ -1662,7 +1663,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, block_bytes: Optional[bytes] = None, ): @@ -1808,7 +1809,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"{receive_time - self.signage_point_times[block.reward_chain_block.signage_point_index]:0.4f}, " - 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:0.4f} seconds, {pre_validation_log}" f"cost: {block.transactions_info.cost if block.transactions_info else 'None'}" f"{percent_full_str}" @@ -1857,7 +1858,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( @@ -1960,7 +1961,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()) @@ -2051,7 +2052,7 @@ async def respond_transaction( self, transaction: SpendBundle, spend_name: bytes32, - peer: Optional[ws.WSChiaConnection] = None, + peer: Optional[ws.WSFlaxConnection] = None, test: bool = False, tx_bytes: Optional[bytes] = None, ) -> Tuple[MempoolInclusionStatus, Optional[Err]]: @@ -2273,7 +2274,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 @@ -2291,7 +2292,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 ) @@ -2335,7 +2336,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 @@ -2461,7 +2462,7 @@ async def broadcast_uncompact_blocks( async def node_next_block_check( - peer: ws.WSChiaConnection, potential_peek: uint32, blockchain: BlockchainInterface + peer: ws.WSFlaxConnection, potential_peek: uint32, blockchain: BlockchainInterface ) -> bool: block_response: Optional[Any] = await peer.request_block(full_node_protocol.RequestBlock(potential_peek, True)) 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 8ec145c31..0eab1a252 100644 --- a/chia/full_node/full_node_api.py +++ b/flax/full_node/full_node_api.py @@ -8,44 +8,44 @@ 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 ( +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, CoinState, RespondSESInfo, ) -from chia.server.outbound_message import Message, make_msg -from chia.types.blockchain_format.coin import Coin, hash_coin_ids -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.blockchain_format.sub_epoch_summary import SubEpochSummary -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.transaction_queue_entry import TransactionQueueEntry -from chia.types.unfinished_block import UnfinishedBlock -from chia.util.api_decorators import api_request, peer_required, bytes_required, execute_task, reply_type -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 +from flax.server.outbound_message import Message, make_msg +from flax.types.blockchain_format.coin import Coin, hash_coin_ids +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.blockchain_format.sub_epoch_summary import SubEpochSummary +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.transaction_queue_entry import TransactionQueueEntry +from flax.types.unfinished_block import UnfinishedBlock +from flax.util.api_decorators import api_request, peer_required, bytes_required, execute_task, reply_type +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: @@ -69,7 +69,7 @@ def api_ready(self): @peer_required @api_request @reply_type([ProtocolMessageTypes.respond_peers]) - 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) @@ -80,7 +80,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: @@ -90,7 +90,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: @@ -102,7 +102,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. @@ -123,7 +123,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. @@ -226,7 +226,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]: @@ -392,7 +392,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). @@ -455,7 +455,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, respond_unfinished_block_bytes: bytes = b"", ) -> Optional[Message]: if self.full_node.sync_store.get_sync_mode(): @@ -468,7 +468,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(): @@ -595,7 +595,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 @@ -651,7 +651,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 @@ -663,7 +663,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)) @@ -679,7 +679,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 @@ -969,7 +969,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 @@ -1036,7 +1036,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 @@ -1047,7 +1047,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 @@ -1064,7 +1064,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 @@ -1351,7 +1351,7 @@ async def respond_compact_proof_of_time(self, request: timelord_protocol.Respond @api_request @bytes_required async def new_compact_vdf( - self, request: full_node_protocol.NewCompactVDF, peer: ws.WSChiaConnection, request_bytes: bytes = b"" + self, request: full_node_protocol.NewCompactVDF, peer: ws.WSFlaxConnection, request_bytes: bytes = b"" ): if self.full_node.sync_store.get_sync_mode(): return None @@ -1377,14 +1377,14 @@ async def new_compact_vdf( @peer_required @api_request @reply_type([ProtocolMessageTypes.respond_compact_vdf]) - 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) @@ -1392,7 +1392,7 @@ async def respond_compact_vdf(self, request: full_node_protocol.RespondCompactVD @peer_required @api_request async def register_interest_in_puzzle_hash( - self, request: wallet_protocol.RegisterForPhUpdates, peer: ws.WSChiaConnection + self, request: wallet_protocol.RegisterForPhUpdates, peer: ws.WSFlaxConnection ): if peer.peer_node_id not in self.full_node.peer_puzzle_hash: self.full_node.peer_puzzle_hash[peer.peer_node_id] = set() @@ -1434,7 +1434,7 @@ async def register_interest_in_puzzle_hash( @peer_required @api_request async def register_interest_in_coin( - self, request: wallet_protocol.RegisterForCoinUpdates, peer: ws.WSChiaConnection + self, request: wallet_protocol.RegisterForCoinUpdates, peer: ws.WSFlaxConnection ): if peer.peer_node_id not in self.full_node.peer_coin_ids: self.full_node.peer_coin_ids[peer.peer_node_id] = set() 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 0626e8e1a..f09668e08 100644 --- a/chia/full_node/full_node_store.py +++ b/flax/full_node/full_node_store.py @@ -4,27 +4,27 @@ 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 chia.util.lru_cache import LRUCache -from chia.util.streamable import Streamable, streamable +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 +from flax.util.lru_cache import LRUCache +from flax.util.streamable import Streamable, streamable 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 7bc2731fa..7bd81d498 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, 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, 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_spend_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_spend_entry.clvm", package_or_requirement="flax.wallet.puzzles") DECOMPRESS_CSE_WITH_PREFIX = load_clvm( - "decompress_coin_spend_entry_with_prefix.clvm", package_or_requirement="chia.wallet.puzzles" + "decompress_coin_spend_entry_with_prefix.clvm", package_or_requirement="flax.wallet.puzzles" ) log = logging.getLogger(__name__) diff --git a/chia/full_node/hint_management.py b/flax/full_node/hint_management.py similarity index 93% rename from chia/full_node/hint_management.py rename to flax/full_node/hint_management.py index e2457117e..5c9e4ff7a 100644 --- a/chia/full_node/hint_management.py +++ b/flax/full_node/hint_management.py @@ -1,8 +1,8 @@ from typing import Dict, List, Optional, Set, Tuple -from chia.consensus.blockchain import StateChangeSummary -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.sized_bytes import bytes32 +from flax.consensus.blockchain import StateChangeSummary +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.sized_bytes import bytes32 def get_hints_and_subscription_coin_ids( diff --git a/chia/full_node/hint_store.py b/flax/full_node/hint_store.py similarity index 95% rename from chia/full_node/hint_store.py rename to flax/full_node/hint_store.py index fc0aa600d..5741586ae 100644 --- a/chia/full_node/hint_store.py +++ b/flax/full_node/hint_store.py @@ -1,6 +1,6 @@ from typing import List, Tuple -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.db_wrapper import DBWrapper2 +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.db_wrapper import DBWrapper2 import logging log = logging.getLogger(__name__) diff --git a/chia/full_node/lock_queue.py b/flax/full_node/lock_queue.py similarity index 100% rename from chia/full_node/lock_queue.py rename to flax/full_node/lock_queue.py 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 4c88adad1..66ceb593f 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 77% rename from chia/full_node/mempool_check_conditions.py rename to flax/full_node/mempool_check_conditions.py index 04bae27dd..525a09c3f 100644 --- a/chia/full_node/mempool_check_conditions.py +++ b/flax/full_node/mempool_check_conditions.py @@ -2,17 +2,17 @@ from typing import Dict, Optional from chia_rs import MEMPOOL_MODE, COND_CANON_INTS, NO_NEG_DIV -from chia.consensus.default_constants import DEFAULT_CONSTANTS -from chia.consensus.cost_calculator import NPCResult -from chia.types.spend_bundle_conditions import SpendBundleConditions -from chia.full_node.generator import create_generator_args, setup_generator_args -from chia.types.coin_record import CoinRecord -from chia.types.generator_types import BlockGenerator -from chia.types.blockchain_format.sized_bytes import bytes32 -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.default_constants import DEFAULT_CONSTANTS +from flax.consensus.cost_calculator import NPCResult +from flax.types.spend_bundle_conditions import SpendBundleConditions +from flax.full_node.generator import create_generator_args, setup_generator_args +from flax.types.coin_record import CoinRecord +from flax.types.generator_types import BlockGenerator +from flax.types.blockchain_format.sized_bytes import bytes32 +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() @@ -43,11 +43,6 @@ def get_name_puzzle_conditions( if mempool_mode: flags = MEMPOOL_MODE - elif unwrap(height) >= DEFAULT_CONSTANTS.SOFT_FORK_HEIGHT: - # conditions must use integers in canonical encoding (i.e. no redundant - # leading zeros) - # the division operator may not be used with negative operands - flags = COND_CANON_INTS | NO_NEG_DIV else: flags = 0 diff --git a/chia/full_node/mempool_manager.py b/flax/full_node/mempool_manager.py similarity index 94% rename from chia/full_node/mempool_manager.py rename to flax/full_node/mempool_manager.py index eb11ba134..2552fd2ce 100644 --- a/chia/full_node/mempool_manager.py +++ b/flax/full_node/mempool_manager.py @@ -5,35 +5,35 @@ from multiprocessing.context import BaseContext import time from concurrent.futures.process import ProcessPoolExecutor -from chia.util.inline_executor import InlineExecutor +from flax.util.inline_executor import InlineExecutor from typing import Dict, List, Optional, Set, Tuple from blspy import GTElement from chiabip158 import PyBIP158 -from chia.util import cached_bls -from chia.consensus.block_record import BlockRecord -from chia.consensus.constants import ConsensusConstants -from chia.consensus.cost_calculator import NPCResult -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 get_name_puzzle_conditions -from chia.full_node.pending_tx_cache import PendingTxCache -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, bytes48 -from chia.types.coin_record import CoinRecord -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.cached_bls import LOCAL_CACHE -from chia.util.condition_tools import pkm_pairs -from chia.util.errors import Err, ValidationError -from chia.util.generator_tools import additions_for_npc -from chia.util.ints import uint32, uint64 -from chia.util.lru_cache import LRUCache -from chia.util.setproctitle import getproctitle, setproctitle -from chia.full_node.mempool_check_conditions import mempool_check_time_locks +from flax.util import cached_bls +from flax.consensus.block_record import BlockRecord +from flax.consensus.constants import ConsensusConstants +from flax.consensus.cost_calculator import NPCResult +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 get_name_puzzle_conditions +from flax.full_node.pending_tx_cache import PendingTxCache +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, bytes48 +from flax.types.coin_record import CoinRecord +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.cached_bls import LOCAL_CACHE +from flax.util.condition_tools import pkm_pairs +from flax.util.errors import Err, ValidationError +from flax.util.generator_tools import additions_for_npc +from flax.util.ints import uint32, uint64 +from flax.util.lru_cache import LRUCache +from flax.util.setproctitle import getproctitle, setproctitle +from flax.full_node.mempool_check_conditions import mempool_check_time_locks log = logging.getLogger(__name__) @@ -97,7 +97,7 @@ def __init__( self.lock = asyncio.Lock() # The fee per cost must be above this amount to consider the fee "nonzero", and thus able to kick out other - # transactions. This prevents spam. This is equivalent to 0.055 XCH per block, or about 0.00005 XCH for two + # transactions. This prevents spam. This is equivalent to 0.055 XFX per block, or about 0.00005 XFX for two # spends. self.nonzero_fee_minimum_fpc = 5 @@ -209,7 +209,7 @@ def remove_seen(self, bundle_hash: bytes32): @staticmethod def get_min_fee_increase() -> int: - # 0.00001 XCH + # 0.00001 XFX return 10000000 def can_replace( @@ -439,7 +439,7 @@ async def add_spendbundle( log.warning(f"{spend.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 ) @@ -447,7 +447,7 @@ async def add_spendbundle( error: Optional[Err] = mempool_check_time_locks( removal_record_dict, npc_result.conds, - uint32(chialisp_height), + uint32(flaxlisp_height), self.peak.timestamp, ) diff --git a/chia/full_node/pending_tx_cache.py b/flax/full_node/pending_tx_cache.py similarity index 90% rename from chia/full_node/pending_tx_cache.py rename to flax/full_node/pending_tx_cache.py index f687dee0e..337bbd320 100644 --- a/chia/full_node/pending_tx_cache.py +++ b/flax/full_node/pending_tx_cache.py @@ -1,7 +1,7 @@ from typing import Dict -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.mempool_item import MempoolItem +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.mempool_item import MempoolItem class PendingTxCache: 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 9230d6f3f..b1851520a 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 @streamable diff --git a/chia/full_node/sync_store.py b/flax/full_node/sync_store.py similarity index 98% rename from chia/full_node/sync_store.py rename to flax/full_node/sync_store.py index bf3fb80e5..6b367098a 100644 --- a/chia/full_node/sync_store.py +++ b/flax/full_node/sync_store.py @@ -3,8 +3,8 @@ from collections import OrderedDict as orderedDict from typing import Dict, List, Optional, OrderedDict, 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 e91d569c9..eb4eaae84 100644 --- a/chia/full_node/weight_proof.py +++ b/flax/full_node/weight_proof.py @@ -9,28 +9,28 @@ import tempfile from typing import Dict, IO, 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.util.chunks import chunks -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, VDFProof -from chia.types.end_of_slot_bundle import EndOfSubSlotBundle -from chia.types.header_block import HeaderBlock -from chia.types.weight_proof import ( +from flax.util.chunks import chunks +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, VDFProof +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, @@ -38,17 +38,17 @@ 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.setproctitle import getproctitle, setproctitle -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.setproctitle import getproctitle, setproctitle +from flax.util.streamable import dataclass_from_dict, recurse_jsonify log = logging.getLogger(__name__) def _create_shutdown_file() -> IO: - return tempfile.NamedTemporaryFile(prefix="chia_full_node_weight_proof_handler_executor_shutdown_trigger") + return tempfile.NamedTemporaryFile(prefix="flax_full_node_weight_proof_handler_executor_shutdown_trigger") class WeightProofHandler: 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 94% rename from chia/harvester/harvester.py rename to flax/harvester/harvester.py index 84d0cb2f2..49a7bf38b 100644 --- a/chia/harvester/harvester.py +++ b/flax/harvester/harvester.py @@ -6,11 +6,11 @@ from pathlib import Path from typing import Any, Callable, Dict, List, Optional, Tuple -import chia.server.ws_connection as ws # lgtm [py/import-and-import-from] -from chia.consensus.constants import ConsensusConstants -from chia.plot_sync.sender import Sender -from chia.plotting.manager import PlotManager -from chia.plotting.util import ( +import flax.server.ws_connection as ws # lgtm [py/import-and-import-from] +from flax.consensus.constants import ConsensusConstants +from flax.plot_sync.sender import Sender +from flax.plotting.manager import PlotManager +from flax.plotting.util import ( PlotRefreshEvents, PlotRefreshResult, PlotsRefreshParameter, @@ -19,7 +19,7 @@ remove_plot, remove_plot_directory, ) -from chia.util.streamable import dataclass_from_dict +from flax.util.streamable import dataclass_from_dict log = logging.getLogger(__name__) @@ -101,7 +101,7 @@ def _plot_refresh_callback(self, event: PlotRefreshEvents, update_result: PlotRe if event == PlotRefreshEvents.done: self.plot_sync_sender.sync_done(update_result.removed, update_result.duration) - def on_disconnect(self, connection: ws.WSChiaConnection): + def on_disconnect(self, connection: ws.WSFlaxConnection): self.log.info(f"peer disconnected {connection.get_peer_logging()}") self.state_changed("close_connection") self.plot_sync_sender.stop() 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 54fe3f0e3..284868737 100644 --- a/chia/harvester/harvester_api.py +++ b/flax/harvester/harvester_api.py @@ -5,20 +5,20 @@ from blspy import AugSchemeMPL, G1Element, G2Element -from chia.consensus.pot_iterations import calculate_iterations_quality, calculate_sp_interval_iters -from chia.harvester.harvester import Harvester -from chia.plotting.util import PlotInfo, parse_plot_info -from chia.protocols import harvester_protocol -from chia.protocols.farmer_protocol import FarmingInfo -from chia.protocols.harvester_protocol import Plot, PlotSyncResponse -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.util import PlotInfo, parse_plot_info +from flax.protocols import harvester_protocol +from flax.protocols.farmer_protocol import FarmingInfo +from flax.protocols.harvester_protocol import Plot, PlotSyncResponse +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: @@ -30,7 +30,7 @@ def __init__(self, harvester: Harvester): @peer_required @api_request async def harvester_handshake( - self, harvester_handshake: harvester_protocol.HarvesterHandshake, peer: WSChiaConnection + self, harvester_handshake: harvester_protocol.HarvesterHandshake, peer: WSFlaxConnection ): """ Handshake between the harvester and farmer. The harvester receives the pool public keys, @@ -47,7 +47,7 @@ async def harvester_handshake( @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/plot_sync/__init__.py b/flax/plot_sync/__init__.py similarity index 100% rename from chia/plot_sync/__init__.py rename to flax/plot_sync/__init__.py diff --git a/chia/plot_sync/delta.py b/flax/plot_sync/delta.py similarity index 97% rename from chia/plot_sync/delta.py rename to flax/plot_sync/delta.py index 6a797ffc3..3851b9ba2 100644 --- a/chia/plot_sync/delta.py +++ b/flax/plot_sync/delta.py @@ -1,7 +1,7 @@ from dataclasses import dataclass, field from typing import Dict, List, Union -from chia.protocols.harvester_protocol import Plot +from flax.protocols.harvester_protocol import Plot @dataclass diff --git a/chia/plot_sync/exceptions.py b/flax/plot_sync/exceptions.py similarity index 91% rename from chia/plot_sync/exceptions.py rename to flax/plot_sync/exceptions.py index e972a2a29..30311644c 100644 --- a/chia/plot_sync/exceptions.py +++ b/flax/plot_sync/exceptions.py @@ -1,9 +1,9 @@ from typing import Any -from chia.plot_sync.util import ErrorCodes, State -from chia.protocols.harvester_protocol import PlotSyncIdentifier -from chia.server.ws_connection import NodeType -from chia.util.ints import uint64 +from flax.plot_sync.util import ErrorCodes, State +from flax.protocols.harvester_protocol import PlotSyncIdentifier +from flax.server.ws_connection import NodeType +from flax.util.ints import uint64 class PlotSyncException(Exception): diff --git a/chia/plot_sync/receiver.py b/flax/plot_sync/receiver.py similarity index 95% rename from chia/plot_sync/receiver.py rename to flax/plot_sync/receiver.py index 22f4059d8..9e2209183 100644 --- a/chia/plot_sync/receiver.py +++ b/flax/plot_sync/receiver.py @@ -3,8 +3,8 @@ from dataclasses import dataclass, field from typing import Any, Callable, Collection, Coroutine, Dict, List, Optional -from chia.plot_sync.delta import Delta, PathListDelta, PlotListDelta -from chia.plot_sync.exceptions import ( +from flax.plot_sync.delta import Delta, PathListDelta, PlotListDelta +from flax.plot_sync.exceptions import ( InvalidIdentifierError, InvalidLastSyncIdError, PlotAlreadyAvailableError, @@ -12,8 +12,8 @@ PlotSyncException, SyncIdsMatchError, ) -from chia.plot_sync.util import ErrorCodes, State -from chia.protocols.harvester_protocol import ( +from flax.plot_sync.util import ErrorCodes, State +from flax.protocols.harvester_protocol import ( Plot, PlotSyncDone, PlotSyncError, @@ -23,11 +23,11 @@ PlotSyncResponse, PlotSyncStart, ) -from chia.server.ws_connection import ProtocolMessageTypes, WSChiaConnection, make_msg -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.ints import int16, uint32, uint64 -from chia.util.misc import get_list_or_len -from chia.util.streamable import _T_Streamable +from flax.server.ws_connection import ProtocolMessageTypes, WSFlaxConnection, make_msg +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.ints import int16, uint32, uint64 +from flax.util.misc import get_list_or_len +from flax.util.streamable import _T_Streamable log = logging.getLogger(__name__) @@ -53,7 +53,7 @@ def bump_plots_processed(self) -> None: class Receiver: - _connection: WSChiaConnection + _connection: WSFlaxConnection _current_sync: Sync _last_sync: Sync _plots: Dict[str, Plot] @@ -65,7 +65,7 @@ class Receiver: def __init__( self, - connection: WSChiaConnection, + connection: WSFlaxConnection, update_callback: Callable[[bytes32, Optional[Delta]], Coroutine[Any, Any, None]], ) -> None: self._connection = connection @@ -93,7 +93,7 @@ def reset(self) -> None: self._duplicates.clear() self._total_plot_size = 0 - def connection(self) -> WSChiaConnection: + def connection(self) -> WSFlaxConnection: return self._connection def current_sync(self) -> Sync: diff --git a/chia/plot_sync/sender.py b/flax/plot_sync/sender.py similarity index 96% rename from chia/plot_sync/sender.py rename to flax/plot_sync/sender.py index a9ea4f5f1..adacada20 100644 --- a/chia/plot_sync/sender.py +++ b/flax/plot_sync/sender.py @@ -8,11 +8,11 @@ from typing_extensions import Protocol -from chia.plot_sync.exceptions import AlreadyStartedError, InvalidConnectionTypeError -from chia.plot_sync.util import Constants -from chia.plotting.manager import PlotManager -from chia.plotting.util import PlotInfo -from chia.protocols.harvester_protocol import ( +from flax.plot_sync.exceptions import AlreadyStartedError, InvalidConnectionTypeError +from flax.plot_sync.util import Constants +from flax.plotting.manager import PlotManager +from flax.plotting.util import PlotInfo +from flax.protocols.harvester_protocol import ( Plot, PlotSyncDone, PlotSyncIdentifier, @@ -21,9 +21,9 @@ PlotSyncResponse, PlotSyncStart, ) -from chia.server.ws_connection import NodeType, ProtocolMessageTypes, WSChiaConnection, make_msg -from chia.util.generator_tools import list_to_batches -from chia.util.ints import int16, uint32, uint64 +from flax.server.ws_connection import NodeType, ProtocolMessageTypes, WSFlaxConnection, make_msg +from flax.util.generator_tools import list_to_batches +from flax.util.ints import int16, uint32, uint64 log = logging.getLogger(__name__) @@ -83,7 +83,7 @@ def __str__(self) -> str: class Sender: _plot_manager: PlotManager - _connection: Optional[WSChiaConnection] + _connection: Optional[WSFlaxConnection] _sync_id: uint64 _next_message_id: uint64 _messages: List[MessageGenerator[PayloadType]] @@ -127,7 +127,7 @@ async def await_closed(self) -> None: self._reset() self._stop_requested = False - def set_connection(self, connection: WSChiaConnection) -> None: + def set_connection(self, connection: WSFlaxConnection) -> None: assert connection.connection_type is not None if connection.connection_type != NodeType.FARMER: raise InvalidConnectionTypeError(connection.connection_type, NodeType.HARVESTER) diff --git a/chia/plot_sync/util.py b/flax/plot_sync/util.py similarity index 100% rename from chia/plot_sync/util.py rename to flax/plot_sync/util.py diff --git a/chia/plotters/__init__.py b/flax/plotters/__init__.py similarity index 100% rename from chia/plotters/__init__.py rename to flax/plotters/__init__.py diff --git a/chia/plotters/bladebit.py b/flax/plotters/bladebit.py similarity index 97% rename from chia/plotters/bladebit.py rename to flax/plotters/bladebit.py index 3a61ad2d2..b4afc667f 100644 --- a/chia/plotters/bladebit.py +++ b/flax/plotters/bladebit.py @@ -7,8 +7,8 @@ from pathlib import Path from typing import Any, Dict, Optional, Tuple -from chia.plotting.create_plots import resolve_plot_keys -from chia.plotters.plotters_util import run_plotter, run_command +from flax.plotting.create_plots import resolve_plot_keys +from flax.plotters.plotters_util import run_plotter, run_command log = logging.getLogger(__name__) @@ -175,7 +175,7 @@ def install_bladebit(root_path): raise RuntimeError("Platform not supported yet for bladebit plotter.") -def plot_bladebit(args, chia_root_path, root_path): +def plot_bladebit(args, flax_root_path, root_path): if not os.path.exists(get_bladebit_executable_path(root_path)): print("Installing bladebit plotter.") try: @@ -189,7 +189,7 @@ def plot_bladebit(args, chia_root_path, root_path): None, None if args.pool_key == b"" else args.pool_key.hex(), None if args.contract == "" else args.contract, - chia_root_path, + flax_root_path, log, args.connect_to_daemon, ) diff --git a/chia/plotters/chiapos.py b/flax/plotters/chiapos.py similarity index 81% rename from chia/plotters/chiapos.py rename to flax/plotters/chiapos.py index 0613077c7..094fb71bc 100644 --- a/chia/plotters/chiapos.py +++ b/flax/plotters/chiapos.py @@ -1,22 +1,22 @@ """ -NOTE: This contains duplicate code from `chia.cmds.plots`. -After `chia plots create` becomes obsolete, consider removing it from there. +NOTE: This contains duplicate code from `flax.cmds.plots`. +After `flax plots create` becomes obsolete, consider removing it from there. """ import asyncio import logging import pkg_resources -from chia.plotting.create_plots import create_plots, resolve_plot_keys +from flax.plotting.create_plots import create_plots, resolve_plot_keys from pathlib import Path from typing import Any, Dict, Optional -from chia.plotting.util import add_plot_directory, validate_plot_size +from flax.plotting.util import add_plot_directory, validate_plot_size log = logging.getLogger(__name__) def get_chiapos_install_info() -> Optional[Dict[str, Any]]: chiapos_version: str = pkg_resources.get_distribution("chiapos").version - return {"display_name": "Chia Proof of Space", "version": chiapos_version, "installed": True} + return {"display_name": "Flax Proof of Space", "version": chiapos_version, "installed": True} class Params: @@ -35,7 +35,7 @@ def __init__(self, args): self.nobitfield = args.nobitfield -def plot_chia(args, root_path): +def plot_flax(args, root_path): try: validate_plot_size(root_path, args.size, args.override) except ValueError as e: diff --git a/chia/plotters/install_plotter.py b/flax/plotters/install_plotter.py similarity index 85% rename from chia/plotters/install_plotter.py rename to flax/plotters/install_plotter.py index b072c92ae..e509b3ab5 100644 --- a/chia/plotters/install_plotter.py +++ b/flax/plotters/install_plotter.py @@ -1,14 +1,14 @@ import os -from chia.plotters.bladebit import install_bladebit -from chia.plotters.madmax import install_madmax +from flax.plotters.bladebit import install_bladebit +from flax.plotters.madmax import install_madmax def install_plotter(plotter, root_path): if plotter == "chiapos": - print("Chiapos already installed. No action taken.") + print("Flaxpos already installed. No action taken.") return elif plotter == "madmax": - if not os.path.exists(root_path / "madmax-plotter/build/chia_plot"): + if not os.path.exists(root_path / "madmax-plotter/build/flax_plot"): print("Installing madmax plotter.") try: install_madmax(root_path) diff --git a/chia/plotters/madmax.py b/flax/plotters/madmax.py similarity index 96% rename from chia/plotters/madmax.py rename to flax/plotters/madmax.py index 1d741113e..21574910c 100644 --- a/chia/plotters/madmax.py +++ b/flax/plotters/madmax.py @@ -6,8 +6,8 @@ from pathlib import Path from typing import Any, Dict, Optional -from chia.plotting.create_plots import resolve_plot_keys -from chia.plotters.plotters_util import run_plotter, run_command +from flax.plotting.create_plots import resolve_plot_keys +from flax.plotters.plotters_util import run_plotter, run_command log = logging.getLogger(__name__) @@ -29,9 +29,9 @@ def get_madmax_package_path() -> Path: def get_madmax_executable_path_for_ksize(plotters_root_path: Path, ksize: int = 32) -> Path: madmax_dir: Path = get_madmax_package_path() - madmax_exec: str = "chia_plot" + madmax_exec: str = "flax_plot" if ksize > 32: - madmax_exec += "_k34" # Use the chia_plot_k34 executable for k-sizes > 32 + madmax_exec += "_k34" # Use the flax_plot_k34 executable for k-sizes > 32 if sys.platform in ["win32", "cygwin"]: madmax_exec += ".exe" if not madmax_dir.exists(): @@ -174,7 +174,7 @@ def dir_with_trailing_slash(dir: str) -> str: return dir if dir[-1] == os.path.sep else dir + os.path.sep -def plot_madmax(args, chia_root_path: Path, plotters_root_path: Path): +def plot_madmax(args, flax_root_path: Path, plotters_root_path: Path): if sys.platform not in ["win32", "cygwin"]: import resource @@ -195,7 +195,7 @@ def plot_madmax(args, chia_root_path: Path, plotters_root_path: Path): None, None if args.pool_key == b"" else args.pool_key.hex(), None if args.contract == "" else args.contract, - chia_root_path, + flax_root_path, log, args.connect_to_daemon, ) diff --git a/chia/plotters/plotters.py b/flax/plotters/plotters.py similarity index 94% rename from chia/plotters/plotters.py rename to flax/plotters/plotters.py index f680bc8e4..152990797 100644 --- a/chia/plotters/plotters.py +++ b/flax/plotters/plotters.py @@ -2,10 +2,10 @@ import binascii import os from enum import Enum -from chia.plotters.bladebit import get_bladebit_install_info, plot_bladebit -from chia.plotters.chiapos import get_chiapos_install_info, plot_chia -from chia.plotters.madmax import get_madmax_install_info, plot_madmax -from chia.plotters.install_plotter import install_plotter +from flax.plotters.bladebit import get_bladebit_install_info, plot_bladebit +from flax.plotters.chiapos import get_chiapos_install_info, plot_flax +from flax.plotters.madmax import get_madmax_install_info, plot_madmax +from flax.plotters.install_plotter import install_plotter from pathlib import Path from typing import Any, Dict, Optional @@ -39,7 +39,7 @@ class Options(Enum): CONNECT_TO_DAEMON = 26 -chia_plotter = [ +flax_plotter = [ Options.TMP_DIR, Options.TMP_DIR2, Options.FINAL_DIR, @@ -315,8 +315,8 @@ def build_parser(subparsers, root_path, option_list, name, plotter_desc): def call_plotters(root_path: Path, args): - # Add `plotters` section in CHIA_ROOT. - chia_root_path = root_path + # Add `plotters` section in FLAX_ROOT. + flax_root_path = root_path root_path = get_plotters_root_path(root_path) if not root_path.is_dir(): if os.path.exists(root_path): @@ -326,14 +326,14 @@ def call_plotters(root_path: Path, args): print(f"Exception deleting old root path: {type(e)} {e}.") if not os.path.exists(root_path): - print(f"Creating plotters folder within CHIA_ROOT: {root_path}") + print(f"Creating plotters folder within FLAX_ROOT: {root_path}") try: os.mkdir(root_path) except Exception as e: print(f"Cannot create plotters root path {root_path} {type(e)} {e}.") plotters = argparse.ArgumentParser(description="Available options.") subparsers = plotters.add_subparsers(help="Available options", dest="plotter") - build_parser(subparsers, root_path, chia_plotter, "chiapos", "Chiapos Plotter") + build_parser(subparsers, root_path, flax_plotter, "chiapos", "Flaxpos Plotter") build_parser(subparsers, root_path, madmax_plotter, "madmax", "Madmax Plotter") build_parser(subparsers, root_path, bladebit_plotter, "bladebit", "Bladebit Plotter") install_parser = subparsers.add_parser("install", description="Install custom plotters.") @@ -343,11 +343,11 @@ def call_plotters(root_path: Path, args): args = plotters.parse_args(args) if args.plotter == "chiapos": - plot_chia(args, chia_root_path) + plot_flax(args, flax_root_path) if args.plotter == "madmax": - plot_madmax(args, chia_root_path, root_path) + plot_madmax(args, flax_root_path, root_path) if args.plotter == "bladebit": - plot_bladebit(args, chia_root_path, root_path) + plot_bladebit(args, flax_root_path, root_path) if args.plotter == "install": install_plotter(args.install_plotter, root_path) diff --git a/chia/plotters/plotters_util.py b/flax/plotters/plotters_util.py similarity index 100% rename from chia/plotters/plotters_util.py rename to flax/plotters/plotters_util.py diff --git a/chia/plotting/__init__.py b/flax/plotting/__init__.py similarity index 100% rename from chia/plotting/__init__.py rename to flax/plotting/__init__.py diff --git a/chia/plotting/cache.py b/flax/plotting/cache.py similarity index 94% rename from chia/plotting/cache.py rename to flax/plotting/cache.py index 58d73a2b9..576015523 100644 --- a/chia/plotting/cache.py +++ b/flax/plotting/cache.py @@ -8,13 +8,13 @@ from blspy import G1Element from chiapos import DiskProver -from chia.plotting.util import parse_plot_info -from chia.types.blockchain_format.proof_of_space import ProofOfSpace -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.ints import uint16, uint64 -from chia.util.path import mkdir -from chia.util.streamable import Streamable, streamable -from chia.wallet.derive_keys import master_sk_to_local_sk +from flax.plotting.util import parse_plot_info +from flax.types.blockchain_format.proof_of_space import ProofOfSpace +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.ints import uint16, uint64 +from flax.util.path import mkdir +from flax.util.streamable import Streamable, streamable +from flax.wallet.derive_keys import master_sk_to_local_sk log = logging.getLogger(__name__) diff --git a/chia/plotting/check_plots.py b/flax/plotting/check_plots.py similarity index 96% rename from chia/plotting/check_plots.py rename to flax/plotting/check_plots.py index fd503a6e3..d3e132ac0 100644 --- a/chia/plotting/check_plots.py +++ b/flax/plotting/check_plots.py @@ -7,8 +7,8 @@ from blspy import G1Element from chiapos import Verifier -from chia.plotting.manager import PlotManager -from chia.plotting.util import ( +from flax.plotting.manager import PlotManager +from flax.plotting.util import ( PlotRefreshEvents, PlotRefreshResult, PlotsRefreshParameter, @@ -16,11 +16,11 @@ get_plot_filenames, parse_plot_info, ) -from chia.util.bech32m import encode_puzzle_hash -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.util.bech32m import encode_puzzle_hash +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__) @@ -194,7 +194,7 @@ def check_plots(root_path, num, challenge_start, grep_string, list_duplicates, d log.warning( f"There are {len(plot_manager.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" ) if debug_show_memo: diff --git a/chia/plotting/create_plots.py b/flax/plotting/create_plots.py similarity index 94% rename from chia/plotting/create_plots.py rename to flax/plotting/create_plots.py index 5de568794..77a06ca90 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.daemon.keychain_proxy import KeychainProxy, connect_to_keychain_and_validate, wrap_local_keychain -from chia.plotting.util import 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.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.daemon.keychain_proxy import KeychainProxy, connect_to_keychain_and_validate, wrap_local_keychain +from flax.plotting.util import 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.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__) @@ -112,7 +112,7 @@ async def get_farmer_public_key(self, keychain_proxy: Optional[KeychainProxy] = sk: Optional[PrivateKey] = await self.get_sk(keychain_proxy) if sk is None: raise RuntimeError( - "No keys, please run 'chia keys add', 'chia keys generate' or provide a public key with -f" + "No keys, please run 'flax keys add', 'flax keys generate' or provide a public key with -f" ) return master_sk_to_farmer_sk(sk).get_g1() @@ -120,7 +120,7 @@ async def get_pool_public_key(self, keychain_proxy: Optional[KeychainProxy] = No sk: Optional[PrivateKey] = await self.get_sk(keychain_proxy) if sk is None: raise RuntimeError( - "No keys, please run 'chia keys add', 'chia keys generate' or provide a public key with -p" + "No keys, please run 'flax keys add', 'flax keys generate' or provide a public key with -p" ) return master_sk_to_pool_sk(sk).get_g1() diff --git a/chia/plotting/manager.py b/flax/plotting/manager.py similarity index 98% rename from chia/plotting/manager.py rename to flax/plotting/manager.py index 6539634de..86cecee13 100644 --- a/chia/plotting/manager.py +++ b/flax/plotting/manager.py @@ -9,10 +9,10 @@ from blspy import G1Element from chiapos import DiskProver -from chia.consensus.pos_quality import UI_ACTUAL_SPACE_CONSTANT_FACTOR, _expected_plot_size -from chia.plotting.cache import Cache, CacheEntry -from chia.plotting.util import PlotInfo, PlotRefreshEvents, PlotRefreshResult, PlotsRefreshParameter, get_plot_filenames -from chia.util.generator_tools import list_to_batches +from flax.consensus.pos_quality import UI_ACTUAL_SPACE_CONSTANT_FACTOR, _expected_plot_size +from flax.plotting.cache import Cache, CacheEntry +from flax.plotting.util import PlotInfo, PlotRefreshEvents, PlotRefreshResult, PlotsRefreshParameter, get_plot_filenames +from flax.util.generator_tools import list_to_batches log = logging.getLogger(__name__) diff --git a/chia/plotting/util.py b/flax/plotting/util.py similarity index 98% rename from chia/plotting/util.py rename to flax/plotting/util.py index 42a16e886..583302501 100644 --- a/chia/plotting/util.py +++ b/flax/plotting/util.py @@ -7,8 +7,8 @@ from blspy import G1Element, PrivateKey from chiapos import DiskProver -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.config import load_config, lock_and_load_config, save_config +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.config import load_config, lock_and_load_config, save_config log = logging.getLogger(__name__) diff --git a/chia/pools/__init__.py b/flax/pools/__init__.py similarity index 100% rename from chia/pools/__init__.py rename to flax/pools/__init__.py diff --git a/chia/pools/pool_config.py b/flax/pools/pool_config.py similarity index 94% rename from chia/pools/pool_config.py rename to flax/pools/pool_config.py index cc4519169..f1fbf2667 100644 --- a/chia/pools/pool_config.py +++ b/flax/pools/pool_config.py @@ -5,10 +5,10 @@ from blspy import G1Element -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.byte_types import hexstr_to_bytes -from chia.util.config import load_config, lock_and_load_config, save_config -from chia.util.streamable import Streamable, streamable +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.byte_types import hexstr_to_bytes +from flax.util.config import load_config, lock_and_load_config, save_config +from flax.util.streamable import Streamable, streamable """ Config example diff --git a/chia/pools/pool_puzzles.py b/flax/pools/pool_puzzles.py similarity index 96% rename from chia/pools/pool_puzzles.py rename to flax/pools/pool_puzzles.py index fb74c9650..4cbb4909f 100644 --- a/chia/pools/pool_puzzles.py +++ b/flax/pools/pool_puzzles.py @@ -3,20 +3,20 @@ from blspy import G1Element from clvm.casts import int_from_bytes, int_to_bytes -from chia.clvm.singleton import SINGLETON_LAUNCHER -from chia.consensus.block_rewards import calculate_pool_reward -from chia.consensus.coinbase import pool_parent_id -from chia.pools.pool_wallet_info import PoolState, LEAVING_POOL, SELF_POOLING +from flax.clvm.singleton import SINGLETON_LAUNCHER +from flax.consensus.block_rewards import calculate_pool_reward +from flax.consensus.coinbase import pool_parent_id +from flax.pools.pool_wallet_info import PoolState, LEAVING_POOL, SELF_POOLING -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.program import Program, SerializedProgram +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.program import Program, SerializedProgram -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.coin_spend import CoinSpend -from chia.wallet.puzzles.load_clvm import load_clvm -from chia.wallet.puzzles.singleton_top_layer import puzzle_for_singleton +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.coin_spend import CoinSpend +from flax.wallet.puzzles.load_clvm import load_clvm +from flax.wallet.puzzles.singleton_top_layer import puzzle_for_singleton -from chia.util.ints import uint32, uint64 +from flax.util.ints import uint32, uint64 log = logging.getLogger(__name__) # "Full" is the outer singleton, with the inner puzzle filled in @@ -388,7 +388,7 @@ def solution_to_pool_state(full_spend: CoinSpend) -> Optional[PoolState]: if inner_solution.rest().first().as_int() != 0: return None - # This is referred to as p1 in the chialisp code + # This is referred to as p1 in the flaxlisp code # spend_type is absorbing money if p1 is a cons box, spend_type is escape if p1 is an atom # TODO: The comment above, and in the CLVM, seems wrong extra_data = inner_solution.first() diff --git a/chia/pools/pool_wallet.py b/flax/pools/pool_wallet.py similarity index 97% rename from chia/pools/pool_wallet.py rename to flax/pools/pool_wallet.py index b41a2585c..55632baad 100644 --- a/chia/pools/pool_wallet.py +++ b/flax/pools/pool_wallet.py @@ -5,8 +5,8 @@ from blspy import PrivateKey, G2Element, G1Element -from chia.pools.pool_config import PoolWalletConfig, load_pool_config, update_pool_config -from chia.pools.pool_wallet_info import ( +from flax.pools.pool_config import PoolWalletConfig, load_pool_config, update_pool_config +from flax.pools.pool_wallet_info import ( PoolWalletInfo, PoolSingletonState, PoolState, @@ -15,17 +15,17 @@ LEAVING_POOL, create_pool_state, ) -from chia.protocols.pool_protocol import POOL_PROTOCOL_VERSION +from flax.protocols.pool_protocol import POOL_PROTOCOL_VERSION -from chia.types.announcement import Announcement -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.blockchain_format.program import Program, SerializedProgram -from chia.types.coin_record import CoinRecord -from chia.types.coin_spend import CoinSpend -from chia.types.spend_bundle import SpendBundle +from flax.types.announcement import Announcement +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.blockchain_format.program import Program, SerializedProgram +from flax.types.coin_record import CoinRecord +from flax.types.coin_spend import CoinSpend +from flax.types.spend_bundle import SpendBundle -from chia.pools.pool_puzzles import ( +from flax.pools.pool_puzzles import ( create_waiting_room_inner_puzzle, create_full_puzzle, SINGLETON_LAUNCHER, @@ -43,18 +43,18 @@ get_delayed_puz_info_from_launcher_spend, ) -from chia.util.ints import uint8, uint32, uint64, uint128 -from chia.wallet.derive_keys import ( +from flax.util.ints import uint8, uint32, uint64, uint128 +from flax.wallet.derive_keys import ( find_owner_sk, ) -from chia.wallet.sign_coin_spends import sign_coin_spends -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 flax.wallet.sign_coin_spends import sign_coin_spends +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 chia.wallet.wallet_info import WalletInfo -from chia.wallet.util.transaction_type import TransactionType +from flax.wallet.wallet_info import WalletInfo +from flax.wallet.util.transaction_type import TransactionType class PoolWallet: @@ -396,7 +396,7 @@ async def create_new_pool_wallet_transaction( ) -> Tuple[TransactionRecord, bytes32, bytes32]: """ A "plot NFT", or pool wallet, represents the idea of a set of plots that all pay to - the same pooling puzzle. This puzzle is a `chia singleton` that is + the same pooling puzzle. This puzzle is a `flax singleton` that is parameterized with a public key controlled by the user's wallet (a `smart coin`). It contains an inner puzzle that can switch between paying block rewards to a pool, or to a user's own wallet. diff --git a/chia/pools/pool_wallet_info.py b/flax/pools/pool_wallet_info.py similarity index 91% rename from chia/pools/pool_wallet_info.py rename to flax/pools/pool_wallet_info.py index 3fef25095..7820b9574 100644 --- a/chia/pools/pool_wallet_info.py +++ b/flax/pools/pool_wallet_info.py @@ -4,13 +4,13 @@ from blspy import G1Element -from chia.protocols.pool_protocol import POOL_PROTOCOL_VERSION -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.util.byte_types import hexstr_to_bytes -from chia.util.ints import uint32, uint8 -from chia.util.streamable import streamable, Streamable +from flax.protocols.pool_protocol import POOL_PROTOCOL_VERSION +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.util.byte_types import hexstr_to_bytes +from flax.util.ints import uint32, uint8 +from flax.util.streamable import streamable, Streamable class PoolSingletonState(IntEnum): 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 e60a421d1..b4ac397da 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 793dabbe9..0d17c1cfd 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 94% rename from chia/protocols/harvester_protocol.py rename to flax/protocols/harvester_protocol.py index bc4f5da8a..d41df9c3a 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 int16, uint8, uint32, 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 int16, uint8, uint32, 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 e9eeab997..caf5a487c 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 94% rename from chia/protocols/pool_protocol.py rename to flax/protocols/pool_protocol.py index 3b8678ec9..48bf463c7 100644 --- a/chia/protocols/pool_protocol.py +++ b/flax/protocols/pool_protocol.py @@ -5,10 +5,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, uint16, uint32, 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, uint16, uint32, uint64 +from flax.util.streamable import Streamable, streamable POOL_PROTOCOL_VERSION = uint8(1) 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/protocol_state_machine.py b/flax/protocols/protocol_state_machine.py similarity index 95% rename from chia/protocols/protocol_state_machine.py rename to flax/protocols/protocol_state_machine.py index 030c5da84..a14591b69 100644 --- a/chia/protocols/protocol_state_machine.py +++ b/flax/protocols/protocol_state_machine.py @@ -1,4 +1,4 @@ -from chia.protocols.protocol_message_types import ProtocolMessageTypes as pmt, ProtocolMessageTypes +from flax.protocols.protocol_message_types import ProtocolMessageTypes as pmt, ProtocolMessageTypes NO_REPLY_EXPECTED = [ # full_node -> full_node messages @@ -20,7 +20,7 @@ VALID_REPLY_MESSAGE_MAP = { # messages for all services - # pmt.handshake is handled in WSChiaConnection.perform_handshake + # pmt.handshake is handled in WSFlaxConnection.perform_handshake # full_node -> full_node protocol messages pmt.request_transaction: [pmt.respond_transaction], pmt.request_proof_of_weight: [pmt.respond_proof_of_weight], diff --git a/chia/protocols/protocol_timing.py b/flax/protocols/protocol_timing.py similarity index 100% rename from chia/protocols/protocol_timing.py rename to flax/protocols/protocol_timing.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 5b0f608f5..4c9f10ead 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.34" @@ -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 @streamable 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 6db1c32e8..326137438 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 92% rename from chia/protocols/wallet_protocol.py rename to flax/protocols/wallet_protocol.py index a96edca4b..d2bb926bc 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/py.typed b/flax/py.typed similarity index 100% rename from chia/py.typed rename to flax/py.typed diff --git a/chia/pyinstaller.spec b/flax/pyinstaller.spec similarity index 74% rename from chia/pyinstaller.spec rename to flax/pyinstaller.spec index 2e4bc0be2..47c614804 100644 --- a/chia/pyinstaller.spec +++ b/flax/pyinstaller.spec @@ -11,15 +11,15 @@ from PyInstaller.utils.hooks import collect_submodules, copy_metadata THIS_IS_WINDOWS = platform.system().lower().startswith("win") THIS_IS_MAC = platform.system().lower().startswith("darwin") -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. @@ -33,7 +33,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) @@ -50,7 +50,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 @@ -63,9 +63,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) @@ -73,11 +73,11 @@ hiddenimports.extend(keyring_imports) binaries = [ ( - f"{ROOT}/madmax/chia_plot", + f"{ROOT}/madmax/flax_plot", "madmax" ), ( - f"{ROOT}/madmax/chia_plot_k34", + f"{ROOT}/madmax/flax_plot_k34", "madmax" ) ] @@ -95,10 +95,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 = pathlib.Path(sysconfig.get_path("platlib")) / "*.dll" binaries = [ @@ -115,11 +115,11 @@ if THIS_IS_WINDOWS: ".", ), ( - f"{ROOT}\\madmax\\chia_plot.exe", + f"{ROOT}\\madmax\\flax_plot.exe", "madmax" ), ( - f"{ROOT}\\madmax\\chia_plot_k34.exe", + f"{ROOT}\\madmax\\flax_plot_k34.exe", "madmax" ), ( @@ -131,10 +131,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) @@ -184,14 +184,14 @@ 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) -add_binary("start_crawler", f"{ROOT}/chia/seeder/start_crawler.py", COLLECT_ARGS) -add_binary("start_seeder", f"{ROOT}/chia/seeder/dns_server.py", COLLECT_ARGS) +add_binary("start_crawler", f"{ROOT}/flax/seeder/start_crawler.py", COLLECT_ARGS) +add_binary("start_seeder", f"{ROOT}/flax/seeder/dns_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/crawler_rpc_api.py b/flax/rpc/crawler_rpc_api.py similarity index 94% rename from chia/rpc/crawler_rpc_api.py rename to flax/rpc/crawler_rpc_api.py index 38173e49f..0fa55ed98 100644 --- a/chia/rpc/crawler_rpc_api.py +++ b/flax/rpc/crawler_rpc_api.py @@ -1,14 +1,14 @@ import ipaddress from typing import Any, Callable, Dict, List, Optional -from chia.seeder.crawler import Crawler -from chia.util.ws_message import WsRpcMessage, create_payload_dict +from flax.seeder.crawler import Crawler +from flax.util.ws_message import WsRpcMessage, create_payload_dict class CrawlerRpcApi: def __init__(self, crawler: Crawler): self.service = crawler - self.service_name = "chia_crawler" + self.service_name = "flax_crawler" def get_routes(self) -> Dict[str, Callable]: return { diff --git a/chia/rpc/farmer_rpc_api.py b/flax/rpc/farmer_rpc_api.py similarity index 96% rename from chia/rpc/farmer_rpc_api.py rename to flax/rpc/farmer_rpc_api.py index 11aa4e747..25da1cb7b 100644 --- a/chia/rpc/farmer_rpc_api.py +++ b/flax/rpc/farmer_rpc_api.py @@ -4,14 +4,14 @@ from typing_extensions import Protocol -from chia.farmer.farmer import Farmer -from chia.plot_sync.receiver import Receiver -from chia.protocols.harvester_protocol import Plot -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.byte_types import hexstr_to_bytes -from chia.util.paginator import Paginator -from chia.util.streamable import dataclass_from_dict -from chia.util.ws_message import WsRpcMessage, create_payload_dict +from flax.farmer.farmer import Farmer +from flax.plot_sync.receiver import Receiver +from flax.protocols.harvester_protocol import Plot +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.byte_types import hexstr_to_bytes +from flax.util.paginator import Paginator +from flax.util.streamable import dataclass_from_dict +from flax.util.ws_message import WsRpcMessage, create_payload_dict class PaginatedRequestData(Protocol): @@ -67,7 +67,7 @@ def plot_matches_filter(plot: Plot, filter_item: FilterItem) -> bool: 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 91% rename from chia/rpc/farmer_rpc_client.py rename to flax/rpc/farmer_rpc_client.py index 26bb9e0c2..2db9e3bc5 100644 --- a/chia/rpc/farmer_rpc_client.py +++ b/flax/rpc/farmer_rpc_client.py @@ -1,16 +1,16 @@ from typing import Any, Dict, List, Optional -from chia.rpc.farmer_rpc_api import PlotInfoRequestData, PlotPathRequestData -from chia.rpc.rpc_client import RpcClient -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.misc import dataclass_to_json_dict +from flax.rpc.farmer_rpc_api import PlotInfoRequestData, PlotPathRequestData +from flax.rpc.rpc_client import RpcClient +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.misc import dataclass_to_json_dict 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 97% rename from chia/rpc/full_node_rpc_api.py rename to flax/rpc/full_node_rpc_api.py index f8fc83eee..5dc6b4c8f 100644 --- a/chia/rpc/full_node_rpc_api.py +++ b/flax/rpc/full_node_rpc_api.py @@ -1,22 +1,22 @@ 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.full_node.mempool_check_conditions import get_puzzle_and_solution_for_coin -from chia.types.blockchain_format.program import Program, SerializedProgram -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.coin_record import CoinRecord -from chia.types.coin_spend import CoinSpend -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.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.log_exceptions import log_exceptions -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.full_node.mempool_check_conditions import get_puzzle_and_solution_for_coin +from flax.types.blockchain_format.program import Program, SerializedProgram +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.coin_record import CoinRecord +from flax.types.coin_spend import CoinSpend +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.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.log_exceptions import log_exceptions +from flax.util.ws_message import WsRpcMessage, create_payload_dict def coin_record_dict_backwards_compat(coin_record: Dict[str, Any]): @@ -27,7 +27,7 @@ def coin_record_dict_backwards_compat(coin_record: Dict[str, Any]): 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 93% rename from chia/rpc/full_node_rpc_client.py rename to flax/rpc/full_node_rpc_client.py index 5c4dd0d29..4e8c8d283 100644 --- a/chia/rpc/full_node_rpc_client.py +++ b/flax/rpc/full_node_rpc_client.py @@ -1,17 +1,17 @@ from typing import Dict, List, Optional, Tuple, Any -from chia.consensus.block_record import BlockRecord -from chia.full_node.signage_point import SignagePoint -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.coin_spend import CoinSpend -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_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.full_node.signage_point import SignagePoint +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.coin_spend import CoinSpend +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_header_block import UnfinishedHeaderBlock +from flax.util.byte_types import hexstr_to_bytes +from flax.util.ints import uint32, uint64 def coin_record_dict_backwards_compat(coin_record: Dict[str, Any]): @@ -21,9 +21,9 @@ def coin_record_dict_backwards_compat(coin_record: Dict[str, Any]): 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 94% rename from chia/rpc/harvester_rpc_api.py rename to flax/rpc/harvester_rpc_api.py index 0a368c7c1..0ebc2527e 100644 --- a/chia/rpc/harvester_rpc_api.py +++ b/flax/rpc/harvester_rpc_api.py @@ -1,13 +1,13 @@ from typing import Any, 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 88% rename from chia/rpc/rpc_client.py rename to flax/rpc/rpc_client.py index 4e7b8f94d..f0ad7d827 100644 --- a/chia/rpc/rpc_client.py +++ b/flax/rpc/rpc_client.py @@ -4,18 +4,18 @@ import aiohttp -from chia.server.server import NodeType, 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 NodeType, 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 that provides easy access to the full node. """ diff --git a/chia/rpc/rpc_server.py b/flax/rpc/rpc_server.py similarity index 96% rename from chia/rpc/rpc_server.py rename to flax/rpc/rpc_server.py index fbd5e5072..f9e0b9be0 100644 --- a/chia/rpc/rpc_server.py +++ b/flax/rpc/rpc_server.py @@ -7,15 +7,15 @@ from aiohttp import ClientConnectorError, ClientSession, ClientWebSocketResponse, WSMsgType, web -from chia.rpc.util import wrap_http_handler -from chia.server.outbound_message import NodeType -from chia.server.server import ssl_context_for_client, 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 -from chia.util.network import select_port -from chia.util.ws_message import create_payload, create_payload_dict, format_response, pong +from flax.rpc.util import wrap_http_handler +from flax.server.outbound_message import NodeType +from flax.server.server import ssl_context_for_client, 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 +from flax.util.network import select_port +from flax.util.ws_message import create_payload, create_payload_dict, format_response, pong log = logging.getLogger(__name__) max_message_size = 50 * 1024 * 1024 # 50MB diff --git a/chia/rpc/timelord_rpc_api.py b/flax/rpc/timelord_rpc_api.py similarity index 80% rename from chia/rpc/timelord_rpc_api.py rename to flax/rpc/timelord_rpc_api.py index 9eca2aea4..f148a5dff 100644 --- a/chia/rpc/timelord_rpc_api.py +++ b/flax/rpc/timelord_rpc_api.py @@ -1,13 +1,13 @@ from typing import Any, Callable, Dict, List, Optional -from chia.timelord.timelord import Timelord -from chia.util.ws_message import WsRpcMessage, create_payload_dict +from flax.timelord.timelord import Timelord +from flax.util.ws_message import WsRpcMessage, create_payload_dict class TimelordRpcApi: def __init__(self, timelord: Timelord): self.service = timelord - self.service_name = "chia_timelord" + self.service_name = "flax_timelord" def get_routes(self) -> Dict[str, Callable]: return {} diff --git a/chia/rpc/util.py b/flax/rpc/util.py similarity index 94% rename from chia/rpc/util.py rename to flax/rpc/util.py index d1e2248ca..d4c3e9075 100644 --- a/chia/rpc/util.py +++ b/flax/rpc/util.py @@ -4,7 +4,7 @@ import aiohttp -from chia.util.json_util import obj_to_response +from flax.util.json_util import obj_to_response log = logging.getLogger(__name__) diff --git a/chia/rpc/wallet_rpc_api.py b/flax/rpc/wallet_rpc_api.py similarity index 97% rename from chia/rpc/wallet_rpc_api.py rename to flax/rpc/wallet_rpc_api.py index 814dd962d..e2898c215 100644 --- a/chia/rpc/wallet_rpc_api.py +++ b/flax/rpc/wallet_rpc_api.py @@ -7,52 +7,52 @@ from blspy import G1Element, PrivateKey -from chia.consensus.block_rewards import calculate_base_farmer_reward -from chia.pools.pool_wallet import PoolWallet -from chia.pools.pool_wallet_info import FARMING_TO_POOL, PoolState, PoolWalletInfo, create_pool_state -from chia.protocols.protocol_message_types import ProtocolMessageTypes -from chia.protocols.wallet_protocol import CoinState -from chia.server.outbound_message import NodeType, make_msg -from chia.simulator.simulator_protocol import FarmNewBlockProtocol -from chia.types.announcement import Announcement -from chia.types.blockchain_format.coin import Coin, coin_as_list -from chia.types.blockchain_format.program import Program -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.coin_spend import CoinSpend -from chia.types.spend_bundle import SpendBundle -from chia.util.bech32m import decode_puzzle_hash, encode_puzzle_hash -from chia.util.byte_types import hexstr_to_bytes -from chia.util.config import load_config -from chia.util.ints import uint8, uint32, uint64, uint16 -from chia.util.keychain import KeyringIsLocked, 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.cat_wallet.cat_constants import DEFAULT_CATS -from chia.wallet.cat_wallet.cat_wallet import CATWallet -from chia.wallet.derive_keys import ( +from flax.consensus.block_rewards import calculate_base_farmer_reward +from flax.pools.pool_wallet import PoolWallet +from flax.pools.pool_wallet_info import FARMING_TO_POOL, PoolState, PoolWalletInfo, create_pool_state +from flax.protocols.protocol_message_types import ProtocolMessageTypes +from flax.protocols.wallet_protocol import CoinState +from flax.server.outbound_message import NodeType, make_msg +from flax.simulator.simulator_protocol import FarmNewBlockProtocol +from flax.types.announcement import Announcement +from flax.types.blockchain_format.coin import Coin, coin_as_list +from flax.types.blockchain_format.program import Program +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.coin_spend import CoinSpend +from flax.types.spend_bundle import SpendBundle +from flax.util.bech32m import decode_puzzle_hash, encode_puzzle_hash +from flax.util.byte_types import hexstr_to_bytes +from flax.util.config import load_config +from flax.util.ints import uint8, uint32, uint64, uint16 +from flax.util.keychain import KeyringIsLocked, 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.cat_wallet.cat_constants import DEFAULT_CATS +from flax.wallet.cat_wallet.cat_wallet import CATWallet +from flax.wallet.derive_keys import ( MAX_POOL_WALLETS, master_sk_to_farmer_sk, master_sk_to_pool_sk, master_sk_to_singleton_owner_sk, match_address_to_sk, ) -from chia.wallet.did_wallet.did_info import DID_HRP -from chia.wallet.did_wallet.did_wallet import DIDWallet -from chia.wallet.nft_wallet import nft_puzzles -from chia.wallet.nft_wallet.nft_info import NFT_HRP, NFTInfo -from chia.wallet.nft_wallet.nft_puzzles import get_metadata_and_phs -from chia.wallet.nft_wallet.nft_wallet import NFTWallet, NFTCoinInfo -from chia.wallet.nft_wallet.uncurry_nft import UncurriedNFT -from chia.wallet.outer_puzzles import AssetType -from chia.wallet.puzzle_drivers import PuzzleInfo -from chia.wallet.rl_wallet.rl_wallet import RLWallet -from chia.wallet.trade_record import TradeRecord -from chia.wallet.trading.offer import Offer -from chia.wallet.transaction_record import TransactionRecord -from chia.wallet.util.transaction_type import TransactionType -from chia.wallet.util.wallet_types import AmountWithPuzzlehash, WalletType -from chia.wallet.wallet_info import WalletInfo -from chia.wallet.wallet_node import WalletNode +from flax.wallet.did_wallet.did_info import DID_HRP +from flax.wallet.did_wallet.did_wallet import DIDWallet +from flax.wallet.nft_wallet import nft_puzzles +from flax.wallet.nft_wallet.nft_info import NFT_HRP, NFTInfo +from flax.wallet.nft_wallet.nft_puzzles import get_metadata_and_phs +from flax.wallet.nft_wallet.nft_wallet import NFTWallet, NFTCoinInfo +from flax.wallet.nft_wallet.uncurry_nft import UncurriedNFT +from flax.wallet.outer_puzzles import AssetType +from flax.wallet.puzzle_drivers import PuzzleInfo +from flax.wallet.rl_wallet.rl_wallet import RLWallet +from flax.wallet.trade_record import TradeRecord +from flax.wallet.trading.offer import Offer +from flax.wallet.transaction_record import TransactionRecord +from flax.wallet.util.transaction_type import TransactionType +from flax.wallet.util.wallet_types import AmountWithPuzzlehash, 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 @@ -64,7 +64,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" self.balance_cache: Dict[int, Any] = {} def get_routes(self) -> Dict[str, Callable]: @@ -333,8 +333,8 @@ async def _check_key_used_for_rewards( return False, False config: Dict = load_config(new_root, "config.yaml") - farmer_target = config["farmer"].get("xch_target_address") - pool_target = config["pool"].get("xch_target_address") + farmer_target = config["farmer"].get("xfx_target_address") + pool_target = config["pool"].get("xfx_target_address") address_to_check: List[bytes32] = [decode_puzzle_hash(farmer_target), decode_puzzle_hash(pool_target)] found_addresses: Set[bytes32] = match_address_to_sk(sk, address_to_check, max_ph_to_search) @@ -609,7 +609,7 @@ async def create_new_wallet(self, request: Dict): if request["mode"] == "new": owner_puzzle_hash: bytes32 = await self.service.wallet_state_manager.main_wallet.get_puzzle_hash(True) - from chia.pools.pool_wallet_info import initial_pool_state_from_dict + from flax.pools.pool_wallet_info import initial_pool_state_from_dict async with self.service.wallet_state_manager.lock: # We assign a pseudo unique id to each pool wallet, so that each one gets its own deterministic diff --git a/chia/rpc/wallet_rpc_client.py b/flax/rpc/wallet_rpc_client.py similarity index 97% rename from chia/rpc/wallet_rpc_client.py rename to flax/rpc/wallet_rpc_client.py index 07e1161cb..0add9b021 100644 --- a/chia/rpc/wallet_rpc_client.py +++ b/flax/rpc/wallet_rpc_client.py @@ -1,16 +1,16 @@ from typing import Dict, List, Optional, Any, Tuple, Union -from chia.pools.pool_wallet_info import PoolWalletInfo -from chia.rpc.rpc_client import RpcClient -from chia.types.announcement import Announcement -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.trade_record import TradeRecord -from chia.wallet.trading.offer import Offer -from chia.wallet.transaction_record import TransactionRecord -from chia.wallet.transaction_sorting import SortKey -from chia.wallet.util.wallet_types import WalletType +from flax.pools.pool_wallet_info import PoolWalletInfo +from flax.rpc.rpc_client import RpcClient +from flax.types.announcement import Announcement +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.trade_record import TradeRecord +from flax.wallet.trading.offer import Offer +from flax.wallet.transaction_record import TransactionRecord +from flax.wallet.transaction_sorting import SortKey +from flax.wallet.util.wallet_types import WalletType def parse_result_transactions(result: Dict[str, Any]) -> Dict[str, Any]: @@ -22,9 +22,9 @@ def parse_result_transactions(result: Dict[str, Any]) -> Dict[str, Any]: 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 that provides easy access to the full node. """ diff --git a/chia/seeder/__init__.py b/flax/seeder/__init__.py similarity index 100% rename from chia/seeder/__init__.py rename to flax/seeder/__init__.py diff --git a/chia/seeder/crawl_store.py b/flax/seeder/crawl_store.py similarity index 99% rename from chia/seeder/crawl_store.py rename to flax/seeder/crawl_store.py index ccae0fc7f..7c4c930fd 100644 --- a/chia/seeder/crawl_store.py +++ b/flax/seeder/crawl_store.py @@ -8,7 +8,7 @@ import aiosqlite -from chia.seeder.peer_record import PeerRecord, PeerReliability +from flax.seeder.peer_record import PeerRecord, PeerReliability log = logging.getLogger(__name__) diff --git a/chia/seeder/crawler.py b/flax/seeder/crawler.py similarity index 95% rename from chia/seeder/crawler.py rename to flax/seeder/crawler.py index c8b2f93f2..9291fb1a8 100644 --- a/chia/seeder/crawler.py +++ b/flax/seeder/crawler.py @@ -9,16 +9,16 @@ import aiosqlite -import chia.server.ws_connection as ws -from chia.consensus.constants import ConsensusConstants -from chia.full_node.coin_store import CoinStore -from chia.protocols import full_node_protocol -from chia.seeder.crawl_store import CrawlStore -from chia.seeder.peer_record import PeerRecord, PeerReliability -from chia.server.server import ChiaServer -from chia.types.peer_info import PeerInfo -from chia.util.path import mkdir, path_from_root -from chia.util.ints import uint32, uint64 +import flax.server.ws_connection as ws +from flax.consensus.constants import ConsensusConstants +from flax.full_node.coin_store import CoinStore +from flax.protocols import full_node_protocol +from flax.seeder.crawl_store import CrawlStore +from flax.seeder.peer_record import PeerRecord, PeerReliability +from flax.server.server import FlaxServer +from flax.types.peer_info import PeerInfo +from flax.util.path import mkdir, path_from_root +from flax.util.ints import uint32, uint64 log = logging.getLogger(__name__) @@ -28,7 +28,7 @@ class Crawler: coin_store: CoinStore connection: aiosqlite.Connection config: Dict - server: Optional[ChiaServer] + server: Optional[FlaxServer] crawl_store: Optional[CrawlStore] log: logging.Logger constants: ConsensusConstants @@ -82,7 +82,7 @@ async def create_client(self, peer_info, on_connect): return await self.server.start_client(peer_info, on_connect) async def connect_task(self, peer): - async def peer_action(peer: ws.WSChiaConnection): + async def peer_action(peer: ws.WSFlaxConnection): peer_info = peer.get_peer_info() version = peer.get_version() @@ -323,14 +323,14 @@ async def crawl(self): except Exception as e: self.log.error(f"Exception: {e}. Traceback: {traceback.format_exc()}.") - def set_server(self, server: ChiaServer): + def set_server(self, server: FlaxServer): self.server = server def _state_changed(self, change: str): if self.state_changed_callback is not None: self.state_changed_callback(change) - 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): try: peer_info = peer.get_peer_info() tls_version = peer.get_tls_version() @@ -345,7 +345,7 @@ async def new_peak(self, request: full_node_protocol.NewPeak, peer: ws.WSChiaCon except Exception as e: self.log.error(f"Exception: {e}. Traceback: {traceback.format_exc()}.") - async def on_connect(self, connection: ws.WSChiaConnection): + async def on_connect(self, connection: ws.WSFlaxConnection): pass def _close(self): diff --git a/chia/seeder/crawler_api.py b/flax/seeder/crawler_api.py similarity index 87% rename from chia/seeder/crawler_api.py rename to flax/seeder/crawler_api.py index 8efe415d2..254501293 100644 --- a/chia/seeder/crawler_api.py +++ b/flax/seeder/crawler_api.py @@ -1,10 +1,10 @@ from typing import Optional -import chia.server.ws_connection as ws -from chia.full_node.full_node import full_node_protocol, wallet_protocol -from chia.seeder.crawler import Crawler -from chia.server.outbound_message import Message -from chia.util.api_decorators import api_request, peer_required +import flax.server.ws_connection as ws +from flax.full_node.full_node import full_node_protocol, wallet_protocol +from flax.seeder.crawler import Crawler +from flax.server.outbound_message import Message +from flax.util.api_decorators import api_request, peer_required class CrawlerAPI: @@ -29,19 +29,19 @@ def log(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): pass @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]: pass @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]: await self.crawler.new_peak(request, peer) return None @@ -52,7 +52,7 @@ async def new_transaction(self, transaction: full_node_protocol.NewTransaction) @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]: pass @@ -64,7 +64,7 @@ async def new_unfinished_block( @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): pass @api_request @@ -100,7 +100,7 @@ async def request_signage_point_or_end_of_sub_slot( async def request_mempool_transactions( self, request: full_node_protocol.RequestMempoolTransactions, - peer: ws.WSChiaConnection, + peer: ws.WSFlaxConnection, ) -> Optional[Message]: pass diff --git a/chia/seeder/dns_server.py b/flax/seeder/dns_server.py similarity index 98% rename from chia/seeder/dns_server.py rename to flax/seeder/dns_server.py index 85466cadf..6a70aeddd 100644 --- a/chia/seeder/dns_server.py +++ b/flax/seeder/dns_server.py @@ -10,10 +10,10 @@ import aiosqlite from dnslib import A, AAAA, SOA, NS, MX, CNAME, RR, DNSRecord, QTYPE, DNSHeader -from chia.util.chia_logging import initialize_logging -from chia.util.path import mkdir, path_from_root -from chia.util.config import load_config -from chia.util.default_root import DEFAULT_ROOT_PATH +from flax.util.flax_logging import initialize_logging +from flax.util.path import mkdir, path_from_root +from flax.util.config import load_config +from flax.util.default_root import DEFAULT_ROOT_PATH SERVICE_NAME = "seeder" log = logging.getLogger(__name__) diff --git a/chia/seeder/peer_record.py b/flax/seeder/peer_record.py similarity index 98% rename from chia/seeder/peer_record.py rename to flax/seeder/peer_record.py index 2a6f8dde4..cbdcf329c 100644 --- a/chia/seeder/peer_record.py +++ b/flax/seeder/peer_record.py @@ -2,8 +2,8 @@ import time from dataclasses import dataclass -from chia.util.ints import uint32, uint64 -from chia.util.streamable import Streamable, streamable +from flax.util.ints import uint32, uint64 +from flax.util.streamable import Streamable, streamable @streamable diff --git a/chia/seeder/start_crawler.py b/flax/seeder/start_crawler.py similarity index 77% rename from chia/seeder/start_crawler.py rename to flax/seeder/start_crawler.py index bd1062cf8..359336858 100644 --- a/chia/seeder/start_crawler.py +++ b/flax/seeder/start_crawler.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.rpc.crawler_rpc_api import CrawlerRpcApi -from chia.seeder.crawler import Crawler -from chia.seeder.crawler_api import CrawlerAPI -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.rpc.crawler_rpc_api import CrawlerRpcApi +from flax.seeder.crawler import Crawler +from flax.seeder.crawler_api import CrawlerAPI +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/__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_sqlite_store.py b/flax/server/address_manager_sqlite_store.py similarity index 95% rename from chia/server/address_manager_sqlite_store.py rename to flax/server/address_manager_sqlite_store.py index c62bd5554..16e98305f 100644 --- a/chia/server/address_manager_sqlite_store.py +++ b/flax/server/address_manager_sqlite_store.py @@ -1,6 +1,6 @@ import aiosqlite -from chia.server.address_manager import AddressManager, ExtendedPeerInfo, NEW_BUCKETS_PER_ADDRESS +from flax.server.address_manager import AddressManager, ExtendedPeerInfo, NEW_BUCKETS_PER_ADDRESS from pathlib import Path from typing import Dict, List, Optional, Tuple @@ -14,7 +14,7 @@ async def create_address_manager_from_db(db_path: Path) -> Optional[AddressManag """ async with aiosqlite.connect(db_path) as connection: await connection.execute("pragma journal_mode=wal") - await connection.execute("pragma synchronous=OFF") + pass # await connection.execute("pragma synchronous=OFF") # Prevent DB corruption by avoiding ill-advised synchronous optimization. metadata: Dict[str, str] = await get_metadata(connection) address_manager: Optional[AddressManager] = None diff --git a/chia/server/address_manager_store.py b/flax/server/address_manager_store.py similarity index 97% rename from chia/server/address_manager_store.py rename to flax/server/address_manager_store.py index 25069133c..dbe31448f 100644 --- a/chia/server/address_manager_store.py +++ b/flax/server/address_manager_store.py @@ -2,17 +2,17 @@ import asyncio import logging -from chia.server.address_manager import ( +from flax.server.address_manager import ( BUCKET_SIZE, NEW_BUCKET_COUNT, NEW_BUCKETS_PER_ADDRESS, AddressManager, ExtendedPeerInfo, ) -from chia.util.files import write_file_async -from chia.util.ints import uint64 -from chia.util.path import mkdir -from chia.util.streamable import streamable, Streamable +from flax.util.files import write_file_async +from flax.util.ints import uint64 +from flax.util.path import mkdir +from flax.util.streamable import streamable, Streamable from dataclasses import dataclass from pathlib import Path from timeit import default_timer as timer 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 4e88e63f7..f619d0d19 100644 --- a/chia/server/node_discovery.py +++ b/flax/server/node_discovery.py @@ -7,25 +7,25 @@ from typing import Dict, Optional, List, Set -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.address_manager_sqlite_store import create_address_manager_from_db -from chia.server.outbound_message import NodeType, make_msg -from chia.server.peer_store_resolver import PeerStoreResolver -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 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.address_manager_sqlite_store import create_address_manager_from_db +from flax.server.outbound_message import NodeType, make_msg +from flax.server.peer_store_resolver import PeerStoreResolver +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 MAX_PEERS_RECEIVED_PER_REQUEST = 1000 MAX_TOTAL_PEERS_RECEIVED = 3000 MAX_CONCURRENT_OUTBOUND_CONNECTIONS = 70 NETWORK_ID_DEFAULT_PORTS = { - "mainnet": 8444, + "mainnet": 6888, "testnet7": 58444, "testnet10": 58444, "testnet8": 58445, @@ -37,7 +37,7 @@ class FullNodeDiscovery: def __init__( self, - server: ChiaServer, + server: FlaxServer, target_outbound_count: int, peer_store_resolver: PeerStoreResolver, introducer_info: Optional[Dict], @@ -47,7 +47,7 @@ def __init__( default_port: Optional[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 @@ -138,7 +138,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 @@ -165,7 +165,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 @@ -203,7 +203,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) @@ -236,7 +236,7 @@ async def _query_dns(self, dns_address): except Exception as e: self.log.warn(f"querying DNS introducer failed: {e}") - async def on_connect_callback(self, peer: ws.WSChiaConnection): + async def on_connect_callback(self, peer: ws.WSFlaxConnection): if self.server.on_connect is not None: await self.server.on_connect(peer) else: 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 ba55ca7b8..208aab5f1 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/peer_store_resolver.py b/flax/server/peer_store_resolver.py similarity index 100% rename from chia/server/peer_store_resolver.py rename to flax/server/peer_store_resolver.py diff --git a/chia/server/rate_limits.py b/flax/server/rate_limits.py similarity index 99% rename from chia/server/rate_limits.py rename to flax/server/rate_limits.py index b70c04b0f..d42c03fd3 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 85% rename from chia/server/reconnect_task.py rename to flax/server/reconnect_task.py index 513fab7bb..8639ba6cf 100644 --- a/chia/server/reconnect_task.py +++ b/flax/server/reconnect_task.py @@ -2,12 +2,12 @@ from typing import Optional -from chia.server.server import ChiaServer -from chia.types.peer_info import PeerInfo -from chia.util.network import get_host_addr +from flax.server.server import FlaxServer +from flax.types.peer_info import PeerInfo +from flax.util.network import get_host_addr -def start_reconnect_task(server: ChiaServer, peer_info_arg: PeerInfo, log, auth: bool, prefer_ipv6: Optional[bool]): +def start_reconnect_task(server: FlaxServer, peer_info_arg: PeerInfo, log, auth: bool, prefer_ipv6: Optional[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 f8c88976a..a831a7d03 100644 --- a/chia/server/server.py +++ b/flax/server/server.py @@ -18,20 +18,20 @@ 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.protocol_state_machine import message_requires_reply -from chia.protocols.protocol_timing import API_EXCEPTION_BAN_SECONDS, INVALID_PROTOCOL_BAN_SECONDS -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_in_network, is_localhost, select_port -from chia.util.ssl_check import verify_ssl_certs_and_keys +from flax.protocols.protocol_message_types import ProtocolMessageTypes +from flax.protocols.protocol_state_machine import message_requires_reply +from flax.protocols.protocol_timing import API_EXCEPTION_BAN_SECONDS, INVALID_PROTOCOL_BAN_SECONDS +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_in_network, is_localhost, select_port +from flax.util.ssl_check import verify_ssl_certs_and_keys max_message_size = 50 * 1024 * 1024 # 50MB @@ -99,7 +99,7 @@ def ssl_context_for_client( return ssl_context -class ChiaServer: +class FlaxServer: def __init__( self, port: int, @@ -113,16 +113,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: {}, @@ -163,7 +163,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: Optional[asyncio.Task] = None @@ -208,7 +208,7 @@ async def garbage_collect_connections_task(self) -> None: is_crawler = getattr(self.node, "crawl", None) while True: await asyncio.sleep(600 if is_crawler is None else 2) - to_remove: List[WSChiaConnection] = [] + to_remove: List[WSFlaxConnection] = [] for connection in self.all_connections.values(): if ( self._local_type == NodeType.FULL_NODE or self._local_type == NodeType.WALLET @@ -260,7 +260,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, log=self.log + self.flax_ca_crt_path, self.flax_ca_key_path, self.p2p_crt_path, self.p2p_key_path, log=self.log ) # If self._port is set to zero, the socket will bind to a new available port. Therefore, we have to obtain @@ -297,9 +297,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, @@ -364,7 +364,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: @@ -413,10 +413,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: # Crawler/DNS introducer usually uses a lower timeout than the default timeout_value = float(self.config.get("peer_connect_timeout", 30)) @@ -452,7 +452,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, @@ -509,7 +509,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 @@ -558,7 +558,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): nonlocal message_types start_time = time.time() message_type = "" @@ -653,7 +653,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: @@ -696,7 +696,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: @@ -704,7 +704,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: @@ -712,10 +712,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, node_type: Optional[NodeType] = None) -> List[WSChiaConnection]: + def get_connections(self, node_type: Optional[NodeType] = None) -> List[WSFlaxConnection]: result = [] for _, connection in self.all_connections.items(): if node_type is None or connection.connection_type == node_type: @@ -763,11 +763,11 @@ async def get_peer_info(self) -> Optional[PeerInfo]: ip = None port = self._port - # Use chia's service first. + # Use flax's service first. try: timeout = ClientTimeout(total=15) async with ClientSession(timeout=timeout) as session: - async with session.get("https://ip.chia.net/") as resp: + async with session.get("https://ip.flaxnetwork.org/") as resp: if resp.status == 200: ip = str(await resp.text()) ip = ip.rstrip() @@ -809,7 +809,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 if not self.config["testing"] and peer.peer_host == "127.0.0.1": 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 90c37cab2..0024ce5b8 100644 --- a/chia/server/start_farmer.py +++ b/flax/server/start_farmer.py @@ -1,17 +1,17 @@ import pathlib from typing import Dict, Optional -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 92% rename from chia/server/start_service.py rename to flax/server/start_service.py index cc5bf6d59..9bda6e3d2 100644 --- a/chia/server/start_service.py +++ b/flax/server/start_service.py @@ -7,23 +7,23 @@ from sys import platform from typing import Any, Callable, List, Optional, Tuple -from chia.daemon.server import singleton, service_launch_lock_path -from chia.server.ssl_context import chia_ssl_ca_paths, private_ssl_ca_paths +from flax.daemon.server import singleton, service_launch_lock_path +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 @@ -74,7 +74,7 @@ def __init__( # when we start this service as a component of an existing process, # don't change its proctitle if running_new_process: - proctitle_name = f"chia_{service_name_prefix}{service_name}" + proctitle_name = f"flax_{service_name_prefix}{service_name}" setproctitle(proctitle_name) self._log = logging.getLogger(service_name) @@ -90,7 +90,7 @@ 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") if node_type == NodeType.WALLET: @@ -98,7 +98,7 @@ def __init__( outbound_rlp = 60 assert inbound_rlp and outbound_rlp - self._server = ChiaServer( + self._server = FlaxServer( advertised_port, node, peer_api, @@ -110,7 +110,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) @@ -260,7 +260,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 dcb15deb4..9f8faea4d 100644 --- a/chia/server/start_timelord.py +++ b/flax/server/start_timelord.py @@ -2,16 +2,16 @@ import pathlib from typing import Dict -from chia.consensus.constants import ConsensusConstants -from chia.consensus.default_constants import DEFAULT_CONSTANTS -from chia.rpc.timelord_rpc_api import TimelordRpcApi -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.rpc.timelord_rpc_api import TimelordRpcApi +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 82% rename from chia/server/start_wallet.py rename to flax/server/start_wallet.py index e888e3dbc..c63375d4b 100644 --- a/chia/server/start_wallet.py +++ b/flax/server/start_wallet.py @@ -2,19 +2,19 @@ from multiprocessing import freeze_support from typing import Dict, Optional -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.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.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 94% rename from chia/server/upnp.py rename to flax/server/upnp.py index 706a84d20..4c7cb1204 100644 --- a/chia/server/upnp.py +++ b/flax/server/upnp.py @@ -33,7 +33,7 @@ def run(): self.upnp.deleteportmapping(port, "TCP") except Exception as e: log.info(f"Removal of previous portmapping failed. This does not indicate an error: {e}") - 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()}" @@ -47,7 +47,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 3c8d9c7f9..4503329e0 100644 --- a/chia/server/ws_connection.py +++ b/flax/server/ws_connection.py @@ -7,25 +7,25 @@ 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.protocol_state_machine import message_response_ok -from chia.protocols.protocol_timing import INTERNAL_PROTOCOL_ERROR_BAN_SECONDS -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.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.protocol_state_machine import message_response_ok +from flax.protocols.protocol_timing import INTERNAL_PROTOCOL_ERROR_BAN_SECONDS +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.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 @@ -72,7 +72,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 @@ -105,7 +105,7 @@ def __init__( self.outbound_rate_limiter = RateLimiter(incoming=False, percentage_of_limit=outbound_rate_limit_percent) self.inbound_rate_limiter = RateLimiter(incoming=True, percentage_of_limit=inbound_rate_limit_percent) - # Used by the Chia Seeder. + # Used by the Flax Seeder. self.version = None self.protocol_version = "" @@ -120,9 +120,9 @@ async def perform_handshake( 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")], @@ -144,7 +144,7 @@ async def perform_handshake( if 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) self.version = inbound_handshake.software_version @@ -171,14 +171,14 @@ async def perform_handshake( raise ProtocolError(Err.INVALID_HANDSHAKE) inbound_handshake = Handshake.from_bytes(message.data) - 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")], @@ -484,7 +484,7 @@ async def _read_one_message(self) -> Optional[Message]: await asyncio.sleep(3) return None - # Used by the Chia Seeder. + # Used by the Flax Seeder. def get_version(self): return self.version diff --git a/chia/simulator/SimulatorFullNodeRpcApi.py b/flax/simulator/SimulatorFullNodeRpcApi.py similarity index 77% rename from chia/simulator/SimulatorFullNodeRpcApi.py rename to flax/simulator/SimulatorFullNodeRpcApi.py index ff5700a01..d920b1fe8 100644 --- a/chia/simulator/SimulatorFullNodeRpcApi.py +++ b/flax/simulator/SimulatorFullNodeRpcApi.py @@ -1,8 +1,8 @@ from typing import Any, Dict, Optional -from chia.rpc.full_node_rpc_api import FullNodeRpcApi -from chia.simulator.simulator_protocol import FarmNewBlockProtocol -from chia.util.bech32m import decode_puzzle_hash +from flax.rpc.full_node_rpc_api import FullNodeRpcApi +from flax.simulator.simulator_protocol import FarmNewBlockProtocol +from flax.util.bech32m import decode_puzzle_hash class SimulatorFullNodeRpcApi(FullNodeRpcApi): 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 3b2a1748e..72dfd98b8 100644 --- a/chia/simulator/full_node_simulator.py +++ b/flax/simulator/full_node_simulator.py @@ -1,13 +1,13 @@ from typing import List, Optional -from chia.consensus.block_record import BlockRecord -from chia.consensus.multiprocess_validation import PreValidationResult -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.consensus.multiprocess_validation import PreValidationResult +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 88% rename from chia/simulator/simulator_constants.py rename to flax/simulator/simulator_constants.py index ae09b6a34..c5a65e3de 100644 --- a/chia/simulator/simulator_constants.py +++ b/flax/simulator/simulator_constants.py @@ -1,7 +1,7 @@ if __name__ == "__main__": from tests.block_tools import create_block_tools, test_constants from tests.util.keyring import TempKeyring - from chia.util.default_root import DEFAULT_ROOT_PATH + from flax.util.default_root import DEFAULT_ROOT_PATH with TempKeyring() as keychain: # TODO: mariano: fix this with new consensus 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 29d8492d1..00d9a3b7e 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 @streamable diff --git a/chia/simulator/start_simulator.py b/flax/simulator/start_simulator.py similarity index 84% rename from chia/simulator/start_simulator.py rename to flax/simulator/start_simulator.py index 6c1a2e76d..ebcd01f0d 100644 --- a/chia/simulator/start_simulator.py +++ b/flax/simulator/start_simulator.py @@ -3,17 +3,17 @@ from multiprocessing import freeze_support from typing import Dict -from chia.full_node.full_node import FullNode -from chia.server.outbound_message import NodeType -from chia.server.start_service import run_service -from chia.simulator.SimulatorFullNodeRpcApi import SimulatorFullNodeRpcApi -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.server.outbound_message import NodeType +from flax.server.start_service import run_service +from flax.simulator.SimulatorFullNodeRpcApi import SimulatorFullNodeRpcApi +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 tests.block_tools import BlockTools, create_block_tools, test_constants from tests.util.keyring import TempKeyring -from chia.simulator.full_node_simulator import FullNodeSimulator +from flax.simulator.full_node_simulator import FullNodeSimulator # See: https://bugs.python.org/issue29288 "".encode("idna") diff --git a/chia/ssl/__init__.py b/flax/ssl/__init__.py similarity index 100% rename from chia/ssl/__init__.py rename to flax/ssl/__init__.py diff --git a/chia/ssl/create_ssl.py b/flax/ssl/create_ssl.py similarity index 86% rename from chia/ssl/create_ssl.py rename to flax/ssl/create_ssl.py index 98594ac09..7a365b84e 100644 --- a/chia/ssl/create_ssl.py +++ b/flax/ssl/create_ssl.py @@ -4,7 +4,7 @@ from typing import Any, List, Tuple import pkg_resources -from chia.util.ssl_check import DEFAULT_PERMISSIONS_CERT_FILE, DEFAULT_PERMISSIONS_KEY_FILE +from flax.util.ssl_check import DEFAULT_PERMISSIONS_CERT_FILE, DEFAULT_PERMISSIONS_KEY_FILE from cryptography import x509 from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives import hashes, serialization @@ -13,9 +13,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 @@ -53,8 +53,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"), ] ) @@ -68,7 +68,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()) @@ -88,8 +88,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"), ] ) @@ -116,7 +116,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 ea1202c9b..a6bc6938d 100644 --- a/chia/timelord/timelord.py +++ b/flax/timelord/timelord.py @@ -12,31 +12,31 @@ from chiavdf import create_discriminant, prove -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.config import process_config_start_method -from chia.util.ints import uint8, uint16, uint32, uint64, uint128 -from chia.util.setproctitle import getproctitle, setproctitle -from chia.util.streamable import Streamable, streamable +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.config import process_config_start_method +from flax.util.ints import uint8, uint16, uint32, uint64, uint128 +from flax.util.setproctitle import getproctitle, setproctitle +from flax.util.streamable import Streamable, streamable log = logging.getLogger(__name__) @@ -68,7 +68,7 @@ def __init__(self, root_path, config: Dict, constants: ConsensusConstants): self._shut_down = False self.free_clients: List[Tuple[str, asyncio.StreamReader, asyncio.StreamWriter]] = [] 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. @@ -175,7 +175,7 @@ def state_changed(self, change: str, change_data: Optional[Dict[str, Any]] = Non if self.state_changed_callback is not None: self.state_changed_callback(change, change_data) - 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 e6d1e810c..6d93c6a63 100644 --- a/chia/timelord/timelord_api.py +++ b/flax/timelord/timelord_api.py @@ -2,10 +2,10 @@ import time 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 92% rename from chia/timelord/timelord_launcher.py rename to flax/timelord/timelord_launcher.py index 657cb6eb1..c0983e055 100644 --- a/chia/timelord/timelord_launcher.py +++ b/flax/timelord/timelord_launcher.py @@ -8,11 +8,11 @@ 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.network import get_host_addr -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.network import get_host_addr +from flax.util.setproctitle import setproctitle active_processes: List = [] stopped = False @@ -114,7 +114,7 @@ def main(): log.info("Timelord launcher not supported on Windows.") return 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 6431d336b..4feb325c0 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 85% rename from chia/types/announcement.py rename to flax/types/announcement.py index d4324f0bd..7b875821b 100644 --- a/chia/types/announcement.py +++ b/flax/types/announcement.py @@ -1,8 +1,8 @@ from dataclasses import dataclass from typing import Optional -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/block_protocol.py b/flax/types/block_protocol.py similarity index 69% rename from chia/types/block_protocol.py rename to flax/types/block_protocol.py index 47ed24f3f..935cb27a0 100644 --- a/chia/types/block_protocol.py +++ b/flax/types/block_protocol.py @@ -2,9 +2,9 @@ from typing_extensions import Protocol -from chia.types.blockchain_format.program import SerializedProgram -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.ints import uint32 +from flax.types.blockchain_format.program import SerializedProgram +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.ints import uint32 class BlockInfo(Protocol): 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 10a83e93e..4a77fce93 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 @streamable diff --git a/chia/types/blockchain_format/coin.py b/flax/types/blockchain_format/coin.py similarity index 90% rename from chia/types/blockchain_format/coin.py rename to flax/types/blockchain_format/coin.py index a638c3853..46e07d2e8 100644 --- a/chia/types/blockchain_format/coin.py +++ b/flax/types/blockchain_format/coin.py @@ -3,10 +3,10 @@ from clvm.casts import int_to_bytes -from chia.types.blockchain_format.sized_bytes import bytes32 -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.hash import std_hash +from flax.util.ints import uint64 +from flax.util.streamable import Streamable, streamable @streamable 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 412e40ba3..dcd5af77a 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 @streamable 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 6d9b126d7..43d97ca75 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 @streamable diff --git a/chia/types/blockchain_format/program.py b/flax/types/blockchain_format/program.py similarity index 97% rename from chia/types/blockchain_format/program.py rename to flax/types/blockchain_format/program.py index 489e1146e..901c8e336 100644 --- a/chia/types/blockchain_format/program.py +++ b/flax/types/blockchain_format/program.py @@ -8,10 +8,10 @@ from chia_rs import MEMPOOL_MODE, run_chia_program, serialized_length, run_generator from clvm_tools.curry import uncurry -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.hash import std_hash -from chia.util.byte_types import hexstr_to_bytes -from chia.types.spend_bundle_conditions import SpendBundleConditions, Spend +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.hash import std_hash +from flax.util.byte_types import hexstr_to_bytes +from flax.types.spend_bundle_conditions import SpendBundleConditions, Spend 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 94% rename from chia/types/blockchain_format/proof_of_space.py rename to flax/types/blockchain_format/proof_of_space.py index f9d1fc8bd..b5644ab09 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, AugSchemeMPL, PrivateKey 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 515d032c0..a159705cb 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 @streamable diff --git a/chia/types/blockchain_format/sized_bytes.py b/flax/types/blockchain_format/sized_bytes.py similarity index 87% rename from chia/types/blockchain_format/sized_bytes.py rename to flax/types/blockchain_format/sized_bytes.py index c2775a176..17ac4090d 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 SizedBytes +from flax.util.byte_types import SizedBytes class bytes4(SizedBytes): 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 a230dcf04..264d969cb 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 @streamable 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 6a1fc89fa..6f5925955 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 @streamable 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 55b47595b..fed5c9b06 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 78% rename from chia/types/coin_record.py rename to flax/types/coin_record.py index b195ad3de..7dd01c126 100644 --- a/chia/types/coin_record.py +++ b/flax/types/coin_record.py @@ -1,11 +1,11 @@ from dataclasses import dataclass from typing import Optional -from chia.protocols.wallet_protocol import CoinState -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.protocols.wallet_protocol import CoinState +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 @streamable diff --git a/chia/types/coin_solution.py b/flax/types/coin_solution.py similarity index 100% rename from chia/types/coin_solution.py rename to flax/types/coin_solution.py diff --git a/chia/types/coin_spend.py b/flax/types/coin_spend.py similarity index 80% rename from chia/types/coin_spend.py rename to flax/types/coin_spend.py index 9efc6aece..270dab710 100644 --- a/chia/types/coin_spend.py +++ b/flax/types/coin_spend.py @@ -1,9 +1,9 @@ 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, fee_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, fee_for_solution +from flax.util.streamable import Streamable, streamable @streamable 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 1f7c7426f..c943f6d27 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): # AGG_SIG is ascii "1" 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 5f0dbce11..6e6ea43e0 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 @streamable 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 72d708f5e..02c9fa6ed 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 @streamable diff --git a/chia/types/full_block.py b/flax/types/full_block.py similarity index 85% rename from chia/types/full_block.py rename to flax/types/full_block.py index 086fb6ea7..8190a6588 100644 --- a/chia/types/full_block.py +++ b/flax/types/full_block.py @@ -1,14 +1,14 @@ 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.sized_bytes import bytes32 -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.sized_bytes import bytes32 +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 @streamable diff --git a/chia/types/generator_types.py b/flax/types/generator_types.py similarity index 82% rename from chia/types/generator_types.py rename to flax/types/generator_types.py index 7b86520bf..267b9c16f 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 e0b44abd2..536072705 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 @streamable 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 dfd588a7e..16754cf27 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 @streamable diff --git a/chia/types/mempool_submission_status.py b/flax/types/mempool_submission_status.py similarity index 84% rename from chia/types/mempool_submission_status.py rename to flax/types/mempool_submission_status.py index 9ba1d5c70..93a5b3f30 100644 --- a/chia/types/mempool_submission_status.py +++ b/flax/types/mempool_submission_status.py @@ -1,9 +1,9 @@ from dataclasses import dataclass from typing import Dict, Optional, Union -from chia.types.mempool_inclusion_status import MempoolInclusionStatus -from chia.util.ints import uint8 -from chia.util.streamable import Streamable, streamable +from flax.types.mempool_inclusion_status import MempoolInclusionStatus +from flax.util.ints import uint8 +from flax.util.streamable import Streamable, streamable @streamable 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 7435cb180..da42e5a9a 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 @streamable 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 5c003838a..27d28d476 100644 --- a/chia/types/spend_bundle.py +++ b/flax/types/spend_bundle.py @@ -6,11 +6,11 @@ from blspy import AugSchemeMPL, G2Element -from chia.consensus.default_constants import DEFAULT_CONSTANTS -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.streamable import Streamable, dataclass_from_dict, recurse_jsonify, streamable -from chia.wallet.util.debug_spend_bundle import debug_spend_bundle +from flax.consensus.default_constants import DEFAULT_CONSTANTS +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.streamable import Streamable, dataclass_from_dict, recurse_jsonify, streamable +from flax.wallet.util.debug_spend_bundle import debug_spend_bundle from .coin_spend import CoinSpend diff --git a/chia/types/spend_bundle_conditions.py b/flax/types/spend_bundle_conditions.py similarity index 81% rename from chia/types/spend_bundle_conditions.py rename to flax/types/spend_bundle_conditions.py index 4fa715f44..6d64f09e7 100644 --- a/chia/types/spend_bundle_conditions.py +++ b/flax/types/spend_bundle_conditions.py @@ -1,9 +1,9 @@ from dataclasses import dataclass from typing import List, Optional, Tuple -from chia.types.blockchain_format.sized_bytes import bytes32, bytes48 -from chia.util.ints import uint32, uint64 -from chia.util.streamable import Streamable, streamable +from flax.types.blockchain_format.sized_bytes import bytes32, bytes48 +from flax.util.ints import uint32, uint64 +from flax.util.streamable import Streamable, streamable # the Spend and SpendBundleConditions classes are mirrors of native types, returned by diff --git a/chia/types/transaction_queue_entry.py b/flax/types/transaction_queue_entry.py similarity index 76% rename from chia/types/transaction_queue_entry.py rename to flax/types/transaction_queue_entry.py index 9fe237161..62c240108 100644 --- a/chia/types/transaction_queue_entry.py +++ b/flax/types/transaction_queue_entry.py @@ -1,9 +1,9 @@ from dataclasses import dataclass from typing import Optional -from chia.server.ws_connection import WSChiaConnection -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.spend_bundle import SpendBundle +from flax.server.ws_connection import WSFlaxConnection +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.spend_bundle import SpendBundle @dataclass(frozen=True) @@ -15,7 +15,7 @@ class TransactionQueueEntry: transaction: SpendBundle transaction_bytes: Optional[bytes] spend_name: bytes32 - peer: Optional[WSChiaConnection] + peer: Optional[WSFlaxConnection] test: bool def __lt__(self, other): 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 da110a66c..ae8745992 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 @streamable 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 da6f3b436..856b9975a 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 @streamable 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 47f5b9118..c600caea6 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 @streamable 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 b51ac7dbe..fedec70a4 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 e760cfaf8..c453577c6 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, Iterable, 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 a07dc2081..2f85c7358 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/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/cached_bls.py b/flax/util/cached_bls.py similarity index 94% rename from chia/util/cached_bls.py rename to flax/util/cached_bls.py index 0aa7bf7d3..a4239e251 100644 --- a/chia/util/cached_bls.py +++ b/flax/util/cached_bls.py @@ -3,9 +3,9 @@ from blspy import AugSchemeMPL, G1Element, G2Element, GTElement -from chia.types.blockchain_format.sized_bytes import bytes48 -from chia.util.hash import std_hash -from chia.util.lru_cache import LRUCache +from flax.types.blockchain_format.sized_bytes import bytes48 +from flax.util.hash import std_hash +from flax.util.lru_cache import LRUCache def get_pairings(cache: LRUCache, pks: List[bytes48], msgs: Sequence[bytes], force_cache: bool) -> List[GTElement]: diff --git a/chia/util/chain_utils.py b/flax/util/chain_utils.py similarity index 78% rename from chia/util/chain_utils.py rename to flax/util/chain_utils.py index e88a686c4..1f558a97c 100644 --- a/chia/util/chain_utils.py +++ b/flax/util/chain_utils.py @@ -2,11 +2,11 @@ from clvm.casts import int_from_bytes -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.condition_opcodes import ConditionOpcode -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.types.condition_opcodes import ConditionOpcode +from flax.util.condition_tools import ( conditions_dict_for_solution, created_outputs_for_conditions_dict, ) diff --git a/chia/util/check_fork_next_block.py b/flax/util/check_fork_next_block.py similarity index 91% rename from chia/util/check_fork_next_block.py rename to flax/util/check_fork_next_block.py index 0a6945fcc..ff46072d8 100644 --- a/chia/util/check_fork_next_block.py +++ b/flax/util/check_fork_next_block.py @@ -1,7 +1,7 @@ from typing import List, Callable -from chia.consensus.blockchain_interface import BlockchainInterface -from chia.util.ints import uint32 +from flax.consensus.blockchain_interface import BlockchainInterface +from flax.util.ints import uint32 async def check_fork_next_block( diff --git a/chia/util/chunks.py b/flax/util/chunks.py similarity index 100% rename from chia/util/chunks.py rename to flax/util/chunks.py diff --git a/chia/util/condition_tools.py b/flax/util/condition_tools.py similarity index 88% rename from chia/util/condition_tools.py rename to flax/util/condition_tools.py index 8d756ccd9..51beeea2d 100644 --- a/chia/util/condition_tools.py +++ b/flax/util/condition_tools.py @@ -2,14 +2,14 @@ from clvm.casts import int_from_bytes -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, bytes48 -from chia.types.condition_opcodes import ConditionOpcode -from chia.types.condition_with_args import ConditionWithArgs -from chia.util.errors import ConsensusError, Err -from chia.util.ints import uint64 -from chia.types.spend_bundle_conditions import SpendBundleConditions +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, bytes48 +from flax.types.condition_opcodes import ConditionOpcode +from flax.types.condition_with_args import ConditionWithArgs +from flax.util.errors import ConsensusError, Err +from flax.util.ints import uint64 +from flax.types.spend_bundle_conditions import SpendBundleConditions # TODO: review each `assert` and consider replacing with explicit checks # since asserts can be stripped with python `-OO` flag @@ -19,7 +19,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() @@ -34,7 +34,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 98% rename from chia/util/config.py rename to flax/util/config.py index 199f967be..af5739c5f 100644 --- a/chia/util/config.py +++ b/flax/util/config.py @@ -16,7 +16,7 @@ from filelock import FileLock from typing_extensions import Literal -from chia.util.path import mkdir +from flax.util.path import mkdir PEER_DB_PATH_KEY_DEPRECATED = "peer_db_path" # replaced by "peers_file_path" WALLET_PEERS_PATH_KEY_DEPRECATED = "wallet_peers_path" # replaced by "wallet_peers_file_path" @@ -28,7 +28,7 @@ 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, filenames=["config.yaml"]) -> None: +def create_default_flax_config(root_path: Path, filenames=["config.yaml"]) -> None: for filename in filenames: default_config_file_data: str = initial_config_file(filename) path: Path = config_path_for_filename(root_path, filename) @@ -110,7 +110,7 @@ def _load_config_maybe_locked( 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) # This loop should not be necessary due to the config lock, but it's kept here just in case 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_synchronous.py b/flax/util/db_synchronous.py similarity index 100% rename from chia/util/db_synchronous.py rename to flax/util/db_synchronous.py diff --git a/chia/util/db_version.py b/flax/util/db_version.py similarity index 100% rename from chia/util/db_version.py rename to flax/util/db_version.py 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..aa7e678dc --- /dev/null +++ b/flax/util/default_root.py @@ -0,0 +1,9 @@ +import os +from pathlib import Path + +DEFAULT_ROOT_PATH = Path(os.path.expanduser(os.getenv("FLAX_ROOT", "~/.flax/mainnet"))).resolve() +STANDALONE_ROOT_PATH = Path( + os.path.expanduser(os.getenv("FLAX_STANDALONE_WALLET_ROOT", "~/.flax/standalone_wallet")) +).resolve() + +DEFAULT_KEYS_ROOT_PATH = Path(os.path.expanduser(os.getenv("FLAX_KEYS_ROOT", "~/.flax_keys"))).resolve() diff --git a/chia/util/dump_keyring.py b/flax/util/dump_keyring.py old mode 100755 new mode 100644 similarity index 94% rename from chia/util/dump_keyring.py rename to flax/util/dump_keyring.py index efc9122b5..0b28d4d6b --- a/chia/util/dump_keyring.py +++ b/flax/util/dump_keyring.py @@ -5,10 +5,10 @@ import threading import yaml -from chia.cmds.passphrase_funcs import prompt_for_passphrase, read_passphrase_from_file -from chia.util.default_root import DEFAULT_KEYS_ROOT_PATH -from chia.util.file_keyring import FileKeyring -from chia.util.keyring_wrapper import DEFAULT_PASSPHRASE_IF_NO_MASTER_PASSPHRASE, KeyringWrapper +from flax.cmds.passphrase_funcs import prompt_for_passphrase, read_passphrase_from_file +from flax.util.default_root import DEFAULT_KEYS_ROOT_PATH +from flax.util.file_keyring import FileKeyring +from flax.util.keyring_wrapper import DEFAULT_PASSPHRASE_IF_NO_MASTER_PASSPHRASE, KeyringWrapper from cryptography.exceptions import InvalidTag from io import TextIOWrapper from pathlib import Path 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/file_keyring.py b/flax/util/file_keyring.py similarity index 99% rename from chia/util/file_keyring.py rename to flax/util/file_keyring.py index 46a0d89fa..d29580b5e 100644 --- a/chia/util/file_keyring.py +++ b/flax/util/file_keyring.py @@ -6,7 +6,7 @@ import threading import yaml -from chia.util.default_root import DEFAULT_KEYS_ROOT_PATH +from flax.util.default_root import DEFAULT_KEYS_ROOT_PATH from contextlib import contextmanager from cryptography.hazmat.primitives.ciphers.aead import ChaCha20Poly1305 # pyright: reportMissingModuleSource=false from functools import wraps @@ -320,7 +320,7 @@ def symmetric_key_from_passphrase(passphrase: str, salt: bytes) -> bytes: @staticmethod def get_symmetric_key(salt: bytes) -> bytes: - from chia.util.keychain import obtain_current_passphrase + from flax.util.keychain import obtain_current_passphrase try: passphrase = obtain_current_passphrase(use_passphrase_cache=True) @@ -392,7 +392,7 @@ def is_first_write(self): return self.outer_payload_cache == FileKeyring.default_outer_payload() def write_keyring(self, fresh_salt: bool = False): - from chia.util.keyring_wrapper import KeyringWrapper + from flax.util.keyring_wrapper import KeyringWrapper inner_payload = self.payload_cache inner_payload_yaml = yaml.safe_dump(inner_payload) diff --git a/chia/util/files.py b/flax/util/files.py similarity index 100% rename from chia/util/files.py rename to flax/util/files.py diff --git a/chia/util/chia_logging.py b/flax/util/flax_logging.py similarity index 98% rename from chia/util/chia_logging.py rename to flax/util/flax_logging.py index 4f033557f..8d84a9381 100644 --- a/chia/util/chia_logging.py +++ b/flax/util/flax_logging.py @@ -6,7 +6,7 @@ from concurrent_log_handler import ConcurrentRotatingFileHandler from logging.handlers import SysLogHandler -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/full_block_utils.py b/flax/util/full_block_utils.py similarity index 99% rename from chia/util/full_block_utils.py rename to flax/util/full_block_utils.py index a1f076b9c..64e3cf9f3 100644 --- a/chia/util/full_block_utils.py +++ b/flax/util/full_block_utils.py @@ -3,7 +3,7 @@ from blspy import G1Element, G2Element from chia_rs import serialized_length -from chia.types.blockchain_format.program import SerializedProgram +from flax.types.blockchain_format.program import SerializedProgram def skip_list(buf: memoryview, skip_item: Callable[[memoryview], memoryview]) -> memoryview: diff --git a/chia/util/generator_tools.py b/flax/util/generator_tools.py similarity index 87% rename from chia/util/generator_tools.py rename to flax/util/generator_tools.py index 526051022..45f180cbf 100644 --- a/chia/util/generator_tools.py +++ b/flax/util/generator_tools.py @@ -1,13 +1,13 @@ from typing import Any, Iterator, List, Tuple, Optional 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.spend_bundle_conditions import SpendBundleConditions -from chia.consensus.cost_calculator import NPCResult -from chia.util.ints import uint64 +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.spend_bundle_conditions import SpendBundleConditions +from flax.consensus.cost_calculator import NPCResult +from flax.util.ints import uint64 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 74% rename from chia/util/initial-config.yaml rename to flax/util/initial-config.yaml index 89b20ed1d..c6809fb2b 100644 --- a/chia/util/initial-config.yaml +++ b/flax/util/initial-config.yaml @@ -4,7 +4,7 @@ min_mainnet_k_size: 32 ping_interval: 120 self_hostname: &self_hostname "localhost" prefer_ipv6: False -daemon_port: 55400 +daemon_port: 56600 daemon_max_message_size: 50000000 # maximum size of RPC message in bytes inbound_rate_limit_percent: 100 outbound_rate_limit_percent: 30 @@ -13,96 +13,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 - 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 - 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 - 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 - 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 - MIN_PLOT_SIZE: 18 - NETWORK_TYPE: 1 - MEMPOOL_BLOCK_BUFFER: 50 - EPOCH_BLOCKS: 768 - DIFFICULTY_STARTING: 30 - testnet10: - AGG_SIG_ME_ADDITIONAL_DATA: ae83525ba8d1dd3f09b277de18ca3e43fc0af20d20c4b3e92ef2a48bd291ccb2 - DIFFICULTY_CONSTANT_FACTOR: 10052721566054 - DIFFICULTY_STARTING: 30 - EPOCH_BLOCKS: 768 - GENESIS_CHALLENGE: ae83525ba8d1dd3f09b277de18ca3e43fc0af20d20c4b3e92ef2a48bd291ccb2 - GENESIS_PRE_FARM_FARMER_PUZZLE_HASH: 3d8765d3a597ec1d99663f6c9816d915b9f68613ac94009884c4addaefcce6af - GENESIS_PRE_FARM_POOL_PUZZLE_HASH: d23da14695a188ae5708dd152263c4db883eb27edeb936178d4d988b8f3ce5fc - MEMPOOL_BLOCK_BUFFER: 10 - MIN_PLOT_SIZE: 18 + GENESIS_CHALLENGE: 28a206a22e7e2060230c88ad149d81cc8e74bcf5e8e74aafcce8b8efe6181dbb NETWORK_TYPE: 1 + GENESIS_PRE_FARM_POOL_PUZZLE_HASH: "e8e245e2e6536e17fd7cbc2e3bd90de06f55362ee3c84cea5a68391e5bad7ef6" + GENESIS_PRE_FARM_FARMER_PUZZLE_HASH: "e8e245e2e6536e17fd7cbc2e3bd90de06f55362ee3c84cea5a68391e5bad7ef6" config: mainnet: - address_prefix: "xch" - default_full_node_port: 8444 + address_prefix: "xfx" testnet0: - address_prefix: "txch" - default_full_node_port: 58444 - testnet1: - address_prefix: "txch" - testnet2: - address_prefix: "txch" - testnet3: - address_prefix: "txch" - testnet4: - address_prefix: "txch" - testnet7: - address_prefix: "txch" - default_full_node_port: 58444 - testnet10: - address_prefix: "txch" - default_full_node_port: 58444 + 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 @@ -110,9 +37,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: @@ -124,7 +51,7 @@ daemon_ssl: logging: &logging log_stdout: False # If True, outputs to stdout instead of a file log_filename: "log/debug.log" - log_level: "WARNING" # Can be CRITICAL, ERROR, WARNING, INFO, DEBUG, NOTSET + log_level: "INFO" # Can be CRITICAL, ERROR, WARNING, INFO, DEBUG, NOTSET log_maxfilesrotation: 7 # Max files in rotation. Default value 7 if the key is not set log_maxbytesrotation: 52428800 # Max bytes logged before rotating logs log_syslog: False # If True, outputs to SysLog host and port specified @@ -138,11 +65,11 @@ seeder: other_peers_port: 8444 # This will override the default full_node.peer_connect_timeout for the crawler full node peer_connect_timeout: 2 - # Path to crawler DB. Defaults to $CHIA_ROOT/crawler.db + # Path to crawler DB. Defaults to $FLAX_ROOT/crawler.db crawler_db_path: "crawler.db" # Peers used for the initial run. bootstrap_peers: - - "node.chia.net" + - "node.flaxnetwork.org" # Only consider nodes synced at least to this height. minimum_height: 240000 # How many of a particular version we need to see before reporting it in the logs @@ -170,14 +97,14 @@ seeder: 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 plots_refresh_parameter: interval_seconds: 120 # The interval in seconds to refresh the plot file manager @@ -205,13 +132,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 @@ -219,23 +146,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 @@ -253,7 +180,7 @@ farmer: timelord_launcher: # The server where the VDF clients will connect to. host: *self_hostname - port: 8000 + port: 6600 # Number of VDF client processes to keep alive in the local machine. process_count: 3 logging: *logging @@ -261,7 +188,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: @@ -273,13 +200,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 @@ -319,7 +246,7 @@ timelord: full_node: # The full node server (if run) will run on this port - port: 8444 + port: 6888 # controls the sync-to-disk behavior of the database connection. Can be one of: # "on" enables syncing to disk, minimizes risk of corrupting the DB in @@ -352,7 +279,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 @@ -402,7 +329,7 @@ full_node: weight_proof_timeout: &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 # this is a debug and profiling facility that logs all SQLite commands to a @@ -415,19 +342,19 @@ full_node: # 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 @@ -440,10 +367,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 @@ -454,14 +381,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 it has seen in the last # recent_peer_threshold seconds @@ -475,8 +402,8 @@ introducer: public_key: "config/ssl/full_node/public_full_node.key" wallet: - port: 8449 - rpc_port: 9256 + port: 6883 + rpc_port: 6761 enable_profiler: False @@ -493,11 +420,11 @@ wallet: initial_num_public_keys: 100 dns_servers: - - "dns-introducer.chia.net" + - "dns-introducer.flaxnetwork.org" full_node_peer: host: *self_hostname - port: 8444 + port: 6888 multiprocessing_start_method: default @@ -519,8 +446,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/inline_executor.py b/flax/util/inline_executor.py similarity index 100% rename from chia/util/inline_executor.py rename to flax/util/inline_executor.py diff --git a/chia/util/ints.py b/flax/util/ints.py similarity index 94% rename from chia/util/ints.py rename to flax/util/ints.py index 9cb952659..1934510a4 100644 --- a/chia/util/ints.py +++ b/flax/util/ints.py @@ -1,6 +1,6 @@ from __future__ import annotations -from chia.util.struct_stream import StructStream, parse_metadata_from_name +from flax.util.struct_stream import StructStream, parse_metadata_from_name @parse_metadata_from_name 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 b701f3191..b76ff3830 100644 --- a/chia/util/keychain.py +++ b/flax/util/keychain.py @@ -6,8 +6,8 @@ from bitstring import BitArray # pyright: reportMissingImports=false from blspy import AugSchemeMPL, G1Element, PrivateKey # pyright: reportMissingImports=false -from chia.util.hash import std_hash -from chia.util.keyring_wrapper import KeyringWrapper +from flax.util.hash import std_hash +from flax.util.keyring_wrapper import KeyringWrapper from hashlib import pbkdf2_hmac from pathlib import Path from secrets import token_bytes @@ -16,8 +16,8 @@ CURRENT_KEY_VERSION = "1.8" -DEFAULT_USER = f"user-chia-{CURRENT_KEY_VERSION}" # e.g. user-chia-1.8 -DEFAULT_SERVICE = f"chia-{DEFAULT_USER}" # e.g. chia-user-chia-1.8 +DEFAULT_USER = f"user-flax-{CURRENT_KEY_VERSION}" # e.g. user-flax-1.8 +DEFAULT_SERVICE = f"flax-{DEFAULT_USER}" # e.g. flax-user-flax-1.8 DEFAULT_PASSPHRASE_PROMPT = ( colorama.Fore.YELLOW + colorama.Style.BRIGHT + "(Unlock Keyring)" + colorama.Style.RESET_ALL + " Passphrase: " ) # noqa: E501 @@ -48,8 +48,8 @@ class KeyringNotSet(Exception): def supports_keyring_passphrase() -> bool: - # Support can be disabled by setting CHIA_PASSPHRASE_SUPPORT to 0/false - return os.environ.get("CHIA_PASSPHRASE_SUPPORT", "true").lower() in ["1", "true"] + # Support can be disabled by setting FLAX_PASSPHRASE_SUPPORT to 0/false + return os.environ.get("FLAX_PASSPHRASE_SUPPORT", "true").lower() in ["1", "true"] def supports_os_passphrase_storage() -> bool: @@ -80,7 +80,7 @@ def obtain_current_passphrase(prompt: str = DEFAULT_PASSPHRASE_PROMPT, use_passp prompted interactively to enter their passphrase a max of MAX_RETRIES times before failing. """ - from chia.cmds.passphrase_funcs import prompt_for_passphrase + from flax.cmds.passphrase_funcs import prompt_for_passphrase if use_passphrase_cache: passphrase, validated = KeyringWrapper.get_shared_instance().get_cached_master_passphrase() @@ -516,7 +516,7 @@ def compare_versions(version1: str, version2: str) -> int: migration_version_file: Path = KeyringWrapper.get_shared_instance().keys_root_path / ".last_legacy_migration" if migration_version_file.exists(): - current_version_str = pkg_resources.get_distribution("chia-blockchain").version + current_version_str = pkg_resources.get_distribution("flax-blockchain").version with migration_version_file.open("r") as f: last_migration_version_str = f.read().strip() return compare_versions(current_version_str, last_migration_version_str) <= 0 @@ -529,7 +529,7 @@ def mark_migration_checked_for_current_version(): Marks the current client version as having checked the legacy keyring for keys needing migration. """ migration_version_file: Path = KeyringWrapper.get_shared_instance().keys_root_path / ".last_legacy_migration" - current_version_str = pkg_resources.get_distribution("chia-blockchain").version + current_version_str = pkg_resources.get_distribution("flax-blockchain").version with migration_version_file.open("w") as f: f.write(current_version_str) diff --git a/chia/util/keyring_wrapper.py b/flax/util/keyring_wrapper.py similarity index 95% rename from chia/util/keyring_wrapper.py rename to flax/util/keyring_wrapper.py index f830de1fc..27ff20016 100644 --- a/chia/util/keyring_wrapper.py +++ b/flax/util/keyring_wrapper.py @@ -2,9 +2,9 @@ import keyring as keyring_main from blspy import PrivateKey # pyright: reportMissingImports=false -from chia.util.default_root import DEFAULT_KEYS_ROOT_PATH -from chia.util.file_keyring import FileKeyring -from chia.util.misc import prompt_yes_no +from flax.util.default_root import DEFAULT_KEYS_ROOT_PATH +from flax.util.file_keyring import FileKeyring +from flax.util.misc import prompt_yes_no from keyrings.cryptfile.cryptfile import CryptFileKeyring # pyright: reportMissingImports=false from keyring.backends.macOS import Keyring as MacKeyring from keyring.backends.Windows import WinVaultKeyring as WinKeyring @@ -19,10 +19,10 @@ # WARNING: Changing the default passphrase will prevent passphrase-less users from accessing # their existing keys. Using a new default passphrase requires migrating existing users to # the new passphrase. -DEFAULT_PASSPHRASE_IF_NO_MASTER_PASSPHRASE = "$ chia passphrase set # all the cool kids are doing it!" +DEFAULT_PASSPHRASE_IF_NO_MASTER_PASSPHRASE = "$ flax passphrase set # all the cool kids are doing it!" -MASTER_PASSPHRASE_SERVICE_NAME = "Chia Passphrase" -MASTER_PASSPHRASE_USER_NAME = "Chia Passphrase" +MASTER_PASSPHRASE_SERVICE_NAME = "Flax Passphrase" +MASTER_PASSPHRASE_USER_NAME = "Flax Passphrase" LegacyKeyring = Union[MacKeyring, WinKeyring, CryptFileKeyring] @@ -51,7 +51,7 @@ def get_os_passphrase_store() -> Optional[OSPassphraseStore]: def check_legacy_keyring_keys_present(keyring: LegacyKeyring) -> bool: from keyring.credentials import SimpleCredential - from chia.util.keychain import default_keychain_user, default_keychain_service, get_private_key_user, MAX_KEYS + from flax.util.keychain import default_keychain_user, default_keychain_service, get_private_key_user, MAX_KEYS keychain_user: str = default_keychain_user() keychain_service: str = default_keychain_service() @@ -110,7 +110,7 @@ def __init__(self, keys_root_path: Path = DEFAULT_KEYS_ROOT_PATH, force_legacy: used CryptFileKeyring. We now use our own FileKeyring backend and migrate the data from the legacy CryptFileKeyring (on write). """ - from chia.util.keychain import KeyringNotSet + from flax.util.keychain import KeyringNotSet self.keys_root_path = keys_root_path if force_legacy: @@ -136,7 +136,7 @@ def refresh_keyrings(self): self.cached_passphrase = self._get_initial_cached_passphrase() def _configure_backend(self) -> Union[LegacyKeyring, FileKeyring]: - from chia.util.keychain import supports_keyring_passphrase + from flax.util.keychain import supports_keyring_passphrase keyring: Union[LegacyKeyring, FileKeyring] @@ -170,7 +170,7 @@ def _get_initial_cached_passphrase(self) -> str: Grab the saved passphrase from the OS credential store (if available), otherwise use the default passphrase """ - from chia.util.keychain import supports_os_passphrase_storage + from flax.util.keychain import supports_os_passphrase_storage passphrase: Optional[str] = None @@ -261,7 +261,7 @@ def set_master_passphrase( Sets a new master passphrase for the keyring """ - from chia.util.keychain import ( + from flax.util.keychain import ( KeyringCurrentPassphraseIsInvalid, KeyringRequiresMigration, supports_os_passphrase_storage, @@ -377,12 +377,12 @@ def confirm_migration(self) -> bool: "passphrase." ) print( - "Would you like to set a master passphrase now? Use 'chia passphrase set' to change the passphrase.\n" + "Would you like to set a master passphrase now? Use 'flax passphrase set' to change the passphrase.\n" ) response = prompt_yes_no("Set keyring master passphrase? (y/n) ") if response: - from chia.cmds.passphrase_funcs import prompt_for_new_passphrase + from flax.cmds.passphrase_funcs import prompt_for_new_passphrase # Prompt for a master passphrase and cache it new_passphrase, save_passphrase = prompt_for_new_passphrase() @@ -394,7 +394,7 @@ def confirm_migration(self) -> bool: ) else: print( - "Will skip setting a master passphrase. Use 'chia passphrase set' to set the master passphrase.\n" + "Will skip setting a master passphrase. Use 'flax passphrase set' to set the master passphrase.\n" ) else: import colorama @@ -411,7 +411,7 @@ def confirm_migration(self) -> bool: return prompt_yes_no("Begin keyring migration? (y/n) ") def migrate_legacy_keys(self) -> MigrationResults: - from chia.util.keychain import get_private_key_user, Keychain, MAX_KEYS + from flax.util.keychain import get_private_key_user, Keychain, MAX_KEYS print("Migrating contents from legacy keyring") @@ -445,7 +445,7 @@ def migrate_legacy_keys(self) -> MigrationResults: ) def verify_migration_results(self, migration_results: MigrationResults) -> bool: - from chia.util.keychain import Keychain + from flax.util.keychain import Keychain # Stop using the legacy keyring. This will direct subsequent reads to the new keyring. self.legacy_keyring = None @@ -521,7 +521,7 @@ def migrate_legacy_keyring_interactive(self): perform a before/after comparison of the keyring contents, and on success we'll prompt to cleanup the legacy keyring. """ - from chia.cmds.passphrase_funcs import async_update_daemon_migration_completed_if_running + from flax.cmds.passphrase_funcs import async_update_daemon_migration_completed_if_running # Make sure the user is ready to begin migration. response = self.confirm_migration() diff --git a/chia/util/lock.py b/flax/util/lock.py similarity index 95% rename from chia/util/lock.py rename to flax/util/lock.py index 8bed53cb3..0fe6ecc7a 100644 --- a/chia/util/lock.py +++ b/flax/util/lock.py @@ -6,7 +6,7 @@ T = TypeVar("T") -# Cribbed mostly from chia/daemon/server.py +# Cribbed mostly from flax/daemon/server.py def create_exclusive_lock(lockfile: str) -> Optional[TextIO]: """ Open a lockfile exclusively. diff --git a/chia/util/log_exceptions.py b/flax/util/log_exceptions.py similarity index 100% rename from chia/util/log_exceptions.py rename to flax/util/log_exceptions.py 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 58% rename from chia/util/make_test_constants.py rename to flax/util/make_test_constants.py index 659c75b06..1994c98f5 100644 --- a/chia/util/make_test_constants.py +++ b/flax/util/make_test_constants.py @@ -1,7 +1,7 @@ from typing import Dict -from chia.consensus.constants import ConsensusConstants -from chia.consensus.default_constants import DEFAULT_CONSTANTS +from flax.consensus.constants import ConsensusConstants +from flax.consensus.default_constants import DEFAULT_CONSTANTS 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 ba24ecac0..217b720fc 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 98% rename from chia/util/misc.py rename to flax/util/misc.py index afdbbcda2..1fbc3381b 100644 --- a/chia/util/misc.py +++ b/flax/util/misc.py @@ -1,6 +1,6 @@ from typing import Any, Dict, Sequence, Union -from chia.util.streamable import recurse_jsonify +from flax.util.streamable import recurse_jsonify def format_bytes(bytes: int) -> str: diff --git a/chia/util/network.py b/flax/util/network.py similarity index 84% rename from chia/util/network.py rename to flax/util/network.py index bbf48a442..b333703d1 100644 --- a/chia/util/network.py +++ b/flax/util/network.py @@ -2,11 +2,11 @@ from pathlib import Path from ipaddress import ip_address, IPv4Network, IPv6Network from typing import Iterable, List, Tuple, Union, Any, Optional, Dict -from chia.server.outbound_message import NodeType -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.peer_info import PeerInfo -from chia.util.config import load_config -from chia.util.ints import uint16 +from flax.server.outbound_message import NodeType +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.peer_info import PeerInfo +from flax.util.config import load_config +from flax.util.ints import uint16 def is_in_network(peer_host: str, networks: Iterable[Union[IPv4Network, IPv6Network]]) -> bool: @@ -23,27 +23,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/paginator.py b/flax/util/paginator.py similarity index 100% rename from chia/util/paginator.py rename to flax/util/paginator.py 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/permissions.py b/flax/util/permissions.py similarity index 100% rename from chia/util/permissions.py rename to flax/util/permissions.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 32c4ed01f..39c9754ba 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, service: str, log: logging.Logger) -> None: @@ -121,7 +121,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..a51932fa6 --- /dev/null +++ b/flax/util/service_groups.py @@ -0,0 +1,33 @@ +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".split(), + "introducer": "flax_introducer".split(), + "simulator": "flax_full_node_simulator".split(), + "crawler": "flax_crawler".split(), + "seeder": "flax_crawler flax_seeder".split(), + "seeder-only": "flax_seeder".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/ssl_check.py b/flax/util/ssl_check.py similarity index 95% rename from chia/util/ssl_check.py rename to flax/util/ssl_check.py index 3e4c1184c..6e45caee9 100644 --- a/chia/util/ssl_check.py +++ b/flax/util/ssl_check.py @@ -1,8 +1,8 @@ import os import stat import sys -from chia.util.config import load_config, traverse_dict -from chia.util.permissions import octal_mode_string, verify_file_permissions +from flax.util.config import load_config, traverse_dict +from flax.util.permissions import octal_mode_string, verify_file_permissions from logging import Logger from pathlib import Path from typing import Dict, List, Optional, Set, Tuple @@ -17,13 +17,13 @@ ) # 0o077 CERT_CONFIG_KEY_PATHS = [ - "chia_ssl_ca:crt", + "flax_ssl_ca:crt", "daemon_ssl:private_crt", "farmer:ssl:private_crt", "farmer:ssl:public_crt", "full_node:ssl:private_crt", "full_node:ssl:public_crt", - "harvester:chia_ssl_ca:crt", + "harvester:flax_ssl_ca:crt", "harvester:private_ssl_ca:crt", "harvester:ssl:private_crt", "introducer:ssl:public_crt", @@ -35,13 +35,13 @@ "wallet:ssl:public_crt", ] KEY_CONFIG_KEY_PATHS = [ - "chia_ssl_ca:key", + "flax_ssl_ca:key", "daemon_ssl:private_key", "farmer:ssl:private_key", "farmer:ssl:public_key", "full_node:ssl:private_key", "full_node:ssl:public_key", - "harvester:chia_ssl_ca:key", + "harvester:flax_ssl_ca:key", "harvester:private_ssl_ca:key", "harvester:ssl:private_key", "introducer:ssl:public_key", @@ -60,7 +60,7 @@ def get_all_ssl_file_paths(root_path: Path) -> Tuple[List[Path], List[Path]]: """Lookup config values and append to a list of files whose permissions we need to check""" - from chia.ssl.create_ssl import get_mozilla_ca_crt + from flax.ssl.create_ssl import get_mozilla_ca_crt all_certs: List[Path] = [] all_keys: List[Path] = [] @@ -143,7 +143,7 @@ def check_ssl(root_path: Path) -> None: get_ssl_perm_warning(path, actual_permissions, expected_permissions) ) # lgtm [py/clear-text-logging-sensitive-data] print("One or more SSL files were found with permission issues.") - print("Run `chia init --fix-ssl-permissions` to fix issues.") + print("Run `flax init --fix-ssl-permissions` to fix issues.") def check_and_fix_permissions_for_ssl_file(file: Path, mask: int, updated_mode: int) -> Tuple[bool, bool]: diff --git a/chia/util/streamable.py b/flax/util/streamable.py similarity index 99% rename from chia/util/streamable.py rename to flax/util/streamable.py index 182cfe765..b295add58 100644 --- a/chia/util/streamable.py +++ b/flax/util/streamable.py @@ -9,10 +9,10 @@ from blspy import G1Element, G2Element, PrivateKey from typing_extensions import Literal, get_args, get_origin -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 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 pp = pprint.PrettyPrinter(indent=1, width=120, compact=True) 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/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/ws_message.py b/flax/util/ws_message.py similarity index 96% rename from chia/util/ws_message.py rename to flax/util/ws_message.py index f84121518..01cc71031 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 from typing_extensions 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 832459252..f15d98d0f 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 @streamable diff --git a/chia/wallet/cat_wallet/__init__.py b/flax/wallet/cat_wallet/__init__.py similarity index 100% rename from chia/wallet/cat_wallet/__init__.py rename to flax/wallet/cat_wallet/__init__.py diff --git a/flax/wallet/cat_wallet/cat_constants.py b/flax/wallet/cat_wallet/cat_constants.py new file mode 100644 index 000000000..a9b6ef4ec --- /dev/null +++ b/flax/wallet/cat_wallet/cat_constants.py @@ -0,0 +1,3 @@ + +DEFAULT_CATS = { +} diff --git a/chia/wallet/cat_wallet/cat_info.py b/flax/wallet/cat_wallet/cat_info.py similarity index 75% rename from chia/wallet/cat_wallet/cat_info.py rename to flax/wallet/cat_wallet/cat_info.py index 78c9fec5e..d503da5c9 100644 --- a/chia/wallet/cat_wallet/cat_info.py +++ b/flax/wallet/cat_wallet/cat_info.py @@ -1,10 +1,10 @@ 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.wallet.lineage_proof import LineageProof -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.wallet.lineage_proof import LineageProof +from flax.util.streamable import Streamable, streamable @streamable diff --git a/chia/wallet/cat_wallet/cat_outer_puzzle.py b/flax/wallet/cat_wallet/cat_outer_puzzle.py similarity index 91% rename from chia/wallet/cat_wallet/cat_outer_puzzle.py rename to flax/wallet/cat_wallet/cat_outer_puzzle.py index 0179c064b..9960254c3 100644 --- a/chia/wallet/cat_wallet/cat_outer_puzzle.py +++ b/flax/wallet/cat_wallet/cat_outer_puzzle.py @@ -1,20 +1,20 @@ from dataclasses import dataclass from typing import Any, List, 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.types.coin_spend import CoinSpend -from chia.util.ints import uint64 -from chia.wallet.cat_wallet.cat_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.coin_spend import CoinSpend +from flax.util.ints import uint64 +from flax.wallet.cat_wallet.cat_utils import ( CAT_MOD, SpendableCAT, construct_cat_puzzle, match_cat_puzzle, unsigned_spend_bundle_for_spendable_cats, ) -from chia.wallet.lineage_proof import LineageProof -from chia.wallet.puzzle_drivers import PuzzleInfo, Solver +from flax.wallet.lineage_proof import LineageProof +from flax.wallet.puzzle_drivers import PuzzleInfo, Solver @dataclass(frozen=True) diff --git a/chia/wallet/cat_wallet/cat_utils.py b/flax/wallet/cat_wallet/cat_utils.py similarity index 90% rename from chia/wallet/cat_wallet/cat_utils.py rename to flax/wallet/cat_wallet/cat_utils.py index 3e3004a53..2948c6133 100644 --- a/chia/wallet/cat_wallet/cat_utils.py +++ b/flax/wallet/cat_wallet/cat_utils.py @@ -3,14 +3,14 @@ from blspy import G2Element -from chia.types.blockchain_format.coin import Coin, coin_as_list -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 CoinSpend, SpendBundle -from chia.util.condition_tools import conditions_dict_for_solution -from chia.wallet.lineage_proof import LineageProof -from chia.wallet.puzzles.cat_loader import CAT_MOD +from flax.types.blockchain_format.coin import Coin, coin_as_list +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 CoinSpend, SpendBundle +from flax.util.condition_tools import conditions_dict_for_solution +from flax.wallet.lineage_proof import LineageProof +from flax.wallet.puzzles.cat_loader import CAT_MOD NULL_SIGNATURE = G2Element() diff --git a/chia/wallet/cat_wallet/cat_wallet.py b/flax/wallet/cat_wallet/cat_wallet.py similarity index 88% rename from chia/wallet/cat_wallet/cat_wallet.py rename to flax/wallet/cat_wallet/cat_wallet.py index fa88b3913..9938f87f1 100644 --- a/chia/wallet/cat_wallet/cat_wallet.py +++ b/flax/wallet/cat_wallet/cat_wallet.py @@ -9,49 +9,49 @@ from blspy import AugSchemeMPL, G2Element -from chia.consensus.cost_calculator import 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.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_spend import CoinSpend -from chia.types.condition_opcodes import ConditionOpcode -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.hash import std_hash -from chia.util.ints import uint8, uint32, uint64, uint128 -from chia.wallet.cat_wallet.cat_constants import DEFAULT_CATS -from chia.wallet.cat_wallet.cat_info import CATInfo, LegacyCATInfo -from chia.wallet.cat_wallet.cat_utils import ( +from flax.consensus.cost_calculator import 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.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_spend import CoinSpend +from flax.types.condition_opcodes import ConditionOpcode +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.hash import std_hash +from flax.util.ints import uint8, uint32, uint64, uint128 +from flax.wallet.cat_wallet.cat_constants import DEFAULT_CATS +from flax.wallet.cat_wallet.cat_info import CATInfo, LegacyCATInfo +from flax.wallet.cat_wallet.cat_utils import ( CAT_MOD, SpendableCAT, construct_cat_puzzle, match_cat_puzzle, unsigned_spend_bundle_for_spendable_cats, ) -from chia.wallet.cat_wallet.lineage_store import CATLineageStore -from chia.wallet.coin_selection import select_coins -from chia.wallet.derivation_record import DerivationRecord -from chia.wallet.lineage_proof import LineageProof -from chia.wallet.outer_puzzles import AssetType -from chia.wallet.puzzle_drivers import PuzzleInfo -from chia.wallet.payment import Payment -from chia.wallet.puzzles.tails import ALL_LIMITATIONS_PROGRAMS -from chia.wallet.puzzles.p2_delegated_puzzle_or_hidden_puzzle import ( +from flax.wallet.cat_wallet.lineage_store import CATLineageStore +from flax.wallet.coin_selection import select_coins +from flax.wallet.derivation_record import DerivationRecord +from flax.wallet.lineage_proof import LineageProof +from flax.wallet.outer_puzzles import AssetType +from flax.wallet.puzzle_drivers import PuzzleInfo +from flax.wallet.payment import Payment +from flax.wallet.puzzles.tails import ALL_LIMITATIONS_PROGRAMS +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.compute_memos import compute_memos -from chia.wallet.util.transaction_type import TransactionType -from chia.wallet.util.wallet_types import AmountWithPuzzlehash, 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.compute_memos import compute_memos +from flax.wallet.util.transaction_type import TransactionType +from flax.wallet.util.wallet_types import AmountWithPuzzlehash, WalletType +from flax.wallet.wallet import Wallet +from flax.wallet.wallet_coin_record import WalletCoinRecord +from flax.wallet.wallet_info import WalletInfo # This should probably not live in this file but it's for experimental right now @@ -100,7 +100,7 @@ async def create_new_cat_wallet( self.wallet_info = new_wallet_info try: - chia_tx, spend_bundle = await ALL_LIMITATIONS_PROGRAMS[ + flax_tx, spend_bundle = await ALL_LIMITATIONS_PROGRAMS[ cat_tail_info["identifier"] ].generate_issuance_bundle( self, @@ -158,8 +158,8 @@ async def create_new_cat_wallet( name=bytes32(token_bytes()), memos=[], ) - chia_tx = dataclasses.replace(chia_tx, spend_bundle=spend_bundle) - await self.standard_wallet.push_transaction(chia_tx) + flax_tx = dataclasses.replace(flax_tx, spend_bundle=spend_bundle) + await self.standard_wallet.push_transaction(flax_tx) await self.standard_wallet.push_transaction(cat_record) return self @@ -527,7 +527,7 @@ async def convert_puzzle_hash(self, puzzle_hash: bytes32) -> bytes32: async def get_lineage_proof_for_coin(self, coin) -> Optional[LineageProof]: return await self.lineage_store.get_lineage_proof(coin.parent_coin_info) - async def create_tandem_xch_tx( + async def create_tandem_xfx_tx( self, fee: uint64, amount_to_claim: uint64, @@ -540,21 +540,21 @@ async def create_tandem_xch_tx( """ announcement = None if fee > amount_to_claim: - chia_coins = await self.standard_wallet.select_coins(fee) - origin_id = list(chia_coins)[0].name() - chia_tx = await self.standard_wallet.generate_signed_transaction( + flax_coins = await self.standard_wallet.select_coins(fee) + origin_id = list(flax_coins)[0].name() + flax_tx = await self.standard_wallet.generate_signed_transaction( uint64(0), (await self.standard_wallet.get_new_puzzlehash()), fee=uint64(fee - amount_to_claim), - coins=chia_coins, + coins=flax_coins, origin_id=origin_id, # We specify this so that we know the coin that is making the announcement negative_change_allowed=False, coin_announcements_to_consume={announcement_to_assert} if announcement_to_assert is not None else None, ) - assert chia_tx.spend_bundle is not None + assert flax_tx.spend_bundle is not None message = None - for spend in chia_tx.spend_bundle.coin_spends: + for spend in flax_tx.spend_bundle.coin_spends: if spend.coin.name() == origin_id: conditions = spend.puzzle_reveal.to_program().run(spend.solution.to_program()).as_python() for condition in conditions: @@ -564,18 +564,18 @@ async def create_tandem_xch_tx( assert message is not None announcement = Announcement(origin_id, message) else: - chia_coins = await self.standard_wallet.select_coins(fee) - selected_amount = sum([c.amount for c in chia_coins]) - chia_tx = await self.standard_wallet.generate_signed_transaction( + flax_coins = await self.standard_wallet.select_coins(fee) + selected_amount = sum([c.amount for c in flax_coins]) + flax_tx = await self.standard_wallet.generate_signed_transaction( uint64(selected_amount + amount_to_claim - fee), (await self.standard_wallet.get_new_puzzlehash()), - coins=chia_coins, + coins=flax_coins, negative_change_allowed=True, coin_announcements_to_consume={announcement_to_assert} if announcement_to_assert is not None else None, ) - assert chia_tx.spend_bundle is not None + assert flax_tx.spend_bundle is not None - return chia_tx, announcement + return flax_tx, announcement async def generate_unsigned_spendbundle( self, @@ -611,14 +611,14 @@ async def generate_unsigned_spendbundle( selected_cat_amount = sum([c.amount for c in cat_coins]) assert selected_cat_amount >= starting_amount - # Figure out if we need to absorb/melt some XCH as part of this - regular_chia_to_claim: int = 0 + # Figure out if we need to absorb/melt some XFX as part of this + regular_flax_to_claim: int = 0 if payment_amount > starting_amount: fee = uint64(fee + payment_amount - starting_amount) elif payment_amount < starting_amount: - regular_chia_to_claim = payment_amount + regular_flax_to_claim = payment_amount - need_chia_transaction = (fee > 0 or regular_chia_to_claim > 0) and (fee - regular_chia_to_claim != 0) + need_flax_transaction = (fee > 0 or regular_flax_to_claim > 0) and (fee - regular_flax_to_claim != 0) # Calculate standard puzzle solutions change = selected_cat_amount - starting_amount @@ -638,17 +638,17 @@ async def generate_unsigned_spendbundle( # Loop through the coins we've selected and gather the information we need to spend them spendable_cat_list = [] - chia_tx = None + flax_tx = None first = True announcement: Announcement for coin in cat_coins: if first: first = False announcement = Announcement(coin.name(), std_hash(b"".join([c.name() for c in cat_coins])), b"\xca") - if need_chia_transaction: - if fee > regular_chia_to_claim: - chia_tx, _ = await self.create_tandem_xch_tx( - fee, uint64(regular_chia_to_claim), announcement_to_assert=announcement + if need_flax_transaction: + if fee > regular_flax_to_claim: + flax_tx, _ = await self.create_tandem_xfx_tx( + fee, uint64(regular_flax_to_claim), announcement_to_assert=announcement ) innersol = self.standard_wallet.make_solution( primaries=primaries, @@ -656,8 +656,8 @@ async def generate_unsigned_spendbundle( coin_announcements_to_assert=coin_announcements_bytes, puzzle_announcements_to_assert=puzzle_announcements_bytes, ) - elif regular_chia_to_claim > fee: - chia_tx, _ = await self.create_tandem_xch_tx(fee, uint64(regular_chia_to_claim)) + elif regular_flax_to_claim > fee: + flax_tx, _ = await self.create_tandem_xfx_tx(fee, uint64(regular_flax_to_claim)) innersol = self.standard_wallet.make_solution( primaries=primaries, coin_announcements={announcement.message}, @@ -691,18 +691,18 @@ async def generate_unsigned_spendbundle( spendable_cat_list.append(new_spendable_cat) cat_spend_bundle = unsigned_spend_bundle_for_spendable_cats(CAT_MOD, spendable_cat_list) - chia_spend_bundle = SpendBundle([], G2Element()) - if chia_tx is not None and chia_tx.spend_bundle is not None: - chia_spend_bundle = chia_tx.spend_bundle + flax_spend_bundle = SpendBundle([], G2Element()) + if flax_tx is not None and flax_tx.spend_bundle is not None: + flax_spend_bundle = flax_tx.spend_bundle return ( SpendBundle.aggregate( [ cat_spend_bundle, - chia_spend_bundle, + flax_spend_bundle, ] ), - chia_tx, + flax_tx, ) async def generate_signed_transaction( @@ -733,7 +733,7 @@ async def generate_signed_transaction( max_send = await self.get_max_send_amount() if payment_sum > max_send: raise ValueError(f"Can't send more than {max_send} in a single transaction") - unsigned_spend_bundle, chia_tx = await self.generate_unsigned_spendbundle( + unsigned_spend_bundle, flax_tx = await self.generate_unsigned_spendbundle( payments, fee, coins=coins, @@ -763,24 +763,24 @@ async def generate_signed_transaction( ) ] - if chia_tx is not None: + if flax_tx is not None: tx_list.append( TransactionRecord( - confirmed_at_height=chia_tx.confirmed_at_height, - created_at_time=chia_tx.created_at_time, - to_puzzle_hash=chia_tx.to_puzzle_hash, - amount=chia_tx.amount, - fee_amount=chia_tx.fee_amount, - confirmed=chia_tx.confirmed, - sent=chia_tx.sent, + confirmed_at_height=flax_tx.confirmed_at_height, + created_at_time=flax_tx.created_at_time, + to_puzzle_hash=flax_tx.to_puzzle_hash, + amount=flax_tx.amount, + fee_amount=flax_tx.fee_amount, + confirmed=flax_tx.confirmed, + sent=flax_tx.sent, spend_bundle=None, - additions=chia_tx.additions, - removals=chia_tx.removals, - wallet_id=chia_tx.wallet_id, - sent_to=chia_tx.sent_to, - trade_id=chia_tx.trade_id, - type=chia_tx.type, - name=chia_tx.name, + additions=flax_tx.additions, + removals=flax_tx.removals, + wallet_id=flax_tx.wallet_id, + sent_to=flax_tx.sent_to, + trade_id=flax_tx.trade_id, + type=flax_tx.type, + name=flax_tx.name, memos=[], ) ) diff --git a/chia/wallet/cat_wallet/lineage_store.py b/flax/wallet/cat_wallet/lineage_store.py similarity index 95% rename from chia/wallet/cat_wallet/lineage_store.py rename to flax/wallet/cat_wallet/lineage_store.py index 48a4a4220..ccb8ff444 100644 --- a/chia/wallet/cat_wallet/lineage_store.py +++ b/flax/wallet/cat_wallet/lineage_store.py @@ -3,9 +3,9 @@ import aiosqlite -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.db_wrapper import DBWrapper -from chia.wallet.lineage_proof import LineageProof +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.db_wrapper import DBWrapper +from flax.wallet.lineage_proof import LineageProof log = logging.getLogger(__name__) diff --git a/chia/wallet/coin_selection.py b/flax/wallet/coin_selection.py similarity index 94% rename from chia/wallet/coin_selection.py rename to flax/wallet/coin_selection.py index 92d950acc..4a8d71d09 100644 --- a/chia/wallet/coin_selection.py +++ b/flax/wallet/coin_selection.py @@ -2,10 +2,10 @@ import random from typing import Dict, List, Optional, Set -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.ints import uint64, uint128 -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.ints import uint64, uint128 +from flax.wallet.wallet_coin_record import WalletCoinRecord async def select_coins( 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 7856bb45d..704321020 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 95% rename from chia/wallet/derive_keys.py rename to flax/wallet/derive_keys.py index 5900c1c36..d0c36698a 100644 --- a/chia/wallet/derive_keys.py +++ b/flax/wallet/derive_keys.py @@ -2,14 +2,14 @@ from blspy import AugSchemeMPL, PrivateKey, G1Element -from chia.consensus.coinbase import create_puzzlehash_for_pk -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.ints import uint32 +from flax.consensus.coinbase import create_puzzlehash_for_pk +from flax.types.blockchain_format.sized_bytes import bytes32 +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, 5, 6 farmer, pool, wallet, local, backup key, singleton, pooling authentication key numbers # Allows up to 100 pool wallets (plot NFTs) 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 67% rename from chia/wallet/did_wallet/did_info.py rename to flax/wallet/did_wallet/did_info.py index 9bfdc5058..96d23e23a 100644 --- a/chia/wallet/did_wallet/did_info.py +++ b/flax/wallet/did_wallet/did_info.py @@ -1,14 +1,14 @@ 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.lineage_proof import LineageProof -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.lineage_proof import LineageProof +from flax.types.blockchain_format.program import Program +from flax.types.blockchain_format.coin import Coin -DID_HRP = "did:chia:" +DID_HRP = "did:flax:" @streamable diff --git a/chia/wallet/did_wallet/did_wallet.py b/flax/wallet/did_wallet/did_wallet.py similarity index 96% rename from chia/wallet/did_wallet/did_wallet.py rename to flax/wallet/did_wallet/did_wallet.py index fbb46e09a..92a28c35b 100644 --- a/chia/wallet/did_wallet/did_wallet.py +++ b/flax/wallet/did_wallet/did_wallet.py @@ -7,29 +7,29 @@ from typing import Dict, Optional, List, Any, Set, Tuple from blspy import AugSchemeMPL, G1Element, G2Element from secrets import token_bytes -from chia.protocols import wallet_protocol -from chia.protocols.wallet_protocol import CoinState -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_spend import CoinSpend -from chia.types.spend_bundle import SpendBundle -from chia.util.ints import uint64, uint32, uint8, uint128 -from chia.wallet.util.transaction_type import TransactionType -from chia.util.condition_tools import conditions_dict_for_solution, pkm_pairs_for_conditions_dict -from chia.wallet.did_wallet.did_info import DIDInfo -from chia.wallet.lineage_proof import LineageProof -from chia.wallet.transaction_record import TransactionRecord -from chia.wallet.util.wallet_types import WalletType -from chia.wallet.util.compute_memos import compute_memos -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_unhardened -from chia.wallet.puzzles.p2_delegated_puzzle_or_hidden_puzzle import ( +from flax.protocols import wallet_protocol +from flax.protocols.wallet_protocol import CoinState +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_spend import CoinSpend +from flax.types.spend_bundle import SpendBundle +from flax.util.ints import uint64, uint32, uint8, uint128 +from flax.wallet.util.transaction_type import TransactionType +from flax.util.condition_tools import conditions_dict_for_solution, pkm_pairs_for_conditions_dict +from flax.wallet.did_wallet.did_info import DIDInfo +from flax.wallet.lineage_proof import LineageProof +from flax.wallet.transaction_record import TransactionRecord +from flax.wallet.util.wallet_types import WalletType +from flax.wallet.util.compute_memos import compute_memos +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_unhardened +from flax.wallet.puzzles.p2_delegated_puzzle_or_hidden_puzzle import ( puzzle_for_pk, DEFAULT_HIDDEN_PUZZLE_HASH, calculate_synthetic_secret_key, @@ -487,19 +487,19 @@ async def load_parent(self, did_info: DIDInfo): await self.add_parent(coin.parent_coin_info, parent_info, True) assert parent_info is not None - async def create_tandem_xch_tx( + async def create_tandem_xfx_tx( self, fee: uint64, announcement_to_assert: Optional[Announcement] = None ) -> TransactionRecord: - chia_coins = await self.standard_wallet.select_coins(fee) - chia_tx = await self.standard_wallet.generate_signed_transaction( + flax_coins = await self.standard_wallet.select_coins(fee) + flax_tx = await self.standard_wallet.generate_signed_transaction( uint64(0), (await self.standard_wallet.get_new_puzzlehash()), fee=fee, - coins=chia_coins, + coins=flax_coins, coin_announcements_to_consume={announcement_to_assert} if announcement_to_assert is not None else None, ) - assert chia_tx.spend_bundle is not None - return chia_tx + assert flax_tx.spend_bundle is not None + return flax_tx def puzzle_for_pk(self, pubkey: G1Element) -> Program: if self.did_info.origin_coin is not None: @@ -574,14 +574,14 @@ async def create_update_spend(self, fee: uint64 = uint64(0)): spend_bundle = await self.sign(unsigned_spend_bundle) if fee > 0: announcement_to_make = coin.name() - chia_tx = await self.create_tandem_xch_tx(fee, Announcement(coin.name(), announcement_to_make)) + flax_tx = await self.create_tandem_xfx_tx(fee, Announcement(coin.name(), announcement_to_make)) else: announcement_to_make = None - chia_tx = None - if chia_tx is not None and chia_tx.spend_bundle is not None: - spend_bundle = SpendBundle.aggregate([spend_bundle, chia_tx.spend_bundle]) - chia_tx = dataclasses.replace(chia_tx, spend_bundle=None) - await self.wallet_state_manager.add_pending_transaction(chia_tx) + flax_tx = None + if flax_tx is not None and flax_tx.spend_bundle is not None: + spend_bundle = SpendBundle.aggregate([spend_bundle, flax_tx.spend_bundle]) + flax_tx = dataclasses.replace(flax_tx, spend_bundle=None) + await self.wallet_state_manager.add_pending_transaction(flax_tx) did_record = TransactionRecord( confirmed_at_height=uint32(0), created_at_time=uint64(int(time.time())), @@ -669,13 +669,13 @@ async def transfer_did(self, new_puzhash: bytes32, fee: uint64, with_recovery: b spend_bundle = await self.sign(unsigned_spend_bundle) if fee > 0: announcement_to_make = coin.name() - chia_tx = await self.create_tandem_xch_tx(fee, Announcement(coin.name(), announcement_to_make)) + flax_tx = await self.create_tandem_xfx_tx(fee, Announcement(coin.name(), announcement_to_make)) else: - chia_tx = None - if chia_tx is not None and chia_tx.spend_bundle is not None: - spend_bundle = SpendBundle.aggregate([spend_bundle, chia_tx.spend_bundle]) - chia_tx = dataclasses.replace(chia_tx, spend_bundle=None) - await self.wallet_state_manager.add_pending_transaction(chia_tx) + flax_tx = None + if flax_tx is not None and flax_tx.spend_bundle is not None: + spend_bundle = SpendBundle.aggregate([spend_bundle, flax_tx.spend_bundle]) + flax_tx = dataclasses.replace(flax_tx, spend_bundle=None) + await self.wallet_state_manager.add_pending_transaction(flax_tx) did_record = TransactionRecord( confirmed_at_height=uint32(0), created_at_time=uint64(int(time.time())), diff --git a/chia/wallet/did_wallet/did_wallet_puzzles.py b/flax/wallet/did_wallet/did_wallet_puzzles.py similarity index 93% rename from chia/wallet/did_wallet/did_wallet_puzzles.py rename to flax/wallet/did_wallet/did_wallet_puzzles.py index 1873e01ec..7c933fe47 100644 --- a/chia/wallet/did_wallet/did_wallet_puzzles.py +++ b/flax/wallet/did_wallet/did_wallet_puzzles.py @@ -1,12 +1,12 @@ -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, Iterator, Dict from blspy import G1Element -from chia.types.blockchain_format.coin import Coin -from chia.types.coin_spend import CoinSpend -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_spend import CoinSpend +from flax.util.ints import uint64 +from flax.wallet.puzzles.load_clvm import load_clvm +from flax.types.condition_opcodes import ConditionOpcode SINGLETON_TOP_LAYER_MOD = load_clvm("singleton_top_layer_v1_1.clvm") @@ -198,9 +198,9 @@ def check_is_did_puzzle(puzzle: Program) -> bool: def metadata_to_program(metadata: Dict) -> Program: """ - Convert the metadata dict to a Chialisp program + Convert the metadata dict to a Flaxlisp program :param metadata: User defined metadata - :return: Chialisp program + :return: Flaxlisp program """ kv_list = [] for key, value in metadata.items(): @@ -211,7 +211,7 @@ def metadata_to_program(metadata: Dict) -> Program: def program_to_metadata(program: Program) -> Dict: """ Convert a program to a metadata dict - :param program: Chialisp program contains the metadata + :param program: Flaxlisp program contains the metadata :return: Metadata dict """ metadata = {} 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 98% rename from chia/wallet/key_val_store.py rename to flax/wallet/key_val_store.py index 0232988b8..1fce2836a 100644 --- a/chia/wallet/key_val_store.py +++ b/flax/wallet/key_val_store.py @@ -2,7 +2,7 @@ import aiosqlite -from chia.util.db_wrapper import DBWrapper +from flax.util.db_wrapper import DBWrapper class KeyValStore: diff --git a/chia/wallet/lineage_proof.py b/flax/wallet/lineage_proof.py similarity index 78% rename from chia/wallet/lineage_proof.py rename to flax/wallet/lineage_proof.py index ec5d3119d..b4792a0d4 100644 --- a/chia/wallet/lineage_proof.py +++ b/flax/wallet/lineage_proof.py @@ -1,10 +1,10 @@ from dataclasses import dataclass from typing import Optional, Any, List -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.blockchain_format.program import Program -from chia.util.ints import uint64 -from chia.util.streamable import Streamable, streamable +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.blockchain_format.program import Program +from flax.util.ints import uint64 +from flax.util.streamable import Streamable, streamable @streamable diff --git a/chia/wallet/nft_wallet/__init__.py b/flax/wallet/nft_wallet/__init__.py similarity index 100% rename from chia/wallet/nft_wallet/__init__.py rename to flax/wallet/nft_wallet/__init__.py diff --git a/chia/wallet/nft_wallet/metadata_outer_puzzle.py b/flax/wallet/nft_wallet/metadata_outer_puzzle.py similarity index 92% rename from chia/wallet/nft_wallet/metadata_outer_puzzle.py rename to flax/wallet/nft_wallet/metadata_outer_puzzle.py index dfc756a72..161af4438 100644 --- a/chia/wallet/nft_wallet/metadata_outer_puzzle.py +++ b/flax/wallet/nft_wallet/metadata_outer_puzzle.py @@ -3,12 +3,12 @@ from clvm_tools.binutils import disassemble -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.util.ints import uint64 -from chia.wallet.puzzle_drivers import PuzzleInfo, Solver -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.util.ints import uint64 +from flax.wallet.puzzle_drivers import PuzzleInfo, Solver +from flax.wallet.puzzles.load_clvm import load_clvm NFT_STATE_LAYER_MOD = load_clvm("nft_state_layer.clvm") NFT_STATE_LAYER_MOD_HASH = NFT_STATE_LAYER_MOD.get_tree_hash() diff --git a/chia/wallet/nft_wallet/nft_info.py b/flax/wallet/nft_wallet/nft_info.py similarity index 84% rename from chia/wallet/nft_wallet/nft_info.py rename to flax/wallet/nft_wallet/nft_info.py index 83c02f1c4..bde1e6432 100644 --- a/chia/wallet/nft_wallet/nft_info.py +++ b/flax/wallet/nft_wallet/nft_info.py @@ -1,13 +1,13 @@ from dataclasses import dataclass from typing import List, 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.util.ints import uint16, uint32, uint64 -from chia.util.streamable import Streamable, streamable -from chia.wallet.lineage_proof import LineageProof -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.util.ints import uint16, uint32, uint64 +from flax.util.streamable import Streamable, streamable +from flax.wallet.lineage_proof import LineageProof +from flax.wallet.puzzles.load_clvm import load_clvm LAUNCHER_PUZZLE = load_clvm("singleton_launcher.clvm") IN_TRANSACTION_STATUS = "IN_TRANSACTION" diff --git a/chia/wallet/nft_wallet/nft_puzzles.py b/flax/wallet/nft_wallet/nft_puzzles.py similarity index 95% rename from chia/wallet/nft_wallet/nft_puzzles.py rename to flax/wallet/nft_wallet/nft_puzzles.py index c25ac6e83..c7e8a862f 100644 --- a/chia/wallet/nft_wallet/nft_puzzles.py +++ b/flax/wallet/nft_wallet/nft_puzzles.py @@ -4,13 +4,13 @@ from clvm.casts import int_from_bytes from clvm_tools.binutils import disassemble -from chia.types.blockchain_format.program import Program, SerializedProgram -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.ints import uint16, uint64 -from chia.wallet.nft_wallet.nft_info import NFTCoinInfo, NFTInfo -from chia.wallet.nft_wallet.uncurry_nft import UncurriedNFT -from chia.wallet.puzzles.load_clvm import load_clvm -from chia.wallet.puzzles.p2_delegated_puzzle_or_hidden_puzzle import solution_for_conditions +from flax.types.blockchain_format.program import Program, SerializedProgram +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.ints import uint16, uint64 +from flax.wallet.nft_wallet.nft_info import NFTCoinInfo, NFTInfo +from flax.wallet.nft_wallet.uncurry_nft import UncurriedNFT +from flax.wallet.puzzles.load_clvm import load_clvm +from flax.wallet.puzzles.p2_delegated_puzzle_or_hidden_puzzle import solution_for_conditions log = logging.getLogger(__name__) SINGLETON_TOP_LAYER_MOD = load_clvm("singleton_top_layer_v1_1.clvm") @@ -125,9 +125,9 @@ def get_nft_info_from_puzzle(nft_coin_info: NFTCoinInfo) -> NFTInfo: def metadata_to_program(metadata: Dict[bytes, Any]) -> Program: """ - Convert the metadata dict to a Chialisp program + Convert the metadata dict to a Flaxlisp program :param metadata: User defined metadata - :return: Chialisp program + :return: Flaxlisp program """ kv_list = [] for key, value in metadata.items(): @@ -139,7 +139,7 @@ def metadata_to_program(metadata: Dict[bytes, Any]) -> Program: def program_to_metadata(program: Program) -> Dict[bytes, Any]: """ Convert a program to a metadata dict - :param program: Chialisp program contains the metadata + :param program: Flaxlisp program contains the metadata :return: Metadata dict """ metadata = {} diff --git a/chia/wallet/nft_wallet/nft_wallet.py b/flax/wallet/nft_wallet/nft_wallet.py similarity index 94% rename from chia/wallet/nft_wallet/nft_wallet.py rename to flax/wallet/nft_wallet/nft_wallet.py index 0281f64b4..4318dedcc 100644 --- a/chia/wallet/nft_wallet/nft_wallet.py +++ b/flax/wallet/nft_wallet/nft_wallet.py @@ -6,39 +6,39 @@ from blspy import AugSchemeMPL, G2Element -from chia.protocols.wallet_protocol import CoinState -from chia.server.outbound_message import NodeType -from chia.server.ws_connection import WSChiaConnection -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_spend import CoinSpend -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.ints import uint8, uint16, uint32, uint64, uint128 -from chia.wallet.derivation_record import DerivationRecord -from chia.wallet.lineage_proof import LineageProof -from chia.wallet.nft_wallet import nft_puzzles -from chia.wallet.nft_wallet.nft_info import NFTCoinInfo, NFTWalletInfo -from chia.wallet.nft_wallet.nft_puzzles import NFT_METADATA_UPDATER, create_ownership_layer_puzzle, get_metadata_and_phs -from chia.wallet.nft_wallet.uncurry_nft import UncurriedNFT -from chia.wallet.outer_puzzles import AssetType, construct_puzzle, match_puzzle, solve_puzzle -from chia.wallet.payment import Payment -from chia.wallet.puzzle_drivers import PuzzleInfo, Solver -from chia.wallet.puzzles.p2_delegated_puzzle_or_hidden_puzzle import ( +from flax.protocols.wallet_protocol import CoinState +from flax.server.outbound_message import NodeType +from flax.server.ws_connection import WSFlaxConnection +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_spend import CoinSpend +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.ints import uint8, uint16, uint32, uint64, uint128 +from flax.wallet.derivation_record import DerivationRecord +from flax.wallet.lineage_proof import LineageProof +from flax.wallet.nft_wallet import nft_puzzles +from flax.wallet.nft_wallet.nft_info import NFTCoinInfo, NFTWalletInfo +from flax.wallet.nft_wallet.nft_puzzles import NFT_METADATA_UPDATER, create_ownership_layer_puzzle, get_metadata_and_phs +from flax.wallet.nft_wallet.uncurry_nft import UncurriedNFT +from flax.wallet.outer_puzzles import AssetType, construct_puzzle, match_puzzle, solve_puzzle +from flax.wallet.payment import Payment +from flax.wallet.puzzle_drivers import PuzzleInfo, Solver +from flax.wallet.puzzles.p2_delegated_puzzle_or_hidden_puzzle import ( DEFAULT_HIDDEN_PUZZLE_HASH, calculate_synthetic_secret_key, puzzle_for_pk, ) -from chia.wallet.trading.offer import OFFER_MOD, NotarizedPayment, Offer -from chia.wallet.transaction_record import TransactionRecord -from chia.wallet.util.compute_memos import compute_memos -from chia.wallet.util.debug_spend_bundle import disassemble -from chia.wallet.util.transaction_type import TransactionType -from chia.wallet.util.wallet_types import AmountWithPuzzlehash, WalletType -from chia.wallet.wallet import Wallet -from chia.wallet.wallet_info import WalletInfo +from flax.wallet.trading.offer import OFFER_MOD, NotarizedPayment, Offer +from flax.wallet.transaction_record import TransactionRecord +from flax.wallet.util.compute_memos import compute_memos +from flax.wallet.util.debug_spend_bundle import disassemble +from flax.wallet.util.transaction_type import TransactionType +from flax.wallet.util.wallet_types import AmountWithPuzzlehash, WalletType +from flax.wallet.wallet import Wallet +from flax.wallet.wallet_info import WalletInfo _T_NFTWallet = TypeVar("_T_NFTWallet", bound="NFTWallet") @@ -159,7 +159,7 @@ async def coin_added(self, coin: Coin, height: uint32, in_transaction: bool) -> return wallet_node = self.wallet_state_manager.wallet_node server = wallet_node.server - full_nodes: Dict[bytes32, WSChiaConnection] = server.connection_by_type.get(NodeType.FULL_NODE, {}) + full_nodes: Dict[bytes32, WSFlaxConnection] = server.connection_by_type.get(NodeType.FULL_NODE, {}) cs: Optional[CoinSpend] = None coin_states: Optional[List[CoinState]] = await self.wallet_state_manager.wallet_node.get_coin_state( [coin.parent_coin_info] @@ -584,19 +584,19 @@ async def create_from_puzzle_info( in_transaction, ) - async def create_tandem_xch_tx( + async def create_tandem_xfx_tx( self, fee: uint64, announcement_to_assert: Optional[Announcement] = None ) -> TransactionRecord: - chia_coins = await self.standard_wallet.select_coins(fee) - chia_tx = await self.standard_wallet.generate_signed_transaction( + flax_coins = await self.standard_wallet.select_coins(fee) + flax_tx = await self.standard_wallet.generate_signed_transaction( uint64(0), (await self.standard_wallet.get_new_puzzlehash()), fee=fee, - coins=chia_coins, + coins=flax_coins, coin_announcements_to_consume={announcement_to_assert} if announcement_to_assert is not None else None, ) - assert chia_tx.spend_bundle is not None - return chia_tx + assert flax_tx.spend_bundle is not None + return flax_tx async def generate_signed_transaction( self, @@ -629,7 +629,7 @@ async def generate_signed_transaction( payment_sum = sum([p.amount for p in payments]) - unsigned_spend_bundle, chia_tx = await self.generate_unsigned_spendbundle( + unsigned_spend_bundle, flax_tx = await self.generate_unsigned_spendbundle( payments, fee, coins=coins, @@ -643,9 +643,9 @@ async def generate_signed_transaction( ) spend_bundle = await self.sign(unsigned_spend_bundle) spend_bundle = SpendBundle.aggregate([spend_bundle] + additional_bundles) - if chia_tx is not None and chia_tx.spend_bundle is not None: - spend_bundle = SpendBundle.aggregate([spend_bundle, chia_tx.spend_bundle]) - chia_tx = dataclasses.replace(chia_tx, spend_bundle=None) + if flax_tx is not None and flax_tx.spend_bundle is not None: + spend_bundle = SpendBundle.aggregate([spend_bundle, flax_tx.spend_bundle]) + flax_tx = dataclasses.replace(flax_tx, spend_bundle=None) tx_list = [ TransactionRecord( @@ -668,8 +668,8 @@ async def generate_signed_transaction( ), ] - if chia_tx is not None: - tx_list.append(chia_tx) + if flax_tx is not None: + tx_list.append(flax_tx) return tx_list @@ -711,10 +711,10 @@ async def generate_unsigned_spendbundle( if fee > 0: announcement_to_make = nft_coin.coin.name() - chia_tx = await self.create_tandem_xch_tx(fee, Announcement(nft_coin.coin.name(), announcement_to_make)) + flax_tx = await self.create_tandem_xfx_tx(fee, Announcement(nft_coin.coin.name(), announcement_to_make)) else: announcement_to_make = None - chia_tx = None + flax_tx = None innersol: Program = self.standard_wallet.make_solution( primaries=primaries, @@ -752,7 +752,7 @@ async def generate_unsigned_spendbundle( nft_spend_bundle = SpendBundle([coin_spend], G2Element()) - return nft_spend_bundle, chia_tx + return nft_spend_bundle, flax_tx @staticmethod async def make_nft1_offer( @@ -838,7 +838,7 @@ async def make_nft1_offer( if offered_amount == royalty_amount: raise ValueError("Amount offered and amount paid in royalties are equal") if offered_asset_id is None: - # std xch offer + # std xfx offer wallet = wallet_state_manager.main_wallet else: # cat offer diff --git a/chia/wallet/nft_wallet/ownership_outer_puzzle.py b/flax/wallet/nft_wallet/ownership_outer_puzzle.py similarity index 94% rename from chia/wallet/nft_wallet/ownership_outer_puzzle.py rename to flax/wallet/nft_wallet/ownership_outer_puzzle.py index 82e2e6ff3..bd1d380ba 100644 --- a/chia/wallet/nft_wallet/ownership_outer_puzzle.py +++ b/flax/wallet/nft_wallet/ownership_outer_puzzle.py @@ -3,10 +3,10 @@ from clvm_tools.binutils import disassemble -from chia.types.blockchain_format.program import Program -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.wallet.puzzle_drivers import PuzzleInfo, Solver -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.wallet.puzzle_drivers import PuzzleInfo, Solver +from flax.wallet.puzzles.load_clvm import load_clvm OWNERSHIP_LAYER_MOD = load_clvm("nft_ownership_layer.clvm") diff --git a/chia/wallet/nft_wallet/singleton_outer_puzzle.py b/flax/wallet/nft_wallet/singleton_outer_puzzle.py similarity index 89% rename from chia/wallet/nft_wallet/singleton_outer_puzzle.py rename to flax/wallet/nft_wallet/singleton_outer_puzzle.py index 07c7cda4c..fa3af4b81 100644 --- a/chia/wallet/nft_wallet/singleton_outer_puzzle.py +++ b/flax/wallet/nft_wallet/singleton_outer_puzzle.py @@ -1,14 +1,14 @@ from dataclasses import dataclass from typing import Any, 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.types.coin_spend import CoinSpend -from chia.util.ints import uint64 -from chia.wallet.lineage_proof import LineageProof -from chia.wallet.puzzle_drivers import PuzzleInfo, Solver -from chia.wallet.puzzles.singleton_top_layer_v1_1 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_spend import CoinSpend +from flax.util.ints import uint64 +from flax.wallet.lineage_proof import LineageProof +from flax.wallet.puzzle_drivers import PuzzleInfo, Solver +from flax.wallet.puzzles.singleton_top_layer_v1_1 import ( SINGLETON_LAUNCHER_HASH, match_singleton_puzzle, puzzle_for_singleton, diff --git a/chia/wallet/nft_wallet/transfer_program_puzzle.py b/flax/wallet/nft_wallet/transfer_program_puzzle.py similarity index 89% rename from chia/wallet/nft_wallet/transfer_program_puzzle.py rename to flax/wallet/nft_wallet/transfer_program_puzzle.py index 7039f0bf6..2c7c8fd71 100644 --- a/chia/wallet/nft_wallet/transfer_program_puzzle.py +++ b/flax/wallet/nft_wallet/transfer_program_puzzle.py @@ -1,12 +1,12 @@ from dataclasses import dataclass from typing import Any, List, Optional, Tuple -from chia.types.blockchain_format.program import Program -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.ints import uint16 -from chia.wallet.puzzle_drivers import PuzzleInfo, Solver -from chia.wallet.puzzles.load_clvm import load_clvm -from chia.wallet.puzzles.singleton_top_layer_v1_1 import SINGLETON_LAUNCHER_HASH, SINGLETON_MOD_HASH +from flax.types.blockchain_format.program import Program +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.ints import uint16 +from flax.wallet.puzzle_drivers import PuzzleInfo, Solver +from flax.wallet.puzzles.load_clvm import load_clvm +from flax.wallet.puzzles.singleton_top_layer_v1_1 import SINGLETON_LAUNCHER_HASH, SINGLETON_MOD_HASH TRANSFER_PROGRAM_MOD = load_clvm("nft_ownership_transfer_program_one_way_claim_with_royalties.clvm") diff --git a/chia/wallet/nft_wallet/uncurry_nft.py b/flax/wallet/nft_wallet/uncurry_nft.py similarity index 96% rename from chia/wallet/nft_wallet/uncurry_nft.py rename to flax/wallet/nft_wallet/uncurry_nft.py index ce3385f9e..33a9a46d2 100644 --- a/chia/wallet/nft_wallet/uncurry_nft.py +++ b/flax/wallet/nft_wallet/uncurry_nft.py @@ -4,10 +4,10 @@ from dataclasses import dataclass from typing import Optional, Type, TypeVar -from chia.types.blockchain_format.program import Program -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.ints import uint16 -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.util.ints import uint16 +from flax.wallet.puzzles.load_clvm import load_clvm log = logging.getLogger(__name__) SINGLETON_TOP_LAYER_MOD = load_clvm("singleton_top_layer_v1_1.clvm") @@ -22,7 +22,7 @@ class UncurriedNFT: """ A simple solution for uncurry NFT puzzle. Initial the class with a full NFT puzzle, it will do a deep uncurry. - This is the only place you need to change after modified the Chialisp curried parameters. + This is the only place you need to change after modified the Flaxlisp curried parameters. """ nft_mod_hash: bytes32 diff --git a/chia/wallet/outer_puzzles.py b/flax/wallet/outer_puzzles.py similarity index 87% rename from chia/wallet/outer_puzzles.py rename to flax/wallet/outer_puzzles.py index eb862549a..1630b48f4 100644 --- a/chia/wallet/outer_puzzles.py +++ b/flax/wallet/outer_puzzles.py @@ -1,14 +1,14 @@ from enum import Enum from typing import Any, Dict, Optional -from chia.types.blockchain_format.program import Program -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.wallet.cat_wallet.cat_outer_puzzle import CATOuterPuzzle -from chia.wallet.nft_wallet.metadata_outer_puzzle import MetadataOuterPuzzle -from chia.wallet.nft_wallet.ownership_outer_puzzle import OwnershipOuterPuzzle -from chia.wallet.nft_wallet.singleton_outer_puzzle import SingletonOuterPuzzle -from chia.wallet.nft_wallet.transfer_program_puzzle import TransferProgramPuzzle -from chia.wallet.puzzle_drivers import PuzzleInfo, Solver +from flax.types.blockchain_format.program import Program +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.wallet.cat_wallet.cat_outer_puzzle import CATOuterPuzzle +from flax.wallet.nft_wallet.metadata_outer_puzzle import MetadataOuterPuzzle +from flax.wallet.nft_wallet.ownership_outer_puzzle import OwnershipOuterPuzzle +from flax.wallet.nft_wallet.singleton_outer_puzzle import SingletonOuterPuzzle +from flax.wallet.nft_wallet.transfer_program_puzzle import TransferProgramPuzzle +from flax.wallet.puzzle_drivers import PuzzleInfo, Solver """ This file provides a central location for acquiring drivers for outer puzzles like CATs, NFTs, etc. diff --git a/chia/wallet/payment.py b/flax/wallet/payment.py similarity index 85% rename from chia/wallet/payment.py rename to flax/wallet/payment.py index 3293376a8..93258c517 100644 --- a/chia/wallet/payment.py +++ b/flax/wallet/payment.py @@ -2,9 +2,9 @@ from typing import List -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.blockchain_format.program import Program -from chia.util.ints import uint64 +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.blockchain_format.program import Program +from flax.util.ints import uint64 # This class is supposed to correspond to a CREATE_COIN condition diff --git a/chia/wallet/puzzle_drivers.py b/flax/wallet/puzzle_drivers.py similarity index 98% rename from chia/wallet/puzzle_drivers.py rename to flax/wallet/puzzle_drivers.py index dec0d01e9..0bd5debe7 100644 --- a/chia/wallet/puzzle_drivers.py +++ b/flax/wallet/puzzle_drivers.py @@ -6,7 +6,7 @@ from clvm_tools.binutils import assemble, type_for_atom from ir.Type import Type -from chia.types.blockchain_format.program import Program +from flax.types.blockchain_format.program import Program """ The following two classes act as wrapper classes around dictionaries of strings. 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/cat.clvm b/flax/wallet/puzzles/cat.clvm similarity index 100% rename from chia/wallet/puzzles/cat.clvm rename to flax/wallet/puzzles/cat.clvm diff --git a/chia/wallet/puzzles/cat.clvm.hex b/flax/wallet/puzzles/cat.clvm.hex similarity index 100% rename from chia/wallet/puzzles/cat.clvm.hex rename to flax/wallet/puzzles/cat.clvm.hex diff --git a/chia/wallet/puzzles/cat.clvm.hex.sha256tree b/flax/wallet/puzzles/cat.clvm.hex.sha256tree similarity index 100% rename from chia/wallet/puzzles/cat.clvm.hex.sha256tree rename to flax/wallet/puzzles/cat.clvm.hex.sha256tree diff --git a/chia/wallet/puzzles/cat_loader.py b/flax/wallet/puzzles/cat_loader.py similarity index 74% rename from chia/wallet/puzzles/cat_loader.py rename to flax/wallet/puzzles/cat_loader.py index 448fea212..5fdb60ea3 100644 --- a/chia/wallet/puzzles/cat_loader.py +++ b/flax/wallet/puzzles/cat_loader.py @@ -1,4 +1,4 @@ -from chia.wallet.puzzles.load_clvm import load_clvm +from flax.wallet.puzzles.load_clvm import load_clvm CAT_MOD = load_clvm("cat.clvm", package_or_requirement=__name__) LOCK_INNER_PUZZLE = load_clvm("lock.inner.puzzle.clvm", package_or_requirement=__name__) diff --git a/chia/wallet/puzzles/cat_truths.clib b/flax/wallet/puzzles/cat_truths.clib similarity index 100% rename from chia/wallet/puzzles/cat_truths.clib rename to flax/wallet/puzzles/cat_truths.clib 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/condition_codes.clvm.hex b/flax/wallet/puzzles/condition_codes.clvm.hex similarity index 100% rename from chia/wallet/puzzles/condition_codes.clvm.hex rename to flax/wallet/puzzles/condition_codes.clvm.hex diff --git a/chia/wallet/puzzles/counter.clvm.hex b/flax/wallet/puzzles/counter.clvm.hex similarity index 100% rename from chia/wallet/puzzles/counter.clvm.hex rename to flax/wallet/puzzles/counter.clvm.hex 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 b/flax/wallet/puzzles/create-lock-puzzlehash.clvm.hex similarity index 100% rename from chia/wallet/puzzles/create-lock-puzzlehash.clvm.hex rename to flax/wallet/puzzles/create-lock-puzzlehash.clvm.hex 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/curry-and-treehash.clinc b/flax/wallet/puzzles/curry-and-treehash.clinc similarity index 100% rename from chia/wallet/puzzles/curry-and-treehash.clinc rename to flax/wallet/puzzles/curry-and-treehash.clinc diff --git a/chia/wallet/puzzles/decompress_coin_spend_entry.clvm b/flax/wallet/puzzles/decompress_coin_spend_entry.clvm similarity index 100% rename from chia/wallet/puzzles/decompress_coin_spend_entry.clvm rename to flax/wallet/puzzles/decompress_coin_spend_entry.clvm diff --git a/chia/wallet/puzzles/decompress_coin_spend_entry.clvm.hex b/flax/wallet/puzzles/decompress_coin_spend_entry.clvm.hex similarity index 100% rename from chia/wallet/puzzles/decompress_coin_spend_entry.clvm.hex rename to flax/wallet/puzzles/decompress_coin_spend_entry.clvm.hex diff --git a/chia/wallet/puzzles/decompress_coin_spend_entry.clvm.hex.sha256tree b/flax/wallet/puzzles/decompress_coin_spend_entry.clvm.hex.sha256tree similarity index 100% rename from chia/wallet/puzzles/decompress_coin_spend_entry.clvm.hex.sha256tree rename to flax/wallet/puzzles/decompress_coin_spend_entry.clvm.hex.sha256tree diff --git a/chia/wallet/puzzles/decompress_coin_spend_entry_with_prefix.clvm b/flax/wallet/puzzles/decompress_coin_spend_entry_with_prefix.clvm similarity index 100% rename from chia/wallet/puzzles/decompress_coin_spend_entry_with_prefix.clvm rename to flax/wallet/puzzles/decompress_coin_spend_entry_with_prefix.clvm diff --git a/chia/wallet/puzzles/decompress_coin_spend_entry_with_prefix.clvm.hex b/flax/wallet/puzzles/decompress_coin_spend_entry_with_prefix.clvm.hex similarity index 100% rename from chia/wallet/puzzles/decompress_coin_spend_entry_with_prefix.clvm.hex rename to flax/wallet/puzzles/decompress_coin_spend_entry_with_prefix.clvm.hex diff --git a/chia/wallet/puzzles/decompress_coin_spend_entry_with_prefix.clvm.hex.sha256tree b/flax/wallet/puzzles/decompress_coin_spend_entry_with_prefix.clvm.hex.sha256tree similarity index 100% rename from chia/wallet/puzzles/decompress_coin_spend_entry_with_prefix.clvm.hex.sha256tree rename to flax/wallet/puzzles/decompress_coin_spend_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/delegated_tail.clvm b/flax/wallet/puzzles/delegated_tail.clvm similarity index 100% rename from chia/wallet/puzzles/delegated_tail.clvm rename to flax/wallet/puzzles/delegated_tail.clvm diff --git a/chia/wallet/puzzles/delegated_tail.clvm.hex b/flax/wallet/puzzles/delegated_tail.clvm.hex similarity index 100% rename from chia/wallet/puzzles/delegated_tail.clvm.hex rename to flax/wallet/puzzles/delegated_tail.clvm.hex diff --git a/chia/wallet/puzzles/delegated_tail.clvm.hex.sha256tree b/flax/wallet/puzzles/delegated_tail.clvm.hex.sha256tree similarity index 100% rename from chia/wallet/puzzles/delegated_tail.clvm.hex.sha256tree rename to flax/wallet/puzzles/delegated_tail.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/everything_with_signature.clvm b/flax/wallet/puzzles/everything_with_signature.clvm similarity index 100% rename from chia/wallet/puzzles/everything_with_signature.clvm rename to flax/wallet/puzzles/everything_with_signature.clvm diff --git a/chia/wallet/puzzles/everything_with_signature.clvm.hex b/flax/wallet/puzzles/everything_with_signature.clvm.hex similarity index 100% rename from chia/wallet/puzzles/everything_with_signature.clvm.hex rename to flax/wallet/puzzles/everything_with_signature.clvm.hex diff --git a/chia/wallet/puzzles/everything_with_signature.clvm.hex.sha256tree b/flax/wallet/puzzles/everything_with_signature.clvm.hex.sha256tree similarity index 100% rename from chia/wallet/puzzles/everything_with_signature.clvm.hex.sha256tree rename to flax/wallet/puzzles/everything_with_signature.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 81f916b1e..88eca2c82 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.clvm b/flax/wallet/puzzles/genesis_by_coin_id.clvm similarity index 100% rename from chia/wallet/puzzles/genesis_by_coin_id.clvm rename to flax/wallet/puzzles/genesis_by_coin_id.clvm diff --git a/chia/wallet/puzzles/genesis_by_coin_id.clvm.hex b/flax/wallet/puzzles/genesis_by_coin_id.clvm.hex similarity index 100% rename from chia/wallet/puzzles/genesis_by_coin_id.clvm.hex rename to flax/wallet/puzzles/genesis_by_coin_id.clvm.hex diff --git a/chia/wallet/puzzles/genesis_by_coin_id.clvm.hex.sha256tree b/flax/wallet/puzzles/genesis_by_coin_id.clvm.hex.sha256tree similarity index 100% rename from chia/wallet/puzzles/genesis_by_coin_id.clvm.hex.sha256tree rename to flax/wallet/puzzles/genesis_by_coin_id.clvm.hex.sha256tree diff --git a/chia/wallet/puzzles/genesis_by_puzzle_hash.clvm b/flax/wallet/puzzles/genesis_by_puzzle_hash.clvm similarity index 100% rename from chia/wallet/puzzles/genesis_by_puzzle_hash.clvm rename to flax/wallet/puzzles/genesis_by_puzzle_hash.clvm diff --git a/chia/wallet/puzzles/genesis_by_puzzle_hash.clvm.hex b/flax/wallet/puzzles/genesis_by_puzzle_hash.clvm.hex similarity index 100% rename from chia/wallet/puzzles/genesis_by_puzzle_hash.clvm.hex rename to flax/wallet/puzzles/genesis_by_puzzle_hash.clvm.hex diff --git a/chia/wallet/puzzles/genesis_by_puzzle_hash.clvm.hex.sha256tree b/flax/wallet/puzzles/genesis_by_puzzle_hash.clvm.hex.sha256tree similarity index 100% rename from chia/wallet/puzzles/genesis_by_puzzle_hash.clvm.hex.sha256tree rename to flax/wallet/puzzles/genesis_by_puzzle_hash.clvm.hex.sha256tree diff --git a/chia/wallet/puzzles/index_lock.clvm.hex b/flax/wallet/puzzles/index_lock.clvm.hex similarity index 100% rename from chia/wallet/puzzles/index_lock.clvm.hex rename to flax/wallet/puzzles/index_lock.clvm.hex diff --git a/chia/wallet/puzzles/json.clib b/flax/wallet/puzzles/json.clib similarity index 100% rename from chia/wallet/puzzles/json.clib rename to flax/wallet/puzzles/json.clib diff --git a/chia/wallet/puzzles/load_clvm.py b/flax/wallet/puzzles/load_clvm.py similarity index 97% rename from chia/wallet/puzzles/load_clvm.py rename to flax/wallet/puzzles/load_clvm.py index 89e2a2a5f..0e8a3f710 100644 --- a/chia/wallet/puzzles/load_clvm.py +++ b/flax/wallet/puzzles/load_clvm.py @@ -5,8 +5,8 @@ import pathlib import pkg_resources -from chia.types.blockchain_format.program import Program, SerializedProgram -from chia.util.lock import lock_by_path +from flax.types.blockchain_format.program import Program, SerializedProgram +from flax.util.lock import lock_by_path from clvm_tools_rs import compile_clvm as compile_clvm_rust 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/nft_metadata_updater.clvm.hex.sha256tree b/flax/wallet/puzzles/nft_metadata_updater.clvm.hex.sha256tree similarity index 100% rename from chia/wallet/puzzles/nft_metadata_updater.clvm.hex.sha256tree rename to flax/wallet/puzzles/nft_metadata_updater.clvm.hex.sha256tree diff --git a/chia/wallet/puzzles/nft_metadata_updater_default.clvm b/flax/wallet/puzzles/nft_metadata_updater_default.clvm similarity index 100% rename from chia/wallet/puzzles/nft_metadata_updater_default.clvm rename to flax/wallet/puzzles/nft_metadata_updater_default.clvm diff --git a/chia/wallet/puzzles/nft_metadata_updater_default.clvm.hex b/flax/wallet/puzzles/nft_metadata_updater_default.clvm.hex similarity index 100% rename from chia/wallet/puzzles/nft_metadata_updater_default.clvm.hex rename to flax/wallet/puzzles/nft_metadata_updater_default.clvm.hex diff --git a/chia/wallet/puzzles/nft_metadata_updater_default.clvm.hex.sha256tree b/flax/wallet/puzzles/nft_metadata_updater_default.clvm.hex.sha256tree similarity index 100% rename from chia/wallet/puzzles/nft_metadata_updater_default.clvm.hex.sha256tree rename to flax/wallet/puzzles/nft_metadata_updater_default.clvm.hex.sha256tree diff --git a/chia/wallet/puzzles/nft_metadata_updater_updateable.clvm b/flax/wallet/puzzles/nft_metadata_updater_updateable.clvm similarity index 100% rename from chia/wallet/puzzles/nft_metadata_updater_updateable.clvm rename to flax/wallet/puzzles/nft_metadata_updater_updateable.clvm diff --git a/chia/wallet/puzzles/nft_metadata_updater_updateable.clvm.hex b/flax/wallet/puzzles/nft_metadata_updater_updateable.clvm.hex similarity index 100% rename from chia/wallet/puzzles/nft_metadata_updater_updateable.clvm.hex rename to flax/wallet/puzzles/nft_metadata_updater_updateable.clvm.hex diff --git a/chia/wallet/puzzles/nft_metadata_updater_updateable.clvm.hex.sha256tree b/flax/wallet/puzzles/nft_metadata_updater_updateable.clvm.hex.sha256tree similarity index 100% rename from chia/wallet/puzzles/nft_metadata_updater_updateable.clvm.hex.sha256tree rename to flax/wallet/puzzles/nft_metadata_updater_updateable.clvm.hex.sha256tree diff --git a/chia/wallet/puzzles/nft_ownership_layer.clvm b/flax/wallet/puzzles/nft_ownership_layer.clvm similarity index 100% rename from chia/wallet/puzzles/nft_ownership_layer.clvm rename to flax/wallet/puzzles/nft_ownership_layer.clvm diff --git a/chia/wallet/puzzles/nft_ownership_layer.clvm.hex b/flax/wallet/puzzles/nft_ownership_layer.clvm.hex similarity index 100% rename from chia/wallet/puzzles/nft_ownership_layer.clvm.hex rename to flax/wallet/puzzles/nft_ownership_layer.clvm.hex diff --git a/chia/wallet/puzzles/nft_ownership_layer.clvm.hex.sha256tree b/flax/wallet/puzzles/nft_ownership_layer.clvm.hex.sha256tree similarity index 100% rename from chia/wallet/puzzles/nft_ownership_layer.clvm.hex.sha256tree rename to flax/wallet/puzzles/nft_ownership_layer.clvm.hex.sha256tree diff --git a/chia/wallet/puzzles/nft_ownership_transfer_program_one_way_claim_with_royalties.clvm b/flax/wallet/puzzles/nft_ownership_transfer_program_one_way_claim_with_royalties.clvm similarity index 99% rename from chia/wallet/puzzles/nft_ownership_transfer_program_one_way_claim_with_royalties.clvm rename to flax/wallet/puzzles/nft_ownership_transfer_program_one_way_claim_with_royalties.clvm index a297a00f3..5daac4a53 100644 --- a/chia/wallet/puzzles/nft_ownership_transfer_program_one_way_claim_with_royalties.clvm +++ b/flax/wallet/puzzles/nft_ownership_transfer_program_one_way_claim_with_royalties.clvm @@ -33,7 +33,7 @@ (f (divmod (* amount percentage) TEN_THOUSAND)) ) - ; Loop of the trade prices list and either assert a puzzle announcement or generate xch + ; Loop of the trade prices list and either assert a puzzle announcement or generate xfx (defun parse_trade_prices_list (ROYALTY_ADDRESS TRADE_PRICE_PERCENTAGE trade_prices_list my_nft_id) (if trade_prices_list (c diff --git a/chia/wallet/puzzles/nft_ownership_transfer_program_one_way_claim_with_royalties.clvm.hex b/flax/wallet/puzzles/nft_ownership_transfer_program_one_way_claim_with_royalties.clvm.hex similarity index 100% rename from chia/wallet/puzzles/nft_ownership_transfer_program_one_way_claim_with_royalties.clvm.hex rename to flax/wallet/puzzles/nft_ownership_transfer_program_one_way_claim_with_royalties.clvm.hex diff --git a/chia/wallet/puzzles/nft_ownership_transfer_program_one_way_claim_with_royalties.clvm.hex.sha256tree b/flax/wallet/puzzles/nft_ownership_transfer_program_one_way_claim_with_royalties.clvm.hex.sha256tree similarity index 100% rename from chia/wallet/puzzles/nft_ownership_transfer_program_one_way_claim_with_royalties.clvm.hex.sha256tree rename to flax/wallet/puzzles/nft_ownership_transfer_program_one_way_claim_with_royalties.clvm.hex.sha256tree diff --git a/chia/wallet/puzzles/nft_state_layer.clvm b/flax/wallet/puzzles/nft_state_layer.clvm similarity index 100% rename from chia/wallet/puzzles/nft_state_layer.clvm rename to flax/wallet/puzzles/nft_state_layer.clvm diff --git a/chia/wallet/puzzles/nft_state_layer.clvm.hex b/flax/wallet/puzzles/nft_state_layer.clvm.hex similarity index 100% rename from chia/wallet/puzzles/nft_state_layer.clvm.hex rename to flax/wallet/puzzles/nft_state_layer.clvm.hex diff --git a/chia/wallet/puzzles/nft_state_layer.clvm.hex.sha256tree b/flax/wallet/puzzles/nft_state_layer.clvm.hex.sha256tree similarity index 100% rename from chia/wallet/puzzles/nft_state_layer.clvm.hex.sha256tree rename to flax/wallet/puzzles/nft_state_layer.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 94% 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 a55704a58..b82ed530c 100644 --- a/chia/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.py +++ b/flax/wallet/puzzles/p2_delegated_puzzle_or_hidden_puzzle.py @@ -15,7 +15,7 @@ Note: -p2_delegated_puzzle_or_hidden_puzzle is essentially the "standard coin" in chia. +p2_delegated_puzzle_or_hidden_puzzle is essentially the "standard coin" in flax. DEFAULT_HIDDEN_PUZZLE_HASH from this puzzle is used with calculate_synthetic_secret_key in the wallet's standard pk_to_sk finder. @@ -28,7 +28,7 @@ level a set of auxiliary sk/pk pairs which are used for specific coins. These can be used for signing in AGG_SIG_ME, but the standard coin uses a key further derived from one of these via calculate_synthetic_secret_key as described in - https://chialisp.com/docs/standard_transaction. Therefore, when a wallet needs + https://flaxlisp.com/docs/standard_transaction. Therefore, when a wallet needs to find a secret key for signing based on a public key, it needs to try repeating this derivation as well and see if the G1Element (pk) associated with any of the derived secret keys matches the pk requested by the coin. @@ -38,7 +38,7 @@ delegated_puzzle_solution = Program.to((1, condition_args)) solutions = Program.to([[], delgated_puzzle_solution, []]) - In context, delegated_puzzle_solution here is any *chialisp program*, here one + In context, delegated_puzzle_solution here is any *flaxlisp program*, here one simply quoting a list of conditions, and the following argument is the arguments to this program, which here are unused. Secondly, the actual arguments to the p2_delegated_puzzle_or_hidden_puzzle are given. The first argument determines @@ -48,7 +48,7 @@ In most cases, the puzzle will be revealed, and this argument will be the nil object, () (represented here by an empty python list). - The second and third arguments are a chialisp program and its corresponding + The second and third arguments are a flaxlisp program and its corresponding arguments, which will be run inside the standard coin puzzle. This interacts with sign_coin_spend in that the AGG_SIG_ME condition added by the inner puzzle asks the surrounding system to provide a signature over the provided program with a synthetic @@ -61,8 +61,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/p2_singleton.clvm b/flax/wallet/puzzles/p2_singleton.clvm similarity index 100% rename from chia/wallet/puzzles/p2_singleton.clvm rename to flax/wallet/puzzles/p2_singleton.clvm diff --git a/chia/wallet/puzzles/p2_singleton.clvm.hex b/flax/wallet/puzzles/p2_singleton.clvm.hex similarity index 100% rename from chia/wallet/puzzles/p2_singleton.clvm.hex rename to flax/wallet/puzzles/p2_singleton.clvm.hex diff --git a/chia/wallet/puzzles/p2_singleton.clvm.hex.sha256tree b/flax/wallet/puzzles/p2_singleton.clvm.hex.sha256tree similarity index 100% rename from chia/wallet/puzzles/p2_singleton.clvm.hex.sha256tree rename to flax/wallet/puzzles/p2_singleton.clvm.hex.sha256tree diff --git a/chia/wallet/puzzles/p2_singleton_or_delayed_puzhash.clvm b/flax/wallet/puzzles/p2_singleton_or_delayed_puzhash.clvm similarity index 100% rename from chia/wallet/puzzles/p2_singleton_or_delayed_puzhash.clvm rename to flax/wallet/puzzles/p2_singleton_or_delayed_puzhash.clvm diff --git a/chia/wallet/puzzles/p2_singleton_or_delayed_puzhash.clvm.hex b/flax/wallet/puzzles/p2_singleton_or_delayed_puzhash.clvm.hex similarity index 100% rename from chia/wallet/puzzles/p2_singleton_or_delayed_puzhash.clvm.hex rename to flax/wallet/puzzles/p2_singleton_or_delayed_puzhash.clvm.hex diff --git a/chia/wallet/puzzles/p2_singleton_or_delayed_puzhash.clvm.hex.sha256tree b/flax/wallet/puzzles/p2_singleton_or_delayed_puzhash.clvm.hex.sha256tree similarity index 100% rename from chia/wallet/puzzles/p2_singleton_or_delayed_puzhash.clvm.hex.sha256tree rename to flax/wallet/puzzles/p2_singleton_or_delayed_puzhash.clvm.hex.sha256tree diff --git a/chia/wallet/puzzles/pool_member_innerpuz.clvm b/flax/wallet/puzzles/pool_member_innerpuz.clvm similarity index 100% rename from chia/wallet/puzzles/pool_member_innerpuz.clvm rename to flax/wallet/puzzles/pool_member_innerpuz.clvm diff --git a/chia/wallet/puzzles/pool_member_innerpuz.clvm.hex b/flax/wallet/puzzles/pool_member_innerpuz.clvm.hex similarity index 100% rename from chia/wallet/puzzles/pool_member_innerpuz.clvm.hex rename to flax/wallet/puzzles/pool_member_innerpuz.clvm.hex diff --git a/chia/wallet/puzzles/pool_member_innerpuz.clvm.hex.sha256tree b/flax/wallet/puzzles/pool_member_innerpuz.clvm.hex.sha256tree similarity index 100% rename from chia/wallet/puzzles/pool_member_innerpuz.clvm.hex.sha256tree rename to flax/wallet/puzzles/pool_member_innerpuz.clvm.hex.sha256tree diff --git a/chia/wallet/puzzles/pool_waitingroom_innerpuz.clvm b/flax/wallet/puzzles/pool_waitingroom_innerpuz.clvm similarity index 100% rename from chia/wallet/puzzles/pool_waitingroom_innerpuz.clvm rename to flax/wallet/puzzles/pool_waitingroom_innerpuz.clvm diff --git a/chia/wallet/puzzles/pool_waitingroom_innerpuz.clvm.hex b/flax/wallet/puzzles/pool_waitingroom_innerpuz.clvm.hex similarity index 100% rename from chia/wallet/puzzles/pool_waitingroom_innerpuz.clvm.hex rename to flax/wallet/puzzles/pool_waitingroom_innerpuz.clvm.hex diff --git a/chia/wallet/puzzles/pool_waitingroom_innerpuz.clvm.hex.sha256tree b/flax/wallet/puzzles/pool_waitingroom_innerpuz.clvm.hex.sha256tree similarity index 100% rename from chia/wallet/puzzles/pool_waitingroom_innerpuz.clvm.hex.sha256tree rename to flax/wallet/puzzles/pool_waitingroom_innerpuz.clvm.hex.sha256tree diff --git a/chia/wallet/puzzles/prefarm/__init__.py b/flax/wallet/puzzles/prefarm/__init__.py similarity index 100% rename from chia/wallet/puzzles/prefarm/__init__.py rename to flax/wallet/puzzles/prefarm/__init__.py 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 f393bc69c..32ec15340 100644 --- a/chia/wallet/puzzles/prefarm/make_prefarm_ph.py +++ b/flax/wallet/puzzles/prefarm/make_prefarm_ph.py @@ -1,16 +1,16 @@ 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 chia.types.blockchain_format.sized_bytes import bytes32 +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 +from flax.types.blockchain_format.sized_bytes import bytes32 -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) @@ -33,32 +33,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(bytes32(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 80% rename from chia/wallet/puzzles/prefarm/spend_prefarm.py rename to flax/wallet/puzzles/prefarm/spend_prefarm.py index 060376592..5e4f90f1d 100644 --- a/chia/wallet/puzzles/prefarm/spend_prefarm.py +++ b/flax/wallet/puzzles/prefarm/spend_prefarm.py @@ -3,17 +3,17 @@ 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_spend import CoinSpend -from chia.types.condition_opcodes import ConditionOpcode -from chia.types.spend_bundle import SpendBundle -from chia.util.bech32m import decode_puzzle_hash -from chia.util.condition_tools import parse_sexp_to_conditions -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_spend import CoinSpend +from flax.types.condition_opcodes import ConditionOpcode +from flax.types.spend_bundle import SpendBundle +from flax.util.bech32m import decode_puzzle_hash +from flax.util.condition_tools import parse_sexp_to_conditions +from flax.util.config import load_config +from flax.util.default_root import DEFAULT_ROOT_PATH +from flax.util.ints import uint32, uint16 def print_conditions(spend_bundle: SpendBundle): @@ -43,8 +43,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 97% rename from chia/wallet/puzzles/puzzle_utils.py rename to flax/wallet/puzzles/puzzle_utils.py index cc863e092..0862b1a38 100644 --- a/chia/wallet/puzzles/puzzle_utils.py +++ b/flax/wallet/puzzles/puzzle_utils.py @@ -1,6 +1,6 @@ from typing import Optional, List -from chia.types.condition_opcodes import ConditionOpcode +from flax.types.condition_opcodes import ConditionOpcode def make_create_coin_condition(puzzle_hash, amount, memos: Optional[List[bytes]]) -> List: 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 5e3881598..efd3a4e11 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/settlement_payments.clvm b/flax/wallet/puzzles/settlement_payments.clvm similarity index 100% rename from chia/wallet/puzzles/settlement_payments.clvm rename to flax/wallet/puzzles/settlement_payments.clvm diff --git a/chia/wallet/puzzles/settlement_payments.clvm.hex b/flax/wallet/puzzles/settlement_payments.clvm.hex similarity index 100% rename from chia/wallet/puzzles/settlement_payments.clvm.hex rename to flax/wallet/puzzles/settlement_payments.clvm.hex diff --git a/chia/wallet/puzzles/settlement_payments.clvm.hex.sha256tree b/flax/wallet/puzzles/settlement_payments.clvm.hex.sha256tree similarity index 100% rename from chia/wallet/puzzles/settlement_payments.clvm.hex.sha256tree rename to flax/wallet/puzzles/settlement_payments.clvm.hex.sha256tree diff --git a/chia/wallet/puzzles/sha256tree.clib b/flax/wallet/puzzles/sha256tree.clib similarity index 100% rename from chia/wallet/puzzles/sha256tree.clib rename to flax/wallet/puzzles/sha256tree.clib 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_launcher.clvm b/flax/wallet/puzzles/singleton_launcher.clvm similarity index 100% rename from chia/wallet/puzzles/singleton_launcher.clvm rename to flax/wallet/puzzles/singleton_launcher.clvm diff --git a/chia/wallet/puzzles/singleton_launcher.clvm.hex b/flax/wallet/puzzles/singleton_launcher.clvm.hex similarity index 100% rename from chia/wallet/puzzles/singleton_launcher.clvm.hex rename to flax/wallet/puzzles/singleton_launcher.clvm.hex diff --git a/chia/wallet/puzzles/singleton_launcher.clvm.hex.sha256tree b/flax/wallet/puzzles/singleton_launcher.clvm.hex.sha256tree similarity index 100% rename from chia/wallet/puzzles/singleton_launcher.clvm.hex.sha256tree rename to flax/wallet/puzzles/singleton_launcher.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/singleton_top_layer.py b/flax/wallet/puzzles/singleton_top_layer.py similarity index 96% rename from chia/wallet/puzzles/singleton_top_layer.py rename to flax/wallet/puzzles/singleton_top_layer.py index 19e6fdce9..1c99e8082 100644 --- a/chia/wallet/puzzles/singleton_top_layer.py +++ b/flax/wallet/puzzles/singleton_top_layer.py @@ -1,14 +1,14 @@ from typing import Iterator, List, Tuple, 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.types.condition_opcodes import ConditionOpcode -from chia.types.coin_spend import CoinSpend -from chia.wallet.puzzles.load_clvm import load_clvm -from chia.wallet.lineage_proof import LineageProof -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.program import Program +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.condition_opcodes import ConditionOpcode +from flax.types.coin_spend import CoinSpend +from flax.wallet.puzzles.load_clvm import load_clvm +from flax.wallet.lineage_proof import LineageProof +from flax.util.ints import uint64 +from flax.util.hash import std_hash SINGLETON_MOD = load_clvm("singleton_top_layer.clvm") SINGLETON_MOD_HASH = SINGLETON_MOD.get_tree_hash() diff --git a/chia/wallet/puzzles/singleton_top_layer_v1_1.clvm b/flax/wallet/puzzles/singleton_top_layer_v1_1.clvm similarity index 100% rename from chia/wallet/puzzles/singleton_top_layer_v1_1.clvm rename to flax/wallet/puzzles/singleton_top_layer_v1_1.clvm diff --git a/chia/wallet/puzzles/singleton_top_layer_v1_1.clvm.hex b/flax/wallet/puzzles/singleton_top_layer_v1_1.clvm.hex similarity index 100% rename from chia/wallet/puzzles/singleton_top_layer_v1_1.clvm.hex rename to flax/wallet/puzzles/singleton_top_layer_v1_1.clvm.hex diff --git a/chia/wallet/puzzles/singleton_top_layer_v1_1.clvm.hex.sha256tree b/flax/wallet/puzzles/singleton_top_layer_v1_1.clvm.hex.sha256tree similarity index 100% rename from chia/wallet/puzzles/singleton_top_layer_v1_1.clvm.hex.sha256tree rename to flax/wallet/puzzles/singleton_top_layer_v1_1.clvm.hex.sha256tree diff --git a/chia/wallet/puzzles/singleton_top_layer_v1_1.py b/flax/wallet/puzzles/singleton_top_layer_v1_1.py similarity index 96% rename from chia/wallet/puzzles/singleton_top_layer_v1_1.py rename to flax/wallet/puzzles/singleton_top_layer_v1_1.py index 140c73ab8..25ac3e801 100644 --- a/chia/wallet/puzzles/singleton_top_layer_v1_1.py +++ b/flax/wallet/puzzles/singleton_top_layer_v1_1.py @@ -1,14 +1,14 @@ from typing import Iterator, 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.coin_spend import CoinSpend -from chia.types.condition_opcodes import ConditionOpcode -from chia.util.hash import std_hash -from chia.util.ints import uint64 -from chia.wallet.lineage_proof import LineageProof -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.types.coin_spend import CoinSpend +from flax.types.condition_opcodes import ConditionOpcode +from flax.util.hash import std_hash +from flax.util.ints import uint64 +from flax.wallet.lineage_proof import LineageProof +from flax.wallet.puzzles.load_clvm import load_clvm SINGLETON_MOD = load_clvm("singleton_top_layer_v1_1.clvm") SINGLETON_MOD_HASH = SINGLETON_MOD.get_tree_hash() diff --git a/chia/wallet/puzzles/singleton_truths.clib b/flax/wallet/puzzles/singleton_truths.clib similarity index 100% rename from chia/wallet/puzzles/singleton_truths.clib rename to flax/wallet/puzzles/singleton_truths.clib diff --git a/chia/wallet/puzzles/tails.py b/flax/wallet/puzzles/tails.py similarity index 92% rename from chia/wallet/puzzles/tails.py rename to flax/wallet/puzzles/tails.py index 6aac17354..c119af50e 100644 --- a/chia/wallet/puzzles/tails.py +++ b/flax/wallet/puzzles/tails.py @@ -1,21 +1,21 @@ from typing import Tuple, Dict, List, Optional, Any -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.util.ints import uint64 -from chia.util.byte_types import hexstr_to_bytes -from chia.wallet.cat_wallet.lineage_store import CATLineageStore -from chia.wallet.lineage_proof import LineageProof -from chia.wallet.puzzles.load_clvm import load_clvm -from chia.wallet.cat_wallet.cat_utils import ( +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.util.ints import uint64 +from flax.util.byte_types import hexstr_to_bytes +from flax.wallet.cat_wallet.lineage_store import CATLineageStore +from flax.wallet.lineage_proof import LineageProof +from flax.wallet.puzzles.load_clvm import load_clvm +from flax.wallet.cat_wallet.cat_utils import ( CAT_MOD, construct_cat_puzzle, unsigned_spend_bundle_for_spendable_cats, SpendableCAT, ) -from chia.wallet.cat_wallet.cat_info import CATInfo -from chia.wallet.transaction_record import TransactionRecord +from flax.wallet.cat_wallet.cat_info import CATInfo +from flax.wallet.transaction_record import TransactionRecord GENESIS_BY_ID_MOD = load_clvm("genesis_by_coin_id.clvm") GENESIS_BY_PUZHASH_MOD = load_clvm("genesis_by_puzzle_hash.clvm") 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/puzzles/utility_macros.clib b/flax/wallet/puzzles/utility_macros.clib similarity index 100% rename from chia/wallet/puzzles/utility_macros.clib rename to flax/wallet/puzzles/utility_macros.clib 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 3db219e1b..dc0b2febb 100644 --- a/chia/wallet/rl_wallet/rl_wallet.py +++ b/flax/wallet/rl_wallet/rl_wallet.py @@ -7,17 +7,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_spend import CoinSpend -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_spend import CoinSpend +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, @@ -25,13 +25,13 @@ 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.util.compute_memos import compute_memos -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.util.compute_memos import compute_memos +from flax.wallet.wallet import Wallet +from flax.wallet.wallet_coin_record import WalletCoinRecord +from flax.wallet.wallet_info import WalletInfo @streamable 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/__init__.py b/flax/wallet/settings/__init__.py similarity index 100% rename from chia/wallet/settings/__init__.py rename to flax/wallet/settings/__init__.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 27f6f92c6..20d0d6ba2 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 @streamable diff --git a/chia/wallet/settings/user_settings.py b/flax/wallet/settings/user_settings.py similarity index 84% rename from chia/wallet/settings/user_settings.py rename to flax/wallet/settings/user_settings.py index b83acec18..cb9922a6c 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_spends.py b/flax/wallet/sign_coin_spends.py similarity index 94% rename from chia/wallet/sign_coin_spends.py rename to flax/wallet/sign_coin_spends.py index 2da07799d..0f5ed2ad1 100644 --- a/chia/wallet/sign_coin_spends.py +++ b/flax/wallet/sign_coin_spends.py @@ -4,9 +4,9 @@ import blspy from blspy import AugSchemeMPL -from chia.types.coin_spend import CoinSpend -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_spend import CoinSpend +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_spends( diff --git a/chia/wallet/trade_manager.py b/flax/wallet/trade_manager.py similarity index 95% rename from chia/wallet/trade_manager.py rename to flax/wallet/trade_manager.py index e7a9913a7..a2339e950 100644 --- a/chia/wallet/trade_manager.py +++ b/flax/wallet/trade_manager.py @@ -4,28 +4,28 @@ import traceback from typing import Any, Dict, List, Optional, Set, Tuple, Union -from chia.protocols.wallet_protocol import CoinState -from chia.types.blockchain_format.coin import Coin, coin_as_list -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.util.db_wrapper import DBWrapper -from chia.util.hash import std_hash -from chia.util.ints import uint32, uint64 -from chia.wallet.nft_wallet.nft_wallet import NFTWallet -from chia.wallet.outer_puzzles import AssetType -from chia.wallet.payment import Payment -from chia.wallet.puzzle_drivers import PuzzleInfo -from chia.wallet.trade_record import TradeRecord -from chia.wallet.trading.offer import NotarizedPayment, Offer -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.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.puzzles.load_clvm import load_clvm +from flax.protocols.wallet_protocol import CoinState +from flax.types.blockchain_format.coin import Coin, coin_as_list +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.util.db_wrapper import DBWrapper +from flax.util.hash import std_hash +from flax.util.ints import uint32, uint64 +from flax.wallet.nft_wallet.nft_wallet import NFTWallet +from flax.wallet.outer_puzzles import AssetType +from flax.wallet.payment import Payment +from flax.wallet.puzzle_drivers import PuzzleInfo +from flax.wallet.trade_record import TradeRecord +from flax.wallet.trading.offer import NotarizedPayment, Offer +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.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.puzzles.load_clvm import load_clvm OFFER_MOD = load_clvm("settlement_payments.clvm") @@ -34,12 +34,12 @@ class TradeManager: """ This class is a driver for creating and accepting settlement_payments.clvm style offers. - By default, standard XCH is supported but to support other types of assets you must implement certain functions on + By default, standard XFX is supported but to support other types of assets you must implement certain functions on the asset's wallet as well as create a driver for its puzzle(s). Here is a guide to integrating a new types of assets with this trade manager: Puzzle Drivers: - - See chia/wallet/outer_puzzles.py for a full description of how to build these + - See flax/wallet/outer_puzzles.py for a full description of how to build these - The `solve` method must be able to be solved by a Solver that looks like this: Solver( { @@ -232,7 +232,7 @@ async def cancel_pending_offer_safely( new_ph = await wallet.wallet_state_manager.main_wallet.get_new_puzzlehash() else: new_ph = await wallet.get_new_puzzlehash() - # This should probably not switch on whether or not we're spending a XCH but it has to for now + # This should probably not switch on whether or not we're spending a XFX but it has to for now if wallet.type() == WalletType.STANDARD_WALLET: if fee_to_pay > coin.amount: selected_coins: Set[Coin] = await wallet.select_coins( @@ -422,7 +422,7 @@ async def _create_offer_for_ids( wallet = self.wallet_state_manager.wallets[id] else: wallet = await self.wallet_state_manager.get_wallet_for_asset_id(id.hex()) - # This should probably not switch on whether or not we're spending XCH but it has to for now + # This should probably not switch on whether or not we're spending XFX but it has to for now if wallet.type() == WalletType.STANDARD_WALLET: tx = await wallet.generate_signed_transaction( abs(offer_dict[id]), diff --git a/chia/wallet/trade_record.py b/flax/wallet/trade_record.py similarity index 83% rename from chia/wallet/trade_record.py rename to flax/wallet/trade_record.py index c2ea1f3f1..55a18c338 100644 --- a/chia/wallet/trade_record.py +++ b/flax/wallet/trade_record.py @@ -1,12 +1,12 @@ from dataclasses import dataclass from typing import List, Optional, Tuple, Dict, Any -from chia.types.blockchain_format.coin import Coin -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 chia.wallet.trading.offer import Offer -from chia.wallet.trading.trade_status import TradeStatus +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.ints import uint8, uint32, uint64 +from flax.util.streamable import Streamable, streamable +from flax.wallet.trading.offer import Offer +from flax.wallet.trading.trade_status import TradeStatus @streamable 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/offer.py b/flax/wallet/trading/offer.py similarity index 96% rename from chia/wallet/trading/offer.py rename to flax/wallet/trading/offer.py index 5f29dffa2..750bd1f80 100644 --- a/chia/wallet/trading/offer.py +++ b/flax/wallet/trading/offer.py @@ -4,15 +4,15 @@ from blspy import G2Element from clvm_tools.binutils import disassemble -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.blockchain_format.coin import Coin, coin_as_list -from chia.types.blockchain_format.program import Program -from chia.types.announcement import Announcement -from chia.types.coin_spend import CoinSpend -from chia.types.spend_bundle import SpendBundle -from chia.util.bech32m import bech32_decode, bech32_encode, convertbits -from chia.util.ints import uint64 -from chia.wallet.outer_puzzles import ( +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.blockchain_format.coin import Coin, coin_as_list +from flax.types.blockchain_format.program import Program +from flax.types.announcement import Announcement +from flax.types.coin_spend import CoinSpend +from flax.types.spend_bundle import SpendBundle +from flax.util.bech32m import bech32_decode, bech32_encode, convertbits +from flax.util.ints import uint64 +from flax.wallet.outer_puzzles import ( construct_puzzle, create_asset_id, match_puzzle, @@ -20,10 +20,10 @@ get_inner_puzzle, get_inner_solution, ) -from chia.wallet.payment import Payment -from chia.wallet.puzzle_drivers import PuzzleInfo, Solver -from chia.wallet.puzzles.load_clvm import load_clvm -from chia.wallet.util.puzzle_compression import ( +from flax.wallet.payment import Payment +from flax.wallet.puzzle_drivers import PuzzleInfo, Solver +from flax.wallet.puzzles.load_clvm import load_clvm +from flax.wallet.util.puzzle_compression import ( compress_object_with_puzzles, decompress_object_with_puzzles, lowest_best_version, @@ -59,7 +59,7 @@ def ph(): @staticmethod def notarize_payments( - requested_payments: Dict[Optional[bytes32], List[Payment]], # `None` means you are requesting XCH + requested_payments: Dict[Optional[bytes32], List[Payment]], # `None` means you are requesting XFX coins: List[Coin], ) -> Dict[Optional[bytes32], List[NotarizedPayment]]: # This sort should be reproducible in CLVM with `>s` @@ -216,7 +216,7 @@ def keys_to_strings(dic: Dict[Optional[bytes32], Any]) -> Dict[str, Any]: new_dic: Dict[str, Any] = {} for key in dic: if key is None: - new_dic["xch"] = dic[key] + new_dic["xfx"] = dic[key] else: new_dic[key.hex()] = dic[key] return new_dic @@ -237,7 +237,7 @@ def get_pending_amounts(self) -> Dict[str, int]: pending_dict: Dict[str, int] = {} # First we add up the amounts of all coins that share an ancestor with the offered coins (i.e. a primary coin) for asset_id, coins in self.get_offered_coins().items(): - name = "xch" if asset_id is None else asset_id.hex() + name = "xfx" if asset_id is None else asset_id.hex() pending_dict[name] = 0 for coin in coins: root_removal: Coin = self.get_root_removal(coin) 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 97% rename from chia/wallet/trading/trade_store.py rename to flax/wallet/trading/trade_store.py index 6a170c76c..b64da0103 100644 --- a/chia/wallet/trading/trade_store.py +++ b/flax/wallet/trading/trade_store.py @@ -4,13 +4,13 @@ import aiosqlite import logging -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 async def migrate_is_my_offer(log: logging.Logger, db_connection: aiosqlite.Connection) -> None: diff --git a/chia/wallet/transaction_record.py b/flax/wallet/transaction_record.py similarity index 87% rename from chia/wallet/transaction_record.py rename to flax/wallet/transaction_record.py index b13b6d366..44e1ed8ae 100644 --- a/chia/wallet/transaction_record.py +++ b/flax/wallet/transaction_record.py @@ -1,15 +1,15 @@ from dataclasses import dataclass from typing import List, Optional, Tuple, Dict -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.bech32m import encode_puzzle_hash, decode_puzzle_hash -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.bech32m import encode_puzzle_hash, decode_puzzle_hash +from flax.util.ints import uint8, uint32, uint64 +from flax.util.streamable import Streamable, streamable +from flax.wallet.util.transaction_type import TransactionType @streamable diff --git a/chia/wallet/transaction_sorting.py b/flax/wallet/transaction_sorting.py similarity index 100% rename from chia/wallet/transaction_sorting.py rename to flax/wallet/transaction_sorting.py 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/compute_hints.py b/flax/wallet/util/compute_hints.py similarity index 71% rename from chia/wallet/util/compute_hints.py rename to flax/wallet/util/compute_hints.py index 36d35ebd1..cd171c683 100644 --- a/chia/wallet/util/compute_hints.py +++ b/flax/wallet/util/compute_hints.py @@ -1,9 +1,9 @@ from typing import List -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.condition_opcodes import ConditionOpcode -from chia.types.blockchain_format.program import INFINITE_COST -from chia.types.coin_spend import CoinSpend +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.condition_opcodes import ConditionOpcode +from flax.types.blockchain_format.program import INFINITE_COST +from flax.types.coin_spend import CoinSpend def compute_coin_hints(cs: CoinSpend) -> List[bytes32]: diff --git a/chia/wallet/util/compute_memos.py b/flax/wallet/util/compute_memos.py similarity index 81% rename from chia/wallet/util/compute_memos.py rename to flax/wallet/util/compute_memos.py index 32c8867b1..a407f9175 100644 --- a/chia/wallet/util/compute_memos.py +++ b/flax/wallet/util/compute_memos.py @@ -1,11 +1,11 @@ from typing import List, Dict from clvm.casts import int_from_bytes -from chia.types.blockchain_format.program import INFINITE_COST -from chia.types.spend_bundle import SpendBundle -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.blockchain_format.coin import Coin -from chia.types.condition_opcodes import ConditionOpcode +from flax.types.blockchain_format.program import INFINITE_COST +from flax.types.spend_bundle import SpendBundle +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.blockchain_format.coin import Coin +from flax.types.condition_opcodes import ConditionOpcode def compute_memos(bundle: SpendBundle) -> Dict[bytes32, List[bytes]]: diff --git a/chia/wallet/util/debug_spend_bundle.py b/flax/wallet/util/debug_spend_bundle.py similarity index 95% rename from chia/wallet/util/debug_spend_bundle.py rename to flax/wallet/util/debug_spend_bundle.py index ea9254433..7b86fba9e 100644 --- a/chia/wallet/util/debug_spend_bundle.py +++ b/flax/wallet/util/debug_spend_bundle.py @@ -4,12 +4,12 @@ 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.consensus.default_constants import DEFAULT_CONSTANTS -from chia.types.condition_opcodes import ConditionOpcode -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.consensus.default_constants import DEFAULT_CONSTANTS +from flax.types.condition_opcodes import ConditionOpcode +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/flax/wallet/util/json_clvm_utils.py b/flax/wallet/util/json_clvm_utils.py new file mode 100644 index 000000000..d70dc5b3d --- /dev/null +++ b/flax/wallet/util/json_clvm_utils.py @@ -0,0 +1,17 @@ +from typing import Any + +from flax.types.blockchain_format.program import Program + + +def json_to_flaxlisp(json_data: Any) -> Any: + list_for_flaxlisp = [] + if isinstance(json_data, list): + for value in json_data: + list_for_flaxlisp.append(json_to_flaxlisp(value)) + else: + if isinstance(json_data, dict): + for key, value in json_data: + list_for_flaxlisp.append((key, json_to_flaxlisp(value))) + else: + list_for_flaxlisp = json_data + return Program.to(list_for_flaxlisp) diff --git a/chia/wallet/util/new_peak_queue.py b/flax/wallet/util/new_peak_queue.py similarity index 91% rename from chia/wallet/util/new_peak_queue.py rename to flax/wallet/util/new_peak_queue.py index 846ccf814..f2291d6e7 100644 --- a/chia/wallet/util/new_peak_queue.py +++ b/flax/wallet/util/new_peak_queue.py @@ -3,9 +3,9 @@ from enum import IntEnum from typing import Any, List -from chia.protocols.wallet_protocol import CoinStateUpdate, NewPeakWallet -from chia.server.ws_connection import WSChiaConnection -from chia.types.blockchain_format.sized_bytes import bytes32 +from flax.protocols.wallet_protocol import CoinStateUpdate, NewPeakWallet +from flax.server.ws_connection import WSFlaxConnection +from flax.types.blockchain_format.sized_bytes import bytes32 class NewPeakQueueTypes(IntEnum): @@ -60,10 +60,10 @@ async def subscribe_to_coin_ids(self, coin_ids: List[bytes32]): async def subscribe_to_puzzle_hashes(self, puzzle_hashes: List[bytes32]): await self._inner_queue.put(NewPeakItem(NewPeakQueueTypes.PUZZLE_HASH_SUBSCRIPTION, puzzle_hashes)) - async def full_node_state_updated(self, coin_state_update: CoinStateUpdate, peer: WSChiaConnection): + async def full_node_state_updated(self, coin_state_update: CoinStateUpdate, peer: WSFlaxConnection): await self._inner_queue.put(NewPeakItem(NewPeakQueueTypes.FULL_NODE_STATE_UPDATED, (coin_state_update, peer))) - async def new_peak_wallet(self, new_peak: NewPeakWallet, peer: WSChiaConnection): + async def new_peak_wallet(self, new_peak: NewPeakWallet, peer: WSFlaxConnection): await self._inner_queue.put(NewPeakItem(NewPeakQueueTypes.NEW_PEAK_WALLET, (new_peak, peer))) async def get(self) -> NewPeakItem: diff --git a/chia/wallet/util/peer_request_cache.py b/flax/wallet/util/peer_request_cache.py similarity index 94% rename from chia/wallet/util/peer_request_cache.py rename to flax/wallet/util/peer_request_cache.py index 739733412..ecb44f7c8 100644 --- a/chia/wallet/util/peer_request_cache.py +++ b/flax/wallet/util/peer_request_cache.py @@ -1,11 +1,11 @@ import asyncio from typing import Optional -from chia.protocols.wallet_protocol import CoinState, RespondSESInfo -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.header_block import HeaderBlock -from chia.util.ints import uint32, uint64 -from chia.util.lru_cache import LRUCache +from flax.protocols.wallet_protocol import CoinState, RespondSESInfo +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.header_block import HeaderBlock +from flax.util.ints import uint32, uint64 +from flax.util.lru_cache import LRUCache class PeerRequestCache: diff --git a/chia/wallet/util/puzzle_compression.py b/flax/wallet/util/puzzle_compression.py similarity index 91% rename from chia/wallet/util/puzzle_compression.py rename to flax/wallet/util/puzzle_compression.py index 7aca14e43..c4335ac0f 100644 --- a/chia/wallet/util/puzzle_compression.py +++ b/flax/wallet/util/puzzle_compression.py @@ -2,10 +2,10 @@ from typing import List -from chia.wallet.puzzles.load_clvm import load_clvm -from chia.wallet.puzzles import p2_delegated_puzzle_or_hidden_puzzle as standard_puzzle -from chia.wallet.puzzles.cat_loader import CAT_MOD -from chia.wallet.nft_wallet.nft_puzzles import ( +from flax.wallet.puzzles.load_clvm import load_clvm +from flax.wallet.puzzles import p2_delegated_puzzle_or_hidden_puzzle as standard_puzzle +from flax.wallet.puzzles.cat_loader import CAT_MOD +from flax.wallet.nft_wallet.nft_puzzles import ( SINGLETON_TOP_LAYER_MOD, NFT_STATE_LAYER_MOD, NFT_OWNERSHIP_LAYER, 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_sync_utils.py b/flax/wallet/util/wallet_sync_utils.py similarity index 93% rename from chia/wallet/util/wallet_sync_utils.py rename to flax/wallet/util/wallet_sync_utils.py index ea8134eac..d6fd0e778 100644 --- a/chia/wallet/util/wallet_sync_utils.py +++ b/flax/wallet/util/wallet_sync_utils.py @@ -4,9 +4,9 @@ from typing import List, Optional, Tuple, Union, Dict from chia_rs import compute_merkle_set_root -from chia.consensus.constants import ConsensusConstants -from chia.protocols import wallet_protocol -from chia.protocols.wallet_protocol import ( +from flax.consensus.constants import ConsensusConstants +from flax.protocols import wallet_protocol +from flax.protocols.wallet_protocol import ( RequestAdditions, RespondAdditions, RejectAdditionsRequest, @@ -20,19 +20,19 @@ RespondHeaderBlocks, RequestHeaderBlocks, ) -from chia.server.ws_connection import WSChiaConnection -from chia.types.blockchain_format.coin import hash_coin_ids, 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.util.ints import uint32 -from chia.util.merkle_set import confirm_not_included_already_hashed, confirm_included_already_hashed, MerkleSet -from chia.wallet.util.peer_request_cache import PeerRequestCache +from flax.server.ws_connection import WSFlaxConnection +from flax.types.blockchain_format.coin import hash_coin_ids, 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.util.ints import uint32 +from flax.util.merkle_set import confirm_not_included_already_hashed, confirm_included_already_hashed, MerkleSet +from flax.wallet.util.peer_request_cache import PeerRequestCache log = logging.getLogger(__name__) -async def fetch_last_tx_from_peer(height: uint32, peer: WSChiaConnection) -> Optional[HeaderBlock]: +async def fetch_last_tx_from_peer(height: uint32, peer: WSFlaxConnection) -> Optional[HeaderBlock]: request_height: int = height while True: if request_height == -1: @@ -51,7 +51,7 @@ async def fetch_last_tx_from_peer(height: uint32, peer: WSChiaConnection) -> Opt async def subscribe_to_phs( puzzle_hashes: List[bytes32], - peer: WSChiaConnection, + peer: WSFlaxConnection, min_height: int, ) -> List[CoinState]: """ @@ -66,7 +66,7 @@ async def subscribe_to_phs( async def subscribe_to_coin_updates( coin_names: List[bytes32], - peer: WSChiaConnection, + peer: WSFlaxConnection, min_height: int, ) -> List[CoinState]: """ @@ -192,7 +192,7 @@ def validate_removals( async def request_and_validate_removals( - peer: WSChiaConnection, height: uint32, header_hash: bytes32, coin_name: bytes32, removals_root: bytes32 + peer: WSFlaxConnection, height: uint32, header_hash: bytes32, coin_name: bytes32, removals_root: bytes32 ) -> bool: removals_request = RequestRemovals(height, header_hash, [coin_name]) @@ -206,7 +206,7 @@ async def request_and_validate_removals( async def request_and_validate_additions( - peer: WSChiaConnection, height: uint32, header_hash: bytes32, puzzle_hash: bytes32, additions_root: bytes32 + peer: WSFlaxConnection, height: uint32, header_hash: bytes32, puzzle_hash: bytes32, additions_root: bytes32 ): additions_request = RequestAdditions(height, header_hash, [puzzle_hash]) additions_res: Optional[Union[RespondAdditions, RejectAdditionsRequest]] = await peer.request_additions( @@ -290,7 +290,7 @@ def last_change_height_cs(cs: CoinState) -> uint32: async def _fetch_header_blocks_inner( - all_peers: List[WSChiaConnection], + all_peers: List[WSFlaxConnection], request: RequestHeaderBlocks, ) -> Optional[RespondHeaderBlocks]: # We will modify this list, don't modify passed parameters. @@ -316,7 +316,7 @@ async def fetch_header_blocks_in_range( start: uint32, end: uint32, peer_request_cache: PeerRequestCache, - all_peers: List[WSChiaConnection], + all_peers: List[WSFlaxConnection], ) -> Optional[List[HeaderBlock]]: blocks: List[HeaderBlock] = [] for i in range(start - (start % 32), end + 1, 32): diff --git a/chia/wallet/util/wallet_types.py b/flax/wallet/util/wallet_types.py similarity index 82% rename from chia/wallet/util/wallet_types.py rename to flax/wallet/util/wallet_types.py index 2c2b00642..43d76dc19 100644 --- a/chia/wallet/util/wallet_types.py +++ b/flax/wallet/util/wallet_types.py @@ -3,8 +3,8 @@ from typing_extensions import TypedDict -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.ints import uint64 +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.ints import uint64 class WalletType(IntEnum): diff --git a/chia/wallet/wallet.py b/flax/wallet/wallet.py similarity index 93% rename from chia/wallet/wallet.py rename to flax/wallet/wallet.py index 5e9db29a8..25072974d 100644 --- a/chia/wallet/wallet.py +++ b/flax/wallet/wallet.py @@ -4,27 +4,27 @@ from blspy import G1Element -from chia.consensus.cost_calculator import 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.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.coin_spend import CoinSpend -from chia.types.generator_types import BlockGenerator -from chia.types.spend_bundle import SpendBundle -from chia.util.hash import std_hash -from chia.util.ints import uint8, uint32, uint64, uint128 -from chia.wallet.coin_selection import select_coins -from chia.wallet.derivation_record import DerivationRecord -from chia.wallet.puzzles.p2_delegated_puzzle_or_hidden_puzzle import ( +from flax.consensus.cost_calculator import 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.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.coin_spend import CoinSpend +from flax.types.generator_types import BlockGenerator +from flax.types.spend_bundle import SpendBundle +from flax.util.hash import std_hash +from flax.util.ints import uint8, uint32, uint64, uint128 +from flax.wallet.coin_selection import select_coins +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_absolute_seconds_exceeds_condition, make_assert_coin_announcement, make_assert_my_coin_id_condition, @@ -34,14 +34,14 @@ make_create_puzzle_announcement, make_reserve_fee_condition, ) -from chia.wallet.secret_key_store import SecretKeyStore -from chia.wallet.sign_coin_spends import sign_coin_spends -from chia.wallet.transaction_record import TransactionRecord -from chia.wallet.util.compute_memos import compute_memos -from chia.wallet.util.transaction_type import TransactionType -from chia.wallet.util.wallet_types import AmountWithPuzzlehash, 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_spends import sign_coin_spends +from flax.wallet.transaction_record import TransactionRecord +from flax.wallet.util.compute_memos import compute_memos +from flax.wallet.util.transaction_type import TransactionType +from flax.wallet.util.wallet_types import AmountWithPuzzlehash, WalletType +from flax.wallet.wallet_coin_record import WalletCoinRecord +from flax.wallet.wallet_info import WalletInfo class Wallet: @@ -488,14 +488,14 @@ async def push_transaction(self, tx: TransactionRecord) -> None: await self.wallet_state_manager.wallet_node.update_ui() # This is to be aggregated together with a CAT 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(uint64(abs(chia_amount)), exclude) + if flax_amount < 0: + utxos = await self.select_coins(uint64(abs(flax_amount)), exclude) else: utxos = await self.select_coins(uint64(0), exclude) @@ -503,7 +503,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 @@ -512,7 +512,7 @@ async def create_spend_bundle_relative_chia(self, chia_amount: int, exclude: Lis if output_created is None: newpuzhash = await self.get_new_puzzlehash() primaries: List[AmountWithPuzzlehash] = [ - {"puzzlehash": newpuzhash, "amount": uint64(chia_amount), "memos": []} + {"puzzlehash": newpuzhash, "amount": uint64(flax_amount), "memos": []} ] solution = self.make_solution(primaries=primaries) output_created = coin 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 3c94e4701..520666a80 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 95% rename from chia/wallet/wallet_action_store.py rename to flax/wallet/wallet_action_store.py index a1b73f16c..59ef56ddc 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_blockchain.py b/flax/wallet/wallet_blockchain.py similarity index 93% rename from chia/wallet/wallet_blockchain.py rename to flax/wallet/wallet_blockchain.py index 64ffb7206..99fdaabd5 100644 --- a/chia/wallet/wallet_blockchain.py +++ b/flax/wallet/wallet_blockchain.py @@ -1,19 +1,19 @@ import logging from typing import Dict, Optional, Tuple, List -from chia.consensus.block_header_validation import validate_finished_header_block -from chia.consensus.block_record import BlockRecord -from chia.consensus.blockchain import ReceiveBlockResult -from chia.consensus.blockchain_interface import BlockchainInterface -from chia.consensus.constants import ConsensusConstants -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.types.blockchain_format.sized_bytes import bytes32 -from chia.types.header_block import HeaderBlock -from chia.types.weight_proof import WeightProof -from chia.util.errors import Err -from chia.util.ints import uint32, uint64 -from chia.wallet.key_val_store import KeyValStore -from chia.wallet.wallet_weight_proof_handler import WalletWeightProofHandler +from flax.consensus.block_header_validation import validate_finished_header_block +from flax.consensus.block_record import BlockRecord +from flax.consensus.blockchain import ReceiveBlockResult +from flax.consensus.blockchain_interface import BlockchainInterface +from flax.consensus.constants import ConsensusConstants +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.types.blockchain_format.sized_bytes import bytes32 +from flax.types.header_block import HeaderBlock +from flax.types.weight_proof import WeightProof +from flax.util.errors import Err +from flax.util.ints import uint32, uint64 +from flax.wallet.key_val_store import KeyValStore +from flax.wallet.wallet_weight_proof_handler import WalletWeightProofHandler 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 8c8a7121e..7fc4aa240 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 1d02bb6e7..2ea4bafaa 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 @streamable diff --git a/chia/wallet/wallet_interested_store.py b/flax/wallet/wallet_interested_store.py similarity index 97% rename from chia/wallet/wallet_interested_store.py rename to flax/wallet/wallet_interested_store.py index 178288783..a7dc3ad15 100644 --- a/chia/wallet/wallet_interested_store.py +++ b/flax/wallet/wallet_interested_store.py @@ -2,9 +2,9 @@ import aiosqlite -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.db_wrapper import DBWrapper -from chia.util.ints import uint32 +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.db_wrapper import DBWrapper +from flax.util.ints import uint32 class WalletInterestedStore: diff --git a/chia/wallet/wallet_nft_store.py b/flax/wallet/wallet_nft_store.py similarity index 93% rename from chia/wallet/wallet_nft_store.py rename to flax/wallet/wallet_nft_store.py index 98139595b..9a0eb31c9 100644 --- a/chia/wallet/wallet_nft_store.py +++ b/flax/wallet/wallet_nft_store.py @@ -3,13 +3,13 @@ import aiosqlite -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.util.db_wrapper import DBWrapper -from chia.util.ints import uint32 -from chia.wallet.lineage_proof import LineageProof -from chia.wallet.nft_wallet.nft_info import DEFAULT_STATUS, IN_TRANSACTION_STATUS, NFTCoinInfo +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.util.db_wrapper import DBWrapper +from flax.util.ints import uint32 +from flax.wallet.lineage_proof import LineageProof +from flax.wallet.nft_wallet.nft_info import DEFAULT_STATUS, IN_TRANSACTION_STATUS, NFTCoinInfo _T_WalletNftStore = TypeVar("_T_WalletNftStore", bound="WalletNftStore") diff --git a/chia/wallet/wallet_node.py b/flax/wallet/wallet_node.py similarity index 95% rename from chia/wallet/wallet_node.py rename to flax/wallet/wallet_node.py index c6296ecb1..ea0d6d2c2 100644 --- a/chia/wallet/wallet_node.py +++ b/flax/wallet/wallet_node.py @@ -10,20 +10,20 @@ from blspy import AugSchemeMPL, PrivateKey from packaging.version import Version -from chia.consensus.block_record import BlockRecord -from chia.consensus.blockchain import ReceiveBlockResult -from chia.consensus.constants import ConsensusConstants -from chia.daemon.keychain_proxy import ( +from flax.consensus.block_record import BlockRecord +from flax.consensus.blockchain import ReceiveBlockResult +from flax.consensus.constants import ConsensusConstants +from flax.daemon.keychain_proxy import ( KeychainProxy, KeychainProxyConnectionFailure, KeyringIsEmpty, connect_to_keychain_and_validate, wrap_local_keychain, ) -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.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 ( CoinState, RequestHeaderBlocks, RequestSESInfo, @@ -32,31 +32,31 @@ RespondToCoinUpdates, RespondToPhUpdates, ) -from chia.server.node_discovery import WalletPeers -from chia.server.outbound_message import Message, NodeType, make_msg -from chia.server.peer_store_resolver import PeerStoreResolver -from chia.server.server import ChiaServer -from chia.server.ws_connection import WSChiaConnection -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.coin_spend import CoinSpend -from chia.types.header_block import HeaderBlock -from chia.types.mempool_inclusion_status import MempoolInclusionStatus -from chia.types.peer_info import PeerInfo -from chia.types.weight_proof import SubEpochData, WeightProof -from chia.util.byte_types import hexstr_to_bytes -from chia.util.chunks import chunks -from chia.util.config import WALLET_PEERS_PATH_KEY_DEPRECATED -from chia.util.default_root import STANDALONE_ROOT_PATH -from chia.util.ints import uint32, uint64 -from chia.util.keychain import Keychain, KeyringIsLocked -from chia.util.path import mkdir, path_from_root -from chia.util.profiler import profile_task -from chia.wallet.transaction_record import TransactionRecord -from chia.wallet.util.new_peak_queue import NewPeakItem, NewPeakQueue, NewPeakQueueTypes -from chia.wallet.util.peer_request_cache import PeerRequestCache, can_use_peer_request_cache -from chia.wallet.util.wallet_sync_utils import ( +from flax.server.node_discovery import WalletPeers +from flax.server.outbound_message import Message, NodeType, make_msg +from flax.server.peer_store_resolver import PeerStoreResolver +from flax.server.server import FlaxServer +from flax.server.ws_connection import WSFlaxConnection +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.coin_spend import CoinSpend +from flax.types.header_block import HeaderBlock +from flax.types.mempool_inclusion_status import MempoolInclusionStatus +from flax.types.peer_info import PeerInfo +from flax.types.weight_proof import SubEpochData, WeightProof +from flax.util.byte_types import hexstr_to_bytes +from flax.util.chunks import chunks +from flax.util.config import WALLET_PEERS_PATH_KEY_DEPRECATED +from flax.util.default_root import STANDALONE_ROOT_PATH +from flax.util.ints import uint32, uint64 +from flax.util.keychain import Keychain, KeyringIsLocked +from flax.util.path import mkdir, path_from_root +from flax.util.profiler import profile_task +from flax.wallet.transaction_record import TransactionRecord +from flax.wallet.util.new_peak_queue import NewPeakItem, NewPeakQueue, NewPeakQueueTypes +from flax.wallet.util.peer_request_cache import PeerRequestCache, can_use_peer_request_cache +from flax.wallet.util.wallet_sync_utils import ( fetch_header_blocks_in_range, fetch_last_tx_from_peer, last_change_height_cs, @@ -65,16 +65,16 @@ subscribe_to_coin_updates, subscribe_to_phs, ) -from chia.wallet.wallet_action import WalletAction -from chia.wallet.wallet_coin_record import WalletCoinRecord -from chia.wallet.wallet_state_manager import WalletStateManager +from flax.wallet.wallet_action import WalletAction +from flax.wallet.wallet_coin_record import WalletCoinRecord +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 # Maintains the state of the wallet (blockchain and transactions), handles DB connections wallet_state_manager: Optional[WalletStateManager] @@ -168,7 +168,7 @@ async def get_key_for_fingerprint(self, fingerprint: Optional[int]) -> Optional[ keychain_proxy = await self.ensure_keychain_proxy() key = await keychain_proxy.get_key_for_fingerprint(fingerprint) except KeyringIsEmpty: - 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 except KeyringIsLocked: self.log.warning("Keyring is locked") @@ -363,7 +363,7 @@ async def _process_new_subscriptions(self): while not self._shut_down: # Here we process four types of messages in the queue, where the first one has higher priority (lower # number in the queue), and priority decreases for each type. - peer: Optional[WSChiaConnection] = None + peer: Optional[WSFlaxConnection] = None item: Optional[NewPeakItem] = None try: peer, item = None, None @@ -413,7 +413,7 @@ async def _process_new_subscriptions(self): if peer is not None: await peer.close(9999) - def set_server(self, server: ChiaServer): + def set_server(self, server: FlaxServer): self.server = server self.initialize_wallet_peers() @@ -436,7 +436,7 @@ def initialize_wallet_peers(self): default_peers_file_path="wallet/db/wallet_peers.dat", ), self.config["introducer_peer"], - self.config.get("dns_servers", ["dns-introducer.chia.net"]), + self.config.get("dns_servers", ["dns-introducer.flaxnetwork.org"]), self.config["peer_connect_interval"], network_name, None, @@ -444,7 +444,7 @@ def initialize_wallet_peers(self): ) asyncio.create_task(self.wallet_peers.start()) - def on_disconnect(self, peer: WSChiaConnection): + def on_disconnect(self, peer: WSFlaxConnection): if self.is_trusted(peer): self.local_node_synced = False self.initialize_wallet_peers() @@ -456,7 +456,7 @@ def on_disconnect(self, peer: WSChiaConnection): if peer.peer_node_id in self.node_peaks: self.node_peaks.pop(peer.peer_node_id) - async def on_connect(self, peer: WSChiaConnection): + async def on_connect(self, peer: WSFlaxConnection): if self.wallet_state_manager is None: return None @@ -512,7 +512,7 @@ async def perform_atomic_rollback(self, fork_height: int, cache: Optional[PeerRe async def long_sync( self, target_height: uint32, - full_node: WSChiaConnection, + full_node: WSFlaxConnection, fork_height: int, *, rollback: bool, @@ -615,7 +615,7 @@ def is_new_state_update(cs: CoinState) -> bool: async def receive_state_from_peer( self, items_input: List[CoinState], - peer: WSChiaConnection, + peer: WSFlaxConnection, fork_height: Optional[uint32] = None, height: Optional[uint32] = None, header_hash: Optional[bytes32] = None, @@ -773,7 +773,7 @@ async def get_coins_with_puzzle_hash(self, puzzle_hash) -> List[CoinState]: return coin_state.coin_states async def is_peer_synced( - self, peer: WSChiaConnection, header_block: HeaderBlock, request_time: uint64 + self, peer: WSFlaxConnection, header_block: HeaderBlock, request_time: uint64 ) -> Optional[uint64]: # Get last timestamp last_tx: Optional[HeaderBlock] = await fetch_last_tx_from_peer(header_block.height, peer) @@ -805,7 +805,7 @@ def add_state_to_race_cache(self, header_hash: bytes32, height: uint32, coin_sta self.race_cache[header_hash] = set() self.race_cache[header_hash].add(coin_state) - async def state_update_received(self, request: wallet_protocol.CoinStateUpdate, peer: WSChiaConnection) -> None: + async def state_update_received(self, request: wallet_protocol.CoinStateUpdate, peer: WSFlaxConnection) -> None: # This gets called every time there is a new coin or puzzle hash change in the DB # that is of interest to this wallet. It is not guaranteed to come for every height. This message is guaranteed # to come before the corresponding new_peak for each height. We handle this differently for trusted and @@ -824,7 +824,7 @@ async def state_update_received(self, request: wallet_protocol.CoinStateUpdate, request.peak_hash, ) - def get_full_node_peer(self) -> Optional[WSChiaConnection]: + def get_full_node_peer(self) -> Optional[WSFlaxConnection]: if self.server is None: return None @@ -869,7 +869,7 @@ async def get_timestamp_for_height(self, height: uint32) -> uint64: if cache_ts is not None: return cache_ts - peer: Optional[WSChiaConnection] = self.get_full_node_peer() + peer: Optional[WSFlaxConnection] = self.get_full_node_peer() if peer is None: raise ValueError("Cannot fetch timestamp, no peers") self.log.debug(f"Fetching block at height: {height}") @@ -880,7 +880,7 @@ async def get_timestamp_for_height(self, height: uint32) -> uint64: self.get_cache_for_peer(peer).add_to_blocks(last_tx_block) return last_tx_block.foliage_transaction_block.timestamp - async def new_peak_wallet(self, new_peak: wallet_protocol.NewPeakWallet, peer: WSChiaConnection): + async def new_peak_wallet(self, new_peak: wallet_protocol.NewPeakWallet, peer: WSFlaxConnection): if self.wallet_state_manager is None: # When logging out of wallet return @@ -1063,7 +1063,7 @@ async def new_peak_wallet(self, new_peak: wallet_protocol.NewPeakWallet, peer: W async with self.wallet_state_manager.lock: await self.wallet_state_manager.new_peak(new_peak) - async def wallet_short_sync_backtrack(self, header_block: HeaderBlock, peer: WSChiaConnection) -> int: + async def wallet_short_sync_backtrack(self, header_block: HeaderBlock, peer: WSFlaxConnection) -> int: assert self.wallet_state_manager is not None peak: Optional[HeaderBlock] = await self.wallet_state_manager.blockchain.get_peak_block() @@ -1110,7 +1110,7 @@ async def update_ui(self): self.wallet_state_manager.state_changed("coin_added", wallet_id) async def fetch_and_validate_the_weight_proof( - self, peer: WSChiaConnection, peak: HeaderBlock + self, peer: WSFlaxConnection, peak: HeaderBlock ) -> Tuple[bool, Optional[WeightProof], List[SubEpochSummary], List[BlockRecord]]: assert self.wallet_state_manager is not None assert self.wallet_state_manager.weight_proof_handler is not None @@ -1172,7 +1172,7 @@ async def get_coin_ids_to_subscribe(self, min_height: int) -> List[bytes32]: async def validate_received_state_from_peer( self, coin_state: CoinState, - peer: WSChiaConnection, + peer: WSFlaxConnection, peer_request_cache: PeerRequestCache, fork_height: Optional[uint32], ) -> bool: @@ -1308,7 +1308,7 @@ async def validate_received_state_from_peer( return True async def validate_block_inclusion( - self, block: HeaderBlock, peer: WSChiaConnection, peer_request_cache: PeerRequestCache + self, block: HeaderBlock, peer: WSFlaxConnection, peer_request_cache: PeerRequestCache ) -> bool: assert self.wallet_state_manager is not None assert self.server is not None @@ -1427,7 +1427,7 @@ async def validate_block_inclusion( return False return True - async def fetch_puzzle_solution(self, peer: WSChiaConnection, height: uint32, coin: Coin) -> CoinSpend: + async def fetch_puzzle_solution(self, peer: WSFlaxConnection, height: uint32, coin: Coin) -> CoinSpend: solution_response = await peer.request_puzzle_solution( wallet_protocol.RequestPuzzleSolution(coin.name(), height) ) @@ -1443,7 +1443,7 @@ async def fetch_puzzle_solution(self, peer: WSChiaConnection, height: uint32, co ) async def get_coin_state( - self, coin_names: List[bytes32], fork_height: Optional[uint32] = None, peer: Optional[WSChiaConnection] = None + self, coin_names: List[bytes32], fork_height: Optional[uint32] = None, peer: Optional[WSFlaxConnection] = None ) -> List[CoinState]: assert self.server is not None all_nodes = self.server.connection_by_type[NodeType.FULL_NODE] @@ -1480,7 +1480,7 @@ async def get_coin_state( return coin_state.coin_states async def fetch_children( - self, peer: WSChiaConnection, coin_name: bytes32, fork_height: Optional[uint32] = None + self, peer: WSFlaxConnection, coin_name: bytes32, fork_height: Optional[uint32] = None ) -> List[CoinState]: response: Optional[wallet_protocol.RespondChildren] = await peer.request_children( wallet_protocol.RequestChildren(coin_name) diff --git a/chia/wallet/wallet_node_api.py b/flax/wallet/wallet_node_api.py similarity index 88% rename from chia/wallet/wallet_node_api.py rename to flax/wallet/wallet_node_api.py index ddef660c4..48216199b 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 """ @@ -62,7 +62,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 @@ -71,7 +71,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. @@ -99,7 +99,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 self.wallet_node.wallet_peers is not None: await self.wallet_node.wallet_peers.respond_peers(request, peer.get_peer_info(), False) @@ -109,7 +109,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 self.wallet_node.wallet_peers is None: return None @@ -139,7 +139,7 @@ async def reject_header_blocks(self, request: wallet_protocol.RejectHeaderBlocks @execute_task @peer_required @api_request - async def coin_state_update(self, request: wallet_protocol.CoinStateUpdate, peer: WSChiaConnection): + async def coin_state_update(self, request: wallet_protocol.CoinStateUpdate, peer: WSFlaxConnection): await self.wallet_node.new_peak_queue.full_node_state_updated(request, peer) @api_request diff --git a/chia/wallet/wallet_pool_store.py b/flax/wallet/wallet_pool_store.py similarity index 97% rename from chia/wallet/wallet_pool_store.py rename to flax/wallet/wallet_pool_store.py index 2523dd61c..33b91cf3c 100644 --- a/chia/wallet/wallet_pool_store.py +++ b/flax/wallet/wallet_pool_store.py @@ -3,9 +3,9 @@ import aiosqlite -from chia.types.coin_spend import CoinSpend -from chia.util.db_wrapper import DBWrapper -from chia.util.ints import uint32 +from flax.types.coin_spend import CoinSpend +from flax.util.db_wrapper import DBWrapper +from flax.util.ints import uint32 log = logging.getLogger(__name__) diff --git a/chia/wallet/wallet_puzzle_store.py b/flax/wallet/wallet_puzzle_store.py similarity index 98% rename from chia/wallet/wallet_puzzle_store.py rename to flax/wallet/wallet_puzzle_store.py index f022a6211..51d58e5bc 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 f128b8a23..6332dea33 100644 --- a/chia/wallet/wallet_state_manager.py +++ b/flax/wallet/wallet_state_manager.py @@ -12,66 +12,66 @@ import aiosqlite from blspy import G1Element, PrivateKey -from chia.consensus.coinbase import farmer_parent_id, pool_parent_id -from chia.consensus.constants import ConsensusConstants -from chia.pools.pool_puzzles import SINGLETON_LAUNCHER_HASH, solution_to_pool_state -from chia.pools.pool_wallet import PoolWallet -from chia.protocols import wallet_protocol -from chia.protocols.wallet_protocol import CoinState, PuzzleSolutionResponse, RespondPuzzleSolution -from chia.server.server import ChiaServer -from chia.server.ws_connection import WSChiaConnection -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_spend import CoinSpend -from chia.types.full_block import FullBlock -from chia.types.mempool_inclusion_status import MempoolInclusionStatus -from chia.util.bech32m import encode_puzzle_hash -from chia.util.byte_types import hexstr_to_bytes -from chia.util.config import process_config_start_method -from chia.util.db_synchronous import db_synchronous_on -from chia.util.db_wrapper import DBWrapper -from chia.util.errors import Err -from chia.util.ints import uint8, uint32, uint64, uint128 -from chia.wallet.cat_wallet.cat_constants import DEFAULT_CATS -from chia.wallet.cat_wallet.cat_utils import construct_cat_puzzle, match_cat_puzzle -from chia.wallet.cat_wallet.cat_wallet import CATWallet -from chia.wallet.derivation_record import DerivationRecord -from chia.wallet.derive_keys import master_sk_to_wallet_sk, master_sk_to_wallet_sk_unhardened -from chia.wallet.did_wallet.did_info import DID_HRP -from chia.wallet.did_wallet.did_wallet import DIDWallet -from chia.wallet.did_wallet.did_wallet_puzzles import DID_INNERPUZ_MOD, create_fullpuz, match_did_puzzle -from chia.wallet.key_val_store import KeyValStore -from chia.wallet.nft_wallet.nft_info import NFTWalletInfo -from chia.wallet.nft_wallet.nft_puzzles import get_metadata_and_phs, get_new_owner_did -from chia.wallet.nft_wallet.nft_wallet import NFTWallet -from chia.wallet.nft_wallet.uncurry_nft import UncurriedNFT -from chia.wallet.outer_puzzles import AssetType -from chia.wallet.puzzle_drivers import PuzzleInfo -from chia.wallet.puzzles.cat_loader import CAT_MOD -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.compute_hints import compute_coin_hints -from chia.wallet.util.transaction_type import TransactionType -from chia.wallet.util.wallet_sync_utils import last_change_height_cs -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_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 -from chia.wallet.wallet_interested_store import WalletInterestedStore -from chia.wallet.wallet_nft_store import WalletNftStore -from chia.wallet.wallet_pool_store import WalletPoolStore -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.wallet.wallet_weight_proof_handler import WalletWeightProofHandler +from flax.consensus.coinbase import farmer_parent_id, pool_parent_id +from flax.consensus.constants import ConsensusConstants +from flax.pools.pool_puzzles import SINGLETON_LAUNCHER_HASH, solution_to_pool_state +from flax.pools.pool_wallet import PoolWallet +from flax.protocols import wallet_protocol +from flax.protocols.wallet_protocol import CoinState, PuzzleSolutionResponse, RespondPuzzleSolution +from flax.server.server import FlaxServer +from flax.server.ws_connection import WSFlaxConnection +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_spend import CoinSpend +from flax.types.full_block import FullBlock +from flax.types.mempool_inclusion_status import MempoolInclusionStatus +from flax.util.bech32m import encode_puzzle_hash +from flax.util.byte_types import hexstr_to_bytes +from flax.util.config import process_config_start_method +from flax.util.db_synchronous import db_synchronous_on +from flax.util.db_wrapper import DBWrapper +from flax.util.errors import Err +from flax.util.ints import uint8, uint32, uint64, uint128 +from flax.wallet.cat_wallet.cat_constants import DEFAULT_CATS +from flax.wallet.cat_wallet.cat_utils import construct_cat_puzzle, match_cat_puzzle +from flax.wallet.cat_wallet.cat_wallet import CATWallet +from flax.wallet.derivation_record import DerivationRecord +from flax.wallet.derive_keys import master_sk_to_wallet_sk, master_sk_to_wallet_sk_unhardened +from flax.wallet.did_wallet.did_info import DID_HRP +from flax.wallet.did_wallet.did_wallet import DIDWallet +from flax.wallet.did_wallet.did_wallet_puzzles import DID_INNERPUZ_MOD, create_fullpuz, match_did_puzzle +from flax.wallet.key_val_store import KeyValStore +from flax.wallet.nft_wallet.nft_info import NFTWalletInfo +from flax.wallet.nft_wallet.nft_puzzles import get_metadata_and_phs, get_new_owner_did +from flax.wallet.nft_wallet.nft_wallet import NFTWallet +from flax.wallet.nft_wallet.uncurry_nft import UncurriedNFT +from flax.wallet.outer_puzzles import AssetType +from flax.wallet.puzzle_drivers import PuzzleInfo +from flax.wallet.puzzles.cat_loader import CAT_MOD +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.compute_hints import compute_coin_hints +from flax.wallet.util.transaction_type import TransactionType +from flax.wallet.util.wallet_sync_utils import last_change_height_cs +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_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 +from flax.wallet.wallet_interested_store import WalletInterestedStore +from flax.wallet.wallet_nft_store import WalletNftStore +from flax.wallet.wallet_pool_store import WalletPoolStore +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.wallet.wallet_weight_proof_handler import WalletWeightProofHandler class WalletStateManager: @@ -117,7 +117,7 @@ class WalletStateManager: interested_store: WalletInterestedStore multiprocessing_context: multiprocessing.context.BaseContext weight_proof_handler: WalletWeightProofHandler - server: ChiaServer + server: FlaxServer root_path: Path wallet_node: Any pool_store: WalletPoolStore @@ -130,7 +130,7 @@ async def create( config: Dict, db_path: Path, constants: ConsensusConstants, - server: ChiaServer, + server: FlaxServer, root_path: Path, wallet_node, name: str = None, @@ -147,9 +147,10 @@ async def create( self.db_connection = await aiosqlite.connect(db_path) await self.db_connection.execute("pragma journal_mode=wal") - await self.db_connection.execute( - "pragma synchronous={}".format(db_synchronous_on(self.config.get("db_sync", "auto"), db_path)) - ) + # Never use pragma synchronous=OFF in Flax. + # await self.db_connection.execute( + # "pragma synchronous={}".format(db_synchronous_on(self.config.get("db_sync", "auto"), db_path)) + # ) self.db_wrapper = DBWrapper(self.db_connection) self.coin_store = await WalletCoinStore.create(self.db_wrapper) @@ -554,7 +555,7 @@ async def unconfirmed_removals_for_wallet(self, wallet_id: int) -> Dict[bytes32, return removals async def determine_coin_type( - self, peer: WSChiaConnection, coin_state: CoinState, fork_height: Optional[uint32] + self, peer: WSFlaxConnection, coin_state: CoinState, fork_height: Optional[uint32] ) -> Tuple[Optional[uint32], Optional[WalletType]]: if self.is_pool_reward(coin_state.created_height, coin_state.coin.parent_coin_info) or self.is_farmer_reward( coin_state.created_height, coin_state.coin.parent_coin_info @@ -814,7 +815,7 @@ async def handle_nft( return wallet_id, wallet_type async def new_coin_state( - self, coin_states: List[CoinState], peer: WSChiaConnection, fork_height: Optional[uint32] + self, coin_states: List[CoinState], peer: WSFlaxConnection, fork_height: Optional[uint32] ) -> None: # TODO: add comment about what this method does # Input states should already be sorted by cs_height, with reorgs at the beginning 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 98% rename from chia/wallet/wallet_transaction_store.py rename to flax/wallet/wallet_transaction_store.py index 02b330f31..8d3955b7a 100644 --- a/chia/wallet/wallet_transaction_store.py +++ b/flax/wallet/wallet_transaction_store.py @@ -4,14 +4,14 @@ 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.transaction_sorting import SortKey -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.transaction_sorting import SortKey +from flax.wallet.util.transaction_type import TransactionType def filter_ok_mempool_status(sent_to: List[Tuple[str, uint8, Optional[str]]]) -> List[Tuple[str, uint8, Optional[str]]]: diff --git a/chia/wallet/wallet_user_store.py b/flax/wallet/wallet_user_store.py similarity index 95% rename from chia/wallet/wallet_user_store.py rename to flax/wallet/wallet_user_store.py index 7f1eb1455..cb07e6b9b 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: @@ -46,7 +46,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/chia/wallet/wallet_weight_proof_handler.py b/flax/wallet/wallet_weight_proof_handler.py similarity index 94% rename from chia/wallet/wallet_weight_proof_handler.py rename to flax/wallet/wallet_weight_proof_handler.py index 7690c6019..d86814da6 100644 --- a/chia/wallet/wallet_weight_proof_handler.py +++ b/flax/wallet/wallet_weight_proof_handler.py @@ -7,9 +7,9 @@ from multiprocessing.context import BaseContext from typing import IO, List, Tuple, Optional -from chia.consensus.block_record import BlockRecord -from chia.consensus.constants import ConsensusConstants -from chia.full_node.weight_proof import ( +from flax.consensus.block_record import BlockRecord +from flax.consensus.constants import ConsensusConstants +from flax.full_node.weight_proof import ( _validate_sub_epoch_summaries, vars_to_bytes, validate_sub_epoch_sampling, @@ -18,20 +18,20 @@ chunks, _validate_vdf_batch, ) -from chia.types.blockchain_format.sub_epoch_summary import SubEpochSummary +from flax.types.blockchain_format.sub_epoch_summary import SubEpochSummary -from chia.types.weight_proof import ( +from flax.types.weight_proof import ( WeightProof, ) -from chia.util.ints import uint32 -from chia.util.setproctitle import getproctitle, setproctitle +from flax.util.ints import uint32 +from flax.util.setproctitle import getproctitle, setproctitle log = logging.getLogger(__name__) def _create_shutdown_file() -> IO: - return tempfile.NamedTemporaryFile(prefix="chia_wallet_weight_proof_handler_executor_shutdown_trigger") + return tempfile.NamedTemporaryFile(prefix="flax_wallet_weight_proof_handler_executor_shutdown_trigger") class WalletWeightProofHandler: diff --git a/install-gui.sh b/install-gui.sh index 278d156ca..a5fc2360d 100755 --- a/install-gui.sh +++ b/install-gui.sh @@ -13,17 +13,17 @@ if [ "${SCRIPT_DIR}" != "$(pwd)" ]; then fi 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 nodejs_is_installed(){ @@ -57,12 +57,12 @@ do_install_npm_locally(){ cd "${NPM_GLOBAL}" if [ "$NPM_VERSION" -lt "6" ]; then # Ubuntu image of Amazon ec2 instance surprisingly uses nodejs@3.5.2 - # which doesn't support `npm ci` as of 27th Jan, 2022 + # which doesn't support `npm install` as of 27th Jan, 2022 echo "npm install" npm install else - echo "npm ci" - npm ci + echo "npm install" + npm install fi export N_PREFIX=${SCRIPT_DIR}/.n PATH="${N_PREFIX}/bin:$(npm bin):${PATH}" @@ -88,7 +88,7 @@ do_install_npm_locally(){ } # Work around for inconsistent `npm` exec path issue -# https://github.com/Chia-Network/chia-blockchain/pull/10460#issuecomment-1054492495 +# https://github.com/Flax-Network/flax-blockchain/pull/10460#issuecomment-1054492495 patch_inconsistent_npm_issue(){ node_module_dir=$1 if [ ! -d "$node_module_dir" ]; then @@ -182,7 +182,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 @@ -194,20 +194,20 @@ if [ ! "$CI" ]; then fi # Work around for inconsistent `npm` exec path issue - # https://github.com/Chia-Network/chia-blockchain/pull/10460#issuecomment-1054492495 + # https://github.com/Flax-Network/flax-blockchain/pull/10460#issuecomment-1054492495 patch_inconsistent_npm_issue "../node_modules" - npm ci + npm install npm audit fix || true npm run build - # Set modified output of `chia version` to version property of GUI's package.json + # Set modified output of `flax version` to version property of GUI's package.json python ../installhelper.py else echo "Skipping node.js in install.sh on MacOS ci." fi echo "" -echo "Chia blockchain install-gui.sh completed." +echo "Flax blockchain install-gui.sh completed." echo "" echo "Type 'bash start-gui.sh &' to start the GUI." diff --git a/install-timelord.sh b/install-timelord.sh old mode 100644 new mode 100755 index 0f976131a..7921f0b88 --- a/install-timelord.sh +++ b/install-timelord.sh @@ -26,7 +26,7 @@ do done 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 @@ -44,7 +44,7 @@ fi 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))') @@ -95,8 +95,8 @@ else echo "apt-get install libgmp-dev libboost-python-dev $PYTHON_DEV_DEPENDENCY libboost-system-dev build-essential -y" sudo apt-get install libgmp-dev libboost-python-dev "$PYTHON_DEV_DEPENDENCY" libboost-system-dev build-essential -y echo "Installing chiavdf from source on Ubuntu/Debian" - 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 dependencies on RedHat/CentOS/Fedora" @@ -104,22 +104,22 @@ else echo "yum install gcc gcc-c++ gmp-devel $PYTHON_DEV_DEPENDENCY libtool make autoconf automake openssl-devel libevent-devel boost-devel python3 cmake -y" sudo yum install gcc gcc-c++ gmp-devel "$PYTHON_DEV_DEPENDENCY" libtool make autoconf automake openssl-devel libevent-devel boost-devel python3 cmake -y echo "Installing chiavdf from source on RedHat/CentOS/Fedora" - 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; then echo "Installing chiavdf dependencies for MacOS." brew install boost cmake gmp 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 index 1b62e6d4e..3fb96e3f7 100755 --- a/install.sh +++ b/install.sh @@ -47,9 +47,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 @@ -92,7 +92,7 @@ install_python3_and_sqlite3_from_source_with_yum() { echo "cd $TMP_PATH" cd "$TMP_PATH" # Install sqlite>=3.37 - # yum install sqlite-devel brings sqlite3.7 which is not compatible with chia + # yum install sqlite-devel brings sqlite3.7 which is not compatible with flax echo "wget https://www.sqlite.org/2022/sqlite-autoconf-3370200.tar.gz" wget https://www.sqlite.org/2022/sqlite-autoconf-3370200.tar.gz tar xf sqlite-autoconf-3370200.tar.gz @@ -105,7 +105,7 @@ install_python3_and_sqlite3_from_source_with_yum() { make -j"$(nproc)" | stdbuf -o0 cut -b1-"$(tput cols)" | sed -u 'i\\o033[2K' | stdbuf -o0 tr '\n' '\r'; echo echo "sudo make install" sudo make install | stdbuf -o0 cut -b1-"$(tput cols)" | sed -u 'i\\o033[2K' | stdbuf -o0 tr '\n' '\r'; echo - # yum install python3 brings Python3.6 which is not supported by chia + # yum install python3 brings Python3.6 which is not supported by flax cd .. echo "wget https://www.python.org/ftp/python/3.9.11/Python-3.9.11.tgz" wget https://www.python.org/ftp/python/3.9.11/Python-3.9.11.tgz @@ -211,7 +211,7 @@ find_python() { if [ "$BEST_VERSION" = "3" ]; then PY3_VERSION=$(python$BEST_VERSION --version | cut -d ' ' -f2) if [[ "$PY3_VERSION" =~ 3.11.* ]]; then - echo "Chia requires Python version < 3.11.0" >&2 + echo "Flax requires Python version < 3.11.0" >&2 echo "Current Python version = $PY3_VERSION" >&2 # If Arch, direct to Arch Wiki if type pacman >/dev/null 2>&1 && [ -f "/etc/arch-release" ]; then @@ -298,13 +298,13 @@ python -m pip install --extra-index-url https://pypi.chia.net/simple/ miniupnpc= python -m pip install -e ."${EXTRAS}" --extra-index-url https://pypi.chia.net/simple/ echo "" -echo "Chia blockchain install.sh complete." -echo "For assistance join us on Keybase in the #support 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 #support chat channel:" +echo "https://discord.gg/yEWaF6CQcA" 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/installhelper.py b/installhelper.py index 7416ecf4c..037a34f35 100644 --- a/installhelper.py +++ b/installhelper.py @@ -1,6 +1,6 @@ # # Install helper code to manage inserting the correct version for the GUI -# Gets the version from the result of "chia version" +# Gets the version from the result of "flax version" # Converts to proper symver format so NPM doesn't complain # Adds the version info to the package.json file # @@ -47,9 +47,9 @@ def make_semver(version_str: str) -> str: return version -def get_chia_version() -> str: +def get_flax_version() -> str: version: str = "0.0" - output = subprocess.run(["chia", "version"], capture_output=True) + output = subprocess.run(["flax", "version"], capture_output=True) if output.returncode == 0: version = str(output.stdout.strip(), "utf-8").splitlines()[-1] return make_semver(version) @@ -62,12 +62,12 @@ def update_version(package_json_path: str): with open(package_json_path) as f: data = json.load(f) - data["version"] = get_chia_version() + data["version"] = get_flax_version() with open(package_json_path, "w") as w: json.dump(data, indent=4, fp=w) if __name__ == "__main__": - update_version(f"{os.path.dirname(__file__)}/chia-blockchain-gui/package.json") - update_version(f"{os.path.dirname(__file__)}/chia-blockchain-gui/packages/gui/package.json") + update_version(f"{os.path.dirname(__file__)}/flax-blockchain-gui/package.json") + update_version(f"{os.path.dirname(__file__)}/flax-blockchain-gui/packages/gui/package.json") diff --git a/lgtm.yml b/lgtm.yml index 413554587..f22f39112 100644 --- a/lgtm.yml +++ b/lgtm.yml @@ -8,4 +8,4 @@ extraction: javascript: index: include: - - chia-blockchain-gui + - flax-blockchain-gui diff --git a/mypy.ini b/mypy.ini index 7934d6fd7..e3cc2d543 100644 --- a/mypy.ini +++ b/mypy.ini @@ -1,5 +1,5 @@ [mypy] -files = benchmarks,build_scripts,chia,tests,tools,*.py +files = benchmarks,build_scripts,flax,tests,tools,*.py ignore_missing_imports = True show_error_codes = True warn_unused_ignores = True @@ -17,7 +17,7 @@ no_implicit_reexport = True strict_equality = True # list created by: venv/bin/mypy | sed -n 's/.py:.*//p' | sort | uniq | tr '/' '.' | tr '\n' ',' -[mypy-benchmarks.block_ref,benchmarks.block_store,benchmarks.coin_store,benchmarks.utils,build_scripts.installer-version,chia.clvm.spend_sim,chia.cmds.configure,chia.cmds.db,chia.cmds.db_upgrade_func,chia.cmds.farm_funcs,chia.cmds.init,chia.cmds.init_funcs,chia.cmds.keys,chia.cmds.keys_funcs,chia.cmds.passphrase,chia.cmds.passphrase_funcs,chia.cmds.plotnft,chia.cmds.plotnft_funcs,chia.cmds.plots,chia.cmds.plotters,chia.cmds.show,chia.cmds.start_funcs,chia.cmds.wallet,chia.cmds.wallet_funcs,chia.daemon.client,chia.daemon.keychain_proxy,chia.daemon.keychain_server,chia.daemon.server,chia.farmer.farmer,chia.farmer.farmer_api,chia.full_node.block_height_map,chia.full_node.block_store,chia.full_node.bundle_tools,chia.full_node.coin_store,chia.full_node.full_node,chia.full_node.full_node_api,chia.full_node.full_node_store,chia.full_node.generator,chia.full_node.hint_store,chia.full_node.lock_queue,chia.full_node.mempool,chia.full_node.mempool_check_conditions,chia.full_node.mempool_manager,chia.full_node.pending_tx_cache,chia.full_node.sync_store,chia.full_node.weight_proof,chia.harvester.harvester,chia.harvester.harvester_api,chia.introducer.introducer,chia.introducer.introducer_api,chia.plotters.bladebit,chia.plotters.chiapos,chia.plotters.install_plotter,chia.plotters.madmax,chia.plotters.plotters,chia.plotters.plotters_util,chia.plotting.check_plots,chia.plotting.create_plots,chia.plotting.manager,chia.plotting.util,chia.pools.pool_config,chia.pools.pool_puzzles,chia.pools.pool_wallet,chia.pools.pool_wallet_info,chia.protocols.pool_protocol,chia.rpc.crawler_rpc_api,chia.rpc.farmer_rpc_api,chia.rpc.farmer_rpc_client,chia.rpc.full_node_rpc_api,chia.rpc.full_node_rpc_client,chia.rpc.harvester_rpc_api,chia.rpc.harvester_rpc_client,chia.rpc.rpc_client,chia.rpc.rpc_server,chia.rpc.timelord_rpc_api,chia.rpc.util,chia.rpc.wallet_rpc_api,chia.rpc.wallet_rpc_client,chia.seeder.crawler,chia.seeder.crawler_api,chia.seeder.crawl_store,chia.seeder.dns_server,chia.seeder.peer_record,chia.seeder.start_crawler,chia.server.address_manager,chia.server.address_manager_store,chia.server.connection_utils,chia.server.introducer_peers,chia.server.node_discovery,chia.server.peer_store_resolver,chia.server.rate_limits,chia.server.reconnect_task,chia.server.server,chia.server.ssl_context,chia.server.start_farmer,chia.server.start_full_node,chia.server.start_harvester,chia.server.start_introducer,chia.server.start_service,chia.server.start_timelord,chia.server.start_wallet,chia.server.upnp,chia.server.ws_connection,chia.simulator.full_node_simulator,chia.simulator.start_simulator,chia.ssl.create_ssl,chia.timelord.iters_from_block,chia.timelord.timelord,chia.timelord.timelord_api,chia.timelord.timelord_launcher,chia.timelord.timelord_state,chia.types.announcement,chia.types.blockchain_format.classgroup,chia.types.blockchain_format.coin,chia.types.blockchain_format.program,chia.types.blockchain_format.proof_of_space,chia.types.blockchain_format.tree_hash,chia.types.blockchain_format.vdf,chia.types.full_block,chia.types.header_block,chia.types.mempool_item,chia.types.name_puzzle_condition,chia.types.peer_info,chia.types.spend_bundle,chia.types.transaction_queue_entry,chia.types.unfinished_block,chia.types.unfinished_header_block,chia.util.api_decorators,chia.util.block_cache,chia.util.cached_bls,chia.util.check_fork_next_block,chia.util.chia_logging,chia.util.config,chia.util.db_wrapper,chia.util.dump_keyring,chia.util.file_keyring,chia.util.files,chia.util.hash,chia.util.json_util,chia.util.keychain,chia.util.keyring_wrapper,chia.util.log_exceptions,chia.util.lru_cache,chia.util.make_test_constants,chia.util.merkle_set,chia.util.network,chia.util.partial_func,chia.util.pip_import,chia.util.profiler,chia.util.safe_cancel_task,chia.util.service_groups,chia.util.ssl_check,chia.util.validate_alert,chia.wallet.block_record,chia.wallet.cat_wallet.cat_utils,chia.wallet.cat_wallet.cat_wallet,chia.wallet.cat_wallet.lineage_store,chia.wallet.chialisp,chia.wallet.did_wallet.did_wallet,chia.wallet.did_wallet.did_wallet_puzzles,chia.wallet.key_val_store,chia.wallet.lineage_proof,chia.wallet.nft_wallet.nft_wallet,chia.wallet.payment,chia.wallet.puzzles.load_clvm,chia.wallet.puzzles.p2_conditions,chia.wallet.puzzles.p2_delegated_conditions,chia.wallet.puzzles.p2_delegated_puzzle,chia.wallet.puzzles.p2_delegated_puzzle_or_hidden_puzzle,chia.wallet.puzzles.p2_m_of_n_delegate_direct,chia.wallet.puzzles.p2_puzzle_hash,chia.wallet.puzzles.prefarm.spend_prefarm,chia.wallet.puzzles.puzzle_utils,chia.wallet.puzzles.rom_bootstrap_generator,chia.wallet.puzzles.singleton_top_layer,chia.wallet.puzzles.tails,chia.wallet.rl_wallet.rl_wallet,chia.wallet.rl_wallet.rl_wallet_puzzles,chia.wallet.secret_key_store,chia.wallet.settings.user_settings,chia.wallet.trade_manager,chia.wallet.trade_record,chia.wallet.trading.offer,chia.wallet.trading.trade_store,chia.wallet.transaction_record,chia.wallet.util.debug_spend_bundle,chia.wallet.util.new_peak_queue,chia.wallet.util.peer_request_cache,chia.wallet.util.wallet_sync_utils,chia.wallet.wallet,chia.wallet.wallet_action_store,chia.wallet.wallet_blockchain,chia.wallet.wallet_coin_store,chia.wallet.wallet_interested_store,chia.wallet.wallet_node,chia.wallet.wallet_node_api,chia.wallet.wallet_pool_store,chia.wallet.wallet_puzzle_store,chia.wallet.wallet_state_manager,chia.wallet.wallet_sync_store,chia.wallet.wallet_transaction_store,chia.wallet.wallet_user_store,chia.wallet.wallet_weight_proof_handler,installhelper,tests.blockchain.blockchain_test_utils,tests.blockchain.test_blockchain,tests.blockchain.test_blockchain_transactions,tests.block_tools,tests.build-init-files,tests.build-workflows,tests.clvm.coin_store,tests.clvm.test_chialisp_deserialization,tests.clvm.test_clvm_compilation,tests.clvm.test_program,tests.clvm.test_puzzle_compression,tests.clvm.test_puzzles,tests.clvm.test_serialized_program,tests.clvm.test_singletons,tests.clvm.test_spend_sim,tests.conftest,tests.connection_utils,tests.core.cmds.test_keys,tests.core.consensus.test_pot_iterations,tests.core.custom_types.test_coin,tests.core.custom_types.test_proof_of_space,tests.core.custom_types.test_spend_bundle,tests.core.daemon.test_daemon,tests.core.full_node.full_sync.test_full_sync,tests.core.full_node.stores.test_block_store,tests.core.full_node.stores.test_coin_store,tests.core.full_node.stores.test_full_node_store,tests.core.full_node.stores.test_hint_store,tests.core.full_node.stores.test_sync_store,tests.core.full_node.test_address_manager,tests.core.full_node.test_block_height_map,tests.core.full_node.test_conditions,tests.core.full_node.test_full_node,tests.core.full_node.test_mempool,tests.core.full_node.test_mempool_performance,tests.core.full_node.test_node_load,tests.core.full_node.test_peer_store_resolver,tests.core.full_node.test_performance,tests.core.full_node.test_transactions,tests.core.make_block_generator,tests.core.node_height,tests.core.server.test_dos,tests.core.server.test_rate_limits,tests.core.ssl.test_ssl,tests.core.test_cost_calculation,tests.core.test_crawler_rpc,tests.core.test_daemon_rpc,tests.core.test_db_conversion,tests.core.test_db_validation,tests.core.test_farmer_harvester_rpc,tests.core.test_filter,tests.core.test_full_node_rpc,tests.core.test_merkle_set,tests.core.test_setproctitle,tests.core.util.test_cached_bls,tests.core.util.test_config,tests.core.util.test_file_keyring_synchronization,tests.core.util.test_files,tests.core.util.test_keychain,tests.core.util.test_keyring_wrapper,tests.core.util.test_lru_cache,tests.core.util.test_significant_bits,tests.farmer_harvester.test_farmer_harvester,tests.generator.test_compression,tests.generator.test_generator_types,tests.generator.test_list_to_batches,tests.generator.test_rom,tests.generator.test_scan,tests.plotting.test_plot_manager,tests.pools.test_pool_cmdline,tests.pools.test_pool_config,tests.pools.test_pool_puzzles_lifecycle,tests.pools.test_pool_rpc,tests.pools.test_wallet_pool_store,tests.setup_nodes,tests.setup_services,tests.simulation.test_simulation,tests.time_out_assert,tests.tools.test_full_sync,tests.tools.test_run_block,tests.util.alert_server,tests.util.benchmark_cost,tests.util.blockchain,tests.util.build_network_protocol_files,tests.util.db_connection,tests.util.generator_tools_testing,tests.util.keyring,tests.util.key_tool,tests.util.rpc,tests.util.test_full_block_utils,tests.util.test_lock_queue,tests.util.test_misc,tests.util.test_network,tests.util.test_network_protocol_files,tests.wallet.cat_wallet.test_cat_lifecycle,tests.wallet.cat_wallet.test_cat_wallet,tests.wallet.cat_wallet.test_offer_lifecycle,tests.wallet.cat_wallet.test_trades,tests.wallet.did_wallet.test_did,tests.wallet.did_wallet.test_did_rpc,tests.wallet.did_wallet.test_nft_rpc,tests.wallet.did_wallet.test_nft_wallet,tests.wallet.rl_wallet.test_rl_rpc,tests.wallet.rl_wallet.test_rl_wallet,tests.wallet.rpc.test_wallet_rpc,tests.wallet.simple_sync.test_simple_sync_protocol,tests.wallet.sync.test_wallet_sync,tests.wallet.test_bech32m,tests.wallet.test_chialisp,tests.wallet.test_puzzle_store,tests.wallet.test_singleton,tests.wallet.test_singleton_lifecycle,tests.wallet.test_singleton_lifecycle_fast,tests.wallet.test_taproot,tests.wallet.test_wallet_blockchain,tests.wallet.test_wallet_interested_store,tests.wallet.test_wallet_key_val_store,tests.wallet.test_wallet_user_store,tests.wallet_tools,tests.weight_proof.test_weight_proof,tools.analyze-chain,tools.run_block,tools.test_full_sync,tests.wallet.nft_wallet.test_nft_wallet,chia.wallet.nft_wallet.nft_puzzles,tests.wallet.nft_wallet.test_nft_puzzles] +[mypy-benchmarks.block_ref,benchmarks.block_store,benchmarks.coin_store,benchmarks.utils,build_scripts.installer-version,flax.clvm.spend_sim,flax.cmds.configure,flax.cmds.db,flax.cmds.db_upgrade_func,flax.cmds.farm_funcs,flax.cmds.init,flax.cmds.init_funcs,flax.cmds.keys,flax.cmds.keys_funcs,flax.cmds.passphrase,flax.cmds.passphrase_funcs,flax.cmds.plotnft,flax.cmds.plotnft_funcs,flax.cmds.plots,flax.cmds.plotters,flax.cmds.show,flax.cmds.start_funcs,flax.cmds.wallet,flax.cmds.wallet_funcs,flax.daemon.client,flax.daemon.keychain_proxy,flax.daemon.keychain_server,flax.daemon.server,flax.farmer.farmer,flax.farmer.farmer_api,flax.full_node.block_height_map,flax.full_node.block_store,flax.full_node.bundle_tools,flax.full_node.coin_store,flax.full_node.full_node,flax.full_node.full_node_api,flax.full_node.full_node_store,flax.full_node.generator,flax.full_node.hint_store,flax.full_node.lock_queue,flax.full_node.mempool,flax.full_node.mempool_check_conditions,flax.full_node.mempool_manager,flax.full_node.pending_tx_cache,flax.full_node.sync_store,flax.full_node.weight_proof,flax.harvester.harvester,flax.harvester.harvester_api,flax.introducer.introducer,flax.introducer.introducer_api,flax.plotters.bladebit,flax.plotters.chiapos,flax.plotters.install_plotter,flax.plotters.madmax,flax.plotters.plotters,flax.plotters.plotters_util,flax.plotting.check_plots,flax.plotting.create_plots,flax.plotting.manager,flax.plotting.util,flax.pools.pool_config,flax.pools.pool_puzzles,flax.pools.pool_wallet,flax.pools.pool_wallet_info,flax.protocols.pool_protocol,flax.rpc.crawler_rpc_api,flax.rpc.farmer_rpc_api,flax.rpc.farmer_rpc_client,flax.rpc.full_node_rpc_api,flax.rpc.full_node_rpc_client,flax.rpc.harvester_rpc_api,flax.rpc.harvester_rpc_client,flax.rpc.rpc_client,flax.rpc.rpc_server,flax.rpc.timelord_rpc_api,flax.rpc.util,flax.rpc.wallet_rpc_api,flax.rpc.wallet_rpc_client,flax.seeder.crawler,flax.seeder.crawler_api,flax.seeder.crawl_store,flax.seeder.dns_server,flax.seeder.peer_record,flax.seeder.start_crawler,flax.server.address_manager,flax.server.address_manager_store,flax.server.connection_utils,flax.server.introducer_peers,flax.server.node_discovery,flax.server.peer_store_resolver,flax.server.rate_limits,flax.server.reconnect_task,flax.server.server,flax.server.ssl_context,flax.server.start_farmer,flax.server.start_full_node,flax.server.start_harvester,flax.server.start_introducer,flax.server.start_service,flax.server.start_timelord,flax.server.start_wallet,flax.server.upnp,flax.server.ws_connection,flax.simulator.full_node_simulator,flax.simulator.start_simulator,flax.ssl.create_ssl,flax.timelord.iters_from_block,flax.timelord.timelord,flax.timelord.timelord_api,flax.timelord.timelord_launcher,flax.timelord.timelord_state,flax.types.announcement,flax.types.blockchain_format.classgroup,flax.types.blockchain_format.coin,flax.types.blockchain_format.program,flax.types.blockchain_format.proof_of_space,flax.types.blockchain_format.tree_hash,flax.types.blockchain_format.vdf,flax.types.full_block,flax.types.header_block,flax.types.mempool_item,flax.types.name_puzzle_condition,flax.types.peer_info,flax.types.spend_bundle,flax.types.transaction_queue_entry,flax.types.unfinished_block,flax.types.unfinished_header_block,flax.util.api_decorators,flax.util.block_cache,flax.util.cached_bls,flax.util.check_fork_next_block,flax.util.flax_logging,flax.util.config,flax.util.db_wrapper,flax.util.dump_keyring,flax.util.file_keyring,flax.util.files,flax.util.hash,flax.util.json_util,flax.util.keychain,flax.util.keyring_wrapper,flax.util.log_exceptions,flax.util.lru_cache,flax.util.make_test_constants,flax.util.merkle_set,flax.util.network,flax.util.partial_func,flax.util.pip_import,flax.util.profiler,flax.util.safe_cancel_task,flax.util.service_groups,flax.util.ssl_check,flax.util.validate_alert,flax.wallet.block_record,flax.wallet.cat_wallet.cat_utils,flax.wallet.cat_wallet.cat_wallet,flax.wallet.cat_wallet.lineage_store,flax.wallet.flaxlisp,flax.wallet.did_wallet.did_wallet,flax.wallet.did_wallet.did_wallet_puzzles,flax.wallet.key_val_store,flax.wallet.lineage_proof,flax.wallet.nft_wallet.nft_wallet,flax.wallet.payment,flax.wallet.puzzles.load_clvm,flax.wallet.puzzles.p2_conditions,flax.wallet.puzzles.p2_delegated_conditions,flax.wallet.puzzles.p2_delegated_puzzle,flax.wallet.puzzles.p2_delegated_puzzle_or_hidden_puzzle,flax.wallet.puzzles.p2_m_of_n_delegate_direct,flax.wallet.puzzles.p2_puzzle_hash,flax.wallet.puzzles.prefarm.spend_prefarm,flax.wallet.puzzles.puzzle_utils,flax.wallet.puzzles.rom_bootstrap_generator,flax.wallet.puzzles.singleton_top_layer,flax.wallet.puzzles.tails,flax.wallet.rl_wallet.rl_wallet,flax.wallet.rl_wallet.rl_wallet_puzzles,flax.wallet.secret_key_store,flax.wallet.settings.user_settings,flax.wallet.trade_manager,flax.wallet.trade_record,flax.wallet.trading.offer,flax.wallet.trading.trade_store,flax.wallet.transaction_record,flax.wallet.util.debug_spend_bundle,flax.wallet.util.new_peak_queue,flax.wallet.util.peer_request_cache,flax.wallet.util.wallet_sync_utils,flax.wallet.wallet,flax.wallet.wallet_action_store,flax.wallet.wallet_blockchain,flax.wallet.wallet_coin_store,flax.wallet.wallet_interested_store,flax.wallet.wallet_node,flax.wallet.wallet_node_api,flax.wallet.wallet_pool_store,flax.wallet.wallet_puzzle_store,flax.wallet.wallet_state_manager,flax.wallet.wallet_sync_store,flax.wallet.wallet_transaction_store,flax.wallet.wallet_user_store,flax.wallet.wallet_weight_proof_handler,installhelper,tests.blockchain.blockchain_test_utils,tests.blockchain.test_blockchain,tests.blockchain.test_blockchain_transactions,tests.block_tools,tests.build-init-files,tests.build-workflows,tests.clvm.coin_store,tests.clvm.test_flaxlisp_deserialization,tests.clvm.test_clvm_compilation,tests.clvm.test_program,tests.clvm.test_puzzle_compression,tests.clvm.test_puzzles,tests.clvm.test_serialized_program,tests.clvm.test_singletons,tests.clvm.test_spend_sim,tests.conftest,tests.connection_utils,tests.core.cmds.test_keys,tests.core.consensus.test_pot_iterations,tests.core.custom_types.test_coin,tests.core.custom_types.test_proof_of_space,tests.core.custom_types.test_spend_bundle,tests.core.daemon.test_daemon,tests.core.full_node.full_sync.test_full_sync,tests.core.full_node.stores.test_block_store,tests.core.full_node.stores.test_coin_store,tests.core.full_node.stores.test_full_node_store,tests.core.full_node.stores.test_hint_store,tests.core.full_node.stores.test_sync_store,tests.core.full_node.test_address_manager,tests.core.full_node.test_block_height_map,tests.core.full_node.test_conditions,tests.core.full_node.test_full_node,tests.core.full_node.test_mempool,tests.core.full_node.test_mempool_performance,tests.core.full_node.test_node_load,tests.core.full_node.test_peer_store_resolver,tests.core.full_node.test_performance,tests.core.full_node.test_transactions,tests.core.make_block_generator,tests.core.node_height,tests.core.server.test_dos,tests.core.server.test_rate_limits,tests.core.ssl.test_ssl,tests.core.test_cost_calculation,tests.core.test_crawler_rpc,tests.core.test_daemon_rpc,tests.core.test_db_conversion,tests.core.test_db_validation,tests.core.test_farmer_harvester_rpc,tests.core.test_filter,tests.core.test_full_node_rpc,tests.core.test_merkle_set,tests.core.test_setproctitle,tests.core.util.test_cached_bls,tests.core.util.test_config,tests.core.util.test_file_keyring_synchronization,tests.core.util.test_files,tests.core.util.test_keychain,tests.core.util.test_keyring_wrapper,tests.core.util.test_lru_cache,tests.core.util.test_significant_bits,tests.farmer_harvester.test_farmer_harvester,tests.generator.test_compression,tests.generator.test_generator_types,tests.generator.test_list_to_batches,tests.generator.test_rom,tests.generator.test_scan,tests.plotting.test_plot_manager,tests.pools.test_pool_cmdline,tests.pools.test_pool_config,tests.pools.test_pool_puzzles_lifecycle,tests.pools.test_pool_rpc,tests.pools.test_wallet_pool_store,tests.setup_nodes,tests.setup_services,tests.simulation.test_simulation,tests.time_out_assert,tests.tools.test_full_sync,tests.tools.test_run_block,tests.util.alert_server,tests.util.benchmark_cost,tests.util.blockchain,tests.util.build_network_protocol_files,tests.util.db_connection,tests.util.generator_tools_testing,tests.util.keyring,tests.util.key_tool,tests.util.rpc,tests.util.test_full_block_utils,tests.util.test_lock_queue,tests.util.test_misc,tests.util.test_network,tests.util.test_network_protocol_files,tests.wallet.cat_wallet.test_cat_lifecycle,tests.wallet.cat_wallet.test_cat_wallet,tests.wallet.cat_wallet.test_offer_lifecycle,tests.wallet.cat_wallet.test_trades,tests.wallet.did_wallet.test_did,tests.wallet.did_wallet.test_did_rpc,tests.wallet.did_wallet.test_nft_rpc,tests.wallet.did_wallet.test_nft_wallet,tests.wallet.rl_wallet.test_rl_rpc,tests.wallet.rl_wallet.test_rl_wallet,tests.wallet.rpc.test_wallet_rpc,tests.wallet.simple_sync.test_simple_sync_protocol,tests.wallet.sync.test_wallet_sync,tests.wallet.test_bech32m,tests.wallet.test_flaxlisp,tests.wallet.test_puzzle_store,tests.wallet.test_singleton,tests.wallet.test_singleton_lifecycle,tests.wallet.test_singleton_lifecycle_fast,tests.wallet.test_taproot,tests.wallet.test_wallet_blockchain,tests.wallet.test_wallet_interested_store,tests.wallet.test_wallet_key_val_store,tests.wallet.test_wallet_user_store,tests.wallet_tools,tests.weight_proof.test_weight_proof,tools.analyze-chain,tools.run_block,tools.test_full_sync,tests.wallet.nft_wallet.test_nft_wallet,flax.wallet.nft_wallet.nft_puzzles,tests.wallet.nft_wallet.test_nft_puzzles] disallow_any_generics = False disallow_subclassing_any = False disallow_untyped_calls = False diff --git a/pyproject.toml b/pyproject.toml index b6d308171..cde70339e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,7 @@ target-version = ['py37', 'py38', 'py39'] include = ''' ^/( [^/]*.py - | (benchmarks|build_scripts|chia|tests|tools)/.*\.pyi? + | (benchmarks|build_scripts|flax|tests|tools)/.*\.pyi? )$ ''' exclude = '' 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 cdf00cdfb..0ffa3b211 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,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==6.0", # Used for config file format - "setproctitle==1.2.3", # Gives the chia processes readable names + "setproctitle==1.2.3", # Gives the flax processes readable names "sortedcontainers==2.4.0", # For maintaining sorted mempools # TODO: when moving to click 8 remove the pinning of black noted below "click==7.1.2", # For the CLI @@ -66,14 +66,12 @@ ] kwargs = dict( - name="chia-blockchain", - author="Mariano Sorgente", - author_email="mariano@chia.net", - description="Chia blockchain full node, farmer, timelord, and wallet.", - url="https://chia.net/", + name="flax-blockchain", + 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, extras_require=dict( uvloop=["uvloop"], @@ -82,61 +80,61 @@ ), packages=[ "build_scripts", - "chia", - "chia.cmds", - "chia.clvm", - "chia.consensus", - "chia.daemon", - "chia.full_node", - "chia.timelord", - "chia.farmer", - "chia.harvester", - "chia.introducer", - "chia.plot_sync", - "chia.plotters", - "chia.plotting", - "chia.pools", - "chia.protocols", - "chia.rpc", - "chia.seeder", - "chia.server", - "chia.simulator", - "chia.types.blockchain_format", - "chia.types", - "chia.util", - "chia.wallet", - "chia.wallet.puzzles", - "chia.wallet.rl_wallet", - "chia.wallet.cat_wallet", - "chia.wallet.did_wallet", - "chia.wallet.nft_wallet", - "chia.wallet.settings", - "chia.wallet.trading", - "chia.wallet.util", - "chia.ssl", + "flax", + "flax.cmds", + "flax.clvm", + "flax.consensus", + "flax.daemon", + "flax.full_node", + "flax.timelord", + "flax.farmer", + "flax.harvester", + "flax.introducer", + "flax.plot_sync", + "flax.plotters", + "flax.plotting", + "flax.pools", + "flax.protocols", + "flax.rpc", + "flax.seeder", + "flax.server", + "flax.simulator", + "flax.types.blockchain_format", + "flax.types", + "flax.util", + "flax.wallet", + "flax.wallet.puzzles", + "flax.wallet.rl_wallet", + "flax.wallet.cat_wallet", + "flax.wallet.did_wallet", + "flax.wallet.nft_wallet", + "flax.wallet.settings", + "flax.wallet.trading", + "flax.wallet.util", + "flax.ssl", "mozilla-ca", ], entry_points={ "console_scripts": [ - "chia = chia.cmds.chia:main", - "chia_daemon = chia.daemon.server: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_crawler = chia.seeder.start_crawler:main", - "chia_seeder = chia.seeder.dns_server: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_daemon = flax.daemon.server: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_crawler = flax.seeder.start_crawler:main", + "flax_seeder = flax.seeder.dns_server: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"], + "flax": ["pyinstaller.spec"], "": ["*.clvm", "*.clvm.hex", "*.clib", "*.clinc", "*.clsp", "py.typed"], - "chia.util": ["initial-*.yaml", "english.txt"], - "chia.ssl": ["chia_ca.crt", "chia_ca.key", "dst_root_ca.pem"], + "flax.util": ["initial-*.yaml", "english.txt"], + "flax.ssl": ["flax_ca.crt", "flax_ca.key", "dst_root_ca.pem"], "mozilla-ca": ["cacert.pem"], }, long_description=open("README.md").read(), diff --git a/start-gui.sh b/start-gui.sh index 1ff9101ca..6bc4851b5 100755 --- a/start-gui.sh +++ b/start-gui.sh @@ -16,7 +16,7 @@ if [ -d "${SCRIPT_DIR}/.n" ]; then fi 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 @@ -37,7 +37,7 @@ else fi echo "### Checking GUI build" -GUI_BUILD_PATH="${SCRIPT_DIR}/chia-blockchain-gui/packages/gui/build/electron/main.js" +GUI_BUILD_PATH="${SCRIPT_DIR}/flax-blockchain-gui/packages/gui/build/electron/main.js" if [ ! -e "$GUI_BUILD_PATH" ]; then echo "Error: GUI build was not found" echo "It is expected at $GUI_BUILD_PATH" @@ -49,6 +49,6 @@ else fi echo "### Starting GUI" -cd "${SCRIPT_DIR}/chia-blockchain-gui/" +cd "${SCRIPT_DIR}/flax-blockchain-gui/" echo "npm run electron" npm run electron 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/block_tools.py b/tests/block_tools.py index b347024b4..5032be436 100644 --- a/tests/block_tools.py +++ b/tests/block_tools.py @@ -17,78 +17,78 @@ from blspy import AugSchemeMPL, G1Element, G2Element, PrivateKey from chiabip158 import PyBIP158 -from chia.cmds.init_funcs import create_all_ssl, create_default_chia_config -from chia.daemon.keychain_proxy import connect_to_keychain_and_validate, wrap_local_keychain -from chia.full_node.bundle_tools import ( +from flax.cmds.init_funcs import create_all_ssl, create_default_flax_config +from flax.daemon.keychain_proxy import connect_to_keychain_and_validate, wrap_local_keychain +from flax.full_node.bundle_tools import ( best_solution_generator_from_template, detect_potential_template_generator, simple_solution_generator, ) -from chia.util.errors import Err -from chia.full_node.generator import setup_generator_args -from chia.full_node.mempool_check_conditions import GENERATOR_MOD -from chia.plotting.create_plots import create_plots, PlotKeys -from chia.plotting.util import add_plot_directory -from chia.consensus.block_creation import unfinished_block_to_full_block -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_puzzlehash_for_pk, create_farmer_coin, create_pool_coin -from chia.consensus.condition_costs import ConditionCost -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.util.errors import Err +from flax.full_node.generator import setup_generator_args +from flax.full_node.mempool_check_conditions import GENERATOR_MOD +from flax.plotting.create_plots import create_plots, PlotKeys +from flax.plotting.util import add_plot_directory +from flax.consensus.block_creation import unfinished_block_to_full_block +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_puzzlehash_for_pk, create_farmer_coin, create_pool_coin +from flax.consensus.condition_costs import ConditionCost +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.util import PlotsRefreshParameter, PlotRefreshResult, PlotRefreshEvents, parse_plot_info -from chia.plotting.manager import PlotManager -from chia.server.server import ssl_context_for_client -from chia.types.blockchain_format.classgroup import ClassgroupElement -from chia.types.blockchain_format.coin import Coin, hash_coin_ids -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.program import INFINITE_COST -from chia.types.blockchain_format.proof_of_space import ProofOfSpace -from chia.types.blockchain_format.reward_chain_block import RewardChainBlockUnfinished -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.util import PlotsRefreshParameter, PlotRefreshResult, PlotRefreshEvents, parse_plot_info +from flax.plotting.manager import PlotManager +from flax.server.server import ssl_context_for_client +from flax.types.blockchain_format.classgroup import ClassgroupElement +from flax.types.blockchain_format.coin import Coin, hash_coin_ids +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.program import INFINITE_COST +from flax.types.blockchain_format.proof_of_space import ProofOfSpace +from flax.types.blockchain_format.reward_chain_block import RewardChainBlockUnfinished +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.condition_opcodes import ConditionOpcode -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, lock_config, save_config, override_config -from chia.util.default_root import DEFAULT_ROOT_PATH -from chia.util.hash import std_hash -from chia.util.ints import uint8, uint16, uint32, uint64, uint128 -from chia.util.keychain import Keychain, bytes_to_mnemonic -from chia.util.prev_transaction_block import get_prev_transaction_block -from chia.util.path import mkdir -from chia.util.vdf_prover import get_vdf_info_and_proof +from flax.types.blockchain_format.sub_epoch_summary import SubEpochSummary +from flax.types.blockchain_format.vdf import VDFInfo, VDFProof +from flax.types.condition_opcodes import ConditionOpcode +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, lock_config, save_config, override_config +from flax.util.default_root import DEFAULT_ROOT_PATH +from flax.util.hash import std_hash +from flax.util.ints import uint8, uint16, uint32, uint64, uint128 +from flax.util.keychain import Keychain, bytes_to_mnemonic +from flax.util.prev_transaction_block import get_prev_transaction_block +from flax.util.path import mkdir +from flax.util.vdf_prover import get_vdf_info_and_proof from tests.time_out_assert import time_out_assert_custom_interval from tests.wallet_tools import WalletTool from tests.util.socket import find_available_listen_port from tests.util.ssl_certs import get_next_nodes_certs_and_keys, get_next_private_ca_cert_and_key -from chia.wallet.derive_keys import ( +from flax.wallet.derive_keys import ( master_sk_to_farmer_sk, master_sk_to_local_sk, master_sk_to_pool_sk, @@ -156,7 +156,7 @@ def __init__( self.local_keychain = keychain self._block_time_residual = 0.0 - create_default_chia_config(root_path) + create_default_flax_config(root_path) create_all_ssl( root_path, private_ca_crt_and_key=get_next_private_ca_cert_and_key(), @@ -219,7 +219,7 @@ async def setup_keys(self): self.keychain_proxy = wrap_local_keychain(self.local_keychain, log=log) else: self.keychain_proxy = await connect_to_keychain_and_validate( - self.root_path, log, user="testing-1.8.0", service="chia-testing-1.8.0" + self.root_path, log, user="testing-1.8.0", service="flax-testing-1.8.0" ) await self.keychain_proxy.delete_all_keys() @@ -244,7 +244,7 @@ async def setup_keys(self): self.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(self.farmer_pubkeys) == 0: - raise RuntimeError("Keys not generated. Run `chia generate keys`") + raise RuntimeError("Keys not generated. Run `flax generate keys`") self.plot_manager.set_public_keys(self.farmer_pubkeys, self.pool_pubkeys) @@ -316,7 +316,7 @@ async def new_plot( if pool_contract_puzzle_hash is None: pool_pk = self.pool_pk else: - pool_address = encode_puzzle_hash(pool_contract_puzzle_hash, "xch") + pool_address = encode_puzzle_hash(pool_contract_puzzle_hash, "xfx") plot_keys = PlotKeys(self.farmer_pk, pool_pk, pool_address) # No datetime in the filename, to get deterministic filenames and not re-plot diff --git a/tests/blockchain/blockchain_test_utils.py b/tests/blockchain/blockchain_test_utils.py index 4547c9bbd..1e6ca5a6b 100644 --- a/tests/blockchain/blockchain_test_utils.py +++ b/tests/blockchain/blockchain_test_utils.py @@ -1,10 +1,10 @@ from typing import Optional, List -from chia.consensus.blockchain import Blockchain, ReceiveBlockResult -from chia.consensus.multiprocess_validation import PreValidationResult -from chia.types.full_block import FullBlock -from chia.util.errors import Err -from chia.util.ints import uint64, uint32 +from flax.consensus.blockchain import Blockchain, ReceiveBlockResult +from flax.consensus.multiprocess_validation import PreValidationResult +from flax.types.full_block import FullBlock +from flax.util.errors import Err +from flax.util.ints import uint64, uint32 async def check_block_store_invariant(bc: Blockchain): diff --git a/tests/blockchain/test_blockchain.py b/tests/blockchain/test_blockchain.py index a8d665182..9d59aeebc 100644 --- a/tests/blockchain/test_blockchain.py +++ b/tests/blockchain/test_blockchain.py @@ -9,35 +9,35 @@ from blspy import AugSchemeMPL, G2Element from clvm.casts import int_to_bytes -from chia.consensus.block_header_validation import validate_finished_header_block -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.multiprocess_validation import PreValidationResult -from chia.consensus.pot_iterations import is_overflow_block -from chia.full_node.bundle_tools import detect_potential_template_generator -from chia.full_node.mempool_check_conditions import get_name_puzzle_conditions -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.generator_types import BlockGenerator -from chia.types.spend_bundle import SpendBundle -from chia.types.unfinished_block import UnfinishedBlock -from chia.util.generator_tools import get_block_header +from flax.consensus.block_header_validation import validate_finished_header_block +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.multiprocess_validation import PreValidationResult +from flax.consensus.pot_iterations import is_overflow_block +from flax.full_node.bundle_tools import detect_potential_template_generator +from flax.full_node.mempool_check_conditions import get_name_puzzle_conditions +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.generator_types import BlockGenerator +from flax.types.spend_bundle import SpendBundle +from flax.types.unfinished_block import UnfinishedBlock +from flax.util.generator_tools import get_block_header from tests.block_tools import create_block_tools_async, 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 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 tests.blockchain.blockchain_test_utils import ( _validate_and_add_block, _validate_and_add_block_multi_error, @@ -48,7 +48,7 @@ from tests.setup_nodes import test_constants from tests.util.blockchain import create_blockchain from tests.util.keyring import TempKeyring -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, ) diff --git a/tests/blockchain/test_blockchain_transactions.py b/tests/blockchain/test_blockchain_transactions.py index 4f39638ce..829a6c0d1 100644 --- a/tests/blockchain/test_blockchain_transactions.py +++ b/tests/blockchain/test_blockchain_transactions.py @@ -3,13 +3,13 @@ import pytest from clvm.casts import int_to_bytes -from chia.protocols import full_node_protocol, wallet_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 flax.protocols import full_node_protocol, wallet_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 tests.blockchain.blockchain_test_utils import _validate_and_add_block from tests.setup_nodes import test_constants from tests.util.generator_tools_testing import run_and_get_removals_and_additions diff --git a/tests/build-init-files.py b/tests/build-init-files.py old mode 100755 new mode 100644 index 61eacf8a9..45b60df4e --- a/tests/build-init-files.py +++ b/tests/build-init-files.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -# Create missing `__init__.py` files in the source code folders (in "chia/" and "tests/"). +# Create missing `__init__.py` files in the source code folders (in "flax/" and "tests/"). # # They are required by the python interpreter to properly identify modules/packages so that tools like `mypy` or an IDE # can work with their full capabilities. @@ -38,7 +38,7 @@ def command(verbose, root_str): stream_handler = logging.StreamHandler() logger.addHandler(stream_handler) - tree_roots = ["benchmarks", "build_scripts", "chia", "tests", "tools"] + tree_roots = ["benchmarks", "build_scripts", "flax", "tests", "tools"] failed = False root = pathlib.Path(root_str).resolve() directories = sorted( diff --git a/tests/build-workflows.py b/tests/build-workflows.py old mode 100755 new mode 100644 index 2781c05e7..fb231c72c --- a/tests/build-workflows.py +++ b/tests/build-workflows.py @@ -83,7 +83,7 @@ def generate_replacements(conf, dir): 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["job_timeout"]: diff --git a/tests/check_pytest_monitor_output.py b/tests/check_pytest_monitor_output.py old mode 100755 new mode 100644 diff --git a/tests/check_sql_statements.py b/tests/check_sql_statements.py old mode 100755 new mode 100644 index f84829200..1bdabbc21 --- a/tests/check_sql_statements.py +++ b/tests/check_sql_statements.py @@ -41,10 +41,10 @@ def check_create(sql_type: str, cwd: str, exemptions: Set[Tuple[str, str]] = set ret = 0 -ret += check_create("INDEX", "chia/wallet") +ret += check_create("INDEX", "flax/wallet") ret += check_create( "INDEX", - "chia/full_node", + "flax/full_node", set( [ ("block_store.py", "is_fully_compactified"), @@ -52,10 +52,10 @@ def check_create(sql_type: str, cwd: str, exemptions: Set[Tuple[str, str]] = set ] ), ) -ret += check_create("TABLE", "chia/wallet") +ret += check_create("TABLE", "flax/wallet") ret += check_create( "TABLE", - "chia/full_node", + "flax/full_node", set( [ ("block_store.py", "sub_epoch_segments_v3"), diff --git a/tests/clvm/benchmark_costs.py b/tests/clvm/benchmark_costs.py index ccf1e44ad..b29b972c4 100644 --- a/tests/clvm/benchmark_costs.py +++ b/tests/clvm/benchmark_costs.py @@ -1,10 +1,10 @@ -from chia.types.blockchain_format.program import INFINITE_COST -from chia.types.spend_bundle import SpendBundle -from chia.types.generator_types import BlockGenerator -from chia.consensus.cost_calculator import NPCResult -from chia.consensus.default_constants import DEFAULT_CONSTANTS -from chia.full_node.bundle_tools import simple_solution_generator -from chia.full_node.mempool_check_conditions import get_name_puzzle_conditions +from flax.types.blockchain_format.program import INFINITE_COST +from flax.types.spend_bundle import SpendBundle +from flax.types.generator_types import BlockGenerator +from flax.consensus.cost_calculator import NPCResult +from flax.consensus.default_constants import DEFAULT_CONSTANTS +from flax.full_node.bundle_tools import simple_solution_generator +from flax.full_node.mempool_check_conditions import get_name_puzzle_conditions def cost_of_spend_bundle(spend_bundle: SpendBundle) -> int: diff --git a/tests/clvm/coin_store.py b/tests/clvm/coin_store.py index 7e6098122..98bfe3e1b 100644 --- a/tests/clvm/coin_store.py +++ b/tests/clvm/coin_store.py @@ -2,15 +2,15 @@ from dataclasses import dataclass, replace from typing import Dict, Iterator, Optional -from chia.full_node.mempool_check_conditions import mempool_check_time_locks, 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.spend_bundle import SpendBundle -from chia.util.ints import uint32, uint64 -from chia.full_node.bundle_tools import simple_solution_generator -from chia.util.errors import Err -from chia.consensus.cost_calculator import NPCResult +from flax.full_node.mempool_check_conditions import mempool_check_time_locks, 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.spend_bundle import SpendBundle +from flax.util.ints import uint32, uint64 +from flax.full_node.bundle_tools import simple_solution_generator +from flax.util.errors import Err +from flax.consensus.cost_calculator import NPCResult MAX_COST = 11000000000 diff --git a/tests/clvm/test_clvm_compilation.py b/tests/clvm/test_clvm_compilation.py index 98f89fcf0..63a777148 100644 --- a/tests/clvm/test_clvm_compilation.py +++ b/tests/clvm/test_clvm_compilation.py @@ -3,57 +3,57 @@ 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/cat.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/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_spend_entry_with_prefix.clvm", - "chia/wallet/puzzles/decompress_coin_spend_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", - "chia/wallet/puzzles/p2_singleton.clvm", - "chia/wallet/puzzles/pool_waitingroom_innerpuz.clvm", - "chia/wallet/puzzles/pool_member_innerpuz.clvm", - "chia/wallet/puzzles/singleton_launcher.clvm", - "chia/wallet/puzzles/p2_singleton_or_delayed_puzhash.clvm", - "chia/wallet/puzzles/genesis_by_puzzle_hash.clvm", - "chia/wallet/puzzles/everything_with_signature.clvm", - "chia/wallet/puzzles/delegated_tail.clvm", - "chia/wallet/puzzles/settlement_payments.clvm", - "chia/wallet/puzzles/genesis_by_coin_id.clvm", - "chia/wallet/puzzles/singleton_top_layer_v1_1.clvm", - "chia/wallet/puzzles/nft_metadata_updater_default.clvm", - "chia/wallet/puzzles/nft_metadata_updater_updateable.clvm", - "chia/wallet/puzzles/nft_state_layer.clvm", - "chia/wallet/puzzles/nft_ownership_layer.clvm", - "chia/wallet/puzzles/nft_ownership_transfer_program_one_way_claim_with_royalties.clvm", + "flax/wallet/puzzles/calculate_synthetic_public_key.clvm", + "flax/wallet/puzzles/cat.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/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_spend_entry_with_prefix.clvm", + "flax/wallet/puzzles/decompress_coin_spend_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", + "flax/wallet/puzzles/p2_singleton.clvm", + "flax/wallet/puzzles/pool_waitingroom_innerpuz.clvm", + "flax/wallet/puzzles/pool_member_innerpuz.clvm", + "flax/wallet/puzzles/singleton_launcher.clvm", + "flax/wallet/puzzles/p2_singleton_or_delayed_puzhash.clvm", + "flax/wallet/puzzles/genesis_by_puzzle_hash.clvm", + "flax/wallet/puzzles/everything_with_signature.clvm", + "flax/wallet/puzzles/delegated_tail.clvm", + "flax/wallet/puzzles/settlement_payments.clvm", + "flax/wallet/puzzles/genesis_by_coin_id.clvm", + "flax/wallet/puzzles/singleton_top_layer_v1_1.clvm", + "flax/wallet/puzzles/nft_metadata_updater_default.clvm", + "flax/wallet/puzzles/nft_metadata_updater_updateable.clvm", + "flax/wallet/puzzles/nft_state_layer.clvm", + "flax/wallet/puzzles/nft_ownership_layer.clvm", + "flax/wallet/puzzles/nft_ownership_transfer_program_one_way_claim_with_royalties.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): @@ -80,7 +80,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_program.py b/tests/clvm/test_program.py index 76aa5f639..49e4274ad 100644 --- a/tests/clvm/test_program.py +++ b/tests/clvm/test_program.py @@ -1,6 +1,6 @@ from unittest import TestCase -from chia.types.blockchain_format.program import Program +from flax.types.blockchain_format.program import Program from clvm.EvalError import EvalError from clvm_tools.curry import uncurry from clvm.operators import KEYWORD_TO_ATOM diff --git a/tests/clvm/test_puzzle_compression.py b/tests/clvm/test_puzzle_compression.py index 03b91e615..ef3c01603 100644 --- a/tests/clvm/test_puzzle_compression.py +++ b/tests/clvm/test_puzzle_compression.py @@ -1,21 +1,21 @@ from blspy import G1Element, G2Element from typing import Dict -from chia.types.blockchain_format.program import Program -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.blockchain_format.coin import Coin -from chia.types.spend_bundle import SpendBundle -from chia.types.coin_spend import CoinSpend -from chia.util.ints import uint64 -from chia.wallet.trading.offer import OFFER_MOD -from chia.wallet.util.puzzle_compression import ( +from flax.types.blockchain_format.program import Program +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.blockchain_format.coin import Coin +from flax.types.spend_bundle import SpendBundle +from flax.types.coin_spend import CoinSpend +from flax.util.ints import uint64 +from flax.wallet.trading.offer import OFFER_MOD +from flax.wallet.util.puzzle_compression import ( LATEST_VERSION, lowest_best_version, compress_object_with_puzzles, decompress_object_with_puzzles, ) -from chia.wallet.cat_wallet.cat_utils import CAT_MOD, construct_cat_puzzle -from chia.wallet.puzzles.p2_delegated_puzzle_or_hidden_puzzle import puzzle_for_pk +from flax.wallet.cat_wallet.cat_utils import CAT_MOD, construct_cat_puzzle +from flax.wallet.puzzles.p2_delegated_puzzle_or_hidden_puzzle import puzzle_for_pk ZERO_32 = bytes32([0] * 32) ONE_32 = bytes32([17] * 32) diff --git a/tests/clvm/test_puzzle_drivers.py b/tests/clvm/test_puzzle_drivers.py index 4c62975ba..8a81bcdf6 100644 --- a/tests/clvm/test_puzzle_drivers.py +++ b/tests/clvm/test_puzzle_drivers.py @@ -2,8 +2,8 @@ import pytest -from chia.types.blockchain_format.program import Program -from chia.wallet.puzzle_drivers import PuzzleInfo, Solver +from flax.types.blockchain_format.program import Program +from flax.wallet.puzzle_drivers import PuzzleInfo, Solver def test_puzzle_info() -> None: diff --git a/tests/clvm/test_puzzles.py b/tests/clvm/test_puzzles.py index bd1fc237e..4e551c277 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_spend import CoinSpend -from chia.types.condition_opcodes import ConditionOpcode -from chia.types.spend_bundle import SpendBundle -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_spend import CoinSpend +from flax.types.condition_opcodes import ConditionOpcode +from flax.types.spend_bundle import SpendBundle +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/clvm/test_singletons.py b/tests/clvm/test_singletons.py index 7877df462..e2a56a51e 100644 --- a/tests/clvm/test_singletons.py +++ b/tests/clvm/test_singletons.py @@ -4,33 +4,33 @@ from blspy import AugSchemeMPL, G1Element, G2Element, PrivateKey -from chia.types.blockchain_format.program import Program -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.blockchain_format.coin import Coin -from chia.types.coin_spend import CoinSpend -from chia.types.condition_opcodes import ConditionOpcode -from chia.types.spend_bundle import SpendBundle -from chia.util.errors import Err -from chia.util.ints import uint64 -from chia.consensus.default_constants import DEFAULT_CONSTANTS -from chia.wallet.lineage_proof import LineageProof -from chia.wallet.puzzles import p2_conditions, p2_delegated_puzzle_or_hidden_puzzle +from flax.types.blockchain_format.program import Program +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.blockchain_format.coin import Coin +from flax.types.coin_spend import CoinSpend +from flax.types.condition_opcodes import ConditionOpcode +from flax.types.spend_bundle import SpendBundle +from flax.util.errors import Err +from flax.util.ints import uint64 +from flax.consensus.default_constants import DEFAULT_CONSTANTS +from flax.wallet.lineage_proof import LineageProof +from flax.wallet.puzzles import p2_conditions, p2_delegated_puzzle_or_hidden_puzzle from tests.util.key_tool import KeyTool from tests.clvm.test_puzzles import ( public_key_for_index, secret_exponent_for_index, ) -from chia.clvm.spend_sim import SpendSim, SimClient +from flax.clvm.spend_sim import SpendSim, SimClient """ This test suite aims to test: - - chia.wallet.puzzles.singleton_top_layer.py - - chia.wallet.puzzles.singleton_top_layer.clvm - - chia.wallet.puzzles.singleton_top_layer_v1_1.py - - chia.wallet.puzzles.singleton_top_layer_v1_1.clvm - - chia.wallet.puzzles.p2_singleton.clvm - - chia.wallet.puzzles.p2_singleton_or_delayed_puzhash.clvm + - flax.wallet.puzzles.singleton_top_layer.py + - flax.wallet.puzzles.singleton_top_layer.clvm + - flax.wallet.puzzles.singleton_top_layer_v1_1.py + - flax.wallet.puzzles.singleton_top_layer_v1_1.clvm + - flax.wallet.puzzles.p2_singleton.clvm + - flax.wallet.puzzles.p2_singleton_or_delayed_puzhash.clvm """ @@ -91,11 +91,11 @@ async def test_singleton_top_layer(self, version): starting_puzzle: Program = p2_delegated_puzzle_or_hidden_puzzle.puzzle_for_pk(pk) # noqa if version == 0: - from chia.wallet.puzzles import singleton_top_layer + from flax.wallet.puzzles import singleton_top_layer adapted_puzzle: Program = singleton_top_layer.adapt_inner_to_singleton(starting_puzzle) # noqa else: - from chia.wallet.puzzles import singleton_top_layer_v1_1 as singleton_top_layer + from flax.wallet.puzzles import singleton_top_layer_v1_1 as singleton_top_layer adapted_puzzle = starting_puzzle adapted_puzzle_hash: bytes32 = adapted_puzzle.get_tree_hash() diff --git a/tests/clvm/test_spend_sim.py b/tests/clvm/test_spend_sim.py index 99fa83d08..ca6664375 100644 --- a/tests/clvm/test_spend_sim.py +++ b/tests/clvm/test_spend_sim.py @@ -2,11 +2,11 @@ from blspy import G2Element -from chia.clvm.spend_sim import SpendSim, SimClient -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.blockchain_format.program import Program -from chia.types.spend_bundle import SpendBundle -from chia.types.coin_spend import CoinSpend +from flax.clvm.spend_sim import SpendSim, SimClient +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.blockchain_format.program import Program +from flax.types.spend_bundle import SpendBundle +from flax.types.coin_spend import CoinSpend class TestSpendSim: diff --git a/tests/conftest.py b/tests/conftest.py index 1a695ba83..61ea17490 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -10,15 +10,15 @@ from tests.setup_nodes import setup_node_and_wallet, setup_n_nodes, setup_two_nodes from pathlib import Path from typing import AsyncIterator, List, Tuple -from chia.server.start_service import Service +from flax.server.start_service import Service # Set spawn after stdlib imports, but before other imports -from chia.clvm.spend_sim import SimClient, SpendSim -from chia.protocols import full_node_protocol -from chia.simulator.simulator_protocol import FarmNewBlockProtocol -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.peer_info import PeerInfo -from chia.util.ints import uint16 +from flax.clvm.spend_sim import SimClient, SpendSim +from flax.protocols import full_node_protocol +from flax.simulator.simulator_protocol import FarmNewBlockProtocol +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.peer_info import PeerInfo +from flax.util.ints import uint16 from tests.core.node_height import node_height_at_least from tests.pools.test_pool_rpc import wallet_is_synced from tests.setup_nodes import ( @@ -38,7 +38,7 @@ multiprocessing.set_start_method("spawn") from pathlib import Path -from chia.util.keyring_wrapper import KeyringWrapper +from flax.util.keyring_wrapper import KeyringWrapper from tests.block_tools import BlockTools, test_constants, create_block_tools, create_block_tools_async from tests.util.keyring import TempKeyring from tests.setup_nodes import setup_farmer_multi_harvester @@ -66,7 +66,7 @@ def self_hostname(): # NOTE: -# Instantiating the bt fixture results in an attempt to create the chia root directory +# Instantiating the bt fixture results in an attempt to create the flax root directory # which the build scripts symlink to a sometimes-not-there directory. # When not there, Python complains since, well, the symlink is not a directory nor points to a directory. # diff --git a/tests/connection_utils.py b/tests/connection_utils.py index 44722be02..47f883318 100644 --- a/tests/connection_utils.py +++ b/tests/connection_utils.py @@ -7,32 +7,32 @@ 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.time_out_assert import time_out_assert log = logging.getLogger(__name__) -async def disconnect_all(server: ChiaServer) -> None: +async def disconnect_all(server: FlaxServer) -> None: cons = list(server.all_connections.values())[:] for con in cons: await con.close() -async def disconnect_all_and_reconnect(server: ChiaServer, reconnect_to: ChiaServer, self_hostname: str) -> bool: +async def disconnect_all_and_reconnect(server: FlaxServer, reconnect_to: FlaxServer, self_hostname: str) -> bool: await disconnect_all(server) return await server.start_client(PeerInfo(self_hostname, uint16(reconnect_to._port)), None) async def add_dummy_connection( - server: ChiaServer, self_hostname: str, dummy_port: int, type: NodeType = NodeType.FULL_NODE + server: FlaxServer, self_hostname: str, dummy_port: int, type: NodeType = NodeType.FULL_NODE ) -> Tuple[asyncio.Queue, bytes32]: timeout = aiohttp.ClientTimeout(total=10) session = aiohttp.ClientSession(timeout=timeout) @@ -40,17 +40,17 @@ async def add_dummy_connection( 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( type, ws, server._port, @@ -68,7 +68,7 @@ async def add_dummy_connection( return incoming_queue, peer_id -async def connect_and_get_peer(server_1: ChiaServer, server_2: ChiaServer, self_hostname: str) -> WSChiaConnection: +async def connect_and_get_peer(server_1: FlaxServer, server_2: FlaxServer, self_hostname: str) -> WSFlaxConnection: """ Connect server_2 to server_1, and get return the connection in server_1. """ diff --git a/tests/core/cmds/test_keys.py b/tests/core/cmds/test_keys.py index 573a46b99..f96040c04 100644 --- a/tests/core/cmds/test_keys.py +++ b/tests/core/cmds/test_keys.py @@ -4,12 +4,12 @@ import re from blspy import PrivateKey -from chia.cmds.chia import cli -from chia.cmds.keys import delete_all_cmd, generate_and_print_cmd, show_cmd, sign_cmd, verify_cmd -from chia.util.config import load_config -from chia.util.file_keyring import FileKeyring -from chia.util.keychain import DEFAULT_USER, DEFAULT_SERVICE, Keychain, generate_mnemonic -from chia.util.keyring_wrapper import DEFAULT_KEYS_ROOT_PATH, KeyringWrapper, LegacyKeyring +from flax.cmds.flax import cli +from flax.cmds.keys import delete_all_cmd, generate_and_print_cmd, show_cmd, sign_cmd, verify_cmd +from flax.util.config import load_config +from flax.util.file_keyring import FileKeyring +from flax.util.keychain import DEFAULT_USER, DEFAULT_SERVICE, Keychain, generate_mnemonic +from flax.util.keyring_wrapper import DEFAULT_KEYS_ROOT_PATH, KeyringWrapper, LegacyKeyring from click.testing import CliRunner, Result from keyring.backend import KeyringBackend from pathlib import Path @@ -67,7 +67,7 @@ def delete_password(self, service, username): @pytest.fixture(scope="function") def empty_keyring(): - with TempKeyring(user="user-chia-1.8", service="chia-user-chia-1.8") as keychain: + with TempKeyring(user="user-flax-1.8", service="flax-user-flax-1.8") as keychain: yield keychain KeyringWrapper.cleanup_shared_instance() @@ -117,7 +117,7 @@ class TestKeysCommands: def test_generate_with_new_config(self, tmp_path, empty_keyring): """ Generate a new config and a new key. Verify that the config has - the correct xch_target_address entries. + the correct xfx_target_address entries. """ keychain = empty_keyring @@ -141,19 +141,19 @@ def test_generate_with_new_config(self, tmp_path, empty_keyring): assert result.exit_code == 0 assert len(keychain.get_all_private_keys()) == 1 - # Verify that the config has the correct xch_target_address entries - address_matches = re.findall(r"xch1[^\n]+", result.output) + # Verify that the config has the correct xfx_target_address entries + address_matches = re.findall(r"xfx1[^\n]+", result.output) assert len(address_matches) > 1 address = address_matches[0] config: Dict = load_config(tmp_path, "config.yaml") - assert config["farmer"]["xch_target_address"] == address - assert config["pool"]["xch_target_address"] == address + assert config["farmer"]["xfx_target_address"] == address + assert config["pool"]["xfx_target_address"] == address def test_generate_with_existing_config(self, tmp_path, empty_keyring): """ Generate a new key using an existing config. Verify that the config has - the original xch_target_address entries. + the original xfx_target_address entries. """ keychain = empty_keyring @@ -177,14 +177,14 @@ def test_generate_with_existing_config(self, tmp_path, empty_keyring): assert generate_result.exit_code == 0 assert len(keychain.get_all_private_keys()) == 1 - # Verify that the config has the correct xch_target_address entries - address_matches = re.findall(r"xch1[^\n]+", generate_result.output) + # Verify that the config has the correct xfx_target_address entries + address_matches = re.findall(r"xfx1[^\n]+", generate_result.output) assert len(address_matches) > 1 address = address_matches[0] existing_config: Dict = load_config(tmp_path, "config.yaml") - assert existing_config["farmer"]["xch_target_address"] == address - assert existing_config["pool"]["xch_target_address"] == address + assert existing_config["farmer"]["xfx_target_address"] == address + assert existing_config["pool"]["xfx_target_address"] == address # Generate the second key runner = CliRunner() @@ -195,14 +195,14 @@ def test_generate_with_existing_config(self, tmp_path, empty_keyring): assert result.exit_code == 0 assert len(keychain.get_all_private_keys()) == 2 - # Verify that the config's xch_target_address entries have not changed + # Verify that the config's xfx_target_address entries have not changed config: Dict = load_config(tmp_path, "config.yaml") - assert config["farmer"]["xch_target_address"] == existing_config["farmer"]["xch_target_address"] - assert config["pool"]["xch_target_address"] == existing_config["pool"]["xch_target_address"] + assert config["farmer"]["xfx_target_address"] == existing_config["farmer"]["xfx_target_address"] + assert config["pool"]["xfx_target_address"] == existing_config["pool"]["xfx_target_address"] def test_show(self, keyring_with_one_key): """ - Test that the `chia keys show` command shows the correct key. + Test that the `flax keys show` command shows the correct key. """ keychain = keyring_with_one_key @@ -217,7 +217,7 @@ def test_show(self, keyring_with_one_key): def test_show_mnemonic(self, keyring_with_one_key): """ - Test that the `chia keys show --show-mnemonic-seed` command shows the key's mnemonic seed. + Test that the `flax keys show --show-mnemonic-seed` command shows the key's mnemonic seed. """ keychain = keyring_with_one_key @@ -367,7 +367,7 @@ def test_delete_all(self, empty_keyring): def test_generate_and_print(self): """ - Test the `chia keys generate_and_print` command. + Test the `flax keys generate_and_print` command. """ runner = CliRunner() @@ -378,7 +378,7 @@ def test_generate_and_print(self): def test_sign(self, keyring_with_one_key): """ - Test the `chia keys sign` command. + Test the `flax keys sign` command. """ message: str = "hello world" @@ -411,7 +411,7 @@ def test_sign(self, keyring_with_one_key): def test_sign_non_observer(self, keyring_with_one_key): """ - Test the `chia keys sign` command with a non-observer key. + Test the `flax keys sign` command with a non-observer key. """ message: str = "hello world" @@ -483,7 +483,7 @@ def test_sign_mnemonic_seed_file(self, empty_keyring, mnemonic_seed_file): def test_verify(self): """ - Test the `chia keys verify` command. + Test the `flax keys verify` command. """ message: str = "hello world" @@ -504,7 +504,7 @@ def test_verify(self): def test_derive_search(self, tmp_path, keyring_with_one_key): """ - Test the `chia keys derive search` command, searching a public and private key + Test the `flax keys derive search` command, searching a public and private key """ keychain = keyring_with_one_key @@ -562,7 +562,7 @@ def test_derive_search(self, tmp_path, keyring_with_one_key): def test_derive_search_wallet_address(self, tmp_path, keyring_with_one_key): """ - Test the `chia keys derive search` command, searching for a wallet address + Test the `flax keys derive search` command, searching for a wallet address """ keychain = keyring_with_one_key @@ -593,7 +593,7 @@ def test_derive_search_wallet_address(self, tmp_path, keyring_with_one_key): "40", "--search-type", "address", - "xch1mnr0ygu7lvmk3nfgzmncfk39fwu0dv933yrcv97nd6pmrt7fzmhs8taffd", + "xfx1mnr0ygu7lvmk3nfgzmncfk39fwu0dv933yrcv97nd6pmrt7fzmhs8taffd", ], ) @@ -602,7 +602,7 @@ def test_derive_search_wallet_address(self, tmp_path, keyring_with_one_key): result.output.find( ( "Found wallet address: " - "xch1mnr0ygu7lvmk3nfgzmncfk39fwu0dv933yrcv97nd6pmrt7fzmhs8taffd (HD path: m/12381/8444/2/30)" + "xfx1mnr0ygu7lvmk3nfgzmncfk39fwu0dv933yrcv97nd6pmrt7fzmhs8taffd (HD path: m/12381/8444/2/30)" ) ) != -1 @@ -610,7 +610,7 @@ def test_derive_search_wallet_address(self, tmp_path, keyring_with_one_key): def test_derive_search_wallet_testnet_address(self, tmp_path, keyring_with_one_key): """ - Test the `chia keys derive search` command, searching for a testnet wallet address + Test the `flax keys derive search` command, searching for a testnet wallet address """ keychain = keyring_with_one_key @@ -641,9 +641,9 @@ def test_derive_search_wallet_testnet_address(self, tmp_path, keyring_with_one_k "40", "--search-type", "address", - "txch1mnr0ygu7lvmk3nfgzmncfk39fwu0dv933yrcv97nd6pmrt7fzmhs2v6lg7", + "txfx1mnr0ygu7lvmk3nfgzmncfk39fwu0dv933yrcv97nd6pmrt7fzmhs2v6lg7", "--prefix", - "txch", + "txfx", ], ) @@ -652,7 +652,7 @@ def test_derive_search_wallet_testnet_address(self, tmp_path, keyring_with_one_k result.output.find( ( "Found wallet address: " - "txch1mnr0ygu7lvmk3nfgzmncfk39fwu0dv933yrcv97nd6pmrt7fzmhs2v6lg7 (HD path: m/12381/8444/2/30)" + "txfx1mnr0ygu7lvmk3nfgzmncfk39fwu0dv933yrcv97nd6pmrt7fzmhs2v6lg7 (HD path: m/12381/8444/2/30)" ) ) != -1 @@ -660,7 +660,7 @@ def test_derive_search_wallet_testnet_address(self, tmp_path, keyring_with_one_k def test_derive_search_failure(self, tmp_path, keyring_with_one_key): """ - Test the `chia keys derive search` command with a failing search. + Test the `flax keys derive search` command with a failing search. """ keychain = keyring_with_one_key @@ -699,7 +699,7 @@ def test_derive_search_failure(self, tmp_path, keyring_with_one_key): def test_derive_search_hd_path(self, tmp_path, empty_keyring, mnemonic_seed_file): """ - Test the `chia keys derive search` command, searching under a provided HD path. + Test the `flax keys derive search` command, searching under a provided HD path. """ keychain = empty_keyring @@ -749,7 +749,7 @@ def test_derive_search_hd_path(self, tmp_path, empty_keyring, mnemonic_seed_file def test_derive_wallet_address(self, tmp_path, keyring_with_one_key): """ - Test the `chia keys derive wallet-address` command, generating a couple of wallet addresses. + Test the `flax keys derive wallet-address` command, generating a couple of wallet addresses. """ keychain = keyring_with_one_key @@ -790,7 +790,7 @@ def test_derive_wallet_address(self, tmp_path, keyring_with_one_key): result.output.find( ( "Wallet address 50 (m/12381n/8444n/2n/50n): " - "xch1jp2u7an0mn9hdlw2x05nmje49gwgzmqyvh0qmh6008yksetuvkfs6wrfdq" + "xfx1jp2u7an0mn9hdlw2x05nmje49gwgzmqyvh0qmh6008yksetuvkfs6wrfdq" ) ) != -1 @@ -799,7 +799,7 @@ def test_derive_wallet_address(self, tmp_path, keyring_with_one_key): result.output.find( ( "Wallet address 51 (m/12381n/8444n/2n/51n): " - "xch1006n6l3x5e8exar8mlj004znjl5pq0tq73h76kz0yergswnjzn8sumvfmt" + "xfx1006n6l3x5e8exar8mlj004znjl5pq0tq73h76kz0yergswnjzn8sumvfmt" ) ) != -1 @@ -807,7 +807,7 @@ def test_derive_wallet_address(self, tmp_path, keyring_with_one_key): def test_derive_wallet_testnet_address(self, tmp_path, keyring_with_one_key): """ - Test the `chia keys derive wallet-address` command, generating a couple of testnet wallet addresses. + Test the `flax keys derive wallet-address` command, generating a couple of testnet wallet addresses. """ keychain = keyring_with_one_key @@ -841,7 +841,7 @@ def test_derive_wallet_testnet_address(self, tmp_path, keyring_with_one_key): "--non-observer-derivation", "--show-hd-path", "--prefix", - "txch", + "txfx", ], ) @@ -850,7 +850,7 @@ def test_derive_wallet_testnet_address(self, tmp_path, keyring_with_one_key): result.output.find( ( "Wallet address 50 (m/12381n/8444n/2n/50n): " - "txch1jp2u7an0mn9hdlw2x05nmje49gwgzmqyvh0qmh6008yksetuvkfshfylvn" + "txfx1jp2u7an0mn9hdlw2x05nmje49gwgzmqyvh0qmh6008yksetuvkfshfylvn" ) ) != -1 @@ -859,7 +859,7 @@ def test_derive_wallet_testnet_address(self, tmp_path, keyring_with_one_key): result.output.find( ( "Wallet address 51 (m/12381n/8444n/2n/51n): " - "txch1006n6l3x5e8exar8mlj004znjl5pq0tq73h76kz0yergswnjzn8s3utl6c" + "txfx1006n6l3x5e8exar8mlj004znjl5pq0tq73h76kz0yergswnjzn8s3utl6c" ) ) != -1 @@ -867,7 +867,7 @@ def test_derive_wallet_testnet_address(self, tmp_path, keyring_with_one_key): def test_derive_child_keys(self, tmp_path, keyring_with_one_key): """ - Test the `chia keys derive child-keys` command, generating a couple of derived keys. + Test the `flax keys derive child-keys` command, generating a couple of derived keys. """ keychain = keyring_with_one_key @@ -945,7 +945,7 @@ def test_derive_child_keys(self, tmp_path, keyring_with_one_key): def test_migration_not_needed(self, tmp_path, setup_keyringwrapper, monkeypatch): """ - Test the `chia keys migrate` command when no migration is necessary + Test the `flax keys migrate` command when no migration is necessary """ def mock_keychain_needs_migration() -> bool: @@ -974,7 +974,7 @@ def mock_keychain_get_keys_needing_migration() -> Tuple[List[Tuple[PrivateKey, b def test_migration_full(self, tmp_path, setup_legacy_keyringwrapper): """ - Test the `chia keys migrate` command when a full migration is needed + Test the `flax keys migrate` command when a full migration is needed """ legacy_keyring = KeyringWrapper.get_shared_instance().legacy_keyring @@ -1008,7 +1008,7 @@ def test_migration_full(self, tmp_path, setup_legacy_keyringwrapper): assert len(Keychain().get_all_public_keys()) == 3 # new keyring has 3 keys assert len(legacy_keyring.service_dict[DEFAULT_SERVICE]) == 0 # legacy keys removed - current_version_str = pkg_resources.get_distribution("chia-blockchain").version + current_version_str = pkg_resources.get_distribution("flax-blockchain").version last_migration_version_str = ( KeyringWrapper.get_shared_instance().keys_root_path / ".last_legacy_migration" ).read_text() @@ -1025,7 +1025,7 @@ def mock_get_legacy_keyring_instance() -> Optional[LegacyKeyring]: nonlocal legacy_keyring return legacy_keyring - from chia.util import keyring_wrapper + from flax.util import keyring_wrapper monkeypatch.setattr(keyring_wrapper, "get_legacy_keyring_instance", mock_get_legacy_keyring_instance) @@ -1060,7 +1060,7 @@ def mock_get_legacy_keyring_instance() -> Optional[LegacyKeyring]: assert len(Keychain().get_all_public_keys()) == 4 # new keyring has 4 keys assert len(legacy_keyring.service_dict[DEFAULT_SERVICE]) == 0 # legacy keys removed - current_version_str = pkg_resources.get_distribution("chia-blockchain").version + current_version_str = pkg_resources.get_distribution("flax-blockchain").version last_migration_version_str = ( KeyringWrapper.get_shared_instance().keys_root_path / ".last_legacy_migration" ).read_text() @@ -1077,7 +1077,7 @@ def mock_get_legacy_keyring_instance() -> Optional[LegacyKeyring]: nonlocal legacy_keyring return legacy_keyring - from chia.util import keyring_wrapper + from flax.util import keyring_wrapper monkeypatch.setattr(keyring_wrapper, "get_legacy_keyring_instance", mock_get_legacy_keyring_instance) @@ -1110,7 +1110,7 @@ def mock_get_legacy_keyring_instance() -> Optional[LegacyKeyring]: nonlocal legacy_keyring return legacy_keyring - from chia.util import keyring_wrapper + from flax.util import keyring_wrapper monkeypatch.setattr(keyring_wrapper, "get_legacy_keyring_instance", mock_get_legacy_keyring_instance) @@ -1146,7 +1146,7 @@ def mock_get_distribution_version(_) -> DummyDistribution: monkeypatch.setattr(pkg_resources, "get_distribution", mock_get_distribution_version) dist_version = "1.2.11.dev123" - assert pkg_resources.get_distribution("chia-blockchain").version == "1.2.11.dev123" + assert pkg_resources.get_distribution("flax-blockchain").version == "1.2.11.dev123" Keychain.mark_migration_checked_for_current_version() diff --git a/tests/core/cmds/test_wallet.py b/tests/core/cmds/test_wallet.py index f211c5b50..e411108d0 100644 --- a/tests/core/cmds/test_wallet.py +++ b/tests/core/cmds/test_wallet.py @@ -2,9 +2,9 @@ import pytest -from chia.cmds.wallet_funcs import print_offer_summary -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.ints import uint32 +from flax.cmds.wallet_funcs import print_offer_summary +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.ints import uint32 TEST_DUCKSAUCE_ASSET_ID = "1000000000000000000000000000000000000000000000000000000000000001" TEST_CRUNCHBERRIES_ASSET_ID = "1000000000000000000000000000000000000000000000000000000000000002" @@ -22,14 +22,14 @@ async def cat_name_resolver(asset_id: bytes32) -> Optional[Tuple[Optional[uint32 @pytest.mark.asyncio -async def test_print_offer_summary_xch(capsys: Any) -> None: - summary_dict = {"xch": 1_000_000_000_000} +async def test_print_offer_summary_xfx(capsys: Any) -> None: + summary_dict = {"xfx": 1_000_000_000_000} await print_offer_summary(cat_name_resolver, summary_dict) captured = capsys.readouterr() - assert "XCH (Wallet ID: 1): 1.0 (1000000000000 mojos)" in captured.out + assert "XFX (Wallet ID: 1): 1.0 (1000000000000 mojos)" in captured.out @pytest.mark.asyncio @@ -61,9 +61,9 @@ async def test_print_offer_summary_multiple_cats(capsys: Any) -> None: @pytest.mark.asyncio -async def test_print_offer_summary_xch_and_cats(capsys: Any) -> None: +async def test_print_offer_summary_xfx_and_cats(capsys: Any) -> None: summary_dict = { - "xch": 2_500_000_000_000, + "xfx": 2_500_000_000_000, TEST_DUCKSAUCE_ASSET_ID: 1_111, TEST_CRUNCHBERRIES_ASSET_ID: 2_222, TEST_UNICORNTEARS_ASSET_ID: 3_333, @@ -73,16 +73,16 @@ async def test_print_offer_summary_xch_and_cats(capsys: Any) -> None: captured = capsys.readouterr() - assert "XCH (Wallet ID: 1): 2.5 (2500000000000 mojos)" in captured.out + assert "XFX (Wallet ID: 1): 2.5 (2500000000000 mojos)" in captured.out assert "DuckSauce (Wallet ID: 2): 1.111 (1111 mojos)" in captured.out assert "CrunchBerries (Wallet ID: 3): 2.222 (2222 mojos)" in captured.out assert "UnicornTears (Wallet ID: 4): 3.333 (3333 mojos)" in captured.out @pytest.mark.asyncio -async def test_print_offer_summary_xch_and_cats_with_zero_values(capsys: Any) -> None: +async def test_print_offer_summary_xfx_and_cats_with_zero_values(capsys: Any) -> None: summary_dict = { - "xch": 0, + "xfx": 0, TEST_DUCKSAUCE_ASSET_ID: 0, TEST_CRUNCHBERRIES_ASSET_ID: 0, TEST_UNICORNTEARS_ASSET_ID: 0, @@ -92,7 +92,7 @@ async def test_print_offer_summary_xch_and_cats_with_zero_values(capsys: Any) -> captured = capsys.readouterr() - assert "XCH (Wallet ID: 1): 0.0 (0 mojos)" in captured.out + assert "XFX (Wallet ID: 1): 0.0 (0 mojos)" in captured.out assert "DuckSauce (Wallet ID: 2): 0.0 (0 mojos)" in captured.out assert "CrunchBerries (Wallet ID: 3): 0.0 (0 mojos)" in captured.out assert "UnicornTears (Wallet ID: 4): 0.0 (0 mojos)" in captured.out @@ -114,11 +114,11 @@ async def test_print_offer_summary_cat_with_fee_and_change(capsys: Any) -> None: @pytest.mark.asyncio -async def test_print_offer_summary_xch_with_one_mojo(capsys: Any) -> None: - summary_dict = {"xch": 1} +async def test_print_offer_summary_xfx_with_one_mojo(capsys: Any) -> None: + summary_dict = {"xfx": 1} await print_offer_summary(cat_name_resolver, summary_dict) captured = capsys.readouterr() - assert "XCH (Wallet ID: 1): 1e-12 (1 mojo)" in captured.out + assert "XFX (Wallet ID: 1): 1e-12 (1 mojo)" in captured.out 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/custom_types/test_coin.py b/tests/core/custom_types/test_coin.py index 20dbe869b..8b0e1122a 100644 --- a/tests/core/custom_types/test_coin.py +++ b/tests/core/custom_types/test_coin.py @@ -1,8 +1,8 @@ from typing import List -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 import pytest diff --git a/tests/core/custom_types/test_proof_of_space.py b/tests/core/custom_types/test_proof_of_space.py index b718a76ea..71181fc49 100644 --- a/tests/core/custom_types/test_proof_of_space.py +++ b/tests/core/custom_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/custom_types/test_spend_bundle.py b/tests/core/custom_types/test_spend_bundle.py index 405ad1dd2..02201b291 100644 --- a/tests/core/custom_types/test_spend_bundle.py +++ b/tests/core/custom_types/test_spend_bundle.py @@ -3,7 +3,7 @@ from blspy import G2Element -from chia.types.spend_bundle import SpendBundle +from flax.types.spend_bundle import SpendBundle BLANK_SPEND_BUNDLE = SpendBundle(coin_spends=[], aggregated_signature=G2Element()) diff --git a/tests/core/daemon/test_daemon.py b/tests/core/daemon/test_daemon.py index 331610b89..5779e2796 100644 --- a/tests/core/daemon/test_daemon.py +++ b/tests/core/daemon/test_daemon.py @@ -4,13 +4,13 @@ import logging import pytest -from chia.daemon.server import WebSocketServer -from chia.server.outbound_message import NodeType -from chia.types.peer_info import PeerInfo +from flax.daemon.server import WebSocketServer +from flax.server.outbound_message import NodeType +from flax.types.peer_info import PeerInfo from tests.block_tools import BlockTools -from chia.util.ints import uint16 -from chia.util.keyring_wrapper import DEFAULT_PASSPHRASE_IF_NO_MASTER_PASSPHRASE -from chia.util.ws_message import create_payload +from flax.util.ints import uint16 +from flax.util.keyring_wrapper import DEFAULT_PASSPHRASE_IF_NO_MASTER_PASSPHRASE +from flax.util.ws_message import create_payload from tests.core.node_height import node_height_at_least from tests.time_out_assert import time_out_assert_custom_interval, time_out_assert @@ -72,7 +72,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/full_node/full_sync/test_full_sync.py b/tests/core/full_node/full_sync/test_full_sync.py index 5513f7bdf..9f82a3b7f 100644 --- a/tests/core/full_node/full_sync/test_full_sync.py +++ b/tests/core/full_node/full_sync/test_full_sync.py @@ -6,13 +6,13 @@ import pytest -from chia.full_node.weight_proof import _validate_sub_epoch_summaries -from chia.protocols import full_node_protocol -from chia.types.blockchain_format.sub_epoch_summary import SubEpochSummary -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.full_node.weight_proof import _validate_sub_epoch_summaries +from flax.protocols import full_node_protocol +from flax.types.blockchain_format.sub_epoch_summary import SubEpochSummary +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.node_height import node_height_exactly, node_height_between from tests.setup_nodes import test_constants from tests.time_out_assert import time_out_assert diff --git a/tests/core/full_node/ram_db.py b/tests/core/full_node/ram_db.py index f5245a0dc..1162cbf8d 100644 --- a/tests/core/full_node/ram_db.py +++ b/tests/core/full_node/ram_db.py @@ -4,12 +4,12 @@ import random 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.full_node.hint_store import HintStore -from chia.util.db_wrapper import DBWrapper2 +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.full_node.hint_store import HintStore +from flax.util.db_wrapper import DBWrapper2 async def create_ram_blockchain(consensus_constants: ConsensusConstants) -> Tuple[DBWrapper2, Blockchain]: diff --git a/tests/core/full_node/stores/test_block_store.py b/tests/core/full_node/stores/test_block_store.py index a8330e3aa..a055f0611 100644 --- a/tests/core/full_node/stores/test_block_store.py +++ b/tests/core/full_node/stores/test_block_store.py @@ -7,15 +7,15 @@ import pytest from clvm.casts import int_to_bytes -from chia.consensus.blockchain import Blockchain -from chia.consensus.full_block_to_block_record import header_block_to_sub_block_record -from chia.consensus.default_constants import DEFAULT_CONSTANTS -from chia.full_node.block_store import BlockStore -from chia.full_node.coin_store import CoinStore -from chia.full_node.hint_store import HintStore -from chia.util.ints import uint8 -from chia.types.blockchain_format.vdf import VDFProof -from chia.types.blockchain_format.program import SerializedProgram +from flax.consensus.blockchain import Blockchain +from flax.consensus.full_block_to_block_record import header_block_to_sub_block_record +from flax.consensus.default_constants import DEFAULT_CONSTANTS +from flax.full_node.block_store import BlockStore +from flax.full_node.coin_store import CoinStore +from flax.full_node.hint_store import HintStore +from flax.util.ints import uint8 +from flax.types.blockchain_format.vdf import VDFProof +from flax.types.blockchain_format.program import SerializedProgram from tests.blockchain.blockchain_test_utils import _validate_and_add_block from tests.util.db_connection import DBConnection from tests.setup_nodes import test_constants diff --git a/tests/core/full_node/stores/test_coin_store.py b/tests/core/full_node/stores/test_coin_store.py index 3a292093e..d6d894e29 100644 --- a/tests/core/full_node/stores/test_coin_store.py +++ b/tests/core/full_node/stores/test_coin_store.py @@ -3,24 +3,24 @@ 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.hint_store import HintStore -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.hash import std_hash -from chia.util.ints import uint64, uint32 +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.hint_store import HintStore +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.hash import std_hash +from flax.util.ints import uint64, uint32 from tests.blockchain.blockchain_test_utils import _validate_and_add_block from tests.wallet_tools import WalletTool from tests.setup_nodes import test_constants -from chia.types.blockchain_format.sized_bytes import bytes32 +from flax.types.blockchain_format.sized_bytes import bytes32 from tests.util.db_connection import DBConnection constants = test_constants diff --git a/tests/core/full_node/stores/test_full_node_store.py b/tests/core/full_node/stores/test_full_node_store.py index 6cc66036c..4a1c381be 100644 --- a/tests/core/full_node/stores/test_full_node_store.py +++ b/tests/core/full_node/stores/test_full_node_store.py @@ -5,19 +5,19 @@ import pytest import pytest_asyncio -from chia.consensus.blockchain import ReceiveBlockResult -from chia.consensus.find_fork_point import find_fork_point_in_chain -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.hash import std_hash -from chia.util.ints import uint8, uint32, uint64, uint128 +from flax.consensus.blockchain import ReceiveBlockResult +from flax.consensus.find_fork_point import find_fork_point_in_chain +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.hash import std_hash +from flax.util.ints import uint8, uint32, uint64, uint128 from tests.block_tools import get_signage_point, create_block_tools_async from tests.blockchain.blockchain_test_utils import ( _validate_and_add_block, diff --git a/tests/core/full_node/stores/test_hint_store.py b/tests/core/full_node/stores/test_hint_store.py index 8203b263f..033a2a005 100644 --- a/tests/core/full_node/stores/test_hint_store.py +++ b/tests/core/full_node/stores/test_hint_store.py @@ -2,14 +2,14 @@ import pytest from clvm.casts import int_to_bytes -from chia.full_node.hint_store import HintStore -from chia.protocols.full_node_protocol import RespondBlock -from chia.types.blockchain_format.coin import Coin -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.types.spend_bundle import SpendBundle -from chia.util.ints import uint64 +from flax.full_node.hint_store import HintStore +from flax.protocols.full_node_protocol import RespondBlock +from flax.types.blockchain_format.coin import Coin +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.types.spend_bundle import SpendBundle +from flax.util.ints import uint64 from tests.util.db_connection import DBConnection from tests.wallet_tools import WalletTool diff --git a/tests/core/full_node/stores/test_sync_store.py b/tests/core/full_node/stores/test_sync_store.py index e219ebbb7..4f79e7ffb 100644 --- a/tests/core/full_node/stores/test_sync_store.py +++ b/tests/core/full_node/stores/test_sync_store.py @@ -1,7 +1,7 @@ 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 class TestStore: diff --git a/tests/core/full_node/test_address_manager.py b/tests/core/full_node/test_address_manager.py index de1e40f71..49b3fade4 100644 --- a/tests/core/full_node/test_address_manager.py +++ b/tests/core/full_node/test_address_manager.py @@ -4,10 +4,10 @@ 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 chia.util.ints import uint16, uint64 +from flax.server.address_manager import AddressManager, ExtendedPeerInfo +from flax.server.address_manager_store import AddressManagerStore +from flax.types.peer_info import PeerInfo, TimestampedPeerInfo +from flax.util.ints import uint16, uint64 class AddressManagerTest(AddressManager): diff --git a/tests/core/full_node/test_block_height_map.py b/tests/core/full_node/test_block_height_map.py index 835023c0f..f8f6a2ead 100644 --- a/tests/core/full_node/test_block_height_map.py +++ b/tests/core/full_node/test_block_height_map.py @@ -1,14 +1,14 @@ import pytest import struct -from chia.full_node.block_height_map import BlockHeightMap, SesCache -from chia.types.blockchain_format.sub_epoch_summary import SubEpochSummary -from chia.util.db_wrapper import DBWrapper2 +from flax.full_node.block_height_map import BlockHeightMap, SesCache +from flax.types.blockchain_format.sub_epoch_summary import SubEpochSummary +from flax.util.db_wrapper import DBWrapper2 from tests.util.db_connection import DBConnection -from chia.types.blockchain_format.sized_bytes import bytes32 +from flax.types.blockchain_format.sized_bytes import bytes32 from typing import Optional -from chia.util.ints import uint8 -from chia.util.files import write_file_async +from flax.util.ints import uint8 +from flax.util.files import write_file_async def gen_block_hash(height: int) -> bytes32: diff --git a/tests/core/full_node/test_conditions.py b/tests/core/full_node/test_conditions.py index c005b9545..3ca72a528 100644 --- a/tests/core/full_node/test_conditions.py +++ b/tests/core/full_node/test_conditions.py @@ -14,15 +14,15 @@ from clvm_tools.binutils import assemble -from chia.types.announcement import Announcement -from chia.types.blockchain_format.program import Program -from chia.types.coin_record import CoinRecord -from chia.types.coin_spend import CoinSpend -from chia.types.condition_opcodes import ConditionOpcode -from chia.types.full_block import FullBlock -from chia.types.spend_bundle import SpendBundle -from chia.util.errors import Err -from chia.util.ints import uint32 +from flax.types.announcement import Announcement +from flax.types.blockchain_format.program import Program +from flax.types.coin_record import CoinRecord +from flax.types.coin_spend import CoinSpend +from flax.types.condition_opcodes import ConditionOpcode +from flax.types.full_block import FullBlock +from flax.types.spend_bundle import SpendBundle +from flax.util.errors import Err +from flax.util.ints import uint32 from tests.block_tools import BlockTools from tests.util.keyring import TempKeyring diff --git a/tests/core/full_node/test_full_node.py b/tests/core/full_node/test_full_node.py index 186fff3ce..f4c00809a 100644 --- a/tests/core/full_node/test_full_node.py +++ b/tests/core/full_node/test_full_node.py @@ -9,34 +9,34 @@ from blspy import G2Element from clvm.casts import int_to_bytes -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, wallet_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 Program, SerializedProgram -from chia.types.blockchain_format.vdf import CompressibleVDFField, VDFProof -from chia.types.coin_spend import CoinSpend -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.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.wallet.transaction_record import TransactionRecord +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, wallet_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 Program, SerializedProgram +from flax.types.blockchain_format.vdf import CompressibleVDFField, VDFProof +from flax.types.coin_spend import CoinSpend +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.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.wallet.transaction_record import TransactionRecord from tests.block_tools import get_signage_point from tests.blockchain.blockchain_test_utils import ( _validate_and_add_block, diff --git a/tests/core/full_node/test_generator_tools.py b/tests/core/full_node/test_generator_tools.py index ff739cf01..deb0151cf 100644 --- a/tests/core/full_node/test_generator_tools.py +++ b/tests/core/full_node/test_generator_tools.py @@ -1,10 +1,10 @@ from typing import List -from chia.types.blockchain_format.coin import Coin -from chia.types.spend_bundle_conditions import Spend, SpendBundleConditions -from chia.util.generator_tools import tx_removals_and_additions -from chia.util.hash import std_hash -from chia.util.ints import uint32, uint64 +from flax.types.blockchain_format.coin import Coin +from flax.types.spend_bundle_conditions import Spend, SpendBundleConditions +from flax.util.generator_tools import tx_removals_and_additions +from flax.util.hash import std_hash +from flax.util.ints import uint32, uint64 coin_ids = [std_hash(i.to_bytes(4, "big")) for i in range(10)] phs = [std_hash(i.to_bytes(4, "big")) for i in range(10)] diff --git a/tests/core/full_node/test_hint_management.py b/tests/core/full_node/test_hint_management.py index a62596f7f..877045792 100644 --- a/tests/core/full_node/test_hint_management.py +++ b/tests/core/full_node/test_hint_management.py @@ -2,15 +2,15 @@ import pytest -from chia.consensus.block_record import BlockRecord -from chia.consensus.blockchain import Blockchain, StateChangeSummary -from chia.consensus.cost_calculator import NPCResult -from chia.full_node.hint_management import get_hints_and_subscription_coin_ids -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.spend_bundle_conditions import Spend, SpendBundleConditions -from chia.util.hash import std_hash -from chia.util.ints import uint32, uint64 +from flax.consensus.block_record import BlockRecord +from flax.consensus.blockchain import Blockchain, StateChangeSummary +from flax.consensus.cost_calculator import NPCResult +from flax.full_node.hint_management import get_hints_and_subscription_coin_ids +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.spend_bundle_conditions import Spend, SpendBundleConditions +from flax.util.hash import std_hash +from flax.util.ints import uint32, uint64 from tests.block_tools import BlockTools from tests.blockchain.blockchain_test_utils import _validate_and_add_block diff --git a/tests/core/full_node/test_mempool.py b/tests/core/full_node/test_mempool.py index 1c0e3f643..421ea2efc 100644 --- a/tests/core/full_node/test_mempool.py +++ b/tests/core/full_node/test_mempool.py @@ -6,45 +6,45 @@ from clvm.casts import int_to_bytes import pytest -import chia.server.ws_connection as ws - -from chia.full_node.mempool import Mempool -from chia.full_node.full_node_api import FullNodeAPI -from chia.protocols import full_node_protocol, wallet_protocol -from chia.protocols.wallet_protocol import TransactionAck -from chia.server.outbound_message import Message -from chia.simulator.simulator_protocol import FarmNewBlockProtocol -from chia.types.announcement import Announcement -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.sized_bytes import bytes32, bytes48 -from chia.types.coin_spend import CoinSpend -from chia.types.condition_opcodes import ConditionOpcode -from chia.types.condition_with_args import ConditionWithArgs -from chia.types.spend_bundle import SpendBundle -from chia.types.mempool_item import MempoolItem -from chia.util.condition_tools import conditions_for_solution, pkm_pairs -from chia.util.errors import Err -from chia.util.ints import uint64, uint32 -from chia.util.hash import std_hash -from chia.types.mempool_inclusion_status import MempoolInclusionStatus -from chia.util.api_decorators import api_request, peer_required, bytes_required -from chia.full_node.mempool_check_conditions import get_name_puzzle_conditions -from chia.full_node.pending_tx_cache import PendingTxCache +import flax.server.ws_connection as ws + +from flax.full_node.mempool import Mempool +from flax.full_node.full_node_api import FullNodeAPI +from flax.protocols import full_node_protocol, wallet_protocol +from flax.protocols.wallet_protocol import TransactionAck +from flax.server.outbound_message import Message +from flax.simulator.simulator_protocol import FarmNewBlockProtocol +from flax.types.announcement import Announcement +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.sized_bytes import bytes32, bytes48 +from flax.types.coin_spend import CoinSpend +from flax.types.condition_opcodes import ConditionOpcode +from flax.types.condition_with_args import ConditionWithArgs +from flax.types.spend_bundle import SpendBundle +from flax.types.mempool_item import MempoolItem +from flax.util.condition_tools import conditions_for_solution, pkm_pairs +from flax.util.errors import Err +from flax.util.ints import uint64, uint32 +from flax.util.hash import std_hash +from flax.types.mempool_inclusion_status import MempoolInclusionStatus +from flax.util.api_decorators import api_request, peer_required, bytes_required +from flax.full_node.mempool_check_conditions import get_name_puzzle_conditions +from flax.full_node.pending_tx_cache import PendingTxCache from blspy import G2Element -from chia.util.recursive_replace import recursive_replace +from flax.util.recursive_replace import recursive_replace from tests.blockchain.blockchain_test_utils import _validate_and_add_block from tests.connection_utils import connect_and_get_peer, add_dummy_connection from tests.core.node_height import node_height_at_least from tests.time_out_assert import time_out_assert -from chia.types.blockchain_format.program import Program, INFINITE_COST -from chia.consensus.cost_calculator import NPCResult -from chia.consensus.condition_costs import ConditionCost -from chia.types.blockchain_format.program import SerializedProgram +from flax.types.blockchain_format.program import Program, INFINITE_COST +from flax.consensus.cost_calculator import NPCResult +from flax.consensus.condition_costs import ConditionCost +from flax.types.blockchain_format.program import SerializedProgram from clvm_tools import binutils -from chia.types.generator_types import BlockGenerator +from flax.types.generator_types import BlockGenerator from blspy import G1Element -from chia.types.spend_bundle_conditions import SpendBundleConditions, Spend +from flax.types.spend_bundle_conditions import SpendBundleConditions, Spend from tests.util.misc import assert_runtime from tests.wallet_tools import WalletTool @@ -176,7 +176,7 @@ async def test_basic_mempool(self, bt, one_node_one_block, wallet_a): async def respond_transaction( node: FullNodeAPI, tx: full_node_protocol.RespondTransaction, - peer: ws.WSChiaConnection, + peer: ws.WSFlaxConnection, tx_bytes: bytes = b"", test: bool = False, ) -> Tuple[MempoolInclusionStatus, Optional[Err]]: diff --git a/tests/core/full_node/test_mempool_performance.py b/tests/core/full_node/test_mempool_performance.py index ec3364b5b..7aed937ea 100644 --- a/tests/core/full_node/test_mempool_performance.py +++ b/tests/core/full_node/test_mempool_performance.py @@ -4,11 +4,11 @@ import pytest -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 chia.wallet.wallet_node import WalletNode +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 flax.wallet.wallet_node import WalletNode from tests.connection_utils import connect_and_get_peer from tests.time_out_assert import time_out_assert from tests.util.misc import assert_runtime diff --git a/tests/core/full_node/test_node_load.py b/tests/core/full_node/test_node_load.py index f6422c27e..a3ee4a412 100644 --- a/tests/core/full_node/test_node_load.py +++ b/tests/core/full_node/test_node_load.py @@ -1,8 +1,8 @@ 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.time_out_assert import time_out_assert from tests.util.misc import assert_runtime diff --git a/tests/core/full_node/test_peer_store_resolver.py b/tests/core/full_node/test_peer_store_resolver.py index b01c97721..4813e4667 100644 --- a/tests/core/full_node/test_peer_store_resolver.py +++ b/tests/core/full_node/test_peer_store_resolver.py @@ -2,7 +2,7 @@ from pathlib import Path from typing import Dict -from chia.server.peer_store_resolver import PeerStoreResolver +from flax.server.peer_store_resolver import PeerStoreResolver class TestPeerStoreResolver: diff --git a/tests/core/full_node/test_performance.py b/tests/core/full_node/test_performance.py index 51356e96a..8a9eea7fa 100644 --- a/tests/core/full_node/test_performance.py +++ b/tests/core/full_node/test_performance.py @@ -8,14 +8,14 @@ import pytest from clvm.casts import int_to_bytes -from chia.consensus.block_record import BlockRecord -from chia.consensus.pot_iterations import is_overflow_block -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.ints import uint64 +from flax.consensus.block_record import BlockRecord +from flax.consensus.pot_iterations import is_overflow_block +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.ints import uint64 from tests.connection_utils import add_dummy_connection from tests.core.full_node.stores.test_coin_store import get_future_reward_coins from tests.core.node_height import node_height_at_least diff --git a/tests/core/full_node/test_transactions.py b/tests/core/full_node/test_transactions.py index b2c88a2a7..81fbe5d0e 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.time_out_assert import time_out_assert diff --git a/tests/core/make_block_generator.py b/tests/core/make_block_generator.py index 274b62384..8db071263 100644 --- a/tests/core/make_block_generator.py +++ b/tests/core/make_block_generator.py @@ -2,16 +2,16 @@ 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.blockchain_format.sized_bytes import bytes32 -from chia.types.coin_spend import CoinSpend -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.blockchain_format.sized_bytes import bytes32 +from flax.types.coin_spend import CoinSpend +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 a8c369612..27c3d95e6 100644 --- a/tests/core/server/test_dos.py +++ b/tests/core/server/test_dos.py @@ -5,17 +5,17 @@ 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.protocols.shared_protocol import Handshake -from chia.server.outbound_message import make_msg, Message -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.errors import Err -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.protocols.shared_protocol import Handshake +from flax.server.outbound_message import make_msg, Message +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.errors import Err +from flax.util.ints import uint16, uint64 from tests.time_out_assert import time_out_assert log = logging.getLogger(__name__) @@ -49,7 +49,7 @@ async def test_large_message_disconnect_and_ban(self, setup_two_nodes_fixture, s 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 @@ -98,7 +98,7 @@ async def test_bad_handshake_and_ban(self, setup_two_nodes_fixture, self_hostnam 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 @@ -144,7 +144,7 @@ async def test_invalid_protocol_handshake(self, setup_two_nodes_fixture, self_ho 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 @@ -175,8 +175,8 @@ async def test_spam_tx(self, setup_two_nodes_fixture, self_hostname): 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" @@ -230,8 +230,8 @@ async def test_spam_message_non_tx(self, setup_two_nodes_fixture, self_hostname) 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" @@ -279,8 +279,8 @@ async def test_spam_message_too_large(self, setup_two_nodes_fixture, self_hostna 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 2df14dba5..14f5e2b5d 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 0b04993e4..c68dcf1c9 100644 --- a/tests/core/ssl/test_ssl.py +++ b/tests/core/ssl/test_ssl.py @@ -4,25 +4,25 @@ import pytest import pytest_asyncio -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.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.ints import uint16 from tests.block_tools import test_constants from tests.setup_nodes import setup_harvester_farmer -async def establish_connection(server: ChiaServer, self_hostname: str, ssl_context) -> None: +async def establish_connection(server: FlaxServer, self_hostname: str, ssl_context) -> None: timeout = aiohttp.ClientTimeout(total=10) dummy_port = 5 # this does not matter async with aiohttp.ClientSession(timeout=timeout) as session: 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, @@ -50,7 +50,7 @@ class TestSSL: async def test_public_connections(self, wallet_node_sim_and_wallet, self_hostname): full_nodes, wallets = wallet_node_sim_and_wallet 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) @@ -80,10 +80,10 @@ async def test_farmer(self, harvester_farmer, self_hostname): 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_key_path, pub_crt, pub_key + farmer_server.flax_ca_crt_path, farmer_server.flax_ca_key_path, pub_crt, pub_key ) with pytest.raises(aiohttp.ClientConnectorCertificateError): await establish_connection(farmer_server, self_hostname, ssl_context) @@ -103,13 +103,13 @@ async def test_full_node(self, wallet_node_sim_and_wallet, self_hostname): 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_key_path, pub_crt, pub_key + full_node_server.flax_ca_crt_path, full_node_server.flax_ca_key_path, pub_crt, pub_key ) await establish_connection(full_node_server, self_hostname, ssl_context) @@ -122,10 +122,10 @@ async def test_wallet(self, wallet_node_sim_and_wallet, self_hostname): 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_key_path, pub_crt, pub_key + wallet_server.flax_ca_crt_path, wallet_server.flax_ca_key_path, pub_crt, pub_key ) with pytest.raises(aiohttp.ClientConnectorError): await establish_connection(wallet_server, self_hostname, ssl_context) @@ -154,13 +154,13 @@ async def test_harvester(self, harvester_farmer, self_hostname): 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_key_path, pub_crt, pub_key + harvester_server.flax_ca_crt_path, harvester_server.flax_ca_key_path, pub_crt, pub_key ) with pytest.raises(aiohttp.ClientConnectorError): await establish_connection(harvester_server, self_hostname, ssl_context) @@ -185,16 +185,16 @@ async def test_introducer(self, introducer, self_hostname): 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_key_path, pub_crt, pub_key + introducer_server.flax_ca_crt_path, introducer_server.flax_ca_key_path, pub_crt, pub_key ) await establish_connection(introducer_server, self_hostname, ssl_context) @@ -206,13 +206,13 @@ async def test_timelord(self, timelord, self_hostname): 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_key_path, pub_crt, pub_key + timelord_server.flax_ca_crt_path, timelord_server.flax_ca_key_path, pub_crt, pub_key ) with pytest.raises(aiohttp.ClientConnectorError): await establish_connection(timelord_server, self_hostname, ssl_context) diff --git a/tests/core/test_coins.py b/tests/core/test_coins.py index f08097c5c..75bf717ee 100644 --- a/tests/core/test_coins.py +++ b/tests/core/test_coins.py @@ -1,9 +1,9 @@ from itertools import permutations from benchmarks.utils import rand_hash -from chia.types.blockchain_format.coin import hash_coin_ids -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.hash import std_hash +from flax.types.blockchain_format.coin import hash_coin_ids +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.hash import std_hash def test_hash_coin_ids_empty() -> None: diff --git a/tests/core/test_cost_calculation.py b/tests/core/test_cost_calculation.py index 9d1d70fc3..ab0346d6c 100644 --- a/tests/core/test_cost_calculation.py +++ b/tests/core/test_cost_calculation.py @@ -4,13 +4,13 @@ import pytest from clvm_tools import binutils -from chia.consensus.condition_costs import ConditionCost -from chia.consensus.cost_calculator import NPCResult -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 +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 test_constants from tests.util.misc import assert_runtime @@ -39,7 +39,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_crawler_rpc.py b/tests/core/test_crawler_rpc.py index 285a8b84f..685140360 100644 --- a/tests/core/test_crawler_rpc.py +++ b/tests/core/test_crawler_rpc.py @@ -1,7 +1,7 @@ import pytest -from chia.rpc.crawler_rpc_api import CrawlerRpcApi -from chia.seeder.crawler import Crawler +from flax.rpc.crawler_rpc_api import CrawlerRpcApi +from flax.seeder.crawler import Crawler class TestCrawlerRpc: diff --git a/tests/core/test_daemon_rpc.py b/tests/core/test_daemon_rpc.py index cec32ef33..5d750d623 100644 --- a/tests/core/test_daemon_rpc.py +++ b/tests/core/test_daemon_rpc.py @@ -1,7 +1,7 @@ import pytest -from chia import __version__ -from chia.daemon.client import connect_to_daemon +from flax import __version__ +from flax.daemon.client import connect_to_daemon class TestDaemonRpc: diff --git a/tests/core/test_db_conversion.py b/tests/core/test_db_conversion.py index f9e598d96..c43f7b5c4 100644 --- a/tests/core/test_db_conversion.py +++ b/tests/core/test_db_conversion.py @@ -7,15 +7,15 @@ from tests.setup_nodes import test_constants from tests.util.temp_file import TempFile -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.ints import uint64 -from chia.cmds.db_upgrade_func import convert_v1_to_v2 -from chia.util.db_wrapper import DBWrapper2 -from chia.full_node.block_store import BlockStore -from chia.full_node.coin_store import CoinStore -from chia.full_node.hint_store import HintStore -from chia.consensus.blockchain import Blockchain -from chia.consensus.multiprocess_validation import PreValidationResult +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.ints import uint64 +from flax.cmds.db_upgrade_func import convert_v1_to_v2 +from flax.util.db_wrapper import DBWrapper2 +from flax.full_node.block_store import BlockStore +from flax.full_node.coin_store import CoinStore +from flax.full_node.hint_store import HintStore +from flax.consensus.blockchain import Blockchain +from flax.consensus.multiprocess_validation import PreValidationResult def rand_bytes(num) -> bytes: diff --git a/tests/core/test_db_validation.py b/tests/core/test_db_validation.py index 7eb059229..ba795202f 100644 --- a/tests/core/test_db_validation.py +++ b/tests/core/test_db_validation.py @@ -7,17 +7,17 @@ import aiosqlite import pytest -from chia.cmds.db_validate_func import validate_v2 -from chia.consensus.blockchain import Blockchain -from chia.consensus.default_constants import DEFAULT_CONSTANTS -from chia.consensus.multiprocess_validation import PreValidationResult -from chia.full_node.block_store import BlockStore -from chia.full_node.coin_store import CoinStore -from chia.full_node.hint_store import HintStore -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.full_block import FullBlock -from chia.util.db_wrapper import DBWrapper2 -from chia.util.ints import uint64 +from flax.cmds.db_validate_func import validate_v2 +from flax.consensus.blockchain import Blockchain +from flax.consensus.default_constants import DEFAULT_CONSTANTS +from flax.consensus.multiprocess_validation import PreValidationResult +from flax.full_node.block_store import BlockStore +from flax.full_node.coin_store import CoinStore +from flax.full_node.hint_store import HintStore +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.full_block import FullBlock +from flax.util.db_wrapper import DBWrapper2 +from flax.util.ints import uint64 from tests.setup_nodes import test_constants from tests.util.temp_file import TempFile @@ -134,7 +134,7 @@ async def make_db(db_file: Path, blocks: List[FullBlock]) -> None: await db_wrapper.add_connection(await aiosqlite.connect(db_file)) async with db_wrapper.write_db() as conn: - # this is done by chia init normally + # this is done by flax init normally await conn.execute("CREATE TABLE database_version(version int)") await conn.execute("INSERT INTO database_version VALUES (2)") diff --git a/tests/core/test_farmer_harvester_rpc.py b/tests/core/test_farmer_harvester_rpc.py index 0cb761a60..f1f12968e 100644 --- a/tests/core/test_farmer_harvester_rpc.py +++ b/tests/core/test_farmer_harvester_rpc.py @@ -10,12 +10,12 @@ import pytest import pytest_asyncio -from chia.consensus.coinbase import create_puzzlehash_for_pk -from chia.plot_sync.receiver import Receiver -from chia.plotting.util import add_plot_directory -from chia.protocols import farmer_protocol -from chia.protocols.harvester_protocol import Plot -from chia.rpc.farmer_rpc_api import ( +from flax.consensus.coinbase import create_puzzlehash_for_pk +from flax.plot_sync.receiver import Receiver +from flax.plotting.util import add_plot_directory +from flax.protocols import farmer_protocol +from flax.protocols.harvester_protocol import Plot +from flax.rpc.farmer_rpc_api import ( FarmerRpcApi, FilterItem, PaginatedRequestData, @@ -23,19 +23,19 @@ PlotPathRequestData, plot_matches_filter, ) -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.byte_types import hexstr_to_bytes -from chia.util.config import load_config, lock_and_load_config, save_config -from chia.util.hash import std_hash -from chia.util.ints import uint8, uint16, uint32, uint64 -from chia.util.misc import get_list_or_len -from chia.util.streamable import dataclass_from_dict -from chia.wallet.derive_keys import master_sk_to_wallet_sk, master_sk_to_wallet_sk_unhardened +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.byte_types import hexstr_to_bytes +from flax.util.config import load_config, lock_and_load_config, save_config +from flax.util.hash import std_hash +from flax.util.ints import uint8, uint16, uint32, uint64 +from flax.util.misc import get_list_or_len +from flax.util.streamable import dataclass_from_dict +from flax.wallet.derive_keys import master_sk_to_wallet_sk, master_sk_to_wallet_sk_unhardened from tests.block_tools import get_plot_dir from tests.plot_sync.test_delta import dummy_plot from tests.setup_nodes import setup_harvester_farmer, test_constants @@ -228,7 +228,7 @@ async def test_farmer_reward_target_endpoints(bt, harvester_farmer_environment): new_ph: bytes32 = create_puzzlehash_for_pk(master_sk_to_wallet_sk(bt.farmer_master_sk, uint32(2)).get_g1()) new_ph_2: bytes32 = create_puzzlehash_for_pk(master_sk_to_wallet_sk(bt.pool_master_sk, uint32(7)).get_g1()) - await farmer_rpc_client.set_reward_targets(encode_puzzle_hash(new_ph, "xch"), encode_puzzle_hash(new_ph_2, "xch")) + await farmer_rpc_client.set_reward_targets(encode_puzzle_hash(new_ph, "xfx"), encode_puzzle_hash(new_ph_2, "xfx")) targets_3 = await farmer_rpc_client.get_reward_targets(True, 10) assert decode_puzzle_hash(targets_3["farmer_target"]) == new_ph assert decode_puzzle_hash(targets_3["pool_target"]) == new_ph_2 @@ -246,7 +246,7 @@ async def test_farmer_reward_target_endpoints(bt, harvester_farmer_environment): master_sk_to_wallet_sk_unhardened(bt.pool_master_sk, uint32(7)).get_g1() ) await farmer_rpc_client.set_reward_targets( - encode_puzzle_hash(observer_farmer, "xch"), encode_puzzle_hash(observer_pool, "xch") + encode_puzzle_hash(observer_farmer, "xfx"), encode_puzzle_hash(observer_pool, "xfx") ) targets = await farmer_rpc_client.get_reward_targets(True, 10) assert decode_puzzle_hash(targets["farmer_target"]) == observer_farmer @@ -255,10 +255,10 @@ async def test_farmer_reward_target_endpoints(bt, harvester_farmer_environment): root_path = farmer_api.farmer._root_path config = load_config(root_path, "config.yaml") - assert config["farmer"]["xch_target_address"] == encode_puzzle_hash(observer_farmer, "xch") - assert config["pool"]["xch_target_address"] == encode_puzzle_hash(observer_pool, "xch") + assert config["farmer"]["xfx_target_address"] == encode_puzzle_hash(observer_farmer, "xfx") + assert config["pool"]["xfx_target_address"] == encode_puzzle_hash(observer_pool, "xfx") - new_ph_2_encoded = encode_puzzle_hash(new_ph_2, "xch") + new_ph_2_encoded = encode_puzzle_hash(new_ph_2, "xfx") added_char = new_ph_2_encoded + "a" with pytest.raises(ValueError): await farmer_rpc_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 c5eeb52c9..226e86b93 100644 --- a/tests/core/test_full_node_rpc.py +++ b/tests/core/test_full_node_rpc.py @@ -4,18 +4,18 @@ import pytest from blspy import AugSchemeMPL -from chia.consensus.pot_iterations import is_overflow_block -from chia.full_node.signage_point import SignagePoint -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 NodeType, start_rpc_server -from chia.simulator.simulator_protocol import FarmNewBlockProtocol, ReorgProtocol -from chia.types.full_block import FullBlock -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 uint8, uint16 +from flax.consensus.pot_iterations import is_overflow_block +from flax.full_node.signage_point import SignagePoint +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 NodeType, start_rpc_server +from flax.simulator.simulator_protocol import FarmNewBlockProtocol, ReorgProtocol +from flax.types.full_block import FullBlock +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 uint8, uint16 from tests.block_tools import get_signage_point from tests.blockchain.blockchain_test_utils import _validate_and_add_block from tests.connection_utils import connect_and_get_peer diff --git a/tests/core/test_merkle_set.py b/tests/core/test_merkle_set.py index 34cef54ed..1a2482ddb 100644 --- a/tests/core/test_merkle_set.py +++ b/tests/core/test_merkle_set.py @@ -7,8 +7,8 @@ import pytest from chia_rs import compute_merkle_set_root -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.merkle_set import MerkleSet, confirm_included_already_hashed +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.merkle_set import MerkleSet, confirm_included_already_hashed class TestMerkleSet: 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/util/test_cached_bls.py b/tests/core/util/test_cached_bls.py index f85a665f9..8e09ff542 100644 --- a/tests/core/util/test_cached_bls.py +++ b/tests/core/util/test_cached_bls.py @@ -1,7 +1,7 @@ from blspy import AugSchemeMPL, G1Element -from chia.util import cached_bls -from chia.util.hash import std_hash -from chia.util.lru_cache import LRUCache +from flax.util import cached_bls +from flax.util.hash import std_hash +from flax.util.lru_cache import LRUCache def test_cached_bls(): diff --git a/tests/core/util/test_config.py b/tests/core/util/test_config.py index c1c80ce51..472888199 100644 --- a/tests/core/util/test_config.py +++ b/tests/core/util/test_config.py @@ -8,16 +8,16 @@ import random import yaml -from chia.util.config import ( +from flax.util.config import ( config_path_for_filename, - create_default_chia_config, + create_default_flax_config, initial_config_file, load_config, lock_and_load_config, lock_config, save_config, ) -from chia.util.path import mkdir +from flax.util.path import mkdir from multiprocessing import Pool, Queue, TimeoutError from pathlib import Path from threading import Thread @@ -148,7 +148,7 @@ def root_path_populated_with_config(tmpdir) -> Path: Returns the root path containing the config. """ root_path: Path = Path(tmpdir) - create_default_chia_config(root_path) + create_default_flax_config(root_path) return Path(root_path) @@ -165,7 +165,7 @@ def default_config_dict() -> Dict: class TestConfig: def test_create_config_new(self, tmpdir): """ - Test create_default_chia_config() as in a first run scenario + Test create_default_flax_config() as in a first run scenario """ # When: using a clean directory root_path: Path = Path(tmpdir) @@ -173,7 +173,7 @@ def test_create_config_new(self, tmpdir): # Expect: config.yaml doesn't exist assert config_file_path.exists() is False # When: creating a new config - create_default_chia_config(root_path) + create_default_flax_config(root_path) # Expect: config.yaml exists assert config_file_path.exists() is True @@ -187,7 +187,7 @@ def test_create_config_new(self, tmpdir): def test_create_config_overwrite(self, tmpdir): """ - Test create_default_chia_config() when overwriting an existing config.yaml + Test create_default_flax_config() when overwriting an existing config.yaml """ # When: using a clean directory root_path: Path = Path(tmpdir) @@ -199,7 +199,7 @@ def test_create_config_overwrite(self, tmpdir): # Expect: config.yaml exists assert config_file_path.exists() is True # When: creating a new config - create_default_chia_config(root_path) + create_default_flax_config(root_path) # Expect: config.yaml exists assert config_file_path.exists() is True @@ -220,7 +220,7 @@ def test_load_config(self, root_path_populated_with_config, default_config_dict) config: Dict = load_config(root_path=root_path, filename="config.yaml") assert config is not None # Expect: config values should match the defaults (from a small sampling) - assert config["daemon_port"] == default_config_dict["daemon_port"] == 55400 + assert config["daemon_port"] == default_config_dict["daemon_port"] == 56600 assert config["self_hostname"] == default_config_dict["self_hostname"] == "localhost" assert ( config["farmer"]["network_overrides"]["constants"]["mainnet"]["GENESIS_CHALLENGE"] diff --git a/tests/core/util/test_db_wrapper.py b/tests/core/util/test_db_wrapper.py index a838eb7a5..64b700dd4 100644 --- a/tests/core/util/test_db_wrapper.py +++ b/tests/core/util/test_db_wrapper.py @@ -5,7 +5,7 @@ import aiosqlite import pytest -from chia.util.db_wrapper import DBWrapper2 +from flax.util.db_wrapper import DBWrapper2 from tests.util.db_connection import DBConnection diff --git a/tests/core/util/test_file_keyring_synchronization.py b/tests/core/util/test_file_keyring_synchronization.py index 9035baf33..dc0418ac9 100644 --- a/tests/core/util/test_file_keyring_synchronization.py +++ b/tests/core/util/test_file_keyring_synchronization.py @@ -3,9 +3,9 @@ import os import pytest -from chia.util.file_keyring import acquire_writer_lock, FileKeyring, FileKeyringLockTimeout -from chia.util.keyring_wrapper import KeyringWrapper -from chia.util.path import mkdir +from flax.util.file_keyring import acquire_writer_lock, FileKeyring, FileKeyringLockTimeout +from flax.util.keyring_wrapper import KeyringWrapper +from flax.util.path import mkdir from multiprocessing import Pool, TimeoutError from pathlib import Path from sys import platform diff --git a/tests/core/util/test_files.py b/tests/core/util/test_files.py index 5b5c6a44c..321a2df71 100644 --- a/tests/core/util/test_files.py +++ b/tests/core/util/test_files.py @@ -3,8 +3,8 @@ import shutil import sys -from chia.util import files -from chia.util.files import move_file, move_file_async, write_file_async +from flax.util import files +from flax.util.files import move_file, move_file_async, write_file_async from pathlib import Path diff --git a/tests/core/util/test_jsonify.py b/tests/core/util/test_jsonify.py index 46e4fb89d..c0ed69e7e 100644 --- a/tests/core/util/test_jsonify.py +++ b/tests/core/util/test_jsonify.py @@ -1,9 +1,9 @@ from dataclasses import dataclass from typing import Any, Dict, List, Optional, Tuple -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.ints import uint32 -from chia.util.streamable import Streamable, recurse_jsonify, streamable +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.ints import uint32 +from flax.util.streamable import Streamable, recurse_jsonify, streamable def dict_with_types(d: Dict[str, Any]) -> Dict[str, Any]: diff --git a/tests/core/util/test_keychain.py b/tests/core/util/test_keychain.py index a841ec319..d66f2ba62 100644 --- a/tests/core/util/test_keychain.py +++ b/tests/core/util/test_keychain.py @@ -5,13 +5,13 @@ from blspy import AugSchemeMPL, PrivateKey from tests.util.keyring import using_temp_file_keyring -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 TestKeychain(unittest.TestCase): @using_temp_file_keyring() def test_basic_add_delete(self): - kc: Keychain = Keychain(user="testing-1.8.0", service="chia-testing-1.8.0") + kc: Keychain = Keychain(user="testing-1.8.0", service="flax-testing-1.8.0") kc.delete_all_keys() assert kc._get_free_private_key_index() == 0 @@ -81,7 +81,7 @@ def test_basic_add_delete(self): @using_temp_file_keyring() def test_bip39_eip2333_test_vector(self): - kc: Keychain = Keychain(user="testing-1.8.0", service="chia-testing-1.8.0") + kc: Keychain = Keychain(user="testing-1.8.0", service="flax-testing-1.8.0") kc.delete_all_keys() mnemonic = "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about" diff --git a/tests/core/util/test_keyring_wrapper.py b/tests/core/util/test_keyring_wrapper.py index 77cfe3a38..ac1fe106f 100644 --- a/tests/core/util/test_keyring_wrapper.py +++ b/tests/core/util/test_keyring_wrapper.py @@ -1,7 +1,7 @@ import logging import pytest -from chia.util.keyring_wrapper import KeyringWrapper, DEFAULT_PASSPHRASE_IF_NO_MASTER_PASSPHRASE +from flax.util.keyring_wrapper import KeyringWrapper, DEFAULT_PASSPHRASE_IF_NO_MASTER_PASSPHRASE from pathlib import Path from sys import platform from tests.util.keyring import using_temp_file_keyring, using_temp_file_keyring_and_cryptfilekeyring 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 610173bac..d5aa817c7 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 e750da68f..4fb418b28 100644 --- a/tests/core/util/test_streamable.py +++ b/tests/core/util/test_streamable.py @@ -8,14 +8,14 @@ from clvm_tools import binutils from typing_extensions import Literal -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, uint64 -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, uint64 +from flax.util.streamable import ( DefinitionError, Streamable, is_type_List, diff --git a/tests/farmer_harvester/test_farmer_harvester.py b/tests/farmer_harvester/test_farmer_harvester.py index 881ff28e5..173767cd0 100644 --- a/tests/farmer_harvester/test_farmer_harvester.py +++ b/tests/farmer_harvester/test_farmer_harvester.py @@ -3,8 +3,8 @@ import pytest import pytest_asyncio -from chia.farmer.farmer import Farmer -from chia.util.keychain import generate_mnemonic +from flax.farmer.farmer import Farmer +from flax.util.keychain import generate_mnemonic from tests.setup_nodes import setup_harvester_farmer, test_constants from tests.time_out_assert import time_out_assert 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 30757a122..3e1097999 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_spend_entry_list, compressed_spend_bundle_solution, @@ -11,14 +11,14 @@ simple_solution_generator, spend_bundle_to_serialized_coin_spend_entry_list, ) -from chia.full_node.generator import run_generator_unsafe, create_generator_args -from chia.full_node.mempool_check_conditions import get_puzzle_and_solution_for_coin -from chia.types.blockchain_format.program import Program, SerializedProgram, INFINITE_COST -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 -from chia.wallet.puzzles.load_clvm import load_clvm +from flax.full_node.generator import run_generator_unsafe, create_generator_args +from flax.full_node.mempool_check_conditions import get_puzzle_and_solution_for_coin +from flax.types.blockchain_format.program import Program, SerializedProgram, INFINITE_COST +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 +from flax.wallet.puzzles.load_clvm import load_clvm from tests.core.make_block_generator import make_spend_bundle @@ -28,17 +28,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_spend_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_spend_entry.clvm", package_or_requirement="flax.wallet.puzzles") DECOMPRESS_CSE_WITH_PREFIX = load_clvm( - "decompress_coin_spend_entry_with_prefix.clvm", package_or_requirement="chia.wallet.puzzles" + "decompress_coin_spend_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_list_to_batches.py b/tests/generator/test_list_to_batches.py index 2f98ee170..a7837e37f 100644 --- a/tests/generator/test_list_to_batches.py +++ b/tests/generator/test_list_to_batches.py @@ -1,5 +1,5 @@ import pytest -from chia.util.generator_tools import list_to_batches +from flax.util.generator_tools import list_to_batches def test_empty_lists(): diff --git a/tests/generator/test_rom.py b/tests/generator/test_rom.py index 35c9804f7..e274d4a60 100644 --- a/tests/generator/test_rom.py +++ b/tests/generator/test_rom.py @@ -1,21 +1,21 @@ from clvm_tools import binutils from clvm_tools.clvmc import compile_clvm_text -from chia.full_node.generator import run_generator_unsafe -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.generator_types import BlockGenerator -from chia.util.ints import uint32 -from chia.wallet.puzzles.load_clvm import load_clvm -from chia.consensus.condition_costs import ConditionCost -from chia.types.spend_bundle_conditions import Spend +from flax.full_node.generator import run_generator_unsafe +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.generator_types import BlockGenerator +from flax.util.ints import uint32 +from flax.wallet.puzzles.load_clvm import load_clvm +from flax.consensus.condition_costs import ConditionCost +from flax.types.spend_bundle_conditions import Spend MAX_COST = int(1e15) COST_PER_BYTE = int(12000) -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/plot_sync/test_delta.py b/tests/plot_sync/test_delta.py index 057e449bd..ec302cc92 100644 --- a/tests/plot_sync/test_delta.py +++ b/tests/plot_sync/test_delta.py @@ -4,10 +4,10 @@ import pytest from blspy import G1Element -from chia.plot_sync.delta import Delta, DeltaType, PathListDelta, PlotListDelta -from chia.protocols.harvester_protocol import Plot -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.ints import uint8, uint64 +from flax.plot_sync.delta import Delta, DeltaType, PathListDelta, PlotListDelta +from flax.protocols.harvester_protocol import Plot +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.ints import uint8, uint64 log = logging.getLogger(__name__) diff --git a/tests/plot_sync/test_plot_sync.py b/tests/plot_sync/test_plot_sync.py index 2bcaf985f..5eaae1a41 100644 --- a/tests/plot_sync/test_plot_sync.py +++ b/tests/plot_sync/test_plot_sync.py @@ -9,21 +9,21 @@ import pytest_asyncio from blspy import G1Element -from chia.farmer.farmer_api import Farmer -from chia.harvester.harvester_api import Harvester -from chia.plot_sync.delta import Delta, PathListDelta, PlotListDelta -from chia.plot_sync.receiver import Receiver -from chia.plot_sync.sender import Sender -from chia.plot_sync.util import Constants, State -from chia.plotting.manager import PlotManager -from chia.plotting.util import add_plot_directory, remove_plot_directory -from chia.protocols.harvester_protocol import Plot -from chia.server.start_service import Service -from chia.server.ws_connection import ProtocolMessageTypes -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.config import create_default_chia_config, lock_and_load_config, save_config -from chia.util.ints import uint8, uint64 -from chia.util.streamable import _T_Streamable +from flax.farmer.farmer_api import Farmer +from flax.harvester.harvester_api import Harvester +from flax.plot_sync.delta import Delta, PathListDelta, PlotListDelta +from flax.plot_sync.receiver import Receiver +from flax.plot_sync.sender import Sender +from flax.plot_sync.util import Constants, State +from flax.plotting.manager import PlotManager +from flax.plotting.util import add_plot_directory, remove_plot_directory +from flax.protocols.harvester_protocol import Plot +from flax.server.start_service import Service +from flax.server.ws_connection import ProtocolMessageTypes +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.config import create_default_flax_config, lock_and_load_config, save_config +from flax.util.ints import uint8, uint64 +from flax.util.streamable import _T_Streamable from tests.block_tools import BlockTools from tests.plot_sync.util import start_harvester_service from tests.plotting.test_plot_manager import MockPlotInfo, TestDirectory @@ -291,7 +291,7 @@ def new_test_dir(name: str, plot_list: List[Path]) -> TestDirectory: dir_invalid: TestDirectory = new_test_dir("invalid", plots_invalid) dir_keys_missing: TestDirectory = new_test_dir("keys_missing", plots_keys_missing) dir_duplicates: TestDirectory = new_test_dir("duplicates", directories[3].plots) - create_default_chia_config(tmp_path) + create_default_flax_config(tmp_path) # Invalidate the plots in `dir_invalid` for path in dir_invalid.path_list(): diff --git a/tests/plot_sync/test_receiver.py b/tests/plot_sync/test_receiver.py index 1eda3c17b..922b69bc4 100644 --- a/tests/plot_sync/test_receiver.py +++ b/tests/plot_sync/test_receiver.py @@ -8,10 +8,10 @@ import pytest from blspy import G1Element -from chia.plot_sync.delta import Delta -from chia.plot_sync.receiver import Receiver, Sync -from chia.plot_sync.util import ErrorCodes, State -from chia.protocols.harvester_protocol import ( +from flax.plot_sync.delta import Delta +from flax.plot_sync.receiver import Receiver, Sync +from flax.plot_sync.util import ErrorCodes, State +from flax.protocols.harvester_protocol import ( Plot, PlotSyncDone, PlotSyncIdentifier, @@ -20,11 +20,11 @@ PlotSyncResponse, PlotSyncStart, ) -from chia.server.ws_connection import NodeType -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.ints import uint8, uint32, uint64 -from chia.util.misc import get_list_or_len -from chia.util.streamable import _T_Streamable +from flax.server.ws_connection import NodeType +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.ints import uint8, uint32, uint64 +from flax.util.misc import get_list_or_len +from flax.util.streamable import _T_Streamable from tests.plot_sync.util import get_dummy_connection log = logging.getLogger(__name__) diff --git a/tests/plot_sync/test_sender.py b/tests/plot_sync/test_sender.py index db15ae7ab..06a6966b1 100644 --- a/tests/plot_sync/test_sender.py +++ b/tests/plot_sync/test_sender.py @@ -1,11 +1,11 @@ import pytest -from chia.plot_sync.exceptions import AlreadyStartedError, InvalidConnectionTypeError -from chia.plot_sync.sender import ExpectedResponse, Sender -from chia.plot_sync.util import Constants -from chia.protocols.harvester_protocol import PlotSyncIdentifier, PlotSyncResponse -from chia.server.ws_connection import NodeType, ProtocolMessageTypes -from chia.util.ints import int16, uint64 +from flax.plot_sync.exceptions import AlreadyStartedError, InvalidConnectionTypeError +from flax.plot_sync.sender import ExpectedResponse, Sender +from flax.plot_sync.util import Constants +from flax.protocols.harvester_protocol import PlotSyncIdentifier, PlotSyncResponse +from flax.server.ws_connection import NodeType, ProtocolMessageTypes +from flax.util.ints import int16, uint64 from tests.block_tools import BlockTools from tests.plot_sync.util import get_dummy_connection, plot_sync_identifier diff --git a/tests/plot_sync/test_sync_simulated.py b/tests/plot_sync/test_sync_simulated.py index a51296083..ab84adeb7 100644 --- a/tests/plot_sync/test_sync_simulated.py +++ b/tests/plot_sync/test_sync_simulated.py @@ -11,19 +11,19 @@ import pytest from blspy import G1Element -from chia.farmer.farmer_api import Farmer -from chia.harvester.harvester_api import Harvester -from chia.plot_sync.receiver import Receiver -from chia.plot_sync.sender import Sender -from chia.plot_sync.util import Constants -from chia.plotting.manager import PlotManager -from chia.plotting.util import PlotInfo -from chia.protocols.harvester_protocol import PlotSyncError, PlotSyncResponse -from chia.server.start_service import Service -from chia.server.ws_connection import ProtocolMessageTypes, WSChiaConnection, make_msg -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.generator_tools import list_to_batches -from chia.util.ints import int16, uint64 +from flax.farmer.farmer_api import Farmer +from flax.harvester.harvester_api import Harvester +from flax.plot_sync.receiver import Receiver +from flax.plot_sync.sender import Sender +from flax.plot_sync.util import Constants +from flax.plotting.manager import PlotManager +from flax.plotting.util import PlotInfo +from flax.protocols.harvester_protocol import PlotSyncError, PlotSyncResponse +from flax.server.start_service import Service +from flax.server.ws_connection import ProtocolMessageTypes, WSFlaxConnection, make_msg +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.generator_tools import list_to_batches +from flax.util.ints import int16, uint64 from tests.plot_sync.util import start_harvester_service from tests.time_out_assert import time_out_assert @@ -192,7 +192,7 @@ async def run( data.validate_plot_sync() -async def skip_processing(self: Any, _: WSChiaConnection, message_type: ProtocolMessageTypes, message: Any) -> bool: +async def skip_processing(self: Any, _: WSFlaxConnection, message_type: ProtocolMessageTypes, message: Any) -> bool: self.message_counter += 1 if self.simulate_error == ErrorSimulation.DropEveryFourthMessage: if self.message_counter % 4 == 0: @@ -226,7 +226,7 @@ async def skip_processing(self: Any, _: WSChiaConnection, message_type: Protocol async def _testable_process( - self: Any, peer: WSChiaConnection, message_type: ProtocolMessageTypes, message: Any + self: Any, peer: WSFlaxConnection, message_type: ProtocolMessageTypes, message: Any ) -> None: if await skip_processing(self, peer, message_type, message): return diff --git a/tests/plot_sync/util.py b/tests/plot_sync/util.py index 823616f50..ab31db354 100644 --- a/tests/plot_sync/util.py +++ b/tests/plot_sync/util.py @@ -3,18 +3,18 @@ from secrets import token_bytes from typing import Optional -from chia.harvester.harvester_api import Harvester -from chia.plot_sync.sender import Sender -from chia.protocols.harvester_protocol import PlotSyncIdentifier -from chia.server.start_service import Service -from chia.server.ws_connection import Message, NodeType -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.ints import uint64 +from flax.harvester.harvester_api import Harvester +from flax.plot_sync.sender import Sender +from flax.protocols.harvester_protocol import PlotSyncIdentifier +from flax.server.start_service import Service +from flax.server.ws_connection import Message, NodeType +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.ints import uint64 from tests.time_out_assert import time_out_assert @dataclass -class WSChiaConnectionDummy: +class WSFlaxConnectionDummy: connection_type: NodeType peer_node_id: bytes32 peer_host: str = "localhost" @@ -25,8 +25,8 @@ async def send_message(self, message: Message) -> None: self.last_sent_message = message -def get_dummy_connection(node_type: NodeType, peer_id: Optional[bytes32] = None) -> WSChiaConnectionDummy: - return WSChiaConnectionDummy(node_type, bytes32(token_bytes(32)) if peer_id is None else peer_id) +def get_dummy_connection(node_type: NodeType, peer_id: Optional[bytes32] = None) -> WSFlaxConnectionDummy: + return WSFlaxConnectionDummy(node_type, bytes32(token_bytes(32)) if peer_id is None else peer_id) def plot_sync_identifier(current_sync_id: uint64, message_id: uint64) -> PlotSyncIdentifier: diff --git a/tests/plotting/test_plot_manager.py b/tests/plotting/test_plot_manager.py index 692759c01..720e83a8f 100644 --- a/tests/plotting/test_plot_manager.py +++ b/tests/plotting/test_plot_manager.py @@ -9,8 +9,8 @@ import pytest from blspy import G1Element -from chia.plotting.manager import Cache, PlotManager -from chia.plotting.util import ( +from flax.plotting.manager import Cache, PlotManager +from flax.plotting.util import ( PlotInfo, PlotRefreshEvents, PlotRefreshResult, @@ -19,8 +19,8 @@ remove_plot, remove_plot_directory, ) -from chia.util.config import create_default_chia_config, lock_and_load_config, save_config -from chia.util.path import mkdir +from flax.util.config import create_default_flax_config, lock_and_load_config, save_config +from flax.util.path import mkdir from tests.block_tools import get_plot_dir from tests.plotting.util import get_test_plots from tests.time_out_assert import time_out_assert @@ -147,7 +147,7 @@ def test_plot_environment(tmp_path, bt) -> Iterator[TestEnvironment]: dir_1: TestDirectory = TestDirectory(tmp_path / "plots" / "1", plots[0:dir_1_count]) dir_2: TestDirectory = TestDirectory(tmp_path / "plots" / "2", plots[dir_1_count : dir_1_count + dir_2_count]) - create_default_chia_config(tmp_path) + create_default_flax_config(tmp_path) refresh_tester = PlotRefreshTester(tmp_path) refresh_tester.plot_manager.set_public_keys(bt.plot_manager.farmer_public_keys, bt.plot_manager.pool_public_keys) diff --git a/tests/pools/test_pool_cmdline.py b/tests/pools/test_pool_cmdline.py index 835ac4d95..c4e0c1b3c 100644 --- a/tests/pools/test_pool_cmdline.py +++ b/tests/pools/test_pool_cmdline.py @@ -4,8 +4,8 @@ import pytest from click.testing import CliRunner, Result -from chia.cmds.plotnft import validate_fee -from chia.cmds.plotnft import create_cmd, show_cmd +from flax.cmds.plotnft import validate_fee +from flax.cmds.plotnft import create_cmd, show_cmd pytestmark = pytest.mark.skip("TODO: Works locally but fails on CI, needs to be fixed!") diff --git a/tests/pools/test_pool_config.py b/tests/pools/test_pool_config.py index 798d6071f..f8677e96b 100644 --- a/tests/pools/test_pool_config.py +++ b/tests/pools/test_pool_config.py @@ -3,8 +3,8 @@ from blspy import AugSchemeMPL, PrivateKey -from chia.pools.pool_config import PoolWalletConfig -from chia.util.config import load_config, lock_config, save_config, create_default_chia_config +from flax.pools.pool_config import PoolWalletConfig +from flax.util.config import load_config, lock_config, save_config, create_default_flax_config def test_pool_config(): @@ -13,7 +13,7 @@ def test_pool_config(): eg_config = test_path / "config.yaml" to_config = test_path / "test_pool_config.yaml" - create_default_chia_config(test_root, ["config.yaml"]) + create_default_flax_config(test_root, ["config.yaml"]) assert eg_config.exists() eg_config.rename(to_config) config = load_config(test_root, "test_pool_config.yaml") diff --git a/tests/pools/test_pool_puzzles_lifecycle.py b/tests/pools/test_pool_puzzles_lifecycle.py index 80b19483b..7499a8d9e 100644 --- a/tests/pools/test_pool_puzzles_lifecycle.py +++ b/tests/pools/test_pool_puzzles_lifecycle.py @@ -5,23 +5,23 @@ from blspy import AugSchemeMPL, G1Element, G2Element, PrivateKey -from chia.types.blockchain_format.program import Program -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.blockchain_format.coin import Coin -from chia.types.coin_spend import CoinSpend -from chia.types.spend_bundle import SpendBundle -from chia.util.ints import uint64, uint32 -from chia.consensus.default_constants import DEFAULT_CONSTANTS -from chia.wallet.puzzles.p2_delegated_puzzle_or_hidden_puzzle import ( +from flax.types.blockchain_format.program import Program +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.blockchain_format.coin import Coin +from flax.types.coin_spend import CoinSpend +from flax.types.spend_bundle import SpendBundle +from flax.util.ints import uint64, uint32 +from flax.consensus.default_constants import DEFAULT_CONSTANTS +from flax.wallet.puzzles.p2_delegated_puzzle_or_hidden_puzzle import ( puzzle_for_pk, solution_for_conditions, calculate_synthetic_secret_key, DEFAULT_HIDDEN_PUZZLE_HASH, ) -from chia.wallet.puzzles.p2_conditions import puzzle_for_conditions -from chia.wallet.puzzles import singleton_top_layer -from chia.pools.pool_wallet_info import PoolState -from chia.pools.pool_puzzles import ( +from flax.wallet.puzzles.p2_conditions import puzzle_for_conditions +from flax.wallet.puzzles import singleton_top_layer +from flax.pools.pool_wallet_info import PoolState +from flax.pools.pool_puzzles import ( create_waiting_room_inner_puzzle, create_pooling_inner_puzzle, create_p2_singleton_puzzle, @@ -47,9 +47,9 @@ """ This test suite aims to test: - - chia.pools.pool_puzzles.py - - chia.wallet.puzzles.pool_member_innerpuz.clvm - - chia.wallet.puzzles.pool_waiting_room_innerpuz.clvm + - flax.pools.pool_puzzles.py + - flax.wallet.puzzles.pool_member_innerpuz.clvm + - flax.wallet.puzzles.pool_waiting_room_innerpuz.clvm """ diff --git a/tests/pools/test_pool_rpc.py b/tests/pools/test_pool_rpc.py index e438310e1..a86100ad3 100644 --- a/tests/pools/test_pool_rpc.py +++ b/tests/pools/test_pool_rpc.py @@ -10,26 +10,26 @@ import pytest_asyncio from blspy import G1Element -from chia.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward -from chia.full_node.full_node_api import FullNodeAPI -from chia.pools.pool_puzzles import SINGLETON_LAUNCHER_HASH -from chia.pools.pool_wallet_info import PoolSingletonState, PoolWalletInfo -from chia.protocols import full_node_protocol -from chia.protocols.full_node_protocol import RespondBlock -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, ReorgProtocol -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.peer_info import PeerInfo -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.ints import uint16, uint32 -from chia.wallet.derive_keys import find_authentication_sk, find_owner_sk -from chia.wallet.transaction_record import TransactionRecord -from chia.wallet.util.wallet_types import WalletType -from chia.wallet.wallet_node import WalletNode +from flax.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward +from flax.full_node.full_node_api import FullNodeAPI +from flax.pools.pool_puzzles import SINGLETON_LAUNCHER_HASH +from flax.pools.pool_wallet_info import PoolSingletonState, PoolWalletInfo +from flax.protocols import full_node_protocol +from flax.protocols.full_node_protocol import RespondBlock +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, ReorgProtocol +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.peer_info import PeerInfo +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.ints import uint16, uint32 +from flax.wallet.derive_keys import find_authentication_sk, find_owner_sk +from flax.wallet.transaction_record import TransactionRecord +from flax.wallet.util.wallet_types import WalletType +from flax.wallet.wallet_node import WalletNode from tests.block_tools import BlockTools, get_plot_dir from tests.setup_nodes import setup_simulators_and_wallets from tests.time_out_assert import time_out_assert @@ -523,7 +523,7 @@ async def test_absorb_self(self, one_wallet_node_and_rpc, trusted_and_fee, bt, s assert len(await wallet_node_0.wallet_state_manager.tx_store.get_unconfirmed_for_wallet(2)) == 0 tr: TransactionRecord = await client.send_transaction( - 1, 100, encode_puzzle_hash(status.p2_singleton_puzzle_hash, "txch") + 1, 100, encode_puzzle_hash(status.p2_singleton_puzzle_hash, "txfx") ) await time_out_assert( @@ -656,7 +656,7 @@ async def test_absorb_pooling(self, one_wallet_node_and_rpc, trusted_and_fee, bt await time_out_assert(20, wallet_is_synced, True, wallet_node_0, full_node_api) our_ph = await wallet_0.get_new_puzzlehash() assert len(await client.get_wallets(WalletType.POOLING_WALLET)) == 0 - # Balance stars at 6 XCH + # Balance stars at 6 XFX assert (await wallet_0.get_confirmed_balance()) == 6000000000000 creation_tx: TransactionRecord = await client.create_new_pool_wallet( our_ph, "http://123.45.67.89", 10, f"{self_hostname}:5000", "new", "FARMING_TO_POOL", fee @@ -733,7 +733,7 @@ async def test_absorb_pooling(self, one_wallet_node_and_rpc, trusted_and_fee, bt wallet_node_0.wallet_state_manager.blockchain.get_peak_height() == full_node_api.full_node.blockchain.get_peak().height ) - # Balance stars at 6 XCH and 5 more blocks are farmed, total 22 XCH + # Balance stars at 6 XFX and 5 more blocks are farmed, total 22 XFX assert (await wallet_0.get_confirmed_balance()) == 21999999999999 num_trials = 3 @@ -929,11 +929,11 @@ async def test_leave_pool(self, setup, trusted_and_fee, self_hostname): try: assert len(await client.get_wallets(WalletType.POOLING_WALLET)) == 0 - async def have_chia(): + async def have_flax(): await farm_blocks(full_node_api, our_ph, 1) return (await wallets[0].get_confirmed_balance()) > 0 - await time_out_assert(timeout=MAX_WAIT_SECS, function=have_chia) + await time_out_assert(timeout=MAX_WAIT_SECS, function=have_flax) await time_out_assert(20, wallet_is_synced, True, wallet_nodes[0], full_node_api) creation_tx: TransactionRecord = await client.create_new_pool_wallet( @@ -1048,11 +1048,11 @@ async def test_change_pools(self, setup, trusted_and_fee, self_hostname): try: assert len(await client.get_wallets(WalletType.POOLING_WALLET)) == 0 - async def have_chia(): + async def have_flax(): await farm_blocks(full_node_api, our_ph, 1) return (await wallets[0].get_confirmed_balance()) > 0 - await time_out_assert(timeout=WAIT_SECS, function=have_chia) + await time_out_assert(timeout=WAIT_SECS, function=have_flax) await time_out_assert(20, wallet_is_synced, True, wallet_nodes[0], full_node_api) creation_tx: TransactionRecord = await client.create_new_pool_wallet( @@ -1147,11 +1147,11 @@ async def test_change_pools_reorg(self, setup, trusted_and_fee, bt, self_hostnam try: assert len(await client.get_wallets(WalletType.POOLING_WALLET)) == 0 - async def have_chia(): + async def have_flax(): await farm_blocks(full_node_api, our_ph, 1) return (await wallets[0].get_confirmed_balance()) > 0 - await time_out_assert(timeout=WAIT_SECS, function=have_chia) + await time_out_assert(timeout=WAIT_SECS, function=have_flax) await time_out_assert(20, wallet_is_synced, True, wallet_nodes[0], full_node_api) creation_tx: TransactionRecord = await client.create_new_pool_wallet( diff --git a/tests/pools/test_pool_wallet.py b/tests/pools/test_pool_wallet.py index 810eb6145..3948dd7b8 100644 --- a/tests/pools/test_pool_wallet.py +++ b/tests/pools/test_pool_wallet.py @@ -7,8 +7,8 @@ from blspy import G1Element from benchmarks.utils import rand_g1, rand_hash -from chia.pools.pool_wallet import PoolWallet -from chia.types.blockchain_format.sized_bytes import bytes32 +from flax.pools.pool_wallet import PoolWallet +from flax.types.blockchain_format.sized_bytes import bytes32 @dataclass @@ -76,7 +76,7 @@ async def test_update_pool_config_new_config(monkeypatch: Any) -> None: def mock_load_pool_config(root_path: Path) -> List[MockPoolWalletConfig]: return [] - monkeypatch.setattr("chia.pools.pool_wallet.load_pool_config", mock_load_pool_config) + monkeypatch.setattr("flax.pools.pool_wallet.load_pool_config", mock_load_pool_config) # Mock pool_config.update_pool_config to capture the updated configs async def mock_pool_config_update_pool_config( @@ -85,7 +85,7 @@ async def mock_pool_config_update_pool_config( nonlocal updated_configs updated_configs = pool_config_list - monkeypatch.setattr("chia.pools.pool_wallet.update_pool_config", mock_pool_config_update_pool_config) + monkeypatch.setattr("flax.pools.pool_wallet.update_pool_config", mock_pool_config_update_pool_config) # Mock PoolWallet.get_current_state to return our canned state async def mock_get_current_state(self: Any) -> Any: @@ -159,7 +159,7 @@ def mock_load_pool_config(root_path: Path) -> List[MockPoolWalletConfig]: nonlocal existing_config return [existing_config] - monkeypatch.setattr("chia.pools.pool_wallet.load_pool_config", mock_load_pool_config) + monkeypatch.setattr("flax.pools.pool_wallet.load_pool_config", mock_load_pool_config) # Mock pool_config.update_pool_config to capture the updated configs async def mock_pool_config_update_pool_config( @@ -168,7 +168,7 @@ async def mock_pool_config_update_pool_config( nonlocal updated_configs updated_configs = pool_config_list - monkeypatch.setattr("chia.pools.pool_wallet.update_pool_config", mock_pool_config_update_pool_config) + monkeypatch.setattr("flax.pools.pool_wallet.update_pool_config", mock_pool_config_update_pool_config) # Mock PoolWallet.get_current_state to return our canned state async def mock_get_current_state(self: Any) -> Any: diff --git a/tests/pools/test_wallet_pool_store.py b/tests/pools/test_wallet_pool_store.py index 27c3152a2..70cb02e8e 100644 --- a/tests/pools/test_wallet_pool_store.py +++ b/tests/pools/test_wallet_pool_store.py @@ -6,14 +6,14 @@ import pytest from clvm_tools import binutils -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.coin_spend import CoinSpend -from chia.util.db_wrapper import DBWrapper -from chia.util.ints import uint64 - -from chia.wallet.wallet_pool_store import WalletPoolStore +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.coin_spend import CoinSpend +from flax.util.db_wrapper import DBWrapper +from flax.util.ints import uint64 + +from flax.wallet.wallet_pool_store import WalletPoolStore def make_child_solution(coin_spend: CoinSpend, new_coin: Optional[Coin] = None) -> CoinSpend: diff --git a/tests/runner_templates/build-test-macos b/tests/runner_templates/build-test-macos index 26a039fd0..18f434210 100644 --- a/tests/runner_templates/build-test-macos +++ b/tests/runner_templates/build-test-macos @@ -1,5 +1,5 @@ # -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme +# THIS FILE IS GENERATED. SEE https://github.com/Flax-Network/flax-blockchain/tree/main/tests#readme # name: MacOS TEST_NAME Test @@ -32,7 +32,7 @@ jobs: python-version: ['3.9', '3.10'] os: [macOS-latest] env: - CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet + FLAX_ROOT: ${{ github.workspace }}/.flax/mainnet JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_TEST_NAME steps: @@ -48,10 +48,10 @@ jobs: - name: Create keychain for CI use run: | - security create-keychain -p foo chiachain - security default-keychain -s chiachain - security unlock-keychain -p foo chiachain - security set-keychain-settings -t 7200 -u chiachain + security create-keychain -p foo flaxfxain + security default-keychain -s flaxfxain + security unlock-keychain -p foo flaxfxain + security set-keychain-settings -t 7200 -u flaxfxain - name: Get pip cache dir id: pip-cache @@ -99,5 +99,5 @@ INSTALL_TIMELORD path: coverage_reports/* if-no-files-found: error # -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme +# THIS FILE IS GENERATED. SEE https://github.com/Flax-Network/flax-blockchain/tree/main/tests#readme # diff --git a/tests/runner_templates/build-test-ubuntu b/tests/runner_templates/build-test-ubuntu index 4e245cf36..e151fa82d 100644 --- a/tests/runner_templates/build-test-ubuntu +++ b/tests/runner_templates/build-test-ubuntu @@ -1,5 +1,5 @@ # -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme +# THIS FILE IS GENERATED. SEE https://github.com/Flax-Network/flax-blockchain/tree/main/tests#readme # name: Ubuntu TEST_NAME Test @@ -32,7 +32,7 @@ jobs: python-version: ['3.7', '3.8', '3.9', '3.10'] os: [ubuntu-latest] env: - CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet + FLAX_ROOT: ${{ github.workspace }}/.flax/mainnet JOB_FILE_NAME: tests_${{ matrix.os }}_python-${{ matrix.python-version }}_TEST_NAME steps: @@ -101,5 +101,5 @@ INSTALL_TIMELORD CHECK_RESOURCE_USAGE # -# THIS FILE IS GENERATED. SEE https://github.com/Chia-Network/chia-blockchain/tree/main/tests#readme +# THIS FILE IS GENERATED. SEE https://github.com/Flax-Network/flax-blockchain/tree/main/tests#readme # diff --git a/tests/runner_templates/checkout-test-plots.include.yml b/tests/runner_templates/checkout-test-plots.include.yml index af48e1a22..541a8d8d8 100644 --- a/tests/runner_templates/checkout-test-plots.include.yml +++ b/tests/runner_templates/checkout-test-plots.include.yml @@ -3,13 +3,13 @@ id: test-blocks-plots with: path: | - ${{ github.workspace }}/.chia/blocks - ${{ github.workspace }}/.chia/test-plots + ${{ github.workspace }}/.flax/blocks + ${{ github.workspace }}/.flax/test-plots key: 0.29.0 - name: Checkout test blocks and plots if: steps.test-blocks-plots.outputs.cache-hit != 'true' run: | - wget -qO- https://github.com/Chia-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf - - mkdir ${{ github.workspace }}/.chia - mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.chia + wget -qO- https://github.com/Flax-Network/test-cache/archive/refs/tags/0.29.0.tar.gz | tar xzf - + mkdir ${{ github.workspace }}/.flax + mv ${{ github.workspace }}/test-cache-0.29.0/* ${{ github.workspace }}/.flax diff --git a/tests/setup_nodes.py b/tests/setup_nodes.py index 6d1be9747..72831fc7e 100644 --- a/tests/setup_nodes.py +++ b/tests/setup_nodes.py @@ -3,11 +3,11 @@ from typing import AsyncIterator, Dict, List, Tuple, Optional from pathlib import Path -from chia.consensus.constants import ConsensusConstants -from chia.full_node.full_node_api import FullNodeAPI -from chia.server.start_service import Service -from chia.util.hash import std_hash -from chia.util.ints import uint16, uint32 +from flax.consensus.constants import ConsensusConstants +from flax.full_node.full_node_api import FullNodeAPI +from flax.server.start_service import Service +from flax.util.hash import std_hash +from flax.util.ints import uint16, uint32 from tests.block_tools import BlockTools, create_block_tools_async, test_constants from tests.setup_services import ( setup_daemon, diff --git a/tests/setup_services.py b/tests/setup_services.py index 9dd60d135..b1562baf9 100644 --- a/tests/setup_services.py +++ b/tests/setup_services.py @@ -6,22 +6,22 @@ from secrets import token_bytes from typing import AsyncGenerator, Optional -from chia.cmds.init_funcs import init -from chia.consensus.constants import ConsensusConstants -from chia.daemon.server import WebSocketServer, daemon_launch_lock_path, singleton -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.util.bech32m import encode_puzzle_hash -from chia.util.config import lock_and_load_config, save_config -from chia.util.ints import uint16 -from chia.util.keychain import bytes_to_mnemonic +from flax.cmds.init_funcs import init +from flax.consensus.constants import ConsensusConstants +from flax.daemon.server import WebSocketServer, daemon_launch_lock_path, singleton +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.util.bech32m import encode_puzzle_hash +from flax.util.config import lock_and_load_config, save_config +from flax.util.ints import uint16 +from flax.util.keychain import bytes_to_mnemonic from tests.block_tools import BlockTools from tests.util.keyring import TempKeyring @@ -238,11 +238,11 @@ async def setup_farmer( config = root_config["farmer"] config_pool = root_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["rpc_port"] = uint16(0) - 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 ad999960d..ddbaa47a5 100644 --- a/tests/simulation/test_simulation.py +++ b/tests/simulation/test_simulation.py @@ -1,9 +1,9 @@ import pytest import pytest_asyncio -from chia.types.peer_info import PeerInfo +from flax.types.peer_info import PeerInfo from tests.block_tools import create_block_tools_async -from chia.util.ints import uint16 +from flax.util.ints import uint16 from tests.core.node_height import node_height_at_least from tests.setup_nodes import 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 b0c57c1c1..48ee9242b 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/tools/test_run_block.py b/tests/tools/test_run_block.py index 140f9c952..dbbc000bd 100644 --- a/tests/tools/test_run_block.py +++ b/tests/tools/test_run_block.py @@ -2,9 +2,9 @@ from pathlib import Path from typing import List -from chia.consensus.default_constants import DEFAULT_CONSTANTS -from chia.types.condition_opcodes import ConditionOpcode -from chia.types.condition_with_args import ConditionWithArgs +from flax.consensus.default_constants import DEFAULT_CONSTANTS +from flax.types.condition_opcodes import ConditionOpcode +from flax.types.condition_with_args import ConditionWithArgs from tools.run_block import run_json_block testnet10 = { diff --git a/tests/util/alert_server.py b/tests/util/alert_server.py index 4f0f2d7ad..aa9c62446 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 417467917..5a704e35c 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 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 tests.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.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/blockchain.py b/tests/util/blockchain.py index ed1a628ab..8ec6a99bc 100644 --- a/tests/util/blockchain.py +++ b/tests/util/blockchain.py @@ -6,15 +6,15 @@ import aiosqlite import tempfile -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.full_node.hint_store import HintStore -from chia.types.full_block import FullBlock -from chia.util.db_wrapper import DBWrapper2 -from chia.util.default_root import DEFAULT_ROOT_PATH -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.full_node.hint_store import HintStore +from flax.types.full_block import FullBlock +from flax.util.db_wrapper import DBWrapper2 +from flax.util.default_root import DEFAULT_ROOT_PATH +from flax.util.path import mkdir from tests.block_tools import BlockTools diff --git a/tests/util/build_network_protocol_files.py b/tests/util/build_network_protocol_files.py index ad73d254c..5699716c4 100644 --- a/tests/util/build_network_protocol_files.py +++ b/tests/util/build_network_protocol_files.py @@ -2,9 +2,9 @@ import os from pathlib import Path -from chia.util.streamable import Streamable, streamable +from flax.util.streamable import Streamable, streamable from tests.util.network_protocol_data import * -from chia.util.ints import uint32 +from flax.util.ints import uint32 version = "1.0" diff --git a/tests/util/db_connection.py b/tests/util/db_connection.py index 110ba2749..fd8a82693 100644 --- a/tests/util/db_connection.py +++ b/tests/util/db_connection.py @@ -1,5 +1,5 @@ from pathlib import Path -from chia.util.db_wrapper import DBWrapper2 +from flax.util.db_wrapper import DBWrapper2 import tempfile import aiosqlite diff --git a/tests/util/gen_ssl_certs.py b/tests/util/gen_ssl_certs.py index 753114414..f80a249bb 100644 --- a/tests/util/gen_ssl_certs.py +++ b/tests/util/gen_ssl_certs.py @@ -4,7 +4,7 @@ import click from pytest import MonkeyPatch -from chia.ssl.create_ssl import generate_ca_signed_cert, get_chia_ca_crt_key, make_ca_cert +from flax.ssl.create_ssl import generate_ca_signed_cert, get_flax_ca_crt_key, make_ca_cert # NOTE: This is a standalone tool that can be used to generate a CA cert/key as well as node certs/keys. @@ -35,7 +35,7 @@ def patched_write_ssl_cert_and_key(cert_path: Path, cert_data: bytes, key_path: print() patch = MonkeyPatch() - patch.setattr("chia.ssl.create_ssl.write_ssl_cert_and_key", patched_write_ssl_cert_and_key) + patch.setattr("flax.ssl.create_ssl.write_ssl_cert_and_key", patched_write_ssl_cert_and_key) private_ca_crt: Optional[bytes] = None private_ca_key: Optional[bytes] = None @@ -75,14 +75,14 @@ def patched_write_ssl_cert_and_key(cert_path: Path, cert_data: bytes, key_path: }, } - chia_ca_crt, chia_ca_key = get_chia_ca_crt_key() + flax_ca_crt, flax_ca_key = get_flax_ca_crt_key() for node_name, cert_type_dict in node_certs_and_keys.items(): for cert_type, cert_dict in cert_type_dict.items(): crt = cert_dict["crt"] key = cert_dict["key"] - ca_crt = chia_ca_crt if cert_type == "public" else private_ca_crt - ca_key = chia_ca_key if cert_type == "public" else private_ca_key + ca_crt = flax_ca_crt if cert_type == "public" else private_ca_crt + ca_key = flax_ca_key if cert_type == "public" else private_ca_key generate_ca_signed_cert(ca_crt, ca_key, Path(crt), Path(key)) diff --git a/tests/util/generator_tools_testing.py b/tests/util/generator_tools_testing.py index a4eefdf51..b3f39db2f 100644 --- a/tests/util/generator_tools_testing.py +++ b/tests/util/generator_tools_testing.py @@ -1,12 +1,12 @@ 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 tx_removals_and_additions -from chia.util.ints import uint32 +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 tx_removals_and_additions +from flax.util.ints import uint32 def run_and_get_removals_and_additions( diff --git a/tests/util/key_tool.py b/tests/util/key_tool.py index 8b74ff6ef..5574ba204 100644 --- a/tests/util/key_tool.py +++ b/tests/util/key_tool.py @@ -2,8 +2,8 @@ from blspy import AugSchemeMPL, G2Element, PrivateKey -from chia.types.coin_spend import CoinSpend -from chia.util.condition_tools import conditions_by_opcode, conditions_for_solution, pkm_pairs_for_conditions_dict +from flax.types.coin_spend import CoinSpend +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 tests.block_tools import test_constants diff --git a/tests/util/keyring.py b/tests/util/keyring.py index 3321d45e6..a65b3e6f4 100644 --- a/tests/util/keyring.py +++ b/tests/util/keyring.py @@ -2,9 +2,9 @@ import shutil import tempfile -from chia.util.file_keyring import FileKeyring -from chia.util.keychain import Keychain, default_keychain_service, default_keychain_user, get_private_key_user -from chia.util.keyring_wrapper import KeyringWrapper +from flax.util.file_keyring import FileKeyring +from flax.util.keychain import Keychain, default_keychain_service, default_keychain_user, get_private_key_user +from flax.util.keyring_wrapper import KeyringWrapper from functools import wraps from keyring.util import platform_ from keyrings.cryptfile.cryptfile import CryptFileKeyring # pyright: reportMissingImports=false @@ -100,7 +100,7 @@ def __init__( self, *, user: str = "testing-1.8.0", - service: str = "testing-chia-1.8.0", + service: str = "testing-flax-1.8.0", populate: bool = False, setup_cryptfilekeyring: bool = False, existing_keyring_path: str = None, @@ -132,13 +132,13 @@ def _patch_and_create_keychain( existing_keyring_dir = Path(existing_keyring_path).parent if existing_keyring_path else None temp_dir = existing_keyring_dir or tempfile.mkdtemp(prefix="test_keyring_wrapper") - mock_supports_keyring_passphrase_patch = patch("chia.util.keychain.supports_keyring_passphrase") + mock_supports_keyring_passphrase_patch = patch("flax.util.keychain.supports_keyring_passphrase") mock_supports_keyring_passphrase = mock_supports_keyring_passphrase_patch.start() # Patch supports_keyring_passphrase() to return True mock_supports_keyring_passphrase.return_value = True - mock_supports_os_passphrase_storage_patch = patch("chia.util.keychain.supports_os_passphrase_storage") + mock_supports_os_passphrase_storage_patch = patch("flax.util.keychain.supports_os_passphrase_storage") mock_supports_os_passphrase_storage = mock_supports_os_passphrase_storage_patch.start() # Patch supports_os_passphrase_storage() to return use_os_credential_store diff --git a/tests/util/misc.py b/tests/util/misc.py index 42cd20db7..a4e886261 100644 --- a/tests/util/misc.py +++ b/tests/util/misc.py @@ -205,7 +205,7 @@ class _AssertRuntime: Produces output of the following form. Asserting maximum duration: full block - /home/altendky/repos/chia-blockchain/tests/core/full_node/test_performance.py:187 + /home/altendky/repos/flax-blockchain/tests/core/full_node/test_performance.py:187 run time: 0.027789528900002837 allowed: 0.1 percent: 28 % diff --git a/tests/util/network_protocol_data.py b/tests/util/network_protocol_data.py index 0de8ddf76..585eeed15 100644 --- a/tests/util/network_protocol_data.py +++ b/tests/util/network_protocol_data.py @@ -1,33 +1,33 @@ # flake8: noqa -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.ints import uint8, uint16, uint32, uint64, uint128 -from chia.types.blockchain_format.proof_of_space import ProofOfSpace -from chia.types.blockchain_format.pool_target import PoolTarget -from chia.types.coin_spend import CoinSpend -from chia.types.blockchain_format.coin import Coin -from chia.types.spend_bundle import SpendBundle -from chia.types.blockchain_format.program import Program, SerializedProgram -from chia.types.blockchain_format.sub_epoch_summary import SubEpochSummary -from chia.types.weight_proof import WeightProof, SubEpochData, SubEpochChallengeSegment, SubSlotData, RecentChainData -from chia.types.blockchain_format.vdf import VDFInfo, VDFProof -from chia.types.blockchain_format.classgroup import ClassgroupElement +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.ints import uint8, uint16, uint32, uint64, uint128 +from flax.types.blockchain_format.proof_of_space import ProofOfSpace +from flax.types.blockchain_format.pool_target import PoolTarget +from flax.types.coin_spend import CoinSpend +from flax.types.blockchain_format.coin import Coin +from flax.types.spend_bundle import SpendBundle +from flax.types.blockchain_format.program import Program, SerializedProgram +from flax.types.blockchain_format.sub_epoch_summary import SubEpochSummary +from flax.types.weight_proof import WeightProof, SubEpochData, SubEpochChallengeSegment, SubSlotData, RecentChainData +from flax.types.blockchain_format.vdf import VDFInfo, VDFProof +from flax.types.blockchain_format.classgroup import ClassgroupElement from blspy import G1Element, G2Element -from chia.types.header_block import HeaderBlock -from chia.types.full_block import FullBlock -from chia.types.unfinished_block import UnfinishedBlock -from chia.types.blockchain_format.slots import ( +from flax.types.header_block import HeaderBlock +from flax.types.full_block import FullBlock +from flax.types.unfinished_block import UnfinishedBlock +from flax.types.blockchain_format.slots import ( ChallengeChainSubSlot, InfusedChallengeChainSubSlot, RewardChainSubSlot, SubSlotProofs, ) -from chia.types.end_of_slot_bundle import EndOfSubSlotBundle -from chia.types.peer_info import TimestampedPeerInfo -from chia.types.blockchain_format.reward_chain_block import RewardChainBlock -from chia.types.blockchain_format.foliage import Foliage, FoliageTransactionBlock, FoliageBlockData, TransactionsInfo +from flax.types.end_of_slot_bundle import EndOfSubSlotBundle +from flax.types.peer_info import TimestampedPeerInfo +from flax.types.blockchain_format.reward_chain_block import RewardChainBlock +from flax.types.blockchain_format.foliage import Foliage, FoliageTransactionBlock, FoliageBlockData, TransactionsInfo -from chia.protocols import ( +from flax.protocols import ( farmer_protocol, full_node_protocol, harvester_protocol, diff --git a/tests/util/test_chunks.py b/tests/util/test_chunks.py index 2c4383ab3..c684b1288 100644 --- a/tests/util/test_chunks.py +++ b/tests/util/test_chunks.py @@ -1,4 +1,4 @@ -from chia.util.chunks import chunks +from flax.util.chunks import chunks def test_chunks() -> None: diff --git a/tests/util/test_full_block_utils.py b/tests/util/test_full_block_utils.py index 0a87b7f22..f88bc1727 100644 --- a/tests/util/test_full_block_utils.py +++ b/tests/util/test_full_block_utils.py @@ -4,21 +4,21 @@ import pytest from benchmarks.utils import rand_bytes, rand_g1, rand_g2, rand_hash, rand_vdf, rand_vdf_proof, rewards -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.program import SerializedProgram -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.slots import ( +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.program import SerializedProgram +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.slots import ( ChallengeChainSubSlot, InfusedChallengeChainSubSlot, RewardChainSubSlot, SubSlotProofs, ) -from chia.types.end_of_slot_bundle import EndOfSubSlotBundle -from chia.types.full_block import FullBlock -from chia.util.full_block_utils import generator_from_block -from chia.util.ints import uint8, uint32, uint64, uint128 +from flax.types.end_of_slot_bundle import EndOfSubSlotBundle +from flax.types.full_block import FullBlock +from flax.util.full_block_utils import generator_from_block +from flax.util.ints import uint8, uint32, uint64, uint128 test_g2s = [rand_g2() for _ in range(10)] test_g1s = [rand_g1() for _ in range(10)] diff --git a/tests/util/test_lock_queue.py b/tests/util/test_lock_queue.py index e725b7507..fc42a0cbb 100644 --- a/tests/util/test_lock_queue.py +++ b/tests/util/test_lock_queue.py @@ -5,7 +5,7 @@ import pytest -from chia.full_node.lock_queue import LockQueue, LockClient +from flax.full_node.lock_queue import LockQueue, LockClient log = logging.getLogger(__name__) diff --git a/tests/util/test_misc.py b/tests/util/test_misc.py index 3601abbe3..357aad02d 100644 --- a/tests/util/test_misc.py +++ b/tests/util/test_misc.py @@ -1,6 +1,6 @@ import pytest -from chia.util.misc import format_bytes -from chia.util.misc import format_minutes +from flax.util.misc import format_bytes +from flax.util.misc import format_minutes class TestMisc: diff --git a/tests/util/test_network.py b/tests/util/test_network.py index d09862870..b37a08f65 100644 --- a/tests/util/test_network.py +++ b/tests/util/test_network.py @@ -2,7 +2,7 @@ import sys import pytest -from chia.util.network import get_host_addr +from flax.util.network import get_host_addr class TestNetwork: diff --git a/tests/util/test_network_protocol_files.py b/tests/util/test_network_protocol_files.py index df2d25cb1..a94a96806 100644 --- a/tests/util/test_network_protocol_files.py +++ b/tests/util/test_network_protocol_files.py @@ -4,7 +4,7 @@ import os import pytest from tests.util.build_network_protocol_files import get_network_protocol_filename -from chia.protocols import ( +from flax.protocols import ( farmer_protocol, full_node_protocol, harvester_protocol, diff --git a/tests/util/test_paginator.py b/tests/util/test_paginator.py index 9ffb4814e..13dd08193 100644 --- a/tests/util/test_paginator.py +++ b/tests/util/test_paginator.py @@ -3,7 +3,7 @@ import pytest -from chia.util.paginator import InvalidPageSizeError, InvalidPageSizeLimit, PageOutOfBoundsError, Paginator +from flax.util.paginator import InvalidPageSizeError, InvalidPageSizeLimit, PageOutOfBoundsError, Paginator @pytest.mark.parametrize( diff --git a/tests/util/test_struct_stream.py b/tests/util/test_struct_stream.py index 7ae56d862..d3f2997f9 100644 --- a/tests/util/test_struct_stream.py +++ b/tests/util/test_struct_stream.py @@ -15,8 +15,8 @@ from _pytest.fixtures import SubRequest from typing_extensions import final -from chia.util.ints import int8, uint8, int16, uint16, int32, uint32, int64, uint64, uint128, int512 -from chia.util.struct_stream import StructStream, parse_metadata_from_name +from flax.util.ints import int8, uint8, int16, uint16, int32, uint32, int64, uint64, uint128, int512 +from flax.util.struct_stream import StructStream, parse_metadata_from_name def dataclass_parameter(instance: object) -> ParameterSet: diff --git a/tests/wallet/cat_wallet/test_cat_lifecycle.py b/tests/wallet/cat_wallet/test_cat_lifecycle.py index c56a6d95a..7aa9fb527 100644 --- a/tests/wallet/cat_wallet/test_cat_lifecycle.py +++ b/tests/wallet/cat_wallet/test_cat_lifecycle.py @@ -4,23 +4,23 @@ from blspy import PrivateKey, AugSchemeMPL, G2Element from clvm.casts import int_to_bytes -from chia.clvm.spend_sim import SpendSim, SimClient -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_spend import CoinSpend -from chia.types.mempool_inclusion_status import MempoolInclusionStatus -from chia.types.spend_bundle import SpendBundle -from chia.util.errors import Err -from chia.util.ints import uint64 -from chia.wallet.cat_wallet.cat_utils import ( +from flax.clvm.spend_sim import SpendSim, SimClient +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_spend import CoinSpend +from flax.types.mempool_inclusion_status import MempoolInclusionStatus +from flax.types.spend_bundle import SpendBundle +from flax.util.errors import Err +from flax.util.ints import uint64 +from flax.wallet.cat_wallet.cat_utils import ( CAT_MOD, SpendableCAT, construct_cat_puzzle, unsigned_spend_bundle_for_spendable_cats, ) -from chia.wallet.lineage_proof import LineageProof -from chia.wallet.puzzles.tails import ( +from flax.wallet.lineage_proof import LineageProof +from flax.wallet.puzzles.tails import ( GenesisById, GenesisByPuzhash, EverythingWithSig, diff --git a/tests/wallet/cat_wallet/test_cat_outer_puzzle.py b/tests/wallet/cat_wallet/test_cat_outer_puzzle.py index 4e76572a6..9446b1450 100644 --- a/tests/wallet/cat_wallet/test_cat_outer_puzzle.py +++ b/tests/wallet/cat_wallet/test_cat_outer_puzzle.py @@ -2,13 +2,13 @@ from clvm_tools.binutils import disassemble -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_spend import CoinSpend -from chia.util.ints import uint64 -from chia.wallet.cat_wallet.cat_utils import CAT_MOD, construct_cat_puzzle -from chia.wallet.outer_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_spend import CoinSpend +from flax.util.ints import uint64 +from flax.wallet.cat_wallet.cat_utils import CAT_MOD, construct_cat_puzzle +from flax.wallet.outer_puzzles import ( construct_puzzle, create_asset_id, get_inner_puzzle, @@ -16,7 +16,7 @@ match_puzzle, solve_puzzle, ) -from chia.wallet.puzzle_drivers import PuzzleInfo, Solver +from flax.wallet.puzzle_drivers import PuzzleInfo, Solver def test_cat_outer_puzzle() -> None: diff --git a/tests/wallet/cat_wallet/test_cat_wallet.py b/tests/wallet/cat_wallet/test_cat_wallet.py index bfde40d42..4eb52473b 100644 --- a/tests/wallet/cat_wallet/test_cat_wallet.py +++ b/tests/wallet/cat_wallet/test_cat_wallet.py @@ -3,20 +3,20 @@ 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.cat_wallet.cat_constants import DEFAULT_CATS -from chia.wallet.cat_wallet.cat_info import LegacyCATInfo -from chia.wallet.cat_wallet.cat_utils import construct_cat_puzzle -from chia.wallet.cat_wallet.cat_wallet import CATWallet -from chia.wallet.puzzles.cat_loader import CAT_MOD -from chia.wallet.transaction_record import TransactionRecord -from chia.wallet.wallet_info import WalletInfo +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.cat_wallet.cat_constants import DEFAULT_CATS +from flax.wallet.cat_wallet.cat_info import LegacyCATInfo +from flax.wallet.cat_wallet.cat_utils import construct_cat_puzzle +from flax.wallet.cat_wallet.cat_wallet import CATWallet +from flax.wallet.puzzles.cat_loader import CAT_MOD +from flax.wallet.transaction_record import TransactionRecord +from flax.wallet.wallet_info import WalletInfo from tests.pools.test_pool_rpc import wallet_is_synced from tests.time_out_assert import time_out_assert diff --git a/tests/wallet/cat_wallet/test_offer_lifecycle.py b/tests/wallet/cat_wallet/test_offer_lifecycle.py index 57b1b7620..9cc57ceec 100644 --- a/tests/wallet/cat_wallet/test_offer_lifecycle.py +++ b/tests/wallet/cat_wallet/test_offer_lifecycle.py @@ -3,24 +3,24 @@ import pytest from blspy import G2Element -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_spend import CoinSpend -from chia.types.mempool_inclusion_status import MempoolInclusionStatus -from chia.types.spend_bundle import SpendBundle -from chia.util.ints import uint64 -from chia.wallet.cat_wallet.cat_utils import ( +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_spend import CoinSpend +from flax.types.mempool_inclusion_status import MempoolInclusionStatus +from flax.types.spend_bundle import SpendBundle +from flax.util.ints import uint64 +from flax.wallet.cat_wallet.cat_utils import ( CAT_MOD, construct_cat_puzzle, SpendableCAT, unsigned_spend_bundle_for_spendable_cats, ) -from chia.wallet.outer_puzzles import AssetType -from chia.wallet.puzzle_drivers import PuzzleInfo -from chia.wallet.payment import Payment -from chia.wallet.trading.offer import Offer, NotarizedPayment +from flax.wallet.outer_puzzles import AssetType +from flax.wallet.puzzle_drivers import PuzzleInfo +from flax.wallet.payment import Payment +from flax.wallet.trading.offer import Offer, NotarizedPayment from tests.clvm.benchmark_costs import cost_of_spend_bundle acs = Program.to(1) @@ -40,7 +40,7 @@ def str_to_cat_hash(tail_str: str) -> bytes32: return construct_cat_puzzle(CAT_MOD, str_to_tail_hash(tail_str), acs).get_tree_hash() -# This method takes a dictionary of strings mapping to amounts and generates the appropriate CAT/XCH coins +# This method takes a dictionary of strings mapping to amounts and generates the appropriate CAT/XFX coins async def generate_coins( sim, sim_client, @@ -176,7 +176,7 @@ async def test_complex_offer(self, setup_sim): "blue": [3000], } all_coins: Dict[Optional[str], List[Coin]] = await generate_coins(sim, sim_client, coins_needed) - chia_coins: List[Coin] = all_coins[None] + flax_coins: List[Coin] = all_coins[None] red_coins: List[Coin] = all_coins["red"] blue_coins: List[Coin] = all_coins["blue"] @@ -193,23 +193,23 @@ async def test_complex_offer(self, setup_sim): for key, value in driver_dict.items(): driver_dict_as_infos[key.hex()] = value.info - # Create an XCH Offer for RED - chia_requested_payments: Dict[Optional[bytes32], List[Payment]] = { + # Create an XFX Offer for RED + flax_requested_payments: Dict[Optional[bytes32], List[Payment]] = { str_to_tail_hash("red"): [ Payment(acs_ph, 100, [b"memo"]), Payment(acs_ph, 200, [b"memo"]), ] } - chia_requested_payments: Dict[Optional[bytes32], List[NotarizedPayment]] = Offer.notarize_payments( - chia_requested_payments, chia_coins + flax_requested_payments: Dict[Optional[bytes32], List[NotarizedPayment]] = Offer.notarize_payments( + flax_requested_payments, flax_coins ) - chia_announcements: List[Announcement] = Offer.calculate_announcements(chia_requested_payments, driver_dict) - chia_secured_bundle: SpendBundle = generate_secure_bundle(chia_coins, chia_announcements, 1000) - chia_offer = Offer(chia_requested_payments, chia_secured_bundle, driver_dict) - assert not chia_offer.is_valid() + flax_announcements: List[Announcement] = Offer.calculate_announcements(flax_requested_payments, driver_dict) + flax_secured_bundle: SpendBundle = generate_secure_bundle(flax_coins, flax_announcements, 1000) + flax_offer = Offer(flax_requested_payments, flax_secured_bundle, driver_dict) + assert not flax_offer.is_valid() - # Create a RED Offer for XCH + # Create a RED Offer for XFX red_coins_1 = red_coins[0:1] red_coins_2 = red_coins[1:] red_requested_payments: Dict[Optional[bytes32], List[Payment]] = { @@ -248,12 +248,12 @@ async def test_complex_offer(self, setup_sim): assert not red_offer_2.is_valid() # Test aggregation of offers - new_offer = Offer.aggregate([chia_offer, red_offer, red_offer_2]) + new_offer = Offer.aggregate([flax_offer, red_offer, red_offer_2]) assert new_offer.get_offered_amounts() == {None: 1000, str_to_tail_hash("red"): 350} assert new_offer.get_requested_amounts() == {None: 700, str_to_tail_hash("red"): 300} assert new_offer.is_valid() - # Create yet another offer of BLUE for XCH and RED + # Create yet another offer of BLUE for XFX and RED blue_requested_payments: Dict[Optional[bytes32], List[Payment]] = { None: [ Payment(acs_ph, 200, [b"blue memo"]), @@ -283,15 +283,15 @@ async def test_complex_offer(self, setup_sim): assert new_offer.get_requested_amounts() == {None: 900, str_to_tail_hash("red"): 350} assert new_offer.summary() == ( { - "xch": 1000, + "xfx": 1000, str_to_tail_hash("red").hex(): 350, str_to_tail_hash("blue").hex(): 2000, }, - {"xch": 900, str_to_tail_hash("red").hex(): 350}, + {"xfx": 900, str_to_tail_hash("red").hex(): 350}, driver_dict_as_infos, ) assert new_offer.get_pending_amounts() == { - "xch": 1200, + "xfx": 1200, str_to_tail_hash("red").hex(): 350, str_to_tail_hash("blue").hex(): 3000, } diff --git a/tests/wallet/cat_wallet/test_trades.py b/tests/wallet/cat_wallet/test_trades.py index d65126af5..ec5b708aa 100644 --- a/tests/wallet/cat_wallet/test_trades.py +++ b/tests/wallet/cat_wallet/test_trades.py @@ -4,16 +4,16 @@ import pytest -from chia.full_node.mempool_manager import MempoolManager -from chia.simulator.simulator_protocol import FarmNewBlockProtocol -from chia.util.ints import uint64 -from chia.wallet.cat_wallet.cat_wallet import CATWallet -from chia.wallet.outer_puzzles import AssetType -from chia.wallet.puzzle_drivers import PuzzleInfo -from chia.wallet.trading.offer import Offer -from chia.wallet.trading.trade_status import TradeStatus -from chia.wallet.transaction_record import TransactionRecord -from chia.wallet.util.transaction_type import TransactionType +from flax.full_node.mempool_manager import MempoolManager +from flax.simulator.simulator_protocol import FarmNewBlockProtocol +from flax.util.ints import uint64 +from flax.wallet.cat_wallet.cat_wallet import CATWallet +from flax.wallet.outer_puzzles import AssetType +from flax.wallet.puzzle_drivers import PuzzleInfo +from flax.wallet.trading.offer import Offer +from flax.wallet.trading.trade_status import TradeStatus +from flax.wallet.transaction_record import TransactionRecord +from flax.wallet.util.transaction_type import TransactionType from tests.time_out_assert import time_out_assert @@ -66,20 +66,20 @@ async def test_cat_trades(self, wallets_prefarm): ) # Create the trade parameters - MAKER_CHIA_BALANCE = 20 * 1000000000000 - 100 - TAKER_CHIA_BALANCE = 20 * 1000000000000 - 100 - await time_out_assert(25, wallet_maker.get_confirmed_balance, MAKER_CHIA_BALANCE) - await time_out_assert(25, wallet_taker.get_unconfirmed_balance, TAKER_CHIA_BALANCE) + MAKER_FLAX_BALANCE = 20 * 1000000000000 - 100 + TAKER_FLAX_BALANCE = 20 * 1000000000000 - 100 + await time_out_assert(25, wallet_maker.get_confirmed_balance, MAKER_FLAX_BALANCE) + await time_out_assert(25, wallet_taker.get_unconfirmed_balance, TAKER_FLAX_BALANCE) MAKER_CAT_BALANCE = 100 MAKER_NEW_CAT_BALANCE = 0 TAKER_CAT_BALANCE = 0 TAKER_NEW_CAT_BALANCE = 100 - chia_for_cat = { + flax_for_cat = { wallet_maker.id(): -1, bytes.fromhex(new_cat_wallet_maker.get_asset_id()): 2, # This is the CAT that the taker made } - cat_for_chia = { + cat_for_flax = { wallet_maker.id(): 3, cat_wallet_maker.id(): -4, # The taker has no knowledge of this CAT yet } @@ -87,17 +87,17 @@ async def test_cat_trades(self, wallets_prefarm): bytes.fromhex(cat_wallet_maker.get_asset_id()): -5, new_cat_wallet_maker.id(): 6, } - chia_for_multiple_cat = { + flax_for_multiple_cat = { wallet_maker.id(): -7, cat_wallet_maker.id(): 8, new_cat_wallet_maker.id(): 9, } - multiple_cat_for_chia = { + multiple_cat_for_flax = { wallet_maker.id(): 10, cat_wallet_maker.id(): -11, new_cat_wallet_maker.id(): -12, } - chia_and_cat_for_cat = { + flax_and_cat_for_cat = { wallet_maker.id(): -13, cat_wallet_maker.id(): -14, new_cat_wallet_maker.id(): 15, @@ -117,8 +117,8 @@ async def test_cat_trades(self, wallets_prefarm): trade_manager_taker = wallet_node_taker.wallet_state_manager.trade_manager # Execute all of the trades - # chia_for_cat - success, trade_make, error = await trade_manager_maker.create_offer_for_ids(chia_for_cat, fee=uint64(1)) + # flax_for_cat + success, trade_make, error = await trade_manager_maker.create_offer_for_ids(flax_for_cat, fee=uint64(1)) await asyncio.sleep(1) assert error is None assert success is True @@ -132,23 +132,23 @@ async def test_cat_trades(self, wallets_prefarm): assert success is True assert trade_take is not None - MAKER_CHIA_BALANCE -= 2 # -1 and -1 for fee + MAKER_FLAX_BALANCE -= 2 # -1 and -1 for fee MAKER_NEW_CAT_BALANCE += 2 - TAKER_CHIA_BALANCE += 0 # +1 and -1 for fee + TAKER_FLAX_BALANCE += 0 # +1 and -1 for fee TAKER_NEW_CAT_BALANCE -= 2 - await time_out_assert(15, wallet_taker.get_unconfirmed_balance, TAKER_CHIA_BALANCE) + await time_out_assert(15, wallet_taker.get_unconfirmed_balance, TAKER_FLAX_BALANCE) await time_out_assert(15, new_cat_wallet_taker.get_unconfirmed_balance, TAKER_NEW_CAT_BALANCE) for i in range(0, buffer_blocks): await full_node.farm_new_transaction_block(FarmNewBlockProtocol(token_bytes())) - await time_out_assert(15, wallet_maker.get_confirmed_balance, MAKER_CHIA_BALANCE) - await time_out_assert(15, wallet_maker.get_unconfirmed_balance, MAKER_CHIA_BALANCE) + await time_out_assert(15, wallet_maker.get_confirmed_balance, MAKER_FLAX_BALANCE) + await time_out_assert(15, wallet_maker.get_unconfirmed_balance, MAKER_FLAX_BALANCE) await time_out_assert(15, new_cat_wallet_maker.get_confirmed_balance, MAKER_NEW_CAT_BALANCE) await time_out_assert(15, new_cat_wallet_maker.get_unconfirmed_balance, MAKER_NEW_CAT_BALANCE) - await time_out_assert(15, wallet_taker.get_confirmed_balance, TAKER_CHIA_BALANCE) - await time_out_assert(15, wallet_taker.get_unconfirmed_balance, TAKER_CHIA_BALANCE) + await time_out_assert(15, wallet_taker.get_confirmed_balance, TAKER_FLAX_BALANCE) + await time_out_assert(15, wallet_taker.get_unconfirmed_balance, TAKER_FLAX_BALANCE) await time_out_assert(15, new_cat_wallet_taker.get_confirmed_balance, TAKER_NEW_CAT_BALANCE) await time_out_assert(15, new_cat_wallet_taker.get_unconfirmed_balance, TAKER_NEW_CAT_BALANCE) @@ -166,8 +166,8 @@ async def assert_trade_tx_number(wallet_node, trade_id, number): await time_out_assert(15, assert_trade_tx_number, True, wallet_node_maker, trade_make.trade_id, 1) await time_out_assert(15, assert_trade_tx_number, True, wallet_node_taker, trade_take.trade_id, 3) - # cat_for_chia - success, trade_make, error = await trade_manager_maker.create_offer_for_ids(cat_for_chia) + # cat_for_flax + success, trade_make, error = await trade_manager_maker.create_offer_for_ids(cat_for_flax) await asyncio.sleep(1) assert error is None assert success is True @@ -180,26 +180,26 @@ async def assert_trade_tx_number(wallet_node, trade_id, number): assert trade_take is not None MAKER_CAT_BALANCE -= 4 - MAKER_CHIA_BALANCE += 3 + MAKER_FLAX_BALANCE += 3 TAKER_CAT_BALANCE += 4 - TAKER_CHIA_BALANCE -= 3 + TAKER_FLAX_BALANCE -= 3 cat_wallet_taker: CATWallet = await wallet_node_taker.wallet_state_manager.get_wallet_for_asset_id( cat_wallet_maker.get_asset_id() ) - await time_out_assert(15, wallet_taker.get_unconfirmed_balance, TAKER_CHIA_BALANCE) + await time_out_assert(15, wallet_taker.get_unconfirmed_balance, TAKER_FLAX_BALANCE) await time_out_assert(15, cat_wallet_taker.get_unconfirmed_balance, TAKER_CAT_BALANCE) for i in range(0, buffer_blocks): await full_node.farm_new_transaction_block(FarmNewBlockProtocol(token_bytes())) - await time_out_assert(15, wallet_maker.get_confirmed_balance, MAKER_CHIA_BALANCE) - await time_out_assert(15, wallet_maker.get_unconfirmed_balance, MAKER_CHIA_BALANCE) + await time_out_assert(15, wallet_maker.get_confirmed_balance, MAKER_FLAX_BALANCE) + await time_out_assert(15, wallet_maker.get_unconfirmed_balance, MAKER_FLAX_BALANCE) await time_out_assert(15, cat_wallet_maker.get_confirmed_balance, MAKER_CAT_BALANCE) await time_out_assert(15, cat_wallet_maker.get_unconfirmed_balance, MAKER_CAT_BALANCE) - await time_out_assert(15, wallet_taker.get_confirmed_balance, TAKER_CHIA_BALANCE) - await time_out_assert(15, wallet_taker.get_unconfirmed_balance, TAKER_CHIA_BALANCE) + await time_out_assert(15, wallet_taker.get_confirmed_balance, TAKER_FLAX_BALANCE) + await time_out_assert(15, wallet_taker.get_unconfirmed_balance, TAKER_FLAX_BALANCE) await time_out_assert(15, cat_wallet_taker.get_confirmed_balance, TAKER_CAT_BALANCE) await time_out_assert(15, cat_wallet_taker.get_unconfirmed_balance, TAKER_CAT_BALANCE) await time_out_assert(15, get_trade_and_status, TradeStatus.CONFIRMED, trade_manager_maker, trade_make) @@ -241,9 +241,9 @@ async def assert_trade_tx_number(wallet_node, trade_id, number): await time_out_assert(15, get_trade_and_status, TradeStatus.CONFIRMED, trade_manager_maker, trade_make) await time_out_assert(15, get_trade_and_status, TradeStatus.CONFIRMED, trade_manager_taker, trade_take) - # chia_for_multiple_cat + # flax_for_multiple_cat success, trade_make, error = await trade_manager_maker.create_offer_for_ids( - chia_for_multiple_cat, driver_dict=driver_dict + flax_for_multiple_cat, driver_dict=driver_dict ) await asyncio.sleep(1) assert error is None @@ -255,10 +255,10 @@ async def assert_trade_tx_number(wallet_node, trade_id, number): assert success is True assert trade_take is not None - MAKER_CHIA_BALANCE -= 7 + MAKER_FLAX_BALANCE -= 7 MAKER_CAT_BALANCE += 8 MAKER_NEW_CAT_BALANCE += 9 - TAKER_CHIA_BALANCE += 7 + TAKER_FLAX_BALANCE += 7 TAKER_CAT_BALANCE -= 8 TAKER_NEW_CAT_BALANCE -= 9 @@ -279,8 +279,8 @@ async def assert_trade_tx_number(wallet_node, trade_id, number): await time_out_assert(15, get_trade_and_status, TradeStatus.CONFIRMED, trade_manager_maker, trade_make) await time_out_assert(15, get_trade_and_status, TradeStatus.CONFIRMED, trade_manager_taker, trade_take) - # multiple_cat_for_chia - success, trade_make, error = await trade_manager_maker.create_offer_for_ids(multiple_cat_for_chia) + # multiple_cat_for_flax + success, trade_make, error = await trade_manager_maker.create_offer_for_ids(multiple_cat_for_flax) await asyncio.sleep(1) assert error is None assert success is True @@ -293,10 +293,10 @@ async def assert_trade_tx_number(wallet_node, trade_id, number): MAKER_CAT_BALANCE -= 11 MAKER_NEW_CAT_BALANCE -= 12 - MAKER_CHIA_BALANCE += 10 + MAKER_FLAX_BALANCE += 10 TAKER_CAT_BALANCE += 11 TAKER_NEW_CAT_BALANCE += 12 - TAKER_CHIA_BALANCE -= 10 + TAKER_FLAX_BALANCE -= 10 await time_out_assert(15, new_cat_wallet_taker.get_unconfirmed_balance, TAKER_NEW_CAT_BALANCE) await time_out_assert(15, cat_wallet_taker.get_unconfirmed_balance, TAKER_CAT_BALANCE) @@ -315,8 +315,8 @@ async def assert_trade_tx_number(wallet_node, trade_id, number): await time_out_assert(15, get_trade_and_status, TradeStatus.CONFIRMED, trade_manager_maker, trade_make) await time_out_assert(15, get_trade_and_status, TradeStatus.CONFIRMED, trade_manager_taker, trade_take) - # chia_and_cat_for_cat - success, trade_make, error = await trade_manager_maker.create_offer_for_ids(chia_and_cat_for_cat) + # flax_and_cat_for_cat + success, trade_make, error = await trade_manager_maker.create_offer_for_ids(flax_and_cat_for_cat) await asyncio.sleep(1) assert error is None assert success is True @@ -327,10 +327,10 @@ async def assert_trade_tx_number(wallet_node, trade_id, number): assert success is True assert trade_take is not None - MAKER_CHIA_BALANCE -= 13 + MAKER_FLAX_BALANCE -= 13 MAKER_CAT_BALANCE -= 14 MAKER_NEW_CAT_BALANCE += 15 - TAKER_CHIA_BALANCE += 13 + TAKER_FLAX_BALANCE += 13 TAKER_CAT_BALANCE += 14 TAKER_NEW_CAT_BALANCE -= 15 @@ -372,17 +372,17 @@ async def test_trade_cancellation(self, wallets_prefarm): await time_out_assert(15, cat_wallet_maker.get_confirmed_balance, 100) await time_out_assert(15, cat_wallet_maker.get_unconfirmed_balance, 100) - MAKER_CHIA_BALANCE = 20 * 1000000000000 - 100 + MAKER_FLAX_BALANCE = 20 * 1000000000000 - 100 MAKER_CAT_BALANCE = 100 - TAKER_CHIA_BALANCE = 20 * 1000000000000 - await time_out_assert(15, wallet_maker.get_confirmed_balance, MAKER_CHIA_BALANCE) + TAKER_FLAX_BALANCE = 20 * 1000000000000 + await time_out_assert(15, wallet_maker.get_confirmed_balance, MAKER_FLAX_BALANCE) - cat_for_chia = { + cat_for_flax = { wallet_maker.id(): 1, cat_wallet_maker.id(): -2, } - chia_for_cat = { + flax_for_cat = { wallet_maker.id(): -3, cat_wallet_maker.id(): 4, } @@ -394,7 +394,7 @@ async def get_trade_and_status(trade_manager, trade) -> TradeStatus: trade_rec = await trade_manager.get_trade_by_id(trade.trade_id) return TradeStatus(trade_rec.status) - success, trade_make, error = await trade_manager_maker.create_offer_for_ids(cat_for_chia) + success, trade_make, error = await trade_manager_maker.create_offer_for_ids(cat_for_flax) await asyncio.sleep(1) assert error is None assert success is True @@ -444,9 +444,9 @@ async def get_trade_and_status(trade_manager, trade) -> TradeStatus: # await time_out_assert(15, get_trade_and_status, TradeStatus.FAILED, trade_manager_taker, trade_take) await time_out_assert(15, wallet_maker.get_pending_change_balance, 0) - await time_out_assert(15, wallet_maker.get_confirmed_balance, MAKER_CHIA_BALANCE - FEE) + await time_out_assert(15, wallet_maker.get_confirmed_balance, MAKER_FLAX_BALANCE - FEE) await time_out_assert(15, cat_wallet_maker.get_confirmed_balance, MAKER_CAT_BALANCE) - await time_out_assert(15, wallet_taker.get_confirmed_balance, TAKER_CHIA_BALANCE) + await time_out_assert(15, wallet_taker.get_confirmed_balance, TAKER_FLAX_BALANCE) success, trade_take, error = await trade_manager_taker.respond_to_offer(Offer.from_bytes(trade_make.offer)) await asyncio.sleep(1) @@ -455,7 +455,7 @@ async def get_trade_and_status(trade_manager, trade) -> TradeStatus: assert trade_take is None # Now we're going to create the other way around for test coverage sake - success, trade_make, error = await trade_manager_maker.create_offer_for_ids(chia_for_cat) + success, trade_make, error = await trade_manager_maker.create_offer_for_ids(flax_for_cat) await asyncio.sleep(1) assert error is None assert success is True diff --git a/tests/wallet/did_wallet/test_did.py b/tests/wallet/did_wallet/test_did.py index 35a07f224..fcfde632e 100644 --- a/tests/wallet/did_wallet/test_did.py +++ b/tests/wallet/did_wallet/test_did.py @@ -4,15 +4,15 @@ import pytest from blspy import AugSchemeMPL -from chia.consensus.block_rewards import calculate_pool_reward, calculate_base_farmer_reward -from chia.simulator.simulator_protocol import FarmNewBlockProtocol -from chia.types.blockchain_format.program import Program -from chia.types.peer_info import PeerInfo -from chia.types.spend_bundle import SpendBundle -from chia.util.ints import uint16, uint32, uint64 - -from chia.wallet.util.wallet_types import WalletType -from chia.wallet.did_wallet.did_wallet import DIDWallet +from flax.consensus.block_rewards import calculate_pool_reward, calculate_base_farmer_reward +from flax.simulator.simulator_protocol import FarmNewBlockProtocol +from flax.types.blockchain_format.program import Program +from flax.types.peer_info import PeerInfo +from flax.types.spend_bundle import SpendBundle +from flax.util.ints import uint16, uint32, uint64 + +from flax.wallet.util.wallet_types import WalletType +from flax.wallet.did_wallet.did_wallet import DIDWallet from tests.time_out_assert import time_out_assert, time_out_assert_not_none # pytestmark = pytest.mark.skip("TODO: Fix tests") diff --git a/tests/wallet/nft_wallet/test_nft_1_offers.py b/tests/wallet/nft_wallet/test_nft_1_offers.py index 2641b5904..2f7a24faf 100644 --- a/tests/wallet/nft_wallet/test_nft_1_offers.py +++ b/tests/wallet/nft_wallet/test_nft_1_offers.py @@ -5,29 +5,29 @@ 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.rpc.wallet_rpc_api import WalletRpcApi -from chia.simulator.full_node_simulator import FullNodeSimulator -from chia.simulator.simulator_protocol import FarmNewBlockProtocol -from chia.types.blockchain_format.program import Program -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.peer_info import PeerInfo - -# from chia.util.bech32m import encode_puzzle_hash -# from chia.util.byte_types import hexstr_to_bytes -from chia.util.ints import uint16, uint32, uint64 -from chia.wallet.cat_wallet.cat_wallet import CATWallet -from chia.wallet.did_wallet.did_wallet import DIDWallet -from chia.wallet.nft_wallet.nft_wallet import NFTWallet -from chia.wallet.outer_puzzles import create_asset_id, match_puzzle -from chia.wallet.puzzle_drivers import PuzzleInfo -from chia.wallet.trading.offer import Offer -from chia.wallet.trading.trade_status import TradeStatus -from chia.wallet.util.compute_memos import compute_memos - -# from chia.wallet.util.wallet_types import WalletType +from flax.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward +from flax.full_node.mempool_manager import MempoolManager + +# from flax.rpc.wallet_rpc_api import WalletRpcApi +from flax.simulator.full_node_simulator import FullNodeSimulator +from flax.simulator.simulator_protocol import FarmNewBlockProtocol +from flax.types.blockchain_format.program import Program +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.peer_info import PeerInfo + +# from flax.util.bech32m import encode_puzzle_hash +# from flax.util.byte_types import hexstr_to_bytes +from flax.util.ints import uint16, uint32, uint64 +from flax.wallet.cat_wallet.cat_wallet import CATWallet +from flax.wallet.did_wallet.did_wallet import DIDWallet +from flax.wallet.nft_wallet.nft_wallet import NFTWallet +from flax.wallet.outer_puzzles import create_asset_id, match_puzzle +from flax.wallet.puzzle_drivers import PuzzleInfo +from flax.wallet.trading.offer import Offer +from flax.wallet.trading.trade_status import TradeStatus +from flax.wallet.util.compute_memos import compute_memos + +# from flax.wallet.util.wallet_types import WalletType from tests.time_out_assert import time_out_assert, time_out_assert_not_none # from clvm_tools.binutils import disassemble @@ -119,7 +119,7 @@ async def test_nft_offer_sell_nft(two_wallet_nodes: Any, trusted: Any) -> None: ) metadata = Program.to( [ - ("u", ["https://www.chia.net/img/branding/chia-logo.svg"]), + ("u", ["https://www.flaxnetwork.org/img/branding/flax-logo.svg"]), ("h", "0xD4584AD463139FA8C0D9F68F4B59F185"), ] ) @@ -146,7 +146,7 @@ async def test_nft_offer_sell_nft(two_wallet_nodes: Any, trusted: Any) -> None: wallet_node_taker.wallet_state_manager, wallet_taker, name="NFT WALLET TAKER" ) - # maker create offer: NFT for xch + # maker create offer: NFT for xfx trade_manager_maker = wallet_maker.wallet_state_manager.trade_manager trade_manager_taker = wallet_taker.wallet_state_manager.trade_manager @@ -158,13 +158,13 @@ async def test_nft_offer_sell_nft(two_wallet_nodes: Any, trusted: Any) -> None: nft_to_offer = coins_maker[0] nft_to_offer_info: Optional[PuzzleInfo] = match_puzzle(nft_to_offer.full_puzzle) nft_to_offer_asset_id: bytes32 = create_asset_id(nft_to_offer_info) # type: ignore - xch_requested = 1000 + xfx_requested = 1000 maker_fee = uint64(433) - offer_did_nft_for_xch = {nft_to_offer_asset_id: -1, wallet_maker.id(): xch_requested} + offer_did_nft_for_xfx = {nft_to_offer_asset_id: -1, wallet_maker.id(): xfx_requested} success, trade_make, error = await trade_manager_maker.create_offer_for_ids( - offer_did_nft_for_xch, {}, fee=maker_fee + offer_did_nft_for_xfx, {}, fee=maker_fee ) await asyncio.sleep(1) @@ -188,9 +188,9 @@ async def test_nft_offer_sell_nft(two_wallet_nodes: Any, trusted: Any) -> None: await time_out_assert(5, len, 1, nft_wallet_taker.my_nft_coins) # assert payments and royalties - expected_royalty = uint64(xch_requested * royalty_basis_pts / 10000) - expected_maker_balance = funds - 2 - maker_fee + xch_requested + expected_royalty - expected_taker_balance = funds - taker_fee - xch_requested - expected_royalty + expected_royalty = uint64(xfx_requested * royalty_basis_pts / 10000) + expected_maker_balance = funds - 2 - maker_fee + xfx_requested + expected_royalty + expected_taker_balance = funds - taker_fee - xfx_requested - expected_royalty await time_out_assert(10, wallet_maker.get_confirmed_balance, expected_maker_balance) await time_out_assert(10, wallet_taker.get_confirmed_balance, expected_taker_balance) @@ -269,7 +269,7 @@ async def test_nft_offer_request_nft(two_wallet_nodes: Any, trusted: Any) -> Non ) metadata = Program.to( [ - ("u", ["https://www.chia.net/img/branding/chia-logo.svg"]), + ("u", ["https://www.flaxnetwork.org/img/branding/flax-logo.svg"]), ("h", "0xD4584AD463139FA8C0D9F68F4B59F185"), ] ) @@ -298,7 +298,7 @@ async def test_nft_offer_request_nft(two_wallet_nodes: Any, trusted: Any) -> Non wallet_node_maker.wallet_state_manager, wallet_maker, name="NFT WALLET MAKER" ) - # maker create offer: NFT for xch + # maker create offer: NFT for xfx trade_manager_maker = wallet_maker.wallet_state_manager.trade_manager trade_manager_taker = wallet_taker.wallet_state_manager.trade_manager @@ -312,11 +312,11 @@ async def test_nft_offer_request_nft(two_wallet_nodes: Any, trusted: Any) -> Non assert isinstance(nft_to_request_info, PuzzleInfo) nft_to_request_asset_id = create_asset_id(nft_to_request_info) - xch_offered = 1000 + xfx_offered = 1000 maker_fee = 10 driver_dict = {nft_to_request_asset_id: nft_to_request_info} - offer_dict = {nft_to_request_asset_id: 1, wallet_maker.id(): -xch_offered} + offer_dict = {nft_to_request_asset_id: 1, wallet_maker.id(): -xfx_offered} success, trade_make, error = await trade_manager_maker.create_offer_for_ids(offer_dict, driver_dict, fee=maker_fee) @@ -341,9 +341,9 @@ async def test_nft_offer_request_nft(two_wallet_nodes: Any, trusted: Any) -> Non await time_out_assert(5, len, 0, nft_wallet_taker.my_nft_coins) # assert payments and royalties - expected_royalty = uint64(xch_offered * royalty_basis_pts / 10000) - expected_maker_balance = funds - maker_fee - xch_offered - expected_royalty - expected_taker_balance = funds - 2 - taker_fee + xch_offered + expected_royalty + expected_royalty = uint64(xfx_offered * royalty_basis_pts / 10000) + expected_maker_balance = funds - maker_fee - xfx_offered - expected_royalty + expected_taker_balance = funds - 2 - taker_fee + xfx_offered + expected_royalty await time_out_assert(10, wallet_maker.get_confirmed_balance, expected_maker_balance) await time_out_assert(10, wallet_taker.get_confirmed_balance, expected_taker_balance) @@ -422,7 +422,7 @@ async def test_nft_offer_sell_did_to_did(two_wallet_nodes: Any, trusted: Any) -> ) metadata = Program.to( [ - ("u", ["https://www.chia.net/img/branding/chia-logo.svg"]), + ("u", ["https://www.flaxnetwork.org/img/branding/flax-logo.svg"]), ("h", "0xD4584AD463139FA8C0D9F68F4B59F185"), ] ) @@ -472,7 +472,7 @@ async def test_nft_offer_sell_did_to_did(two_wallet_nodes: Any, trusted: Any) -> wallet_node_taker.wallet_state_manager, wallet_taker, name="NFT WALLET TAKER", did_id=did_id_taker ) - # maker create offer: NFT for xch + # maker create offer: NFT for xfx trade_manager_maker = wallet_maker.wallet_state_manager.trade_manager trade_manager_taker = wallet_taker.wallet_state_manager.trade_manager @@ -484,13 +484,13 @@ async def test_nft_offer_sell_did_to_did(two_wallet_nodes: Any, trusted: Any) -> nft_to_offer = coins_maker[0] nft_to_offer_info: Optional[PuzzleInfo] = match_puzzle(nft_to_offer.full_puzzle) nft_to_offer_asset_id: bytes32 = create_asset_id(nft_to_offer_info) # type: ignore - xch_requested = 1000 + xfx_requested = 1000 maker_fee = uint64(433) - offer_did_nft_for_xch = {nft_to_offer_asset_id: -1, wallet_maker.id(): xch_requested} + offer_did_nft_for_xfx = {nft_to_offer_asset_id: -1, wallet_maker.id(): xfx_requested} success, trade_make, error = await trade_manager_maker.create_offer_for_ids( - offer_did_nft_for_xch, {}, fee=maker_fee + offer_did_nft_for_xfx, {}, fee=maker_fee ) await asyncio.sleep(1) @@ -516,9 +516,9 @@ async def test_nft_offer_sell_did_to_did(two_wallet_nodes: Any, trusted: Any) -> await time_out_assert(5, len, 1, wallet_taker.wallet_state_manager.wallets[4].my_nft_coins) assert wallet_taker.wallet_state_manager.wallets[4].my_nft_coins[0].nft_id == nft_to_offer_asset_id # assert payments and royalties - expected_royalty = uint64(xch_requested * royalty_basis_pts / 10000) - expected_maker_balance = funds - 2 - maker_fee + xch_requested + expected_royalty - expected_taker_balance = funds - 1 - taker_fee - xch_requested - expected_royalty + expected_royalty = uint64(xfx_requested * royalty_basis_pts / 10000) + expected_maker_balance = funds - 2 - maker_fee + xfx_requested + expected_royalty + expected_taker_balance = funds - 1 - taker_fee - xfx_requested - expected_royalty await time_out_assert(10, wallet_maker.get_confirmed_balance, expected_maker_balance) await time_out_assert(10, wallet_taker.get_confirmed_balance, expected_taker_balance) @@ -599,7 +599,7 @@ async def test_nft_offer_sell_nft_for_cat(two_wallet_nodes: Any, trusted: Any) - ) metadata = Program.to( [ - ("u", ["https://www.chia.net/img/branding/chia-logo.svg"]), + ("u", ["https://www.flaxnetwork.org/img/branding/flax-logo.svg"]), ("h", "0xD4584AD463139FA8C0D9F68F4B59F185"), ] ) @@ -626,7 +626,7 @@ async def test_nft_offer_sell_nft_for_cat(two_wallet_nodes: Any, trusted: Any) - wallet_node_taker.wallet_state_manager, wallet_taker, name="NFT WALLET TAKER" ) - # maker create offer: NFT for xch + # maker create offer: NFT for xfx trade_manager_maker = wallet_maker.wallet_state_manager.trade_manager trade_manager_taker = wallet_taker.wallet_state_manager.trade_manager @@ -679,10 +679,10 @@ async def test_nft_offer_sell_nft_for_cat(two_wallet_nodes: Any, trusted: Any) - cats_requested = 1000 maker_fee = uint64(433) - offer_did_nft_for_xch = {nft_to_offer_asset_id: -1, cat_wallet_maker.id(): cats_requested} + offer_did_nft_for_xfx = {nft_to_offer_asset_id: -1, cat_wallet_maker.id(): cats_requested} success, trade_make, error = await trade_manager_maker.create_offer_for_ids( - offer_did_nft_for_xch, {}, fee=maker_fee + offer_did_nft_for_xfx, {}, fee=maker_fee ) await asyncio.sleep(1) @@ -793,7 +793,7 @@ async def test_nft_offer_request_nft_for_cat(two_wallet_nodes: Any, trusted: Any ) metadata = Program.to( [ - ("u", ["https://www.chia.net/img/branding/chia-logo.svg"]), + ("u", ["https://www.flaxnetwork.org/img/branding/flax-logo.svg"]), ("h", "0xD4584AD463139FA8C0D9F68F4B59F185"), ] ) @@ -820,7 +820,7 @@ async def test_nft_offer_request_nft_for_cat(two_wallet_nodes: Any, trusted: Any wallet_node_maker.wallet_state_manager, wallet_maker, name="NFT WALLET MAKER" ) - # maker create offer: NFT for xch + # maker create offer: NFT for xfx trade_manager_maker = wallet_maker.wallet_state_manager.trade_manager trade_manager_taker = wallet_taker.wallet_state_manager.trade_manager @@ -976,7 +976,7 @@ async def test_nft_offer_sell_cancel(two_wallet_nodes: Any, trusted: Any) -> Non ) metadata = Program.to( [ - ("u", ["https://www.chia.net/img/branding/chia-logo.svg"]), + ("u", ["https://www.flaxnetwork.org/img/branding/flax-logo.svg"]), ("h", "0xD4584AD463139FA8C0D9F68F4B59F185"), ] ) @@ -998,7 +998,7 @@ async def test_nft_offer_sell_cancel(two_wallet_nodes: Any, trusted: Any) -> Non await time_out_assert(10, len, 1, nft_wallet_maker.my_nft_coins) - # maker create offer: NFT for xch + # maker create offer: NFT for xfx trade_manager_maker = wallet_maker.wallet_state_manager.trade_manager coins_maker = nft_wallet_maker.my_nft_coins @@ -1007,13 +1007,13 @@ async def test_nft_offer_sell_cancel(two_wallet_nodes: Any, trusted: Any) -> Non nft_to_offer = coins_maker[0] nft_to_offer_info: Optional[PuzzleInfo] = match_puzzle(nft_to_offer.full_puzzle) nft_to_offer_asset_id: bytes32 = create_asset_id(nft_to_offer_info) # type: ignore - xch_requested = 1000 + xfx_requested = 1000 maker_fee = uint64(433) - offer_did_nft_for_xch = {nft_to_offer_asset_id: -1, wallet_maker.id(): xch_requested} + offer_did_nft_for_xfx = {nft_to_offer_asset_id: -1, wallet_maker.id(): xfx_requested} success, trade_make, error = await trade_manager_maker.create_offer_for_ids( - offer_did_nft_for_xch, {}, fee=maker_fee + offer_did_nft_for_xfx, {}, fee=maker_fee ) FEE = uint64(2000000000000) diff --git a/tests/wallet/nft_wallet/test_nft_lifecycle.py b/tests/wallet/nft_wallet/test_nft_lifecycle.py index 5ac132152..674d1971a 100644 --- a/tests/wallet/nft_wallet/test_nft_lifecycle.py +++ b/tests/wallet/nft_wallet/test_nft_lifecycle.py @@ -4,15 +4,15 @@ import pytest from blspy import G2Element -from chia.clvm.spend_sim import SimClient, SpendSim -from chia.types.announcement import Announcement -from chia.types.blockchain_format.program import Program -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.coin_spend import CoinSpend -from chia.types.mempool_inclusion_status import MempoolInclusionStatus -from chia.types.spend_bundle import SpendBundle -from chia.util.errors import Err -from chia.wallet.nft_wallet.nft_puzzles import ( +from flax.clvm.spend_sim import SimClient, SpendSim +from flax.types.announcement import Announcement +from flax.types.blockchain_format.program import Program +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.coin_spend import CoinSpend +from flax.types.mempool_inclusion_status import MempoolInclusionStatus +from flax.types.spend_bundle import SpendBundle +from flax.util.errors import Err +from flax.wallet.nft_wallet.nft_puzzles import ( NFT_METADATA_UPDATER, NFT_TRANSFER_PROGRAM_DEFAULT, construct_ownership_layer, @@ -298,7 +298,7 @@ async def test_default_transfer_program(setup_sim: Tuple[SpendSim, SimClient]) - cat_coin = ( await sim_client.get_coin_records_by_puzzle_hash(FAKE_CAT.get_tree_hash(), include_spent_coins=False) )[0].coin - xch_coin = (await sim_client.get_coin_records_by_puzzle_hash(ACS_PH, include_spent_coins=False))[0].coin + xfx_coin = (await sim_client.get_coin_records_by_puzzle_hash(ACS_PH, include_spent_coins=False))[0].coin ownership_spend = CoinSpend( ownership_coin, @@ -317,8 +317,8 @@ async def test_default_transfer_program(setup_sim: Tuple[SpendSim, SimClient]) - expected_announcement_data = Program.to( (FAKE_LAUNCHER_ID, [[ROYALTY_ADDRESS, 50, [ROYALTY_ADDRESS]]]) ).get_tree_hash() - xch_announcement_spend = CoinSpend( - xch_coin, + xfx_announcement_spend = CoinSpend( + xfx_coin, ACS, Program.to([[62, expected_announcement_data]]), ) @@ -328,14 +328,14 @@ async def test_default_transfer_program(setup_sim: Tuple[SpendSim, SimClient]) - # Make sure every combo except all of them work for i in range(1, 3): for announcement_combo in itertools.combinations( - [did_announcement_spend, xch_announcement_spend, cat_announcement_spend], i + [did_announcement_spend, xfx_announcement_spend, cat_announcement_spend], i ): result = await sim_client.push_tx(SpendBundle([ownership_spend, *announcement_combo], G2Element())) assert result == (MempoolInclusionStatus.FAILED, Err.ASSERT_ANNOUNCE_CONSUMED_FAILED) # Make sure all of them together pass full_bundle = SpendBundle( - [ownership_spend, did_announcement_spend, xch_announcement_spend, cat_announcement_spend], G2Element() + [ownership_spend, did_announcement_spend, xfx_announcement_spend, cat_announcement_spend], G2Element() ) result = await sim_client.push_tx(full_bundle) assert result == (MempoolInclusionStatus.SUCCESS, None) diff --git a/tests/wallet/nft_wallet/test_nft_offers.py b/tests/wallet/nft_wallet/test_nft_offers.py index 63ef77920..972a9af0d 100644 --- a/tests/wallet/nft_wallet/test_nft_offers.py +++ b/tests/wallet/nft_wallet/test_nft_offers.py @@ -4,20 +4,20 @@ 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.full_node_simulator import FullNodeSimulator -from chia.simulator.simulator_protocol import FarmNewBlockProtocol -from chia.types.blockchain_format.program import Program -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.cat_wallet.cat_wallet import CATWallet -from chia.wallet.nft_wallet.nft_wallet import NFTWallet -from chia.wallet.outer_puzzles import create_asset_id, match_puzzle -from chia.wallet.puzzle_drivers import PuzzleInfo -from chia.wallet.trading.offer import Offer -from chia.wallet.trading.trade_status import TradeStatus +from flax.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward +from flax.full_node.mempool_manager import MempoolManager +from flax.simulator.full_node_simulator import FullNodeSimulator +from flax.simulator.simulator_protocol import FarmNewBlockProtocol +from flax.types.blockchain_format.program import Program +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.cat_wallet.cat_wallet import CATWallet +from flax.wallet.nft_wallet.nft_wallet import NFTWallet +from flax.wallet.outer_puzzles import create_asset_id, match_puzzle +from flax.wallet.puzzle_drivers import PuzzleInfo +from flax.wallet.trading.offer import Offer +from flax.wallet.trading.trade_status import TradeStatus from tests.time_out_assert import time_out_assert, time_out_assert_not_none @@ -95,7 +95,7 @@ async def test_nft_offer_with_fee(two_wallet_nodes: Any, trusted: Any) -> None: metadata = Program.to( [ - ("u", ["https://www.chia.net/img/branding/chia-logo.svg"]), + ("u", ["https://www.flaxnetwork.org/img/branding/flax-logo.svg"]), ("h", "0xD4584AD463139FA8C0D9F68F4B59F185"), ] ) @@ -113,7 +113,7 @@ async def test_nft_offer_with_fee(two_wallet_nodes: Any, trusted: Any) -> None: coins_taker = nft_wallet_taker.my_nft_coins assert len(coins_taker) == 0 - # MAKE FIRST TRADE: 1 NFT for 100 xch + # MAKE FIRST TRADE: 1 NFT for 100 xfx maker_balance_pre = await wallet_maker.get_confirmed_balance() taker_balance_pre = await wallet_taker.get_confirmed_balance() @@ -122,12 +122,12 @@ async def test_nft_offer_with_fee(two_wallet_nodes: Any, trusted: Any) -> None: nft_asset_id: bytes32 = create_asset_id(nft_info) # type: ignore driver_dict: Dict[bytes32, Optional[PuzzleInfo]] = {nft_asset_id: nft_info} - xch_request = 100 + xfx_request = 100 maker_fee = uint64(10) - offer_nft_for_xch = {wallet_maker.id(): xch_request, nft_asset_id: -1} + offer_nft_for_xfx = {wallet_maker.id(): xfx_request, nft_asset_id: -1} success, trade_make, error = await trade_manager_maker.create_offer_for_ids( - offer_nft_for_xch, driver_dict, fee=maker_fee + offer_nft_for_xfx, driver_dict, fee=maker_fee ) await asyncio.sleep(1) assert success is True @@ -150,15 +150,15 @@ async def test_nft_offer_with_fee(two_wallet_nodes: Any, trusted: Any) -> None: await time_out_assert(15, get_trade_and_status, TradeStatus.CONFIRMED, trade_manager_maker, trade_make) await time_out_assert(15, get_trade_and_status, TradeStatus.CONFIRMED, trade_manager_taker, trade_take) - await time_out_assert(15, wallet_maker.get_confirmed_balance, maker_balance_pre + xch_request - maker_fee) - await time_out_assert(15, wallet_taker.get_confirmed_balance, taker_balance_pre - xch_request - taker_fee) + await time_out_assert(15, wallet_maker.get_confirmed_balance, maker_balance_pre + xfx_request - maker_fee) + await time_out_assert(15, wallet_taker.get_confirmed_balance, taker_balance_pre - xfx_request - taker_fee) coins_maker = nft_wallet_maker.my_nft_coins coins_taker = nft_wallet_taker.my_nft_coins assert len(coins_maker) == 0 assert len(coins_taker) == 1 - # MAKE SECOND TRADE: 100 xch for 1 NFT + # MAKE SECOND TRADE: 100 xfx for 1 NFT maker_balance_pre = await wallet_maker.get_confirmed_balance() taker_balance_pre = await wallet_taker.get_confirmed_balance() @@ -168,11 +168,11 @@ async def test_nft_offer_with_fee(two_wallet_nodes: Any, trusted: Any) -> None: nft_to_buy_asset_id: bytes32 = create_asset_id(nft_to_buy_info) # type: ignore driver_dict_to_buy: Dict[bytes32, Optional[PuzzleInfo]] = {nft_to_buy_asset_id: nft_to_buy_info} - xch_offered = 1000 + xfx_offered = 1000 maker_fee = uint64(10) - offer_xch_for_nft = {wallet_maker.id(): -xch_offered, nft_to_buy_asset_id: 1} + offer_xfx_for_nft = {wallet_maker.id(): -xfx_offered, nft_to_buy_asset_id: 1} success, trade_make, error = await trade_manager_maker.create_offer_for_ids( - offer_xch_for_nft, driver_dict_to_buy, fee=maker_fee + offer_xfx_for_nft, driver_dict_to_buy, fee=maker_fee ) await asyncio.sleep(1) assert success is True @@ -195,8 +195,8 @@ async def test_nft_offer_with_fee(two_wallet_nodes: Any, trusted: Any) -> None: await time_out_assert(15, get_trade_and_status, TradeStatus.CONFIRMED, trade_manager_maker, trade_make) await time_out_assert(15, get_trade_and_status, TradeStatus.CONFIRMED, trade_manager_taker, trade_take) - await time_out_assert(15, wallet_maker.get_confirmed_balance, maker_balance_pre - xch_offered - maker_fee) - await time_out_assert(15, wallet_taker.get_confirmed_balance, taker_balance_pre + xch_offered - taker_fee) + await time_out_assert(15, wallet_maker.get_confirmed_balance, maker_balance_pre - xfx_offered - maker_fee) + await time_out_assert(15, wallet_taker.get_confirmed_balance, taker_balance_pre + xfx_offered - taker_fee) coins_maker = nft_wallet_maker.my_nft_coins coins_taker = nft_wallet_taker.my_nft_coins @@ -266,7 +266,7 @@ async def test_nft_offer_cancellations(two_wallet_nodes: Any, trusted: Any) -> N metadata = Program.to( [ - ("u", ["https://www.chia.net/img/branding/chia-logo.svg"]), + ("u", ["https://www.flaxnetwork.org/img/branding/flax-logo.svg"]), ("h", "0xD4584AD463139FA8C0D9F68F4B59F185"), ] ) @@ -293,12 +293,12 @@ async def test_nft_offer_cancellations(two_wallet_nodes: Any, trusted: Any) -> N nft_asset_id: bytes32 = create_asset_id(nft_info) # type: ignore driver_dict: Dict[bytes32, Optional[PuzzleInfo]] = {nft_asset_id: nft_info} - xch_request = 100 + xfx_request = 100 maker_fee = uint64(10) - offer_nft_for_xch = {wallet_maker.id(): xch_request, nft_asset_id: -1} + offer_nft_for_xfx = {wallet_maker.id(): xfx_request, nft_asset_id: -1} success, trade_make, error = await trade_manager_maker.create_offer_for_ids( - offer_nft_for_xch, driver_dict, fee=maker_fee + offer_nft_for_xfx, driver_dict, fee=maker_fee ) await asyncio.sleep(1) assert success is True @@ -391,7 +391,7 @@ async def test_nft_offer_with_metadata_update(two_wallet_nodes: Any, trusted: An metadata = Program.to( [ - ("u", ["https://www.chia.net/img/branding/chia-logo.svg"]), + ("u", ["https://www.flaxnetwork.org/img/branding/flax-logo.svg"]), ("h", "0xD4584AD463139FA8C0D9F68F4B59F185"), ("mu", []), ("lu", []), @@ -432,7 +432,7 @@ async def test_nft_offer_with_metadata_update(two_wallet_nodes: Any, trusted: An assert url_to_add in updated_nft_info.also().info["metadata"] # type: ignore - # MAKE FIRST TRADE: 1 NFT for 100 xch + # MAKE FIRST TRADE: 1 NFT for 100 xfx maker_balance_pre = await wallet_maker.get_confirmed_balance() taker_balance_pre = await wallet_taker.get_confirmed_balance() @@ -441,12 +441,12 @@ async def test_nft_offer_with_metadata_update(two_wallet_nodes: Any, trusted: An nft_asset_id: bytes32 = create_asset_id(nft_info) # type: ignore driver_dict: Dict[bytes32, Optional[PuzzleInfo]] = {nft_asset_id: nft_info} - xch_request = 100 + xfx_request = 100 maker_fee = uint64(10) - offer_nft_for_xch = {wallet_maker.id(): xch_request, nft_asset_id: -1} + offer_nft_for_xfx = {wallet_maker.id(): xfx_request, nft_asset_id: -1} success, trade_make, error = await trade_manager_maker.create_offer_for_ids( - offer_nft_for_xch, driver_dict, fee=maker_fee + offer_nft_for_xfx, driver_dict, fee=maker_fee ) await asyncio.sleep(1) assert success is True @@ -469,8 +469,8 @@ async def test_nft_offer_with_metadata_update(two_wallet_nodes: Any, trusted: An await time_out_assert(15, get_trade_and_status, TradeStatus.CONFIRMED, trade_manager_maker, trade_make) await time_out_assert(15, get_trade_and_status, TradeStatus.CONFIRMED, trade_manager_taker, trade_take) - await time_out_assert(15, wallet_maker.get_confirmed_balance, maker_balance_pre + xch_request - maker_fee) - await time_out_assert(15, wallet_taker.get_confirmed_balance, taker_balance_pre - xch_request - taker_fee) + await time_out_assert(15, wallet_maker.get_confirmed_balance, maker_balance_pre + xfx_request - maker_fee) + await time_out_assert(15, wallet_taker.get_confirmed_balance, taker_balance_pre - xfx_request - taker_fee) coins_maker = nft_wallet_maker.my_nft_coins coins_taker = nft_wallet_taker.my_nft_coins @@ -541,7 +541,7 @@ async def test_nft_offer_nft_for_cat(two_wallet_nodes: Any, trusted: Any) -> Non metadata = Program.to( [ - ("u", ["https://www.chia.net/img/branding/chia-logo.svg"]), + ("u", ["https://www.flaxnetwork.org/img/branding/flax-logo.svg"]), ("h", "0xD4584AD463139FA8C0D9F68F4B59F185"), ] ) @@ -766,7 +766,7 @@ async def test_nft_offer_nft_for_nft(two_wallet_nodes: Any, trusted: Any) -> Non metadata = Program.to( [ - ("u", ["https://www.chia.net/img/branding/chia-logo.svg"]), + ("u", ["https://www.flaxnetwork.org/img/branding/flax-logo.svg"]), ("h", "0xD4584AD463139FA8C0D9F68F4B59F185"), ] ) @@ -777,7 +777,7 @@ async def test_nft_offer_nft_for_nft(two_wallet_nodes: Any, trusted: Any) -> Non metadata_2 = Program.to( [ - ("u", ["https://www.chia.net/image2.html"]), + ("u", ["https://www.flaxnetwork.org/image2.html"]), ("h", "0xD4584AD463139FA8C0D9F68F4B59F183"), ] ) diff --git a/tests/wallet/nft_wallet/test_nft_puzzles.py b/tests/wallet/nft_wallet/test_nft_puzzles.py index 572d25936..d4009bee8 100644 --- a/tests/wallet/nft_wallet/test_nft_puzzles.py +++ b/tests/wallet/nft_wallet/test_nft_puzzles.py @@ -3,18 +3,18 @@ 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 chia.wallet.nft_wallet import uncurry_nft -from chia.wallet.nft_wallet.nft_puzzles import ( +from flax.types.blockchain_format.program import Program +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.wallet.nft_wallet import uncurry_nft +from flax.wallet.nft_wallet.nft_puzzles import ( construct_ownership_layer, create_full_puzzle, create_nft_layer_puzzle_with_curry_params, recurry_nft_puzzle, ) -from chia.wallet.outer_puzzles import match_puzzle -from chia.wallet.puzzles.load_clvm import load_clvm -from chia.wallet.puzzles.p2_delegated_puzzle_or_hidden_puzzle import puzzle_for_pk, solution_for_conditions +from flax.wallet.outer_puzzles import match_puzzle +from flax.wallet.puzzles.load_clvm import load_clvm +from flax.wallet.puzzles.p2_delegated_puzzle_or_hidden_puzzle import puzzle_for_pk, solution_for_conditions from tests.core.make_block_generator import int_to_public_key SINGLETON_MOD = load_clvm("singleton_top_layer_v1_1.clvm") @@ -39,7 +39,7 @@ def test_nft_transfer_puzzle_hashes(): maker_did = Program.to("maker did").get_tree_hash() # maker_did_inner_hash = Program.to("maker did inner hash").get_tree_hash() metadata = [ - ("u", ["https://www.chia.net/img/branding/chia-logo.svg"]), + ("u", ["https://www.flaxnetwork.org/img/branding/flax-logo.svg"]), ("h", 0xD4584AD463139FA8C0D9F68F4B59F185), ] metadata_updater_hash = NFT_METADATA_UPDATER_DEFAULT.get_tree_hash() @@ -167,7 +167,7 @@ def get_updated_nft_puzzle(puzzle: Program, solution: Program) -> bytes32: def test_transfer_puzzle_builder() -> None: metadata = [ - ("u", ["https://www.chia.net/img/branding/chia-logo.svg"]), + ("u", ["https://www.flaxnetwork.org/img/branding/flax-logo.svg"]), ("h", 0xD4584AD463139FA8C0D9F68F4B59F185), ] sp2_puzzle, solution = make_a_new_solution() diff --git a/tests/wallet/nft_wallet/test_nft_wallet.py b/tests/wallet/nft_wallet/test_nft_wallet.py index cb7f9f08e..c4d682c32 100644 --- a/tests/wallet/nft_wallet/test_nft_wallet.py +++ b/tests/wallet/nft_wallet/test_nft_wallet.py @@ -5,22 +5,22 @@ import pytest from clvm_tools.binutils import disassemble -from chia.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward -from chia.full_node.mempool_manager import MempoolManager -from chia.rpc.wallet_rpc_api import WalletRpcApi -from chia.simulator.full_node_simulator import FullNodeSimulator -from chia.simulator.simulator_protocol import FarmNewBlockProtocol -from chia.types.blockchain_format.program import Program -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.peer_info import PeerInfo -from chia.util.bech32m import encode_puzzle_hash -from chia.util.byte_types import hexstr_to_bytes -from chia.util.ints import uint16, uint32, uint64 -from chia.wallet.did_wallet.did_info import DID_HRP -from chia.wallet.did_wallet.did_wallet import DIDWallet -from chia.wallet.nft_wallet.nft_wallet import NFTWallet -from chia.wallet.util.compute_memos import compute_memos -from chia.wallet.util.wallet_types import WalletType +from flax.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward +from flax.full_node.mempool_manager import MempoolManager +from flax.rpc.wallet_rpc_api import WalletRpcApi +from flax.simulator.full_node_simulator import FullNodeSimulator +from flax.simulator.simulator_protocol import FarmNewBlockProtocol +from flax.types.blockchain_format.program import Program +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.peer_info import PeerInfo +from flax.util.bech32m import encode_puzzle_hash +from flax.util.byte_types import hexstr_to_bytes +from flax.util.ints import uint16, uint32, uint64 +from flax.wallet.did_wallet.did_info import DID_HRP +from flax.wallet.did_wallet.did_wallet import DIDWallet +from flax.wallet.nft_wallet.nft_wallet import NFTWallet +from flax.wallet.util.compute_memos import compute_memos +from flax.wallet.util.wallet_types import WalletType from tests.time_out_assert import time_out_assert, time_out_assert_not_none @@ -111,7 +111,7 @@ async def test_nft_wallet_creation_automatically(two_wallet_nodes: Any, trusted: ) metadata = Program.to( [ - ("u", ["https://www.chia.net/img/branding/chia-logo.svg"]), + ("u", ["https://www.flaxnetwork.org/img/branding/flax-logo.svg"]), ("h", "0xD4584AD463139FA8C0D9F68F4B59F185"), ] ) @@ -203,7 +203,7 @@ async def test_nft_wallet_creation_and_transfer(two_wallet_nodes: Any, trusted: ) metadata = Program.to( [ - ("u", ["https://www.chia.net/img/branding/chia-logo.svg"]), + ("u", ["https://www.flaxnetwork.org/img/branding/flax-logo.svg"]), ("h", "0xD4584AD463139FA8C0D9F68F4B59F185"), ] ) @@ -335,7 +335,7 @@ async def test_nft_wallet_rpc_creation_and_list(two_wallet_nodes: Any, trusted: "wallet_id": nft_wallet_0_id, "artist_address": ph, "hash": "0xD4584AD463139FA8C0D9F68F4B59F185", - "uris": ["https://www.chia.net/img/branding/chia-logo.svg"], + "uris": ["https://www.flaxnetwork.org/img/branding/flax-logo.svg"], } ) @@ -353,7 +353,7 @@ async def test_nft_wallet_rpc_creation_and_list(two_wallet_nodes: Any, trusted: "wallet_id": nft_wallet_0_id, "artist_address": ph, "hash": "0xD4584AD463139FA8C0D9F68F4B59F184", - "uris": ["https://chialisp.com/img/logo.svg"], + "uris": ["https://flaxlisp.com/img/logo.svg"], } ) assert isinstance(tr2, dict) @@ -372,7 +372,7 @@ async def test_nft_wallet_rpc_creation_and_list(two_wallet_nodes: Any, trusted: uris.append(coin.data_uris[0]) assert coin.mint_height > 0 assert len(uris) == 2 - assert "https://chialisp.com/img/logo.svg" in uris + assert "https://flaxlisp.com/img/logo.svg" in uris assert bytes32.fromhex(coins[1].to_json_dict()["nft_coin_id"][2:]) in [x.name() for x in sb.additions()] @@ -382,8 +382,8 @@ async def test_nft_wallet_rpc_creation_and_list(two_wallet_nodes: Any, trusted: ) @pytest.mark.asyncio async def test_nft_wallet_rpc_update_metadata(two_wallet_nodes: Any, trusted: Any) -> None: - from chia.types.blockchain_format.sized_bytes import bytes32 - from chia.wallet.nft_wallet.nft_info import NFT_HRP + from flax.types.blockchain_format.sized_bytes import bytes32 + from flax.wallet.nft_wallet.nft_info import NFT_HRP num_blocks = 3 full_nodes, wallets = two_wallet_nodes @@ -435,7 +435,7 @@ async def test_nft_wallet_rpc_update_metadata(two_wallet_nodes: Any, trusted: An "wallet_id": nft_wallet_0_id, "artist_address": ph, "hash": "0xD4584AD463139FA8C0D9F68F4B59F185", - "uris": ["https://www.chia.net/img/branding/chia-logo.svg"], + "uris": ["https://www.flaxnetwork.org/img/branding/flax-logo.svg"], } ) @@ -457,7 +457,7 @@ async def test_nft_wallet_rpc_update_metadata(two_wallet_nodes: Any, trusted: An assert coin["chain_info"] == disassemble( Program.to( [ - ("u", ["https://www.chia.net/img/branding/chia-logo.svg"]), + ("u", ["https://www.flaxnetwork.org/img/branding/flax-logo.svg"]), ("h", hexstr_to_bytes("0xD4584AD463139FA8C0D9F68F4B59F185")), ("mu", []), ("lu", []), @@ -494,7 +494,7 @@ async def test_nft_wallet_rpc_update_metadata(two_wallet_nodes: Any, trusted: An assert coin["mint_height"] > 0 uris = coin["data_uris"] assert len(uris) == 1 - assert "https://www.chia.net/img/branding/chia-logo.svg" in uris + assert "https://www.flaxnetwork.org/img/branding/flax-logo.svg" in uris assert len(coin["metadata_uris"]) == 1 assert "http://metadata" == coin["metadata_uris"][0] assert len(coin["license_uris"]) == 0 @@ -620,8 +620,8 @@ async def test_nft_with_did_wallet_creation(two_wallet_nodes: Any, trusted: Any) { "wallet_id": nft_wallet_0_id, "hash": "0xD4584AD463139FA8C0D9F68F4B59F185", - "uris": ["https://www.chia.net/img/branding/chia-logo.svg"], - "target_address": encode_puzzle_hash(nft_ph, "txch"), + "uris": ["https://www.flaxnetwork.org/img/branding/flax-logo.svg"], + "target_address": encode_puzzle_hash(nft_ph, "txfx"), } ) assert resp.get("success") @@ -673,7 +673,7 @@ async def test_nft_with_did_wallet_creation(two_wallet_nodes: Any, trusted: Any) did_nft = coins[0].to_json_dict() assert did_nft["mint_height"] > 0 assert did_nft["supports_did"] - assert did_nft["data_uris"][0] == "https://www.chia.net/img/branding/chia-logo.svg" + assert did_nft["data_uris"][0] == "https://www.flaxnetwork.org/img/branding/flax-logo.svg" assert did_nft["data_hash"] == "0xD4584AD463139FA8C0D9F68F4B59F185".lower() assert did_nft["owner_did"][2:] == hex_did_id # Check unassigned NFT @@ -700,7 +700,7 @@ async def test_nft_with_did_wallet_creation(two_wallet_nodes: Any, trusted: Any) ) @pytest.mark.asyncio async def test_nft_rpc_mint(two_wallet_nodes: Any, trusted: Any) -> None: - from chia.wallet.did_wallet.did_info import DID_HRP + from flax.wallet.did_wallet.did_info import DID_HRP num_blocks = 3 full_nodes, wallets = two_wallet_nodes @@ -771,7 +771,7 @@ async def test_nft_rpc_mint(two_wallet_nodes: Any, trusted: Any) -> None: { "wallet_id": nft_wallet_0_id, "hash": data_hash_param, - "uris": ["https://www.chia.net/img/branding/chia-logo.svg"], + "uris": ["https://www.flaxnetwork.org/img/branding/flax-logo.svg"], "license_uris": license_uris, "license_hash": license_hash, "meta_hash": meta_hash, @@ -882,7 +882,7 @@ async def test_nft_transfer_nft_with_did(two_wallet_nodes: Any, trusted: Any) -> { "wallet_id": nft_wallet_0_id, "hash": "0xD4584AD463139FA8C0D9F68F4B59F185", - "uris": ["https://www.chia.net/img/branding/chia-logo.svg"], + "uris": ["https://www.flaxnetwork.org/img/branding/flax-logo.svg"], "fee": fee, } ) @@ -910,7 +910,7 @@ async def test_nft_transfer_nft_with_did(two_wallet_nodes: Any, trusted: Any) -> resp = await api_0.nft_transfer_nft( dict( wallet_id=nft_wallet_0_id, - target_address=encode_puzzle_hash(ph1, "xch"), + target_address=encode_puzzle_hash(ph1, "xfx"), nft_coin_id=coins[0].nft_coin_id.hex(), fee=fee, ) @@ -1043,8 +1043,8 @@ async def test_update_metadata_for_nft_did(two_wallet_nodes: Any, trusted: Any) { "wallet_id": nft_wallet_0_id, "hash": "0xD4584AD463139FA8C0D9F68F4B59F185", - "uris": ["https://www.chia.net/img/branding/chia-logo.svg"], - "mu": ["https://www.chia.net/img/branding/chia-logo.svg"], + "uris": ["https://www.flaxnetwork.org/img/branding/flax-logo.svg"], + "mu": ["https://www.flaxnetwork.org/img/branding/flax-logo.svg"], } ) assert resp.get("success") @@ -1098,7 +1098,7 @@ async def test_update_metadata_for_nft_did(two_wallet_nodes: Any, trusted: Any) assert coin["mint_height"] > 0 uris = coin["data_uris"] assert len(uris) == 1 - assert "https://www.chia.net/img/branding/chia-logo.svg" in uris + assert "https://www.flaxnetwork.org/img/branding/flax-logo.svg" in uris assert len(coin["metadata_uris"]) == 1 assert "http://metadata" == coin["metadata_uris"][0] assert len(coin["license_uris"]) == 0 @@ -1168,8 +1168,8 @@ async def test_nft_set_did(two_wallet_nodes: Any, trusted: Any) -> None: { "wallet_id": nft_wallet_0_id, "hash": "0xD4584AD463139FA8C0D9F68F4B59F185", - "uris": ["https://www.chia.net/img/branding/chia-logo.svg"], - "mu": ["https://www.chia.net/img/branding/chia-logo.svg"], + "uris": ["https://www.flaxnetwork.org/img/branding/flax-logo.svg"], + "mu": ["https://www.flaxnetwork.org/img/branding/flax-logo.svg"], "did_id": "", } ) @@ -1319,8 +1319,8 @@ async def test_set_nft_status(two_wallet_nodes: Any, trusted: Any) -> None: { "wallet_id": nft_wallet_0_id, "hash": "0xD4584AD463139FA8C0D9F68F4B59F185", - "uris": ["https://www.chia.net/img/branding/chia-logo.svg"], - "mu": ["https://www.chia.net/img/branding/chia-logo.svg"], + "uris": ["https://www.flaxnetwork.org/img/branding/flax-logo.svg"], + "mu": ["https://www.flaxnetwork.org/img/branding/flax-logo.svg"], } ) assert resp.get("success") diff --git a/tests/wallet/nft_wallet/test_ownership_outer_puzzle.py b/tests/wallet/nft_wallet/test_ownership_outer_puzzle.py index eaccb08ad..df35d66f0 100644 --- a/tests/wallet/nft_wallet/test_ownership_outer_puzzle.py +++ b/tests/wallet/nft_wallet/test_ownership_outer_puzzle.py @@ -2,12 +2,12 @@ from clvm_tools.binutils import assemble -from chia.types.blockchain_format.program import Program -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.ints import uint16 -from chia.wallet.nft_wallet.ownership_outer_puzzle import puzzle_for_ownership_layer -from chia.wallet.nft_wallet.transfer_program_puzzle import puzzle_for_transfer_program -from chia.wallet.outer_puzzles import ( +from flax.types.blockchain_format.program import Program +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.ints import uint16 +from flax.wallet.nft_wallet.ownership_outer_puzzle import puzzle_for_ownership_layer +from flax.wallet.nft_wallet.transfer_program_puzzle import puzzle_for_transfer_program +from flax.wallet.outer_puzzles import ( construct_puzzle, create_asset_id, get_inner_puzzle, @@ -15,7 +15,7 @@ match_puzzle, solve_puzzle, ) -from chia.wallet.puzzle_drivers import PuzzleInfo, Solver +from flax.wallet.puzzle_drivers import PuzzleInfo, Solver def test_ownership_outer_puzzle() -> None: diff --git a/tests/wallet/rl_wallet/test_rl_rpc.py b/tests/wallet/rl_wallet/test_rl_rpc.py index 78a6f58da..22a98a19b 100644 --- a/tests/wallet/rl_wallet/test_rl_rpc.py +++ b/tests/wallet/rl_wallet/test_rl_rpc.py @@ -2,16 +2,16 @@ 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.transaction_record import TransactionRecord -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.transaction_record import TransactionRecord +from flax.wallet.util.wallet_types import WalletType from tests.time_out_assert import time_out_assert from tests.wallet.sync.test_wallet_sync import wallet_height_at_least @@ -128,7 +128,7 @@ async def test_create_rl_coin(self, three_wallet_nodes, self_hostname): assert await wallet.get_confirmed_balance() == fund_owners_initial_balance - 101 assert await check_balance(api_user, user_wallet_id) == 100 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}) await asyncio.sleep(2) @@ -149,7 +149,7 @@ async def test_create_rl_coin(self, three_wallet_nodes, self_hostname): await time_out_assert(15, wallet_height_at_least, True, wallet_node, 68) assert await check_balance(api_user, user_wallet_id) == 195 # 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, "amount": 105, "fee": 0, "address": puzzle_hash} ) diff --git a/tests/wallet/rl_wallet/test_rl_wallet.py b/tests/wallet/rl_wallet/test_rl_wallet.py index ebf0ddd59..331bc252c 100644 --- a/tests/wallet/rl_wallet/test_rl_wallet.py +++ b/tests/wallet/rl_wallet/test_rl_wallet.py @@ -1,9 +1,9 @@ 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.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 17e73b7c4..f60195017 100644 --- a/tests/wallet/rpc/test_wallet_rpc.py +++ b/tests/wallet/rpc/test_wallet_rpc.py @@ -8,39 +8,39 @@ import pytest_asyncio from blspy import G2Element -from chia.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward -from chia.consensus.coinbase import create_puzzlehash_for_pk -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.server.server import ChiaServer -from chia.simulator.full_node_simulator import FullNodeSimulator -from chia.simulator.simulator_protocol import FarmNewBlockProtocol -from chia.types.announcement import Announcement -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.coin_spend import CoinSpend -from chia.types.peer_info import PeerInfo -from chia.types.spend_bundle import SpendBundle -from chia.util.bech32m import decode_puzzle_hash, encode_puzzle_hash -from chia.util.config import lock_and_load_config, save_config -from chia.util.hash import std_hash -from chia.util.ints import uint16, uint32, uint64 -from chia.wallet.cat_wallet.cat_constants import DEFAULT_CATS -from chia.wallet.cat_wallet.cat_wallet import CATWallet -from chia.wallet.derive_keys import master_sk_to_wallet_sk, master_sk_to_wallet_sk_unhardened -from chia.wallet.did_wallet.did_wallet import DIDWallet -from chia.wallet.nft_wallet.nft_wallet import NFTWallet -from chia.wallet.trading.trade_status import TradeStatus -from chia.wallet.transaction_record import TransactionRecord -from chia.wallet.transaction_sorting import SortKey -from chia.wallet.util.compute_memos import compute_memos -from chia.wallet.util.wallet_types import WalletType -from chia.wallet.wallet import Wallet -from chia.wallet.wallet_node import WalletNode +from flax.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward +from flax.consensus.coinbase import create_puzzlehash_for_pk +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.server.server import FlaxServer +from flax.simulator.full_node_simulator import FullNodeSimulator +from flax.simulator.simulator_protocol import FarmNewBlockProtocol +from flax.types.announcement import Announcement +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.coin_spend import CoinSpend +from flax.types.peer_info import PeerInfo +from flax.types.spend_bundle import SpendBundle +from flax.util.bech32m import decode_puzzle_hash, encode_puzzle_hash +from flax.util.config import lock_and_load_config, save_config +from flax.util.hash import std_hash +from flax.util.ints import uint16, uint32, uint64 +from flax.wallet.cat_wallet.cat_constants import DEFAULT_CATS +from flax.wallet.cat_wallet.cat_wallet import CATWallet +from flax.wallet.derive_keys import master_sk_to_wallet_sk, master_sk_to_wallet_sk_unhardened +from flax.wallet.did_wallet.did_wallet import DIDWallet +from flax.wallet.nft_wallet.nft_wallet import NFTWallet +from flax.wallet.trading.trade_status import TradeStatus +from flax.wallet.transaction_record import TransactionRecord +from flax.wallet.transaction_sorting import SortKey +from flax.wallet.util.compute_memos import compute_memos +from flax.wallet.util.wallet_types import WalletType +from flax.wallet.wallet import Wallet +from flax.wallet.wallet_node import WalletNode from tests.block_tools import BlockTools from tests.pools.test_pool_rpc import wallet_is_synced from tests.time_out_assert import time_out_assert @@ -57,7 +57,7 @@ class WalletBundle: @dataclasses.dataclass class FullNodeBundle: - server: ChiaServer + server: FlaxServer api: FullNodeSimulator rpc_client: FullNodeRpcClient @@ -259,7 +259,7 @@ async def test_send_transaction(wallet_rpc_environment: WalletRpcTestEnvironment generated_funds = await generate_funds(full_node_api, env.wallet_1) - addr = encode_puzzle_hash(await wallet_2.get_new_puzzlehash(), "txch") + addr = encode_puzzle_hash(await wallet_2.get_new_puzzlehash(), "txfx") tx_amount = uint64(15600000) with pytest.raises(ValueError): await client.send_transaction("1", uint64(100000000000000001), addr) @@ -485,7 +485,7 @@ async def test_get_transactions(wallet_rpc_environment: WalletRpcTestEnvironment # Test RELEVANCE await client.send_transaction( - "1", uint64(1), encode_puzzle_hash(await wallet.get_new_puzzlehash(), "txch") + "1", uint64(1), encode_puzzle_hash(await wallet.get_new_puzzlehash(), "txfx") ) # Create a pending tx all_transactions = await client.get_transactions("1", sort_key=SortKey.RELEVANCE) @@ -502,10 +502,10 @@ async def test_get_transactions(wallet_rpc_environment: WalletRpcTestEnvironment # Test get_transactions to address ph_by_addr = await wallet.get_new_puzzlehash() - await client.send_transaction("1", uint64(1), encode_puzzle_hash(ph_by_addr, "txch")) - await client.farm_block(encode_puzzle_hash(ph_by_addr, "txch")) + await client.send_transaction("1", uint64(1), encode_puzzle_hash(ph_by_addr, "txfx")) + await client.farm_block(encode_puzzle_hash(ph_by_addr, "txfx")) await time_out_assert(10, wallet_is_synced, True, wallet_node, full_node_api) - tx_for_address = await client.get_transactions("1", to_address=encode_puzzle_hash(ph_by_addr, "txch")) + tx_for_address = await client.get_transactions("1", to_address=encode_puzzle_hash(ph_by_addr, "txfx")) assert len(tx_for_address) == 1 assert tx_for_address[0].to_puzzle_hash == ph_by_addr @@ -653,7 +653,7 @@ async def test_offer_endpoints(wallet_rpc_environment: WalletRpcTestEnvironment) await farm_transaction(full_node_api, wallet_node, spend_bundle) await time_out_assert(10, get_confirmed_balance, 4, wallet_2_rpc, cat_wallet_id) - # Create an offer of 5 chia for one CAT + # Create an offer of 5 flax for one CAT offer, trade_record = await wallet_1_rpc.create_offer_for_ids( {uint32(1): -5, cat_asset_id.hex(): 1}, validate_only=True ) @@ -671,7 +671,7 @@ async def test_offer_endpoints(wallet_rpc_environment: WalletRpcTestEnvironment) assert offer is not None summary = await wallet_1_rpc.get_offer_summary(offer) - assert summary == {"offered": {"xch": 5}, "requested": {cat_asset_id.hex(): 1}, "infos": driver_dict, "fees": 1} + assert summary == {"offered": {"xfx": 5}, "requested": {cat_asset_id.hex(): 1}, "infos": driver_dict, "fees": 1} assert await wallet_1_rpc.check_offer_validity(offer) @@ -735,7 +735,7 @@ def only_ids(trades): @pytest.mark.asyncio async def test_did_endpoints(wallet_rpc_environment: WalletRpcTestEnvironment): - from chia.wallet.did_wallet.did_info import DID_HRP + from flax.wallet.did_wallet.did_info import DID_HRP env: WalletRpcTestEnvironment = wallet_rpc_environment @@ -807,7 +807,7 @@ async def test_did_endpoints(wallet_rpc_environment: WalletRpcTestEnvironment): await farm_transaction_block(full_node_api, wallet_1_node) # Transfer DID - addr = encode_puzzle_hash(await wallet_2.get_new_puzzlehash(), "txch") + addr = encode_puzzle_hash(await wallet_2.get_new_puzzlehash(), "txfx") res = await wallet_1_rpc.did_transfer_did(did_wallet_id_0, addr, 0, True) assert res["success"] @@ -831,7 +831,7 @@ async def test_did_endpoints(wallet_rpc_environment: WalletRpcTestEnvironment): @pytest.mark.asyncio async def test_nft_endpoints(wallet_rpc_environment: WalletRpcTestEnvironment): - from chia.wallet.nft_wallet.nft_info import NFT_HRP + from flax.wallet.nft_wallet.nft_info import NFT_HRP env: WalletRpcTestEnvironment = wallet_rpc_environment wallet_1_node: WalletNode = env.wallet_1.node @@ -850,7 +850,7 @@ async def test_nft_endpoints(wallet_rpc_environment: WalletRpcTestEnvironment): None, None, "0xD4584AD463139FA8C0D9F68F4B59F185", - ["https://www.chia.net/img/branding/chia-logo.svg"], + ["https://www.flaxnetwork.org/img/branding/flax-logo.svg"], ) assert res["success"] @@ -869,7 +869,7 @@ async def test_nft_endpoints(wallet_rpc_environment: WalletRpcTestEnvironment): nft_info = (await wallet_1_rpc.get_nft_info(hmr_nft_id))["nft_info"] assert nft_info["nft_coin_id"][2:] == nft_wallet.get_current_nfts()[0].coin.name().hex() - addr = encode_puzzle_hash(await wallet_2.get_new_puzzlehash(), "txch") + addr = encode_puzzle_hash(await wallet_2.get_new_puzzlehash(), "txfx") res = await wallet_1_rpc.transfer_nft(nft_wallet_id, nft_id, addr, 0) assert res["success"] @@ -910,7 +910,7 @@ async def test_key_and_address_endpoints(wallet_rpc_environment: WalletRpcTestEn assert (await client.get_height_info()) > 0 ph = await wallet.get_new_puzzlehash() - addr = encode_puzzle_hash(ph, "txch") + addr = encode_puzzle_hash(ph, "txfx") tx_amount = uint64(15600000) created_tx = await client.send_transaction("1", tx_amount, addr) @@ -943,11 +943,11 @@ async def test_key_and_address_endpoints(wallet_rpc_environment: WalletRpcTestEn sk = await wallet_node.get_key_for_fingerprint(pks[0]) test_ph = create_puzzlehash_for_pk(master_sk_to_wallet_sk(sk, uint32(0)).get_g1()) with lock_and_load_config(wallet_node.root_path, "config.yaml") as test_config: - test_config["farmer"]["xch_target_address"] = encode_puzzle_hash(test_ph, "txch") + test_config["farmer"]["xfx_target_address"] = encode_puzzle_hash(test_ph, "txfx") # set pool to second private key sk = await wallet_node.get_key_for_fingerprint(pks[1]) test_ph = create_puzzlehash_for_pk(master_sk_to_wallet_sk(sk, uint32(0)).get_g1()) - test_config["pool"]["xch_target_address"] = encode_puzzle_hash(test_ph, "txch") + test_config["pool"]["xfx_target_address"] = encode_puzzle_hash(test_ph, "txfx") save_config(wallet_node.root_path, "config.yaml", test_config) # Check first key @@ -973,11 +973,11 @@ async def test_key_and_address_endpoints(wallet_rpc_environment: WalletRpcTestEn sk = await wallet_node.get_key_for_fingerprint(pks[0]) test_ph = create_puzzlehash_for_pk(master_sk_to_wallet_sk_unhardened(sk, uint32(0)).get_g1()) with lock_and_load_config(wallet_node.root_path, "config.yaml") as test_config: - test_config["farmer"]["xch_target_address"] = encode_puzzle_hash(test_ph, "txch") + test_config["farmer"]["xfx_target_address"] = encode_puzzle_hash(test_ph, "txfx") # set pool to second private key sk = await wallet_node.get_key_for_fingerprint(pks[1]) test_ph = create_puzzlehash_for_pk(master_sk_to_wallet_sk_unhardened(sk, uint32(0)).get_g1()) - test_config["pool"]["xch_target_address"] = encode_puzzle_hash(test_ph, "txch") + test_config["pool"]["xfx_target_address"] = encode_puzzle_hash(test_ph, "txfx") save_config(wallet_node.root_path, "config.yaml", test_config) # Check first key diff --git a/tests/wallet/simple_sync/test_simple_sync_protocol.py b/tests/wallet/simple_sync/test_simple_sync_protocol.py index bcbd59c5b..4e9325ee5 100644 --- a/tests/wallet/simple_sync/test_simple_sync_protocol.py +++ b/tests/wallet/simple_sync/test_simple_sync_protocol.py @@ -6,22 +6,22 @@ from clvm.casts import int_to_bytes from colorlog import getLogger -from chia.consensus.block_rewards import calculate_pool_reward, calculate_base_farmer_reward -from chia.protocols import wallet_protocol -from chia.protocols.full_node_protocol import RespondTransaction -from chia.protocols.protocol_message_types import ProtocolMessageTypes -from chia.protocols.wallet_protocol import RespondToCoinUpdates, CoinStateUpdate, RespondToPhUpdates -from chia.server.outbound_message import NodeType -from chia.simulator.simulator_protocol import FarmNewBlockProtocol, ReorgProtocol -from chia.types.blockchain_format.coin import Coin -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.peer_info import PeerInfo -from chia.types.spend_bundle import SpendBundle -from chia.util.ints import uint16, uint32, uint64 -from chia.wallet.wallet import Wallet -from chia.wallet.wallet_state_manager import WalletStateManager +from flax.consensus.block_rewards import calculate_pool_reward, calculate_base_farmer_reward +from flax.protocols import wallet_protocol +from flax.protocols.full_node_protocol import RespondTransaction +from flax.protocols.protocol_message_types import ProtocolMessageTypes +from flax.protocols.wallet_protocol import RespondToCoinUpdates, CoinStateUpdate, RespondToPhUpdates +from flax.server.outbound_message import NodeType +from flax.simulator.simulator_protocol import FarmNewBlockProtocol, ReorgProtocol +from flax.types.blockchain_format.coin import Coin +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.peer_info import PeerInfo +from flax.types.spend_bundle import SpendBundle +from flax.util.ints import uint16, uint32, uint64 +from flax.wallet.wallet import Wallet +from flax.wallet.wallet_state_manager import WalletStateManager from tests.connection_utils import add_dummy_connection from tests.pools.test_pool_rpc import wallet_is_synced from tests.time_out_assert import time_out_assert @@ -196,7 +196,7 @@ async def test_subscribe_for_ph(self, wallet_node_simulator, self_hostname): await full_node_api.farm_new_transaction_block(FarmNewBlockProtocol(puzzle_hash)) # Let's make sure the wallet can handle a non ephemeral launcher - from chia.wallet.puzzles.singleton_top_layer import SINGLETON_LAUNCHER_HASH + from flax.wallet.puzzles.singleton_top_layer import SINGLETON_LAUNCHER_HASH await time_out_assert(10, wallet_is_synced, True, wallet_node, full_node_api) tx_record = await wallet.generate_signed_transaction(uint64(10), SINGLETON_LAUNCHER_HASH, uint64(0)) diff --git a/tests/wallet/sync/test_wallet_sync.py b/tests/wallet/sync/test_wallet_sync.py index 27e57a5de..6642f781f 100644 --- a/tests/wallet/sync/test_wallet_sync.py +++ b/tests/wallet/sync/test_wallet_sync.py @@ -1,11 +1,11 @@ import pytest from colorlog import getLogger -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 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 tests.connection_utils import disconnect_all, disconnect_all_and_reconnect from tests.pools.test_pool_rpc import wallet_is_synced from tests.setup_nodes import test_constants 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_coin_selection.py b/tests/wallet/test_coin_selection.py index 71815ba25..106ef9d1a 100644 --- a/tests/wallet/test_coin_selection.py +++ b/tests/wallet/test_coin_selection.py @@ -4,14 +4,14 @@ import pytest -from chia.consensus.default_constants import DEFAULT_CONSTANTS -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.hash import std_hash -from chia.util.ints import uint32, uint64, uint128 -from chia.wallet.coin_selection import check_for_exact_match, knapsack_coin_algorithm, select_coins -from chia.wallet.util.wallet_types import WalletType -from chia.wallet.wallet_coin_record import WalletCoinRecord +from flax.consensus.default_constants import DEFAULT_CONSTANTS +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.hash import std_hash +from flax.util.ints import uint32, uint64, uint128 +from flax.wallet.coin_selection import check_for_exact_match, knapsack_coin_algorithm, select_coins +from flax.wallet.util.wallet_types import WalletType +from flax.wallet.wallet_coin_record import WalletCoinRecord class TestCoinSelection: 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_nft_store.py b/tests/wallet/test_nft_store.py index 4946017e0..9d56a28f6 100644 --- a/tests/wallet/test_nft_store.py +++ b/tests/wallet/test_nft_store.py @@ -3,14 +3,14 @@ import aiosqlite import pytest -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.util.db_wrapper import DBWrapper -from chia.util.ints import uint32, uint64 -from chia.wallet.lineage_proof import LineageProof -from chia.wallet.nft_wallet.nft_info import NFTCoinInfo -from chia.wallet.wallet_nft_store import WalletNftStore +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.util.db_wrapper import DBWrapper +from flax.util.ints import uint32, uint64 +from flax.wallet.lineage_proof import LineageProof +from flax.wallet.nft_wallet.nft_info import NFTCoinInfo +from flax.wallet.wallet_nft_store import WalletNftStore class TestNftStore: diff --git a/tests/wallet/test_puzzle_store.py b/tests/wallet/test_puzzle_store.py index bd90a4f10..20e5aa12d 100644 --- a/tests/wallet/test_puzzle_store.py +++ b/tests/wallet/test_puzzle_store.py @@ -5,11 +5,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 class TestPuzzleStore: diff --git a/tests/wallet/test_singleton.py b/tests/wallet/test_singleton.py index 8f806e71c..4a6299b74 100644 --- a/tests/wallet/test_singleton.py +++ b/tests/wallet/test_singleton.py @@ -1,10 +1,10 @@ from clvm_tools import binutils -from chia.types.blockchain_format.program import Program, INFINITE_COST -from chia.types.announcement import Announcement -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.util.condition_tools import parse_sexp_to_conditions -from chia.wallet.puzzles.load_clvm import load_clvm +from flax.types.blockchain_format.program import Program, INFINITE_COST +from flax.types.announcement import Announcement +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.util.condition_tools import parse_sexp_to_conditions +from flax.wallet.puzzles.load_clvm import load_clvm SINGLETON_MOD = load_clvm("singleton_top_layer.clvm") LAUNCHER_PUZZLE = load_clvm("singleton_launcher.clvm") diff --git a/tests/wallet/test_singleton_lifecycle.py b/tests/wallet/test_singleton_lifecycle.py index 11a1b004a..d3d677d7b 100644 --- a/tests/wallet/test_singleton_lifecycle.py +++ b/tests/wallet/test_singleton_lifecycle.py @@ -4,16 +4,16 @@ from blspy import G2Element from clvm_tools import binutils -from chia.types.blockchain_format.program import Program, INFINITE_COST -from chia.types.announcement import Announcement -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.coin_spend import CoinSpend -from chia.types.condition_opcodes import ConditionOpcode -from chia.types.spend_bundle import SpendBundle - -from chia.util.ints import uint64 -from chia.wallet.puzzles.load_clvm import load_clvm +from flax.types.blockchain_format.program import Program, INFINITE_COST +from flax.types.announcement import Announcement +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.coin_spend import CoinSpend +from flax.types.condition_opcodes import ConditionOpcode +from flax.types.spend_bundle import SpendBundle + +from flax.util.ints import uint64 +from flax.wallet.puzzles.load_clvm import load_clvm from tests.core.full_node.test_conditions import check_spend_bundle_validity, initial_blocks diff --git a/tests/wallet/test_singleton_lifecycle_fast.py b/tests/wallet/test_singleton_lifecycle_fast.py index 79630205c..d847852bf 100644 --- a/tests/wallet/test_singleton_lifecycle_fast.py +++ b/tests/wallet/test_singleton_lifecycle_fast.py @@ -4,15 +4,15 @@ from blspy import G1Element, G2Element from clvm_tools import binutils -from chia.types.blockchain_format.program import Program, SerializedProgram -from chia.types.announcement import Announcement -from chia.types.blockchain_format.coin import Coin -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.coin_spend import CoinSpend -from chia.types.condition_opcodes import ConditionOpcode -from chia.types.spend_bundle import SpendBundle -from chia.util.ints import uint64 -from chia.wallet.puzzles.load_clvm import load_clvm +from flax.types.blockchain_format.program import Program, SerializedProgram +from flax.types.announcement import Announcement +from flax.types.blockchain_format.coin import Coin +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.coin_spend import CoinSpend +from flax.types.condition_opcodes import ConditionOpcode +from flax.types.spend_bundle import SpendBundle +from flax.util.ints import uint64 +from flax.wallet.puzzles.load_clvm import load_clvm from tests.clvm.coin_store import BadSpendBundleError, CoinStore, CoinTimestamp 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 7c37c35ab..0f5511768 100644 --- a/tests/wallet/test_wallet.py +++ b/tests/wallet/test_wallet.py @@ -4,22 +4,22 @@ import pytest -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.full_node_simulator import FullNodeSimulator -from chia.simulator.simulator_protocol import FarmNewBlockProtocol, ReorgProtocol -from chia.types.blockchain_format.program import Program -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.derive_keys import master_sk_to_wallet_sk -from chia.wallet.transaction_record import TransactionRecord -from chia.wallet.util.compute_memos import compute_memos -from chia.wallet.util.transaction_type import TransactionType -from chia.wallet.util.wallet_types import AmountWithPuzzlehash -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.full_node_simulator import FullNodeSimulator +from flax.simulator.simulator_protocol import FarmNewBlockProtocol, ReorgProtocol +from flax.types.blockchain_format.program import Program +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.derive_keys import master_sk_to_wallet_sk +from flax.wallet.transaction_record import TransactionRecord +from flax.wallet.util.compute_memos import compute_memos +from flax.wallet.util.transaction_type import TransactionType +from flax.wallet.util.wallet_types import AmountWithPuzzlehash +from flax.wallet.wallet_node import WalletNode +from flax.wallet.wallet_state_manager import WalletStateManager from tests.pools.test_pool_rpc import wallet_is_synced from tests.time_out_assert import time_out_assert, time_out_assert_not_none from tests.wallet.cat_wallet.test_cat_wallet import tx_in_pool @@ -33,14 +33,14 @@ class TestWalletSimulator: @pytest.mark.asyncio async def test_wallet_coinbase( self, - wallet_node_sim_and_wallet: Tuple[List[FullNodeSimulator], List[Tuple[WalletNode, ChiaServer]]], + wallet_node_sim_and_wallet: Tuple[List[FullNodeSimulator], List[Tuple[WalletNode, FlaxServer]]], trusted: bool, self_hostname: str, ) -> None: num_blocks = 10 full_nodes, wallets = wallet_node_sim_and_wallet 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] assert wallet_node.wallet_state_manager is not None @@ -96,7 +96,7 @@ async def check_tx_are_pool_farm_rewards() -> bool: @pytest.mark.asyncio async def test_wallet_make_transaction( self, - two_wallet_nodes: Tuple[List[FullNodeSimulator], List[Tuple[WalletNode, ChiaServer]]], + two_wallet_nodes: Tuple[List[FullNodeSimulator], List[Tuple[WalletNode, FlaxServer]]], trusted: bool, self_hostname: str, ) -> None: @@ -160,7 +160,7 @@ async def test_wallet_make_transaction( @pytest.mark.asyncio async def test_wallet_coinbase_reorg( self, - wallet_node_sim_and_wallet: Tuple[List[FullNodeSimulator], List[Tuple[WalletNode, ChiaServer]]], + wallet_node_sim_and_wallet: Tuple[List[FullNodeSimulator], List[Tuple[WalletNode, FlaxServer]]], trusted: bool, self_hostname: str, ) -> None: @@ -207,7 +207,7 @@ async def test_wallet_coinbase_reorg( @pytest.mark.asyncio async def test_wallet_send_to_three_peers( self, - three_sim_two_wallets: Tuple[List[FullNodeSimulator], List[Tuple[WalletNode, ChiaServer]]], + three_sim_two_wallets: Tuple[List[FullNodeSimulator], List[Tuple[WalletNode, FlaxServer]]], trusted: bool, self_hostname: str, ) -> None: @@ -283,7 +283,7 @@ async def test_wallet_send_to_three_peers( @pytest.mark.asyncio async def test_wallet_make_transaction_hop( self, - two_wallet_nodes_five_freeze: Tuple[List[FullNodeSimulator], List[Tuple[WalletNode, ChiaServer]]], + two_wallet_nodes_five_freeze: Tuple[List[FullNodeSimulator], List[Tuple[WalletNode, FlaxServer]]], trusted: bool, self_hostname: str, ) -> None: @@ -392,7 +392,7 @@ async def test_wallet_make_transaction_hop( # 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 @@ -411,7 +411,7 @@ async def test_wallet_make_transaction_hop( @pytest.mark.asyncio async def test_wallet_make_transaction_with_fee( self, - two_wallet_nodes: Tuple[List[FullNodeSimulator], List[Tuple[WalletNode, ChiaServer]]], + two_wallet_nodes: Tuple[List[FullNodeSimulator], List[Tuple[WalletNode, FlaxServer]]], trusted: bool, self_hostname: str, ) -> None: @@ -488,7 +488,7 @@ async def test_wallet_make_transaction_with_fee( @pytest.mark.asyncio async def test_wallet_create_hit_max_send_amount( self, - two_wallet_nodes: Tuple[List[FullNodeSimulator], List[Tuple[WalletNode, ChiaServer]]], + two_wallet_nodes: Tuple[List[FullNodeSimulator], List[Tuple[WalletNode, FlaxServer]]], trusted: bool, self_hostname: str, ) -> None: @@ -593,7 +593,7 @@ async def test_wallet_create_hit_max_send_amount( @pytest.mark.asyncio async def test_wallet_prevent_fee_theft( self, - two_wallet_nodes: Tuple[List[FullNodeSimulator], List[Tuple[WalletNode, ChiaServer]]], + two_wallet_nodes: Tuple[List[FullNodeSimulator], List[Tuple[WalletNode, FlaxServer]]], trusted: bool, self_hostname: str, ) -> None: @@ -688,7 +688,7 @@ async def test_wallet_prevent_fee_theft( @pytest.mark.asyncio async def test_wallet_tx_reorg( self, - two_wallet_nodes: Tuple[List[FullNodeSimulator], List[Tuple[WalletNode, ChiaServer]]], + two_wallet_nodes: Tuple[List[FullNodeSimulator], List[Tuple[WalletNode, FlaxServer]]], trusted: bool, self_hostname: str, ) -> None: @@ -797,13 +797,13 @@ async def test_wallet_tx_reorg( @pytest.mark.asyncio async def test_address_sliding_window( self, - wallet_node_100_pk: Tuple[List[FullNodeSimulator], List[Tuple[WalletNode, ChiaServer]]], + wallet_node_100_pk: Tuple[List[FullNodeSimulator], List[Tuple[WalletNode, FlaxServer]]], trusted: bool, self_hostname: str, ) -> None: full_nodes, wallets = wallet_node_100_pk 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] assert wallet_node.wallet_state_manager is not None if trusted: @@ -846,7 +846,7 @@ async def test_address_sliding_window( @pytest.mark.asyncio async def test_wallet_transaction_options( self, - two_wallet_nodes: Tuple[List[FullNodeSimulator], List[Tuple[WalletNode, ChiaServer]]], + two_wallet_nodes: Tuple[List[FullNodeSimulator], List[Tuple[WalletNode, FlaxServer]]], trusted: bool, self_hostname: str, ) -> None: diff --git a/tests/wallet/test_wallet_blockchain.py b/tests/wallet/test_wallet_blockchain.py index e5a84f598..0d6e26a0a 100644 --- a/tests/wallet/test_wallet_blockchain.py +++ b/tests/wallet/test_wallet_blockchain.py @@ -4,14 +4,14 @@ import aiosqlite import pytest -from chia.consensus.blockchain import ReceiveBlockResult -from chia.protocols import full_node_protocol -from chia.types.blockchain_format.vdf import VDFProof -from chia.types.weight_proof import WeightProof -from chia.util.db_wrapper import DBWrapper -from chia.util.generator_tools import get_block_header -from chia.wallet.key_val_store import KeyValStore -from chia.wallet.wallet_blockchain import WalletBlockchain +from flax.consensus.blockchain import ReceiveBlockResult +from flax.protocols import full_node_protocol +from flax.types.blockchain_format.vdf import VDFProof +from flax.types.weight_proof import WeightProof +from flax.util.db_wrapper import DBWrapper +from flax.util.generator_tools import get_block_header +from flax.wallet.key_val_store import KeyValStore +from flax.wallet.wallet_blockchain import WalletBlockchain from tests.setup_nodes import test_constants diff --git a/tests/wallet/test_wallet_interested_store.py b/tests/wallet/test_wallet_interested_store.py index 112ed558d..d308fde5c 100644 --- a/tests/wallet/test_wallet_interested_store.py +++ b/tests/wallet/test_wallet_interested_store.py @@ -3,11 +3,11 @@ import aiosqlite import pytest -from chia.types.blockchain_format.coin import Coin -from chia.util.db_wrapper import DBWrapper -from chia.util.ints import uint64 +from flax.types.blockchain_format.coin import Coin +from flax.util.db_wrapper import DBWrapper +from flax.util.ints import uint64 -from chia.wallet.wallet_interested_store import WalletInterestedStore +from flax.wallet.wallet_interested_store import WalletInterestedStore class TestWalletInterestedStore: diff --git a/tests/wallet/test_wallet_key_val_store.py b/tests/wallet/test_wallet_key_val_store.py index 4f688e0ed..388b723de 100644 --- a/tests/wallet/test_wallet_key_val_store.py +++ b/tests/wallet/test_wallet_key_val_store.py @@ -2,10 +2,10 @@ import aiosqlite import pytest -from chia.types.full_block import FullBlock -from chia.types.header_block import HeaderBlock -from chia.util.db_wrapper import DBWrapper -from chia.wallet.key_val_store import KeyValStore +from flax.types.full_block import FullBlock +from flax.types.header_block import HeaderBlock +from flax.util.db_wrapper import DBWrapper +from flax.wallet.key_val_store import KeyValStore class TestWalletKeyValStore: diff --git a/tests/wallet/test_wallet_retry.py b/tests/wallet/test_wallet_retry.py index 13804d691..b14c0dd48 100644 --- a/tests/wallet/test_wallet_retry.py +++ b/tests/wallet/test_wallet_retry.py @@ -3,13 +3,13 @@ import pytest -from chia.full_node.full_node_api import FullNodeAPI -from chia.simulator.full_node_simulator import FullNodeSimulator -from chia.types.peer_info import PeerInfo -from chia.types.spend_bundle import SpendBundle -from chia.util.ints import uint16, uint64 -from chia.wallet.transaction_record import TransactionRecord -from chia.wallet.wallet_node import WalletNode +from flax.full_node.full_node_api import FullNodeAPI +from flax.simulator.full_node_simulator import FullNodeSimulator +from flax.types.peer_info import PeerInfo +from flax.types.spend_bundle import SpendBundle +from flax.util.ints import uint16, uint64 +from flax.wallet.transaction_record import TransactionRecord +from flax.wallet.wallet_node import WalletNode from tests.block_tools import BlockTools from tests.pools.test_pool_rpc import farm_blocks, wallet_is_synced from tests.time_out_assert import time_out_assert, time_out_assert_custom_interval 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/wallet/test_wallet_user_store.py b/tests/wallet/test_wallet_user_store.py index 399557852..e39a7d9de 100644 --- a/tests/wallet/test_wallet_user_store.py +++ b/tests/wallet/test_wallet_user_store.py @@ -3,9 +3,9 @@ import aiosqlite import pytest -from chia.util.db_wrapper import DBWrapper -from chia.wallet.util.wallet_types import WalletType -from chia.wallet.wallet_user_store import WalletUserStore +from flax.util.db_wrapper import DBWrapper +from flax.wallet.util.wallet_types import WalletType +from flax.wallet.wallet_user_store import WalletUserStore @pytest.mark.asyncio diff --git a/tests/wallet_tools.py b/tests/wallet_tools.py index aff5ab4cb..00f6b9158 100644 --- a/tests/wallet_tools.py +++ b/tests/wallet_tools.py @@ -3,20 +3,20 @@ from blspy import AugSchemeMPL, G2Element, PrivateKey, G1Element from clvm.casts import int_from_bytes, int_to_bytes -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, SerializedProgram -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.coin_spend import CoinSpend -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.condition_tools import conditions_by_opcode, conditions_for_solution -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, SerializedProgram +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.coin_spend import CoinSpend +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.condition_tools import conditions_by_opcode, conditions_for_solution +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, diff --git a/tests/weight_proof/test_weight_proof.py b/tests/weight_proof/test_weight_proof.py index 0734c0005..348d53b55 100644 --- a/tests/weight_proof/test_weight_proof.py +++ b/tests/weight_proof/test_weight_proof.py @@ -4,25 +4,25 @@ import aiosqlite import pytest -from chia.consensus.block_record import BlockRecord -from chia.consensus.default_constants import DEFAULT_CONSTANTS -from chia.consensus.full_block_to_block_record import block_to_block_record -from chia.full_node.block_store import BlockStore -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 flax.consensus.block_record import BlockRecord +from flax.consensus.default_constants import DEFAULT_CONSTANTS +from flax.consensus.full_block_to_block_record import block_to_block_record +from flax.full_node.block_store import BlockStore +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 tests.block_tools import test_constants -from chia.util.generator_tools import get_block_header +from flax.util.generator_tools import get_block_header -from chia.consensus.pot_iterations import calculate_iterations_quality -from chia.full_node.weight_proof import ( +from flax.consensus.pot_iterations import calculate_iterations_quality +from flax.full_node.weight_proof import ( WeightProofHandler, _map_sub_epoch_summaries, _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 def count_sub_epochs(blockchain, last_hash) -> int: diff --git a/tools/analyze-chain.py b/tools/analyze-chain.py old mode 100755 new mode 100644 index ccf2de828..9bf2f18b4 --- a/tools/analyze-chain.py +++ b/tools/analyze-chain.py @@ -12,11 +12,11 @@ from chia_rs import run_generator, MEMPOOL_MODE -from chia.types.full_block import FullBlock -from chia.types.blockchain_format.program import Program -from chia.consensus.default_constants import DEFAULT_CONSTANTS -from chia.wallet.puzzles.rom_bootstrap_generator import get_generator -from chia.util.ints import uint32 +from flax.types.full_block import FullBlock +from flax.types.blockchain_format.program import Program +from flax.consensus.default_constants import DEFAULT_CONSTANTS +from flax.wallet.puzzles.rom_bootstrap_generator import get_generator +from flax.util.ints import uint32 GENERATOR_ROM = bytes(get_generator()) diff --git a/tools/generate_chain.py b/tools/generate_chain.py index b842778a1..50c0addc9 100644 --- a/tools/generate_chain.py +++ b/tools/generate_chain.py @@ -10,11 +10,11 @@ import click import zstd -from chia.types.blockchain_format.coin import Coin -from chia.types.spend_bundle import SpendBundle -from chia.util.chia_logging import initialize_logging -from chia.util.ints import uint32, uint64 -from chia.util.path import mkdir +from flax.types.blockchain_format.coin import Coin +from flax.types.spend_bundle import SpendBundle +from flax.util.flax_logging import initialize_logging +from flax.util.ints import uint32, uint64 +from flax.util.path import mkdir from tests.block_tools import create_block_tools from tests.util.keyring import TempKeyring from tools.test_constants import test_constants diff --git a/tools/run_benchmark.sh b/tools/run_benchmark.sh old mode 100755 new mode 100644 diff --git a/tools/run_block.py b/tools/run_block.py index 15de2a328..035dc445b 100644 --- a/tools/run_block.py +++ b/tools/run_block.py @@ -1,9 +1,9 @@ #!/usr/bin/env python """ -run_block: Convert an encoded FullBlock from the Chia blockchain into a list of transactions +run_block: Convert an encoded FullBlock from the Flax blockchain into a list of transactions -As input, takes a file containing a [FullBlock](../chia/types/full_block.py) in json format +As input, takes a file containing a [FullBlock](../flax/types/full_block.py) in json format ``` curl --insecure --cert $config_root/config/ssl/full_node/private_full_node.crt \ @@ -11,8 +11,8 @@ -d '{ "header_hash": "'$hash'" }' -H "Content-Type: application/json" \ -X POST https://localhost:$port/get_block -$ca_root is the directory containing your current Chia config files -$hash is the header_hash of the [BlockRecord](../chia/consensus/block_record.py) +$ca_root is the directory containing your current Flax config files +$hash is the header_hash of the [BlockRecord](../flax/consensus/block_record.py) $port is the Full Node RPC API port ``` @@ -27,7 +27,7 @@ The information for each spend is an "NPC" (Name, Puzzle, Condition): "coin_name": a unique 32 byte identifier - "conditions": a list of condition expressions, as in [condition_opcodes.py](../chia/types/condition_opcodes.py) + "conditions": a list of condition expressions, as in [condition_opcodes.py](../flax/types/condition_opcodes.py) "puzzle_hash": the sha256 of the CLVM bytecode that controls spending this coin Condition Opcodes, such as AGG_SIG_ME, or CREATE_COIN are created by running the "puzzle", i.e. the CLVM bytecode @@ -44,19 +44,19 @@ from chia_rs import COND_CANON_INTS, NO_NEG_DIV from clvm.casts import int_from_bytes -from chia.consensus.constants import ConsensusConstants -from chia.consensus.default_constants import DEFAULT_CONSTANTS -from chia.full_node.generator import create_generator_args -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.condition_opcodes import ConditionOpcode -from chia.types.condition_with_args import ConditionWithArgs -from chia.types.generator_types import BlockGenerator -from chia.util.config import load_config -from chia.util.default_root import DEFAULT_ROOT_PATH -from chia.util.ints import uint32, uint64 -from chia.wallet.cat_wallet.cat_utils import match_cat_puzzle +from flax.consensus.constants import ConsensusConstants +from flax.consensus.default_constants import DEFAULT_CONSTANTS +from flax.full_node.generator import create_generator_args +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.condition_opcodes import ConditionOpcode +from flax.types.condition_with_args import ConditionWithArgs +from flax.types.generator_types import BlockGenerator +from flax.util.config import load_config +from flax.util.default_root import DEFAULT_ROOT_PATH +from flax.util.ints import uint32, uint64 +from flax.wallet.cat_wallet.cat_utils import match_cat_puzzle @dataclass @@ -100,13 +100,7 @@ def run_generator( block_generator: BlockGenerator, constants: ConsensusConstants, max_cost: int, height: uint32 ) -> List[CAT]: - if height >= DEFAULT_CONSTANTS.SOFT_FORK_HEIGHT: - # conditions must use integers in canonical encoding (i.e. no redundant - # leading zeros) - # the division operator may not be used with negative operands - flags = COND_CANON_INTS | NO_NEG_DIV - else: - flags = 0 + flags = 0 args = create_generator_args(block_generator.generator_refs).first() _, block_result = block_generator.program.run_with_cost(max_cost, flags, args) diff --git a/tools/test_constants.py b/tools/test_constants.py index 0d86a8fab..839ed09ee 100644 --- a/tools/test_constants.py +++ b/tools/test_constants.py @@ -1,4 +1,4 @@ -from chia.consensus.default_constants import DEFAULT_CONSTANTS +from flax.consensus.default_constants import DEFAULT_CONSTANTS test_constants = DEFAULT_CONSTANTS.replace( **{ diff --git a/tools/test_full_sync.py b/tools/test_full_sync.py old mode 100755 new mode 100644 index 1b79f1497..45a047fec --- a/tools/test_full_sync.py +++ b/tools/test_full_sync.py @@ -14,17 +14,17 @@ import click import zstd -import chia.server.ws_connection as ws -from chia.cmds.init_funcs import chia_init -from chia.consensus.default_constants import DEFAULT_CONSTANTS -from chia.full_node.full_node import FullNode -from chia.protocols import full_node_protocol -from chia.server.outbound_message import Message, NodeType -from chia.types.blockchain_format.sized_bytes import bytes32 -from chia.types.full_block import FullBlock -from chia.types.peer_info import PeerInfo -from chia.util.config import load_config -from chia.util.ints import uint16 +import flax.server.ws_connection as ws +from flax.cmds.init_funcs import flax_init +from flax.consensus.default_constants import DEFAULT_CONSTANTS +from flax.full_node.full_node import FullNode +from flax.protocols import full_node_protocol +from flax.server.outbound_message import Message, NodeType +from flax.types.blockchain_format.sized_bytes import bytes32 +from flax.types.full_block import FullBlock +from flax.types.peer_info import PeerInfo +from flax.util.config import load_config +from flax.util.ints import uint16 from tests.block_tools import make_unfinished_block from tools.test_constants import test_constants as TEST_CONSTANTS @@ -91,7 +91,7 @@ async def run_sync_test( with tempfile.TemporaryDirectory() as root_dir: root_path = Path(root_dir) - chia_init(root_path, should_check_keys=False, v1_db=(db_version == 1)) + flax_init(root_path, should_check_keys=False, v1_db=(db_version == 1)) config = load_config(root_path, "config.yaml") if test_constants: @@ -112,7 +112,7 @@ async def run_sync_test( await full_node._start() full_node.set_server(FakeServer()) # type: ignore[arg-type] - peer: ws.WSChiaConnection = FakePeer() # type: ignore[assignment] + peer: ws.WSFlaxConnection = FakePeer() # type: ignore[assignment] print() counter = 0