chainspace-go icon indicating copy to clipboard operation
chainspace-go copied to clipboard

'make contract' command fails

Open savvysiddharth opened this issue 3 years ago • 2 comments

I'm trying to run this code locally on my machine. I followed instructions from Docs. Though chainspace is installed as I'm able to run chainspace genload command successfully, but make contract fails with this error: go: go.mod file not found in current directory or any parent directory; see 'go help modules'

Adding screenshot for reference image

savvysiddharth avatar Feb 24 '22 13:02 savvysiddharth

Modified ./chainspace-go/dummycontract/Dockerfile

FROM golang:alpine AS build

COPY . /go/src/chainspace.io/dummychecker
WORKDIR /go/src/chainspace.io/dummychecker
ADD . .
RUN go mod init
RUN CGO_ENABLED=0 GOOS=linux go build -a -tags netgo -ldflags '-w'

FROM scratch

COPY --from=build /go/src/chainspace.io/dummychecker/dummychecker /dummychecker

ENTRYPOINT ["/dummychecker"]

I added ADD . . and RUN go mod init before the RUN CGO_.. line and go.mod is not issue anymore, but it throws another error: go install: version is required when current directory is not in a module

Attaching screenshot for reference: image

Using @latest suffix didn't help, as it threw another error as follows:

image

savvysiddharth avatar Feb 24 '22 18:02 savvysiddharth

Hey -- no one is maintaining this code since the chainspace team joined Novi / FB back in Feb 3, 2019 :(

gdanezis avatar Jun 17 '22 13:06 gdanezis