This definitely needs future cleanup but itās good enough from a client perspective to get us going.
LOCAL TESTING
- Clone and build
nomctl
- Create local hyperqube_z devnet
git clone git@github.com:hypercore-one/nomctl.git
cd nomctl
git checkout hyperqube_z
make nomctl
./build/nomctl -hq generate-devnet -ez
- Copy key into nomctl directory. On mac, the directory will be
~/Library/hqzd/wallet
. On linux, it should be~/.hqzd/wallet
. Thenomctl
command looks for keys in the~/.nomctl/wallet
directory.
# Adjust as needed
cp ~/.hqzd/wallet/<KEYFILE> ~/.nomctl/wallet/
- In a new terminal session, clone hyperqube_z and run the node
git clone git@github.com:hypercore-one/hyperqube_z.git
cd hyperqube_z
git checkout hyperqube_z
make hqzd
./build/hqzd
- You should have a running local cluster now. Go back to the
nomctl
terminal and run a few commands for testing. Make sure to always use the-hq
flag. If you have used nomctl before with another network, you will need to use the--keyStore
,-k
flag to choose the right key. The default password for the devnet isDon'tTrust.Verify
./build/nomctl -hq znn-cli -p "Don'tTrust.Verify" balance
./build/nomctl -hq znn-cli -p "Don'tTrust.Verify" plasma.list
# this example shows that utilQ is correctly taking the role of QSR
# I should make address default to the key
./build/nomctl -hq znn-cli -p "Don'tTrust.Verify" plasma.fuse <ADDRESS> 1000
getting this error
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
what os are you using?
and what is your go version
?
go version go1.23.4 linux/amd64
Ubuntu 22.04.5 LTS - Desktop
Hmm itās a bit strange
v1.10.22 has all those functions
Can you run go mod download
and then trying make nomctl
again?
x3639@0x3639-NoM:~/nomctl$ go mod download
x3639@0x3639-NoM:~/nomctl$ make nomctl
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
iām on the correct branch
x3639@0x3639-NoM:~/nomctl$ git branch
* hyperqube_z
master
tried this
note the version: go: downloading github.com/ethereum/go-ethereum v1.14.12
x3639@0x3639-NoM:~/nomctl$ go clean -modcache
x3639@0x3639-NoM:~/nomctl$ go mod tidy
go: downloading github.com/ethereum/go-ethereum v1.14.12
go: downloading github.com/hypercore-one/go-zdk v0.1.1-0.20241212163241-b71304db9eb2
go: downloading github.com/shopspring/decimal v1.3.1
go: downloading github.com/tyler-smith/go-bip39 v1.1.0
go: downloading github.com/urfave/cli/v2 v2.25.7
go: downloading github.com/hypercore-one/hyperqube_z v0.0.0-20241212025544-714b2282baad
go: downloading golang.org/x/term v0.27.0
go: downloading golang.org/x/crypto v0.31.0
go: downloading github.com/cpuguy83/go-md2man/v2 v2.0.2
go: downloading github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673
go: downloading github.com/pkg/errors v0.9.1
go: downloading github.com/prometheus/tsdb v0.10.0
go: downloading github.com/rs/cors v1.8.2
go: downloading github.com/inconshreveable/log15 v2.16.0+incompatible
go: downloading github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7
go: downloading github.com/btcsuite/btcd/btcutil v1.1.6
go: downloading google.golang.org/protobuf v1.35.2
go: downloading github.com/deckarep/golang-set v1.8.0
go: downloading github.com/gorilla/websocket v1.5.3
go: downloading gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce
go: downloading golang.org/x/sys v0.28.0
go: downloading github.com/russross/blackfriday/v2 v2.1.0
go: downloading gopkg.in/natefinch/lumberjack.v2 v2.2.1
go: downloading github.com/hashicorp/golang-lru v1.0.2
go: downloading github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0
go: downloading github.com/shirou/gopsutil v3.21.11+incompatible
go: downloading github.com/holiman/uint256 v1.3.2
go: downloading github.com/huin/goupnp v1.3.0
go: downloading github.com/jackpal/go-nat-pmp v1.0.2
go: downloading github.com/davecgh/go-spew v1.1.1
go: downloading github.com/google/gofuzz v1.2.0
go: downloading github.com/stretchr/testify v1.9.0
go: downloading github.com/go-stack/stack v1.8.1
go: downloading github.com/mattn/go-colorable v0.1.13
go: downloading github.com/onsi/ginkgo v1.14.0
go: downloading github.com/onsi/gomega v1.10.3
go: downloading golang.org/x/exp v0.0.0-20241210194714-1829a127f884
go: downloading github.com/google/go-cmp v0.6.0
go: downloading github.com/go-kit/kit v0.9.0
go: downloading github.com/decred/dcrd/crypto/blake256 v1.0.1
go: downloading golang.org/x/sync v0.10.0
go: downloading github.com/tklauser/go-sysconf v0.3.14
go: downloading github.com/yusufpapurcu/wmi v1.2.4
go: downloading github.com/pmezard/go-difflib v1.0.0
go: downloading gopkg.in/yaml.v3 v3.0.1
go: downloading github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb
go: downloading github.com/mattn/go-isatty v0.0.20
go: downloading github.com/golang-collections/collections v0.0.0-20130729185459-604e922904d3
go: downloading gopkg.in/karalabe/cookiejar.v2 v2.0.0-20150724131613-8dcd6a7f4951
go: downloading github.com/go-ole/go-ole v1.3.0
go: downloading github.com/tklauser/numcpus v0.9.0
go: downloading github.com/go-logfmt/logfmt v0.3.0
go: downloading golang.org/x/net v0.24.0
go: downloading golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
go: downloading gopkg.in/yaml.v2 v2.4.0
go: downloading github.com/nxadm/tail v1.4.4
go: downloading github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515
go: downloading gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7
go: downloading github.com/fsnotify/fsnotify v1.6.0
go: downloading golang.org/x/text v0.21.0
x3639@0x3639-NoM:~/nomctl$ go mod download
x3639@0x3639-NoM:~/nomctl$ make nomctl
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
I switched to my linux machine and canāt replicate.
Also I need to update the instructions to use ~/.hqzd
instead of ~/hqzd
for linux
george@nom:~/testing$ git clone git@github.com:hypercore-one/nomctl.git
cd nomctl
git checkout hyperqube_z
make nomctl
./build/nomctl -hq generate-devnet -ez
Cloning into 'nomctl'...
remote: Enumerating objects: 97, done.
remote: Counting objects: 100% (97/97), done.
remote: Compressing objects: 100% (62/62), done.
remote: Total 97 (delta 56), reused 68 (delta 33), pack-reused 0 (from 0)
Receiving objects: 100% (97/97), 79.10 KiB | 1.98 MiB/s, done.
Resolving deltas: 100% (56/56), done.
branch 'hyperqube_z' set up to track 'origin/hyperqube_z'.
Switched to a new branch 'hyperqube_z'
go build -o build/nomctl
go: downloading go1.22.5 (linux/amd64)
go: downloading github.com/hypercore-one/hyperqube_z v0.0.0-20241212025544-714b2282baad
go: downloading github.com/hypercore-one/go-zdk v0.1.1-0.20241212163241-b71304db9eb2
go: downloading github.com/ethereum/go-ethereum v1.14.12
go: downloading golang.org/x/term v0.27.0
go: downloading golang.org/x/crypto v0.31.0
go: downloading golang.org/x/sys v0.28.0
go: downloading github.com/btcsuite/btcd/btcutil v1.1.6
go: downloading google.golang.org/protobuf v1.35.2
go: downloading github.com/gorilla/websocket v1.5.3
go: downloading github.com/huin/goupnp v1.3.0
go: downloading github.com/mattn/go-isatty v0.0.20
go: downloading golang.org/x/sync v0.10.0
go: downloading github.com/holiman/uint256 v1.3.2
go: downloading golang.org/x/exp v0.0.0-20241210194714-1829a127f884
go: downloading github.com/tklauser/go-sysconf v0.3.14
go: downloading github.com/tklauser/numcpus v0.9.0
george@nom:~/testing/nomctl$ go version
go version go1.22.5 linux/amd64
I installed go with snap. Let me try a fresh install
Im in
Loaded a valid genesis config from path '/home/x3639/.hqzd/genesis.json'
Initialized NoM. Height: 1, Hash: bf1658dff419ec7175d6c045c068b52d7f12e1eccf2a545db1f4eecc5357b5f9
Producing momentum ...
[Momentum inserted] Height: 2, Hash: 5cf4d30a5a551368b4144dbe722851c4366788ac7a1a6a3cd6c7d303be6607b3, Timestamp: 1734051900, Pillar producer address: z1qzxza5uqe7q096yzj254fllzj3ne5g08at59gh, Current time: 2024-12-12 19:05:02, Txs: 0
hqzd successfully started
*** Node status ***
* Producer address detected: z1qzxza5uqe7q096yzj254fllzj3ne5g08at59gh
Producing momentum ...
[Momentum inserted] Height: 3, Hash: c2102467ec7c570ae1abfbc285e41279198404cc5541c20a666bd5b67848a393, Timestamp: 1734051960, Pillar producer address: z1qzxza5uqe7q096yzj254fllzj3ne5g08at59gh, Current time: 2024-12-12 19:06:00, Txs: 0
./build/nomctl -hq znn-cli -p "Don'tTrust.Verify" plasma.fuse z1qzxza5uqe7q096yzj254fllzj3ne5g08at59gh 1000
Using the default keyStore z1qzxza5uqe7q096yzj254fllzj3ne5g08at59gh
Fusing 1000 QSR to z1qzxza5uqe7q096yzj254fllzj3ne5g08at59gh
Done
no idea what was causing that issue. I switched to a different ubuntu VM 22.04 desktop and it worked.
so note the time in between momentums is a minute
and if you run the balance command you should see utilZ and utilQ
the cli still uses ZNN and QSR in its messages in some places, which Iāll fix later
cool. Iāll let it run a while
iāll put some instructions together for it
but basically one thing to try is
activate the spork to deactivate pillar registration
make a new address
send funds to it
try to register a new pillar
get a failure
I tested hqzd locally but Iām having issues generating momentums. Running on macOS with M1. Go version is 1.23.4.
Findings:
When trying to generate a momentum the producer event is discarded because ācurrent time is before start timeā
. This is caused by the producer event being fired before the event should start. The producer event is consistently being fired between 1 to 3 milliseconds too early. Sometimes it will fire the event on the correct time and the momentum will be generated.
I narrowed down the problem to this line in consensus.go
. For whatever reason either the time.After
method or the time.Sub
method is inaccurate and the resulting imprecision causes the producer event to be fired slightly too soon. As a quick fix adding an additional 10 millisecond delay here ensures that the event is not fired too soon.
The hqzd changes do not touch this area of the code and I canāt think of a reason why the hqzd changes would cause this. I didnāt have to time to test if this same issue happens on a mainnet devnet yet.
Edit: Not able to reproduce this issue on a mainnet devnet in the otherwise same environment.
Iāve seen that same issue when running hqzd devnet. It only seemed to happen occasionally for me.
It could be a race condition that with a 10s blocktime, itās busy with something and technically a little behind always.
If Times t and u both contain monotonic clock readings, the operations t.After(u), t.Before(u), t.Equal(u), t.Compare(u), and t.Sub(u) are carried out using the monotonic clock readings alone, ignoring the wall clock readings. If either t or u contains no monotonic clock reading, these operations fall back to using the wall clock readings.