Skip to content

Commit

Permalink
Rename src to chia.
Browse files Browse the repository at this point in the history
  • Loading branch information
richardkiss authored and hoffmang9 committed Apr 5, 2021
1 parent ad7d7e0 commit 8a3e005
Show file tree
Hide file tree
Showing 26 changed files with 369 additions and 121 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/upload-pypi-source.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ jobs:
- name: Lint source with flake8
run: |
flake8 src tests
flake8 chia tests
- name: Lint source with mypy
run: |
mypy --exclude config.py tests
mypy src
mypy chia
- name: Build source distribution
run: |
Expand Down
2 changes: 1 addition & 1 deletion build_scripts/build_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ if [ "$LAST_EXIT_CODE" -ne 0 ]; then
fi

electron-packager . chia-blockchain --asar.unpack="**/daemon/**" --platform=linux \
--icon=src/assets/img/Chia.icns --overwrite --app-bundle-id=net.chia.blockchain \
--icon=chia/assets/img/Chia.icns --overwrite --app-bundle-id=net.chia.blockchain \
--appVersion=$CHIA_INSTALLER_VERSION
LAST_EXIT_CODE=$?
if [ "$LAST_EXIT_CODE" -ne 0 ]; then
Expand Down
4 changes: 2 additions & 2 deletions build_scripts/build_macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ mkdir dist

echo "Create executables with pyinstaller"
pip install pyinstaller==4.2
SPEC_FILE=$(python -c 'import src; print(src.PYINSTALLER_SPEC_PATH)')
SPEC_FILE=$(python -c 'import chia; print(chia.PYINSTALLER_SPEC_PATH)')
pyinstaller --log-level=INFO "$SPEC_FILE"
LAST_EXIT_CODE=$?
if [ "$LAST_EXIT_CODE" -ne 0 ]; then
Expand All @@ -45,7 +45,7 @@ if [ "$LAST_EXIT_CODE" -ne 0 ]; then
fi

electron-packager . Chia --asar.unpack="**/daemon/**" --platform=darwin \
--icon=src/assets/img/Chia.icns --overwrite --app-bundle-id=net.chia.blockchain \
--icon=chia/assets/img/Chia.icns --overwrite --app-bundle-id=net.chia.blockchain \
--appVersion=$CHIA_INSTALLER_VERSION
LAST_EXIT_CODE=$?
if [ "$LAST_EXIT_CODE" -ne 0 ]; then
Expand Down
4 changes: 2 additions & 2 deletions build_scripts/build_windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ pip install --no-index --find-links=.\win_build\ chia-blockchain
Write-Output " ---"
Write-Output "Use pyinstaller to create chia .exe's"
Write-Output " ---"
$SPEC_FILE = (python -c 'import src; print(src.PYINSTALLER_SPEC_PATH)') -join "`n"
$SPEC_FILE = (python -c 'import chia; print(chia.PYINSTALLER_SPEC_PATH)') -join "`n"
pyinstaller --log-level INFO $SPEC_FILE

Write-Output " ---"
Expand Down Expand Up @@ -108,7 +108,7 @@ Write-Output "packageName is $packageName"

Write-Output " ---"
Write-Output "electron-packager"
electron-packager . Chia --asar.unpack="**\daemon\**" --overwrite --icon=.\src\assets\img\chia.ico --app-version=$packageVersion
electron-packager . Chia --asar.unpack="**\daemon\**" --overwrite --icon=.\chia\assets\img\chia.ico --app-version=$packageVersion
Write-Output " ---"

Write-Output " ---"
Expand Down
244 changes: 244 additions & 0 deletions build_scripts/daemon.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,244 @@
# -*- mode: python ; coding: utf-8 -*-
#from chia.cmds.chia import SUBCOMMANDS
import pathlib

from pkg_resources import get_distribution

from os import listdir
from os.path import isfile, join
from PyInstaller.utils.hooks import copy_metadata

# Include all files that end with clvm.hex
puzzles_path = "../chia/wallet/puzzles"
puzzle_dist_path = "./chia/wallet/puzzles"
onlyfiles = [f for f in listdir(puzzles_path) if isfile(join(puzzles_path, f))]

hex_puzzles = []
for file in onlyfiles:
if file.endswith("clvm.hex"):
puzzle_path = f"{puzzles_path}/{file}"
hex_puzzles.append((puzzles_path, puzzle_dist_path))

build = pathlib.Path().absolute()
root = build.parent

version_data = copy_metadata(get_distribution("chia-blockchain"))[0]

SUBCOMMANDS = [
"configure",
"farm",
"init",
"keys",
"netspace",
"plots",
"run_daemon",
"show",
"start",
"stop",
"version",
"wallet",
]
block_cipher = None
subcommand_modules = [f"{root}/chia.cmds.%s" % _ for _ in SUBCOMMANDS]
subcommand_modules.extend([f"chia.cmds.%s" % _ for _ in SUBCOMMANDS])
other = ["aiter.active_aiter", "aiter.aiter_forker", "aiter.aiter_to_iter", "aiter.azip", "aiter.flatten_aiter", "aiter.gated_aiter",
"aiter.iter_to_aiter", "aiter.join_aiters", "aiter.map_aiter", "aiter.map_filter_aiter", "aiter.preload_aiter",
"aiter.push_aiter", "aiter.sharable_aiter", "aiter.stoppable_aiter", "pkg_resources.py2_warn"]

entry_points = ["chia.cmds.chia",
"chia.server.start_wallet",
"chia.server.start_full_node",
"chia.server.start_harvester",
"chia.server.start_farmer",
"chia.server.start_introducer",
"chia.server.start_timelord",
"chia.timelord_launcher",
"chia.simulator.start_simulator"]

subcommand_modules.extend(other)
subcommand_modules.extend(entry_points)



daemon = Analysis([f"{root}/chia/daemon/server.py"],
pathex=[f"{root}/venv/lib/python3.8/site-packages/aiter/", f"{root}"],
binaries = [],
datas=[version_data, (f"../chia/util/initial-config.yaml", f"./chia/util/"), ] +
hex_puzzles,
hiddenimports=subcommand_modules,
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False)

full_node = Analysis([f"{root}/chia/server/start_full_node.py"],
pathex=[f"{root}/venv/lib/python3.8/site-packages/aiter/", f"{root}"],
binaries = [],
datas=[version_data],
hiddenimports=subcommand_modules,
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False)

wallet = Analysis([f"{root}/chia/server/start_wallet.py"],
pathex=[f"{root}/venv/lib/python3.8/site-packages/aiter/", f"{root}"],
binaries = [],
datas=[(f"../mozilla-ca/cacert.pem", f"./mozilla-ca/"), (f"../chia/ssl/dst_root_ca.pem", f"./chia/ssl/"), (f"../chia/ssl/chia_ca.key", f"./chia/ssl/"), (f"../chia/ssl/chia_ca.crt", f"./chia/ssl/"), (f"../chia/util/english.txt", f"./chia/util/"), version_data ] + hex_puzzles,
hiddenimports=subcommand_modules,
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False)

chia = Analysis([f"{root}/chia/cmds/chia.py"],
pathex=[f"{root}/venv/lib/python3.8/site-packages/aiter/", f"{root}"],
binaries = [],
datas=[version_data],
hiddenimports=subcommand_modules,
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False)

farmer = Analysis([f"{root}/chia/server/start_farmer.py"],
pathex=[f"{root}/venv/lib/python3.8/site-packages/aiter/", f"{root}"],
binaries = [],
datas=[version_data],
hiddenimports=subcommand_modules,
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False)

harvester = Analysis([f"{root}/chia/server/start_harvester.py"],
pathex=[f"{root}/venv/lib/python3.8/site-packages/aiter/", f"{root}"],
binaries = [],
datas=[version_data],
hiddenimports=subcommand_modules,
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False)

daemon_pyz = PYZ(daemon.pure, daemon.zipped_data,
cipher=block_cipher)
full_node_pyz = PYZ(full_node.pure, full_node.zipped_data,
cipher=block_cipher)
wallet_pyz = PYZ(wallet.pure, wallet.zipped_data,
cipher=block_cipher)
chia_pyz = PYZ(chia.pure, chia.zipped_data,
cipher=block_cipher)
farmer_pyz = PYZ(farmer.pure, farmer.zipped_data,
cipher=block_cipher)
harvester_pyz = PYZ(harvester.pure, harvester.zipped_data,
cipher=block_cipher)

daemon_exe = EXE(daemon_pyz,
daemon.scripts,
[],
exclude_binaries=True,
name='daemon',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=True )

full_node_exe = EXE(full_node_pyz,
full_node.scripts,
[],
exclude_binaries=True,
name='start_full_node',
debug=False,
bootloader_ignore_signals=False,
strip=False)

wallet_exe = EXE(wallet_pyz,
wallet.scripts,
[],
exclude_binaries=True,
name='start_wallet',
debug=False,
bootloader_ignore_signals=False,
strip=False)

chia_exe = EXE(chia_pyz,
chia.scripts,
[],
exclude_binaries=True,
name='chia',
debug=False,
bootloader_ignore_signals=False,
strip=False)

farmer_exe = EXE(farmer_pyz,
farmer.scripts,
[],
exclude_binaries=True,
name='start_farmer',
debug=False,
bootloader_ignore_signals=False,
strip=False)

harvester_exe = EXE(harvester_pyz,
harvester.scripts,
[],
exclude_binaries=True,
name='start_harvester',
debug=False,
bootloader_ignore_signals=False,
strip=False)

coll = COLLECT(daemon_exe,
daemon.binaries,
daemon.zipfiles,
daemon.datas,

full_node_exe,
full_node.binaries,
full_node.zipfiles,
full_node.datas,

wallet_exe,
wallet.binaries,
wallet.zipfiles,
wallet.datas,

chia_exe,
chia.binaries,
chia.zipfiles,
chia.datas,

farmer_exe,
farmer.binaries,
farmer.zipfiles,
farmer.datas,

harvester_exe,
harvester.binaries,
harvester.zipfiles,
harvester.datas,

strip = False,
upx_exclude = [],
name = 'daemon'
)
76 changes: 38 additions & 38 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,51 +54,51 @@
),
packages=[
"build_scripts",
"src",
"src.cmds",
"src.consensus",
"src.daemon",
"src.full_node",
"src.timelord",
"src.farmer",
"src.harvester",
"src.introducer",
"src.plotting",
"src.protocols",
"src.rpc",
"src.server",
"src.simulator",
"src.types.blockchain_format",
"src.types",
"src.util",
"src.wallet",
"src.wallet.puzzles",
"src.wallet.rl_wallet",
"src.wallet.cc_wallet",
"src.wallet.settings",
"src.wallet.trading",
"src.wallet.util",
"src.ssl",
"chia",
"chia.cmds",
"chia.consensus",
"chia.daemon",
"chia.full_node",
"chia.timelord",
"chia.farmer",
"chia.harvester",
"chia.introducer",
"chia.plotting",
"chia.protocols",
"chia.rpc",
"chia.server",
"chia.simulator",
"chia.types.blockchain_format",
"chia.types",
"chia.util",
"chia.wallet",
"chia.wallet.puzzles",
"chia.wallet.rl_wallet",
"chia.wallet.cc_wallet",
"chia.wallet.settings",
"chia.wallet.trading",
"chia.wallet.util",
"chia.ssl",
"mozilla-ca",
],
entry_points={
"console_scripts": [
"chia = src.cmds.chia:main",
"chia_wallet = src.server.start_wallet:main",
"chia_full_node = src.server.start_full_node:main",
"chia_harvester = src.server.start_harvester:main",
"chia_farmer = src.server.start_farmer:main",
"chia_introducer = src.server.start_introducer:main",
"chia_timelord = src.server.start_timelord:main",
"chia_timelord_launcher = src.timelord.timelord_launcher:main",
"chia_full_node_simulator = src.simulator.start_simulator:main",
"chia = chia.cmds.chia:main",
"chia_wallet = chia.server.start_wallet:main",
"chia_full_node = chia.server.start_full_node:main",
"chia_harvester = chia.server.start_harvester:main",
"chia_farmer = chia.server.start_farmer:main",
"chia_introducer = chia.server.start_introducer:main",
"chia_timelord = chia.server.start_timelord:main",
"chia_timelord_launcher = chia.timelord.timelord_launcher:main",
"chia_full_node_simulator = chia.simulator.start_simulator:main",
]
},
package_data={
"src": ["pyinstaller.spec"],
"src.wallet.puzzles": ["*.clvm", "*.clvm.hex"],
"src.util": ["initial-*.yaml", "english.txt"],
"src.ssl": ["chia_ca.crt", "chia_ca.key", "dst_root_ca.pem"],
"chia": ["pyinstaller.spec"],
"chia.wallet.puzzles": ["*.clvm", "*.clvm.hex"],
"chia.util": ["initial-*.yaml", "english.txt"],
"chia.ssl": ["chia_ca.crt", "chia_ca.key", "dst_root_ca.pem"],
"mozilla-ca": ["cacert.pem"],
},
use_scm_version={"fallback_version": "unknown-no-.git-directory"},
Expand Down
Loading

0 comments on commit 8a3e005

Please sign in to comment.