This monorepo contains multiple packages for the Autonomys Auto SDK, including utility, consensus and identity functions.
The repository is organized as follows:
packages/auto-utils
: Utility functions for the SDK.packages/auto-consensus
: Consensus functions.packages/auto-id
: Identity functions.
- Node.js
- Yarn 4
-
Clone the repository:
git clone https://github.com/autonomys/auto-sdk.git
-
Navigate to the project directory:
cd auto-sdk
-
Set Yarn to use the Berry version:
yarn set version berry
-
Install dependencies:
yarn install
To build all packages:
yarn run build
To run tests for all packages:
yarn run test
To test the packages against a local node, you can use the script at scripts/run-dev.js
.
-
Verify that the line 3-7 of the bash script in
scripts/download.sh
matches your current OS and architecture.# Change the following variables as needed # OS to download OS="macos" # macos | ubuntu | windows # Architecture to download ARCHITECTURE="aarch64" # aarch64 | x86_64-skylake | x86_64-v2
-
Run the script:
node scripts/run-dev.js
This script will:
- Download the latest version of the node and farmer for your OS and architecture (
scripts/download.sh
); - Start the node, create and insert the keystore in the node (
scripts/run-node.sh
); - Start the farmer (
scripts/run-farmer.sh
); - Register the node as operator, wait and kill the node and farmer (inside
scripts/run-dev.js
); - Start the node as an operator (
scripts/run-operator.sh
); - Restart the farmer (
scripts/run-farmer.sh
).
- Download the latest version of the node and farmer for your OS and architecture (
-
Run the tests:
bash scripts/localhost-run-test.sh
The tests will detect the local node and farmer and run the tests against them instead of the public testnet.
This project uses workspaces. Packages are located in the packages
directory. Each package can have its own dependencies and build scripts.
This project is licensed under the MIT License. See the LICENSE file for more details.