From dff13490916a16a0feb349315714c7948fbc8768 Mon Sep 17 00:00:00 2001 From: Hamza Hamud <53880692+hhamud@users.noreply.github.com> Date: Wed, 24 Dec 2025 15:43:17 +0000 Subject: [PATCH 1/8] feat: add cli option --- utils/config-gen/go.mod | 58 +++++++ utils/config-gen/go.sum | 341 +++++++++++++++++++++++++++++++++++++++ utils/config-gen/main.go | 102 ++++++++++++ 3 files changed, 501 insertions(+) create mode 100644 utils/config-gen/go.mod create mode 100644 utils/config-gen/go.sum create mode 100644 utils/config-gen/main.go diff --git a/utils/config-gen/go.mod b/utils/config-gen/go.mod new file mode 100644 index 0000000..e4ca447 --- /dev/null +++ b/utils/config-gen/go.mod @@ -0,0 +1,58 @@ +module config-gen + +go 1.23.2 + +replace source.quilibrium.com/quilibrium/monorepo/config => ../../config + +replace source.quilibrium.com/quilibrium/monorepo/utils => ../../utils + +replace github.com/multiformats/go-multiaddr => ../../go-multiaddr + +replace github.com/multiformats/go-multiaddr-dns => ../../go-multiaddr-dns + +replace github.com/libp2p/go-libp2p => ../../go-libp2p + +replace github.com/libp2p/go-libp2p-kad-dht => ../../go-libp2p-kad-dht + +replace source.quilibrium.com/quilibrium/monorepo/go-libp2p-blossomsub => ../../go-libp2p-blossomsub + +require ( + github.com/libp2p/go-libp2p v0.41.1 + source.quilibrium.com/quilibrium/monorepo/config v0.0.0-00010101000000-000000000000 +) + +require ( + github.com/cloudflare/circl v1.6.1 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 // indirect + github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect + github.com/ipfs/go-cid v0.5.0 // indirect + github.com/ipfs/go-log/v2 v2.5.1 // indirect + github.com/klauspost/cpuid/v2 v2.2.10 // indirect + github.com/libp2p/go-buffer-pool v0.1.0 // indirect + github.com/libp2p/go-msgio v0.3.0 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/minio/sha256-simd v1.0.1 // indirect + github.com/mr-tron/base58 v1.2.0 // indirect + github.com/multiformats/go-base32 v0.1.0 // indirect + github.com/multiformats/go-base36 v0.2.0 // indirect + github.com/multiformats/go-multiaddr v0.16.0 // indirect + github.com/multiformats/go-multiaddr-fmt v0.1.0 // indirect + github.com/multiformats/go-multibase v0.2.0 // indirect + github.com/multiformats/go-multicodec v0.9.1 // indirect + github.com/multiformats/go-multihash v0.2.3 // indirect + github.com/multiformats/go-multistream v0.6.1 // indirect + github.com/multiformats/go-varint v0.0.7 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/spaolacci/murmur3 v1.1.0 // indirect + go.uber.org/multierr v1.11.0 // indirect + go.uber.org/zap v1.27.0 // indirect + golang.org/x/crypto v0.39.0 // indirect + golang.org/x/exp v0.0.0-20250606033433-dcc06ee1d476 // indirect + golang.org/x/sys v0.33.0 // indirect + google.golang.org/protobuf v1.36.6 // indirect + gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + lukechampine.com/blake3 v1.4.1 // indirect + source.quilibrium.com/quilibrium/monorepo/go-libp2p-blossomsub v0.0.0-00010101000000-000000000000 // indirect + source.quilibrium.com/quilibrium/monorepo/utils v0.0.0-00010101000000-000000000000 // indirect +) diff --git a/utils/config-gen/go.sum b/utils/config-gen/go.sum new file mode 100644 index 0000000..bdca5e9 --- /dev/null +++ b/utils/config-gen/go.sum @@ -0,0 +1,341 @@ +github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= +github.com/benbjohnson/clock v1.3.5 h1:VvXlSJBzZpA/zum6Sj74hxwYI2DIxRWuNIoXAzHZz5o= +github.com/benbjohnson/clock v1.3.5/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cloudflare/circl v1.6.1 h1:zqIqSPIndyBh1bjLVVDHMPpVKqp8Su/V+6MeDzzQBQ0= +github.com/cloudflare/circl v1.6.1/go.mod h1:uddAzsPgqdMAYatqJ0lsjX1oECcQLIlRpzZh3pJrofs= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c h1:pFUpOrbxDR6AkioZ1ySsx5yxlDQZ8stG2b88gTPxgJU= +github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c/go.mod h1:6UhI8N9EjYm1c2odKpFpAYeR8dsBeM7PtzQhRgxRr9U= +github.com/decred/dcrd/crypto/blake256 v1.1.0 h1:zPMNGQCm0g4QTY27fOCorQW7EryeQ/U0x++OzVrdms8= +github.com/decred/dcrd/crypto/blake256 v1.1.0/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 h1:NMZiJj8QnKe1LgsbDayM4UoHwbvwDRwnI3hwNaAHRnc= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0/go.mod h1:ZXNYxsqcloTdSy/rNShjYzMhyjf0LaoftYK0p+A3h40= +github.com/flynn/noise v1.1.0 h1:KjPQoQCEFdZDiP03phOvGi11+SVVhBG2wOWAorLsstg= +github.com/flynn/noise v1.1.0/go.mod h1:xbMo+0i6+IGbYdJhF31t2eR1BIU0CYc12+BNAKwUTag= +github.com/francoispqt/gojay v1.2.13 h1:d2m3sFjloqoIUQU3TsHBgj6qg/BVGlTBeHDUmyJnXKk= +github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/google/gopacket v1.1.19 h1:ves8RnFZPGiFnTS0uPQStjwru6uO6h+nlr9j6fL7kF8= +github.com/google/gopacket v1.1.19/go.mod h1:iJ8V8n6KS+z2U1A8pUwu8bW5SyEMkXJB8Yo/Vo+TKTo= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= +github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= +github.com/huin/goupnp v1.3.0 h1:UvLUlWDNpoUdYzb2TCn+MuTWtcjXKSza2n6CBdQ0xXc= +github.com/huin/goupnp v1.3.0/go.mod h1:gnGPsThkYa7bFi/KWmEysQRf48l2dvR5bxr2OFckNX8= +github.com/ipfs/go-cid v0.0.7/go.mod h1:6Ux9z5e+HpkQdckYoX1PG/6xqKspzlEIR5SDmgqgC/I= +github.com/ipfs/go-cid v0.5.0 h1:goEKKhaGm0ul11IHA7I6p1GmKz8kEYniqFopaB5Otwg= +github.com/ipfs/go-cid v0.5.0/go.mod h1:0L7vmeNXpQpUS9vt+yEARkJ8rOg43DF3iPgn4GIN0mk= +github.com/ipfs/go-log/v2 v2.5.1 h1:1XdUzF7048prq4aBjDQQ4SL5RxftpRGdXhNRwKSAlcY= +github.com/ipfs/go-log/v2 v2.5.1/go.mod h1:prSpmC1Gpllc9UYWxDiZDreBYw7zp4Iqp1kOLU9U5UI= +github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= +github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= +github.com/jbenet/go-temp-err-catcher v0.1.0 h1:zpb3ZH6wIE8Shj2sKS+khgRvf7T7RABoLk/+KKHggpk= +github.com/jbenet/go-temp-err-catcher v0.1.0/go.mod h1:0kJRvmDZXNMIiJirNPEYfhpPwbGVtZVWC34vc5WLsDk= +github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo= +github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ= +github.com/klauspost/cpuid/v2 v2.0.4/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.2.3/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= +github.com/klauspost/cpuid/v2 v2.2.6/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= +github.com/klauspost/cpuid/v2 v2.2.10 h1:tBs3QSyvjDyFTq3uoc/9xFpCuOsJQFNPiAhYdw2skhE= +github.com/klauspost/cpuid/v2 v2.2.10/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0= +github.com/koron/go-ssdp v0.0.6 h1:Jb0h04599eq/CY7rB5YEqPS83HmRfHP2azkxMN2rFtU= +github.com/koron/go-ssdp v0.0.6/go.mod h1:0R9LfRJGek1zWTjN3JUNlm5INCDYGpRDfAptnct63fI= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8= +github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= +github.com/libp2p/go-flow-metrics v0.2.0 h1:EIZzjmeOE6c8Dav0sNv35vhZxATIXWZg6j/C08XmmDw= +github.com/libp2p/go-flow-metrics v0.2.0/go.mod h1:st3qqfu8+pMfh+9Mzqb2GTiwrAGjIPszEjZmtksN8Jc= +github.com/libp2p/go-libp2p-asn-util v0.4.1 h1:xqL7++IKD9TBFMgnLPZR6/6iYhawHKHl950SO9L6n94= +github.com/libp2p/go-libp2p-asn-util v0.4.1/go.mod h1:d/NI6XZ9qxw67b4e+NgpQexCIiFYJjErASrYW4PFDN8= +github.com/libp2p/go-libp2p-testing v0.12.0 h1:EPvBb4kKMWO29qP4mZGyhVzUyR25dvfUIK5WDu6iPUA= +github.com/libp2p/go-libp2p-testing v0.12.0/go.mod h1:KcGDRXyN7sQCllucn1cOOS+Dmm7ujhfEyXQL5lvkcPg= +github.com/libp2p/go-msgio v0.3.0 h1:mf3Z8B1xcFN314sWX+2vOTShIE0Mmn2TXn3YCUQGNj0= +github.com/libp2p/go-msgio v0.3.0/go.mod h1:nyRM819GmVaF9LX3l03RMh10QdOroF++NBbxAb0mmDM= +github.com/libp2p/go-netroute v0.2.2 h1:Dejd8cQ47Qx2kRABg6lPwknU7+nBnFRpko45/fFPuZ8= +github.com/libp2p/go-netroute v0.2.2/go.mod h1:Rntq6jUAH0l9Gg17w5bFGhcC9a+vk4KNXs6s7IljKYE= +github.com/libp2p/go-reuseport v0.4.0 h1:nR5KU7hD0WxXCJbmw7r2rhRYruNRl2koHw8fQscQm2s= +github.com/libp2p/go-reuseport v0.4.0/go.mod h1:ZtI03j/wO5hZVDFo2jKywN6bYKWLOy8Se6DrI2E1cLU= +github.com/libp2p/go-yamux/v5 v5.0.1 h1:f0WoX/bEF2E8SbE4c/k1Mo+/9z0O4oC/hWEA+nfYRSg= +github.com/libp2p/go-yamux/v5 v5.0.1/go.mod h1:en+3cdX51U0ZslwRdRLrvQsdayFt3TSUKvBGErzpWbU= +github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd h1:br0buuQ854V8u83wA0rVZ8ttrq5CpaPZdvrK0LP2lOk= +github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd/go.mod h1:QuCEs1Nt24+FYQEqAAncTDPJIuGs+LxK1MCiFL25pMU= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/miekg/dns v1.1.66 h1:FeZXOS3VCVsKnEAd+wBkjMC3D2K+ww66Cq3VnCINuJE= +github.com/miekg/dns v1.1.66/go.mod h1:jGFzBsSNbJw6z1HYut1RKBKHA9PBdxeHrZG8J+gC2WE= +github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b h1:z78hV3sbSMAUoyUMM0I83AUIT6Hu17AWfgjzIbtrYFc= +github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b/go.mod h1:lxPUiZwKoFL8DUUmalo2yJJUCxbPKtm8OKfqr2/FTNU= +github.com/mikioh/tcpopt v0.0.0-20190314235656-172688c1accc h1:PTfri+PuQmWDqERdnNMiD9ZejrlswWrCpBEZgWOiTrc= +github.com/mikioh/tcpopt v0.0.0-20190314235656-172688c1accc/go.mod h1:cGKTAVKx4SxOuR/czcZ/E2RSJ3sfHs8FpHhQ5CWMf9s= +github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1/go.mod h1:pD8RvIylQ358TN4wwqatJ8rNavkEINozVn9DtGI3dfQ= +github.com/minio/sha256-simd v0.1.1-0.20190913151208-6de447530771/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM= +github.com/minio/sha256-simd v1.0.0/go.mod h1:OuYzVNI5vcoYIAmbIvHPl3N3jUzVedXbKy5RFepssQM= +github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM= +github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8= +github.com/mr-tron/base58 v1.1.0/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8= +github.com/mr-tron/base58 v1.1.3/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= +github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= +github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= +github.com/multiformats/go-base32 v0.0.3/go.mod h1:pLiuGC8y0QR3Ue4Zug5UzK9LjgbkL8NSQj0zQ5Nz/AA= +github.com/multiformats/go-base32 v0.1.0 h1:pVx9xoSPqEIQG8o+UbAe7DNi51oej1NtK+aGkbLYxPE= +github.com/multiformats/go-base32 v0.1.0/go.mod h1:Kj3tFY6zNr+ABYMqeUNeGvkIC/UYgtWibDcT0rExnbI= +github.com/multiformats/go-base36 v0.1.0/go.mod h1:kFGE83c6s80PklsHO9sRn2NCoffoRdUUOENyW/Vv6sM= +github.com/multiformats/go-base36 v0.2.0 h1:lFsAbNOGeKtuKozrtBsAkSVhv1p9D0/qedU9rQyccr0= +github.com/multiformats/go-base36 v0.2.0/go.mod h1:qvnKE++v+2MWCfePClUEjE78Z7P2a1UV0xHgWc0hkp4= +github.com/multiformats/go-multiaddr-fmt v0.1.0 h1:WLEFClPycPkp4fnIzoFoV9FVd49/eQsuaL3/CWe167E= +github.com/multiformats/go-multiaddr-fmt v0.1.0/go.mod h1:hGtDIW4PU4BqJ50gW2quDuPVjyWNZxToGUh/HwTZYJo= +github.com/multiformats/go-multibase v0.0.3/go.mod h1:5+1R4eQrT3PkYZ24C3W2Ue2tPwIdYQD509ZjSb5y9Oc= +github.com/multiformats/go-multibase v0.2.0 h1:isdYCVLvksgWlMW9OZRYJEa9pZETFivncJHmHnnd87g= +github.com/multiformats/go-multibase v0.2.0/go.mod h1:bFBZX4lKCA/2lyOFSAoKH5SS6oPyjtnzK/XTFDPkNuk= +github.com/multiformats/go-multicodec v0.9.1 h1:x/Fuxr7ZuR4jJV4Os5g444F7xC4XmyUaT/FWtE+9Zjo= +github.com/multiformats/go-multicodec v0.9.1/go.mod h1:LLWNMtyV5ithSBUo3vFIMaeDy+h3EbkMTek1m+Fybbo= +github.com/multiformats/go-multihash v0.0.13/go.mod h1:VdAWLKTwram9oKAatUcLxBNUjdtcVwxObEQBtRfuyjc= +github.com/multiformats/go-multihash v0.2.3 h1:7Lyc8XfX/IY2jWb/gI7JP+o7JEq9hOa7BFvVU9RSh+U= +github.com/multiformats/go-multihash v0.2.3/go.mod h1:dXgKXCXjBzdscBLk9JkjINiEsCKRVch90MdaGiKsvSM= +github.com/multiformats/go-multistream v0.6.1 h1:4aoX5v6T+yWmc2raBHsTvzmFhOI8WVOer28DeBBEYdQ= +github.com/multiformats/go-multistream v0.6.1/go.mod h1:ksQf6kqHAb6zIsyw7Zm+gAuVo57Qbq84E27YlYqavqw= +github.com/multiformats/go-varint v0.0.5/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= +github.com/multiformats/go-varint v0.0.6/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= +github.com/multiformats/go-varint v0.0.7 h1:sWSGR+f/eu5ABZA2ZpYKBILXTTs9JWpdEM/nEGOHFS8= +github.com/multiformats/go-varint v0.0.7/go.mod h1:r8PUYw/fD/SjBCiKOoDlGF6QawOELpZAu9eioSos/OU= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 h1:onHthvaw9LFnH4t2DcNVpwGmV9E1BkGknEliJkfwQj0= +github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58/go.mod h1:DXv8WO4yhMYhSNPKjeNKa5WY9YCIEBRbNzFFPJbWO6Y= +github.com/pion/datachannel v1.5.10 h1:ly0Q26K1i6ZkGf42W7D4hQYR90pZwzFOjTq5AuCKk4o= +github.com/pion/datachannel v1.5.10/go.mod h1:p/jJfC9arb29W7WrxyKbepTU20CFgyx5oLo8Rs4Py/M= +github.com/pion/dtls/v2 v2.2.12 h1:KP7H5/c1EiVAAKUmXyCzPiQe5+bCJrpOeKg/L05dunk= +github.com/pion/dtls/v2 v2.2.12/go.mod h1:d9SYc9fch0CqK90mRk1dC7AkzzpwJj6u2GU3u+9pqFE= +github.com/pion/dtls/v3 v3.0.6 h1:7Hkd8WhAJNbRgq9RgdNh1aaWlZlGpYTzdqjy9x9sK2E= +github.com/pion/dtls/v3 v3.0.6/go.mod h1:iJxNQ3Uhn1NZWOMWlLxEEHAN5yX7GyPvvKw04v9bzYU= +github.com/pion/ice/v4 v4.0.10 h1:P59w1iauC/wPk9PdY8Vjl4fOFL5B+USq1+xbDcN6gT4= +github.com/pion/ice/v4 v4.0.10/go.mod h1:y3M18aPhIxLlcO/4dn9X8LzLLSma84cx6emMSu14FGw= +github.com/pion/interceptor v0.1.40 h1:e0BjnPcGpr2CFQgKhrQisBU7V3GXK6wrfYrGYaU6Jq4= +github.com/pion/interceptor v0.1.40/go.mod h1:Z6kqH7M/FYirg3frjGJ21VLSRJGBXB/KqaTIrdqnOic= +github.com/pion/logging v0.2.3 h1:gHuf0zpoh1GW67Nr6Gj4cv5Z9ZscU7g/EaoC/Ke/igI= +github.com/pion/logging v0.2.3/go.mod h1:z8YfknkquMe1csOrxK5kc+5/ZPAzMxbKLX5aXpbpC90= +github.com/pion/mdns/v2 v2.0.7 h1:c9kM8ewCgjslaAmicYMFQIde2H9/lrZpjBkN8VwoVtM= +github.com/pion/mdns/v2 v2.0.7/go.mod h1:vAdSYNAT0Jy3Ru0zl2YiW3Rm/fJCwIeM0nToenfOJKA= +github.com/pion/randutil v0.1.0 h1:CFG1UdESneORglEsnimhUjf33Rwjubwj6xfiOXBa3mA= +github.com/pion/randutil v0.1.0/go.mod h1:XcJrSMMbbMRhASFVOlj/5hQial/Y8oH/HVo7TBZq+j8= +github.com/pion/rtcp v1.2.15 h1:LZQi2JbdipLOj4eBjK4wlVoQWfrZbh3Q6eHtWtJBZBo= +github.com/pion/rtcp v1.2.15/go.mod h1:jlGuAjHMEXwMUHK78RgX0UmEJFV4zUKOFHR7OP+D3D0= +github.com/pion/rtp v1.8.19 h1:jhdO/3XhL/aKm/wARFVmvTfq0lC/CvN1xwYKmduly3c= +github.com/pion/rtp v1.8.19/go.mod h1:bAu2UFKScgzyFqvUKmbvzSdPr+NGbZtv6UB2hesqXBk= +github.com/pion/sctp v1.8.39 h1:PJma40vRHa3UTO3C4MyeJDQ+KIobVYRZQZ0Nt7SjQnE= +github.com/pion/sctp v1.8.39/go.mod h1:cNiLdchXra8fHQwmIoqw0MbLLMs+f7uQ+dGMG2gWebE= +github.com/pion/sdp/v3 v3.0.13 h1:uN3SS2b+QDZnWXgdr69SM8KB4EbcnPnPf2Laxhty/l4= +github.com/pion/sdp/v3 v3.0.13/go.mod h1:88GMahN5xnScv1hIMTqLdu/cOcUkj6a9ytbncwMCq2E= +github.com/pion/srtp/v3 v3.0.6 h1:E2gyj1f5X10sB/qILUGIkL4C2CqK269Xq167PbGCc/4= +github.com/pion/srtp/v3 v3.0.6/go.mod h1:BxvziG3v/armJHAaJ87euvkhHqWe9I7iiOy50K2QkhY= +github.com/pion/stun v0.6.1 h1:8lp6YejULeHBF8NmV8e2787BogQhduZugh5PdhDyyN4= +github.com/pion/stun v0.6.1/go.mod h1:/hO7APkX4hZKu/D0f2lHzNyvdkTGtIy3NDmLR7kSz/8= +github.com/pion/stun/v3 v3.0.0 h1:4h1gwhWLWuZWOJIJR9s2ferRO+W3zA/b6ijOI6mKzUw= +github.com/pion/stun/v3 v3.0.0/go.mod h1:HvCN8txt8mwi4FBvS3EmDghW6aQJ24T+y+1TKjB5jyU= +github.com/pion/transport/v2 v2.2.10 h1:ucLBLE8nuxiHfvkFKnkDQRYWYfp8ejf4YBOPfaQpw6Q= +github.com/pion/transport/v2 v2.2.10/go.mod h1:sq1kSLWs+cHW9E+2fJP95QudkzbK7wscs8yYgQToO5E= +github.com/pion/transport/v3 v3.0.7 h1:iRbMH05BzSNwhILHoBoAPxoB9xQgOaJk+591KC9P1o0= +github.com/pion/transport/v3 v3.0.7/go.mod h1:YleKiTZ4vqNxVwh77Z0zytYi7rXHl7j6uPLGhhz9rwo= +github.com/pion/turn/v4 v4.0.2 h1:ZqgQ3+MjP32ug30xAbD6Mn+/K4Sxi3SdNOTFf+7mpps= +github.com/pion/turn/v4 v4.0.2/go.mod h1:pMMKP/ieNAG/fN5cZiN4SDuyKsXtNTr0ccN7IToA1zs= +github.com/pion/webrtc/v4 v4.1.2 h1:mpuUo/EJ1zMNKGE79fAdYNFZBX790KE7kQQpLMjjR54= +github.com/pion/webrtc/v4 v4.1.2/go.mod h1:xsCXiNAmMEjIdFxAYU0MbB3RwRieJsegSB2JZsGN+8U= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_golang v1.22.0 h1:rb93p9lokFEsctTys46VnV1kLCDpVZ0a/Y92Vm0Zc6Q= +github.com/prometheus/client_golang v1.22.0/go.mod h1:R7ljNsLXhuQXYZYtw6GAE9AZg8Y7vEW5scdCXrWRXC0= +github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk= +github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE= +github.com/prometheus/common v0.64.0 h1:pdZeA+g617P7oGv1CzdTzyeShxAGrTBsolKNOLQPGO4= +github.com/prometheus/common v0.64.0/go.mod h1:0gZns+BLRQ3V6NdaerOhMbwwRbNh9hkGINtQAsP5GS8= +github.com/prometheus/procfs v0.16.1 h1:hZ15bTNuirocR6u0JZ6BAHHmwS1p8B4P6MRqxtzMyRg= +github.com/prometheus/procfs v0.16.1/go.mod h1:teAbpZRB1iIAJYREa1LsoWUXykVXA1KlTmWl8x/U+Is= +github.com/quic-go/qpack v0.5.1 h1:giqksBPnT/HDtZ6VhtFKgoLOWmlyo9Ei6u9PqzIMbhI= +github.com/quic-go/qpack v0.5.1/go.mod h1:+PC4XFrEskIVkcLzpEkbLqq1uCoxPhQuvK5rH1ZgaEg= +github.com/quic-go/quic-go v0.54.0 h1:6s1YB9QotYI6Ospeiguknbp2Znb/jZYjZLRXn9kMQBg= +github.com/quic-go/quic-go v0.54.0/go.mod h1:e68ZEaCdyviluZmy44P6Iey98v/Wfz6HCjQEm+l8zTY= +github.com/quic-go/webtransport-go v0.9.0 h1:jgys+7/wm6JarGDrW+lD/r9BGqBAmqY/ssklE09bA70= +github.com/quic-go/webtransport-go v0.9.0/go.mod h1:4FUYIiUc75XSsF6HShcLeXXYZJ9AGwo/xh3L8M/P1ao= +github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= +github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= +github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= +github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/wlynxg/anet v0.0.5 h1:J3VJGi1gvo0JwZ/P1/Yc/8p63SoW98B5dHkYDmpgvvU= +github.com/wlynxg/anet v0.0.5/go.mod h1:eay5PRQr7fIVAMbTbchTnO9gG65Hg/uYGdc7mguHxoA= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/dig v1.19.0 h1:BACLhebsYdpQ7IROQ1AGPjrXcP5dF80U3gKoFzbaq/4= +go.uber.org/dig v1.19.0/go.mod h1:Us0rSJiThwCv2GteUN0Q7OKvU7n5J4dxZ9JKUXozFdE= +go.uber.org/fx v1.24.0 h1:wE8mruvpg2kiiL1Vqd0CC+tr0/24XIB10Iwp2lLWzkg= +go.uber.org/fx v1.24.0/go.mod h1:AmDeGyS+ZARGKM4tlH4FY2Jr63VjbEDJHtqXTGP5hbo= +go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= +go.uber.org/mock v0.5.2 h1:LbtPTcP8A5k9WPXj54PPPbjcI4Y6lhyOZXn+VS7wNko= +go.uber.org/mock v0.5.2/go.mod h1:wLlUxC2vVTPTaE3UD51E0BGOAElKrILxhVSDYQLld5o= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI= +go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= +go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= +golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= +golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= +golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= +golang.org/x/crypto v0.39.0 h1:SHs+kF4LP+f+p14esP5jAoDpHU8Gu/v9lFRK6IT5imM= +golang.org/x/crypto v0.39.0/go.mod h1:L+Xg3Wf6HoL4Bn4238Z6ft6KfEpN0tJGo53AAPC632U= +golang.org/x/exp v0.0.0-20230725012225-302865e7556b/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= +golang.org/x/exp v0.0.0-20250606033433-dcc06ee1d476 h1:bsqhLWFR6G6xiQcb+JoGqdKdRU6WzPWmK8E0jxTjzo4= +golang.org/x/exp v0.0.0-20250606033433-dcc06ee1d476/go.mod h1:3//PLf8L/X+8b4vuAfHzxeRUl04Adcb341+IGKfnqS8= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.25.0 h1:n7a+ZbQKQA/Ysbyb0/6IbB1H/X41mKgbhfv7AfG/44w= +golang.org/x/mod v0.25.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= +golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= +golang.org/x/net v0.41.0 h1:vBTly1HeNPEn3wtREYfy4GZ/NECgw2Cnl+nK6Nz3uvw= +golang.org/x/net v0.41.0/go.mod h1:B/K4NNqkfmg07DQYrbwvSluqCJOOXwUjeb/5lOisjbA= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.15.0 h1:KWH3jNZsfyT6xfAfKiz6MRNmd46ByHDYaZ7KSkCtdW8= +golang.org/x/sync v0.15.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw= +golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= +golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= +golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= +golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= +golang.org/x/text v0.26.0 h1:P42AVeLghgTYr4+xUnTRKDMqpar+PtX7KWuNQL21L8M= +golang.org/x/text v0.26.0/go.mod h1:QK15LZJUUQVJxhz7wXgxSy/CJaTFjd0G+YLonydOVQA= +golang.org/x/time v0.12.0 h1:ScB/8o8olJvc+CQPWrK3fPZNfh7qgwCrY0zJmoEQLSE= +golang.org/x/time v0.12.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= +golang.org/x/tools v0.34.0 h1:qIpSLOxeCYGg9TrcJokLBG4KFA6d795g0xkBkiESGlo= +golang.org/x/tools v0.34.0/go.mod h1:pAP9OwEaY1CAW3HOmg3hLZC5Z0CCmzjAF2UQMSqNARg= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY= +google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= +gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +lukechampine.com/blake3 v1.1.6/go.mod h1:tkKEOtDkNtklkXtLNEOGNq5tcV90tJiA1vAA12R78LA= +lukechampine.com/blake3 v1.2.1/go.mod h1:0OFRp7fBtAylGVCO40o87sbupkyIGgbpv1+M1k1LM6k= +lukechampine.com/blake3 v1.4.1 h1:I3Smz7gso8w4/TunLKec6K2fn+kyKtDxr/xcQEN84Wg= +lukechampine.com/blake3 v1.4.1/go.mod h1:QFosUxmjB8mnrWFSNwKmvxHpfY72bmD2tQ0kBMM3kwo= diff --git a/utils/config-gen/main.go b/utils/config-gen/main.go new file mode 100644 index 0000000..0f19831 --- /dev/null +++ b/utils/config-gen/main.go @@ -0,0 +1,102 @@ +package main + +import ( + "crypto/rand" + "encoding/hex" + "flag" + "fmt" + "log" + "os" + "path/filepath" + "strings" + + "github.com/libp2p/go-libp2p/core/crypto" + "source.quilibrium.com/quilibrium/monorepo/config" +) + +func main() { + configDir := flag.String("config", ".config", "directory to save configuration") + proverKey := flag.String("prover-key", "", "hex-encoded proving key (optional, will generate one if empty)") + flag.Parse() + + // Robustness: if run from utils/config-gen, warn the user. + cwd, _ := os.Getwd() + if filepath.Base(cwd) == "config-gen" { + fmt.Println("WARNING: Running from utils/config-gen. It is RECOMMENDED to run this from the project root.") + fmt.Println("Example: go run utils/config-gen/main.go --config .config") + } + + // Ensure the directory exists + if err := os.MkdirAll(*configDir, 0700); err != nil { + log.Fatalf("failed to create config directory: %v", err) + } + + pk := *proverKey + if pk == "" { + fmt.Println("No proving key provided, generating a random Ed448 key...") + privkey, _, err := crypto.GenerateEd448Key(rand.Reader) + if err != nil { + log.Fatalf("failed to generate proving key: %v", err) + } + + rawKey, err := privkey.Raw() + if err != nil { + log.Fatalf("failed to get raw proving key: %v", err) + } + pk = hex.EncodeToString(rawKey) + fmt.Printf("Generated Proving Key: %s\n", pk) + fmt.Println("IMPORTANT: Save this key in a secure location!") + } + + // config.LoadConfig will generate defaults if config.yml doesn't exist. + // We pass skipGenesisCheck=true because we don't want to download the + // genesis file just for generating a local config and keys. + _, err := config.LoadConfig(*configDir, pk, true) + if err != nil { + log.Fatalf("failed to generate config: %v", err) + } + + // Path Stabilization: Load the generated config and clean up any relative paths + // that might have been created if run from a subdirectory. + confPath := filepath.Join(*configDir, "config.yml") + cfg, err := config.NewConfig(confPath) + if err != nil { + log.Fatalf("failed to load generated config for stabilization: %v", err) + } + + stabilized := false + cleanPath := func(p string) string { + if strings.HasPrefix(p, "../../") { + stabilized = true + return strings.TrimPrefix(p, "../../") + } + return p + } + + if cfg.DB != nil { + cfg.DB.Path = cleanPath(cfg.DB.Path) + cfg.DB.WorkerPathPrefix = cleanPath(cfg.DB.WorkerPathPrefix) + } + if cfg.Key != nil && cfg.Key.KeyStoreFile != nil { + cfg.Key.KeyStoreFile.Path = cleanPath(cfg.Key.KeyStoreFile.Path) + } + + // Protocol Stabilization: Ensure listenMultiaddr is UDP/QUIC-v1 for Docker compatibility. + // We want to avoid TCP 8336 if it was accidentally defaulted. + if cfg.P2P != nil { + if cfg.P2P.ListenMultiaddr == "/ip4/0.0.0.0/tcp/8336" || cfg.P2P.ListenMultiaddr == "" { + fmt.Println("Stabilizing P2P protocol to UDP/QUIC-v1...") + cfg.P2P.ListenMultiaddr = "/ip4/0.0.0.0/udp/8336/quic-v1" + stabilized = true + } + } + + if stabilized { + fmt.Println("Saving stabilized configuration to config.yml...") + if err := config.SaveConfig(*configDir, cfg); err != nil { + log.Fatalf("failed to save stabilized config: %v", err) + } + } + + fmt.Println("Configuration and keys generated successfully.") +} From b556e7aee3380748f0becf644202e22380ed8833 Mon Sep 17 00:00:00 2001 From: Hamza Hamud <53880692+hhamud@users.noreply.github.com> Date: Wed, 24 Dec 2025 19:44:33 +0000 Subject: [PATCH 2/8] docs: add comprehensive docker guide and update readme --- DOCKER-README.md | 3 ++ DOCKER_GUIDE.md | 113 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 116 insertions(+) create mode 100644 DOCKER_GUIDE.md diff --git a/DOCKER-README.md b/DOCKER-README.md index 457ff76..ed7a9a6 100644 --- a/DOCKER-README.md +++ b/DOCKER-README.md @@ -1,5 +1,8 @@ # Quilibrium Docker Instructions +> [!TIP] +> For a comprehensive guide on building from source and deployment, see [DOCKER_GUIDE.md](DOCKER_GUIDE.md). + ## Build The only requirements are `git` (to checkout the repository) and docker (to build the image). diff --git a/DOCKER_GUIDE.md b/DOCKER_GUIDE.md new file mode 100644 index 0000000..074c1ac --- /dev/null +++ b/DOCKER_GUIDE.md @@ -0,0 +1,113 @@ +# Quilibrium Node: Build from Source & Deployment Guide + +This guide covers the end-to-end process of building a Quilibrium (Q-Node) from source using Docker and optimizing it for hosting environments. + +## 1. System Preparation + +Before building, optimize the host network stack. Quilibrium relies on the QUIC protocol (UDP), which requires larger buffer sizes than the Linux default to prevent packet loss. + +### Increase UDP Buffer Sizes +Run these commands on your server: + +```bash +sudo sysctl -w net.core.rmem_max=7500000 +sudo sysctl -w net.core.wmem_max=7500000 +``` + +To make these changes permanent, add them to `/etc/sysctl.conf`. + +### Configure Firewall (UFW) +Open the ports required for P2P, streaming, and worker communication: + +```bash +sudo ufw allow 22/tcp +sudo ufw allow 443/tcp +sudo ufw allow 8336:8338/udp +sudo ufw allow 8340/udp +sudo ufw allow 50000:50010/tcp +sudo ufw allow 50000:50010/udp +sudo ufw reload +``` + +## 2. Configuration Generation + +Quilibrium nodes require a valid configuration and cryptographic keys to participate in the network. For containerized deployments, it is recommended to generate these separately from the main node execution. + +### Why Separate Config Generation? +1. **Security**: Sensitive key generation is handled explicitly as a separate step. +2. **Immutability**: Pre-generated configurations can be mounted as read-only volumes, following container best practices. +3. **Stability**: Ensures consistent network settings (like UDP/QUIC-v1) before the node starts. + +### Generating Config +You can use the `config-gen` utility included in the Docker image or build it from source. + +**Using Docker:** +```bash +docker run --rm -v $(pwd)/.config:/root/.config quilibrium --target node-only config-gen --config /root/.config +``` + +## 3. Build from Source + +Using `DOCKER_BUILDKIT`, we can build a highly optimized, slim image specifically for the node. + +### The Build Command +Navigate to your monorepo directory and execute: + +```bash +DOCKER_BUILDKIT=1 docker build \ + --target node-only \ + -f Dockerfile.source \ + --build-arg GIT_COMMIT=$(git log -1 --format=%h) \ + -t quilibrium \ + -t quilibrium:$(git describe --tags --abbrev=0 2>/dev/null || echo "latest") . +``` + +### Why these flags? +- `--target node-only`: Excludes unnecessary build tools from the final image. +- `--build-arg GIT_COMMIT`: Embeds the specific version hash into the binary for network identification. +- `-t quilibrium:tag`: Tags the image with a specific version for easy management and rollbacks. + +## 4. Deployment + +For servers with dedicated public IPs, **Host Networking** is the recommended deployment method. It eliminates Docker NAT overhead and ensures the node is easily reachable by peers. + +### Run the Container +```bash +docker run -d --name q-node \ + --network host \ + --restart unless-stopped \ + -v $(pwd)/.config:/root/.config \ + quilibrium -signature-check=false +``` + +## 5. Managing the Container + +| Action | Command | +| --- | --- | +| **Stop** | `docker stop q-node` | +| **Start** | `docker start q-node` | +| **Restart** | `docker restart q-node` | +| **Status** | `docker ps --filter "name=q-node"` | +| **Logs** | `docker logs -f q-node` | + +## 6. Verification + +### Check Connectivity +Wait 5–10 minutes for the node to initialize workers and sync. Look for the "Reachable" status: +```bash +docker logs -f q-node | grep "reachable" +``` + +### Monitor Performance +Check how much data your node is processing: +```bash +docker stats q-node +``` + +## 7. Troubleshooting + +| Error | Meaning | Solution | +| --- | --- | --- | +| `connection refused ... :60000` | Master cannot talk to Workers. | Use `--network host`. | +| `YOUR NODE IS NOT REACHABLE` | External peers can't find you. | Ensure Ports 8336-8340 (UDP) are open. | +| `failed to increase buffer size` | UDP throttling. | Re-run the `sysctl` commands in Step 1. | From bf5a96ce1375930741a793c73791a0649531cc74 Mon Sep 17 00:00:00 2001 From: Hamza Hamud <53880692+hhamud@users.noreply.github.com> Date: Wed, 24 Dec 2025 20:20:00 +0000 Subject: [PATCH 3/8] docs: refine docker guide config generation command --- DOCKER_GUIDE.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/DOCKER_GUIDE.md b/DOCKER_GUIDE.md index 074c1ac..1554028 100644 --- a/DOCKER_GUIDE.md +++ b/DOCKER_GUIDE.md @@ -33,17 +33,20 @@ sudo ufw reload Quilibrium nodes require a valid configuration and cryptographic keys to participate in the network. For containerized deployments, it is recommended to generate these separately from the main node execution. -### Why Separate Config Generation? -1. **Security**: Sensitive key generation is handled explicitly as a separate step. -2. **Immutability**: Pre-generated configurations can be mounted as read-only volumes, following container best practices. -3. **Stability**: Ensures consistent network settings (like UDP/QUIC-v1) before the node starts. - ### Generating Config You can use the `config-gen` utility included in the Docker image or build it from source. +**Using Go (from repo root):** +```bash +go run ./utils/config-gen --config $(pwd)/.config +``` + **Using Docker:** ```bash -docker run --rm -v $(pwd)/.config:/root/.config quilibrium --target node-only config-gen --config /root/.config +docker run --rm -it \ + --entrypoint config-gen \ + -v $(pwd)/.config:/root/.config \ + quilibrium --config /root/.config ``` ## 3. Build from Source From 1d978cf2118552bfb930de4f9f2277b301e3f1f9 Mon Sep 17 00:00:00 2001 From: Hamza Hamud <53880692+hhamud@users.noreply.github.com> Date: Wed, 24 Dec 2025 20:24:19 +0000 Subject: [PATCH 4/8] feat: automate docker build and deploy workflows via Taskfile --- DOCKER_GUIDE.md | 38 ++++++++++++++++++++------------------ Dockerfile.source | 4 ++++ Taskfile.yaml | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+), 18 deletions(-) diff --git a/DOCKER_GUIDE.md b/DOCKER_GUIDE.md index 1554028..2f11971 100644 --- a/DOCKER_GUIDE.md +++ b/DOCKER_GUIDE.md @@ -34,53 +34,55 @@ sudo ufw reload Quilibrium nodes require a valid configuration and cryptographic keys to participate in the network. For containerized deployments, it is recommended to generate these separately from the main node execution. ### Generating Config -You can use the `config-gen` utility included in the Docker image or build it from source. +You can use the `config-gen` utility included -**Using Go (from repo root):** +**Using Task (Recommended):** ```bash -go run ./utils/config-gen --config $(pwd)/.config +task config:gen ``` -**Using Docker:** +You can override the directory using `CONFIG_DIR`: ```bash -docker run --rm -it \ - --entrypoint config-gen \ - -v $(pwd)/.config:/root/.config \ - quilibrium --config /root/.config +task config:gen CONFIG_DIR=/path/to/config ``` ## 3. Build from Source -Using `DOCKER_BUILDKIT`, we can build a highly optimized, slim image specifically for the node. - -### The Build Command Navigate to your monorepo directory and execute: +**Using Task:** +```bash +task build:node:source +``` + +**Using Docker directly:** ```bash DOCKER_BUILDKIT=1 docker build \ --target node-only \ -f Dockerfile.source \ --build-arg GIT_COMMIT=$(git log -1 --format=%h) \ - -t quilibrium \ - -t quilibrium:$(git describe --tags --abbrev=0 2>/dev/null || echo "latest") . + -t quilibrium:node-only . ``` -### Why these flags? -- `--target node-only`: Excludes unnecessary build tools from the final image. -- `--build-arg GIT_COMMIT`: Embeds the specific version hash into the binary for network identification. -- `-t quilibrium:tag`: Tags the image with a specific version for easy management and rollbacks. ## 4. Deployment For servers with dedicated public IPs, **Host Networking** is the recommended deployment method. It eliminates Docker NAT overhead and ensures the node is easily reachable by peers. ### Run the Container + +**Using Task:** +```bash +task deploy:node +``` + +**Using Docker directly:** ```bash docker run -d --name q-node \ --network host \ --restart unless-stopped \ -v $(pwd)/.config:/root/.config \ - quilibrium -signature-check=false + quilibrium:node-only -signature-check=false ``` ## 5. Managing the Container diff --git a/Dockerfile.source b/Dockerfile.source index 459da3b..229b994 100644 --- a/Dockerfile.source +++ b/Dockerfile.source @@ -260,6 +260,9 @@ RUN apt-get update && apt-get install -y \ libmpfr6 \ && rm -rf /var/lib/apt/lists/* +ENV QUILIBRIUM_SIGNATURE_CHECK=true +ENV GOEXPERIMENT=arenas + COPY --from=build-node /usr/bin/node /usr/local/bin/node WORKDIR /root ENTRYPOINT ["node"] @@ -295,6 +298,7 @@ ARG GIT_BRANCH ARG GIT_COMMIT ENV GOEXPERIMENT=arenas +ENV QUILIBRIUM_SIGNATURE_CHECK=false LABEL org.opencontainers.image.title="Quilibrium Network Node" LABEL org.opencontainers.image.description="Quilibrium is a decentralized alternative to platform as a service providers." diff --git a/Taskfile.yaml b/Taskfile.yaml index aab32bd..b8a3058 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -168,3 +168,35 @@ tasks: desc: Test the Quilibrium docker image. cmds: - client/test/run_tests.sh -d 'ubuntu' -v '24.04' + + config:gen: + desc: Generate configuration and keys using Go. + cmds: + - go run ./utils/config-gen --config {{.CONFIG_DIR | default ".config"}} + + + build:node:source: + desc: Build the optimized Quilibrium node-only docker image. + cmds: + - | + docker build \ + --target node-only \ + -f Dockerfile.source \ + --build-arg NODE_VERSION={{.VERSION}} \ + --build-arg GIT_REPO={{.GIT_REPO}} \ + --build-arg GIT_BRANCH={{.GIT_BRANCH}} \ + --build-arg GIT_COMMIT={{.GIT_COMMIT}} \ + -t ${QUILIBRIUM_IMAGE_NAME:-quilibrium}:{{.VERSION}}-node-only \ + -t ${QUILIBRIUM_IMAGE_NAME:-quilibrium}:node-only \ + . + + deploy:node: + desc: Run the Quilibrium node using host networking and external config. + cmds: + - | + docker run -d --name q-node \ + --network host \ + --restart unless-stopped \ + -v {{.CONFIG_DIR | default "$(pwd)/.config"}}:/root/.config \ + ${QUILIBRIUM_IMAGE_NAME:-quilibrium}:node-only \ + -signature-check=false From 6f5f8109ab3fad54ca1f1993b01f1d841be8c106 Mon Sep 17 00:00:00 2001 From: Hamza Hamud <53880692+hhamud@users.noreply.github.com> Date: Thu, 25 Dec 2025 15:56:20 +0000 Subject: [PATCH 5/8] chore: consolidate docker files and refine documentation - Move all Docker-related files to docker/ directory - Consolidate DOCKER-README.md and DOCKER_GUIDE.md into docker/README.md - Update docker/Taskfile.yaml with refined paths and new tasks - Update root Taskfile.yaml to preserve only native build tasks - Update docker-compose.yml to map config to root .config/ - Expand docker/README.md with comprehensive guides and troubleshooting --- DOCKER-README.md | 56 --- DOCKER_GUIDE.md | 118 ------ Taskfile.yaml | 145 ------- .dockerignore => docker/.dockerignore | 0 docker/.env.example | 4 + .../Dockerfile.conntest.source | 0 .../Dockerfile.release | 0 Dockerfile.source => docker/Dockerfile.source | 0 .../Dockerfile.source.dockerignore | 0 .../Dockerfile.sourceavx512 | 0 .../Dockerfile.vdf.source | 0 .../Dockerfile.vdf.sourceavx512 | 0 .../Dockerfile.vdf.sourcezen3 | 0 .../Dockerfile.vdf.sourcezen4 | 0 docker/README.md | 362 ++++++++++++------ docker/Taskfile.yaml | 216 ++++++++++- docker/docker-compose.yml | 6 +- 17 files changed, 456 insertions(+), 451 deletions(-) delete mode 100644 DOCKER-README.md delete mode 100644 DOCKER_GUIDE.md rename .dockerignore => docker/.dockerignore (100%) rename Dockerfile.conntest.source => docker/Dockerfile.conntest.source (100%) rename Dockerfile.release => docker/Dockerfile.release (100%) rename Dockerfile.source => docker/Dockerfile.source (100%) rename Dockerfile.source.dockerignore => docker/Dockerfile.source.dockerignore (100%) rename Dockerfile.sourceavx512 => docker/Dockerfile.sourceavx512 (100%) rename Dockerfile.vdf.source => docker/Dockerfile.vdf.source (100%) rename Dockerfile.vdf.sourceavx512 => docker/Dockerfile.vdf.sourceavx512 (100%) rename Dockerfile.vdf.sourcezen3 => docker/Dockerfile.vdf.sourcezen3 (100%) rename Dockerfile.vdf.sourcezen4 => docker/Dockerfile.vdf.sourcezen4 (100%) diff --git a/DOCKER-README.md b/DOCKER-README.md deleted file mode 100644 index ed7a9a6..0000000 --- a/DOCKER-README.md +++ /dev/null @@ -1,56 +0,0 @@ -# Quilibrium Docker Instructions - -> [!TIP] -> For a comprehensive guide on building from source and deployment, see [DOCKER_GUIDE.md](DOCKER_GUIDE.md). - -## Build - -The only requirements are `git` (to checkout the repository) and docker (to build the image). -Golang does not have to be installed, the docker image build process uses a build stage that provides the -correct Go environment and compiles the node down to one command. - -In the repository root folder, where the [Dockerfile.source](Dockerfile.source) file is, build the docker image: -```shell -docker build -f Dockerfile.source --build-arg GIT_COMMIT=$(git log -1 --format=%h) -t quilibrium -t quilibrium:1.4.16 . -``` - -Use latest version instead of `1.4.16`. - -The image that is built is light and safe. It is based on Alpine Linux with the Quilibrium node binary, no -source code, nor the Go development environment. The image also has the `grpcurl` tool that can be used to -query the gRPC interface. - -### Task - -You can also use the [Task](https://taskfile.dev/) tool, it is a simple build tool that takes care of extracting -parameters and building the image. The tasks are all defined in [Taskfile.yaml](Taskfile.yaml). - -You can optionally create an `.env` file, in the same repository root folder to override specific parameters. Right now -only one optional env var is supported and that is `QUILIBRIUM_IMAGE_NAME`, if you want to change the default -image name from `quilibrium` to something else. If you are pushing your images to GitHub then you have to follow the -GitHub naming convention and use a name like `ghcr.io/mscurtescu/ceremonyclient`. - -Bellow there are example interactions with `Task`. - -The node version is extracted from [node/main.go](node/main.go). This version string is used to tag the image. The git -repo, branch and commit are read through the `git` command and depend on the current state of your working -directory (on what branch and at what commit you are). These last three values are used to label the image. - -List tasks: -```shell -task -l -``` - -Show what parameters, like image name, version etc, will be used: -```shell -task status -``` - -Build the image (aka run the `build` task): -```shell -task build -``` - -## Run - -In order to run a Quilibrium node using the docker image follow the instructions in the [docker](docker) subfolder. diff --git a/DOCKER_GUIDE.md b/DOCKER_GUIDE.md deleted file mode 100644 index 2f11971..0000000 --- a/DOCKER_GUIDE.md +++ /dev/null @@ -1,118 +0,0 @@ -# Quilibrium Node: Build from Source & Deployment Guide - -This guide covers the end-to-end process of building a Quilibrium (Q-Node) from source using Docker and optimizing it for hosting environments. - -## 1. System Preparation - -Before building, optimize the host network stack. Quilibrium relies on the QUIC protocol (UDP), which requires larger buffer sizes than the Linux default to prevent packet loss. - -### Increase UDP Buffer Sizes -Run these commands on your server: - -```bash -sudo sysctl -w net.core.rmem_max=7500000 -sudo sysctl -w net.core.wmem_max=7500000 -``` - -To make these changes permanent, add them to `/etc/sysctl.conf`. - -### Configure Firewall (UFW) -Open the ports required for P2P, streaming, and worker communication: - -```bash -sudo ufw allow 22/tcp -sudo ufw allow 443/tcp -sudo ufw allow 8336:8338/udp -sudo ufw allow 8340/udp -sudo ufw allow 50000:50010/tcp -sudo ufw allow 50000:50010/udp -sudo ufw reload -``` - -## 2. Configuration Generation - -Quilibrium nodes require a valid configuration and cryptographic keys to participate in the network. For containerized deployments, it is recommended to generate these separately from the main node execution. - -### Generating Config -You can use the `config-gen` utility included - -**Using Task (Recommended):** -```bash -task config:gen -``` - -You can override the directory using `CONFIG_DIR`: -```bash -task config:gen CONFIG_DIR=/path/to/config -``` - -## 3. Build from Source - -Navigate to your monorepo directory and execute: - -**Using Task:** -```bash -task build:node:source -``` - -**Using Docker directly:** -```bash -DOCKER_BUILDKIT=1 docker build \ - --target node-only \ - -f Dockerfile.source \ - --build-arg GIT_COMMIT=$(git log -1 --format=%h) \ - -t quilibrium:node-only . -``` - - -## 4. Deployment - -For servers with dedicated public IPs, **Host Networking** is the recommended deployment method. It eliminates Docker NAT overhead and ensures the node is easily reachable by peers. - -### Run the Container - -**Using Task:** -```bash -task deploy:node -``` - -**Using Docker directly:** -```bash -docker run -d --name q-node \ - --network host \ - --restart unless-stopped \ - -v $(pwd)/.config:/root/.config \ - quilibrium:node-only -signature-check=false -``` - -## 5. Managing the Container - -| Action | Command | -| --- | --- | -| **Stop** | `docker stop q-node` | -| **Start** | `docker start q-node` | -| **Restart** | `docker restart q-node` | -| **Status** | `docker ps --filter "name=q-node"` | -| **Logs** | `docker logs -f q-node` | - -## 6. Verification - -### Check Connectivity -Wait 5–10 minutes for the node to initialize workers and sync. Look for the "Reachable" status: -```bash -docker logs -f q-node | grep "reachable" -``` - -### Monitor Performance -Check how much data your node is processing: -```bash -docker stats q-node -``` - -## 7. Troubleshooting - -| Error | Meaning | Solution | -| --- | --- | --- | -| `connection refused ... :60000` | Master cannot talk to Workers. | Use `--network host`. | -| `YOUR NODE IS NOT REACHABLE` | External peers can't find you. | Ensure Ports 8336-8340 (UDP) are open. | -| `failed to increase buffer size` | UDP throttling. | Re-run the `sysctl` commands in Step 1. | diff --git a/Taskfile.yaml b/Taskfile.yaml index b8a3058..bf95704 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -5,9 +5,6 @@ version: '3' dotenv: - '.env' -env: - DOCKER_BUILDKIT: '1' - vars: VERSION: sh: cat config/version.go | grep -A 1 "func GetVersion() \[\]byte {" | grep -Eo '0x[0-9a-fA-F]+' | xargs printf "%d.%d.%d" @@ -23,7 +20,6 @@ tasks: status: desc: Display configuration info. cmds: - - echo -n "Image name:" && echo " ${QUILIBRIUM_IMAGE_NAME:-quilibrium}" - echo -n "Version :" && echo " {{.VERSION}}" - echo -n "Repo :" && echo " {{.GIT_REPO}}" - echo -n "Branch :" && echo " {{.GIT_BRANCH}}" @@ -55,148 +51,7 @@ tasks: - rpm/generate.sh - client/build.sh -o build/arm64_macos/qclient - build_node_arm64_linux: - desc: Build the Quilibrium node binary for ARM64 Linux. Outputs to node/build. - cmds: - - docker build --platform linux/arm64 -f Dockerfile.source --output node/build/arm64_linux --target=node . - - build_qclient_arm64_linux: - desc: Build the QClient node binary for ARM64 Linux. Outputs to client/build. - cmds: - - docker build --platform linux/arm64 -f Dockerfile.source --output client/build/arm64_linux --target=qclient . - - build_node_amd64_linux: - desc: Build the Quilibrium node binary for AMD64 Linux. Outputs to node/build. - cmds: - - docker build --platform linux/amd64 -f Dockerfile.source --output node/build/amd64_linux --target=node . - - build_conntest_amd64_linux: - desc: Build the Quilibrium node connection test binary for AMD64 Linux. Outputs to conntest/build. - cmds: - - docker build --platform linux/amd64 -f Dockerfile.conntest.source --output conntest/build/amd64_linux --target=conntest . - - build_node_amd64_avx512_linux: - desc: Build the Quilibrium node binary for AMD64 Linux with AVX-512 extensions. Outputs to node/build. - cmds: - - docker build --platform linux/amd64 -f Dockerfile.sourceavx512 --output node/build/amd64_avx512_linux --target=node . - - build_qclient_amd64_linux: - desc: Build the QClient node binary for AMD64 Linux. Outputs to client/build. - cmds: - - docker build --platform linux/amd64 -f Dockerfile.source --output client/build/amd64_linux --target=qclient . - - build_qclient_amd64_avx512_linux: - desc: Build the QClient node binary for AMD64 Linux with AVX-512 extensions. Outputs to client/build. - cmds: - - docker build --platform linux/amd64 -f Dockerfile.sourceavx512 --output client/build/amd64_avx512_linux --target=qclient . - - build_vdf_perf_analysis_amd64_linux: - cmds: - - docker build --platform linux/amd64 -f Dockerfile.vdf.source --output vdf/build/amd64_linux --target=vdf --progress=plain --no-cache . - - build_vdf_perf_analysis_amd64_avx512_linux: - cmds: - - docker build --platform linux/amd64 -f Dockerfile.vdf.sourceavx512 --output vdf/build/amd64_avx512_linux --target=vdf-avx512 . - - build_vdf_perf_analysis_amd64_zen3_linux: - cmds: - - docker build --platform linux/amd64 -f Dockerfile.vdf.sourcezen3 --output vdf/build/amd64_zen3_linux --target=vdf-zen3 --progress=plain --no-cache . - - build_vdf_perf_analysis_amd64_zen4_linux: - cmds: - - docker build --platform linux/amd64 -f Dockerfile.vdf.sourcezen4 --output vdf/build/amd64_zen4_linux --target=vdf-zen4 --progress=plain --no-cache . - - build_vdf_perf_analysis_arm64_linux: - cmds: - - docker build --platform linux/arm64 -f Dockerfile.vdf.source --output vdf/build/arm64_linux --target=vdf --progress=plain --no-cache . - - build:source: - desc: Build the Quilibrium docker image from source. - cmds: - - | - docker build \ - -f Dockerfile.source \ - --build-arg NODE_VERSION={{.VERSION}} \ - --build-arg GIT_REPO={{.GIT_REPO}} \ - --build-arg GIT_BRANCH={{.GIT_BRANCH}} \ - --build-arg GIT_COMMIT={{.GIT_COMMIT}} \ - -t ${QUILIBRIUM_IMAGE_NAME:-quilibrium}:{{.VERSION}}-source \ - -t ${QUILIBRIUM_IMAGE_NAME:-quilibrium}:source \ - . - status: - - | - docker image inspect \ - ${QUILIBRIUM_IMAGE_NAME:-quilibrium}:{{.VERSION}}-source \ - >/dev/null 2>/dev/null - - build:release: - desc: Build the Quilibrium docker image from release binaries. - aliases: - - build - cmds: - - | - docker build \ - -f Dockerfile.release \ - --build-arg NODE_VERSION={{.VERSION}} \ - --build-arg GIT_REPO={{.GIT_REPO}} \ - --build-arg GIT_BRANCH={{.GIT_BRANCH}} \ - --build-arg GIT_COMMIT={{.GIT_COMMIT}} \ - --build-arg MAX_KEY_ID={{.MAX_KEY_ID}} \ - -t ${QUILIBRIUM_IMAGE_NAME:-quilibrium}:{{.VERSION}}-release \ - -t ${QUILIBRIUM_IMAGE_NAME:-quilibrium}:release \ - . - status: - - | - docker image inspect \ - ${QUILIBRIUM_IMAGE_NAME:-quilibrium}:{{.VERSION}}-release \ - >/dev/null 2>/dev/null - - docker:login: - desc: Login to Docker hub - aliases: - - login - cmds: - - echo $DOCKER_TOKEN | docker login -u $DOCKER_USERNAME --password-stdin - - push: - desc: Push Quilibrium docker image to the container registry. - cmds: - - docker push ${QUILIBRIUM_IMAGE_NAME:-quilibrium}:{{.VERSION}} - - docker push ${QUILIBRIUM_IMAGE_NAME:-quilibrium}:latest - - test:qclient: - desc: Test the Quilibrium docker image. - cmds: - - client/test/run_tests.sh -d 'ubuntu' -v '24.04' - config:gen: desc: Generate configuration and keys using Go. cmds: - go run ./utils/config-gen --config {{.CONFIG_DIR | default ".config"}} - - - build:node:source: - desc: Build the optimized Quilibrium node-only docker image. - cmds: - - | - docker build \ - --target node-only \ - -f Dockerfile.source \ - --build-arg NODE_VERSION={{.VERSION}} \ - --build-arg GIT_REPO={{.GIT_REPO}} \ - --build-arg GIT_BRANCH={{.GIT_BRANCH}} \ - --build-arg GIT_COMMIT={{.GIT_COMMIT}} \ - -t ${QUILIBRIUM_IMAGE_NAME:-quilibrium}:{{.VERSION}}-node-only \ - -t ${QUILIBRIUM_IMAGE_NAME:-quilibrium}:node-only \ - . - - deploy:node: - desc: Run the Quilibrium node using host networking and external config. - cmds: - - | - docker run -d --name q-node \ - --network host \ - --restart unless-stopped \ - -v {{.CONFIG_DIR | default "$(pwd)/.config"}}:/root/.config \ - ${QUILIBRIUM_IMAGE_NAME:-quilibrium}:node-only \ - -signature-check=false diff --git a/.dockerignore b/docker/.dockerignore similarity index 100% rename from .dockerignore rename to docker/.dockerignore diff --git a/docker/.env.example b/docker/.env.example index f7337ca..3eb91b7 100644 --- a/docker/.env.example +++ b/docker/.env.example @@ -16,3 +16,7 @@ QUILIBRIUM_REST_PORT= # The public DNS name or IP address for this Quilibrium node. NODE_PUBLIC_NAME= + +# Use a custom configuration directory. +# Default: ../.config (monorepo root) +QUILIBRIUM_CONFIG_DIR= diff --git a/Dockerfile.conntest.source b/docker/Dockerfile.conntest.source similarity index 100% rename from Dockerfile.conntest.source rename to docker/Dockerfile.conntest.source diff --git a/Dockerfile.release b/docker/Dockerfile.release similarity index 100% rename from Dockerfile.release rename to docker/Dockerfile.release diff --git a/Dockerfile.source b/docker/Dockerfile.source similarity index 100% rename from Dockerfile.source rename to docker/Dockerfile.source diff --git a/Dockerfile.source.dockerignore b/docker/Dockerfile.source.dockerignore similarity index 100% rename from Dockerfile.source.dockerignore rename to docker/Dockerfile.source.dockerignore diff --git a/Dockerfile.sourceavx512 b/docker/Dockerfile.sourceavx512 similarity index 100% rename from Dockerfile.sourceavx512 rename to docker/Dockerfile.sourceavx512 diff --git a/Dockerfile.vdf.source b/docker/Dockerfile.vdf.source similarity index 100% rename from Dockerfile.vdf.source rename to docker/Dockerfile.vdf.source diff --git a/Dockerfile.vdf.sourceavx512 b/docker/Dockerfile.vdf.sourceavx512 similarity index 100% rename from Dockerfile.vdf.sourceavx512 rename to docker/Dockerfile.vdf.sourceavx512 diff --git a/Dockerfile.vdf.sourcezen3 b/docker/Dockerfile.vdf.sourcezen3 similarity index 100% rename from Dockerfile.vdf.sourcezen3 rename to docker/Dockerfile.vdf.sourcezen3 diff --git a/Dockerfile.vdf.sourcezen4 b/docker/Dockerfile.vdf.sourcezen4 similarity index 100% rename from Dockerfile.vdf.sourcezen4 rename to docker/Dockerfile.vdf.sourcezen4 diff --git a/docker/README.md b/docker/README.md index fa83b85..d0a9532 100644 --- a/docker/README.md +++ b/docker/README.md @@ -1,165 +1,293 @@ -# Quilibrium Docker Instructions +# Quilibrium Docker Guide -## Install Docker on a Server +This folder contains all the necessary files to build and run Quilibrium nodes using Docker. -> [!IMPORTANT] -> You have to install Docker Engine on your server, you don't want to install Docker Desktop. +## Prerequisites -The official Linux installation instructions start here: -https://docs.docker.com/engine/install/ +### Required Tools +- **Docker** (v20.10+) with BuildKit support +- **Docker Compose** (v2.0+) +- **Task** (optional but recommended) - [taskfile.dev](https://taskfile.dev) -For Ubuntu you can start here: -https://docs.docker.com/engine/install/ubuntu/ +### Install Task +```bash +# macOS +brew install go-task -While there are several installation methods, you really want to use the apt repository, this way you get -automatic updates. +# Linux (script) +sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin -Make sure you also follow the Linux post-installation steps: -https://docs.docker.com/engine/install/linux-postinstall/ +# Or via Go +go install github.com/go-task/task/v3/cmd/task@latest +``` -## Install Docker on a Desktop +### Docker Version Check +```bash +docker --version # Should be 20.10+ +docker compose version # Should be v2.0+ +``` -For a Linux desktop follow the server installation steps above, do not install Docker Desktop for Linux unless -you know what you are doing. +## 1. System Preparation -For Mac and Windows follow the corresponding Docker Desktop installation links from the top of: -https://docs.docker.com/engine/install/ +Before building or running, optimize the host network stack. Quilibrium relies on the QUIC protocol (UDP), which requires larger buffer sizes than the Linux default. -## Running a Node +### Increase UDP Buffer Sizes +```bash +sudo sysctl -w net.core.rmem_max=7500000 +sudo sysctl -w net.core.wmem_max=7500000 +``` +To make these changes permanent, add them to `/etc/sysctl.conf`. -Copy [docker-compose.yml](docker-compose.yml) to a new folder on a server. The official -Docker image provided by Quilibrium Network will be pulled. +### Configure Firewall (UFW) +Open the ports required for P2P, gRPC, REST, and worker communication: -A `.config/` subfolder will be created in this folder, this will hold both configuration -and the node storage. +```bash +sudo ufw allow 22/tcp +sudo ufw allow 443/tcp +sudo ufw allow 8336:8338/udp +sudo ufw allow 8340/udp +sudo ufw allow 50000:50010/tcp +sudo ufw allow 50000:50010/udp +sudo ufw reload +``` -Optionally you can also copy [Taskfile.yaml](Taskfile.yaml) and [.env.example](.env.example) to the -server, if you are planning to use them. See below. +## 2. File Structure -### New Instance +| File | Purpose | +| --- | --- | +| `Dockerfile.source` | Main multi-stage build for node + qclient | +| `Dockerfile.sourceavx512` | Optimized build with AVX-512 instructions | +| `Dockerfile.release` | Build from pre-compiled release binaries | +| `Dockerfile.conntest.source` | Connection test utility build | +| `Dockerfile.vdf.*` | VDF performance analysis builds (various CPU optimizations) | +| `docker-compose.yml` | Container orchestration config | +| `Taskfile.yaml` | Task automation commands | +| `.env.example` | Environment variable template | +| `rustup-init.sh` | Rust installer for build stages | -If you are starting a brand new node then simply run Quilibrium in a container with: -```shell +## 3. Dockerfile Variants + +### Production Dockerfiles + +| Dockerfile | Use Case | Target Stages | +| --- | --- | --- | +| `Dockerfile.source` | Standard build from source | `node-only`, `node`, `qclient`, `final` | +| `Dockerfile.sourceavx512` | AVX-512 optimized (Intel Xeon, AMD Zen4+) | Same as above | +| `Dockerfile.release` | Build from release binaries (faster) | Single stage | + +### Specialized Dockerfiles + +| Dockerfile | Use Case | +| --- | --- | +| `Dockerfile.conntest.source` | Network connectivity testing | +| `Dockerfile.vdf.source` | VDF performance benchmarking | +| `Dockerfile.vdf.sourceavx512` | VDF with AVX-512 optimizations | +| `Dockerfile.vdf.sourcezen3` | VDF optimized for AMD Zen3 | +| `Dockerfile.vdf.sourcezen4` | VDF optimized for AMD Zen4 | + +## 4. Build Targets & Cross-Compilation + +### Available Build Tasks + +| Task | Platform | Output | +| --- | --- | --- | +| `build_node_arm64_linux` | Linux ARM64 | `../node/build/arm64_linux/` | +| `build_node_amd64_linux` | Linux AMD64 | `../node/build/amd64_linux/` | +| `build_node_amd64_avx512_linux` | Linux AMD64 (AVX-512) | `../node/build/amd64_avx512_linux/` | +| `build_node_arm64_macos` | macOS ARM64 | `../node/build/arm64_macos/` | +| `build_qclient_arm64_linux` | Linux ARM64 | `../client/build/arm64_linux/` | +| `build_qclient_amd64_linux` | Linux AMD64 | `../client/build/amd64_linux/` | +| `build_qclient_amd64_avx512_linux` | Linux AMD64 (AVX-512) | `../client/build/amd64_avx512_linux/` | +| `build_qclient_arm64_macos` | macOS ARM64 | `../client/build/arm64_macos/` | + +### Cross-Compilation Examples + +**Build Linux ARM64 binary from any platform:** +```bash +task build_node_arm64_linux +``` + +**Build Linux AMD64 with AVX-512 optimizations:** +```bash +task build_node_amd64_avx512_linux +``` + +**Manual cross-compilation with Docker:** +```bash +# Build for ARM64 +docker build --platform linux/arm64 -f Dockerfile.source --output ../node/build/arm64_linux --target=node .. + +# Build for AMD64 +docker build --platform linux/amd64 -f Dockerfile.source --output ../node/build/amd64_linux --target=node .. +``` + +## 5. Docker Images + +### Build Images + +```bash +# Full image (node + qclient) +task build:source + +# Node-only optimized image +task build:node:source + +# From release binaries (faster) +task build:release +``` + +### Image Tags + +After building, images are tagged as: +- `quilibrium:2.1.0-source` / `quilibrium:source` +- `quilibrium:2.1.0-node-only` / `quilibrium:node-only` +- `quilibrium:2.1.0-release` / `quilibrium:release` + +## 6. Configuration + +### Configuration Directory +By default, the Docker configuration uses the `.config` directory at the **root of the repository** (`../.config`). This allows you to share configuration between native and containerized builds. + +### Generating Config +```bash +task config:gen +``` +This will generate the configuration in `../.config`. + +## 7. Running a Node + +### Quick Start (Docker Compose) +```bash +task up +``` +Or: +```bash docker compose up -d ``` -A `.config/` subfolder will be created under the current folder, this is mapped inside the container. +### Host Networking (Recommended for Servers) +For servers with dedicated public IPs, host networking eliminates Docker NAT overhead: + +```bash +task deploy:node +``` +Or: +```bash +docker run -d --name q-node \ + --network host \ + --restart unless-stopped \ + -v $(pwd)/../.config:/root/.config \ + quilibrium:node-only -signature-check=false +``` + +### New Instance +If you are starting a brand new node, a `.config/` folder will be created at the repository root. > [!IMPORTANT] -> Once the node is running (the `-node-info` command shows a balance) make sure you backup -> `config.yml` and `keys.yml`. +> Once the node is running (the `task node-info` command shows a balance), make sure you backup `config.yml` and `keys.yml`. ### Restore Previous Instance +1. Ensure your `config.yml` and `keys.yml` are in the `.config/` folder at the repository root. +2. Start the node: `task up` -If you have both `config.yml` and `keys.yml` backed up from a previous instance then follow these -steps to restore them: +## 8. gRPC & REST API Access -1. Create an empty `.config/` subfolder. -2. Copy `config.yml` and `keys.yml` to `.config/`. -3. Start the node with: - ```shell - docker compose up -d - ``` +The node exposes two APIs for programmatic access: -### Task +| API | Port | Protocol | Binding | +| --- | --- | --- | --- | +| **gRPC** | 8337 | TCP | `127.0.0.1` (localhost only) | +| **REST** | 8338 | TCP | `127.0.0.1` (localhost only) | -You can also use the [Task](https://taskfile.dev/) tool, it is a simple build tool that takes care of running -complex commands and intereacting with the container. The tasks are all defined in -[Taskfile.yaml](Taskfile.yaml). +### Using grpcurl +The container includes `grpcurl` for gRPC interaction: -You can optionally create an `.env` file, in the same folder to override specific parameters. Right now -only one optional env var is supported with `Task` and that is `QUILIBRIUM_IMAGE_NAME`, if you want to change the -default image name from `quilibrium` to something else. If you are pushing your images to GitHub, for example, then you -have to follow the GitHub naming convention and use a name like `ghcr.io/mscurtescu/ceremonyclient`. See the -[.env.example](.env.example) sample file, and keep in mind that `.env` is shared with -[docker-compose.yml](docker-compose.yml). +```bash +# List available services +docker compose exec node grpcurl -plaintext localhost:8337 list -Bellow there are example interactions with `Task`. +# Get node info +docker compose exec node grpcurl -plaintext localhost:8337 quilibrium.node.node.pb.NodeService/GetNodeInfo -Start the container through docker compose: -```shell -task up +# Get token balance +docker compose exec node grpcurl -plaintext localhost:8337 quilibrium.node.node.pb.NodeService/GetTokenInfo ``` -Show the logs through docker compose: -```shell -task logs +### Using qclient (inside container) +```bash +docker compose exec node qclient help +docker compose exec node qclient token balance +docker compose exec node qclient token info ``` -Drop into a shell inside the running container: -```shell -task shell -``` +### Exposing APIs Externally +By default, APIs are bound to localhost for security. To expose externally, modify `docker-compose.override.yml`: -Stop the running container(s): -```shell -task down -``` - -Backup the critical configuration: -```shell -task backup -``` - -The above command will create a `backup.tar.gz` archive in the current folder, you still have to copy this -file from the server into a safe location. The command adds the `config.yml` and `keys.yml` files from -the `.config/` subfolder to the archive, with the ownership of the current user. - - -## Customizing docker-compose.yml - -If you want to change certain parameters in [docker-compose.yml](docker-compose.yml) it is better not -to edit the file directly as new versions pushed through git would overwrite your changes. A more -flexible solution is to create another file called `docker-compose.override.yml` right next to it -and specifying the necessary overriding changes there. - -For example: ```yaml services: node: - image: ghcr.io/mscurtescu/ceremonyclient - restart: on-failure:7 + ports: + - '0.0.0.0:8337:8337/tcp' # gRPC (use with caution) + - '0.0.0.0:8338:8338/tcp' # REST (use with caution) ``` -The above will override the image name and also the restart policy. +> [!WARNING] +> Exposing gRPC/REST externally can be a security risk. Use a reverse proxy with authentication if needed. -You can optionally create an `.env` file, in the same folder to override specific parameters. See the -[.env.example](.env.example) sample file, and keep in mind that `.env` is shared with -[Taskfile.yaml](Taskfile.yaml). You can customize the image name and port mappings. +## 9. Management Commands -To check if your overrides are being picked up run the following command: -```shell -docker compose config +| Action | Task Command | Docker Command | +| --- | --- | --- | +| **Status** | `task status` | N/A | +| **Logs** | `task logs` | `docker compose logs -f` | +| **Stop** | `task down` | `docker compose down` | +| **Shell** | `task shell` | `docker compose exec -it node sh` | +| **Node Info** | `task node-info` | `docker compose exec node node -node-info` | +| **Backup** | `task backup` | N/A | +| **Restore** | `task restore` | N/A | +| **Update** | `task update` | Pull + restart | +| **Test Port** | `task test:port` | Requires `NODE_PUBLIC_NAME` | + +The `backup` task creates a `backup.tar.gz` archive in this `docker/` folder containing `config.yml` and `keys.yml` from `../.config`. Copy this file to a safe location. + +### Customizing Configuration +Create a `.env` file based on [.env.example](.env.example): + +| Variable | Default | Description | +| --- | --- | --- | +| `QUILIBRIUM_IMAGE_NAME` | `quilibrium` | Docker image name | +| `QUILIBRIUM_CONFIG_DIR` | `../.config` | Configuration directory | +| `QUILIBRIUM_P2P_PORT` | `8336` | P2P UDP port | +| `QUILIBRIUM_GRPC_PORT` | `8337` | gRPC TCP port | +| `QUILIBRIUM_REST_PORT` | `8338` | REST TCP port | +| `NODE_PUBLIC_NAME` | (none) | Public DNS/IP for port testing | + +## 10. Verification + +### Check Connectivity +Wait 5–10 minutes for the node to initialize. Look for the "Reachable" status: +```bash +docker logs -f q-node | grep "reachable" ``` -This will output the merged and canonical compose file that will be used to run the container(s). - - -## Interact with a running container - -Drop into a shell inside a running container: -```shell -docker compose exec -it node sh +### Test Port Visibility +```bash +NODE_PUBLIC_NAME=your.server.ip task test:port ``` -Watch the logs: -```shell -docker compose logs -f +### Monitor Performance +```bash +docker stats q-node ``` -Get the node related info (peer id, version, max frame and balance): -```shell -docker compose exec node node -node-info -``` +## 11. Troubleshooting -Run the DB console: -```shell -docker compose exec node node -db-console -``` - -Run the Quilibrium client: -```shell -docker compose exec node qclient help -docker compose exec node qclient token help -docker compose exec node qclient token balance -``` +| Issue | Solution | +| --- | --- | +| **Node Not Reachable** | Ensure ports 8336-8340 (UDP) are open in your firewall. | +| **Buffer Size Errors** | Re-run the `sysctl` commands in Step 1. | +| **Config Not Found** | Verify that `../.config` exists and contains your keys. | +| **Backup Fails** | Ensure `../.config/config.yml` and `../.config/keys.yml` exist. | +| **Connection Refused :60000** | Use `--network host` for worker communication. | +| **grpcurl not found** | Use the full image (`build:source`) not `node-only`. | +| **Build fails on Apple Silicon** | Use `--platform linux/amd64` for cross-compilation. | diff --git a/docker/Taskfile.yaml b/docker/Taskfile.yaml index d2115ba..01f289a 100644 --- a/docker/Taskfile.yaml +++ b/docker/Taskfile.yaml @@ -5,11 +5,34 @@ version: '3' dotenv: - '.env' +env: + DOCKER_BUILDKIT: '1' + vars: PROJECT_NAME: quilibrium SERVICE_NAME: node + VERSION: + sh: cat ../config/version.go | grep -A 1 "func GetVersion() \[\]byte {" | grep -Eo '0x[0-9a-fA-F]+' | xargs printf "%d.%d.%d" + GIT_REPO: + sh: git config --get remote.origin.url | sed 's/\.git$//' + GIT_BRANCH: + sh: git rev-parse --abbrev-ref HEAD + GIT_COMMIT: + sh: git log -1 --format=%h + MAX_KEY_ID: 17 tasks: + status: + desc: Display configuration info. + cmds: + - echo -n "Image name:" && echo " ${QUILIBRIUM_IMAGE_NAME:-quilibrium}" + - echo -n "Version :" && echo " {{.VERSION}}" + - echo -n "Repo :" && echo " {{.GIT_REPO}}" + - echo -n "Branch :" && echo " {{.GIT_BRANCH}}" + - echo -n "Commit :" && echo " {{.GIT_COMMIT}}" + - echo -n "Max Key ID:" && echo " {{.MAX_KEY_ID}}" + silent: true + up: desc: Run a new Quilibrium and related containers, through docker compose. cmds: @@ -56,25 +79,25 @@ tasks: desc: Create a backup file with the critical configuration files. prompt: You will be prompted for root access. Make sure you verify the generated backup file. Continue? preconditions: - - sh: 'test -d .config' + - sh: 'test -d ../.config' msg: '.config does not exists!' - - sh: 'test -f .config/config.yml' + - sh: 'test -f ../.config/config.yml' msg: '.config/config.yml does not exists!' - - sh: 'test -f .config/keys.yml' + - sh: 'test -f ../.config/keys.yml' msg: '.config/keys.yml does not exists!' - sh: '! test -f backup.tar.gz' msg: 'A previous backup.tar.gz found in the current folder!' sources: - - '.config/config.yml' - - '.config/keys.yml' + - '../.config/config.yml' + - '../.config/keys.yml' generates: - 'backup.tar.gz' cmds: - | export TMP_DIR=$(mktemp -d) export TASK_DIR=$(pwd) - sudo cp .config/config.yml $TMP_DIR - sudo cp .config/keys.yml $TMP_DIR + sudo cp ../.config/config.yml $TMP_DIR + sudo cp ../.config/keys.yml $TMP_DIR sudo chown $(whoami):$(id -gn) $TMP_DIR/* cd $TMP_DIR tar -czf $TASK_DIR/backup.tar.gz * @@ -87,19 +110,19 @@ tasks: restore: desc: Restores a backup file with the critical configuration files. preconditions: - - sh: '! test -d .config' + - sh: '! test -d ../.config' msg: '.config already exists, restore cannot be performed safely!' - sh: 'test -f backup.tar.gz' msg: 'backup.tar.gz not found in the current folder!' sources: - 'backup.tar.gz' generates: - - '.config/config.yml' - - '.config/keys.yml' + - '../.config/config.yml' + - '../.config/keys.yml' cmds: - | - mkdir .config - tar -xzf backup.tar.gz -C .config + mkdir ../.config + tar -xzf backup.tar.gz -C ../.config echo "Backup restored from: backup.tar.gz" silent: true @@ -112,3 +135,172 @@ tasks: msg: 'The public DNS name or IP address of the server must be set in NODE_PUBLIC_NAME.' cmds: - 'nc -vzu ${NODE_PUBLIC_NAME} ${QUILIBRIUM_P2P_PORT:=8336}' + + build_node_arm64_macos: + desc: Build the Quilibrium node binary for MacOS ARM. Assumes it's ran from the same platform. Outputs to node/build. + cmds: + - ../vdf/generate.sh + - ../bls48581/generate.sh + - ../verenc/generate.sh + - ../bulletproofs/generate.sh + - ../ferret/generate.sh + - ../channel/generate.sh + - ../rpm/generate.sh + - ../node/build.sh -o ../node/build/arm64_macos/node + + build_qclient_arm64_macos: + desc: Build the QClient node binary for MacOS ARM. Outputs to client/build + cmds: + - ../vdf/generate.sh + - ../bls48581/generate.sh + - ../verenc/generate.sh + - ../bulletproofs/generate.sh + - ../ferret/generate.sh + - ../channel/generate.sh + - ../rpm/generate.sh + - ../client/build.sh -o ../client/build/arm64_macos/qclient + + build_node_arm64_linux: + desc: Build the Quilibrium node binary for ARM64 Linux. Outputs to node/build. + cmds: + - docker build --platform linux/arm64 -f Dockerfile.source --output ../node/build/arm64_linux --target=node .. + + build_qclient_arm64_linux: + desc: Build the QClient node binary for ARM64 Linux. Outputs to client/build. + cmds: + - docker build --platform linux/arm64 -f Dockerfile.source --output ../client/build/arm64_linux --target=qclient .. + + build_node_amd64_linux: + desc: Build the Quilibrium node binary for AMD64 Linux. Outputs to node/build. + cmds: + - docker build --platform linux/amd64 -f Dockerfile.source --output ../node/build/amd64_linux --target=node .. + + build_conntest_amd64_linux: + desc: Build the Quilibrium node connection test binary for AMD64 Linux. Outputs to conntest/build. + cmds: + - docker build --platform linux/amd64 -f Dockerfile.conntest.source --output ../conntest/build/amd64_linux --target=conntest .. + + build_node_amd64_avx512_linux: + desc: Build the Quilibrium node binary for AMD64 Linux with AVX-512 extensions. Outputs to node/build. + cmds: + - docker build --platform linux/amd64 -f Dockerfile.sourceavx512 --output ../node/build/amd64_avx512_linux --target=node .. + + build_qclient_amd64_linux: + desc: Build the QClient node binary for AMD64 Linux. Outputs to client/build. + cmds: + - docker build --platform linux/amd64 -f Dockerfile.source --output ../client/build/amd64_linux --target=qclient .. + + build_qclient_amd64_avx512_linux: + desc: Build the QClient node binary for AMD64 Linux with AVX-512 extensions. Outputs to client/build. + cmds: + - docker build --platform linux/amd64 -f Dockerfile.sourceavx512 --output ../client/build/amd64_avx512_linux --target=qclient .. + + build_vdf_perf_analysis_amd64_linux: + cmds: + - docker build --platform linux/amd64 -f Dockerfile.vdf.source --output ../vdf/build/amd64_linux --target=vdf --progress=plain --no-cache .. + + build_vdf_perf_analysis_amd64_avx512_linux: + cmds: + - docker build --platform linux/amd64 -f Dockerfile.vdf.sourceavx512 --output ../vdf/build/amd64_avx512_linux --target=vdf-avx512 .. + + build_vdf_perf_analysis_amd64_zen3_linux: + cmds: + - docker build --platform linux/amd64 -f Dockerfile.vdf.sourcezen3 --output ../vdf/build/amd64_zen3_linux --target=vdf-zen3 --progress=plain --no-cache .. + + build_vdf_perf_analysis_amd64_zen4_linux: + cmds: + - docker build --platform linux/amd64 -f Dockerfile.vdf.sourcezen4 --output ../vdf/build/amd64_zen4_linux --target=vdf-zen4 --progress=plain --no-cache .. + + build_vdf_perf_analysis_arm64_linux: + cmds: + - docker build --platform linux/arm64 -f Dockerfile.vdf.source --output ../vdf/build/arm64_linux --target=vdf --progress=plain --no-cache .. + + build:source: + desc: Build the Quilibrium docker image from source. + cmds: + - | + docker build \ + -f Dockerfile.source \ + --build-arg NODE_VERSION={{.VERSION}} \ + --build-arg GIT_REPO={{.GIT_REPO}} \ + --build-arg GIT_BRANCH={{.GIT_BRANCH}} \ + --build-arg GIT_COMMIT={{.GIT_COMMIT}} \ + -t ${QUILIBRIUM_IMAGE_NAME:-quilibrium}:{{.VERSION}}-source \ + -t ${QUILIBRIUM_IMAGE_NAME:-quilibrium}:source \ + .. + status: + - | + docker image inspect \ + ${QUILIBRIUM_IMAGE_NAME:-quilibrium}:{{.VERSION}}-source \ + >/dev/null 2>/dev/null + + build:release: + desc: Build the Quilibrium docker image from release binaries. + aliases: + - build + cmds: + - | + docker build \ + -f Dockerfile.release \ + --build-arg NODE_VERSION={{.VERSION}} \ + --build-arg GIT_REPO={{.GIT_REPO}} \ + --build-arg GIT_BRANCH={{.GIT_BRANCH}} \ + --build-arg GIT_COMMIT={{.GIT_COMMIT}} \ + --build-arg MAX_KEY_ID={{.MAX_KEY_ID}} \ + -t ${QUILIBRIUM_IMAGE_NAME:-quilibrium}:{{.VERSION}}-release \ + -t ${QUILIBRIUM_IMAGE_NAME:-quilibrium}:release \ + .. + status: + - | + docker image inspect \ + ${QUILIBRIUM_IMAGE_NAME:-quilibrium}:{{.VERSION}}-release \ + >/dev/null 2>/dev/null + + docker:login: + desc: Login to Docker hub + aliases: + - login + cmds: + - echo $DOCKER_TOKEN | docker login -u $DOCKER_USERNAME --password-stdin + + push: + desc: Push Quilibrium docker image to the container registry. + cmds: + - docker push ${QUILIBRIUM_IMAGE_NAME:-quilibrium}:{{.VERSION}} + - docker push ${QUILIBRIUM_IMAGE_NAME:-quilibrium}:latest + + test:qclient: + desc: Test the Quilibrium docker image. + cmds: + - ../client/test/run_tests.sh -d 'ubuntu' -v '24.04' + + config:gen: + desc: Generate configuration and keys using Go. + cmds: + - go run ../utils/config-gen --config {{.CONFIG_DIR | default "../.config"}} + + build:node:source: + desc: Build the optimized Quilibrium node-only docker image. + cmds: + - | + docker build \ + --target node-only \ + -f Dockerfile.source \ + --build-arg NODE_VERSION={{.VERSION}} \ + --build-arg GIT_REPO={{.GIT_REPO}} \ + --build-arg GIT_BRANCH={{.GIT_BRANCH}} \ + --build-arg GIT_COMMIT={{.GIT_COMMIT}} \ + -t ${QUILIBRIUM_IMAGE_NAME:-quilibrium}:{{.VERSION}}-node-only \ + -t ${QUILIBRIUM_IMAGE_NAME:-quilibrium}:node-only \ + .. + + deploy:node: + desc: Run the Quilibrium node using host networking and external config. + cmds: + - | + docker run -d --name q-node \ + --network host \ + --restart unless-stopped \ + -v {{.CONFIG_DIR | default "$(pwd)/../.config"}}:/root/.config \ + ${QUILIBRIUM_IMAGE_NAME:-quilibrium}:node-only \ + -signature-check=false diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 816b238..c3b098c 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -1,6 +1,6 @@ name: quilibrium -# See sysctl related warning in DOCKER-README.md. +# See sysctl related warning in README.md. # Host configuration changes are required. services: @@ -16,13 +16,13 @@ services: - '127.0.0.1:${QUILIBRIUM_GRPC_PORT:-8337}:8337/tcp' # gRPC - '127.0.0.1:${QUILIBRIUM_REST_PORT:-8338}:8338/tcp' # REST healthcheck: - test: ["CMD", "grpcurl", "-plaintext", "localhost:8337", "list", "quilibrium.node.node.pb.NodeService"] + test: [ "CMD", "grpcurl", "-plaintext", "localhost:8337", "list", "quilibrium.node.node.pb.NodeService" ] interval: 30s timeout: 5s retries: 3 start_period: 15m volumes: - - ./.config:/root/.config + - ${QUILIBRIUM_CONFIG_DIR:-../.config}:/root/.config logging: driver: "json-file" options: From 1fbab4a05f1e1d7aa6444e0b5e15a630323204e6 Mon Sep 17 00:00:00 2001 From: Hamza Hamud <53880692+hhamud@users.noreply.github.com> Date: Thu, 25 Dec 2025 17:14:48 +0000 Subject: [PATCH 6/8] chore: clean up taskfile --- Taskfile.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Taskfile.yaml b/Taskfile.yaml index bf95704..dab6a88 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -20,6 +20,7 @@ tasks: status: desc: Display configuration info. cmds: + - echo -n "Image name:" && echo " ${QUILIBRIUM_IMAGE_NAME:-quilibrium}" - echo -n "Version :" && echo " {{.VERSION}}" - echo -n "Repo :" && echo " {{.GIT_REPO}}" - echo -n "Branch :" && echo " {{.GIT_BRANCH}}" @@ -51,7 +52,3 @@ tasks: - rpm/generate.sh - client/build.sh -o build/arm64_macos/qclient - config:gen: - desc: Generate configuration and keys using Go. - cmds: - - go run ./utils/config-gen --config {{.CONFIG_DIR | default ".config"}} From 57fea0f0a16246d7bb9fc1cdd771a45d8b913e2d Mon Sep 17 00:00:00 2001 From: Hamza Hamud <53880692+hhamud@users.noreply.github.com> Date: Fri, 26 Dec 2025 21:19:22 +0000 Subject: [PATCH 7/8] fix: comments --- docker/Dockerfile.conntest.source | 189 --------------------------- docker/Dockerfile.vdf.source | 141 -------------------- docker/Dockerfile.vdf.sourceavx512 | 143 -------------------- docker/Dockerfile.vdf.sourcezen3 | 143 -------------------- docker/Dockerfile.vdf.sourcezen4 | 143 -------------------- docker/README.md | 202 +---------------------------- 6 files changed, 6 insertions(+), 955 deletions(-) delete mode 100644 docker/Dockerfile.conntest.source delete mode 100644 docker/Dockerfile.vdf.source delete mode 100644 docker/Dockerfile.vdf.sourceavx512 delete mode 100644 docker/Dockerfile.vdf.sourcezen3 delete mode 100644 docker/Dockerfile.vdf.sourcezen4 diff --git a/docker/Dockerfile.conntest.source b/docker/Dockerfile.conntest.source deleted file mode 100644 index d79e0f6..0000000 --- a/docker/Dockerfile.conntest.source +++ /dev/null @@ -1,189 +0,0 @@ -# syntax=docker.io/docker/dockerfile:1.7-labs -FROM --platform=${TARGETPLATFORM} ubuntu:24.04 AS base - -ENV PATH="${PATH}:/root/.cargo/bin/" - -ARG TARGETOS -ARG TARGETARCH - -# Install GMP 6.2 (6.3 which MacOS is using only available on Debian unstable) -RUN apt-get update && apt-get install -y \ - build-essential \ - curl \ - git \ - cmake \ - libgmp-dev \ - libmpfr-dev \ - libmpfr6 \ - wget \ - m4 \ - pkg-config \ - gcc \ - g++ \ - make \ - autoconf \ - automake \ - libtool \ - libssl-dev \ - python3 \ - python-is-python3 \ - && rm -rf /var/lib/apt/lists/* - -ARG GO_VERSION=1.23.5 -RUN apt update && apt install -y wget && \ - ARCH=$(dpkg --print-architecture) && \ - case ${ARCH} in \ - amd64) GOARCH=amd64 ;; \ - arm64) GOARCH=arm64 ;; \ - *) echo "Unsupported architecture: ${ARCH}" && exit 1 ;; \ - esac && \ - wget https://go.dev/dl/go${GO_VERSION}.linux-${GOARCH}.tar.gz && \ - rm -rf /usr/local/go && \ - tar -C /usr/local -xzf go${GO_VERSION}.linux-${GOARCH}.tar.gz && \ - rm go${GO_VERSION}.linux-${GOARCH}.tar.gz - -ENV PATH=$PATH:/usr/local/go/bin - -RUN git clone https://github.com/flintlib/flint.git && \ - cd flint && \ - git checkout flint-3.0 && \ - ./bootstrap.sh && \ - ./configure \ - --prefix=/usr/local \ - --with-gmp=/usr/local \ - --with-mpfr=/usr/local \ - --enable-static \ - --disable-shared \ - CFLAGS="-O3" && \ - make && \ - make install && \ - cd .. && \ - rm -rf flint - -COPY docker/rustup-init.sh /opt/rustup-init.sh - -RUN /opt/rustup-init.sh -y --profile minimal - -# Install uniffi-bindgen-go -RUN cargo install uniffi-bindgen-go --git https://github.com/NordSecurity/uniffi-bindgen-go --tag v0.2.1+v0.25.0 - -FROM base AS build - -ENV GOEXPERIMENT=arenas -ENV QUILIBRIUM_SIGNATURE_CHECK=false - -# Install grpcurl before building the node and client -# as to avoid needing to redo it on rebuilds -RUN go install github.com/fullstorydev/grpcurl/cmd/grpcurl@latest - -WORKDIR /opt/ceremonyclient - -# Copy everything except node and client so as to avoid -# invalidating the cache at this point on client or node rebuilds - -COPY --exclude=client \ - --exclude=conntest \ - --exclude=sidecar . . - -RUN bash install-emp.sh - - -RUN cd emp-tool && sed -i 's/add_library(${NAME} SHARED ${sources})/add_library(${NAME} STATIC ${sources})/g' CMakeLists.txt && mkdir build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local && cd .. && make && make install && cd .. - -RUN cd emp-ot && mkdir build && cd build && cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local && cd .. && make && make install && cd .. - -RUN go mod download - -## Generate Rust bindings for channel -WORKDIR /opt/ceremonyclient/channel - -RUN go mod download - -RUN ./generate.sh - - -## Generate Rust bindings for VDF -WORKDIR /opt/ceremonyclient/vdf - -RUN go mod download - -RUN ./generate.sh - - -## Generate Rust bindings for Ferret -WORKDIR /opt/ceremonyclient/ferret - -RUN go mod download - -RUN ./generate.sh - -## Generate Rust bindings for BLS48581 -WORKDIR /opt/ceremonyclient/bls48581 - -RUN go mod download - -RUN ./generate.sh - -## Generate Rust bindings for RPM -WORKDIR /opt/ceremonyclient/rpm - -RUN go mod download - -RUN ./generate.sh - -## Generate Rust bindings for VerEnc -WORKDIR /opt/ceremonyclient/verenc - -RUN go mod download - -RUN ./generate.sh - -## Generate Rust bindings for Bulletproofs -WORKDIR /opt/ceremonyclient/bulletproofs - -RUN go mod download - -RUN ./generate.sh - -FROM build AS build-conntest - -# Build and install conntest -COPY ./conntest /opt/ceremonyclient/conntest -WORKDIR /opt/ceremonyclient/conntest - -ENV GOPROXY=direct -RUN ./build.sh && cp conntest /usr/bin - -# Allows exporting single binary -FROM scratch AS conntest -COPY --from=build-conntest /usr/bin/conntest /conntest -ENTRYPOINT [ "/conntest" ] - -FROM ubuntu:24.04 - -RUN apt-get update && apt-get install libflint-dev -y - -ARG NODE_VERSION -ARG GIT_REPO -ARG GIT_BRANCH -ARG GIT_COMMIT - -ENV GOEXPERIMENT=arenas - -LABEL org.opencontainers.image.title="Quilibrium Network Node connection test" -LABEL org.opencontainers.image.description="Quilibrium is a decentralized alternative to platform as a service providers." -LABEL org.opencontainers.image.version=$NODE_VERSION -LABEL org.opencontainers.image.vendor=Quilibrium -LABEL org.opencontainers.image.url=https://quilibrium.com/ -LABEL org.opencontainers.image.documentation=https://quilibrium.com/docs -LABEL org.opencontainers.image.source=$GIT_REPO -LABEL org.opencontainers.image.ref.name=$GIT_BRANCH -LABEL org.opencontainers.image.revision=$GIT_COMMIT - -RUN apt-get update && apt-get install -y ca-certificates - -COPY --from=build-conntest /usr/bin/conntest /usr/local/bin - -WORKDIR /root - -ENTRYPOINT ["conntest"] diff --git a/docker/Dockerfile.vdf.source b/docker/Dockerfile.vdf.source deleted file mode 100644 index 54870f6..0000000 --- a/docker/Dockerfile.vdf.source +++ /dev/null @@ -1,141 +0,0 @@ -# syntax=docker.io/docker/dockerfile:1.7-labs -FROM --platform=${TARGETPLATFORM} ubuntu:24.04 AS base - -ENV PATH="${PATH}:/root/.cargo/bin/" - -ARG TARGETOS -ARG TARGETARCH - -# Install GMP 6.2 (6.3 which MacOS is using only available on Debian unstable) -RUN --mount=type=cache,target=/usr/local/,id=usr-local-${TARGETOS}-${TARGETARCH} \ - --mount=type=cache,target=/var/cache/apt,sharing=locked \ - --mount=type=cache,target=/var/lib/apt,sharing=locked \ - apt-get update && apt-get install -y \ - build-essential \ - curl \ - git \ - cmake \ - libgmp-dev \ - libmpfr-dev \ - libmpfr6 \ - wget \ - m4 \ - pkg-config \ - gcc \ - g++ \ - make \ - autoconf \ - automake \ - libtool \ - libssl-dev \ - python3 \ - python-is-python3 \ - && rm -rf /var/lib/apt/lists/* - -ARG GO_VERSION=1.23.5 -RUN --mount=type=cache,target=/usr/local,id=usr-local-${TARGETOS}-${TARGETARCH} \ - apt update && apt install -y wget && \ - ARCH=$(dpkg --print-architecture) && \ - case ${ARCH} in \ - amd64) GOARCH=amd64 ;; \ - arm64) GOARCH=arm64 ;; \ - *) echo "Unsupported architecture: ${ARCH}" && exit 1 ;; \ - esac && \ - wget https://go.dev/dl/go${GO_VERSION}.linux-${GOARCH}.tar.gz && \ - rm -rf /usr/local/go && \ - tar -C /usr/local -xzf go${GO_VERSION}.linux-${GOARCH}.tar.gz && \ - rm go${GO_VERSION}.linux-${GOARCH}.tar.gz - -ENV PATH=$PATH:/usr/local/go/bin - -RUN --mount=type=cache,target=/usr/local,id=usr-local-${TARGETOS}-${TARGETARCH} \ - git clone https://github.com/flintlib/flint.git && \ - cd flint && \ - git checkout flint-3.0 && \ - ./bootstrap.sh && \ - ./configure \ - --prefix=/usr/local \ - --with-gmp=/usr/local \ - --with-mpfr=/usr/local \ - --enable-static \ - --disable-shared \ - CFLAGS="-O3" && \ - make && \ - make install && \ - cd .. && \ - rm -rf flint - -COPY docker/rustup-init.sh /opt/rustup-init.sh - -RUN --mount=type=cache,target=/root/.cargo,id=cargo-${TARGETOS}-${TARGETARCH} \ - --mount=type=cache,target=/opt/ceremonyclient/target/,id=target-${TARGETOS}-${TARGETARCH} \ - --mount=type=cache,target=/usr/local/,id=usr-local-${TARGETOS}-${TARGETARCH} \ - --mount=type=cache,target=/go/pkg/mod,id=go-mod-${TARGETOS}-${TARGETARCH} \ - /opt/rustup-init.sh -y --profile minimal - -# Install uniffi-bindgen-go -RUN --mount=type=cache,target=/root/.cargo,id=cargo-${TARGETOS}-${TARGETARCH} \ - --mount=type=cache,target=/opt/ceremonyclient/target/,id=target-${TARGETOS}-${TARGETARCH} \ - --mount=type=cache,target=/usr/local/,id=usr-local-${TARGETOS}-${TARGETARCH} \ - --mount=type=cache,target=/go/pkg/mod,id=go-mod-${TARGETOS}-${TARGETARCH} \ - cargo install uniffi-bindgen-go --git https://github.com/NordSecurity/uniffi-bindgen-go --tag v0.2.1+v0.25.0 - -FROM base AS build - -ENV QUILIBRIUM_SIGNATURE_CHECK=false - -WORKDIR /opt/ceremonyclient - -# Copy everything except node and client so as to avoid -# invalidating the cache at this point on client or node rebuilds - -COPY --exclude=node \ - --exclude=client \ - --exclude=sidecar . . - -## Generate Rust bindings for VDF -WORKDIR /opt/ceremonyclient/vdf - -RUN --mount=type=cache,target=/usr/local/,id=usr-local-${TARGETOS}-${TARGETARCH} \ - --mount=type=cache,target=/go/pkg/mod,id=go-mod-${TARGETOS}-${TARGETARCH} \ - --mount=type=cache,target=/root/.cache/go-build,id=go-build-${TARGETOS}-${TARGETARCH} \ - go mod download - -RUN --mount=type=cache,target=/root/.cargo,id=cargo-${TARGETOS}-${TARGETARCH} \ - --mount=type=cache,target=/opt/ceremonyclient/target/,id=target-${TARGETOS}-${TARGETARCH} \ - --mount=type=cache,target=/usr/local/,id=usr-local-${TARGETOS}-${TARGETARCH} \ - --mount=type=cache,target=/go/pkg/mod,id=go-mod-${TARGETOS}-${TARGETARCH} \ - --mount=type=cache,target=/root/.cache/go-build,id=go-build-${TARGETOS}-${TARGETARCH} \ - ./generate.sh - - -FROM build AS build-node - -WORKDIR /opt/ceremonyclient/vdf - -RUN --mount=type=cache,target=/usr/local/,id=usr-local-${TARGETOS}-${TARGETARCH} \ - --mount=type=cache,target=/opt/ceremonyclient/target/,id=target-${TARGETOS}-${TARGETARCH} \ - --mount=type=cache,target=/go/pkg/mod,id=go-mod-${TARGETOS}-${TARGETARCH} \ - --mount=type=cache,target=/root/.cache/go-build,id=go-build-${TARGETOS}-${TARGETARCH} \ - ./build-test.sh -o vdf-test perftest/main.go && cp vdf-test /usr/bin - -# Allows exporting single binary -FROM scratch AS vdf -COPY --from=build-node /usr/bin/vdf-test /vdf-test -ENTRYPOINT [ "/vdf-test" ] - -LABEL org.opencontainers.image.title="Quilibrium Network Node" -LABEL org.opencontainers.image.description="Quilibrium is a decentralized alternative to platform as a service providers." -LABEL org.opencontainers.image.version=$NODE_VERSION -LABEL org.opencontainers.image.vendor=Quilibrium -LABEL org.opencontainers.image.url=https://quilibrium.com/ -LABEL org.opencontainers.image.documentation=https://quilibrium.com/docs -LABEL org.opencontainers.image.source=$GIT_REPO -LABEL org.opencontainers.image.ref.name=$GIT_BRANCH -LABEL org.opencontainers.image.revision=$GIT_COMMIT - -COPY --from=build-node /usr/bin/vdf-test /usr/local/vdf-test - -WORKDIR /root - -ENTRYPOINT ["vdf-test"] diff --git a/docker/Dockerfile.vdf.sourceavx512 b/docker/Dockerfile.vdf.sourceavx512 deleted file mode 100644 index 8dc4e1a..0000000 --- a/docker/Dockerfile.vdf.sourceavx512 +++ /dev/null @@ -1,143 +0,0 @@ -# syntax=docker.io/docker/dockerfile:1.7-labs -FROM --platform=${TARGETPLATFORM} ubuntu:24.04 AS base-avx512 - -ENV PATH="${PATH}:/root/.cargo/bin/" - -ARG TARGETOS -ARG TARGETARCH - -# Install GMP 6.2 (6.3 which MacOS is using only available on Debian unstable) -RUN --mount=type=cache,target=/usr/local/,id=usr-local-${TARGETOS}-${TARGETARCH}-avx512 \ - --mount=type=cache,target=/var/cache/apt,sharing=locked \ - --mount=type=cache,target=/var/lib/apt,sharing=locked \ - apt-get update && apt-get install -y \ - build-essential \ - curl \ - git \ - cmake \ - libgmp-dev \ - libmpfr-dev \ - libmpfr6 \ - wget \ - m4 \ - pkg-config \ - gcc \ - g++ \ - make \ - autoconf \ - automake \ - libtool \ - libssl-dev \ - python3 \ - python-is-python3 \ - && rm -rf /var/lib/apt/lists/* - -ARG GO_VERSION=1.23.5 -RUN --mount=type=cache,target=/usr/local,id=usr-local-${TARGETOS}-${TARGETARCH}-avx512 \ - apt update && apt install -y wget && \ - ARCH=$(dpkg --print-architecture) && \ - case ${ARCH} in \ - amd64) GOARCH=amd64 ;; \ - arm64) GOARCH=arm64 ;; \ - *) echo "Unsupported architecture: ${ARCH}" && exit 1 ;; \ - esac && \ - wget https://go.dev/dl/go${GO_VERSION}.linux-${GOARCH}.tar.gz && \ - rm -rf /usr/local/go && \ - tar -C /usr/local -xzf go${GO_VERSION}.linux-${GOARCH}.tar.gz && \ - rm go${GO_VERSION}.linux-${GOARCH}.tar.gz - -ENV PATH=$PATH:/usr/local/go/bin - -# Build FLINT from source with AVX-512 -RUN --mount=type=cache,target=/usr/local,id=usr-local-${TARGETOS}-${TARGETARCH}-avx512 \ - git clone https://github.com/flintlib/flint.git && \ - cd flint && \ - git checkout flint-3.0 && \ - ./bootstrap.sh && \ - ./configure \ - --prefix=/usr/local \ - --with-gmp=/usr/local \ - --with-mpfr=/usr/local \ - --enable-avx512 \ - --enable-static \ - --disable-shared \ - CFLAGS="-march=skylake-avx512 -mtune=skylake-avx512 -O3" && \ - make -j$(nproc) && \ - make install && \ - cd .. && \ - rm -rf flint - -COPY docker/rustup-init.sh /opt/rustup-init.sh - -RUN --mount=type=cache,target=/root/.cargo,id=cargo-${TARGETOS}-${TARGETARCH}-avx512 \ - --mount=type=cache,target=/opt/ceremonyclient/target/,id=target-${TARGETOS}-${TARGETARCH}-avx512 \ - --mount=type=cache,target=/usr/local/,id=usr-local-${TARGETOS}-${TARGETARCH}-avx512 \ - --mount=type=cache,target=/go/pkg/mod,id=go-mod-${TARGETOS}-${TARGETARCH}-avx512 \ - /opt/rustup-init.sh -y --profile minimal - -# Install uniffi-bindgen-go -RUN --mount=type=cache,target=/root/.cargo,id=cargo-${TARGETOS}-${TARGETARCH}-avx512 \ - --mount=type=cache,target=/opt/ceremonyclient/target/,id=target-${TARGETOS}-${TARGETARCH}-avx512 \ - --mount=type=cache,target=/usr/local/,id=usr-local-${TARGETOS}-${TARGETARCH}-avx512 \ - --mount=type=cache,target=/go/pkg/mod,id=go-mod-${TARGETOS}-${TARGETARCH}-avx512 \ - cargo install uniffi-bindgen-go --git https://github.com/NordSecurity/uniffi-bindgen-go --tag v0.2.1+v0.25.0 - -FROM base-avx512 AS build-avx512 - -ENV QUILIBRIUM_SIGNATURE_CHECK=false - -WORKDIR /opt/ceremonyclient - -# Copy everything except node and client so as to avoid -# invalidating the cache at this point on client or node rebuilds - -COPY --exclude=node \ - --exclude=client \ - --exclude=sidecar . . - -## Generate Rust bindings for VDF -WORKDIR /opt/ceremonyclient/vdf - -RUN --mount=type=cache,target=/usr/local/,id=usr-local-${TARGETOS}-${TARGETARCH}-avx512 \ - --mount=type=cache,target=/go/pkg/mod,id=go-mod-${TARGETOS}-${TARGETARCH}-avx512 \ - --mount=type=cache,target=/root/.cache/go-build,id=go-build-${TARGETOS}-${TARGETARCH}-avx512 \ - go mod download - -RUN --mount=type=cache,target=/root/.cargo,id=cargo-${TARGETOS}-${TARGETARCH}-avx512 \ - --mount=type=cache,target=/opt/ceremonyclient/target/,id=target-${TARGETOS}-${TARGETARCH}-avx512 \ - --mount=type=cache,target=/usr/local/,id=usr-local-${TARGETOS}-${TARGETARCH}-avx512 \ - --mount=type=cache,target=/go/pkg/mod,id=go-mod-${TARGETOS}-${TARGETARCH}-avx512 \ - --mount=type=cache,target=/root/.cache/go-build,id=go-build-${TARGETOS}-${TARGETARCH}-avx512 \ - ./generate.sh - - -FROM build-avx512 AS build-node-avx512 - -WORKDIR /opt/ceremonyclient/vdf - -RUN --mount=type=cache,target=/usr/local/,id=usr-local-${TARGETOS}-${TARGETARCH}-avx512 \ - --mount=type=cache,target=/opt/ceremonyclient/target/,id=target-${TARGETOS}-${TARGETARCH}-avx512 \ - --mount=type=cache,target=/go/pkg/mod,id=go-mod-${TARGETOS}-${TARGETARCH}-avx512 \ - --mount=type=cache,target=/root/.cache/go-build,id=go-build-${TARGETOS}-${TARGETARCH}-avx512 \ - ./build-test.sh -o vdf-test perftest/main.go && cp vdf-test /usr/bin - -# Allows exporting single binary -FROM scratch AS vdf-avx512 -COPY --from=build-node-avx512 /usr/bin/vdf-test /vdf-test -ENTRYPOINT [ "/vdf-test" ] - -LABEL org.opencontainers.image.title="Quilibrium Network Node" -LABEL org.opencontainers.image.description="Quilibrium is a decentralized alternative to platform as a service providers." -LABEL org.opencontainers.image.version=$NODE_VERSION -LABEL org.opencontainers.image.vendor=Quilibrium -LABEL org.opencontainers.image.url=https://quilibrium.com/ -LABEL org.opencontainers.image.documentation=https://quilibrium.com/docs -LABEL org.opencontainers.image.source=$GIT_REPO -LABEL org.opencontainers.image.ref.name=$GIT_BRANCH -LABEL org.opencontainers.image.revision=$GIT_COMMIT - -COPY --from=build-node-avx512 /usr/bin/vdf-test /usr/local/vdf-test - -WORKDIR /root - -ENTRYPOINT ["vdf-test"] \ No newline at end of file diff --git a/docker/Dockerfile.vdf.sourcezen3 b/docker/Dockerfile.vdf.sourcezen3 deleted file mode 100644 index a3d6a51..0000000 --- a/docker/Dockerfile.vdf.sourcezen3 +++ /dev/null @@ -1,143 +0,0 @@ -# syntax=docker.io/docker/dockerfile:1.7-labs -FROM --platform=${TARGETPLATFORM} ubuntu:24.04 AS base-zen3 - -ENV PATH="${PATH}:/root/.cargo/bin/" - -ARG TARGETOS -ARG TARGETARCH - -# Install GMP 6.2 (6.3 which MacOS is using only available on Debian unstable) -RUN --mount=type=cache,target=/usr/local/,id=usr-local-${TARGETOS}-${TARGETARCH}-zen3 \ - --mount=type=cache,target=/var/cache/apt,sharing=locked \ - --mount=type=cache,target=/var/lib/apt,sharing=locked \ - apt-get update && apt-get install -y \ - build-essential \ - curl \ - git \ - cmake \ - libgmp-dev \ - libmpfr-dev \ - libmpfr6 \ - wget \ - m4 \ - pkg-config \ - gcc \ - g++ \ - make \ - autoconf \ - automake \ - libtool \ - libssl-dev \ - python3 \ - python-is-python3 \ - && rm -rf /var/lib/apt/lists/* - -ARG GO_VERSION=1.23.5 -RUN --mount=type=cache,target=/usr/local,id=usr-local-${TARGETOS}-${TARGETARCH}-zen3 \ - apt update && apt install -y wget && \ - ARCH=$(dpkg --print-architecture) && \ - case ${ARCH} in \ - amd64) GOARCH=amd64 ;; \ - arm64) GOARCH=arm64 ;; \ - *) echo "Unsupported architecture: ${ARCH}" && exit 1 ;; \ - esac && \ - wget https://go.dev/dl/go${GO_VERSION}.linux-${GOARCH}.tar.gz && \ - rm -rf /usr/local/go && \ - tar -C /usr/local -xzf go${GO_VERSION}.linux-${GOARCH}.tar.gz && \ - rm go${GO_VERSION}.linux-${GOARCH}.tar.gz - -ENV PATH=$PATH:/usr/local/go/bin - -# Build FLINT from source with AVX-512 -RUN --mount=type=cache,target=/usr/local,id=usr-local-${TARGETOS}-${TARGETARCH}-zen3 \ - git clone https://github.com/flintlib/flint.git && \ - cd flint && \ - git checkout flint-3.0 && \ - ./bootstrap.sh && \ - ./configure \ - --prefix=/usr/local \ - --with-gmp=/usr/local \ - --with-mpfr=/usr/local \ - --enable-avx2 \ - --enable-static \ - --disable-shared \ - CFLAGS="-march=znver3 -mtune=znver3 -O3" && \ - make -j$(nproc) && \ - make install && \ - cd .. && \ - rm -rf flint - -COPY docker/rustup-init.sh /opt/rustup-init.sh - -RUN --mount=type=cache,target=/root/.cargo,id=cargo-${TARGETOS}-${TARGETARCH}-zen3 \ - --mount=type=cache,target=/opt/ceremonyclient/target/,id=target-${TARGETOS}-${TARGETARCH}-zen3 \ - --mount=type=cache,target=/usr/local/,id=usr-local-${TARGETOS}-${TARGETARCH}-zen3 \ - --mount=type=cache,target=/go/pkg/mod,id=go-mod-${TARGETOS}-${TARGETARCH}-zen3 \ - /opt/rustup-init.sh -y --profile minimal - -# Install uniffi-bindgen-go -RUN --mount=type=cache,target=/root/.cargo,id=cargo-${TARGETOS}-${TARGETARCH}-zen3 \ - --mount=type=cache,target=/opt/ceremonyclient/target/,id=target-${TARGETOS}-${TARGETARCH}-zen3 \ - --mount=type=cache,target=/usr/local/,id=usr-local-${TARGETOS}-${TARGETARCH}-zen3 \ - --mount=type=cache,target=/go/pkg/mod,id=go-mod-${TARGETOS}-${TARGETARCH}-zen3 \ - cargo install uniffi-bindgen-go --git https://github.com/NordSecurity/uniffi-bindgen-go --tag v0.2.1+v0.25.0 - -FROM base-zen3 AS build-zen3 - -ENV QUILIBRIUM_SIGNATURE_CHECK=false - -WORKDIR /opt/ceremonyclient - -# Copy everything except node and client so as to avoid -# invalidating the cache at this point on client or node rebuilds - -COPY --exclude=node \ - --exclude=client \ - --exclude=sidecar . . - -## Generate Rust bindings for VDF -WORKDIR /opt/ceremonyclient/vdf - -RUN --mount=type=cache,target=/usr/local/,id=usr-local-${TARGETOS}-${TARGETARCH}-zen3 \ - --mount=type=cache,target=/go/pkg/mod,id=go-mod-${TARGETOS}-${TARGETARCH}-zen3 \ - --mount=type=cache,target=/root/.cache/go-build,id=go-build-${TARGETOS}-${TARGETARCH}-zen3 \ - go mod download - -RUN --mount=type=cache,target=/root/.cargo,id=cargo-${TARGETOS}-${TARGETARCH}-zen3 \ - --mount=type=cache,target=/opt/ceremonyclient/target/,id=target-${TARGETOS}-${TARGETARCH}-zen3 \ - --mount=type=cache,target=/usr/local/,id=usr-local-${TARGETOS}-${TARGETARCH}-zen3 \ - --mount=type=cache,target=/go/pkg/mod,id=go-mod-${TARGETOS}-${TARGETARCH}-zen3 \ - --mount=type=cache,target=/root/.cache/go-build,id=go-build-${TARGETOS}-${TARGETARCH}-zen3 \ - ./generate.sh - - -FROM build-zen3 AS build-node-zen3 - -WORKDIR /opt/ceremonyclient/vdf - -RUN --mount=type=cache,target=/usr/local/,id=usr-local-${TARGETOS}-${TARGETARCH}-zen3 \ - --mount=type=cache,target=/opt/ceremonyclient/target/,id=target-${TARGETOS}-${TARGETARCH}-zen3 \ - --mount=type=cache,target=/go/pkg/mod,id=go-mod-${TARGETOS}-${TARGETARCH}-zen3 \ - --mount=type=cache,target=/root/.cache/go-build,id=go-build-${TARGETOS}-${TARGETARCH}-zen3 \ - ./build-test.sh -o vdf-test perftest/main.go && cp vdf-test /usr/bin - -# Allows exporting single binary -FROM scratch AS vdf-zen3 -COPY --from=build-node-zen3 /usr/bin/vdf-test /vdf-test -ENTRYPOINT [ "/vdf-test" ] - -LABEL org.opencontainers.image.title="Quilibrium Network Node" -LABEL org.opencontainers.image.description="Quilibrium is a decentralized alternative to platform as a service providers." -LABEL org.opencontainers.image.version=$NODE_VERSION -LABEL org.opencontainers.image.vendor=Quilibrium -LABEL org.opencontainers.image.url=https://quilibrium.com/ -LABEL org.opencontainers.image.documentation=https://quilibrium.com/docs -LABEL org.opencontainers.image.source=$GIT_REPO -LABEL org.opencontainers.image.ref.name=$GIT_BRANCH -LABEL org.opencontainers.image.revision=$GIT_COMMIT - -COPY --from=build-node-zen3 /usr/bin/vdf-test /usr/local/vdf-test - -WORKDIR /root - -ENTRYPOINT ["vdf-test"] diff --git a/docker/Dockerfile.vdf.sourcezen4 b/docker/Dockerfile.vdf.sourcezen4 deleted file mode 100644 index 808165f..0000000 --- a/docker/Dockerfile.vdf.sourcezen4 +++ /dev/null @@ -1,143 +0,0 @@ -# syntax=docker.io/docker/dockerfile:1.7-labs -FROM --platform=${TARGETPLATFORM} ubuntu:24.04 AS base-zen4 - -ENV PATH="${PATH}:/root/.cargo/bin/" - -ARG TARGETOS -ARG TARGETARCH - -# Install GMP 6.2 (6.3 which MacOS is using only available on Debian unstable) -RUN --mount=type=cache,target=/usr/local/,id=usr-local-${TARGETOS}-${TARGETARCH}-zen4 \ - --mount=type=cache,target=/var/cache/apt,sharing=locked \ - --mount=type=cache,target=/var/lib/apt,sharing=locked \ - apt-get update && apt-get install -y \ - build-essential \ - curl \ - git \ - cmake \ - libgmp-dev \ - libmpfr-dev \ - libmpfr6 \ - wget \ - m4 \ - pkg-config \ - gcc \ - g++ \ - make \ - autoconf \ - automake \ - libtool \ - libssl-dev \ - python3 \ - python-is-python3 \ - && rm -rf /var/lib/apt/lists/* - -ARG GO_VERSION=1.23.5 -RUN --mount=type=cache,target=/usr/local,id=usr-local-${TARGETOS}-${TARGETARCH}-zen4 \ - apt update && apt install -y wget && \ - ARCH=$(dpkg --print-architecture) && \ - case ${ARCH} in \ - amd64) GOARCH=amd64 ;; \ - arm64) GOARCH=arm64 ;; \ - *) echo "Unsupported architecture: ${ARCH}" && exit 1 ;; \ - esac && \ - wget https://go.dev/dl/go${GO_VERSION}.linux-${GOARCH}.tar.gz && \ - rm -rf /usr/local/go && \ - tar -C /usr/local -xzf go${GO_VERSION}.linux-${GOARCH}.tar.gz && \ - rm go${GO_VERSION}.linux-${GOARCH}.tar.gz - -ENV PATH=$PATH:/usr/local/go/bin - -# Build FLINT from source with AVX-512 -RUN --mount=type=cache,target=/usr/local,id=usr-local-${TARGETOS}-${TARGETARCH}-zen4 \ - git clone https://github.com/flintlib/flint.git && \ - cd flint && \ - git checkout flint-3.0 && \ - ./bootstrap.sh && \ - ./configure \ - --prefix=/usr/local \ - --with-gmp=/usr/local \ - --with-mpfr=/usr/local \ - --enable-avx2 \ - --enable-static \ - --disable-shared \ - CFLAGS="-march=znver4 -mtune=znver4 -O3" && \ - make -j$(nproc) && \ - make install && \ - cd .. && \ - rm -rf flint - -COPY docker/rustup-init.sh /opt/rustup-init.sh - -RUN --mount=type=cache,target=/root/.cargo,id=cargo-${TARGETOS}-${TARGETARCH}-zen4 \ - --mount=type=cache,target=/opt/ceremonyclient/target/,id=target-${TARGETOS}-${TARGETARCH}-zen4 \ - --mount=type=cache,target=/usr/local/,id=usr-local-${TARGETOS}-${TARGETARCH}-zen4 \ - --mount=type=cache,target=/go/pkg/mod,id=go-mod-${TARGETOS}-${TARGETARCH}-zen4 \ - /opt/rustup-init.sh -y --profile minimal - -# Install uniffi-bindgen-go -RUN --mount=type=cache,target=/root/.cargo,id=cargo-${TARGETOS}-${TARGETARCH}-zen4 \ - --mount=type=cache,target=/opt/ceremonyclient/target/,id=target-${TARGETOS}-${TARGETARCH}-zen4 \ - --mount=type=cache,target=/usr/local/,id=usr-local-${TARGETOS}-${TARGETARCH}-zen4 \ - --mount=type=cache,target=/go/pkg/mod,id=go-mod-${TARGETOS}-${TARGETARCH}-zen4 \ - cargo install uniffi-bindgen-go --git https://github.com/NordSecurity/uniffi-bindgen-go --tag v0.2.1+v0.25.0 - -FROM base-zen4 AS build-zen4 - -ENV QUILIBRIUM_SIGNATURE_CHECK=false - -WORKDIR /opt/ceremonyclient - -# Copy everything except node and client so as to avoid -# invalidating the cache at this point on client or node rebuilds - -COPY --exclude=node \ - --exclude=client \ - --exclude=sidecar . . - -## Generate Rust bindings for VDF -WORKDIR /opt/ceremonyclient/vdf - -RUN --mount=type=cache,target=/usr/local/,id=usr-local-${TARGETOS}-${TARGETARCH}-zen4 \ - --mount=type=cache,target=/go/pkg/mod,id=go-mod-${TARGETOS}-${TARGETARCH}-zen4 \ - --mount=type=cache,target=/root/.cache/go-build,id=go-build-${TARGETOS}-${TARGETARCH}-zen4 \ - go mod download - -RUN --mount=type=cache,target=/root/.cargo,id=cargo-${TARGETOS}-${TARGETARCH}-zen4 \ - --mount=type=cache,target=/opt/ceremonyclient/target/,id=target-${TARGETOS}-${TARGETARCH}-zen4 \ - --mount=type=cache,target=/usr/local/,id=usr-local-${TARGETOS}-${TARGETARCH}-zen4 \ - --mount=type=cache,target=/go/pkg/mod,id=go-mod-${TARGETOS}-${TARGETARCH}-zen4 \ - --mount=type=cache,target=/root/.cache/go-build,id=go-build-${TARGETOS}-${TARGETARCH}-zen4 \ - ./generate.sh - - -FROM build-zen4 AS build-node-zen4 - -WORKDIR /opt/ceremonyclient/vdf - -RUN --mount=type=cache,target=/usr/local/,id=usr-local-${TARGETOS}-${TARGETARCH}-zen4 \ - --mount=type=cache,target=/opt/ceremonyclient/target/,id=target-${TARGETOS}-${TARGETARCH}-zen4 \ - --mount=type=cache,target=/go/pkg/mod,id=go-mod-${TARGETOS}-${TARGETARCH}-zen4 \ - --mount=type=cache,target=/root/.cache/go-build,id=go-build-${TARGETOS}-${TARGETARCH}-zen4 \ - ./build-test.sh -o vdf-test perftest/main.go && cp vdf-test /usr/bin - -# Allows exporting single binary -FROM scratch AS vdf-zen4 -COPY --from=build-node-zen4 /usr/bin/vdf-test /vdf-test -ENTRYPOINT [ "/vdf-test" ] - -LABEL org.opencontainers.image.title="Quilibrium Network Node" -LABEL org.opencontainers.image.description="Quilibrium is a decentralized alternative to platform as a service providers." -LABEL org.opencontainers.image.version=$NODE_VERSION -LABEL org.opencontainers.image.vendor=Quilibrium -LABEL org.opencontainers.image.url=https://quilibrium.com/ -LABEL org.opencontainers.image.documentation=https://quilibrium.com/docs -LABEL org.opencontainers.image.source=$GIT_REPO -LABEL org.opencontainers.image.ref.name=$GIT_BRANCH -LABEL org.opencontainers.image.revision=$GIT_COMMIT - -COPY --from=build-node-zen4 /usr/bin/vdf-test /usr/local/vdf-test - -WORKDIR /root - -ENTRYPOINT ["vdf-test"] diff --git a/docker/README.md b/docker/README.md index d0a9532..adae191 100644 --- a/docker/README.md +++ b/docker/README.md @@ -2,148 +2,15 @@ This folder contains all the necessary files to build and run Quilibrium nodes using Docker. -## Prerequisites - -### Required Tools -- **Docker** (v20.10+) with BuildKit support -- **Docker Compose** (v2.0+) -- **Task** (optional but recommended) - [taskfile.dev](https://taskfile.dev) - -### Install Task -```bash -# macOS -brew install go-task - -# Linux (script) -sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin - -# Or via Go -go install github.com/go-task/task/v3/cmd/task@latest -``` - -### Docker Version Check -```bash -docker --version # Should be 20.10+ -docker compose version # Should be v2.0+ -``` ## 1. System Preparation -Before building or running, optimize the host network stack. Quilibrium relies on the QUIC protocol (UDP), which requires larger buffer sizes than the Linux default. +For system preparation follow this [guide](https://docs.quilibrium.com/). -### Increase UDP Buffer Sizes -```bash -sudo sysctl -w net.core.rmem_max=7500000 -sudo sysctl -w net.core.wmem_max=7500000 -``` -To make these changes permanent, add them to `/etc/sysctl.conf`. +If you have issues with connecting to others consider opening up additonal ports 50000+ and 60000+ -### Configure Firewall (UFW) -Open the ports required for P2P, gRPC, REST, and worker communication: -```bash -sudo ufw allow 22/tcp -sudo ufw allow 443/tcp -sudo ufw allow 8336:8338/udp -sudo ufw allow 8340/udp -sudo ufw allow 50000:50010/tcp -sudo ufw allow 50000:50010/udp -sudo ufw reload -``` - -## 2. File Structure - -| File | Purpose | -| --- | --- | -| `Dockerfile.source` | Main multi-stage build for node + qclient | -| `Dockerfile.sourceavx512` | Optimized build with AVX-512 instructions | -| `Dockerfile.release` | Build from pre-compiled release binaries | -| `Dockerfile.conntest.source` | Connection test utility build | -| `Dockerfile.vdf.*` | VDF performance analysis builds (various CPU optimizations) | -| `docker-compose.yml` | Container orchestration config | -| `Taskfile.yaml` | Task automation commands | -| `.env.example` | Environment variable template | -| `rustup-init.sh` | Rust installer for build stages | - -## 3. Dockerfile Variants - -### Production Dockerfiles - -| Dockerfile | Use Case | Target Stages | -| --- | --- | --- | -| `Dockerfile.source` | Standard build from source | `node-only`, `node`, `qclient`, `final` | -| `Dockerfile.sourceavx512` | AVX-512 optimized (Intel Xeon, AMD Zen4+) | Same as above | -| `Dockerfile.release` | Build from release binaries (faster) | Single stage | - -### Specialized Dockerfiles - -| Dockerfile | Use Case | -| --- | --- | -| `Dockerfile.conntest.source` | Network connectivity testing | -| `Dockerfile.vdf.source` | VDF performance benchmarking | -| `Dockerfile.vdf.sourceavx512` | VDF with AVX-512 optimizations | -| `Dockerfile.vdf.sourcezen3` | VDF optimized for AMD Zen3 | -| `Dockerfile.vdf.sourcezen4` | VDF optimized for AMD Zen4 | - -## 4. Build Targets & Cross-Compilation - -### Available Build Tasks - -| Task | Platform | Output | -| --- | --- | --- | -| `build_node_arm64_linux` | Linux ARM64 | `../node/build/arm64_linux/` | -| `build_node_amd64_linux` | Linux AMD64 | `../node/build/amd64_linux/` | -| `build_node_amd64_avx512_linux` | Linux AMD64 (AVX-512) | `../node/build/amd64_avx512_linux/` | -| `build_node_arm64_macos` | macOS ARM64 | `../node/build/arm64_macos/` | -| `build_qclient_arm64_linux` | Linux ARM64 | `../client/build/arm64_linux/` | -| `build_qclient_amd64_linux` | Linux AMD64 | `../client/build/amd64_linux/` | -| `build_qclient_amd64_avx512_linux` | Linux AMD64 (AVX-512) | `../client/build/amd64_avx512_linux/` | -| `build_qclient_arm64_macos` | macOS ARM64 | `../client/build/arm64_macos/` | - -### Cross-Compilation Examples - -**Build Linux ARM64 binary from any platform:** -```bash -task build_node_arm64_linux -``` - -**Build Linux AMD64 with AVX-512 optimizations:** -```bash -task build_node_amd64_avx512_linux -``` - -**Manual cross-compilation with Docker:** -```bash -# Build for ARM64 -docker build --platform linux/arm64 -f Dockerfile.source --output ../node/build/arm64_linux --target=node .. - -# Build for AMD64 -docker build --platform linux/amd64 -f Dockerfile.source --output ../node/build/amd64_linux --target=node .. -``` - -## 5. Docker Images - -### Build Images - -```bash -# Full image (node + qclient) -task build:source - -# Node-only optimized image -task build:node:source - -# From release binaries (faster) -task build:release -``` - -### Image Tags - -After building, images are tagged as: -- `quilibrium:2.1.0-source` / `quilibrium:source` -- `quilibrium:2.1.0-node-only` / `quilibrium:node-only` -- `quilibrium:2.1.0-release` / `quilibrium:release` - -## 6. Configuration +## 2. Configuration ### Configuration Directory By default, the Docker configuration uses the `.config` directory at the **root of the repository** (`../.config`). This allows you to share configuration between native and containerized builds. @@ -154,32 +21,18 @@ task config:gen ``` This will generate the configuration in `../.config`. -## 7. Running a Node +## 3. Running a Node ### Quick Start (Docker Compose) ```bash task up ``` Or: + ```bash docker compose up -d ``` -### Host Networking (Recommended for Servers) -For servers with dedicated public IPs, host networking eliminates Docker NAT overhead: - -```bash -task deploy:node -``` -Or: -```bash -docker run -d --name q-node \ - --network host \ - --restart unless-stopped \ - -v $(pwd)/../.config:/root/.config \ - quilibrium:node-only -signature-check=false -``` - ### New Instance If you are starting a brand new node, a `.config/` folder will be created at the repository root. @@ -190,51 +43,8 @@ If you are starting a brand new node, a `.config/` folder will be created at the 1. Ensure your `config.yml` and `keys.yml` are in the `.config/` folder at the repository root. 2. Start the node: `task up` -## 8. gRPC & REST API Access -The node exposes two APIs for programmatic access: - -| API | Port | Protocol | Binding | -| --- | --- | --- | --- | -| **gRPC** | 8337 | TCP | `127.0.0.1` (localhost only) | -| **REST** | 8338 | TCP | `127.0.0.1` (localhost only) | - -### Using grpcurl -The container includes `grpcurl` for gRPC interaction: - -```bash -# List available services -docker compose exec node grpcurl -plaintext localhost:8337 list - -# Get node info -docker compose exec node grpcurl -plaintext localhost:8337 quilibrium.node.node.pb.NodeService/GetNodeInfo - -# Get token balance -docker compose exec node grpcurl -plaintext localhost:8337 quilibrium.node.node.pb.NodeService/GetTokenInfo -``` - -### Using qclient (inside container) -```bash -docker compose exec node qclient help -docker compose exec node qclient token balance -docker compose exec node qclient token info -``` - -### Exposing APIs Externally -By default, APIs are bound to localhost for security. To expose externally, modify `docker-compose.override.yml`: - -```yaml -services: - node: - ports: - - '0.0.0.0:8337:8337/tcp' # gRPC (use with caution) - - '0.0.0.0:8338:8338/tcp' # REST (use with caution) -``` - -> [!WARNING] -> Exposing gRPC/REST externally can be a security risk. Use a reverse proxy with authentication if needed. - -## 9. Management Commands +## 4. Management Commands | Action | Task Command | Docker Command | | --- | --- | --- | From 7402ced7f3cdacdd9e8cfa5dca86490a7109cc20 Mon Sep 17 00:00:00 2001 From: Hamza Hamud <53880692+hhamud@users.noreply.github.com> Date: Fri, 26 Dec 2025 21:20:50 +0000 Subject: [PATCH 8/8] fix: remove additional comments --- docker/README.md | 59 ------------------------------------------------ 1 file changed, 59 deletions(-) diff --git a/docker/README.md b/docker/README.md index adae191..8c9abc2 100644 --- a/docker/README.md +++ b/docker/README.md @@ -42,62 +42,3 @@ If you are starting a brand new node, a `.config/` folder will be created at the ### Restore Previous Instance 1. Ensure your `config.yml` and `keys.yml` are in the `.config/` folder at the repository root. 2. Start the node: `task up` - - -## 4. Management Commands - -| Action | Task Command | Docker Command | -| --- | --- | --- | -| **Status** | `task status` | N/A | -| **Logs** | `task logs` | `docker compose logs -f` | -| **Stop** | `task down` | `docker compose down` | -| **Shell** | `task shell` | `docker compose exec -it node sh` | -| **Node Info** | `task node-info` | `docker compose exec node node -node-info` | -| **Backup** | `task backup` | N/A | -| **Restore** | `task restore` | N/A | -| **Update** | `task update` | Pull + restart | -| **Test Port** | `task test:port` | Requires `NODE_PUBLIC_NAME` | - -The `backup` task creates a `backup.tar.gz` archive in this `docker/` folder containing `config.yml` and `keys.yml` from `../.config`. Copy this file to a safe location. - -### Customizing Configuration -Create a `.env` file based on [.env.example](.env.example): - -| Variable | Default | Description | -| --- | --- | --- | -| `QUILIBRIUM_IMAGE_NAME` | `quilibrium` | Docker image name | -| `QUILIBRIUM_CONFIG_DIR` | `../.config` | Configuration directory | -| `QUILIBRIUM_P2P_PORT` | `8336` | P2P UDP port | -| `QUILIBRIUM_GRPC_PORT` | `8337` | gRPC TCP port | -| `QUILIBRIUM_REST_PORT` | `8338` | REST TCP port | -| `NODE_PUBLIC_NAME` | (none) | Public DNS/IP for port testing | - -## 10. Verification - -### Check Connectivity -Wait 5–10 minutes for the node to initialize. Look for the "Reachable" status: -```bash -docker logs -f q-node | grep "reachable" -``` - -### Test Port Visibility -```bash -NODE_PUBLIC_NAME=your.server.ip task test:port -``` - -### Monitor Performance -```bash -docker stats q-node -``` - -## 11. Troubleshooting - -| Issue | Solution | -| --- | --- | -| **Node Not Reachable** | Ensure ports 8336-8340 (UDP) are open in your firewall. | -| **Buffer Size Errors** | Re-run the `sysctl` commands in Step 1. | -| **Config Not Found** | Verify that `../.config` exists and contains your keys. | -| **Backup Fails** | Ensure `../.config/config.yml` and `../.config/keys.yml` exist. | -| **Connection Refused :60000** | Use `--network host` for worker communication. | -| **grpcurl not found** | Use the full image (`build:source`) not `node-only`. | -| **Build fails on Apple Silicon** | Use `--platform linux/amd64` for cross-compilation. |