From 1ffc25578c1cbc1ef8b99d9651b5cee49a0ce2a8 Mon Sep 17 00:00:00 2001 From: Jane Wang Date: Mon, 16 Sep 2024 16:22:02 -0400 Subject: [PATCH 1/2] Update README (#1607) --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 46c6d6816..c39d883c2 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ This repo is home to the Stellar CLI, the command-line multi-tool for running an ## Table of Contents - [Documentation](#documentation) +- [Cookbook](#cookbook) - [Installation](#installation) - [Installation with Experimental Features](#installation-with-experimental-features) - [Autocomplete](#autocomplete) @@ -23,6 +24,9 @@ This repo is home to the Stellar CLI, the command-line multi-tool for running an For installation options see below, for usage instructions [see the full help docs](FULL_HELP_DOCS.md). +## Cookbook +To understand how to get the most of the Stellar CLI, see the [Stellar CLI Cookbook](https://github.com/stellar/stellar-cli/tree/main/cookbook) for recipes and a collection of resources to teach you how to use the CLI. Examples of recipes included in the CLI cookbook include: send payments, manage contract lifecycle, extend contract instance/storage/wasm, and more. + ## Installation Install the latest version from source: ``` @@ -76,4 +80,5 @@ Find issues to contribute to [here](https://github.com/stellar/stellar-cli/contr ## Additional Developer Resources - Developer Docs CLI Examples: https://developers.stellar.org/docs/smart-contracts/guides/cli -- Video Tutorial: https://developers.stellar.org/meetings/2024/06/27 +- Video Tutorial on `network container`, `keys`, and `contract init`: https://developers.stellar.org/meetings/2024/06/27 +- Video Tutorial on `alias` and `snapshot`: https://developers.stellar.org/meetings/2024/09/12 From 62ae1d7b87ad1eea59749ccd2e3ad52c9ce8608e Mon Sep 17 00:00:00 2001 From: Nando Vieira Date: Tue, 17 Sep 2024 14:57:39 -0700 Subject: [PATCH 2/2] Rename contract (#1609) --- cmd/crates/soroban-test/tests/it/build.rs | 2 +- .../contract-init-template/contracts/hello_world/src/lib.rs | 4 ++-- .../contract-init-template/contracts/hello_world/src/test.rs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/crates/soroban-test/tests/it/build.rs b/cmd/crates/soroban-test/tests/it/build.rs index 19f0bc041..aba6aadf5 100644 --- a/cmd/crates/soroban-test/tests/it/build.rs +++ b/cmd/crates/soroban-test/tests/it/build.rs @@ -72,7 +72,7 @@ fn build_no_package_found() { .failure() .stderr(predicate::eq( "\ -error: package nopkgwiththisname not found +❌ error: package nopkgwiththisname not found ", )); } diff --git a/cmd/soroban-cli/src/utils/contract-init-template/contracts/hello_world/src/lib.rs b/cmd/soroban-cli/src/utils/contract-init-template/contracts/hello_world/src/lib.rs index f3eb78a36..0b701fd82 100644 --- a/cmd/soroban-cli/src/utils/contract-init-template/contracts/hello_world/src/lib.rs +++ b/cmd/soroban-cli/src/utils/contract-init-template/contracts/hello_world/src/lib.rs @@ -2,10 +2,10 @@ use soroban_sdk::{contract, contractimpl, vec, Env, String, Vec}; #[contract] -pub struct HelloContract; +pub struct Contract; #[contractimpl] -impl HelloContract { +impl Contract { pub fn hello(env: Env, to: String) -> Vec { vec![&env, String::from_str(&env, "Hello"), to] } diff --git a/cmd/soroban-cli/src/utils/contract-init-template/contracts/hello_world/src/test.rs b/cmd/soroban-cli/src/utils/contract-init-template/contracts/hello_world/src/test.rs index 4b250446a..af69a7ecb 100644 --- a/cmd/soroban-cli/src/utils/contract-init-template/contracts/hello_world/src/test.rs +++ b/cmd/soroban-cli/src/utils/contract-init-template/contracts/hello_world/src/test.rs @@ -6,8 +6,8 @@ use soroban_sdk::{vec, Env, String}; #[test] fn test() { let env = Env::default(); - let contract_id = env.register_contract(None, HelloContract); - let client = HelloContractClient::new(&env, &contract_id); + let contract_id = env.register_contract(None, Contract); + let client = ContractClient::new(&env, &contract_id); let words = client.hello(&String::from_str(&env, "Dev")); assert_eq!(