jotagep / harmony-dapp-template

🧰 All-in-one forkable Harmony dev stack to build your dapp
MIT License
10 stars 9 forks source link

Failing to build #15

Open afwebdev opened 2 years ago

afwebdev commented 2 years ago

OS: Windows 11 + WSL2 (Ubuntu 20.04.3 LTS )

➜ yarn autoinit
yarn run v1.22.16
$ ./scripts/autoinit.sh
[1/4] Resolving packages...
success Already up-to-date.
$ docker build -t harmonyone/localnet docker
[+] Building 0.3s (2/3)                                                                                                                                                                                  
[+] Building 22.6s (19/24)                                                                                                                                                                               
 => [internal] load build definition from Dockerfile                                                                                                                                                0.0s
 => => transferring dockerfile: 38B                                                                                                                                                                 0.0s
 => [internal] load .dockerignore                                                                                                                                                                   0.0s
 => => transferring context: 2B                                                                                                                                                                     0.0s
 => [internal] load metadata for docker.io/harmonyone/localnet-test:latest                                                                                                                          0.7s
 => [ 1/20] FROM docker.io/harmonyone/localnet-test@sha256:75af616f14d984c1c616b18bf366ed61f0cbed97e1fbb04c9381b0e1c9592b29                                                                         0.0s
 => [internal] load build context                                                                                                                                                                   0.0s
 => => transferring context: 263B                                                                                                                                                                   0.0s
 => CACHED [ 2/20] RUN hmy keys import-private-key 144109d9b1182b51233955c112f64a545bb70143539f161e936bb01f8b1e081d                                                                                 0.0s
 => CACHED [ 3/20] RUN hmy keys import-private-key 59f46b7addacb231e75932d384c5c75d5e9a84920609b5d27a57922244efbf90                                                                                 0.0s
 => CACHED [ 4/20] RUN hmy keys import-private-key d8ee0370d50f5d32c50704f4a0d01f027ab048d9cdb2f137b7ae852d8590d63f                                                                                 0.0s
 => CACHED [ 5/20] RUN hmy keys import-private-key ff356a09310ab648ace558574ca84777f21612f6652867776095a95919a47314                                                                                 0.0s
 => CACHED [ 6/20] RUN hmy keys import-private-key ed6e49719b1d7c82f364bf843d3d17bb5fd7af8a773cdc18c710c2642566cefa                                                                                 0.0s
 => CACHED [ 7/20] RUN hmy keys import-private-key 330032b37bdcd8d8f3d9aae0c8403dcbb24915362493e998f7e0b631f20d3f91                                                                                 0.0s
 => CACHED [ 8/20] RUN hmy keys import-private-key 4e856590fc9233cfc215e5bffe4efdb9611d8e2db78d38be24e02b469fddb5a5                                                                                 0.0s
 => CACHED [ 9/20] RUN hmy keys import-private-key 4d00a5621249165d7fb76bac56cd01786b64a301fffba0137c5fa997c3069163                                                                                 0.0s
 => CACHED [10/20] RUN hmy keys import-private-key 5b2984da0bb75e22208dc3baf8f5a1eb86099418c6b3516d132c70199ce67c65                                                                                 0.0s
 => CACHED [11/20] RUN hmy keys import-private-key 86cc025e63f934f80e4377a022df3623abbdb5a5803089fe80ffb86dad76b864                                                                                 0.0s
 => CACHED [12/20] RUN hmy keys import-private-key 5709f12bc34677a96ed3f01898329eedb0d78a499159ad5a541cdce8c77a3de3                                                                                 0.0s
 => CACHED [13/20] WORKDIR /go/src/github.com/harmony-one                                                                                                                                           0.0s
 => CACHED [14/20] RUN git clone https://github.com/harmony-one/harmony.git                                                                                                                         0.0s
 => ERROR [15/20] RUN cd harmony && go get github.com/pborman/uuid && go get github.com/rjeczalik/notify     && go get github.com/cespare/cp && go get github.com/libp2p/go-libp2p-crypto && go g  21.8s
------                                                                                                                                                                                                   
 > [15/20] RUN cd harmony && go get github.com/pborman/uuid && go get github.com/rjeczalik/notify     && go get github.com/cespare/cp && go get github.com/libp2p/go-libp2p-crypto && go get github.com/kr/pretty     && go get github.com/kr/text && go get gopkg.in/check.v1 && bash scripts/install_build_tools.sh && make:                                                                                    
#18 1.305 go get: upgraded github.com/pborman/uuid v1.2.0 => v1.2.1                                                                                                                                      
#18 4.653 go get: upgraded github.com/kr/pretty v0.2.1 => v0.3.0                                                                                                                                         
#18 5.439 goget.sh: github.com/golang/mock/mockgen is provided by github.com/golang/mock@v1.4.4                                                                                                          
#18 6.499 goget.sh: github.com/golang/protobuf/protoc-gen-go is provided by github.com/golang/protobuf@v1.4.3
#18 12.08 goget.sh: github.com/golangci/golangci-lint/cmd/golangci-lint is provided by github.com/golangci/golangci-lint@v1.22.2
#18 19.26 goget.sh: github.com/harmony-ek/gencodec is provided by github.com/harmony-ek/gencodec@v0.0.0-20190215044613-e6740dbdd846
#18 19.93 goget.sh: golang.org/x/lint/golint is provided by golang.org/x/lint@v0.0.0-20210508222113-6edffad5e616
#18 20.46 goget.sh: golang.org/x/tools/cmd/goimports is provided by golang.org/x/tools@v0.1.7
#18 20.83 Downloading protoc v3.12.3 for linux-x86_64...
#18 21.28 Downloaded as protoc-3.12.3-linux-x86_64.zip; unzipping into /usr/local...
#18 21.29 Archive:  protoc-3.12.3-linux-x86_64.zip
#18 21.29   inflating: /usr/local/include/google/protobuf/api.proto  
#18 21.29   inflating: /usr/local/include/google/protobuf/descriptor.proto  
#18 21.29   inflating: /usr/local/include/google/protobuf/timestamp.proto  
#18 21.29   inflating: /usr/local/include/google/protobuf/duration.proto  
#18 21.29   inflating: /usr/local/include/google/protobuf/compiler/plugin.proto  
#18 21.29   inflating: /usr/local/include/google/protobuf/field_mask.proto  
#18 21.29   inflating: /usr/local/include/google/protobuf/source_context.proto  
#18 21.29   inflating: /usr/local/include/google/protobuf/type.proto  
#18 21.29   inflating: /usr/local/include/google/protobuf/wrappers.proto  
#18 21.29   inflating: /usr/local/include/google/protobuf/struct.proto  
#18 21.29   inflating: /usr/local/include/google/protobuf/any.proto  
#18 21.29   inflating: /usr/local/include/google/protobuf/empty.proto  
#18 21.29   inflating: /usr/local/bin/protoc   
#18 21.33   inflating: /usr/local/readme.txt   
#18 21.33 protoc v3.12.3 has been installed in /usr/local.
#18 21.33 make -C /go/src/github.com/harmony-one/mcl -j8
#18 21.34 make[1]: Entering directory '/go/src/github.com/harmony-one/mcl'
#18 21.35 make[1]: Nothing to be done for 'all'.
#18 21.35 make[1]: Leaving directory '/go/src/github.com/harmony-one/mcl'
#18 21.35 make -C /go/src/github.com/harmony-one/bls BLS_SWAP_G=1 -j8
#18 21.35 make[1]: Entering directory '/go/src/github.com/harmony-one/bls'
#18 21.36 $PATH_VAL is [$PATH:"../../../lib:../../../../mcl/lib" LD_LIBRARY_PATH="../../../lib:../../../../mcl/lib" DYLD_LIBRARY_PATH="../../../lib:../../../../mcl/lib" CGO_LDFLAGS="-L../../../lib" CGO_CFLAGS="-I/go/src/github.com/harmony-one/bls/include -I/go/src/github.com/harmony-one/bls/../mcl/include"]
#18 21.37 make[1]: Nothing to be done for 'all'.
#18 21.37 make[1]: Leaving directory '/go/src/github.com/harmony-one/bls'
#18 21.37 bash ./scripts/go_executable_build.sh -S
#18 21.46 building ./cmd/bootnode
#18 21.54 internal/bech32/bech32.go:4:2: missing go.sum entry for module providing package github.com/btcsuite/btcutil/bech32 (imported by github.com/harmony-one/harmony/internal/bech32); to add:
#18 21.54       go get github.com/harmony-one/harmony/internal/bech32
#18 21.54 internal/utils/utils.go:17:2: missing go.sum entry for module providing package github.com/ethereum/go-ethereum/common (imported by github.com/harmony-one/harmony/internal/utils); to add:
#18 21.54       go get github.com/harmony-one/harmony/internal/utils
#18 21.54 internal/common/address.go:12:2: missing go.sum entry for module providing package github.com/ethereum/go-ethereum/common/hexutil (imported by github.com/harmony-one/harmony/internal/common); to add:
#18 21.54       go get github.com/harmony-one/harmony/internal/common
#18 21.54 internal/genesis/genesis.go:9:2: missing go.sum entry for module providing package github.com/ethereum/go-ethereum/crypto (imported by github.com/harmony-one/harmony/internal/genesis); to add:
#18 21.54       go get github.com/harmony-one/harmony/internal/genesis
#18 21.54 cmd/bootnode/main.go:11:2: missing go.sum entry for module providing package github.com/ethereum/go-ethereum/log (imported by github.com/harmony-one/harmony/cmd/bootnode); to add:
#18 21.54       go get github.com/harmony-one/harmony/cmd/bootnode
#18 21.54 shard/shard_state.go:13:2: missing go.sum entry for module providing package github.com/ethereum/go-ethereum/rlp (imported by github.com/harmony-one/harmony/shard); to add:
#18 21.54       go get github.com/harmony-one/harmony/shard
#18 21.54 api/service/prometheus/service.go:14:2: missing go.sum entry for module providing package github.com/ethereum/go-ethereum/rpc (imported by github.com/harmony-one/harmony/api/service/prometheus); to add:
#18 21.54       go get github.com/harmony-one/harmony/api/service/prometheus
#18 21.54 internal/utils/utils.go:18:2: missing go.sum entry for module providing package github.com/harmony-one/bls/ffi/go/bls (imported by github.com/harmony-one/harmony/internal/utils); to add:
#18 21.54       go get github.com/harmony-one/harmony/internal/utils
#18 21.54 p2p/stream/types/interface.go:5:2: missing go.sum entry for module providing package github.com/hashicorp/go-version (imported by github.com/harmony-one/harmony/p2p/stream/types); to add:
#18 21.54       go get github.com/harmony-one/harmony/p2p/stream/types
#18 21.54 crypto/bls/mask.go:5:2: missing go.sum entry for module providing package github.com/hashicorp/golang-lru (imported by github.com/harmony-one/harmony/crypto/bls); to add:
#18 21.54       go get github.com/harmony-one/harmony/crypto/bls
#18 21.54 /go/pkg/mod/github.com/libp2p/go-libp2p-core@v0.8.6/peer/peer.go:10:2: missing go.sum entry for module providing package github.com/ipfs/go-cid (imported by github.com/libp2p/go-libp2p-core/peer); to add:
#18 21.54       go get github.com/libp2p/go-libp2p-core/peer@v0.8.6
#18 21.54 p2p/discovery/option.go:7:2: missing go.sum entry for module providing package github.com/ipfs/go-ds-badger (imported by github.com/harmony-one/harmony/p2p/discovery); to add:
#18 21.54       go get github.com/harmony-one/harmony/p2p/discovery
#18 21.54 /go/pkg/mod/github.com/libp2p/go-libp2p-core@v0.8.6/network/network.go:13:2: missing go.sum entry for module providing package github.com/jbenet/goprocess (imported by github.com/libp2p/go-libp2p-core/network); to add:
#18 21.54       go get github.com/libp2p/go-libp2p-core/network@v0.8.6
#18 21.54 /go/pkg/mod/github.com/libp2p/go-libp2p-core@v0.8.6/record/envelope.go:12:2: missing go.sum entry for module providing package github.com/libp2p/go-buffer-pool (imported by github.com/libp2p/go-libp2p-core/record); to add:
#18 21.54       go get github.com/libp2p/go-libp2p-core/record@v0.8.6
#18 21.54 p2p/host.go:20:2: missing go.sum entry for module providing package github.com/libp2p/go-libp2p (imported by github.com/harmony-one/harmony/p2p); to add:
#18 21.54       go get github.com/harmony-one/harmony/p2p
#18 21.54 p2p/discovery/discovery.go:11:2: missing go.sum entry for module providing package github.com/libp2p/go-libp2p-discovery (imported by github.com/harmony-one/harmony/p2p/discovery); to add:
#18 21.54       go get github.com/harmony-one/harmony/p2p/discovery
#18 21.54 p2p/discovery/discovery.go:12:2: missing go.sum entry for module providing package github.com/libp2p/go-libp2p-kad-dht (imported by github.com/harmony-one/harmony/p2p/discovery); to add:
#18 21.54       go get github.com/harmony-one/harmony/p2p/discovery
#18 21.54 p2p/host.go:26:2: missing go.sum entry for module providing package github.com/libp2p/go-libp2p-pubsub (imported by github.com/harmony-one/harmony/p2p); to add:
#18 21.54       go get github.com/harmony-one/harmony/p2p
#18 21.54 /go/pkg/mod/github.com/libp2p/go-libp2p-core@v0.8.6/peer/peer.go:12:2: missing go.sum entry for module providing package github.com/mr-tron/base58/base58 (imported by github.com/libp2p/go-libp2p-core/peer); to add:
#18 21.54       go get github.com/libp2p/go-libp2p-core/peer@v0.8.6
#18 21.54 /go/pkg/mod/github.com/libp2p/go-libp2p-core@v0.8.6/peer/addrinfo.go:6:2: missing go.sum entry for module providing package github.com/multiformats/go-multiaddr (imported by github.com/harmony-one/harmony/cmd/bootnode); to add:
#18 21.54       go get github.com/harmony-one/harmony/cmd/bootnode
#18 21.54 p2p/types/peerAddr.go:11:2: missing go.sum entry for module providing package github.com/multiformats/go-multiaddr-dns (imported by github.com/harmony-one/harmony/p2p/types); to add:
#18 21.54       go get github.com/harmony-one/harmony/p2p/types
#18 21.54 /go/pkg/mod/github.com/libp2p/go-libp2p-core@v0.8.6/peer/peer.go:13:2: missing go.sum entry for module providing package github.com/multiformats/go-multihash (imported by github.com/libp2p/go-libp2p-core/peer); to add:
#18 21.54       go get github.com/libp2p/go-libp2p-core/peer@v0.8.6
#18 21.54 /go/pkg/mod/github.com/libp2p/go-libp2p-core@v0.8.6/record/envelope.go:15:2: missing go.sum entry for module providing package github.com/multiformats/go-varint (imported by github.com/libp2p/go-libp2p-core/record); to add:
#18 21.54       go get github.com/libp2p/go-libp2p-core/record@v0.8.6
#18 21.54 internal/utils/singleton.go:13:2: missing go.sum entry for module providing package github.com/natefinch/lumberjack (imported by github.com/harmony-one/harmony/internal/utils); to add:
#18 21.54       go get github.com/harmony-one/harmony/internal/utils
#18 21.54 api/service/prometheus/service.go:16:2: missing go.sum entry for module providing package github.com/prometheus/client_golang/prometheus (imported by github.com/harmony-one/harmony/p2p/stream/types); to add:
#18 21.54       go get github.com/harmony-one/harmony/p2p/stream/types
#18 21.54 api/service/prometheus/service.go:17:2: missing go.sum entry for module providing package github.com/prometheus/client_golang/prometheus/promhttp (imported by github.com/harmony-one/harmony/api/service/prometheus); to add:
#18 21.54       go get github.com/harmony-one/harmony/api/service/prometheus
#18 21.54 api/service/prometheus/service.go:18:2: missing go.sum entry for module providing package github.com/prometheus/client_golang/prometheus/push (imported by github.com/harmony-one/harmony/api/service/prometheus); to add:
#18 21.54       go get github.com/harmony-one/harmony/api/service/prometheus
#18 21.54 internal/utils/singleton.go:14:2: missing go.sum entry for module providing package github.com/rs/zerolog (imported by github.com/harmony-one/harmony/internal/utils); to add:
#18 21.54       go get github.com/harmony-one/harmony/internal/utils
#18 21.54 internal/utils/singleton.go:15:2: missing go.sum entry for module providing package github.com/rs/zerolog/diode (imported by github.com/harmony-one/harmony/internal/utils); to add:
#18 21.54       go get github.com/harmony-one/harmony/internal/utils
#18 21.54 crypto/hash/hash.go:5:2: missing go.sum entry for module providing package golang.org/x/crypto/sha3 (imported by github.com/harmony-one/harmony/shard); to add:
#18 21.54       go get github.com/harmony-one/harmony/shard
#18 21.54 internal/utils/passphrase.go:13:2: missing go.sum entry for module providing package golang.org/x/crypto/ssh/terminal (imported by github.com/harmony-one/harmony/internal/utils); to add:
#18 21.54       go get github.com/harmony-one/harmony/internal/utils
#18 21.55 make: *** [Makefile:18: all] Error 1
------
executor failed running [/bin/bash -c cd harmony && go get github.com/pborman/uuid && go get github.com/rjeczalik/notify     && go get github.com/cespare/cp && go get github.com/libp2p/go-libp2p-crypto && go get github.com/kr/pretty     && go get github.com/kr/text && go get gopkg.in/check.v1 && bash scripts/install_build_tools.sh && make]: exit code: 2
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
$ docker run --name harmony-localnet --rm -d -p 9500:9500 -p 9501:9501 -p 9800:9800 -p 9801:9801 harmonyone/localnet && ./scripts/init-node.sh
Unable to find image 'harmonyone/localnet:latest' locally
time="2021-10-19T17:28:33-04:00" level=error msg="failed to create file hook: while creating logrus local file hook: unable to get 'APPDATA'"
docker: Error response from daemon: pull access denied for harmonyone/localnet, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.
See 'docker run --help'.
error Command failed with exit code 125.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
$ yarn workspace @dnat/hardhat deploy:live
$ hardhat deploy --export ../frontend/src/contracts/contracts.json --watch
Initial scan complete. Ready for changes
Nothing to compile
No need to generate any newer typings.
failed to get chainId, falling back on net_version...
HardhatError: HH108: Cannot connect to the network localnet.
Please make sure your node is running, and check your internet connection and networks config
    at HttpProvider._fetchJsonRpcResponse (/home/andrew/Projects/dnat/packages/hardhat/node_modules/hardhat/src/internal/core/providers/http.ts:176:15)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at HttpProvider.request (/home/andrew/Projects/dnat/packages/hardhat/node_modules/hardhat/src/internal/core/providers/http.ts:55:29)
    at GanacheGasMultiplierProvider._isGanache (/home/andrew/Projects/dnat/packages/hardhat/node_modules/hardhat/src/internal/core/providers/gas-providers.ts:302:30)
    at GanacheGasMultiplierProvider.request (/home/andrew/Projects/dnat/packages/hardhat/node_modules/hardhat/src/internal/core/providers/gas-providers.ts:291:23)
    at ChainIdValidatorProvider._getChainIdFromEthNetVersion (/home/andrew/Projects/dnat/packages/hardhat/node_modules/hardhat/src/internal/core/providers/chainId.ts:33:17)
    at ChainIdValidatorProvider._getChainId (/home/andrew/Projects/dnat/packages/hardhat/node_modules/hardhat/src/internal/core/providers/chainId.ts:17:25)
    at ChainIdValidatorProvider.request (/home/andrew/Projects/dnat/packages/hardhat/node_modules/hardhat/src/internal/core/providers/chainId.ts:55:29)
    at DeploymentsManager.getChainId (/home/andrew/Projects/dnat/packages/hardhat/node_modules/hardhat-deploy/src/DeploymentsManager.ts:424:23)
    at DeploymentsManager.loadDeployments (/home/andrew/Projects/dnat/packages/hardhat/node_modules/hardhat-deploy/src/DeploymentsManager.ts:557:17)

    Caused by: FetchError: request to http://localhost:9500/ failed, reason: connect ECONNREFUSED 127.0.0.1:9500
        at ClientRequest.<anonymous> (/home/andrew/Projects/dnat/packages/hardhat/node_modules/node-fetch/lib/index.js:1461:11)
        at ClientRequest.emit (events.js:400:28)
        at ClientRequest.emit (domain.js:475:12)
        at Socket.socketErrorListener (_http_client.js:475:9)
        at Socket.emit (events.js:400:28)
        at Socket.emit (domain.js:475:12)
        at emitErrorNT (internal/streams/destroy.js:106:8)
        at emitErrorCloseNT (internal/streams/destroy.js:74:3)
        at processTicksAndRejections (internal/process/task_queues.js:82:21)
giangjac commented 2 years ago

@afwebdev, I ran into the same thing. It looks like there are some missing modules. I was able to build localnet by adding && go mod tidy after cd harmony on https://github.com/jotagep/harmony-dapp-template/blob/master/docker/Dockerfile#L24 (ref: https://go.dev/ref/mod#go-mod-tidy)