From 7aba5baa410c42f135bba2b775e6fd130e2f7ad8 Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Fri, 29 Jul 2022 17:11:59 -0700 Subject: [PATCH] Release prep (#51) * makefile * cleanup * lock --- Cargo.lock | 101 ++++++++++++++++++++++++++--------------------------- Cargo.toml | 13 ++++--- Makefile | 10 ++++++ README.md | 36 ++----------------- 4 files changed, 71 insertions(+), 89 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8261f250e..4d0605d63 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -621,7 +621,7 @@ dependencies = [ [[package]] name = "soroban-cli" -version = "0.0.0" +version = "0.0.2" dependencies = [ "base64", "clap", @@ -634,19 +634,20 @@ dependencies = [ [[package]] name = "soroban-env-common" -version = "0.0.0" -source = "git+https://github.com/stellar/rs-stellar-contract-env?rev=36a5007#36a5007611ab095f7821bef00d3fae2953c9ad47" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f2a07a2f4c8f684b5e0bc1013937339300d6c8112b76c6c46bbefc47bdd5905" dependencies = [ "soroban-env-macros", + "soroban-wasmi", "static_assertions", - "stellar-xdr 0.0.0 (git+https://github.com/stellar/rs-stellar-xdr?rev=94e01c7b)", - "wasmi", + "stellar-xdr", ] [[package]] name = "soroban-env-host" -version = "0.0.0" -source = "git+https://github.com/stellar/rs-stellar-contract-env?rev=36a5007#36a5007611ab095f7821bef00d3fae2953c9ad47" +version = "0.0.3" +source = "git+https://github.com/stellar/rs-soroban-env?rev=79e55e4#79e55e4ca4b1b7a9284b712039d7c9a930b17beb" dependencies = [ "backtrace", "dyn-fmt", @@ -660,42 +661,69 @@ dependencies = [ "parity-wasm", "sha2 0.10.2", "soroban-env-common", + "soroban-wasmi", "static_assertions", "thiserror", "tinyvec", - "wasmi", ] [[package]] name = "soroban-env-macros" -version = "0.0.0" -source = "git+https://github.com/stellar/rs-stellar-contract-env?rev=36a5007#36a5007611ab095f7821bef00d3fae2953c9ad47" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92e07a8cf5452fce96ce19df1ba6874e6f92b2dc64302c71aa8460349c08cedc" dependencies = [ "proc-macro2", "quote", - "stellar-xdr 0.0.0 (git+https://github.com/stellar/rs-stellar-xdr?rev=540ed24e)", + "stellar-xdr", "syn", ] [[package]] -name = "static_assertions" -version = "1.1.0" +name = "soroban-wasmi" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +checksum = "2ba96c441aa5a924f5d59114b43b2f8eab4ebbf7041dbf1c38fbae04620cb518" +dependencies = [ + "parity-wasm", + "soroban-wasmi-validation", + "soroban-wasmi_core", +] [[package]] -name = "stellar-xdr" -version = "0.0.0" -source = "git+https://github.com/stellar/rs-stellar-xdr?rev=540ed24e#540ed24edc66b5301459ed3269129670160e51e0" +name = "soroban-wasmi-validation" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8983fe9f704b4f4c171ac02de77fcc85cba9fd65ad951e381525a8d6b58c374b" dependencies = [ - "base64", - "serde", + "parity-wasm", ] +[[package]] +name = "soroban-wasmi_core" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0db272b8e5d09022d701f74b58994710587cd7d5d7c4b1f00376a141edfbded" +dependencies = [ + "downcast-rs", + "libm", + "memory_units", + "num-rational", + "num-traits", + "parity-wasm", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + [[package]] name = "stellar-xdr" -version = "0.0.0" -source = "git+https://github.com/stellar/rs-stellar-xdr?rev=94e01c7b#94e01c7bbb3622e12907e1ceb95ab85f4e55e085" +version = "0.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "015594b09942b9f9cbe6972ba8c7de3a05a25c4994bbc7282f5f2fa6d28a81c4" dependencies = [ "serde", ] @@ -815,37 +843,6 @@ version = "0.9.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" -[[package]] -name = "wasmi" -version = "0.11.0" -source = "git+https://github.com/stellar/wasmi?rev=4f35508c1a2475ed5d33955023f073639e7ff7df#4f35508c1a2475ed5d33955023f073639e7ff7df" -dependencies = [ - "parity-wasm", - "wasmi-validation", - "wasmi_core", -] - -[[package]] -name = "wasmi-validation" -version = "0.4.1" -source = "git+https://github.com/stellar/wasmi?rev=4f35508c1a2475ed5d33955023f073639e7ff7df#4f35508c1a2475ed5d33955023f073639e7ff7df" -dependencies = [ - "parity-wasm", -] - -[[package]] -name = "wasmi_core" -version = "0.1.0" -source = "git+https://github.com/stellar/wasmi?rev=4f35508c1a2475ed5d33955023f073639e7ff7df#4f35508c1a2475ed5d33955023f073639e7ff7df" -dependencies = [ - "downcast-rs", - "libm", - "memory_units", - "num-rational", - "num-traits", - "parity-wasm", -] - [[package]] name = "winapi" version = "0.3.9" diff --git a/Cargo.toml b/Cargo.toml index 4feefb285..06356a27c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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 "] +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" diff --git a/Makefile b/Makefile index 5c9ae2dbe..7256b4c48 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/README.md b/README.md index d361b4df5..cb27ffd67 100644 --- a/README.md +++ b/README.md @@ -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 --file --fn --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 --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 --wasm --fn --arg 32 --arg 4 ```