Skip to content

Commit

Permalink
Add Wasm variant of ibc-go v7 and v8 (#270)
Browse files Browse the repository at this point in the history
* Add Wasm variant of ibc-go v7 and v8

* Fix formatting

* Fix incorrect update
  • Loading branch information
soareschen authored Aug 26, 2024
1 parent c723f82 commit 145ce6c
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 2 deletions.
36 changes: 36 additions & 0 deletions flake.lock

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

18 changes: 17 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
nixConfig = {
substituters = "https://cosmos-nix.cachix.org https://cache.nixos.org https://nix-community.cachix.org";
trusted-public-keys = "cosmosnix.store-1:O28HneR1MPtgY3WYruWFuXCimRPwY7em5s0iynkQxdk= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=";
trusted-public-keys = "cosmos-nix.cachix.org-1:I9dmz4kn5+JExjPxOd9conCzQVHPl0Jo1Cdp6s+63d4= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=";
};

description = "A reproducible package set for Cosmos, IBC and CosmWasm";
Expand Down Expand Up @@ -147,6 +147,22 @@
ibc-go-v9-src.url = "github:cosmos/ibc-go/v9.0.0-beta.1";
ibc-go-v9-src.flake = false;

ibc-go-v7-wasm-src = {
type = "github";
owner = "cosmos";
repo = "ibc-go";
ref = "modules/light-clients/08-wasm/v0.3.1+ibc-go-v7.4-wasmvm-v1.5";
flake = false;
};

ibc-go-v8-wasm-src = {
type = "github";
owner = "cosmos";
repo = "ibc-go";
ref = "modules/light-clients/08-wasm/v0.4.1+ibc-go-v8.4-wasmvm-v2.0";
flake = false;
};

cosmos-sdk-src.url = "github:cosmos/cosmos-sdk/v0.46.0";
cosmos-sdk-src.flake = false;

Expand Down
8 changes: 8 additions & 0 deletions modules/apps.nix
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,14 @@
type = "app";
program = "${packages.ibc-go-v9-simapp}/bin/simd";
};
ibc-go-v7-wasm-simapp = {
type = "app";
program = "${packages.ibc-go-v7-wasm-simapp}/bin/simd";
};
ibc-go-v8-wasm-simapp = {
type = "app";
program = "${packages.ibc-go-v8-wasm-simapp}/bin/simd";
};
ignite-cli = {
type = "app";
program = "${packages.ignite-cli}/bin/ignite";
Expand Down
2 changes: 1 addition & 1 deletion modules/packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@
# IBC Go
(import ../packages/ibc-go.nix {
inherit inputs;
inherit (self'.packages) libwasmvm_2_1_0;
inherit (self'.packages) libwasmvm_1_5_0 libwasmvm_2_1_0;
inherit (cosmosLib) mkCosmosGoApp wasmdPreFixupPhase;
})
# Libwasm VM
Expand Down
31 changes: 31 additions & 0 deletions packages/ibc-go.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
inputs,
libwasmvm_1_5_0,
libwasmvm_2_1_0,
mkCosmosGoApp,
wasmdPreFixupPhase,
Expand Down Expand Up @@ -102,4 +103,34 @@ with inputs;
'';
buildInputs = [libwasmvm_2_1_0];
};

ibc-go-v7-wasm-simapp = {
name = "simd";
version = "v7.4.0-wasm";
src = "${ibc-go-v7-wasm-src}/modules/light-clients/08-wasm";
rev = ibc-go-v7-wasm-src.rev;
vendorHash = "sha256-jPd1mjyjFlS3thN0LlpPUhnA6D4UyVkDU+pcJwI9tp0=";
goVersion = "1.22";
tags = ["netgo"];
engine = "cometbft/cometbft";
preFixup = ''
${wasmdPreFixupPhase libwasmvm_1_5_0 "simd"}
'';
buildInputs = [libwasmvm_1_5_0];
};

ibc-go-v8-wasm-simapp = {
name = "simd";
version = "v8.4.0-wasm";
src = "${ibc-go-v8-wasm-src}/modules/light-clients/08-wasm";
rev = ibc-go-v8-wasm-src.rev;
vendorHash = "sha256-z+hmzuAeyVYXtbb3SClfwQW0+nrUiYYYZCP6Vvc4dmQ=";
goVersion = "1.22";
tags = ["netgo"];
engine = "cometbft/cometbft";
preFixup = ''
${wasmdPreFixupPhase libwasmvm_2_1_0 "simd"}
'';
buildInputs = [libwasmvm_2_1_0];
};
}

0 comments on commit 145ce6c

Please sign in to comment.