diff --git a/nexus-sdk/guides/setup.md b/nexus-sdk/guides/setup.md index c4100ae..d20ab5d 100644 --- a/nexus-sdk/guides/setup.md +++ b/nexus-sdk/guides/setup.md @@ -48,31 +48,35 @@ cargo install nexus-cli \ nexus --version ``` +## Download the Nexus objects + +```bash +wget https://storage.googleapis.com/production-talus-sui-objects/v0.2.0/objects.devnet.toml +``` + ## Configure the Talus devnet Configure your Nexus CLI to connect to the Talus `devnet` by running: ```bash -nexus conf --sui.net devnet \ - --sui.rpc-url https://rpc.ssfn.devnet.production.taluslabs.dev +nexus conf set --sui.net devnet \ + --sui.rpc-url https://rpc.ssfn.devnet.production.taluslabs.dev \ + --nexus.objects objects.devnet.toml ``` -### Upload some gas budget to Nexus +### Configure the Sui client -In order to pay for the network transaction fees and the tool invocations, you need to upload some gas budget to Nexus. You can do this by running the following command: +After installing the Sui binaries, configure and activate your Talus `devnet` environment: + +{% hint style="info" %} +Assuming you have no prior sui configuration ```bash -nexus gas add-budget --coin +sui client --yes ``` -{% hint style="info" %} -Note that this coin can only be used to pay for Nexus and tool invocation fees only if the DAG is executed from the **same address**. {% endhint %} -### Configure the Sui client - -After installing the Sui binaries, configure and activate your Talus `devnet` environment: - ```bash sui client new-env --alias devnet --rpc https://rpc.ssfn.devnet.production.taluslabs.dev sui client switch --env devnet @@ -84,13 +88,14 @@ Create a new wallet with the following command: ```bash sui client new-address ed25519 tally +sui client switch --address tally ``` {% hint style="danger" %} This command will output your wallet details, including your address and recovery phrase. Ensure you store this information securely. {% endhint %} -To request funds from the faucet, run: +To request funds from the faucet, run the following command twice to get 2 gas coins: ```bash # Pick any alias for your address, here we pick the Talus mascot name tally. @@ -98,19 +103,44 @@ sui client faucet --address tally \ --url https://faucet.devnet.production.taluslabs.dev/gas ``` +```bash +sui client faucet --address tally \ + --url https://faucet.devnet.production.taluslabs.dev/gas +``` + To check the balance, run: ```bash sui client balance tally ``` -## (Optional) Configure Encryption for Nexus workflows +### Upload some gas budget to Nexus + +In order to pay for the network transaction fees and the tool invocations, you need to upload some gas budget to Nexus. You can do this by running the following command: + +```bash +GAS_INFO=$(sui client gas --json) + +echo $GAS_INFO + +nexus gas add-budget \ + --coin $(echo $GAS_INFO | jq -r '.[0].gasCoinId') \ + --sui-gas-coin $(echo $GAS_INFO | jq -r '.[1].gasCoinId') +``` + +{% hint style="info" %} +Note that this coin can only be used to pay for Nexus and tool invocation fees only if the DAG is executed from the **same address**. +{% endhint %} + +## Configure Encryption for Nexus workflows To ensure end-to-end encryption of data flowing through workflows, Nexus employs a customized implementation of the [Signal Protocol](https://signal.org/docs/). To establish a secure communication channel, you must claim a pre-key from the on-chain Nexus module `pre_key_vault`, perform an X3DH (Extended Triple Diffie-Hellman) key exchange, and derive a session key used to send an initial encrypted message. The Nexus CLI abstracts away these cryptographic operations. You can initialize this process by simply running: ```bash +nexus crypto init-key --force +nexus crypto generate-identity-key nexus crypto auth ``` @@ -120,7 +150,7 @@ This command generates two programmable transactions: - The second, after performing the X3DH handshake, sends the initial message to finalize the secure channel setup. {% hint style="info" %} -Keep in mind that the `claim_pre_key` operation is subject to rate limiting. Additionally, it requires a small gas budget to be deposited into Nexus. You can do this using the `nexus gas add-budget` command. +Keep in mind that the `claim_pre_key` operation is subject to rate limiting. Additionally, it requires a small gas budget to be deposited into Nexus. See `nexus gas add-budget` command. {% endhint %} ## (Optional) Access Devnet Sui Explorer