From bd7f5bed0abc8884b3ba9ed41980b6a72e3ab40b Mon Sep 17 00:00:00 2001 From: thephez Date: Mon, 30 Sep 2024 14:37:18 -0400 Subject: [PATCH] docs: update tutorials to continue connecting to testnet Platform v1.4 SDK will connect to mainnet by default instead of testnet so the network option has been set to continue using testnet --- docs/tutorials/connecting-to-testnet.md | 3 ++- .../contracts-and-documents/retrieve-a-data-contract.md | 2 +- docs/tutorials/setup-sdk-client.md | 5 +++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/tutorials/connecting-to-testnet.md b/docs/tutorials/connecting-to-testnet.md index 6c4fac112..14065a24f 100644 --- a/docs/tutorials/connecting-to-testnet.md +++ b/docs/tutorials/connecting-to-testnet.md @@ -27,7 +27,8 @@ npm install dash ### 2. Connect to Dash Platform :::{tip} -The JavaScript Dash SDK connects to testnet by default. Mainnet can only be accessed by [connecting via address](#connect-via-address). +The JavaScript Dash SDK connects to mainnet by default. To connect to other networks, +set the `network` option when instantiating the client as shown in the following example. ::: Create a file named `dashConnect.js` with the following contents. Then run it by typing `node dashConnect.js` from the command line: diff --git a/docs/tutorials/contracts-and-documents/retrieve-a-data-contract.md b/docs/tutorials/contracts-and-documents/retrieve-a-data-contract.md index 2cbbbb8d3..4ca0f9918 100644 --- a/docs/tutorials/contracts-and-documents/retrieve-a-data-contract.md +++ b/docs/tutorials/contracts-and-documents/retrieve-a-data-contract.md @@ -43,7 +43,7 @@ const Dash = require('dash'); const { PlatformProtocol: { Identifier } } = Dash; const myContractId = 'a contract ID'; -const client = new Dash.Client(); +const client = new Dash.Client({ network: 'testnet' }); client.platform.contracts.get(myContractId) .then((myContract) => { diff --git a/docs/tutorials/setup-sdk-client.md b/docs/tutorials/setup-sdk-client.md index 045d7be55..189d7f21d 100644 --- a/docs/tutorials/setup-sdk-client.md +++ b/docs/tutorials/setup-sdk-client.md @@ -18,7 +18,8 @@ In this tutorial we will show how to configure the client for use in the remaini ## Code :::{tip} -The JavaScript Dash SDK connects to testnet by default. Mainnet can only be accessed by [connecting via address](./connecting-to-testnet.md#connect-to-a-network). +The JavaScript Dash SDK connects to mainnet by default. To connect to other networks, +set the `network` option when instantiating the client as shown in the following example. ::: Save the following client configuration module in a file named `setupDashClient.js`. This module @@ -30,7 +31,7 @@ will be re-used in later tutorials. // Fully configured client options const clientOptions = { - // The network to connect to ('testnet' or 'local') + // The network to connect to ('mainnet', 'testnet' or 'local') network: 'testnet', // Wallet configuration for transactions and account management