Skip to content

Commit

Permalink
Update local-network.mdx (#20811)
Browse files Browse the repository at this point in the history
## Description 

Describe the changes or additions included in this PR.

## Test plan 

How did you test the new or updated feature?

---

## Release notes

Check each box that your changes affect. If none of the boxes relate to
your changes, release notes aren't required.

For each box you select, include information after the relevant heading
that describes the impact of your changes that a user might notice and
any actions they must take to implement updates.

- [ ] Protocol: 
- [ ] Nodes (Validators and Full nodes): 
- [ ] gRPC:
- [ ] JSON-RPC: 
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:

---------

Co-authored-by: Ronny Roland <[email protected]>
  • Loading branch information
techdebt-99 and ronny-mysten authored Jan 8, 2025
1 parent c378799 commit 9e1869a
Show file tree
Hide file tree
Showing 62 changed files with 5,553 additions and 6,310 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,11 @@ const address = keypair.getPublicKey().toSuiAddress();
</TabItem>
<TabItem value="cli" label="CLI">

```shell
sui keytool import "TEST_MNEMONIC" ed25519 "m/44'/784'/0'/0'/0'"
sui client new-address ed25519 "m/44'/784'/0'/0'/0'"
```sh
$ sui keytool import "TEST_MNEMONIC" ed25519 "m/44'/784'/0'/0'/0'"
```
```sh
$ sui client new-address ed25519 "m/44'/784'/0'/0'/0'"
```

</TabItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ The following example demonstrates how to serialize data for a transfer using th

{@include: ../../../snippets/info-gas-budget.mdx}

```shell
sui client transfer-sui --to <SUI-ADDRESS> --sui-coin-object-id <COIN-OBJECT-ID> --gas-budget <GAS-AMOUNT> --serialize-unsigned-transaction
```sh
$ sui client transfer-sui --to <SUI-ADDRESS> --sui-coin-object-id <COIN-OBJECT-ID> --gas-budget <GAS-AMOUNT> --serialize-unsigned-transaction
```

The console responds with the resulting `<TX_BYTES>` value.
Expand All @@ -38,7 +38,7 @@ This example uses the `sui keytool` command to sign, using the Ed25519 key corre

You receive the following response:

```shell
```sh
Signer address: <SUI-ADDRESS>
Raw tx_bytes to execute: <TX_BYTES>
Intent: Intent { scope: TransactionData, version: V0, app_id: Sui }
Expand All @@ -55,13 +55,13 @@ To verify a signature against the cryptography library backing Sui when debuggin
After you obtain the serialized signature, you can submit it using the execution transaction command. This command takes `--tx-bytes` as the raw transaction bytes to execute (see output of the previous `sui client transfer` command) and the serialized signature (Base64 encoded `flag || sig || pk`, see output of `sui keytool sign`). This executes the signed transaction and returns the certificate and transaction effects if successful.
```shell
sui client execute-signed-tx --tx-bytes <TX_BYTES> --signatures <SERIALIZED-SIGNATURE>
```sh
$ sui client execute-signed-tx --tx-bytes <TX_BYTES> --signatures <SERIALIZED-SIGNATURE>
```
You get the following response:
```shell
```sh
----- Certificate ----
Transaction Hash: <TRANSACTION-ID>
Transaction Signature: <SIGNATURE>
Expand All @@ -80,14 +80,14 @@ Mutated Objects:
Alternatively, you can use the active key in Sui Keystore to sign and output a Base64-encoded sender signed data with flag `--serialize-signed-transaction`.
```shell
sui client transfer-sui --to <SUI-ADDRESS> --sui-coin-object-id <COIN-OBJECT-ID> --gas-budget <GAS-AMOUNT> --serialize-signed-transaction
```sh
$ sui client transfer-sui --to <SUI-ADDRESS> --sui-coin-object-id <COIN-OBJECT-ID> --gas-budget <GAS-AMOUNT> --serialize-signed-transaction
```
The console responds with the resulting `<SIGNED-TX-BYTES>` value.
After you obtain the signed transaction bytes, you can submit it using the `execute-combined-signed-tx` command. This command takes `--signed-tx-bytes` as the signed transaction bytes to execute (see output of the previous `sui client transfer-sui` command). This executes the signed transaction and returns the certificate and transaction effects if successful.
```shell
sui client execute-combined-signed-tx --signed-tx-bytes <SIGNED-TX-BYTES>
```sh
$ sui client execute-combined-signed-tx --signed-tx-bytes <SIGNED-TX-BYTES>
```
2 changes: 1 addition & 1 deletion docs/content/concepts/cryptography/zklogin.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ The following options support a zkLogin signature over either transaction data o
1. Use the [Sui Keytool CLI](../../references/cli/keytool.mdx). This is recommended for debug usage.

```sh
$SUI_BINARY keytool zk-login-sig-verify --sig $ZKLOGIN_SIG --bytes $BYTES --intent-scope 3 --network devnet --curr-epoch 3
$ sui keytool zk-login-sig-verify --sig $ZKLOGIN_SIG --bytes $BYTES --intent-scope 3 --network devnet --curr-epoch 3
```

1. Use a self-hosted server endpoint and call this endpoint, as described in [zklogin-verifier](https://github.com/MystenLabs/zklogin-verifier). This provides logic flexibility.
Expand Down
16 changes: 8 additions & 8 deletions docs/content/concepts/graphql-rpc.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ The service accepts the following optional headers:

By default, each request returns the service's version in the response header: `x-sui-rpc-version`.

```bash
curl -i -X POST https://sui-mainnet.mystenlabs.com/graphql \
```sh
$ curl -i -X POST https://sui-mainnet.mystenlabs.com/graphql \
--header 'x-sui-rpc-show-usage: true' \
--header 'Content-Type: application/json' \
--data '{
Expand All @@ -35,7 +35,7 @@ curl -i -X POST https://sui-mainnet.mystenlabs.com/graphql \

The response for the previous request looks similar to the following:

```bash
```sh
HTTP/2 200
content-type: application/json
content-length: 159
Expand Down Expand Up @@ -96,13 +96,13 @@ When using the online IDE, supply variables as a JSON object to the query in the

When making a request to the GraphQL service (for example, using `curl`), pass the query and variables as two fields of a single JSON object:

```bash
curl -X POST https://sui-testnet.mystenlabs.com/graphql \
```sh
$ curl -X POST https://sui-testnet.mystenlabs.com/graphql \
--header 'Content-Type: application/json' \
--data '{
"query": "query ($epochID: Int) { epoch(id: $epochID) { referenceGasPrice } }",
"variables": { "epochID": 100 }
}'
"query": "query ($epochID: Int) { epoch(id: $epochID) { referenceGasPrice } }",
"variables": { "epochID": 100 }
}'
```

## Fragments
Expand Down
39 changes: 20 additions & 19 deletions docs/content/concepts/object-ownership/immutable.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -117,60 +117,61 @@ As you have learned, the function fails when the `ColorObject` is immutable.

First, view the objects you own:

```shell
export ADDR=`sui client active-address`

sui client objects $ADDR
```sh
$ export ADDR=`sui client active-address`
```
```sh
$ sui client objects $ADDR
```

Publish the `ColorObject` code on-chain using the Sui Client CLI:

{@include: ../../snippets/info-gas-budget.mdx}

```shell
sui client publish $ROOT/examples/move/color_object --gas-budget <GAS-AMOUNT>
```sh
$ sui client publish $ROOT/examples/move/color_object --gas-budget <GAS-AMOUNT>
```

Set the package object ID to the `$PACKAGE` environment variable, if you have it set. Then create a new `ColorObject`:

```shell
sui client call --gas-budget <GAS-AMOUNT> --package $PACKAGE --module "color_object" --function "create" --args 0 255 0
```sh
$ sui client call --gas-budget <GAS-AMOUNT> --package $PACKAGE --module "color_object" --function "create" --args 0 255 0
```

Set the newly created object ID to `$OBJECT`. To view the objects in the current active address:

```shell
sui client objects $ADDR
```sh
$ sui client objects $ADDR
```

You should see an object with the ID you used for `$OBJECT`. To turn it into an immutable object:

```shell
sui client call --gas-budget <GAS-AMOUNT> --package $PACKAGE --module "color_object" --function "freeze_object" --args \"$OBJECT\"
```sh
$ sui client call --gas-budget <GAS-AMOUNT> --package $PACKAGE --module "color_object" --function "freeze_object" --args \"$OBJECT\"
```

View the list of objects again:

```shell
sui client objects $ADDR
```sh
$ sui client objects $ADDR
```

`$OBJECT` is no longer listed. It's no longer owned by anyone. You can see that it's now immutable by querying the object information:

```shell
sui client object $OBJECT
```sh
$ sui client object $OBJECT
```

The response includes:

```shell
```sh
Owner: Immutable
```

If you try to mutate it:

```shell
sui client call --gas-budget <GAS-AMOUNT> --package $PACKAGE --module "color_object" --function "update" --args \"$OBJECT\" 0 0 0
```sh
$ sui client call --gas-budget <GAS-AMOUNT> --package $PACKAGE --module "color_object" --function "update" --args \"$OBJECT\" 0 0 0
```

The response indicates that you can't pass an immutable object to a mutable argument.
Loading

0 comments on commit 9e1869a

Please sign in to comment.