Skip to content
This repository was archived by the owner on Jan 9, 2026. It is now read-only.

Commit 3937411

Browse files
authored
Merge pull request #11 from kadena-io/chore/use-testnet-backend
use testnet backend in dev mode
2 parents 0549c82 + 9bd2810 commit 3937411

File tree

2 files changed

+29
-8
lines changed

2 files changed

+29
-8
lines changed

.env

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ BLOCKSCOUT_DB_NAME=blockscout_${CHAIN_ID}
77
STATS_DB_NAME=stats_${CHAIN_ID}
88
EXPLORER_MAIN_URL=chain-${CHAINWEB_CHAIN_ID}.evm.kadena.internal
99
CHAIN_PUBLIC_URL=chain-${CHAINWEB_CHAIN_ID}.evm.kadena.internal
10-
BLOCKSCOUT_BACKEND_URL=http://chain-${CHAINWEB_CHAIN_ID}.evm.kadena.internal
10+
BLOCKSCOUT_BACKEND_URL=http://${EXPLORER_MAIN_URL}
1111
PROXY_UI_PORT=8008
12-
PROXY_STATS_PORT=8080
13-
PROXY_VISUALIZER_PORT=8081
1412
NEXT_PUBLIC_APP_PORT=${PROXY_UI_PORT}
15-
NEXT_PUBLIC_API_PORT=8000
16-
NEXT_PUBLIC_STATS_API_HOST=${BLOCKSCOUT_BACKEND_URL}:${PROXY_STATS_PORT}
17-
NEXT_PUBLIC_VISUALIZE_API_HOST=http://${EXPLORER_MAIN_URL}:${PROXY_VISUALIZER_PORT}
18-
NEXT_PUBLIC_API_HOST=${CHAIN_PUBLIC_URL}
13+
NEXT_PUBLIC_API_PORT=${PROXY_UI_PORT}
14+
BACKEND_HOST=${EXPLORER_MAIN_URL}:${NEXT_PUBLIC_API_PORT}
15+
NEXT_PUBLIC_STATS_API_HOST=http://${BACKEND_HOST}
16+
NEXT_PUBLIC_STATS_API_BASE_PATH=/stats
17+
NEXT_PUBLIC_VISUALIZE_API_HOST=http://${BACKEND_HOST}
18+
NEXT_PUBLIC_VISUALIZE_API_BASE_PATH=/visualizer
19+
NEXT_PUBLIC_API_HOST=${EXPLORER_MAIN_URL}
1920
NEXT_PUBLIC_APP_HOST=chain-${CHAINWEB_CHAIN_ID}.evm.kadena.internal
20-
BLOCKSCOUT_DB_URL=postgresql://blockscout:ceWb1MeLBEeOIfk65gU8EjF8@db:5432/${BLOCKSCOUT_DB_NAME}
2121
JSONRPC_HTTP=http://chain-${CHAINWEB_CHAIN_ID}.evm.kadena.internal:1848/chainweb/0.0/evm-development/${CHAINWEB_CHAIN_ID}/evm/rpc/
2222
JSONRPC_WS_URL=ws://chain-${CHAINWEB_CHAIN_ID}.evm.kadena.internal:1848/chainweb/0.0/evm-development/${CHAINWEB_CHAIN_ID}/evm/rpc/
2323
ETHEREUM_JSONRPC_HTTP_URL=${JSONRPC_HTTP}

nextjs/rewrites.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,28 @@
1+
const proxyToTestnet = (cid) => [
2+
{
3+
source: '/socket/:path*',
4+
destination: `https://chain-${ cid }.evm-testnet-blockscout.chainweb.com/socket/:path*`,
5+
},
6+
{
7+
source: '/stats/:path*',
8+
destination: `https://chain-${ cid }.evm-testnet-blockscout.chainweb.com/stats/:path*`,
9+
},
10+
{
11+
source: '/visualizer/:path*',
12+
destination: `https://chain-${ cid }.evm-testnet-blockscout.chainweb.com/visualizer/:path*`,
13+
},
14+
{
15+
source: '/api/:path*',
16+
destination: `https://chain-${ cid }.evm-testnet-blockscout.chainweb.com/api/:path*`,
17+
},
18+
];
19+
120
async function rewrites() {
221
return [
322
{ source: '/node-api/proxy/:slug*', destination: '/api/proxy' },
423
{ source: '/node-api/:slug*', destination: '/api/:slug*' },
24+
...(process.env.NODE_ENV === 'development' ? proxyToTestnet(process.env.CHAINWEB_CHAIN_ID) : []),
25+
526
].filter(Boolean);
627
}
728

0 commit comments

Comments
 (0)