Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not Running in the Development Rig Local-style #2

Open
loffelmacher opened this issue Oct 28, 2018 · 4 comments
Open

Not Running in the Development Rig Local-style #2

loffelmacher opened this issue Oct 28, 2018 · 4 comments

Comments

@loffelmacher
Copy link

I've run through the sample twice now, via a "local" setup in the Dev Rig. I cannot get it to make any calls to the backend. I don't really see anything in the UI when loading this through the Dev Rig.

@loffelmacher
Copy link
Author

What I did to get it working was to mimic the directory structure of a typical GOPATH at ~/go so that I had bin pkg and src directories under the ebs directory. Put the go source files way down the src/github path.

Things started working and I was able to deploy to AppEngine this way too.

@rewinfrey
Copy link

@loffelmacher 👋 I'm new to Go and trying to get the animal-facts twitch extension running locally with the developer rig. I have had success getting the other example extensions running locally, but I'm not familiar with Go path and Go project structure.

Could you share more details on what you did to get this setup working? Any replication steps would be very appreciated 🙇

@rewinfrey
Copy link

rewinfrey commented Nov 12, 2018

I was able to get farther, documenting what I did in case it is helpful for others:

  1. Have a read over the first section of https://golang.org/doc/code.html which provides a good overview of the assumptions Go makes about your workspace, Go path, and essentials about how the Go build tool works. Namely you want to understand where your default Go path is, and the structure of your Go path (NB: the src directory holds your Go package files, and the bin directory contains executable binaries built from your Go packages in src).

  2. I made a copy of the ebs directory's Go files and vendor directory into $GOPATH/src/github.com/rewinfrey/animal-facts.

  3. cd $GOPATH/src/github.com/rewinfrey/animal-facts.

  4. dep ensure (I think this ensures dependencies in the vendor directly are up to date).

  5. I modified main.go to a hard-coded path to the .env file (within the ebs directory).

  6. I modified main.go to hardcoded paths for the conf/server.crt and conf/server.key files (within the original animal-facts directory provided by the Twitch developer rig).

  7. go build (This builds the Go package).

  8. go install (This adds an executable binary with the name of the package in $GOPATH/bin).

  9. Update the developer rig's Back-end run command to point to the location of your Go bin executable (e.g. /Users/rewinfrey/go/bin/animal-facts)

  10. Click activate and if file locations line up according to the edits in main.go you should see the running message.

You also have to update the .env file to include your Twitch extension's secret and client id, but I found that the owner id was not necessary.

Also generally I think the recommended path is to first create your extension on your dev.twitch.tv dashboard, and use the secret and client id from your extension manifest for configuring the extension scaffold the developer rig provides. I found that confusing initially but seems like an important step.

Currently I'm stuck after building the Go package and running it within the Twitch developer rig. When making the first configuration view and testing the "save" button, the developer rig reports an error with the log message signature is invalid. I know this is related to the certificates, but not sure yet about the fix. I'll report back if I find the answer.

@loffelmacher
Copy link
Author

Just seeing this now @rewinfrey. I kind of abandoned the Dev Rig after this. Perhaps I'll give it another go soon, though the certificate problems make me leery of doing so.

An additional complication is that I'm writing my backend to be installed in AppEngine, so I needed to satisfy its requirements. Ultimately I did something a bit like you did, but I copied everything under my $GOPATH/src directory into one which sits next to the frontend code. I export GOPATH to point at the root directory of my project, and go buildworks as doesgcloud app deploy`. This is with the 1.11 version of AppEngine standard for golang.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants