Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions src/icpp/commands_build_native.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import sys
import platform
import os
import json
from pathlib import Path
import subprocess
import shutil
Expand Down Expand Up @@ -247,3 +248,23 @@ def c_compile_file_mine(file: str) -> None:

# ----------------------------------------------------------------------
typer.echo("-----")

icpp_pro_messaging_canister_message = (
config_default.ICPP_PRO_MESSAGING_CANISTER_DEFAULT_MESSAGE
)
try:
cmd = (
f"dfx canister call {config_default.ICPP_PRO_MESSAGING_CANISTER} "
f"get_message --ic --output json"
)
response_str = run_shell_cmd(cmd, capture_output=True)
if response_str is not None:
response = json.loads(response_str)
if "Ok" in response and "message" in response["Ok"]:
icpp_pro_messaging_canister_message = response["Ok"]["message"]
except: # pylint: disable=bare-except
pass

typer.echo(icpp_pro_messaging_canister_message)
typer.echo("-----")
# ----------------------------------------------------------------------
21 changes: 18 additions & 3 deletions src/icpp/commands_build_wasm.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# pylint: disable = too-many-statements
import sys
import os
import json
from pathlib import Path
import subprocess
import shutil
Expand Down Expand Up @@ -376,8 +377,22 @@ def c_compile_file_mine(file: str) -> None:
# ----------------------------------------------------------------------
typer.echo("-----")

# ----------------------------------------------------------------------
typer.echo("Support icpp-pro by purchasing an icpp-art NFT at:")
typer.echo("https://bioniq.io/launch/icpp-art/public")
icpp_pro_messaging_canister_message = (
config_default.ICPP_PRO_MESSAGING_CANISTER_DEFAULT_MESSAGE
)
try:
cmd = (
f"dfx canister call {config_default.ICPP_PRO_MESSAGING_CANISTER} "
f"get_message --ic --output json"
)
response_str = run_shell_cmd(cmd, capture_output=True)
if response_str is not None:
response = json.loads(response_str)
if "Ok" in response and "message" in response["Ok"]:
icpp_pro_messaging_canister_message = response["Ok"]["message"]
except: # pylint: disable=bare-except
pass

typer.echo(icpp_pro_messaging_canister_message)
# ----------------------------------------------------------------------
typer.echo("-----")
5 changes: 5 additions & 0 deletions src/icpp/config_default.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
OS_SYSTEM = platform.system()
OS_PROCESSOR = platform.processor()

#######################################################################
# See: https://github.com/onicai/icpp_pro_messaging_canister
ICPP_PRO_MESSAGING_CANISTER = "ahlje-dqaaa-aaaag-aua5q-cai"
ICPP_PRO_MESSAGING_CANISTER_DEFAULT_MESSAGE = "Thank you for using icpp-pro 💻️"

#######################################################################
# Paths for logs & to install dependencies (wasi-sdk, rust, ...)
ICPP_ROOT = Path.home() / ".icpp"
Expand Down
Loading