Skip to content

Commit

Permalink
fix: links to Vara network (#3628)
Browse files Browse the repository at this point in the history
  • Loading branch information
shamilsan authored Dec 27, 2023
1 parent bada27b commit af1b94c
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 31 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Gear Protocol is a Substrate-based solution for developers, enabling anyone to r
</h3>

#

<div align="center">

[![CI][c1]][c2]
Expand Down Expand Up @@ -41,7 +41,7 @@ Gear Protocol is a Substrate-based solution for developers, enabling anyone to r

1. :open_hands: The easiest way to get started with Gear Protocol is by using the demo environment at [https://idea.gear-tech.io](https://idea.gear-tech.io).

2. :wrench: Follow the instructions from ["Getting started in 5 minutes"](https://wiki.gear-tech.io/docs/getting-started-in-5-minutes/) to compile the Rust test program to Wasm. :running: Upload and run the program on the Vara Network Testnet via [Gear Idea](https://idea.gear-tech.io/programs?node=wss%3A%2F%2Ftestnet.vara-network.io), send a message to a program, check how it is going.
2. :wrench: Follow the instructions from ["Getting started in 5 minutes"](https://wiki.gear-tech.io/docs/getting-started-in-5-minutes/) to compile the Rust test program to Wasm. :running: Upload and run the program on the Vara Network Testnet via [Gear Idea](https://idea.gear-tech.io/programs?node=wss%3A%2F%2Ftestnet.vara.network), send a message to a program, check how it is going.

3. :scroll: Write your own program or use one from the comprehensive [examples library](https://github.com/gear-foundation/dapps) as a basis for a convenient and swift onboarding process.

Expand Down Expand Up @@ -140,8 +140,8 @@ Go to https://docs.gear.rs to dive into the documentation on Gear Protocol crate
### Main capabilities
- Gear Protocol enables anyone to create and run a custom-logic **decentralized programs**.
- Programs can support business logic of any other projects running in the **Gear-powered network** (such as the [Vara Network](https://vara-network.io/)) and interact with them.
- Gear Protocol enables anyone to create and run a custom-logic **decentralized programs**.
- Programs can support business logic of any other projects running in the **Gear-powered network** (such as the [Vara Network](https://vara.network/)) and interact with them.
- Establish cross-chain communications between other Substrate-supported blockchains, allowing anyone to run a dApp in the Dotsama ecosystem in a very **cost-less** manner.
- A Gear node can run as a standalone instance running microservices, middleware, open API and more.
Expand Down Expand Up @@ -216,7 +216,7 @@ Gear Protocol is licensed under [GPL v3.0 with a classpath linking exception](LI
<a href="https://gear.foundation/events">
Events
</a> •
<a href="https://vara-network.io/">
<a href="https://vara.network/">
Vara Network
</a> •
</p>
Expand Down
6 changes: 3 additions & 3 deletions gclient/src/api/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ impl GearApi {
}

/// Create and init a new `GearApi` instance that will be used with the
/// public Gear testnet.
pub async fn gear() -> Result<Self> {
Self::init(WSAddress::gear()).await
/// public Vara testnet node.
pub async fn vara_testnet() -> Result<Self> {
Self::init(WSAddress::vara_testnet()).await
}

/// Create and init a new `GearApi` instance that will be used with the
Expand Down
22 changes: 12 additions & 10 deletions gclient/src/ws.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,14 @@ impl WSAddress {
// Local dev node.
const LOCALHOST: &'static str = "ws://127.0.0.1";

// Gear testnet.
const GEAR: &'static str = "wss://rpc-node.gear-tech.io";
const GEAR_PORT: u16 = 443;
// Default secure WebSocket port.
const WSS_DEFAULT_PORT: u16 = 443;

// Vara testnet.
const VARA_TESTNET: &'static str = "wss://testnet.vara.network";

// Vara network.
const VARA: &'static str = "wss://rpc.vara-network.io";
const VARA: &'static str = "wss://rpc.vara.network";

/// Create a new `WSAddress` from a host `domain` and `port`.
///
Expand Down Expand Up @@ -114,18 +116,18 @@ impl WSAddress {
Self::new(Self::LOCALHOST, port)
}

/// Return the default address of the public Gear testnet node.
/// Return the default address of the public Vara testnet node.
///
/// # Examples
///
/// ```
/// use gclient::WSAddress;
///
/// let address = WSAddress::gear();
/// assert_eq!(address, WSAddress::new("wss://rpc-node.gear-tech.io", 443));
/// let address = WSAddress::vara_testnet();
/// assert_eq!(address, WSAddress::new("wss://testnet.vara.network", 443));
/// ```
pub fn gear() -> Self {
Self::new(Self::GEAR, Self::GEAR_PORT)
pub fn vara_testnet() -> Self {
Self::new(Self::VARA_TESTNET, Self::WSS_DEFAULT_PORT)
}

/// Return the default address of the public Vara node.
Expand All @@ -136,7 +138,7 @@ impl WSAddress {
/// use gclient::WSAddress;
///
/// let address = WSAddress::vara();
/// assert_eq!(address.url(), "wss://rpc.vara-network.io");
/// assert_eq!(address.url(), "wss://rpc.vara.network");
/// ```
pub fn vara() -> Self {
Self::new(Self::VARA, None)
Expand Down
2 changes: 1 addition & 1 deletion gsdk/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ use subxt::{
error::RpcError,
};

const DEFAULT_GEAR_ENDPOINT: &str = "wss://rpc.vara-network.io:443";
const DEFAULT_GEAR_ENDPOINT: &str = "wss://rpc.vara.network:443";
const DEFAULT_TIMEOUT: u64 = 60_000;
const ONE_HUNDRED_MEGA_BYTES: u32 = 100 * 1024 * 1024;

Expand Down
2 changes: 1 addition & 1 deletion gsdk/tests/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ async fn test_runtime_wasm_blob_version() -> Result<()> {

#[tokio::test]
async fn test_runtime_wasm_blob_version_history() -> Result<()> {
let api = Api::new(Some("wss://archive-rpc.vara-network.io:443")).await?;
let api = Api::new(Some("wss://archive-rpc.vara.network:443")).await?;

{
let no_method_block_hash = sp_core::H256::from_str(
Expand Down
20 changes: 10 additions & 10 deletions utils/gear-replay-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ Other than that it's a good tool.
- current latest finalized block on Vara chain

```bash
gear try-runtime --chain=vara --runtime vara_runtime.compact.compressed.wasm execute-block live --uri wss://archive-rpc.vara-network.io:443
gear try-runtime --chain=vara --runtime vara_runtime.compact.compressed.wasm execute-block live --uri wss://archive-rpc.vara.network:443
```

- at block `$HASH`

```bash
export HASH=0x8dc1e32576c1ad4e28dc141769576efdbc19d0170d427b69edb2261cfc36e905
gear try-runtime --chain=vara --runtime vara_runtime.compact.compressed.wasm execute-block live --uri wss://archive-rpc.vara-network.io:443 --at "$HASH"
gear try-runtime --chain=vara --runtime vara_runtime.compact.compressed.wasm execute-block live --uri wss://archive-rpc.vara.network:443 --at "$HASH"
```

_Note:_ The `--at` parameter provides the hash of the block which determines the current state of the blockchain. Then the following block is fetched and applied to this state. Therefore if we want to replay extrinsics from the block `N` we must provide the hash of the block `N-1` as the height.
Expand All @@ -60,7 +60,7 @@ Other than that it's a good tool.
```bash
export HASH=0x8dc1e32576c1ad4e28dc141769576efdbc19d0170d427b69edb2261cfc36e905
gear try-runtime --chain=vara --runtime existing create-snapshot --uri wss://archive-rpc.vara-network.io:443 [--at "$HASH"] [$SNAPSHOT_PATH]
gear try-runtime --chain=vara --runtime existing create-snapshot --uri wss://archive-rpc.vara.network:443 [--at "$HASH"] [$SNAPSHOT_PATH]
```

If `$SNAPSHOT_PATH` is not provided the default filename for a snapshot would be `$chain`-`$spec_version`@`$block_hash`.snap (for instance, `vara-140@8dc1e32576c1ad4e28dc141769576efdbc19d0170d427b69edb2261cfc36e905.snap` or `vara-140@latest.snap`).
Expand All @@ -70,22 +70,22 @@ Other than that it's a good tool.
```bash
export SNAPSHOT="vara-140@8dc1e32576c1ad4e28dc141769576efdbc19d0170d427b69edb2261cfc36e905.snap"
gear try-runtime --chain=vara --runtime vara_runtime.compact.compressed.wasm execute-block --block-ws-uri wss://archive-rpc.vara-network.io:443 snap --snapshot-path "$SNAPSHOT"
gear try-runtime --chain=vara --runtime vara_runtime.compact.compressed.wasm execute-block --block-ws-uri wss://archive-rpc.vara.network:443 snap --snapshot-path "$SNAPSHOT"
```

<b>Warning:</b> By default the `try-runtime execute-block` command runs with the `--try-state` option value set to `all`, that is it will try to validate the state of all the pallets in the snapshot. This may result in an error caused by inconsistencies in some pallets storage (for instance, at the moment of this writing the `BagsList` pallet has inconsistent data). This is, of course, something to look into, but it goes beyond the scope of the problem in question.
Since this doesn't affect the internal logic of the Gear flow we want to reproduce, we might consider either completely omitting setting the `try_state` by setting the respective option to `none`
```bash
gear try-runtime --chain=vara --runtime vara_runtime.compact.compressed.wasm execute-block --try-state none live --uri wss://archive-rpc.vara-network.io:443
gear try-runtime --chain=vara --runtime vara_runtime.compact.compressed.wasm execute-block --try-state none live --uri wss://archive-rpc.vara.network:443
```
or enumerate a number of pallets in the runtime we are only concerned with:
```bash
export TRY_PALLETS=System,Babe,Grandpa,Balances,Staking,Vesting,Gear,GearGas,GearProgram,GearMessenger,GearScheduler,GearPayment,StakingRewards
gear try-runtime --chain=vara --runtime vara_runtime.compact.compressed.wasm execute-block --try-state "$TRY_PALLETS" live --uri wss://archive-rpc.vara-network.io:443
gear try-runtime --chain=vara --runtime vara_runtime.compact.compressed.wasm execute-block --try-state "$TRY_PALLETS" live --uri wss://archive-rpc.vara.network:443
```
<br/>
Expand Down Expand Up @@ -118,7 +118,7 @@ General command format and available subcommand are:
help Print this message or the help of the given subcommand(s)
Options:
-u, --uri <URI> The RPC url [default: wss://archive-rpc.vara-network.io:443]
-u, --uri <URI> The RPC url [default: wss://archive-rpc.vara.network:443]
-l, --log [<NODE_LOG>...] Sets a custom logging filter. Syntax is `<target>=<level>`, e.g. -lsync=debug
-h, --help Print help (see more with '--help')
```
Expand All @@ -130,7 +130,7 @@ Currently supported cases include:
- current latest finalized block on Vara chain
```bash
gear-replay-cli --uri wss://archive-rpc.vara-network.io:443 -lgear::runtime,pallet_gear,gear_common,pallet_gear_scheduler=debug replay-block
gear-replay-cli --uri wss://archive-rpc.vara.network:443 -lgear::runtime,pallet_gear,gear_common,pallet_gear_scheduler=debug replay-block
```
- block with `$HASH` or `$BLOCK_NUM`
Expand All @@ -139,8 +139,8 @@ Currently supported cases include:
export HASH=0x8dc1e32576c1ad4e28dc141769576efdbc19d0170d427b69edb2261cfc36e905
export BLOCK_NUM=2000000
gear-replay-cli --uri wss://archive-rpc.vara-network.io:443 -lgear::runtime,pallet_gear,gear_common=debug replay-block --block "$HASH"
gear-replay-cli --uri wss://archive-rpc.vara-network.io:443 -lgear::runtime,pallet_gear,gear_common=debug replay-block --block "$BLOCK_NUM"
gear-replay-cli --uri wss://archive-rpc.vara.network:443 -lgear::runtime,pallet_gear,gear_common=debug replay-block --block "$HASH"
gear-replay-cli --uri wss://archive-rpc.vara.network:443 -lgear::runtime,pallet_gear,gear_common=debug replay-block --block "$BLOCK_NUM"
```
<br/>
Expand Down
2 changes: 1 addition & 1 deletion utils/gear-replay-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ pub struct SharedParams {
short,
long,
value_parser = parse::url,
default_value = "wss://archive-rpc.vara-network.io:443"
default_value = "wss://archive-rpc.vara.network:443"
)]
uri: String,

Expand Down

0 comments on commit af1b94c

Please sign in to comment.