Skip to content

Commit

Permalink
docs: update tutorials to continue connecting to testnet
Browse files Browse the repository at this point in the history
Platform v1.4 SDK will connect to mainnet by default instead of testnet so the network option has been set to continue using testnet
  • Loading branch information
thephez committed Sep 30, 2024
1 parent 02b838f commit bd7f5be
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion docs/tutorials/connecting-to-testnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
5 changes: 3 additions & 2 deletions docs/tutorials/setup-sdk-client.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit bd7f5be

Please sign in to comment.