WP1 Network Launch Code & Config

curl -L https://forum.hypercore.one/uploads/short-url/svdgCBtU1P1eztzvOM2e0vsu7CB.json -o ~/.hqzd/genesis.json
  "Net": {
    "ListenHost": "0.0.0.0",
    "ListenPort": 45995,
    "MinPeers": 4,
    "MinConnectedPeers": 4,
    "MaxPeers": 60,
    "MaxPendingPeers": 10,
    "Seeders": [
	    "enode://763935dbbdd2ed59e64d2263884887abf865165129f18af9fb1cd0e961b936405144970e7363e6be3d0f0bc3d1e4a0e2ac22306335b8102941728718e063777b@45.77.193.218:45995"
    ]
  }

In terms of testing, I have not used AI much for coding so dipping my toe in, I got it to spit out:

#!/bin/bash

# Set the interval time in seconds (configurable)
INTERVAL=5  # Default to 5 seconds

# Check if a custom interval is provided as a command-line argument
if [ ! -z "$1" ]; then
    INTERVAL=$1
fi

# Configurable URL (set the URL you want to use for the -u flag)
URL="http://127.0.0.1:35997" 

# Check if a custom URL is provided as a command-line argument
if [ ! -z "$2" ]; then
    URL=$2
fi

# Define the array of addresses (customizable)
ADDRESSES=("address1" "address2" "address3")  # Replace with actual addresses

# The constant part of the receive command with the -hq, -u, -k, and -p flags
RECEIVE_COMMAND="./build/nomctl -hq znn-cli -u $URL -k hqz -p Don'tTrust.Verify receiveAll"

# The constant part of the send command with the -hq, -u, -k, and -p flags
SEND_COMMAND="./build/nomctl -hq znn-cli -u $URL -k hqz -p Don'tTrust.Verify send"

# Loop indefinitely
while true; do
    # Execute the receive command first
    $RECEIVE_COMMAND
    echo "Executed: $RECEIVE_COMMAND"

    # Loop through the addresses and execute the send command
    for ADDRESS in "${ADDRESSES[@]}"; do
        # Execute the send command with the current address
        $SEND_COMMAND "$ADDRESS" 1 "zts1utylzxxxxxxxxxxx6agxt0"
        
        # Optional: print the command being executed for debugging purposes
        echo "Executed: $SEND_COMMAND $ADDRESS 1 zts1utylzxxxxxxxxxxx6agxt0"
        
        # Wait for the specified interval before repeating the command
        sleep $INTERVAL
    done
done

Here’s an updated script so that the receiveAll command is only run once a min

#!/bin/bash

# Set the interval time in seconds (configurable)
INTERVAL=5  # Default to 5 seconds

# Check if a custom interval is provided as a command-line argument
if [ ! -z "$1" ]; then
    INTERVAL=$1
fi

# Configurable URL (set the URL you want to use for the -u flag)
URL="http://127.0.0.1:35997"  # Default URL is now set to localhost

# Check if a custom URL is provided as a command-line argument
if [ ! -z "$2" ]; then
    URL=$2
fi

# Define the array of addresses (customizable)
ADDRESSES=("address1" "address2" "address3")  # Replace with actual addresses

# The constant part of the receive command with the -hq, -u, -k, and -p flags
RECEIVE_COMMAND="./build/nomctl -hq znn-cli -u $URL -k hqz -p Don'tTrust.Verify receiveAll"

# The constant part of the send command with the -hq, -u, -k, and -p flags
SEND_COMMAND="./build/nomctl -hq znn-cli -u $URL -k hqz -p Don'tTrust.Verify send"

# Variable to track when to run the receive command
LAST_RECEIVE_TIME=0
SECONDS_IN_MINUTE=60

# Loop indefinitely
while true; do
    # Get the current time in seconds
    CURRENT_TIME=$(date +%s)
    
    # If one minute has passed since the last receive command, run the receive command
    if ((CURRENT_TIME - LAST_RECEIVE_TIME >= SECONDS_IN_MINUTE)); then
        # Execute the receive command
        $RECEIVE_COMMAND
        echo "Executed: $RECEIVE_COMMAND"
        
        # Update LAST_RECEIVE_TIME to the current time
        LAST_RECEIVE_TIME=$CURRENT_TIME
    fi

    # Loop through the addresses and execute the send command
    for ADDRESS in "${ADDRESSES[@]}"; do
        # Execute the send command with the current address
        $SEND_COMMAND "$ADDRESS" 1 "zts1utylzxxxxxxxxxxx6agxt0"
        
        # Optional: print the command being executed for debugging purposes
        echo "Executed: $SEND_COMMAND $ADDRESS 1 zts1utylzxxxxxxxxxxx6agxt0"
        
        # Wait for the specified interval before repeating the command
        sleep $INTERVAL
    done
done

Public testnet node ws://172.245.234.82:35998

If you get this error you need to install build-essential

go build -o build/nomctl
# github.com/zenon-network/go-zenon/p2p/discover
../go/pkg/mod/github.com/hypercore-one/hyperqube_z@v0.0.0-20241212025544-714b2282baad/p2p/discover/node.go:223:27: undefined: secp256k1.RecoverPubkey
# github.com/zenon-network/go-zenon/vm/embedded/implementation
../go/pkg/mod/github.com/hypercore-one/hyperqube_z@v0.0.0-20241212025544-714b2282baad/vm/embedded/implementation/bridge.go:47:30: undefined: secp256k1.RecoverPubkey
../go/pkg/mod/github.com/hypercore-one/hyperqube_z@v0.0.0-20241212025544-714b2282baad/vm/embedded/implementation/bridge.go:1155:20: undefined: secp256k1.DecompressPubkey
../go/pkg/mod/github.com/hypercore-one/hyperqube_z@v0.0.0-20241212025544-714b2282baad/vm/embedded/implementation/swap_utils.go:40:26: undefined: secp256k1.CompressPubkey
../go/pkg/mod/github.com/hypercore-one/hyperqube_z@v0.0.0-20241212025544-714b2282baad/vm/embedded/implementation/swap_utils.go:61:30: undefined: secp256k1.Sign
../go/pkg/mod/github.com/hypercore-one/hyperqube_z@v0.0.0-20241212025544-714b2282baad/vm/embedded/implementation/swap_utils.go:74:30: undefined: secp256k1.Sign
../go/pkg/mod/github.com/hypercore-one/hyperqube_z@v0.0.0-20241212025544-714b2282baad/vm/embedded/implementation/swap_utils.go:135:36: undefined: secp256k1.RecoverPubkey
make: *** [Makefile:4: nomctl] Error 1

sudo apt-get install -y build-essential pkg-config

I want to test a new sentrify setup when we go live. Been working with the go-zenon code. Looks like we have some options in config.json

// Discovery specifies whether the peer discovery mechanism should be started
// or not. Disabling is usually useful for protocol debugging (manual topology).
Discovery bool

// Static nodes are used as pre-configured connections which are always
// maintained and re-connected on disconnects.
StaticNodes []*discover.Node

The sentrify tool from @MoonBaze sets the static peers in the Seeders. I wonder why we don’t do something like this below in config.json. We can allow traffic between the Sentry and Pillar, allow DNS and NTP, and block all other traffic. I’m looking to test a sentrify setup with a private subnet. In the SENTRY_IP section below I will use a private IP address.

@georgezgeorgez do you see any issues with this setup?

  },
  "Net": {
    "ListenHost": "0.0.0.0",
    "ListenPort": 45995,

    "Discovery": false,
    "StaticNodes": [
      "enode://763935dbbdd2ed59e64d2263884887abf865165129f18af9fb1cd0e961b936405144970e7363e6be3d0f0bc3d1e4a0e2ac22306335b8102941728718e063777b@SENTRY_IP:45995"
    ],

    "MinPeers": 4,
    "MinConnectedPeers": 4,
    "MaxPeers": 60,
    "MaxPendingPeers": 10
  }

I’m actually going to extend this test. On the sentry I’m going to only allow connections from the known peer list.

https://raw.githubusercontent.com/0x3639/znn-node-parser/refs/heads/master/data/seeders.txt

This data is scraped and updated every 6 hours. I forked Sol’s code here: GitHub - 0x3639/znn-node-parser

This way someone needs to run a node, get in the list, and then try to attack the network. We will see the traffic and block them. So I’m going to test this setup.