-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New Endpoints for better Registration UX (#72)
* checkpointing * checkpointing * update * working * checkpointing * first_device_needs_registration_code * checkpointing * sync * add new builder method update node ports * - wasm updated - registration endpoint updated - added new boilerplate for easy tests * update tests and fix pyo3 * creates venv if not present
- Loading branch information
Showing
90 changed files
with
8,996 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/bin/bash | ||
cd /app/shinkai-libs/shinkai-message-pyo3 | ||
|
||
# Initialize pyenv | ||
set -e | ||
export PYENV_ROOT="$HOME/.pyenv" | ||
export PATH="$PYENV_ROOT/bin:$PATH" | ||
eval "$(pyenv init --path)" | ||
eval "$(pyenv init -)" | ||
|
||
# Get the path of the Python interpreter inside the Docker container | ||
python_path=$(which python) | ||
|
||
# Set the PYO3_PYTHON and PYTHON_SYS_EXECUTABLE environment variables | ||
export PYO3_PYTHON="$python_path" | ||
export PYTHON_SYS_EXECUTABLE="$python_path" | ||
|
||
# Print the Python version | ||
python --version | ||
|
||
# Create a virtual environment if it doesn't exist | ||
if [ ! -d "./venv" ] | ||
then | ||
python -m venv venv | ||
fi | ||
|
||
# Activate your virtual environment | ||
source ./venv/bin/activate | ||
|
||
# Run maturin develop and capture its output | ||
output=$(maturin build -i python) | ||
|
||
# If maturin develop is successful, extract the path of the built wheel file | ||
if [ $? -eq 0 ]; then | ||
echo "Maturin build successful" | ||
wheel_file=$(ls target/wheels/*.whl) | ||
echo "Wheel file: $wheel_file" | ||
|
||
# Update the installed package using the built wheel file | ||
echo "Running pip install --upgrade \"$wheel_file\"..." | ||
pip_output=$(pip install --upgrade "$wheel_file") | ||
|
||
# Run the tests and print their output | ||
echo "Running tests..." | ||
test_output=$(python -m unittest tests.test_shinkai_message_pyo3) | ||
echo "$test_output" | ||
else | ||
echo "maturin develop failed" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,16 @@ | ||
#!/bin/bash | ||
|
||
export NODE_IP="0.0.0.0" | ||
export NODE_PORT="8080" | ||
export NODE_PORT="9552" | ||
export NODE_API_IP="0.0.0.0" | ||
export NODE_API_PORT="13013" | ||
export NODE_API_PORT="9550" | ||
export IDENTITY_SECRET_KEY="df3f619804a92fdb4057192dc43dd748ea778adc52bc498ce80524c014b81119" | ||
export ENCRYPTION_SECRET_KEY="d83f619804a92fdb4057192dc43dd748ea778adc52bc498ce80524c014b81159" | ||
export PING_INTERVAL_SECS="0" | ||
export GLOBAL_IDENTITY_NAME="@@node1.shinkai" | ||
export RUST_LOG=warn,error,info,debug | ||
export RUST_LOG=warn,error,info | ||
export STARTING_NUM_QR_PROFILES="1" | ||
export STARTING_NUM_QR_DEVICES="1" | ||
|
||
if [ -z "$1" ] | ||
then | ||
echo "No argument supplied for CONNECT_PK, using empty string" | ||
export CONNECT_PK="" | ||
else | ||
export CONNECT_PK=$1 | ||
fi | ||
|
||
if [ -z "$2" ] | ||
then | ||
echo "No argument supplied for CONNECT_ADDR, using empty string" | ||
export CONNECT_ADDR="" | ||
else | ||
export CONNECT_ADDR=$2 | ||
fi | ||
export FIRST_DEVICE_NEEDS_REGISTRATION_CODE="false" | ||
|
||
cargo run |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.