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

Added better doc for adding chains #412

Merged
merged 1 commit into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions cw-orch/tests/new_chain.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// ANCHOR: NEW_NETWORK_INFO

use cw_orch::environment::{ChainInfo, ChainKind, NetworkInfo};

pub const NEW_NETWORK_INFO: NetworkInfo = NetworkInfo {
chain_name: "osmosis",
pub_address_prefix: "osmo",
coin_type: 118,
};

pub const NEW_CHAIN_INFO: ChainInfo = ChainInfo {
chain_id: "osmosis-4",
gas_denom: "uosmo",
gas_price: 7575.8,
grpc_urls: &["Some GRPC URLS"],
lcd_url: None, // Not necessary for cw-orch
fcd_url: None, // Not necessary for cw-orch
network_info: NEW_NETWORK_INFO,
kind: ChainKind::Mainnet,
};
// ANCHOR_END: NEW_NETWORK_INFO
28 changes: 25 additions & 3 deletions docs/src/chains/index.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,31 @@
# Supported Chains

cw-orchestrator currently has support for the chains in the following subsections.
cw-orchestrator currently explicitly supports the chains in this section:

## Support a new CosmWasm Chain
If you would like to add support for another chain, please feel free to [open a PR](https://github.com/AbstractSDK/cw-orchestrator/compare)!
- [Archway](./archway.md)
- [Injective](./injective.md)
- [Juno](./juno.md)
- [Kujira](./kujira.md)
- [Neutron](./neutron.md)
- [Osmosis](./osmosis.md)
- [Sei](./sei.md)
- [Terra](./terra.md)
- [Rollkit](./rollkit.md)
- [Xion](./xion.md)

## Support a new Cosmos Chain

Almost all Cosmos Chains can be added to cw-orchestrator. Depending on the on-chain modules (CosmWasm is not available on all chains for instance), action may be forbidden for some chains. However, connection should work out of the box for most of the chains. In order to add a new chain to your project, you can use the following objects:

```rust,ignore
{{#include ../../../cw-orch/tests/new_chain.rs:NEW_NETWORK_INFO}}
```

This chain info can then be used inside your project just like any other chain defined inside cw-orch.

Alternatively, we suggest using the <a href="https://docs.rs/cw-orch-daemon/latest/cw_orch_daemon/sync/struct.DaemonBuilder.html#method.grpc_url" target="blank">grpc_url</a> and <a href="https://docs.rs/cw-orch-daemon/latest/cw_orch_daemon/sync/struct.DaemonBuilder.html#method.gas" target="blank">gas</a> methods on the DaemonBuilder for quick and dirty fixes to the grpc url and the gas prices if needed.

If you would like to add explicit support for another chain, please feel free to [open a PR](https://github.com/AbstractSDK/cw-orchestrator/compare)!


## Issues
Expand Down
Loading