Skip to content

Commit

Permalink
Update bridge sdk (#94)
Browse files Browse the repository at this point in the history
* update bridgeSDK version

* update bridgeSDK version

* fix

* add action to update snapshot

* fix

* update

* fix

* fix

* fix

* update bridgeSDK version

* update

* update snapshot

* update

* fix

* fix

---------

Co-authored-by: Bryan Chen <[email protected]>
  • Loading branch information
StrawberryFlavor and xlc authored Oct 3, 2023
1 parent a54903d commit d68edce
Show file tree
Hide file tree
Showing 14 changed files with 1,678 additions and 396 deletions.
4 changes: 4 additions & 0 deletions networks/all.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ import astarConfig from './astar'
import bifrostConfig from './bifrost'
import centrifugeConfig from './centrifuge'
import crustConfig from './crust'
import darwiniaConfig from './darwinia'
import hydraDXConfig from './hydraDX'
import interlayConfig from './interlay'
import moonbeamConfig from './moonbeam'
import parallelConfig from './parallel'
import phalaConfig from './phala'
import polkadotConfig from './polkadot'
import statemintConfig from './statemint'
import uniqueConfig from './unique'
Expand All @@ -28,6 +30,8 @@ const all = {
crust: crustConfig,
unique: uniqueConfig,
interlay: interlayConfig,
phala: phalaConfig,
darwinia: darwiniaConfig,
} satisfies Record<string, Config>

export default all
27 changes: 27 additions & 0 deletions networks/darwinia.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { Config } from './types'

export default {
polkadot: {
name: 'darwinia' as const,
endpoint: 'wss://darwinia-rpc.dwellir.com',
},
kusama: {
name: 'crab' as const,
endpoint: 'wss://crab.api.onfinality.io/public-ws',
},
config: ({ alice }) => ({
storages: {
System: {
Account: [[[alice.address], { providers: 1, data: { free: '1000000000000000000000' } }]],
},
},
}),
} satisfies Config

export const darwinia = {
paraId: 2046,
}

export const crab = {
paraId: 2105,
}
2 changes: 1 addition & 1 deletion networks/hydraDX.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default {
},
kusama: {
name: 'basilisk' as const,
endpoint: 'wss://rpc.basilisk.cloud',
endpoint: 'wss://basilisk-rpc.dwellir.com',
relayToken: 1,
dai: 13,
},
Expand Down
36 changes: 36 additions & 0 deletions networks/phala.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { Config } from './types'

export type Vars = {
aUSDToken: string
}

export default {
polkadot: {
name: 'phala' as const,
endpoint: 'wss://phala-rpc.dwellir.com',
aUSDToken: '3',
},
kusama: {
name: 'khala' as const,
endpoint: 'wss://khala-rpc.dwellir.com',
aUSDToken: '4',
},
config: ({ alice, aUSDToken }) => ({
storages: {
System: {
Account: [[[alice.address], { providers: 1, data: { free: '1000000000000000' } }]],
},
Assets: {
account: [[[aUSDToken, alice.address], { balance: 100 * 1e12 }]],
},
},
}),
} satisfies Config<Vars>

export const phala = {
paraId: 2035,
}

export const khala = {
paraId: 2004,
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@acala-network/sdk": "^4.1.9-2",
"@acala-network/sdk-core": "^4.1.9-2",
"@polkadot/api": "^10.9.1",
"@polkawallet/bridge": "^0.1.5-9",
"@polkawallet/bridge": "^0.1.5-16",
"dotenv": "^16.3.1",
"typescript": "^5.2.2",
"vitest": "^0.34.4"
Expand Down
28 changes: 28 additions & 0 deletions scripts/configs/crab.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
extensions:
client:
endpoints:
- wss://crab.api.onfinality.io/public-ws:443
event_bus:
substrate_api:
stale_timeout_seconds: 60
cache:
default_ttl_seconds: 0
default_size: 2000
merge_subscription:
keep_alive_seconds: 60
server:
port: 9944
listen_address: '0.0.0.0'
max_connections: 2000

middlewares:
methods:
- response
- cache
- inject_params
- upstream
subscriptions:
- merge_subscription
- upstream

rpcs: substrate
28 changes: 28 additions & 0 deletions scripts/configs/khala.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
extensions:
client:
endpoints:
- wss://khala-rpc.dwellir.com:443
event_bus:
substrate_api:
stale_timeout_seconds: 60
cache:
default_ttl_seconds: 0
default_size: 2000
merge_subscription:
keep_alive_seconds: 60
server:
port: 9944
listen_address: '0.0.0.0'
max_connections: 2000

middlewares:
methods:
- response
- cache
- inject_params
- upstream
subscriptions:
- merge_subscription
- upstream

rpcs: substrate
28 changes: 28 additions & 0 deletions scripts/configs/phala.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
extensions:
client:
endpoints:
- wss://phala-rpc.dwellir.com:443
event_bus:
substrate_api:
stale_timeout_seconds: 60
cache:
default_ttl_seconds: 0
default_size: 2000
merge_subscription:
keep_alive_seconds: 60
server:
port: 9944
listen_address: '0.0.0.0'
max_connections: 2000

middlewares:
methods:
- response
- cache
- inject_params
- upstream
subscriptions:
- merge_subscription
- upstream

rpcs: substrate
3 changes: 3 additions & 0 deletions scripts/run-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ PORT=9019 subway --config configs/quartz.yml &
PORT=9020 subway --config configs/unique.yml &
PORT=9021 subway --config configs/interlay.yml &
PORT=9022 subway --config configs/kintsugi.yml &
PORT=9023 subway --config configs/khala.yml &
PORT=9024 subway --config configs/phala.yml &
PORT=9025 subway --config configs/crab.yml &
trap 'kill $(jobs -p)' EXIT

wait
Loading

0 comments on commit d68edce

Please sign in to comment.