-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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
WIP content #13130
WIP content #13130
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
// assign Testnet RPC address | ||
const testnet = 'https://fullnode.testnet.sui.io:443/'; | ||
// set endpoint value to Testnet RPC URL | ||
const SuiClient = new SuiClient({ endpoint: testnet }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
endpoint was renamed to url
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm. I ran into this so not sure why I failed to update. Good catch.
@@ -0,0 +1,53 @@ | |||
# Connecting to Sui Network | |||
|
|||
The Sui TypeScript SDK provides a SuiClient class that you can use to connect to a network's JSON-RPC server. Use the `SuiClient` for all JSON-RPC read-only operations. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the SuiClient is not strictly read-only, it also supports other RPC methods like sending a transaction
}); | ||
``` | ||
|
||
| Connection object | Full node address | `faucet` location | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
connect objects are being removed from the sdk, maybe we can just use network
for this column
```typescript | ||
import { JsonRpcProvider, localnetConnection } from '@mysten/sui.js'; | ||
// connect to local RPC server | ||
const provider = new JsonRpcProvider(localnetConnection); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JsonRpcProvider will be deprecated and replaced with SuiClient (which does not support faucet).
The updated way to request sui from a faucet is documented here: https://github.com/MystenLabs/sui/blob/main/sdk/docs/pages/typescript-sdk/faucet.mdx
|
||
You need an address on a Sui development network (Devnet, Testnet, Localnet). If you don't already have an address, use the [Sui Client CLI](https://docs.sui.io/build/cli-client) or the [Sui Wallet browser extension](https://docs.mystenlabs.com/wallet) to create one. | ||
|
||
## Clone Sui project and build SDK |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure we need this as part of the docs site, at least not as a prominent part.
Generally, I think we want people to use the published version of the client rather than building/linking a local version of the SDK
Projects developing against one of the on-chain Sui networks (Devnet, Testnet, Mainnet) should use the base SDK published in the NPM registry (previous section) because the code aligns with the relevant JSON-RPC. If your developing against a [local network](https://docs.sui.io/testnet/build/sui-local-network) built from the `main` branch of the Sui monorepo, however, you should use the `experimental`-tagged SDK package as it contains the latest features (or a local build detailed in the section that follows). | ||
|
||
```sh | ||
<Tabs items={["npm", "yarn", "pnpm"]} group="pkg-mgr"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nextra has a plugin that will define these for you (eg https://github.com/MystenLabs/sui/blob/main/sdk/docs/pages/typescript-sdk/index.mdx#L10-L12)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I saw that and was super excited about it, as nerdy as that sounds. But, I left this in there for now because we could use similar behavior for other tab groups. Windows/Mac/Linux, for instance. Of course, there might also already be similar plugins for the cases we'd need...something to noodle on anyway.
just pushed some style fixes to make the linter happy, I'll merge this so anything new is based on the changes you already made here, thanks for adding all this! |
Description
Prelim doc content for Hayes.
Test Plan
NA
If your changes are not user-facing and not a breaking change, you can skip the following section. Otherwise, please indicate what changed, and then add to the Release Notes section as highlighted during the release process.
Type of Change (Check all that apply)
Release notes