Skip to content

Commit d72302c

Browse files
committed
Add tstn
1 parent 9baf150 commit d72302c

File tree

4 files changed

+14
-10
lines changed

4 files changed

+14
-10
lines changed

Makefile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
BINARY_NAME=teranode-p2p-poc
33
FRONTEND_DIR=frontend-react
44
BUILD_DIR=build
5+
REACT_PORT?=30001
56

67
# Default target
78
.PHONY: all
@@ -22,6 +23,9 @@ help:
2223
@echo " docker-build - Build Docker image"
2324
@echo " docker-run - Run Docker container"
2425
@echo " help - Show this help message"
26+
@echo ""
27+
@echo "Environment variables:"
28+
@echo " REACT_PORT - Port for React dev server (default: 30001)"
2529

2630
# Install React dependencies
2731
.PHONY: install-frontend
@@ -59,13 +63,13 @@ run: build
5963
.PHONY: dev
6064
dev: install-frontend
6165
@echo "Starting development servers..."
62-
@echo "Go server will run on :8080, React dev server on :3000"
63-
@echo "Open http://localhost:3000 for development or http://localhost:8080 for production build"
66+
@echo "Go server will run on :8080, React dev server on :$(REACT_PORT)"
67+
@echo "Open http://localhost:$(REACT_PORT) for development or http://localhost:8080 for production build"
6468
@if [ ! -f config.yaml ]; then \
6569
echo "Warning: config.yaml not found. Make sure to create it before running."; \
6670
fi
6771
@trap 'kill %1 %2' EXIT; \
68-
(cd $(FRONTEND_DIR) && npm start) & \
72+
(cd $(FRONTEND_DIR) && PORT=$(REACT_PORT) npm start) & \
6973
go run cmd/main.go & \
7074
wait
7175

frontend-react/src/components/Dashboard.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ export const Dashboard: React.FC = () => {
8989
ApiService.getMessageTypes(),
9090
ApiService.getMessageStats()
9191
]);
92-
setNetworks(networksData);
92+
// Only show mainnet, testnet, and teratestnet
93+
const selectedNetworks: Network[] = ['mainnet', 'testnet', 'teratestnet'];
94+
setNetworks(selectedNetworks);
9395
setMessageTypes(messageTypesData);
9496
setStats({
9597
totalMessages: statsData.totalMessages || 0,

frontend-react/src/services/api.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,8 @@ export class ApiService {
7777
return await response.json();
7878
} catch (error) {
7979
console.error('Error fetching networks:', error);
80-
// Temporarily only showing mainnet and testnet for mobile UI
81-
return ['mainnet', 'testnet'];
82-
// Full list: ['mainnet', 'testnet', 'regtest', 'stn', 'teratestnet', 'tstn'];
80+
// Return selected networks as fallback
81+
return ['mainnet', 'testnet', 'teratestnet'];
8382
}
8483
}
8584

pkg/parser/message_parser.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,8 @@ func ParseMessage(topic string, data []byte) (*ParsedMessage, error) {
107107

108108
// GetNetworks returns all supported networks
109109
func GetNetworks() []string {
110-
// Temporarily only showing mainnet and testnet for mobile UI
111-
return []string{"mainnet", "testnet"}
112-
// Full list: {"mainnet", "testnet", "regtest", "stn", "teratestnet", "tstn"}
110+
// Return only the networks we want to show in the UI
111+
return []string{"mainnet", "testnet", "teratestnet"}
113112
}
114113

115114
// GetMessageTypes returns all supported message types

0 commit comments

Comments
 (0)