dashpay / platform

L2 solution for seriously fast decentralized applications for the Dash network
https://dashplatform.readme.io/docs/introduction-what-is-dash-platform
MIT License
67 stars 39 forks source link

DAPIClientError: There is no connection config for network 'mainnet' #2022

Open jojobyte opened 1 month ago

jojobyte commented 1 month ago

Attempting to create a new client on mainnet throws an error.

Expected Behavior

it should start a client connected to mainnet

Current Behavior

new Dash.Client({ network: 'mainnet' }) throws DAPIClientError: There is no connection config for network 'mainnet'

Possible Solution

It appears https://github.com/dashpay/platform/blob/v1.0-dev/packages/js-dapi-client/lib/networkConfigs.js is missing any options for mainnet, adding some presumably would fix this, as the error comes from https://github.com/dashpay/platform/blob/v1.0-dev/packages/js-dapi-client/lib/dapiAddressProvider/createDAPIAddressProviderFromOptions.js#L101-L103

Steps to Reproduce

  1. npm install dash
  2. Add <script src="./node_modules/dash/dist/dash.min.js"></script> to html
  3. try to create a new client with new Dash.Client({ network: 'mainnet' })
  4. See DAPIClientError: There is no connection config for network 'mainnet' error in console

Context

Unable connect to mainnet.

Your Environment

Version used:

  "dependencies": {
    "dash": "^4.0.1"
  }
shumkov commented 1 day ago

It will be fixed in Platform 1.4