Skip to main content

Connect to a dWallet Network

You can use our test network to experiment with the current version of dWallet running on that network. Alternatively, you can spin up a local dWallet network for local dWallet network for local development.

Tools

You can use the following tools to interact with dWallet networks:

Environment setup

First, Install dWallet. To check if dWallet is already installed, run the following command:

which dwallet

If dWallet is installed, the command will return the path to the dWallet binary.

If it is not installed, it will return dwallet not found. In this case, see install dWallet.

Request Tokens from the Faucet

After installation, request DWLT test tokens by using cURL:

curl -X POST --location "https://faucet.alpha.testnet.dwallet.cloud/gas" \
-H "Content-Type: application/json" \
-d '{
"FixedAmountRequest": {
"recipient": "<YOUR-ACTIVE-ADDRESS>"
}
}'

Connect with Explorer

The Alpha Testnet explorer is available at https://explorer.alpha.testnet.dwallet.cloud/

Configure dWallet Client

To connect the dWallet client to a network, run the following command:

dwallet client

If the dwallet-client help output appears, you already have a client.yaml file. Refer to Connect to a custom RPC endpoint to add a new environment alias or to switch the currently active network.

If this is the first time you are running the dWallet client and a client.yaml file does not exist, the console will display the following message:

Config file ["<PATH-TO-FILE>/client.yaml"] doesn't exist, do you want to connect to a dWallet Full node server [y/N]?

Press y and then press Enter. The process then requests the RPC server URL:

dWallet Full node server URL (Defaults to dWallet Testnet) :

Press Enter to connect to dWallet Testnet. To connect to a custom RPC server, enter the appropriate RPC endpoint URL and press Enter.

If you enter a URL, the process prompts for an alias for the environment:

Environment alias for [<URL-ENTERED>] :

Type an alias name and press Enter.

Select key scheme to generate keypair (0 for ed25519, 1 for secp256k1, 2 for secp256r1):

Press 0, 1, or 2 to select a key scheme, and the press Enter.

dWallet will return a message similar to the following (depending on the key scheme selected), which includes the address, and a 12-word recovery phrase:

Generated new keypair for address with scheme "ed25519" [0xb9c83a8b40d3263c9ba40d551514fbac1f8c12e98a4005a0dac072d3549c2442]
Secret Recovery Phrase : [cap wheat many line human lazy few solid bored proud speed grocery]

Connect to a Custom RPC Endpoint

Check Available Environments

To view the currently available environment aliases, run the following command:

dwallet client envs

The output will display the available environment aliases, with (active) denoting the currently active network:

╭───────┬───────────────────────┬────────╮
│ alias │ url │ active │
├───────┼───────────────────────┼────────┤
│ local │ http://127.0.0.1:9000 │ * │
╰───────┴───────────────────────┴────────╯

Create a New Environment

To add a new alias for a custom RPC endpoint, run the following command. Replace the values in < > with your specific values:

dwallet client new-env --alias <ALIAS> --rpc <RPC-SERVER-URL>

For example, to add the testnet RPC, run:

dwallet client new-env --alias testnet --rpc https://fullnode.alpha.testnet.dwallet.cloud

After running dwallet client envs, the new environment will appear:

╭─────────┬──────────────────────────────────────────────────┬────────╮
│ alias │ url │ active │
├─────────┼──────────────────────────────────────────────────┼────────┤
│ local │ http://127.0.0.1:9000 │ * │
│ testnet │ https://fullnode.alpha.testnet.dwallet.cloud │ │
╰─────────┴──────────────────────────────────────────────────┴────────╯

Note that the active environment will still be local.

Switch Environments

To switch to another network, run the following command:

dwallet client switch --env <ALIAS>

For instance, to switch to the testnet environment created above, use:

dwallet client switch --env testnet

After switching, run dwallet client envs again to confirm that testnet is the active environment:

╭─────────┬──────────────────────────────────────────────────┬────────╮
│ alias │ url │ active │
├─────────┼──────────────────────────────────────────────────┼────────┤
│ local │ http://127.0.0.1:9000 │ │
│ testnet │ https://fullnode.alpha.testnet.dwallet.cloud │ * │
╰─────────┴──────────────────────────────────────────────────┴────────╯

If you encounter any issues, delete the dWallet configuration directory (~/.dwallet/dwallet_config) and reinstall the latest dWallet binaries.