Skip to content

Instantly share code, notes, and snippets.

@tirinox
Created June 23, 2021 09:20
Show Gist options
  • Save tirinox/62c092a7fb020462c6fc6f751ed211cd to your computer and use it in GitHub Desktop.
Save tirinox/62c092a7fb020462c6fc6f751ed211cd to your computer and use it in GitHub Desktop.
Installation xchainpy on MacOS (M1 tested)

Installation of xchainpy on MacOS

  1. Install libsecp256k1 via Homebrew. If you don't have Homebrew then follow the installation instructions on their website.

brew install libsecp256k1

  1. Install wheel (reminder: you do all pip-things under your Python environment):

pip install wheel

  1. Install secp256k1 providing Homebrew's paths to libsecp256k1:

INCLUDE_DIR=$(brew --prefix libsecp256k1)/include LIB_DIR=$(brew --prefix libsecp256k1)/lib pip install --no-binary secp256k1 secp256k1==0.13.2

or for the latest version:

INCLUDE_DIR=$(brew --prefix libsecp256k1)/include LIB_DIR=$(brew --prefix libsecp256k1)/lib pip install --no-binary secp256k1 secp256k1

  1. Install py-binance-chain:

pip install py-binance-chain

  1. Finally, install xchainpy packages. There are options:

a) From PyPi. For example:

pip install xchainpy_crypto xchainpy_thorchain

b) Directly from GitHub.

You can use install_xchainpy_git.sh script. Inside it you should specify the commit hash or branch name.

#!/usr/bin/env bash
# Please fill out here branch or commit hash you would like to use for installation
XCHAINPY_COMMIT=abffc704ff4c9710d73d1ad0573e3b93e5f21371
# XCHAINPY_COMMIT=thorchain_deposit
# List of Deps you want to install
XCHAINPY_DEPS=( "xchainpy_client" "xchainpy_util" "xchainpy_crypto" "xchainpy_thorchain" )
echo "------ UNINSTALLING OLD SETUP ------"
echo
for DEP in "${XCHAINPY_DEPS[@]}"
do
pip uninstall -y "$DEP"
done
echo
echo "------ INSTALLING NEW FROM GITHUB ------"
echo
for DEP in "${XCHAINPY_DEPS[@]}"
do
echo
echo "------- $DEP -------"
echo
pip install --no-cache-dir "git+https://github.com/xchainjs/xchainpy-lib/@$XCHAINPY_COMMIT#subdirectory=xchainpy/$DEP"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment