Skip to content

Commit

Permalink
Release prep (#51)
Browse files Browse the repository at this point in the history
* makefile

* cleanup

* lock
  • Loading branch information
graydon authored Jul 30, 2022
1 parent 2f2462a commit 7aba5ba
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 89 deletions.
101 changes: 49 additions & 52 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 9 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
[package]
name = "soroban-cli"
version = "0.0.0"
description = "Soroban CLI"
homepage = "https://github.com/stellar/soroban-cli"
repository = "https://github.com/stellar/soroban-cli"
authors = ["Stellar Development Foundation <info@stellar.org>"]
license = "Apache-2.0"
readme = "README.md"
version = "0.0.2"
edition = "2021"


[dependencies]
soroban-env-host = { git = "https://github.com/stellar/rs-stellar-contract-env", rev = "36a5007", features = ["vm", "serde"] }
# switch to this once all the repos are renamed
# soroban-env-host = { git = "https://github.com/stellar/rs-soroban-env", rev = "36a5007", features = ["vm", "serde"] }
soroban-env-host = { version = "0.0.3", git = "https://github.com/stellar/rs-soroban-env", rev = "79e55e4", features = ["vm", "serde"] }
# soroban-env-host = { path = "../rs-soroban-env/soroban-env-host", features = ["vm", "serde"] }
clap = { version = "3.1.18", features = ["derive", "env"] }
base64 = "0.13.0"
Expand Down
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,13 @@ fmt:

clean:
cargo clean

# Build all projects as if they are being published to crates.io, and do so for
# all feature and target combinations.
publish-dry-run:
cargo +stable hack --feature-powerset publish --locked --dry-run --package soroban-cli

# Publish publishes the crate to crates.io. The dry-run is a dependency because
# the dry-run target will verify all feature set combinations.
publish: publish-dry-run
cargo +stable publish --locked --package soroban-cli
36 changes: 3 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,45 +5,15 @@ CLI for running Soroban contracts locally in a test VM. Executes WASM files buil
## Install

```
cargo install soroban-cli --git https://github.com/stellar/soroban-cli
cargo install soroban-cli
```

## Usage

All values passed to `--arg` are the JSON representation of SCVals.

### Creating a contract and invoking a function
Note that this will also put the WASM contract in storage.
## Example

```
soroban-cli invoke --id <HEX_CONTRACTID> --file <WASMFILE> --fn <FUNCNAME> --arg '{"i32":32}' --arg '{"i32":4}'
```

Example using the [example_add_i32](https://github.com/stellar/rs-soroban-sdk/tree/main/examples/add_i32) contract:

```
$ soroban-cli invoke --id 3d4017c3e843895a92b70aa74d1b7ebc9c982ccf2ec4968cc0cd55f12af4660c --file example_add_i32.wasm --fn add --arg '{"i32":32}' --arg '{"i32":4}'
{
"i32": 36
}
```

### Creating a contract

```
Example:
soroban-cli deploy --id 3d4017c3e843895a92b70aa74d1b7ebc9c982ccf2ec4968cc0cd55f12af4660c --file example_add_i32.wasm
```

### Invoking a contract in storage

```
soroban-cli invoke --fn add --id <HEX_CONTRACTID> --arg '{"i32":32}' --arg '{"i32":4}'
Example:
soroban-cli invoke --fn add --id 3d4017c3e843895a92b70aa74d1b7ebc9c982ccf2ec4968cc0cd55f12af4660c --arg '{"i32":32}' --arg '{"i32":4}'
soroban-cli invoke --fn put --id 3d4017c3e843895a92b70aa74d1b7ebc9c982ccf2ec4968cc0cd55f12af4660c --arg '{"symbol": [69, 50, 53, 49, 57]}' --arg '{"symbol": [69, 50, 53]}'
soroban-cli invoke --id <HEX_CONTRACTID> --wasm <WASMFILE> --fn <FUNCNAME> --arg 32 --arg 4
```

0 comments on commit 7aba5ba

Please sign in to comment.