Browse Source

Merge pull request #414 from moxiegirl/clarity-cli-fix

Clarity cli fix and wallet update
feat/clarity-updates
Moxiegirl 5 years ago
committed by GitHub
parent
commit
0f12160f56
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      _core/smart/clarityCLI.md
  2. 4
      _core/smart/overview.md
  3. 70
      _core/smart/sdk-quickstart.md
  4. 4
      _core/smart/tutorial.md
  5. 11
      _org/wallet-install.md

2
_core/smart/clarityCLI.md

@ -3,7 +3,7 @@ layout: core
description: "Blockstack smart contracting language" description: "Blockstack smart contracting language"
permalink: /:collection/:path.html permalink: /:collection/:path.html
--- ---
# clarity-cli command line # clarity-cli VM command line
{:.no_toc} {:.no_toc}
You use the `clarity-cli` command to work with smart contracts within the Blockstack virtual environment. This command has the following subcommands: You use the `clarity-cli` command to work with smart contracts within the Blockstack virtual environment. This command has the following subcommands:

4
_core/smart/overview.md

@ -44,9 +44,9 @@ Clarity is a list processing (LISP) language, as such it is not compiled. Omitti
Clarity is in pre-release and does not yet directly interact with the live Stacks blockchain. For the pre-release period you need a test environment to run Clarity contracts. Blockstack provides a Docker image called `clarity-developer-preview` that you can use or you can build a test environment locally from code. Either the Docker image or a local environment is sufficient for testing Clarity programming for standalone contracts. Clarity is in pre-release and does not yet directly interact with the live Stacks blockchain. For the pre-release period you need a test environment to run Clarity contracts. Blockstack provides a Docker image called `clarity-developer-preview` that you can use or you can build a test environment locally from code. Either the Docker image or a local environment is sufficient for testing Clarity programming for standalone contracts.
You use the `clarity-cli` command line to check, launch, and execute standalone Clarity contracts. You can use this same command line to create simulate mining Stacks and inspecting a blockchain. You use the `clarity-cli` command line to check, launch, and execute standalone Clarity contracts inside the virtual test environment. You can use this same command line to create simulate mining Stacks and inspecting a blockchain.
Blockstack expects that some decentralized applications (DApp) will want to make use of Clarity contracts as part of their applications. For this purpose, you should use the Clarity SDK, also in pre-release. The SDK is a development environment, testing framework, and deployment tool. It provides a library for safe interactions with Clarity contracts from a DApp written with the blockstack.js library. Blockstack expects that some decentralized applications (DApp) will want to make use of Clarity contracts as part of their applications. For this purpose, you should use the Clarity SDK, also in pre-release. The SDK is a development environment, testing framework, and deployment tool. It provides a library for safe interactions with Clarity contracts from a DApp written with the blockstack.js library. The SDK has a `clarity` command line for creating Clarity projects.
## Basic building blocks of Clarity contracts ## Basic building blocks of Clarity contracts

70
_core/smart/sdk-quickstart.md

@ -3,7 +3,7 @@ layout: core
description: "Blockstack smart contracting language" description: "Blockstack smart contracting language"
permalink: /:collection/:path.html permalink: /:collection/:path.html
--- ---
# Quickstart for the SDK # Clarity SDK Quickstart
{:.no_toc} {:.no_toc}
You can use the software developer kit (SDK) to develop, test, and deploy Clarity smart contracts. The SDK goes beyond the basic test environment to allow for development of Javascript or TypeScript clients that call upon Clarity contracts. You can use the software developer kit (SDK) to develop, test, and deploy Clarity smart contracts. The SDK goes beyond the basic test environment to allow for development of Javascript or TypeScript clients that call upon Clarity contracts.
@ -30,36 +30,70 @@ $ which npm
If you don't find `npm` in your system, [install it](https://www.npmjs.com/get-npm). If you don't find `npm` in your system, [install it](https://www.npmjs.com/get-npm).
## Task 1: Generate an initial Clarity project ## Task 1: Install the SDK command line
In this task, you generate a project scaffold — an initial set of directories and files. The SDK comes with a command line for setting up the SDK and creating new projects. Use `npm` to install the `clarity` SDK command:
1. Create a new directory for your project. ```
npm install -g @blockstack/clarity-cli
```
```sh Verify you have installed the command correctly:
mkdir hello-clarity-sdk
```
2. Change into your new project directory.
```sh ```
cd hello-clarity-sdk $ clarity --help
``` The Clarity CLI is used to manage Clarity smart contracts from the command line.
VERSION
@blockstack/clarity-cli/0.1.13-alpha.3 darwin-x64 node-v12.10.0
USAGE
$ clarity [COMMAND]
COMMANDS
help display help for clarity
new Generate new project
setup Install blockstack-core and its dependencies
```
## Task 2: Generate an initial Clarity project
In this task, you generate a project scaffold — an initial set of directories and files.
3. Use the `npm` command to initialize a Clarity project. 1. Create a new Clarity project .
```sh ```sh
npm init clarity-dev clarity new hello-clarity-sdk
... ```
The system responds by creating a scaffolding for your Clarity project and initializing the packaging:
added 153 packages from 630 contributors and audited 280 packages in 4.73s ```
$ clarity new hello-clarity-sdk
create .vscode/extensions.json
create .vscode/launch.json
create contracts/sample/hello-world.clar
create test/mocha.opts
create tsconfig.json
create test/hello-world.ts
create .gitignore
create package.json
...
added 126 packages from 632 contributors and audited 226 packages in 4.678s
found 0 vulnerabilities found 0 vulnerabilities
Project created at /private/tmp/hello-clarity-sdk Project created at /tmp/hello-clarity-sdk
``` ```
Depending on your connection speed, it may take time to construct the scaffolding. Depending on your connection speed, it may take time to construct the scaffolding.
## Task 2: Investigate the generated project 2. Change into your new project directory.
```sh
cd hello-clarity-sdk
```
## Task 3: Investigate the generated project
Your project should contain three directories: Your project should contain three directories:
@ -154,7 +188,7 @@ npm run test
In the next section, try your hand at expanding the `hello-world.clar` program. In the next section, try your hand at expanding the `hello-world.clar` program.
## Task 3: Try to expand the contract ## Task 4: Try to expand the contract
In this task, you are challenged to expand the contents of the `contracts/hello-world.clar` file. Use your favorite editor and open the `contracts/hello-world.clar` file. If you use Visual Studio Code, you can install the Blockstack Clarity extension. The extension provides `syntax coloration` and some `autocompletion`. In this task, you are challenged to expand the contents of the `contracts/hello-world.clar` file. Use your favorite editor and open the `contracts/hello-world.clar` file. If you use Visual Studio Code, you can install the Blockstack Clarity extension. The extension provides `syntax coloration` and some `autocompletion`.

4
_core/smart/tutorial.md

@ -3,9 +3,9 @@ layout: core
description: "Blockstack smart contracting language" description: "Blockstack smart contracting language"
permalink: /:collection/:path.html permalink: /:collection/:path.html
--- ---
# Hello Clarity tutorial # Hello Clarity for the VM
In this tutorial, you learn how to use Clarity, Blockstack's smart contracting language. Use this tutorial to get a quick introduction to Clarity and the default Blockstack test environment. In this tutorial, you learn how to use Clarity, Blockstack's smart contracting language inside of a virtual environment. The environment is run using a Docker image. Use this tutorial to get a quick introduction to Clarity and the default Blockstack test environment.
* TOC * TOC
{:toc} {:toc}

11
_org/wallet-install.md

@ -20,17 +20,18 @@ by Blockstack PBC." %}
## Mac Installation ## Mac Installation
1. Select the **MacOS Download** button <a href="https://wallet.blockstack.org" target="\_blank">on this page</a>. 1. <a href="https://wallet.blockstack.org" target="\_blank">Go to the wallet download page</a> in your browser.
2. Select the **MacOS Download** button.
This button downloads the software to your computer. This button downloads the software to your computer.
2. Open a terminal window. 3. Open a terminal window.
To find the terminal software, enter `terminal` into the Spotlight search. To find the terminal software, enter `terminal` into the Spotlight search.
![](images/mac-terminal.png) ![](images/mac-terminal.png)
3. In the terminal window, enter the command to change directory to the folder where you downloaded the wallet software. 4. In the terminal window, enter the command to change directory to the folder where you downloaded the wallet software.
The default location is the **Downloads** folder, type the following into the terminal and press RETURN on your keyboard. The default location is the **Downloads** folder, type the following into the terminal and press RETURN on your keyboard.
@ -38,7 +39,7 @@ by Blockstack PBC." %}
cd ~/Downloads cd ~/Downloads
``` ```
4. In the terminal window, type the following Command 5. In the terminal window, type the following Command
``` ```
shasum -a 512 Stacks-Wallet-macOS-3.0.0.dmg shasum -a 512 Stacks-Wallet-macOS-3.0.0.dmg
@ -46,7 +47,7 @@ by Blockstack PBC." %}
![](images/mac-shasum.png) ![](images/mac-shasum.png)
5. Verify that the resulting hash (a string of letters and numbers) is the same as the latest hash published <a href="https://github.com/blockstack/stacks-wallet/releases" target="\_blank">on this page</a>. 6. Verify that the resulting hash (a string of letters and numbers) is the same as the latest hash published <a href="https://github.com/blockstack/stacks-wallet/releases" target="\_blank">on this page</a>.

Loading…
Cancel
Save