Skip to content

Commit

Permalink
Add Bridging Docs (#82)
Browse files Browse the repository at this point in the history
Co-authored-by: Josh Bowen <[email protected]>
Co-authored-by: Josh Bowen <[email protected]>
  • Loading branch information
3 people authored Oct 30, 2024
1 parent b4b61c6 commit 6121b9d
Show file tree
Hide file tree
Showing 29 changed files with 1,537 additions and 110 deletions.
29 changes: 29 additions & 0 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,35 @@ function sidebar() {
{ text: 'On Devnet', link: '/flame/flame-devnet.md' },
]
},
{
text: 'Bridging',
collapsed: true,
items: [
{ text: 'Use the Bridge UI', link: '/bridging/bridge-ui.md' },
{ text: 'CLI Bridging Overview', link: '/bridging/cli-bridging-overview.md' },
{ text: 'Bridge on Mainnet Alpha', collapsed: true, items: [
{ text: 'Bridge To Astria', link: '/bridging/mainnet-alpha/bridge-to-astria-mainnet-alpha.md' },
{ text: 'Withdraw From Astria', link: '/bridging/mainnet-alpha/withdraw-from-astria-mainnet-alpha.md' },
{ text: 'Bridge to Flame', link: '/bridging/mainnet-alpha/bridge-to-flame-mainnet-alpha.md' },
{ text: 'Withdraw from Flame', link: '/bridging/mainnet-alpha/withdraw-from-flame-mainnet-alpha.md' },
]
},
{ text: 'Bridge on Dawn Testnet', collapsed: true, items: [
{ text: 'Bridge To Astria', link: '/bridging/testnet/bridge-to-astria-testnet.md' },
{ text: 'Withdraw From Astria', link: '/bridging/testnet/withdraw-from-astria-testnet.md' },
{ text: 'Bridge to Flame', link: '/bridging/testnet/bridge-to-flame-testnet.md' },
{ text: 'Withdraw from Flame', link: '/bridging/testnet/withdraw-from-flame-testnet.md' },
]
},
{ text: 'Bridge on Dusk Devnet', collapsed: true, items: [
{ text: 'Bridge To Astria', link: '/bridging/devnet/bridge-to-astria-devnet.md' },
{ text: 'Withdraw From Astria', link: '/bridging/devnet/withdraw-from-astria-devnet.md' },
{ text: 'Bridge to Flame', link: '/bridging/devnet/bridge-to-flame-devnet.md' },
{ text: 'Withdraw from Flame', link: '/bridging/devnet/withdraw-from-flame-devnet.md' },
]
},
]
},
{
text: 'Networks',
collapsed: true,
Expand Down
19 changes: 0 additions & 19 deletions docs/astria-evm/overview.md

This file was deleted.

53 changes: 53 additions & 0 deletions docs/bridging/bridge-ui.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<!-- markdownlint-disable MD041 MD033 -->

<script setup>
import { siteConfig } from '../config.js'

const bridge = siteConfig.flame
</script>

# Use the Astria Bridge UI

Astria is an IBC chain and is connected to Celestia, Noble, Osmosis, and Stride.

> [!IMPORTANT]
> The Astria Bridge UI is the recommended method for bridging to Astria.
>
> Visit the Astria Bridging UI <a :href="link" target="_blank"
> rel="noopenernoreferrer">here</a>.
## Navigate to the Bridge UI for your Desired Network

| Network | Bridge UI Link |
|---|---|
| Astria Mainnet Alpha | <a :href="bridge.mainnet.bridging.ui_link" target="_blank" rel="noopener noreferrer">Mainnet Bridge UI</a> |
| Astria `dawn-1` Testnet | <a :href="bridge.dawn.bridging.ui_link" target="_blank" rel="noopener noreferrer">Testnet Bridge UI</a> |
| Astria `dusk-11` Devnet | <a :href="bridge.dusk.bridging.ui_link" target="_blank" rel="noopener noreferrer">Devnet Bridge UI</a> |

## Supported Wallets

> [!TIP]
> If Flame doesn't show in your Keplr wallet you can add it [here](https://chains.keplr.app/).
[Keplr](https://www.keplr.app/) is supported for bridging from Celestia, Noble,
Osmosis, and Stride as well as the Flame EVM.

Any [EIP-6963](https://eips.ethereum.org/EIPS/eip-6963) compatible
wallet should work with Flame, we have tested [Keplr](https://www.keplr.app/), [Metamask](https://metamask.io/) and [Coinbase
Wallet](https://www.coinbase.com/wallet).

## Bridge to Flame

1. Confirm that the Bridge UI is set to **Deposit**.
2. Select your desired starting network and connect your Keplr wallet
3. Select Flame as the destination and connect your EVM wallet.
4. Set an amount.
5. Click `Deposit`.

## Withdraw from Flame

1. Confirm that the Bridge UI is set to **Withdraw**.
2. Select Flame as the starting network and connect your EVM wallet.
3. Select your desired destination network and connect your Keplr wallet.
4. Set an amount.
5. Click `Withdraw`.
136 changes: 136 additions & 0 deletions docs/bridging/cli-bridging-overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
<!-- markdownlint-disable MD041 MD033 -->

<script setup>
import { siteConfig } from '../config.js'

const link = siteConfig.flame.mainnet.bridging.ui_link
</script>

# Bridge to Astria

Astria is an IBC chain and is connected to Celestia, Noble, Osmosis, and Stride.

> [!IMPORTANT]
> The Astria Bridge UI is the recommended method for bridging to Astria.
>
> Visit the Astria Bridging UI <a :href="link" target="_blank"
> rel="noopenernoreferrer">here</a>.
Manual bridging via the command line is available for power users.

## IBC Connections

### Mainnet

| Connected Network | Channel | Astria Channel |
|---|---|---|
| Celestia | `channel-48` | `channel-0` |
| Noble | `channel-104` | `channel-1` |
| Osmosis | `channel-85486` | `channel-2` |
| Stride | `channel-285` | `channel-3` |

### Testnet (dawn-1)

| Connected Network | Channel | Astria Dawn Channel |
|---|---|---|
| Celestia Mocha-4 | `channel-160` | `channel-0` |
| Noble | `channel-232` | `channel-1` |
| Stride | `channel-53` | `channel-2` |
| Osmosis | `channel-9186` | `channel-3` |

### Devnet (dusk-11)

| Connected Network | Channel | Astria Dusk Channel |
|---|---|---|
| Celestia | `channel-159` | `channel-0` |
| Noble | `channel-231` | `channel-1` |

## CLI Bridging Dependencies

To bridge funds directly on the command line, install the following.

Make sure Go is installed and the `/go/bin` is added to your path. This is
required for building and successfully using `celestia-appd`, `nobled`,
`osmosisd`, and `strided`:

- [Go](https://go.dev/doc/install)

Install the `astria-cli`:

- See [`astria-cli` installation
docs](../developer/astria-cli/astria-cli-installation.md)

Install the `celestia-appd` cli:

- See [`celestia-appd` installation
docs](https://docs.celestia.org/how-to-guides/celestia-app)

Install Foundry:

- See the [Foundry installation
docs](https://book.getfoundry.sh/getting-started/installation).

Build the `nobled` cli from source:

<!--@include: ../components/_install-nobled.md-->

Build the `strided` cli from source:

<!--@include: ../components/_install-strided.md-->

Build the `osmosisd` cli from source:

<!--@include: ../components/_install-osmosisd.md-->

## Creating Accounts

You will need an account for all networks you are interacting with.

<!--@include: ../components/_create-accounts.md-->

## Funding Testnet Accounts

### Celestia Mocha Testnet

Fund your Celestia address using the Celestia testnet faucet
[here](https://docs.celestia.org/how-to-guides/mocha-testnet#mocha-testnet-faucet).

### Noble Testnet

Fund your Noble address using the Noble testnet faucet
[here](https://faucet.circle.com/). Select `Noble Testnet` in the dropdown.

### Astria `dusk` Devnet

Fund your Astria address using the Astria `dusk` network faucet
[here](https://faucet.sequencer.dusk-11.devnet.astria.org/).

### Astria `dawn` Testnet

Fund your Astria address using the Astria `dawn` network faucet
[here](https://faucet.sequencer.dawn-1.astria.org/).

## Checking Account Balances

To make the following commands easily copy and pasted, export your account
addresses to the environment:

```bash
export ASTRIA_ADDRESS="<your-astria-address>"
export CELESTIA_ADDRESS="<your-celestia-address>"
export FLAME_ADDRESS="<your-flame-address>"
export NOBLE_ADDRESS="<your-noble-address>"
export STRIDE_ADDRESS="<your-stride-address>"
```

### Check **Mainnet** Balances

<!--@include: ../components/_check-mainnet-balances.md-->

### Check **Testnet** Balances

<!--@include: ../components/_check-testnet-balances.md-->

### Check **Devnet** Balances

<!--@include: ../components/_check-devnet-balances.md-->
48 changes: 48 additions & 0 deletions docs/bridging/devnet/bridge-to-astria-devnet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Bridging to the Astria `dusk` Devnet

Bridging commands from Celestia and Noble testnets to the Astria `dusk` testnet.

You will need the `astria-cli`, `celestia-appd`, and `nobled` installed. Follow
the install steps [here](../overview.md#bridging-dependencies).

You can export the following to make the commands below easily copy and
pastable.

```bash
export ASTRIA_ADDRESS="<your-astria-address>"
export PRIV_KEY="<your-astria-address-private-key>"
export CELESTIA_KEY_NAME="<name-of-your-celestia-key>"
export CELESTIA_ADDRESS="<your-celestia-address>"
export NOBLE_KEY_NAME="<name-of-your-noble-key>"
export NOBLE_ADDRESS="<your-noble-address>"
```

## Bridge to Astria

### From Celestia

```bash
celestia-appd tx ibc-transfer transfer transfer channel-159 $ASTRIA_ADDRESS 1000000utia --fees=420utia --from $CELESTIA_KEY_NAME --node=https://rpc-mocha.pops.one:443 --chain-id mocha-4
```

### From Noble

```bash
nobled tx ibc-transfer transfer transfer channel-231 $ASTRIA_ADDRESS 1000000uusdc --from $NOBLE_KEY_NAME --node https://noble-testnet-rpc.polkachu.com:443 --chain-id grand-1
```

## Check Your Balances on Astria

```bash
astria-cli sequencer balance get $ASTRIA_ADDRESS --sequencer-url https://rpc.sequencer.dusk-11.devnet.astria.org/
```

### View Transactions on [Mintscan](https://www.mintscan.io/)

You can view your transactions by visiting
`https://www.mintscan.io/noble-testnet/address/<your-celestia-address>` or
`https://www.mintscan.io/noble-testnet/address/<your-noble-address>`. You can
also go directly to [Mintscan](https://www.mintscan.io/) and search for the
`txhash` that is returned after sending your transaction, but it is recommended
to view your address transaction history as this will show if an acknowledgement
for your transfer was received.
92 changes: 92 additions & 0 deletions docs/bridging/devnet/bridge-to-flame-devnet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Bridging to Flame on `dusk` Devnet

Bridging commands from Celestia and Noble testnets to the Astria `dusk` devnet.

You will need the `astria-cli`, `celestia-appd`, and `nobled` installed. Follow
the install steps [here](./overview.md#bridging-dependencies).

You can export the following to make the commands below easily copy and
pastable.

```bash
export ASTRIA_ADDRESS="<your-astria-address>"
export PRIV_KEY="<your-astria-address-private-key>"
export CELESTIA_KEY_NAME="<name-of-your-celestia-key>"
export CELESTIA_ADDRESS="<your-celestia-address>"
export NOBLE_KEY_NAME="<name-of-your-noble-key>"
export NOBLE_ADDRESS="<your-noble-address>"
export FLAME_ADDRESS="<your-flame-address>"
```

## Bridge to Flame on `dusk` Devnet

### From Celestia

::: tip
There is no $TIA `BridgeLockAccount` configured for `dusk-11`.
:::

### From Noble

```bash
nobled tx ibc-transfer transfer \
transfer \
channel-231 \
astria12saluecm8dd7hkutk83eavkl2p70lf5w7txezg \
"100000uusdc" \
--memo="{\"rollupDepositAddress\":\"$FLAME_ADDRESS\"}" \
--chain-id="grand-1" \
--from="grand-test-1" \
--node=https://noble-testnet-rpc.polkachu.com:443
--packet-timeout-height 0-0
```

### nRIA from Astria

```bash
astria-cli sequencer bridge-lock astria1yqdjnnmrp7w5ygwj0dkldsgzjhv5vcakp7yeu9 \
--amount 10000 \
--destination-chain-address $FLAME_ADDRESS \
--private-key $PRIV_KEY \
--sequencer.chain-id astria-dusk-11 \
--sequencer-url https://rpc.sequencer.dusk-11.devnet.astria.org \
--fee-asset=nria --asset=nria
```

### USDC from Astria

```bash
astria-cli sequencer bridge-lock astria12saluecm8dd7hkutk83eavkl2p70lf5w7txezg \
--amount 10000 \
--destination-chain-address $FLAME_ADDRESS \
--private-key $PRIV_KEY \
--sequencer.chain-id astria-dusk-11 \
--sequencer-url https://rpc.sequencer.dusk-11.devnet.astria.org \
--fee-asset=nria --asset=transfer/channel-2/uusdc
```

## Check Your Balances on Flame

### TIA

```bash
cast balance $FLAME_ADDRESS --rpc-url https://rpc.flame.dusk-11.devnet.astria.org

```

### USDC

<!-- TODO: verify correct address -->
```bash
cast balance $FLAME_ADDRESS --erc20 0x6e18cE6Ec3Fc7b8E3EcFca4fA35e25F3f6FA879a --rpc-url https://rpc.flame.dusk-11.devnet.astria.org

```

## View Your Transactions

Open the [Flame Block
Explorer](https://explorer.flame.dusk-11.devnet.astria.org) and search for your
Flame address to see your transactions.

On the account page you can view your TIA balance directly. To view your USDC
balance, select the `Tokens` tab.
Loading

0 comments on commit 6121b9d

Please sign in to comment.