Installation and Upgrades¶
The Python distribution is named moi-python-sdk and is imported as moi. The Go module path is github.com/matrixorigin/moi-go-sdk, while its package name is sdk. Initialize the language’s dependency management in your project before installing either SDK.
Install the Python SDK¶
The Python SDK requires Python 3.9 or later. Use a virtual environment:
python -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install moi-python-sdk
If your package index does not contain the required version, install a tag or commit from the official repository. Production projects should pin an immutable tag or commit instead of following main:
python -m pip install \
"moi-python-sdk @ git+https://github.com/matrixorigin/moi-python-sdk.git@<tag-or-commit>"
Verify the installation:
python -m pip show moi-python-sdk
python -c "from moi import RawClient, SDKClient; print('MOI SDK ready')"
Record the resolved version in requirements.txt, pyproject.toml, or a lock file. The SDK depends on requests; let the package manager resolve it rather than copying dependencies from the SDK repository.
Install the Go SDK¶
From an existing Go module, run:
go get github.com/matrixorigin/moi-go-sdk@latest
go mod tidy
The source package is declared as sdk. An explicit alias makes it clear that the repository name is not the package identifier:
import sdk "github.com/matrixorigin/moi-go-sdk"
Check the selected module version:
go list -m github.com/matrixorigin/moi-go-sdk
The current main branch declares Go 1.24.3 in go.mod. For a released version, use the toolchain requirement in that version’s go.mod. If the project runs an older Go toolchain, select a compatible SDK version or upgrade the toolchain first.
Work from source¶
Use an editable installation or local replacement only when contributing to the SDK itself:
git clone https://github.com/matrixorigin/moi-python-sdk.git
cd moi-python-sdk
python -m pip install -r requirements.txt
python -m pip install -e .
A Go project can temporarily use a replace directive pointing to a local clone. Remove any path that is valid only on a developer workstation before committing.
Upgrade safely¶
The SDKs continue to add endpoints and types. An update can change structures, error handling, or streaming behavior as well as add methods. A safe upgrade process is:
Pin the currently working version and commit the lock file or
go.sum.Review changes and release notes across the selected versions in the official repositories.
After updating, test initialization, a read-only list, a write, pagination, error paths, and every streaming method the application uses.
Confirm that the target MOI environment supports newly added endpoints before deploying.
For Python, upgrade explicitly and re-create the project lock:
python -m pip install --upgrade moi-python-sdk
python -m pip check
For Go, select a target version and run the project tests:
go get github.com/matrixorigin/moi-go-sdk@<version>
go mod tidy
go test ./...
After installation, configure the connection in Endpoints and Authentication. Do not put a real Key in test source.