Skip to content

Commit 404878c

Browse files
authored
docs: update tutorials and move ibc relayer to advanced concepts (#78)
* docs: update tutorials and move ibc relayer to advanced concepts * docs: address pr comments * chore: fix lowercase header
1 parent 2309ec3 commit 404878c

10 files changed

+29
-25
lines changed

pages/dev-advanced-concepts/_meta.json

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"execute-multiple": "Execute Multiple Transactions",
88
"hd-path-coin-types": "HD Path & Coin Types",
99
"proposals": "Proposals",
10+
"ibc-relayer": "IBC Relayer",
1011
"evm-rpc-endpoints": "EVM RPC Endpoints",
1112
"interoperability": "Interoperability",
1213
"differences-with-ethereum": "Differences from Ethereum"

pages/dev-tutorials/ibc-relayer.mdx renamed to pages/dev-advanced-concepts/ibc-relayer.mdx

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
For IBC protocol overview, refer to
44

5-
[IBC Protocol](https://www.notion.so/IBC-Protocol-61a7d667b530434c8841dde8f3aa2612?pvs=21)
5+
[IBC Protocol](../dev-tutorials/ibc-protocol)
66

77
# Overview
88

@@ -90,7 +90,6 @@ port = 3001
9090
id = 'ibc-0'
9191
rpc_addr = 'http://localhost:27030'
9292
grpc_addr = 'http://localhost:27032'
93-
websocket_addr = 'ws://localhost:27030/websocket'
9493
rpc_timeout = '15s'
9594
account_prefix = 'cosmos'
9695
key_name = 'wallet'
@@ -101,12 +100,12 @@ gas_multiplier = 1.5
101100
clock_drift = '5s'
102101
trusting_period = '14days'
103102
trust_threshold = { numerator = '1', denominator = '3' }
103+
event_source = { mode = 'push', url = 'ws://127.0.0.1:27030/websocket', batch_delay = '500ms' }
104104

105105
[[chains]]
106106
id = 'sei-chain'
107107
rpc_addr = 'http://localhost:26657'
108108
grpc_addr = 'http://localhost:9090'
109-
websocket_addr = 'ws://localhost:26657/websocket'
110109
rpc_timeout = '15s'
111110
account_prefix = 'sei'
112111
key_name = 'wallet'
@@ -117,6 +116,7 @@ gas_multiplier = 2
117116
clock_drift = '5s'
118117
trusting_period = '14days'
119118
trust_threshold = { numerator = '1', denominator = '3' }
119+
event_source = { mode = 'push', url = 'ws://127.0.0.1:26657/websocket', batch_delay = '500ms' }
120120

121121
```
122122

pages/dev-advanced-concepts/querying-historical-state.mdx

-4
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,3 @@ Querying by block height with seid
3333
## **Using Indexers for Historical Data**
3434

3535
While archive nodes provide the raw historical data, indexers are essential for efficiently querying and analyzing this data. Indexers organize and optimize the data, making it easier to access and analyze.
36-
37-
## **Indexer Providers**:
38-
39-
There are several indexer providers that you can use to query historical data on the Sei blockchain. Refer to the [Indexer Providers](https://www.notion.so/Advanced-concepts-cfcc51a81ede49d186bb9aa36fc73d83?pvs=21) section for more information on available services.

pages/dev-tutorials/_meta.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,5 @@
88
"nft-contract-tutorial": "NFT Contracts",
99
"pointer-contracts": "Pointer Contracts",
1010
"multi-sig-accounts": "Multi-Sig Accounts",
11-
"ibc-protocol": "IBC Protocol",
12-
"ibc-relayer": "IBC Relayer"
11+
"ibc-protocol": "IBC Protocol"
1312
}

pages/dev-tutorials/building-a-frontend.mdx

+3-3
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ These values will be used in the app to query and execute a contract.
8080
Replace your main `App` component with the following:
8181

8282
```tsx copy filename="App.tsx"
83-
import { WASM_PRECOMPILE_ADDRESS, SeiChainInfo, getWasmPrecompileEthersV6Contract } from '@sei-js/evm';
83+
import { WASM_PRECOMPILE_ADDRESS, SEI_CHAIN_INFO, getWasmPrecompileEthersV6Contract } from '@sei-js/evm';
8484
import { useEffect, useState } from "react";
8585
import { BrowserProvider, Contract, toUtf8Bytes, toUtf8String } from "ethers";
8686
import "./App.css";
@@ -115,14 +115,14 @@ function App() {
115115
if (window.ethereum) {
116116
const provider = new BrowserProvider(window.ethereum);
117117
const { chainId } = await provider.getNetwork();
118-
const devnetChainId = SeiChainInfo.devnet.chainId
118+
const devnetChainId = SEI_CHAIN_INFO.devnet.chainId
119119
if (chainId !== BigInt(devnetChainId)) {
120120
alert("Wallet is not connected to Sei EVM devnet");
121121
return;
122122
}
123123

124124
const signer = await provider.getSigner();
125-
const contract = getWasmPrecompileEthersV6Contract(WASM_PRECOMPILE_ADDRESS, signer)
125+
const contract = getWasmPrecompileEthersV6Contract(signer)
126126

127127
setContract(contract);
128128
} else {

pages/dev-tutorials/evm-general.mdx

+13-3
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,11 @@ To call contract from frontend, you could use `ethers` like:
285285
```tsx
286286
import {ethers} from "ethers";
287287

288-
const signer = await getEthSigner();
289-
const provider = await getProvider();
288+
const privateKey = <Your Private Key>;
289+
const evmRpcEndpoint = <Your Evm Rpc Endpoint>
290+
const provider = new ethers.JsonRpcProvider(evmRpcEndpoint);
291+
const signer = new ethers.Wallet(privateKey, provider);
292+
290293
if (!signer) {
291294
console.log('No signer found');
292295
return;
@@ -331,13 +334,20 @@ To call contract from frontend, you could use `ethers` like:
331334
const contractAddress = 0X_CONTRACT_ADDRESS;
332335

333336
// Create a new instance of the ethers.js Contract object
334-
const contract = new ethers.Contract(contractAddress, abi, provider);
337+
const contract = new ethers.Contract(contractAddress, abi, signer);
335338

336339
// Call the contract's functions
337340
async function getCount() {
338341
const count = await contract.getCount();
339342
console.log(count.toString());
340343
}
341344

345+
async function increment() {
346+
const txResponse = await contract.increment();
347+
const mintedTx = await txResponse.wait();
348+
console.log(mintedTx);
349+
}
350+
351+
await increment();
342352
await getCount();
343353
```

pages/dev-tutorials/nft-contract-tutorial.mdx

+4-4
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ forge remappings > remappings.txt
108108
In a new terminal, deploy your contract:
109109

110110
```bash copy
111-
forge create --rpc-url http://localhost:8545 --private-key <test_account_private_key> src/MyNFT.sol:MyNFT
111+
forge create --rpc-url http://localhost:8545 --private-key <test_account_private_key> src/MyNFT.sol:MyNFT --legacy
112112
```
113113

114114
**Flags**
@@ -120,7 +120,7 @@ forge remappings > remappings.txt
120120
3. Deploy contract to the Sei devnet (EVM endpoint):
121121

122122
```bash copy
123-
forge create --rpc-url https://evm-rpc.arctic-1.seinetwork.io/ --private-key <your_private_key> src/MyNFT.sol:MyNFT
123+
forge create --rpc-url https://evm-rpc.arctic-1.seinetwork.io/ --private-key <your_private_key> src/MyNFT.sol:MyNFT --legacy
124124
```
125125

126126
**Flags**
@@ -143,7 +143,7 @@ forge remappings > remappings.txt
143143
To enable seamless use of this NFT contract in CosmWasm environments, you can create a pointer contract. This process results in an CW721 token that can be imported and used in Sei wallets and applications.
144144

145145
```bash copy
146-
seid tx wasm instantiate 8 '{"erc721_address": "$ERC721_TOKEN_ADDRESS"}' --from=$ACCOUNT --label=$LABEL --chain-id=arctic-1 --broadcast-mode=block --gas=250000 --fees=25000usei --node=https://rpc-arctic-1.sei-apis.com/ --no-admin
146+
seid tx evm register-cw-pointer ERC721 $ERC721_TOKEN_ADDRESS --from $ACCOUNT --chain-id=arctic-1 --fees=25000usei --node=https://rpc-arctic-1.sei-apis.com/
147147
```
148148

149149
**Parameters**
@@ -165,7 +165,7 @@ Executing this command creates an CW721 NFT contract and outputs the contract ad
165165

166166
<Callout type="info">
167167
Learn more about EVM interoperability and pointer contracts
168-
[here](../interoperability/overview.mdx).
168+
[here](../dev-advanced-concepts/interoperability/introduction.mdx).
169169
</Callout>
170170

171171
</Tabs.Tab>

pages/dev-tutorials/pointer-contracts.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ This section guides you through the process of deploying a Pointer Contract for
3434

3535
<Callout type="info" emoji="ℹ️">
3636
For an in-depth understanding of Sei token standards, click
37-
[here](/token-standards).
37+
[here](../dev-token-standards).
3838
</Callout>
3939

4040
#### Prerequisites

pages/dev-tutorials/tokenfactory-tutorial.mdx

+2-4
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ Create a token metadata `json` file. The file below is an example metadata file
6666
{
6767
"name": "sei",
6868
"description": "The native token of Sei.",
69+
"symbol": "SEI",
6970
"denom_units": [
7071
{
7172
"denom": "usei",
@@ -148,15 +149,12 @@ Only the token admin has permission to mint and burn tokens. If necessary, you c
148149
To enable seamless use of this token in EVM environments, we can create a pointer contract. This process results in an ERC20 token that can be imported and used in EVM wallets and applications.
149150

150151
```bash copy
151-
seid tx evm deploy-erc20 $DENOM $NAME $SYMBOL $DECIMAL --from=$ACCOUNT --evm-rpc=https://evm-rpc.arctic-1.seinetwork.io/
152+
seid tx evm register-evm-pointer NATIVE $DENOM --from=$ACCOUNT --fees 20000usei --evm-rpc=https://evm-rpc.arctic-1.seinetwork.io/
152153
```
153154

154155
**Parameters**
155156

156157
- `DENOM`: The denomination of the token for which you want to create an ERC20 pointer. This should match the TokenFactory token you created.
157-
- `NAME`: The name you wish to assign to your ERC20 pointer token. It should match the name of the TokenFactory token.
158-
- `SYMBOL`: The symbol for your ERC20 pointer token. It should correspond with the symbol of the TokenFactory token.
159-
- `DECIMAL`: The number of decimals for your ERC20 pointer token. This should align with the decimals of the TokenFactory token (typically 6).
160158

161159
**Flags**
162160

pages/dev-validators/register.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Before you register a validator, ensure that you have completed the following steps:
66

77
1. **Install the `seid` CLI**: Follow the [installation guide](../dev-node/intro.mdx) to set up the `seid` command-line interface.
8-
2. **Set Up a Full Node**: Ensure your full node is fully synced with the network. Refer to the [full node setup guide](../dev-node/node-operators.mdx).
8+
2. **Set Up a Full Node**: Ensure your full node is fully synced with the network. Refer to the [full node setup guide](../dev-node/intro.mdx).
99

1010
## Generate a Validator Key
1111

0 commit comments

Comments
 (0)