Skip to content

Commit 77c1808

Browse files
committed
rename to NODE_ENDPOINT, NODE is reserved
1 parent 166084c commit 77c1808

3 files changed

Lines changed: 12 additions & 11 deletions

File tree

.github/workflows/ci.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@ jobs:
100100
matrix:
101101
include:
102102
- transport: http
103-
node: "http://127.0.0.1:8001"
103+
node_endpoint: "http://127.0.0.1:8001"
104104
- transport: p2p
105-
node: "16Uiu2HAmRkJeRYRghP3ETQCpdz8NsQzQE9RpSST7i5YNgWqH4dVE"
105+
node_endpoint: "16Uiu2HAmRkJeRYRghP3ETQCpdz8NsQzQE9RpSST7i5YNgWqH4dVE"
106106

107107
steps:
108108
- uses: actions/checkout@v3
@@ -191,7 +191,7 @@ jobs:
191191
env:
192192
INDEXING_RETRY_INTERVAL: 4000
193193
INDEXING_MAX_RETRIES: 120
194-
NODE: ${{ matrix.node }}
194+
NODE_ENDPOINT: ${{ matrix.node_endpoint }}
195195

196196
- name: docker logs
197197
run: |
@@ -216,21 +216,21 @@ jobs:
216216
fail-fast: false
217217
matrix:
218218
os: [ubuntu-latest, macos-latest, windows-latest]
219-
node: ["22", "20"]
219+
node_endpoint: ["22", "20"]
220220

221221
steps:
222222
- uses: actions/checkout@v3
223223
- uses: actions/setup-node@v4
224224
with:
225-
node-version: ${{ matrix.node }}
225+
node-version: ${{ matrix.node_endpoint }}
226226
- name: Cache node_modules
227227
uses: actions/cache@v4
228228
env:
229229
cache-name: cache-node-modules
230230
with:
231231
path: ~/.npm
232-
key: ${{ runner.os }}-${{ matrix.node }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
233-
restore-keys: ${{ runner.os }}-${{ matrix.node }}-build-${{ env.cache-name }}-
232+
key: ${{ runner.os }}-${{ matrix.node_endpoint }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
233+
restore-keys: ${{ runner.os }}-${{ matrix.node_endpoint }}-build-${{ env.cache-name }}-
234234
- run: npm ci
235235
- run: npm run build
236236
- run: npm run doc:json

src/config/ConfigHelper.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,10 @@ export const KNOWN_CONFIDENTIAL_EVMS = [
182182
23295 // oasis_sapphire_testnet
183183
]
184184

185-
// keep backward compatible NODE_URL for now
186185
export const getNodeEndpointConfig = (): Partial<Config> => {
187-
if (process.env.NODE || process.env.NODE_URL) {
186+
if (process.env.NODE_ENDPOINT || process.env.NODE_URL) {
188187
return {
189-
oceanNodeUri: process.env.NODE || process.env.NODE_URL
188+
oceanNodeUri: process.env.NODE_ENDPOINT || process.env.NODE_URL
190189
}
191190
}
192191

src/services/providers/BaseProvider.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,11 @@ export function getAuthorization(signerOrAuthToken: Signer | string): string | u
5252
return typeof signerOrAuthToken === 'string' ? signerOrAuthToken : undefined
5353
}
5454

55+
const MULTIADDR_PREFIXES = ['/ip4/', '/ip6/', '/dns4/', '/dns6/', '/dns/', '/dnsaddr/']
56+
5557
export function isP2pUri(nodeUri: string): boolean {
5658
if (!nodeUri) return false
57-
if (nodeUri.startsWith('/')) return true
59+
if (MULTIADDR_PREFIXES.some((p) => nodeUri.startsWith(p))) return true
5860
try {
5961
peerIdFromString(nodeUri)
6062
return true

0 commit comments

Comments
 (0)