Skip to content

Commit

Permalink
Merge branch 'casper-network:dev' into 1313_contract_events
Browse files Browse the repository at this point in the history
  • Loading branch information
ipopescu authored Dec 19, 2023
2 parents 4d75c59 + afdf742 commit 6cb82ed
Show file tree
Hide file tree
Showing 6 changed files with 89 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
with:
ref: gh-pages

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: gh-pages-backup
path: .
Expand Down Expand Up @@ -96,7 +96,7 @@ jobs:
run: |
echo "$prod_pages_fqdn" > ./docs/CNAME
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: gh-pages-depl-payload
path: ./docs
Expand Down
12 changes: 7 additions & 5 deletions config/sidebar.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ module.exports = {
developers: [
"developers/index",
"developers/prerequisites",
"developers/essential-crates",
{
type: "category",
label: "Writing On-Chain Code",
Expand Down Expand Up @@ -304,11 +305,12 @@ module.exports = {
type: "doc",
id: "resources/tokens/cep18/full-tutorial",
},
items: ["resources/tokens/cep18/full-tutorial",
"resources/tokens/cep18/quickstart-guide",
"resources/tokens/cep18/query",
"resources/tokens/cep18/transfer",
"resources/tokens/cep18/tests",
items: [
"resources/tokens/cep18/full-tutorial",
"resources/tokens/cep18/quickstart-guide",
"resources/tokens/cep18/query",
"resources/tokens/cep18/transfer",
"resources/tokens/cep18/tests",
],
},
{
Expand Down
61 changes: 61 additions & 0 deletions source/docs/casper/developers/essential-crates.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Essential Rust Crates

Several Rust crates are available on [crates.io](https://crates.io/) to support smart contract development with Rust. A crate is a compilation unit that can be compiled into a binary or a library. The corresponding documentation is published on [docs.rs](https://docs.rs). The most important crates are listed below.

## `casper-types`

Types shared by many Casper crates:
- https://crates.io/crates/casper-types
- https://docs.rs/casper-types/latest

## `casper-contract`

A library for developing Casper smart contracts:
- https://crates.io/crates/casper-contract
- https://docs.rs/casper-contract/latest

## `casper-engine-test-support`

The Casper test support library:
- https://crates.io/crates/casper-engine-test-support
- https://docs.rs/casper-engine-test-support/

## `casper-node`

The component for running a node on a Casper network:
- https://crates.io/crates/casper-node
- https://docs.rs/casper-node/latest

## `casper-client`
A client library for interacting with a Casper network:
- https://crates.io/crates/casper-client
- https://docs.rs/casper-client/latest

## `casper-event-standard`

A Rust library that provides a simple and standardized way for Casper contracts to emit events:
- https://crates.io/crates/casper-event-standard
- https://docs.rs/casper-event-standard/latest

## `casper-hashing`

A library providing hashing functionality including Merkle Proof utilities:
- https://crates.io/crates/casper-hashing
- https://docs.rs/casper-hashing/latest/

## `casper-wasm-utils`

Command-line utilities and corresponding Rust API for producing pwasm-compatible executables:
- https://crates.io/crates/casper-wasm-utils
- https://docs.rs/casper-wasm-utils/latest

## `cargo-casper`

A command line tool for creating a Wasm smart contract and tests:
- https://crates.io/crates/cargo-casper
- https://docs.rs/crate/cargo-casper/latest

## Other Libraries

The [Open-Source Software](../resources/casper-open-source-software.md) page provides other community-curated tools and libraries.

1 change: 1 addition & 0 deletions source/docs/casper/developers/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ This section supports developers getting started with the Casper blockchain by w
| Topic | Description |
| ------------------------ | ----------------------------------- |
| [Development Prerequisites](./prerequisites.md) | Setup needed for various workflows |
| [Essential Casper Crates](./essential-crates.md) | Available Casper crates and the corresponding documentation |
| [Writing On-Chain Code](./writing-onchain-code/index.md) | Writing contracts in Rust and Wasm for a Casper network |
| [Casper JSON-RPC API](./json-rpc/index.md) | Endpoints for developers wishing to interact directly with a Casper node's JSON-RPC API |
| [Building dApps](./dapps/index.md) | Useful information for dApp developers |
Expand Down
8 changes: 7 additions & 1 deletion source/docs/casper/developers/prerequisites.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Note: You can also use `brew` on MacOS or `apt` on Linux to install Rust.

## Installing the Casper Crates {#installing-the-casper-crates}

The best and fastest way to set up a Casper Rust project is to use `cargo casper`. Using this will create a simple contract, a runtime environment, and a testing framework with a simple test. _Cargo_ is a build system and package manager for Rust (much like _pip_ if you are familiar with Python, or _npm_ and _yarn_ for those familiar with Javascript). It is also possible to use this configuration in your CI/CD pipeline.
The best and fastest way to set up a Casper Rust project is to use [cargo casper](https://crates.io/crates/cargo-casper), which is the command line tool for creating a Wasm smart contract and tests for use on a Casper network. This tool will create a simple contract, a runtime environment, and a testing framework with a simple test. _Cargo_ is a build system and package manager for Rust (much like _pip_ if you are familiar with Python, or _npm_ and _yarn_ for those familiar with Javascript). It is also possible to use this configuration in your CI/CD pipeline.

```bash
cargo install cargo-casper
Expand All @@ -118,6 +118,12 @@ Verify the installation:
cargo-casper --version
```

:::note

Familiarize yourself with the essential Casper crates described [here](./essential-crates.md).

:::

## Installing the Casper Client {#install-casper-client}

The default Casper client is on [crates.io](https://crates.io/crates/casper-client). This client can transmit your deploys to a Casper network.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,19 @@ rustup toolchain install nightly

### Available Casper Rust crates

To support smart contract development with Rust, the following crates are published:
To support smart contract development with Rust, the following crates are published:

- [Casper Contract](https://crates.io/crates/casper-contract) - a library supporting communication with the blockchain. This is the main library you will need to write smart contracts.
- [Casper Test Support](https://crates.io/crates/casper-engine-test-support) - a virtual machine against which you can test your smart contracts.
- [Casper Types](https://crates.io/crates/casper-types) - a library with types we use across the Rust ecosystem.
- [casper-contract](https://crates.io/crates/casper-contract) - a library supporting communication with the blockchain. This is the main library you will need to write smart contracts.
- [casper-engine-test-support](https://crates.io/crates/casper-engine-test-support) - a virtual machine against which you can test your smart contracts.
- [casper-types](https://crates.io/crates/casper-types) - a library with types we use across the Rust ecosystem.

A crate is a compilation unit that can be compiled into a binary or a library.
A crate is a compilation unit that can be compiled into a binary or a library.

:::note

For a comprehensive list of crates, visit the [Essential Casper Crates](../essential-crates.md) page.

:::

### Available API documentation

Expand Down

0 comments on commit 6cb82ed

Please sign in to comment.