Skip to content

Commit 67df6e2

Browse files
committed
doc: add "connect to spawn chains" guide
1 parent 803661d commit 67df6e2

File tree

2 files changed

+29
-16
lines changed

2 files changed

+29
-16
lines changed

examples/chain-template-spawn/README.md

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,43 +12,50 @@ Open [http://localhost:3000](http://localhost:3000) with your browser to see the
1212

1313
You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file.
1414

15-
## Learn More
15+
## How to connect to Spawn chains
16+
17+
1. Follow the official guide to set up Spawn: https://github.com/rollchains/spawn
18+
2. Make sure the Spawn generated chain is up and running
19+
3. Go to `./config/spawn.ts` to edit the default Spawn chain config if needed
20+
4. Run `yarn dev` and open http://localhost:3000, select "Rollchain" (or other custom chain names) from the chain dropdown in the top right corner, then click "Connect Wallet" in the left sidebar to connect to the chain
21+
5. Go to "Faucet" to get some test tokens and enjoy!
22+
23+
## Learn More
1624

1725
### Chain Registry
1826

1927
The npm package for the Official Cosmos chain registry. Get chain and token data for you application.
2028

21-
* https://github.com/cosmology-tech/chain-registry
29+
- https://github.com/cosmology-tech/chain-registry
2230

2331
### Cosmology Videos
2432

2533
Checkout more videos for how to use various frontend tooling in the Cosmos!
2634

27-
* https://cosmology.zone/learn
35+
- https://cosmology.zone/learn
2836

2937
### Cosmos Kit
3038

3139
A wallet connector for the Cosmos ⚛️
3240

33-
* https://github.com/cosmology-tech/cosmos-kit
41+
- https://github.com/cosmology-tech/cosmos-kit
3442

3543
### Telescope
3644

3745
A "babel for the Cosmos", Telescope is a TypeScript Transpiler for Cosmos Protobufs. Telescope is used to generate libraries for Cosmos blockchains. Simply point to your protobuffer files and create developer-friendly Typescript libraries for teams to build on your blockchain.
3846

39-
* https://github.com/cosmology-tech/telescope
47+
- https://github.com/cosmology-tech/telescope
4048

4149
🎥 [Checkout the Telescope video playlist](https://www.youtube.com/watch?v=n82MsLe82mk&list=PL-lMkVv7GZwyQaK6bp6kMdOS5mzosxytC) to learn how to use `telescope`!
4250

4351
### CosmWasm TS Codegen
4452

4553
The quickest and easiest way to interact with CosmWasm Contracts. @cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.
4654

47-
* https://github.com/CosmWasm/ts-codegen
55+
- https://github.com/CosmWasm/ts-codegen
4856

4957
🎥 [Checkout the CosmWasm/ts-codegen video playlist](https://www.youtube.com/watch?v=D_A5V2PfNLA&list=PL-lMkVv7GZwz1KO3jANwr5W4MoziruXwK) to learn how to use `ts-codegen`!
5058

51-
5259
## Learn More about Next.js
5360

5461
To learn more about Next.js, take a look at the following resources:
@@ -68,19 +75,18 @@ Check out our [Next.js deployment documentation](https://nextjs.org/docs/deploym
6875

6976
Checkout these related projects:
7077

71-
* [@cosmology/telescope](https://github.com/cosmology-tech/telescope) Your Frontend Companion for Building with TypeScript with Cosmos SDK Modules.
72-
* [@cosmwasm/ts-codegen](https://github.com/CosmWasm/ts-codegen) Convert your CosmWasm smart contracts into dev-friendly TypeScript classes.
73-
* [chain-registry](https://github.com/cosmology-tech/chain-registry) Everything from token symbols, logos, and IBC denominations for all assets you want to support in your application.
74-
* [cosmos-kit](https://github.com/cosmology-tech/cosmos-kit) Experience the convenience of connecting with a variety of web3 wallets through a single, streamlined interface.
75-
* [create-cosmos-app](https://github.com/cosmology-tech/create-cosmos-app) Set up a modern Cosmos app by running one command.
76-
* [interchain-ui](https://github.com/cosmology-tech/interchain-ui) The Interchain Design System, empowering developers with a flexible, easy-to-use UI kit.
77-
* [starship](https://github.com/cosmology-tech/starship) Unified Testing and Development for the Interchain.
78+
- [@cosmology/telescope](https://github.com/cosmology-tech/telescope) Your Frontend Companion for Building with TypeScript with Cosmos SDK Modules.
79+
- [@cosmwasm/ts-codegen](https://github.com/CosmWasm/ts-codegen) Convert your CosmWasm smart contracts into dev-friendly TypeScript classes.
80+
- [chain-registry](https://github.com/cosmology-tech/chain-registry) Everything from token symbols, logos, and IBC denominations for all assets you want to support in your application.
81+
- [cosmos-kit](https://github.com/cosmology-tech/cosmos-kit) Experience the convenience of connecting with a variety of web3 wallets through a single, streamlined interface.
82+
- [create-cosmos-app](https://github.com/cosmology-tech/create-cosmos-app) Set up a modern Cosmos app by running one command.
83+
- [interchain-ui](https://github.com/cosmology-tech/interchain-ui) The Interchain Design System, empowering developers with a flexible, easy-to-use UI kit.
84+
- [starship](https://github.com/cosmology-tech/starship) Unified Testing and Development for the Interchain.
7885

7986
## Credits
8087

8188
🛠 Built by Cosmology — if you like our tools, please consider delegating to [our validator ⚛️](https://cosmology.zone/validator)
8289

83-
8490
## Disclaimer
8591

8692
AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED “AS IS”, AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND.

examples/chain-template/components/common/Header/ChainDropdown.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const ChainDropdown = () => {
1313
const { chain } = useChain(selectedChain);
1414
const [input, setInput] = useState<string>(chain.pretty_name);
1515
const { isMobile } = useDetectBreakpoints();
16-
const { data: starshipChains } = useStarshipChains();
16+
const { data: starshipChains, refetch } = useStarshipChains();
1717

1818
const [isChainsAdded, setIsChainsAdded] = useState(false);
1919
const { addChains, getChainLogo } = useManager();
@@ -33,6 +33,12 @@ export const ChainDropdown = () => {
3333
}
3434
}, [starshipChains, isChainsAdded]);
3535

36+
const onOpenChange = (isOpen: boolean) => {
37+
if (isOpen && !isChainsAdded) {
38+
refetch();
39+
}
40+
};
41+
3642
const chains = isChainsAdded
3743
? chainOptions.concat(starshipChains?.chains ?? [])
3844
: chainOptions;
@@ -42,6 +48,7 @@ export const ChainDropdown = () => {
4248
onInputChange={(input) => {
4349
setInput(input);
4450
}}
51+
onOpenChange={onOpenChange}
4552
selectedKey={selectedChain}
4653
onSelectionChange={(key) => {
4754
const chainName = key as string | null;

0 commit comments

Comments
 (0)