diff --git a/.github/workflows/build_tools.yml b/.github/workflows/build_tools.yml index 2484aff0c..3e2e40caf 100644 --- a/.github/workflows/build_tools.yml +++ b/.github/workflows/build_tools.yml @@ -24,4 +24,4 @@ jobs: - name: Build genesis-snapshot tool working-directory: tools/genesis-snapshot - run: go mod tidy && go build . + run: go build . diff --git a/.github/workflows/feature-network-deploy.yml b/.github/workflows/feature-network-deploy.yml index 9d742bb9f..628507e92 100644 --- a/.github/workflows/feature-network-deploy.yml +++ b/.github/workflows/feature-network-deploy.yml @@ -44,7 +44,7 @@ jobs: - uses: actions/setup-go@v5 with: - go-version-file: 'tools/genesis-snapshot/go.mod' + go-version-file: 'go.mod' cache: false - name: Print Go version diff --git a/scripts/go_mod_tidy.sh b/scripts/go_mod_tidy.sh index 1166ea010..fac0c01ab 100755 --- a/scripts/go_mod_tidy.sh +++ b/scripts/go_mod_tidy.sh @@ -7,8 +7,4 @@ pushd tools/gendoc go mod tidy popd -pushd tools/genesis-snapshot -go mod tidy -popd - popd \ No newline at end of file diff --git a/tools/genesis-snapshot/go.mod b/tools/genesis-snapshot/go.mod deleted file mode 100644 index 32f6da780..000000000 --- a/tools/genesis-snapshot/go.mod +++ /dev/null @@ -1,69 +0,0 @@ -module github.com/iotaledger/iota-core/tools/genesis-snapshot - -go 1.21 - -replace github.com/iotaledger/iota-core => ../../ - -require ( - github.com/iotaledger/hive.go/crypto v0.0.0-20240214175801-9ca9f93790f5 - github.com/iotaledger/hive.go/ierrors v0.0.0-20240214175801-9ca9f93790f5 - github.com/iotaledger/hive.go/lo v0.0.0-20240214175801-9ca9f93790f5 - github.com/iotaledger/hive.go/runtime v0.0.0-20240214175801-9ca9f93790f5 - github.com/iotaledger/iota-core v0.0.0-00010101000000-000000000000 - github.com/iotaledger/iota.go/v4 v4.0.0-20240214180848-ff6a4bb7bc41 - github.com/mr-tron/base58 v1.2.0 - github.com/spf13/pflag v1.0.5 - golang.org/x/crypto v0.19.0 - gopkg.in/yaml.v3 v3.0.1 -) - -require ( - filippo.io/edwards25519 v1.1.0 // indirect - github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect - github.com/ethereum/go-ethereum v1.13.12 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/holiman/uint256 v1.2.4 // indirect - github.com/iancoleman/orderedmap v0.3.0 // indirect - github.com/iotaledger/grocksdb v1.7.5-0.20230220105546-5162e18885c7 // indirect - github.com/iotaledger/hive.go/ads v0.0.0-20240214175801-9ca9f93790f5 // indirect - github.com/iotaledger/hive.go/constraints v0.0.0-20240214175801-9ca9f93790f5 // indirect - github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20240214175801-9ca9f93790f5 // indirect - github.com/iotaledger/hive.go/ds v0.0.0-20240214175801-9ca9f93790f5 // indirect - github.com/iotaledger/hive.go/kvstore v0.0.0-20240214175801-9ca9f93790f5 // indirect - github.com/iotaledger/hive.go/log v0.0.0-20240214175801-9ca9f93790f5 // indirect - github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20240214175801-9ca9f93790f5 // indirect - github.com/iotaledger/hive.go/stringify v0.0.0-20240214175801-9ca9f93790f5 // indirect - github.com/iotaledger/iota-crypto-demo v0.0.0-20231208171603-786bb32fdb00 // indirect - github.com/ipfs/go-cid v0.4.1 // indirect - github.com/klauspost/cpuid/v2 v2.2.6 // indirect - github.com/kr/text v0.2.0 // indirect - github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/libp2p/go-libp2p v0.32.2 // indirect - github.com/minio/sha256-simd v1.0.1 // 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.12.2 // indirect - github.com/multiformats/go-multibase v0.2.0 // indirect - github.com/multiformats/go-multicodec v0.9.0 // indirect - github.com/multiformats/go-multihash v0.2.3 // indirect - github.com/multiformats/go-varint v0.0.7 // indirect - github.com/otiai10/copy v1.14.0 // indirect - github.com/pasztorpisti/qs v0.0.0-20171216220353-8d6c33ee906c // indirect - github.com/pelletier/go-toml/v2 v2.1.1 // indirect - github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/pokt-network/smt v0.9.2 // indirect - github.com/sasha-s/go-deadlock v0.3.1 // indirect - github.com/spaolacci/murmur3 v1.1.0 // indirect - github.com/stretchr/testify v1.8.4 // indirect - github.com/zyedidia/generic v1.2.1 // indirect - go.uber.org/atomic v1.11.0 // indirect - golang.org/x/exp v0.0.0-20240213143201-ec583247a57a // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.17.0 // indirect - golang.org/x/text v0.14.0 // indirect - google.golang.org/protobuf v1.32.0 // indirect - lukechampine.com/blake3 v1.2.1 // indirect -) diff --git a/tools/genesis-snapshot/go.sum b/tools/genesis-snapshot/go.sum deleted file mode 100644 index ebd2a2d02..000000000 --- a/tools/genesis-snapshot/go.sum +++ /dev/null @@ -1,145 +0,0 @@ -filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= -filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= -github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= -github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= -github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= -github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -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/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= -github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= -github.com/ethereum/go-ethereum v1.13.12 h1:iDr9UM2JWkngBHGovRJEQn4Kor7mT4gt9rUZqB5M29Y= -github.com/ethereum/go-ethereum v1.13.12/go.mod h1:hKL2Qcj1OvStXNSEDbucexqnEt1Wh4Cz329XsjAalZY= -github.com/fjl/memsize v0.0.2 h1:27txuSD9or+NZlnOWdKUxeBzTAUkWCVh+4Gf2dWFOzA= -github.com/fjl/memsize v0.0.2/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= -github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -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/holiman/uint256 v1.2.4 h1:jUc4Nk8fm9jZabQuqr2JzednajVmBpC+oiTiXZJEApU= -github.com/holiman/uint256 v1.2.4/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E= -github.com/iancoleman/orderedmap v0.3.0 h1:5cbR2grmZR/DiVt+VJopEhtVs9YGInGIxAoMJn+Ichc= -github.com/iancoleman/orderedmap v0.3.0/go.mod h1:XuLcCUkdL5owUCQeF2Ue9uuw1EptkJDkXXS7VoV7XGE= -github.com/iotaledger/grocksdb v1.7.5-0.20230220105546-5162e18885c7 h1:dTrD7X2PTNgli6EbS4tV9qu3QAm/kBU3XaYZV2xdzys= -github.com/iotaledger/grocksdb v1.7.5-0.20230220105546-5162e18885c7/go.mod h1:ZRdPu684P0fQ1z8sXz4dj9H5LWHhz4a9oCtvjunkSrw= -github.com/iotaledger/hive.go/ads v0.0.0-20240214175801-9ca9f93790f5 h1:3HG3ON8Imcd6UNC48cKEWs5RaUbyVlW/A5xopq1DYHk= -github.com/iotaledger/hive.go/ads v0.0.0-20240214175801-9ca9f93790f5/go.mod h1:jjVkGGP4dDQIkQI57N+amojRzbMl1skSmdkg/2bhGgQ= -github.com/iotaledger/hive.go/constraints v0.0.0-20240214175801-9ca9f93790f5 h1:PC1CUm0M8/JiXQdmVKWtIYDJIAffwAh7AQZ9hSlMwl0= -github.com/iotaledger/hive.go/constraints v0.0.0-20240214175801-9ca9f93790f5/go.mod h1:dOBOM2s4se3HcWefPe8sQLUalGXJ8yVXw58oK8jke3s= -github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20240214175801-9ca9f93790f5 h1:1DX9RGuwYqOf6kzVb+LIPYJM3Jw6ykf63hJcYfLO8Qs= -github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20240214175801-9ca9f93790f5/go.mod h1:S25had16ycO2LflaIqJq7EuQs45cWrtmy/zr84VqF9A= -github.com/iotaledger/hive.go/crypto v0.0.0-20240214175801-9ca9f93790f5 h1:Ogf77ffMx/oxb0s2Dsn2wjNDtECSQAtAQpXUdNDFSQE= -github.com/iotaledger/hive.go/crypto v0.0.0-20240214175801-9ca9f93790f5/go.mod h1:ECGlcMlvm7hO5L9etoXCILu9et9PeZOyY1WQiXP6ohs= -github.com/iotaledger/hive.go/ds v0.0.0-20240214175801-9ca9f93790f5 h1:vAf85G2ir//BA96yI7wWWbK3yUuXbcEBC15XzFbEQXQ= -github.com/iotaledger/hive.go/ds v0.0.0-20240214175801-9ca9f93790f5/go.mod h1:UxnYEJlWz87/hQxmSngDwAxPjFqbTgnDpDczL8mqXVk= -github.com/iotaledger/hive.go/ierrors v0.0.0-20240214175801-9ca9f93790f5 h1:KGyJMMNe6rEtQzuu1m/fccRPFkMQXb0xHaAlAN0gFxA= -github.com/iotaledger/hive.go/ierrors v0.0.0-20240214175801-9ca9f93790f5/go.mod h1:HcE8B5lP96enc/OALTb2/rIIi+yOLouRoHOKRclKmC8= -github.com/iotaledger/hive.go/kvstore v0.0.0-20240214175801-9ca9f93790f5 h1:KUE4ZsC4L/lChzk/Tyt1ryQii5ecqL0K+kg+qCPvtU8= -github.com/iotaledger/hive.go/kvstore v0.0.0-20240214175801-9ca9f93790f5/go.mod h1:Cr2o8GY4imGgHmuRD+/JZKaF3mtMeyIqXG5j1YA2zVo= -github.com/iotaledger/hive.go/lo v0.0.0-20240214175801-9ca9f93790f5 h1:MM41w6kwBZeGpp8ks/b+T19MsKXPZWN06kAu++dMNn0= -github.com/iotaledger/hive.go/lo v0.0.0-20240214175801-9ca9f93790f5/go.mod h1:emwj7JQEo+BOIxtkcQwfr9x4MgmdHcDMjxFZohJ+sIk= -github.com/iotaledger/hive.go/log v0.0.0-20240214175801-9ca9f93790f5 h1:hn4wslFGS11fePJS6OTbal0f3y9hH5pSSoANkLRNqQk= -github.com/iotaledger/hive.go/log v0.0.0-20240214175801-9ca9f93790f5/go.mod h1:wDmhnVYX4ETSxFjuJNKe1LtNRmWs1GvOIZNkWY9yFHc= -github.com/iotaledger/hive.go/runtime v0.0.0-20240214175801-9ca9f93790f5 h1:JRQusGWXgL94LajsVxioEHJFwc5ObpcMJOpPHciBKXI= -github.com/iotaledger/hive.go/runtime v0.0.0-20240214175801-9ca9f93790f5/go.mod h1:DAl3k9cClMCxIWbGQX44mdV3ZExly2kJW979G0bZ3cU= -github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20240214175801-9ca9f93790f5 h1:Y4Rb0YK8bOhfQPJmyLDV71VWti8GXrzmPc6Hy8QNOfU= -github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20240214175801-9ca9f93790f5/go.mod h1:Wz93StLE7p0UjPIPy/DDw0xZtuxPIUwBUa2fSmCWL9A= -github.com/iotaledger/hive.go/stringify v0.0.0-20240214175801-9ca9f93790f5 h1:KkZln2uZARc3UqQOyCQDLxNQnr2DK7bITXSg3ZCY+GM= -github.com/iotaledger/hive.go/stringify v0.0.0-20240214175801-9ca9f93790f5/go.mod h1:FTo/UWzNYgnQ082GI9QVM9HFDERqf9rw9RivNpqrnTs= -github.com/iotaledger/iota-crypto-demo v0.0.0-20231208171603-786bb32fdb00 h1:j5udgLtSN6wQgFI9vnhkdJsqsVdJmwtoc0yOmT/Ila4= -github.com/iotaledger/iota-crypto-demo v0.0.0-20231208171603-786bb32fdb00/go.mod h1:gt+URx7DZu414nZME7jtGgxR4DVTSnNa1jF2trTUTZ0= -github.com/iotaledger/iota.go/v4 v4.0.0-20240214180848-ff6a4bb7bc41 h1:vhB52blViIuGCozUMts7DL24Sh5SmuycjwKXgncdPKs= -github.com/iotaledger/iota.go/v4 v4.0.0-20240214180848-ff6a4bb7bc41/go.mod h1:C0sa6gQvtBQdAcSa7AME4Tu7E9MhkrKAxjUAHUBK9u0= -github.com/ipfs/go-cid v0.4.1 h1:A/T3qGvxi4kpKWWcPC/PgbvDA2bjVLO7n4UeVwnbs/s= -github.com/ipfs/go-cid v0.4.1/go.mod h1:uQHwDeX4c6CtyrFwdqyhpNcxVewur1M7l7fNU7LKwZk= -github.com/klauspost/cpuid/v2 v2.2.6 h1:ndNyv040zDGIDh8thGkXYjnFtiN02M1PVVF+JE/48xc= -github.com/klauspost/cpuid/v2 v2.2.6/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= -github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= -github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= -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-libp2p v0.32.2 h1:s8GYN4YJzgUoyeYNPdW7JZeZ5Ee31iNaIBfGYMAY4FQ= -github.com/libp2p/go-libp2p v0.32.2/go.mod h1:E0LKe+diV/ZVJVnOJby8VC5xzHF0660osg71skcxJvk= -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.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.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.2.0 h1:lFsAbNOGeKtuKozrtBsAkSVhv1p9D0/qedU9rQyccr0= -github.com/multiformats/go-base36 v0.2.0/go.mod h1:qvnKE++v+2MWCfePClUEjE78Z7P2a1UV0xHgWc0hkp4= -github.com/multiformats/go-multiaddr v0.12.2 h1:9G9sTY/wCYajKa9lyfWPmpZAwe6oV+Wb1zcmMS1HG24= -github.com/multiformats/go-multiaddr v0.12.2/go.mod h1:GKyaTYjZRdcUhyOetrxTk9z0cW+jA/YrnqTOvKgi44M= -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.0 h1:pb/dlPnzee/Sxv/j4PmkDRxCOi3hXTz3IbPKOXWJkmg= -github.com/multiformats/go-multicodec v0.9.0/go.mod h1:L3QTQvMIaVBkXOXXtVmYE+LI16i14xuaojr/H7Ai54k= -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-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/otiai10/copy v1.14.0 h1:dCI/t1iTdYGtkvCuBG2BgR6KZa83PTclw4U5n2wAllU= -github.com/otiai10/copy v1.14.0/go.mod h1:ECfuL02W+/FkTWZWgQqXPWZgW9oeKCSQ5qVfSc4qc4w= -github.com/otiai10/mint v1.5.1 h1:XaPLeE+9vGbuyEHem1JNk3bYc7KKqyI/na0/mLd/Kks= -github.com/otiai10/mint v1.5.1/go.mod h1:MJm72SBthJjz8qhefc4z1PYEieWmy8Bku7CjcAqyUSM= -github.com/pasztorpisti/qs v0.0.0-20171216220353-8d6c33ee906c h1:Gcce/r5tSQeprxswXXOwQ/RBU1bjQWVd9dB7QKoPXBE= -github.com/pasztorpisti/qs v0.0.0-20171216220353-8d6c33ee906c/go.mod h1:1iCZ0433JJMecYqCa+TdWA9Pax8MGl4ByuNDZ7eSnQY= -github.com/pelletier/go-toml/v2 v2.1.1 h1:LWAJwfNvjQZCFIDKWYQaM62NcYeYViCmWIwmOStowAI= -github.com/pelletier/go-toml/v2 v2.1.1/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= -github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= -github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 h1:jik8PHtAIsPlCRJjJzl4udgEf7hawInF9texMeO2jrU= -github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= -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/pokt-network/smt v0.9.2 h1:h/GnFm1F6mNBbF1hopr+9+y7nr173SU55NX7NxTVU0Y= -github.com/pokt-network/smt v0.9.2/go.mod h1:S4Ho4OPkK2v2vUCHNtA49XDjqUC/OFYpBbynRVYmxvA= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= -github.com/samber/lo v1.39.0 h1:4gTz1wUhNYLhFSKl6O+8peW0v2F4BCY034GRpU9WnuA= -github.com/samber/lo v1.39.0/go.mod h1:+m/ZKRl6ClXCE2Lgf3MsQlWfh4bn1bz6CXEOxnEXnEA= -github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0= -github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= -github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= -github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= -github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/zyedidia/generic v1.2.1 h1:Zv5KS/N2m0XZZiuLS82qheRG4X1o5gsWreGb0hR7XDc= -github.com/zyedidia/generic v1.2.1/go.mod h1:ly2RBz4mnz1yeuVbQA/VFwGjK3mnHGRj1JuoG336Bis= -go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= -go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= -golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= -golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= -golang.org/x/exp v0.0.0-20240213143201-ec583247a57a h1:HinSgX1tJRX3KsL//Gxynpw5CTOAIPhgL4W8PNiIpVE= -golang.org/x/exp v0.0.0-20240213143201-ec583247a57a/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= -google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/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.2.1 h1:YuqqRuaqsGV71BV/nm9xlI0MKUv4QC54jQnBChWbGnI= -lukechampine.com/blake3 v1.2.1/go.mod h1:0OFRp7fBtAylGVCO40o87sbupkyIGgbpv1+M1k1LM6k= diff --git a/tools/genesis-snapshot/main.go b/tools/genesis-snapshot/main.go index 01a0d6af7..c87ab179a 100644 --- a/tools/genesis-snapshot/main.go +++ b/tools/genesis-snapshot/main.go @@ -18,11 +18,11 @@ func main() { parsedOpts, configSelected := parseFlags() opts := presets.Base if strings.Contains(configSelected, ".yml") { - if yamlOpts, err := presets.GenerateFromYaml(configSelected); err != nil { + yamlOpts, err := presets.GenerateFromYaml(configSelected) + if err != nil { panic(err) - } else { - opts = append(opts, yamlOpts...) } + opts = append(opts, yamlOpts...) } else { switch configSelected { case "docker": diff --git a/tools/genesis-snapshot/presets/presets.go b/tools/genesis-snapshot/presets/presets.go index 97934ebc0..9b40eeb7b 100644 --- a/tools/genesis-snapshot/presets/presets.go +++ b/tools/genesis-snapshot/presets/presets.go @@ -16,19 +16,19 @@ import ( ) var ( - // use defaults from iota.go + // use defaults from iota.go. protocolParamsBase = iotago.NewV3SnapshotProtocolParameters( iotago.WithNetworkOptions("default", iotago.PrefixTestnet), ) - // use defaults from iota.go + // use defaults from iota.go. protocolParamsDocker = iotago.NewV3SnapshotProtocolParameters( iotago.WithNetworkOptions("docker", iotago.PrefixTestnet), iotago.WithTimeProviderOptions(5, time.Now().Unix(), 10, 7), iotago.WithLivenessOptions(10, 15, 3, 6, 8), ) - // use defaults from iota.go + // use defaults from iota.go. protocolParamsFeature = iotago.NewV3SnapshotProtocolParameters( iotago.WithNetworkOptions("feature", iotago.PrefixTestnet), iotago.WithTimeProviderOptions(666666, time.Now().Unix()-100_000, 10, 13), diff --git a/tools/genesis-snapshot/presets/presets_yaml.go b/tools/genesis-snapshot/presets/presets_yaml.go index b61f2d515..f6445dfdf 100644 --- a/tools/genesis-snapshot/presets/presets_yaml.go +++ b/tools/genesis-snapshot/presets/presets_yaml.go @@ -2,13 +2,12 @@ package presets import ( "fmt" - "os" "golang.org/x/crypto/blake2b" - "gopkg.in/yaml.v3" "github.com/iotaledger/hive.go/crypto/ed25519" "github.com/iotaledger/hive.go/lo" + "github.com/iotaledger/hive.go/runtime/ioutils" "github.com/iotaledger/hive.go/runtime/options" "github.com/iotaledger/iota-core/pkg/testsuite/mock" "github.com/iotaledger/iota-core/pkg/testsuite/snapshotcreator" @@ -18,12 +17,12 @@ import ( type ValidatorYaml struct { Name string `yaml:"name"` - PublicKey string `yaml:"public-key"` + PublicKey string `yaml:"publicKey"` } type BlockIssuerYaml struct { Name string `yaml:"name"` - PublicKey string `yaml:"public-key"` + PublicKey string `yaml:"publicKey"` } type BasicOutputYaml struct { @@ -37,22 +36,17 @@ type ConfigYaml struct { FilePath string `yaml:"filepath"` Validators []ValidatorYaml `yaml:"validators"` - BlockIssuers []BlockIssuerYaml `yaml:"block-issuers"` - BasicOutputs []BasicOutputYaml `yaml:"basic-outputs"` + BlockIssuers []BlockIssuerYaml `yaml:"blockIssuers"` + BasicOutputs []BasicOutputYaml `yaml:"basicOutputs"` } func GenerateFromYaml(hostsFile string) ([]options.Option[snapshotcreator.Options], error) { - yamlFile, err := os.ReadFile(hostsFile) - if err != nil { - return nil, err - } var configYaml ConfigYaml - err = yaml.Unmarshal(yamlFile, &configYaml) - if err != nil { + if err := ioutils.ReadYAMLFromFile(hostsFile, &configYaml); err != nil { return nil, err } - var accounts []snapshotcreator.AccountDetails + accounts := make([]snapshotcreator.AccountDetails, 0, len(configYaml.Validators)+len(configYaml.BlockIssuers)) for _, validator := range configYaml.Validators { pubkey := validator.PublicKey fmt.Printf("adding validator %s with publicKey %s\n", validator.Name, pubkey) @@ -86,7 +80,7 @@ func GenerateFromYaml(hostsFile string) ([]options.Option[snapshotcreator.Option accounts = append(accounts, account) } - var basicOutputs []snapshotcreator.BasicOutputDetails + basicOutputs := make([]snapshotcreator.BasicOutputDetails, 0, len(configYaml.BasicOutputs)) for _, basicOutput := range configYaml.BasicOutputs { address := lo.Return2(iotago.ParseBech32(basicOutput.Address)) amount := basicOutput.Amount