Skip to content

Commit

Permalink
Merge pull request #261 from docknetwork/feat/fallback-node-address
Browse files Browse the repository at this point in the history
feat: update fallback node address
  • Loading branch information
Jayteekay authored May 8, 2024
2 parents b7b3358 + 0e66fce commit bbe60bc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
1 change: 1 addition & 0 deletions packages/data-store/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"typeorm": "^0.3.15"
},
"dependencies": {
"@docknetwork/wallet-sdk-wasm": "^0.4.19",
"uuid": "^8.3.2"
},
"devDependencies": {
Expand Down
11 changes: 3 additions & 8 deletions packages/data-store/src/configs.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {SUBSTRATE_NETWORKS} from '@docknetwork/wallet-sdk-wasm/src/modules/network-manager';
import {DataStoreConfigs} from './types';
import {genericDocumentNetworkResolver} from './document-network-resolver';

Expand All @@ -10,19 +11,13 @@ export const DEFAULT_CONFIGS: DataStoreConfigs = {
name: 'Mainnet',
id: 'mainnet',
credentialHostnames: ['creds.dock.io'],
configs: {
substrateUrl: 'wss://mainnet-node.dock.io',
addressPrefix: 22,
},
configs: SUBSTRATE_NETWORKS.mainnet,
},
{
name: 'Testnet',
id: 'testnet',
credentialHostnames: [/creds-.*\.dock\.io/],
configs: {
substrateUrl: 'wss://knox-1.dock.io',
addressPrefix: 21,
},
configs: SUBSTRATE_NETWORKS.testnet,
},
],
};
6 changes: 3 additions & 3 deletions packages/wasm/src/modules/network-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ import assert from 'assert';

export type NetworkInfo = {
name: string,
substrateUrl: string,
substrateUrl: string | string[],
addressPrefix: number,
};

export type NetworkId = 'mainnet' | 'testnet' | 'local' | 'custom';

export const SUBSTRATE_NETWORKS = {
export const SUBSTRATE_NETWORKS : Record<NetworkId, NetworkInfo> = {
mainnet: {
name: 'Dock PoS Mainnet',
substrateUrl: 'wss://mainnet-node.dock.io',
substrateUrl: ['wss://mainnet-node.dock.io', 'wss://mainnet-node-2.dock.io'],
addressPrefix: 22,
},
testnet: {
Expand Down

0 comments on commit bbe60bc

Please sign in to comment.