Javascript SDK for interacting with Clarity smart contracts
A development environment, testing framework, and deployment tool for Clarity smart contracts.
.d.ts
) for easy and safer interactions with smart contracts.Quick Start:
npm init clarity-starter
npm test
See create-clarity-starter
for more details.
Quick Start:
Not yet available
npm install -g @blockstack/clarity-cli
clarity help
See clarity-cli/README.md for detailed usage.
TODO: Determine and document intended usage of this package.
npm install @blockstack/clarity-tutorials
Repo structure and project build instructions for contributors.
clarity-cli
binary
-- distributes are automatically installed on MacOS, Windows (64-bit), and Linux (64-bit).
It will be compiled from source if using an OS or architecture not listed. This requires the Rust toolchain -- rustup is the recommended installer. A C compiler must also be available (gcc, clang, and msvc are supported). See clarity-native-bin for more details.
package.json
.npm install
. This automatically triggers lerna bootstrap
to configure local packages in the repo.
Run npm run rebuild
when pulling repo changes to an already setup local environment. This ensures the local environment is setup correctly after any changes to cross-dependencies or new libs.
Rebuild does the following:
- Removes
node_modules
directories, removes the compiledpackages/*/lib
directories, removes the*.tsbuildinfo
cached build metadata.- Runs
lerna bootstrap
to install dependencies and configures cross-dependency symlinks.- Runs
tsc --build [...]
on all packages.
This is a multi-package monorepo.
paths
are specified in the default tsconfig.json
files. This is the config picked up by an editor/IDE/debugger for mapping absolute package names back to their source code in the monorepo.npm build
and package publishing. This is configured in the tsconfig.build.json
files.The Lerna features in use:
lerna bootstrap
- Setup packages in the current Lerna repo; installs all of their dependencies and links any cross-dependencies.lerna run [npm script]
- Run an npm script in each package that contains that script, e.g.lerna run lint
.lerna version
- Identify packages that have been updated since last release, increment package.json versions, commit to git. See docs for details.lerna publish
- Publish packages that have been updated since the last time a release was made.
.
├── package.json
├── lerna.json
├── tsconfig.json
├── tsconfig.build.json
└── packages/
├── lib-a/
│ ├── package.json
│ ├── tsconfig.json
│ ├── tsconfig.build.json
│ ├── src/
│ │ └── index.ts
│ └── test/
│ ├── **/*.ts [test source files]
│ └── mocha.opts
└── lib-a/
├── package.json
├── tsconfig.json
├── tsconfig.build.json
├── src/
│ └── index.ts
└── test/
├── **/*.ts [test source files]
└── mocha.opts
Publishing happens automatically upon commit or merge into the master
branch.