mirror of
https://github.com/DeBrosOfficial/network.git
synced 2025-10-06 08:19:07 +00:00
Refactor go.mod to remove indirect dependency on godotenv and update RQLite node configuration
This commit is contained in:
parent
bf32cc2a49
commit
cad45efb71
@ -36,9 +36,13 @@ func main() {
|
||||
fmt.Sprintf("/ip4/0.0.0.0/udp/%d/quic", *port),
|
||||
}
|
||||
|
||||
// Configure RQLite ports based on node port
|
||||
cfg.Database.RQLitePort = *port + 1000 // e.g., 5002 for node port 4002
|
||||
cfg.Database.RQLiteRaftPort = *port + 3000 // e.g., 7002 for node port 4002 (changed to avoid conflicts)
|
||||
// Configure RQLite ports based on node port (only if not already set in config)
|
||||
if cfg.Database.RQLitePort == 0 {
|
||||
cfg.Database.RQLitePort = *port + 1000 // e.g., 5002 for node port 4002
|
||||
}
|
||||
if cfg.Database.RQLiteRaftPort == 0 {
|
||||
cfg.Database.RQLiteRaftPort = *port + 3000 // e.g., 7002 for node port 4002 (changed to avoid conflicts)
|
||||
}
|
||||
|
||||
// Configure bootstrap peers
|
||||
if *bootstrap != "" {
|
||||
|
@ -14,6 +14,8 @@ database:
|
||||
shard_count: 16
|
||||
max_database_size: 1073741824 # 1GB
|
||||
backup_interval: "24h"
|
||||
rqlite_port: 5001
|
||||
rqlite_raft_port: 5002
|
||||
|
||||
discovery:
|
||||
bootstrap_peers: [] # Bootstrap nodes don't need peers
|
||||
|
@ -14,6 +14,8 @@ database:
|
||||
shard_count: 16
|
||||
max_database_size: 1073741824 # 1GB
|
||||
backup_interval: "24h"
|
||||
rqlite_port: 5001
|
||||
rqlite_raft_port: 5002
|
||||
|
||||
discovery:
|
||||
bootstrap_peers:
|
||||
|
2
go.mod
2
go.mod
@ -5,6 +5,7 @@ go 1.23.8
|
||||
toolchain go1.24.1
|
||||
|
||||
require (
|
||||
github.com/joho/godotenv v1.5.1
|
||||
github.com/libp2p/go-libp2p v0.41.1
|
||||
github.com/libp2p/go-libp2p-kad-dht v0.33.1
|
||||
github.com/libp2p/go-libp2p-pubsub v0.14.2
|
||||
@ -44,7 +45,6 @@ require (
|
||||
github.com/ipld/go-ipld-prime v0.21.0 // indirect
|
||||
github.com/jackpal/go-nat-pmp v1.0.2 // indirect
|
||||
github.com/jbenet/go-temp-err-catcher v0.1.0 // indirect
|
||||
github.com/joho/godotenv v1.5.1 // indirect
|
||||
github.com/klauspost/compress v1.18.0 // indirect
|
||||
github.com/klauspost/cpuid/v2 v2.2.10 // indirect
|
||||
github.com/koron/go-ssdp v0.0.5 // indirect
|
||||
|
@ -215,10 +215,9 @@ func (d *DatabaseClientImpl) getRQLiteNodes() []string {
|
||||
// Fallback to localhost for development
|
||||
return []string{
|
||||
"http://localhost:5001", // bootstrap
|
||||
"http://localhost:5002", // node1
|
||||
"http://localhost:5002", // node1
|
||||
"http://localhost:5003", // node2
|
||||
"http://localhost:5004", // node3 (if exists)
|
||||
"http://localhost:5005", // node4 (if exists)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -121,8 +121,8 @@ func DefaultConfig() *Config {
|
||||
BackupInterval: time.Hour * 24, // Daily backups
|
||||
|
||||
// RQLite-specific configuration
|
||||
RQLitePort: 4001,
|
||||
RQLiteRaftPort: 4002,
|
||||
RQLitePort: 5001,
|
||||
RQLiteRaftPort: 5002,
|
||||
RQLiteJoinAddress: "", // Empty for bootstrap node
|
||||
},
|
||||
Discovery: DiscoveryConfig{
|
||||
|
@ -17,7 +17,7 @@ REPO_URL="https://git.debros.io/DeBros/network.git"
|
||||
MIN_GO_VERSION="1.19"
|
||||
NODE_PORT="4001"
|
||||
RQLITE_NODE_PORT="5001"
|
||||
RAFT_NODE_PORT="7001"
|
||||
RAFT_NODE_PORT="5002"
|
||||
UPDATE_MODE=false
|
||||
NON_INTERACTIVE=false
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user