Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: cw cluster connection #398

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
43 changes: 33 additions & 10 deletions Cargo.lock

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

36 changes: 18 additions & 18 deletions contracts/cosmwasm-vm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@ This Repo contains the smart contracts for ICON-IBC in rust.

### Standard Libraries

| Crate | Usage | Download |
|----------------|--------------------|-------------------------|
|cosmwasm-schema |Contract Development| [![cosmwasm-schema on crates.io](https://img.shields.io/crates/v/cosmwasm-schema.svg)](https://crates.io/crates/cosmwasm-schema) |
|cosmwasm-std |Contract Development| [![cosmwasm-std on crates.io](https://img.shields.io/crates/v/cosmwasm-std.svg)](https://crates.io/crates/cosmwasm-std) |
|cosmwasm-storage|Contract Development| [![cosmwasm-storage on crates.io](https://img.shields.io/crates/v/cosmwasm-storage.svg)](https://crates.io/crates/cosmwasm-storage)

| Specification | Crates.io | Coverage |
|--------------- |-------------------------------|----------------------------|
| cw-ibc-core |[![ibc on crates.io](https://img.shields.io/crates/v/ibc.svg)](https://crates.io/crates/ibc)| [![codecov](https://codecov.io/gh/icon-project/IBC-Integration/branch/main/graph/badge.svg?token=8KX6y8aGom)](https://codecov.io/gh/icon-project/IBC-Integration)|
|cw-icon-light-client|[![ibc on crates.io](https://img.shields.io/crates/v/ibc.svg)](https://crates.io/crates/ibc)| [![codecov](https://codecov.io/gh/icon-project/IBC-Integration/branch/main/graph/badge.svg?token=8KX6y8aGom)](https://codecov.io/gh/icon-project/IBC-Integration)|
| cw-xcall |[![ibc on crates.io](https://img.shields.io/crates/v/ibc.svg)](https://crates.io/crates/ibc)| [![codecov](https://codecov.io/gh/icon-project/IBC-Integration/branch/main/graph/badge.svg?token=8KX6y8aGom)](https://codecov.io/gh/icon-project/IBC-Integration)|
| Crate | Usage | Download |
| ---------------- | -------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| cosmwasm-schema | Contract Development | [![cosmwasm-schema on crates.io](https://img.shields.io/crates/v/cosmwasm-schema.svg)](https://crates.io/crates/cosmwasm-schema) |
| cosmwasm-std | Contract Development | [![cosmwasm-std on crates.io](https://img.shields.io/crates/v/cosmwasm-std.svg)](https://crates.io/crates/cosmwasm-std) |
| cosmwasm-storage | Contract Development | [![cosmwasm-storage on crates.io](https://img.shields.io/crates/v/cosmwasm-storage.svg)](https://crates.io/crates/cosmwasm-storage) |

| Specification | Crates.io | Coverage |
| -------------------- | -------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| cw-ibc-core | [![ibc on crates.io](https://img.shields.io/crates/v/ibc.svg)](https://crates.io/crates/ibc) | [![codecov](https://codecov.io/gh/icon-project/IBC-Integration/branch/main/graph/badge.svg?token=8KX6y8aGom)](https://codecov.io/gh/icon-project/IBC-Integration) |
| cw-icon-light-client | [![ibc on crates.io](https://img.shields.io/crates/v/ibc.svg)](https://crates.io/crates/ibc) | [![codecov](https://codecov.io/gh/icon-project/IBC-Integration/branch/main/graph/badge.svg?token=8KX6y8aGom)](https://codecov.io/gh/icon-project/IBC-Integration) |
| cw-xcall | [![ibc on crates.io](https://img.shields.io/crates/v/ibc.svg)](https://crates.io/crates/ibc) | [![codecov](https://codecov.io/gh/icon-project/IBC-Integration/branch/main/graph/badge.svg?token=8KX6y8aGom)](https://codecov.io/gh/icon-project/IBC-Integration) |

### Prerequiste

- To install Rust in Linux/Mac,

First, [install rustup](https://rustup.rs/). Once installed, make sure you have the wasm32 target:

```shell
rustup default stable
cargo version
Expand All @@ -38,27 +38,27 @@ Download and run, [rustup-init.exe](https://static.rust-lang.org/rustup/dist/i68
### Build Contracts

- Execute the following command to compile the contract

```
cargo wasm
```

- Optimise using cargo, by giving the following command

```
RUSTFLAGS='-C link-arg=-s' cargo wasm
```

- Deploy the contract on testnet

```
// add the wasm binary file path in <path>

RES=$(archwayd tx wasm store <path> --from wallet --chain-id constantine-2 --node https://rpc.constantine-2.archway.tech:443/ --fees 3397uconst --gas auto -y --output json -b block)
```

- Getting CodeId from RES

```
CODE_ID=$(echo $RES | jq -r '.logs[0].events[-1].attributes[1].value')
```
Expand Down Expand Up @@ -110,7 +110,7 @@ The xCall contract in Inter-Blockchain Communication (IBC) protocol facilitate c
IBC-Core is the reference implementation of the Inter-Blockchain Communication (IBC) protocol, which is a standardized protocol for enabling communication and interoperability between independent blockchain networks.

- [ics02_client](./cw-ibc-core/src/ics02_client/) :

ICS02-Client is a module in the IBC-Core that provides a standard interface and protocol for verifying the state of a remote chain in the Inter-Blockchain Communication (IBC) protocol.

- [ics03_connection](./cw-ibc-core/src/ics03_connection/) :
Expand Down Expand Up @@ -147,4 +147,4 @@ cargo test
### References

- [cosmwasm_book](https://book.cosmwasm.com/)
- [ibc-rs](https://github.com/cosmos/ibc-rs/tree/main/crates/ibc)
- [ibc-rs](https://github.com/cosmos/ibc-rs/tree/main/crates/ibc)
50 changes: 50 additions & 0 deletions contracts/cosmwasm-vm/cw-cluster-connection/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
[package]
name = "cluster-connection"
version = "0.1.0"
edition = "2021"

exclude = [
# Those files are rust-optimizer artifacts. You might want to commit them for convenience but they should not be part of the source code publication.
"contract.wasm",
"hash.txt",
]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[lib]
crate-type = ["cdylib", "rlib"]

[features]
# for more explicit tests, cargo test --features=backtraces
backtraces = ["cosmwasm-std/backtraces"]
library = []

[package.metadata.scripts]
optimize = """docker run --rm -v "$(pwd)":/code \
--mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
cosmwasm/rust-optimizer:0.12.10
"""

[dependencies]
cosmwasm-schema = {workspace=true}
cosmwasm-std = { workspace=true}
cw-storage-plus = {workspace=true}
cw2 = {workspace=true}
schemars = {workspace=true}
serde = { workspace=true}
thiserror = { workspace=true}
common ={ workspace=true}
cw-xcall-lib = { path="../cw-xcall-lib" }
hex = "0.4.3"
serde-json-wasm = {workspace=true}
sha2 = { version = "0.10.6", default-features = false }
sha3 = { version = "0.10.6", default-features = false }
ripemd = "0.1.3"
bech32 = "0.9.1"
k256 = "0.11.6"

[dev-dependencies]
cosmwasm = "0.7.2"
getrandom = {version = "0.2", default-features = false, features = ["custom"]}

Loading
Loading