Skip to content

Commit

Permalink
Added bootnode commands
Browse files Browse the repository at this point in the history
  • Loading branch information
alanorwick committed Nov 19, 2021
1 parent 59bc2d4 commit 7d5f896
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 8 deletions.
42 changes: 39 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -202,18 +202,32 @@ endif
@nohup ./build/bin/quai --ws --syncmode full --allow-insecure-unlock --http.addr 0.0.0.0 --ws.addr 0.0.0.0 --ws.api eth,net,web3 --ws.origins "*" --port 30314 --nodekey bootnode.key --http.port $(ZONE_3_2_PORT_HTTP) --ws.port $(ZONE_3_2_PORT_WS) --region 3 --zone 2 > nodelogs/zone-3-2.log 2>&1 &
@nohup ./build/bin/quai --ws --syncmode full --allow-insecure-unlock --http.addr 0.0.0.0 --ws.addr 0.0.0.0 --ws.api eth,net,web3 --ws.origins "*" --port 30315 --nodekey bootnode.key --http.port $(ZONE_3_3_PORT_HTTP) --ws.port $(ZONE_3_3_PORT_WS) --region 3 --zone 3 > nodelogs/zone-3-3.log 2>&1 &

PRIME_COINBASE=0x990eAa88FD08902a4f396beA0285385887Bed5a6
REGION_1_COINBASE=0x1a6ad97c8f06c7ae79fea47e43a8c048da5b1f7d
REGION_2_COINBASE=
REGION_3_COINBASE=
ZONE_1_1_COINBASE=0x1a6ad97c8f06c7ae79fea47e43a8c048da5b1f7d
ZONE_1_2_COINBASE=
ZONE_1_3_COINBASE=
ZONE_2_1_COINBASE=
ZONE_2_2_COINBASE=
ZONE_2_3_COINBASE=
ZONE_3_1_COINBASE=
ZONE_3_2_COINBASE=
ZONE_3_3_COINBASE=

run-full-mining:
ifeq (,$(wildcard ./bootnode.key))
./build/bin/bootnode --genkey=bootnode.key
endif
ifeq (,$(wildcard nodelogs))
mkdir nodelogs
endif
@nohup ./build/bin/quai --ws --mine --miner.threads=4 --miner.etherbase 0x990eAa88FD08902a4f396beA0285385887Bed5a6 --syncmode full --allow-insecure-unlock --http.addr 0.0.0.0 --ws.addr 0.0.0.0 --ws.api eth,net,web3 --ws.origins "*" --port 30303 --nodekey bootnode.key --http.port $(PRIME_PORT_HTTP) --ws.port $(PRIME_PORT_WS) > nodelogs/prime.log 2>&1 &
@nohup ./build/bin/quai --ws --mine --miner.threads=4 --miner.etherbase 0x1a6ad97c8f06c7ae79fea47e43a8c048da5b1f7d --syncmode full --allow-insecure-unlock --http.addr 0.0.0.0 --ws.addr 0.0.0.0 --ws.api eth,net,web3 --ws.origins "*" --port 30304 --nodekey bootnode.key --http.port $(REGION_1_PORT_HTTP) --ws.port $(REGION_1_PORT_WS) --region 1 > nodelogs/region-1.log 2>&1 &
@nohup ./build/bin/quai --ws --mine --miner.threads=4 --miner.etherbase $(PRIME_COINBASE) --syncmode full --allow-insecure-unlock --http.addr 0.0.0.0 --ws.addr 0.0.0.0 --ws.api eth,net,web3 --ws.origins "*" --port 30303 --nodekey bootnode.key --http.port $(PRIME_PORT_HTTP) --ws.port $(PRIME_PORT_WS) > nodelogs/prime.log 2>&1 &
@nohup ./build/bin/quai --ws --mine --miner.threads=4 --miner.etherbase $(REGION_1_COINBASE) --syncmode full --allow-insecure-unlock --http.addr 0.0.0.0 --ws.addr 0.0.0.0 --ws.api eth,net,web3 --ws.origins "*" --port 30304 --nodekey bootnode.key --http.port $(REGION_1_PORT_HTTP) --ws.port $(REGION_1_PORT_WS) --region 1 > nodelogs/region-1.log 2>&1 &
@nohup ./build/bin/quai --ws --syncmode full --allow-insecure-unlock --http.addr 0.0.0.0 --ws.addr 0.0.0.0 --ws.api eth,net,web3 --ws.origins "*" --port 30305 --nodekey bootnode.key --http.port $(REGION_2_PORT_HTTP) --ws.port $(REGION_2_PORT_WS) --region 2 > nodelogs/region-2.log 2>&1 &
@nohup ./build/bin/quai --ws --syncmode full --allow-insecure-unlock --http.addr 0.0.0.0 --ws.addr 0.0.0.0 --ws.api eth,net,web3 --ws.origins "*" --port 30306 --nodekey bootnode.key --http.port $(REGION_3_PORT_HTTP) --ws.port $(REGION_3_PORT_WS) --region 3 > nodelogs/region-3.log 2>&1 &
@nohup ./build/bin/quai --ws --mine --miner.threads=4 --miner.etherbase 0x1a6ad97c8f06c7ae79fea47e43a8c048da5b1f7d --syncmode full --allow-insecure-unlock --http.addr 0.0.0.0 --ws.addr 0.0.0.0 --ws.api eth,net,web3 --ws.origins "*" --port 30307 --nodekey bootnode.key --http.port $(ZONE_1_1_PORT_HTTP) --ws.port $(ZONE_1_1_PORT_WS) --region 1 --zone 1 > nodelogs/zone-1-1.log 2>&1 &
@nohup ./build/bin/quai --ws --mine --miner.threads=4 --miner.etherbase $(ZONE_1_1_COINBASE) --syncmode full --allow-insecure-unlock --http.addr 0.0.0.0 --ws.addr 0.0.0.0 --ws.api eth,net,web3 --ws.origins "*" --port 30307 --nodekey bootnode.key --http.port $(ZONE_1_1_PORT_HTTP) --ws.port $(ZONE_1_1_PORT_WS) --region 1 --zone 1 > nodelogs/zone-1-1.log 2>&1 &
@nohup ./build/bin/quai --ws --syncmode full --allow-insecure-unlock --http.addr 0.0.0.0 --ws.addr 0.0.0.0 --ws.api eth,net,web3 --ws.origins "*" --port 30308 --nodekey bootnode.key --http.port $(ZONE_1_2_PORT_HTTP) --ws.port $(ZONE_1_2_PORT_WS) --region 1 --zone 2 > nodelogs/zone-1-2.log 2>&1 &
@nohup ./build/bin/quai --ws --syncmode full --allow-insecure-unlock --http.addr 0.0.0.0 --ws.addr 0.0.0.0 --ws.api eth,net,web3 --ws.origins "*" --port 30309 --nodekey bootnode.key --http.port $(ZONE_1_3_PORT_HTTP) --ws.port $(ZONE_1_3_PORT_WS) --region 1 --zone 3 > nodelogs/zone-1-3.log 2>&1 &
@nohup ./build/bin/quai --ws --syncmode full --allow-insecure-unlock --http.addr 0.0.0.0 --ws.addr 0.0.0.0 --ws.api eth,net,web3 --ws.origins "*" --port 30310 --nodekey bootnode.key --http.port $(ZONE_2_1_PORT_HTTP) --ws.port $(ZONE_2_1_PORT_WS) --region 2 --zone 1 > nodelogs/zone-2-1.log 2>&1 &
Expand All @@ -223,5 +237,27 @@ endif
@nohup ./build/bin/quai --ws --syncmode full --allow-insecure-unlock --http.addr 0.0.0.0 --ws.addr 0.0.0.0 --ws.api eth,net,web3 --ws.origins "*" --port 30314 --nodekey bootnode.key --http.port $(ZONE_3_2_PORT_HTTP) --ws.port $(ZONE_3_2_PORT_WS) --region 3 --zone 2 > nodelogs/zone-3-2.log 2>&1 &
@nohup ./build/bin/quai --ws --syncmode full --allow-insecure-unlock --http.addr 0.0.0.0 --ws.addr 0.0.0.0 --ws.api eth,net,web3 --ws.origins "*" --port 30315 --nodekey bootnode.key --http.port $(ZONE_3_3_PORT_HTTP) --ws.port $(ZONE_3_3_PORT_WS) --region 3 --zone 3 > nodelogs/zone-3-3.log 2>&1 &


run-bootnode:
ifeq (,$(wildcard ./bootnode.key))
./build/bin/bootnode --genkey=bootnode.key
endif
ifeq (,$(wildcard nodelogs))
mkdir nodelogs
endif
@nohup ./build/bin/quai --ws --http --syncmode full --allow-insecure-unlock --http.addr 0.0.0.0 --ws.addr 0.0.0.0 --ws.api eth,net,web3 --ws.origins "*" --port 30303 --nodekey bootnode.key --http.port $(PRIME_PORT_HTTP) --ws.port $(PRIME_PORT_WS) --nat extip:$(HOST_IP) > nodelogs/prime.log 2>&1 &
@nohup ./build/bin/quai --ws --http --syncmode full --allow-insecure-unlock --http.addr 0.0.0.0 --ws.addr 0.0.0.0 --ws.api eth,net,web3 --ws.origins "*" --port 30304 --nodekey bootnode.key --http.port $(REGION_1_PORT_HTTP) --ws.port $(REGION_1_PORT_WS) --region 1 --nat extip:$(HOST_IP) > nodelogs/region-1.log 2>&1 &
@nohup ./build/bin/quai --ws --http --syncmode full --allow-insecure-unlock --http.addr 0.0.0.0 --ws.addr 0.0.0.0 --ws.api eth,net,web3 --ws.origins "*" --port 30305 --nodekey bootnode.key --http.port $(REGION_2_PORT_HTTP) --ws.port $(REGION_2_PORT_WS) --region 2 --nat extip:$(HOST_IP) > nodelogs/region-2.log 2>&1 &
@nohup ./build/bin/quai --ws --http --syncmode full --allow-insecure-unlock --http.addr 0.0.0.0 --ws.addr 0.0.0.0 --ws.api eth,net,web3 --ws.origins "*" --port 30306 --nodekey bootnode.key --http.port $(REGION_3_PORT_HTTP) --ws.port $(REGION_3_PORT_WS) --region 3 --nat extip:$(HOST_IP) > nodelogs/region-3.log 2>&1 &
@nohup ./build/bin/quai --ws --http --syncmode full --allow-insecure-unlock --http.addr 0.0.0.0 --ws.addr 0.0.0.0 --ws.api eth,net,web3 --ws.origins "*" --port 30307 --nodekey bootnode.key --http.port $(ZONE_1_1_PORT_HTTP) --ws.port $(ZONE_1_1_PORT_WS) --region 1 --zone 1 --nat extip:$(HOST_IP) > nodelogs/zone-1-1.log 2>&1 &
@nohup ./build/bin/quai --ws --http --syncmode full --allow-insecure-unlock --http.addr 0.0.0.0 --ws.addr 0.0.0.0 --ws.api eth,net,web3 --ws.origins "*" --port 30308 --nodekey bootnode.key --http.port $(ZONE_1_2_PORT_HTTP) --ws.port $(ZONE_1_2_PORT_WS) --region 1 --zone 2 --nat extip:$(HOST_IP) > nodelogs/zone-1-2.log 2>&1 &
@nohup ./build/bin/quai --ws --http --syncmode full --allow-insecure-unlock --http.addr 0.0.0.0 --ws.addr 0.0.0.0 --ws.api eth,net,web3 --ws.origins "*" --port 30309 --nodekey bootnode.key --http.port $(ZONE_1_3_PORT_HTTP) --ws.port $(ZONE_1_3_PORT_WS) --region 1 --zone 3 --nat extip:$(HOST_IP) > nodelogs/zone-1-3.log 2>&1 &
@nohup ./build/bin/quai --ws --http --syncmode full --allow-insecure-unlock --http.addr 0.0.0.0 --ws.addr 0.0.0.0 --ws.api eth,net,web3 --ws.origins "*" --port 30310 --nodekey bootnode.key --http.port $(ZONE_2_1_PORT_HTTP) --ws.port $(ZONE_2_1_PORT_WS) --region 2 --zone 1 --nat extip:$(HOST_IP) > nodelogs/zone-2-1.log 2>&1 &
@nohup ./build/bin/quai --ws --http --syncmode full --allow-insecure-unlock --http.addr 0.0.0.0 --ws.addr 0.0.0.0 --ws.api eth,net,web3 --ws.origins "*" --port 30311 --nodekey bootnode.key --http.port $(ZONE_2_2_PORT_HTTP) --ws.port $(ZONE_2_2_PORT_WS) --region 2 --zone 2 --nat extip:$(HOST_IP) > nodelogs/zone-2-2.log 2>&1 &
@nohup ./build/bin/quai --ws --http --syncmode full --allow-insecure-unlock --http.addr 0.0.0.0 --ws.addr 0.0.0.0 --ws.api eth,net,web3 --ws.origins "*" --port 30312 --nodekey bootnode.key --http.port $(ZONE_2_3_PORT_HTTP) --ws.port $(ZONE_2_3_PORT_WS) --region 2 --zone 3 --nat extip:$(HOST_IP) > nodelogs/zone-2-3.log 2>&1 &
@nohup ./build/bin/quai --ws --http --syncmode full --allow-insecure-unlock --http.addr 0.0.0.0 --ws.addr 0.0.0.0 --ws.api eth,net,web3 --ws.origins "*" --port 30313 --nodekey bootnode.key --http.port $(ZONE_3_1_PORT_HTTP) --ws.port $(ZONE_3_1_PORT_WS) --region 3 --zone 1 --nat extip:$(HOST_IP) > nodelogs/zone-3-1.log 2>&1 &
@nohup ./build/bin/quai --ws --http --syncmode full --allow-insecure-unlock --http.addr 0.0.0.0 --ws.addr 0.0.0.0 --ws.api eth,net,web3 --ws.origins "*" --port 30314 --nodekey bootnode.key --http.port $(ZONE_3_2_PORT_HTTP) --ws.port $(ZONE_3_2_PORT_WS) --region 3 --zone 2 --nat extip:$(HOST_IP) > nodelogs/zone-3-2.log 2>&1 &
@nohup ./build/bin/quai --ws --http --syncmode full --allow-insecure-unlock --http.addr 0.0.0.0 --ws.addr 0.0.0.0 --ws.api eth,net,web3 --ws.origins "*" --port 30315 --nodekey bootnode.key --http.port $(ZONE_3_3_PORT_HTTP) --ws.port $(ZONE_3_3_PORT_WS) --region 3 --zone 3 --nat extip:$(HOST_IP) > nodelogs/zone-3-3.log 2>&1 &

stop:
pkill -f './build/bin/quai'
6 changes: 3 additions & 3 deletions cmd/quai/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,13 +263,13 @@ func prepare(ctx *cli.Context) {
// If we're running a known preset, log it for convenience.
switch {
case ctx.GlobalIsSet(utils.RopstenFlag.Name):
log.Info("Starting Geth on Ropsten testnet...")
log.Info("Starting Quai on Ropsten testnet...")

case ctx.GlobalIsSet(utils.DeveloperFlag.Name):
log.Info("Starting Geth in ephemeral dev mode...")
log.Info("Starting Quai in ephemeral dev mode...")

case !ctx.GlobalIsSet(utils.NetworkIdFlag.Name):
log.Info("Starting Geth on Ethereum mainnet...")
log.Info("Starting go-quai on Quai Network mainnet...")
}
// If we're running a light client on any network, drop the cache to some meaningfully low amount
if ctx.GlobalString(utils.SyncModeFlag.Name) == "light" && !ctx.GlobalIsSet(utils.CacheFlag.Name) {
Expand Down
4 changes: 2 additions & 2 deletions eth/ethconfig/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ var LightClientGPO = gasprice.Config{
IgnorePrice: gasprice.DefaultIgnorePrice,
}

// Defaults contains default settings for use on the Ethereum main net.
// Defaults contains default settings for use on the Quai Network Prime main net.
var Defaults = Config{
SyncMode: downloader.SnapSync,
Ethash: ethash.Config{
Expand All @@ -71,7 +71,7 @@ var Defaults = Config{
DatasetsOnDisk: 2,
DatasetsLockMmap: false,
},
NetworkId: 1,
NetworkId: 9000,
TxLookupLimit: 2350000,
LightPeers: 100,
UltraLightFraction: 75,
Expand Down
1 change: 1 addition & 0 deletions p2p/discover/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ func (tab *Table) doRevalidate(done chan<- struct{}) {
// The node responded, move it to the front.
last.livenessChecks++
tab.log.Debug("Revalidated node", "b", bi, "id", last.ID(), "checks", last.livenessChecks)
log.Debug("Revalidated node", "b", bi, "id", last.ID(), "checks", last.livenessChecks)
tab.bumpInBucket(b, last)
return
}
Expand Down

0 comments on commit 7d5f896

Please sign in to comment.