Safenetwork Git Portal Discussion

Yes you’re right! It’s /home/user/src/go_wasm/p2p-git-portal-poc/src/main.go So what should the target directory be? /home/usr/src/ has two subdirectories, go_wasm and wasm_test.

I think it’s go_wasm, I changed the suggested location in the README so one is from the previous tests and the other you will have created for these tests. You can check the dates with ls -l.

Oh, and I think you need to run the command from the same directory as main.go

Aha! Getting somewhere now, but not arrived yet. Does this help?

`user@user:~/src/go_wasm/p2p-git-portal-poc/src$ /usr/bin/go build -o /home/user/src/go_wasm/p2p-git-portal-poc/src/main.go /home/user/src/go_wasm/main.go
go: github.com/happybeing/webpack-golang-wasm-async-loader/gobridge@v0.1.0: parsing /home/mrh/src/go/src/github.com/happybeing/webpack-golang-wasm-async-loader/gobridge/go.mod: open /home/mrh/src/go/src/github.com/happybeing/webpack-golang-wasm-async-loader/gobridge/go.mod: no such file or directory

`

1 Like

Yes, this is the issue. I’m new to publishing to npm (the golang wasm plugin my first yesterday) and npm publish is a little bugger. Even getting it to publish was tricky!

Anyway, think I have the solution and fingers crossed this will fix it:

cd p2p-git-portal-poc
git pull
yarn # to update the golang plugin

yarn build

If that doesn’t work, try removing node_modules and then yarn && yarn build

If the build succeeds, try yarn dev to run the web server and open a browser at localhost:5000 I think (or maybe 127.0.0.1:5000, check what it says in the console).

Thanks again.

Not yet I’m afraid

On yarn build

ERROR in ./src/main.go
Module build failed (from ./node_modules/golang-wasm-async-loader2/dist/index.js):
Error: Command failed: /usr/lib/go-1.13/bin/go build -o -a /home/user/src/go_wasm/p2p-git-portal-poc/src/main.go.wasm /home/user/src/go_wasm/p2p-git-portal-poc/src/main.go
can't load package: named files must be .go files: /home/user/src/go_wasm/p2p-git-portal-poc/src/main.go.wasm

    at ChildProcess.exithandler (child_process.js:303:12)
    at ChildProcess.emit (events.js:315:20)
    at maybeClose (internal/child_process.js:1051:16)
    at Socket.<anonymous> (internal/child_process.js:442:11)
    at Socket.emit (events.js:315:20)
    at Pipe.<anonymous> (net.js:671:12)
 @ ./src/App.svelte 28:0-29 469:81-85
 @ ./src/main.js
 @ multi ./src/main.js
error Command failed with exit code 2.

EDIT: just checking all these dirs and files exist on my system
/usr/lib/go-1.13/bin/go build -o -a /home/user/src/go_wasm/p2p-git-portal-poc/src/main.go.wasm /home/user/src/go_wasm/p2p-git-portal-poc/src/main.go

I think these may be wrong:
/usr/lib/go-1.13/bin/go - doesn’t exist - I have /usr/lib/go/bin/go
/home/user/src/go_wasm/p2p-git-portal-poc/src/main.go.wasm - is the .wasm correct here?

1 Like

NO - was about to file an issue and then the phone went… and then matters arising… and then they needed fed, and then I forgot…

Sorry

1 Like

Sorry John, I’m now crossing my toes too so when you have the time, repeating the last set of instructions should now work! If not, it will have to wait until after the Rubgy! :rugby_football:

Fraid not! Started again from scratch:

Module build failed (from ./node_modules/golang-wasm-async-loader2/dist/index.js):
Error: Command failed: /usr/lib/go-1.13/bin/go build -o /home/user/src/go_wasm/p2p-git-portal-poc/src/main.go.wasm /home/user/src/go_wasm/p2p-git-portal-poc/src/main.go
go: github.com/happybeing/webpack-golang-wasm-async-loader/gobridge@v0.1.0: parsing /home/mrh/src/go/src/github.com/happybeing/webpack-golang-wasm-async-loader/gobridge/go.mod: open /home/mrh/src/go/src/github.com/happybeing/webpack-golang-wasm-async-loader/gobridge/go.mod: no such file or directory

        at ChildProcess.exithandler (child_process.js:303:12)
        at ChildProcess.emit (events.js:315:20)
        at maybeClose (internal/child_process.js:1051:16)
        at Socket.<anonymous> (internal/child_process.js:442:11)
        at Socket.emit (events.js:315:20) at Pipe.<anonymous> (net.js:671:12)
     @ ./src/App.svelte 28:0-29 469:81-85
     @ ./src/main.js
     @ multi ./src/main.js```

OK been out for a somewhat too-invigorating walk ( it pished down just as I was furthest from the house) and have a large mug of strong filter coffee steaming beside me.
Going to read through all the above and try again - with adjustments for my own local path.

Wish me luck and if works I’ll recount the yarn below.
If it doesn’t I’ll moan the face off youse. - hopefully just positively enough that I’ll get away with it.

I should hang on a bit Willie, I’m going to have another look in a moment as that’s a bug in the plugin which I should be able to isolate.

1 Like

Well here’s the first problem

➜  p2p-git-portal-poc git:(main) ✗ node -v
v10.19.0

Well Ive sorted that at least - now on v15.2.1
and will wait for word from you.

Ok, @Southside, off you go. I’ve published v1.0.6 of the plugin and confess I’m still confused as to what I need to do so I’ll be interested to learn what happens. It’s working for me but who knows!

EDIT: I’ve updated both the plugin and the poc so the safest way will be to start by cloning the p2p-git-portal-poc from scratch as in the README.

1 Like

And heres how it went …

tl;dr could not find main.js in /src

➜  p2p-git-portal-poc git:(main) ✗ git pull
remote: Enumerating objects: 24, done.
remote: Counting objects: 100% (24/24), done.
remote: Compressing objects: 100% (11/11), done.
remote: Total 18 (delta 13), reused 12 (delta 7), pack-reused 0
Unpacking objects: 100% (18/18), 2.10 KiB | 0 bytes/s, done.
From https://github.com/happybeing/p2p-git-portal-poc
   2552e40..c6aa5b2  main       -> origin/main
Updating 2552e40..c6aa5b2
Fast-forward
 package.json | 2 +-
 src/go.mod   | 5 ++---
 src/go.sum   | 3 +++
 yarn.lock    | 8 ++++----
 4 files changed, 10 insertions(+), 8 deletions(-)
➜  p2p-git-portal-poc git:(main) ✗ export GOROOT=`go env GOROOT`
➜  p2p-git-portal-poc git:(main) ✗ echo $GOROOT
/usr/lib/go-1.13
➜  p2p-git-portal-poc git:(main) ✗ export GOPATH=`go env GOPATH`
➜  p2p-git-portal-poc git:(main) ✗ echo $GOPATH                 
/home/willie/projects
➜  p2p-git-portal-poc git:(main) ✗ which go
/usr/bin/go
➜  p2p-git-portal-poc git:(main) ✗ yarn 
yarn install v1.22.5
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@2.1.3: The platform "linux" is incompatible with this module.
info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents@1.2.13: The platform "linux" is incompatible with this module.
info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
Done in 43.79s.
➜  p2p-git-portal-poc git:(main) ✗ yarn build
yarn run v1.22.5
$ webpack
Hash: 300925272e49ca0f66a2
Version: webpack 4.44.2
Time: 148ms
Built at: 21/11/2020 18:35:00
        Asset      Size  Chunks                   Chunk Names
    bundle.js  3.89 KiB  bundle  [emitted]        bundle
bundle.js.map  3.51 KiB  bundle  [emitted] [dev]  bundle
Entrypoint bundle = bundle.js bundle.js.map
[0] multi ./src/main.js 28 bytes {bundle} [built]

ERROR in multi ./src/main.js
Module not found: Error: Can't resolve './src/main.js' in '/home/willie/projects/shared/p2p-git-portal-poc'
 @ multi ./src/main.js bundle[0]
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
➜  p2p-git-portal-poc git:(main) ✗ ls -al
total 408
drwxrwxr-x   6 willie willie   4096 Nov 21 18:32 .
drwxr-xr-x   5 willie willie   4096 Nov 20 15:21 ..
drwxrwxr-x   8 willie willie   4096 Nov 21 18:32 .git
-rw-rw-r--   1 willie willie     47 Nov 20 15:21 .gitignore
-rw-rw-r--   1 willie willie 133450 Nov 20 15:21 gitportal-poc-stage1.png
-rw-rw-r--   1 willie willie  35149 Nov 20 15:21 LICENSE
drwxrwxr-x 497 willie willie  20480 Nov 21 18:34 node_modules
-rwxrwxr-x   1 willie willie    737 Nov 21 18:32 package.json
drwxrwxr-x   2 willie willie   4096 Nov 21 14:10 public
-rw-rw-r--   1 willie willie   5813 Nov 20 15:21 README.md
drwxrwxr-x   3 willie willie   4096 Nov 21 18:32 src
-rw-rw-r--   1 willie willie   1304 Nov 20 15:22 webpack.config.js
-rw-rw-r--   1 willie willie 182367 Nov 21 18:32 yarn.lock
➜  p2p-git-portal-poc git:(main) ✗ cd src
➜  src git:(main) ✗ ls -al
total 28
drwxrwxr-x 3 willie willie 4096 Nov 21 18:32 .
drwxrwxr-x 6 willie willie 4096 Nov 21 18:32 ..
-rw-rw-r-- 1 willie willie 1039 Nov 21 18:32 go.mod
-rw-rw-r-- 1 willie willie 9369 Nov 21 18:32 go.sum
drwxrwxr-x 2 willie willie 4096 Nov 20 23:11 go_wasm
➜  src git:(main) ✗ 

PS mods/@happybeing — do you want me to delete this here and move it to issues in your github?

It’s fine posting here Willie.

Do you mind cloning the repo from scratch on case that wasn’t enough to get the latest plugin. I’m done for tonight though, so no hurry. If that still doesn’t work I’ll have another look tomorrow.

Thanks for trying it out - it’s very helpful to me having folks willing to catch these bugs because it’s so easy to think it’s all working when it’s not!

1 Like

looks good – with warnings

pressing ahead manfully :slight_smile:

now for the CORS poxy

5 Likes

Also reached this happy destination (btw your README says localhost:5000 Mark)

5 Likes

yes had to change that to port 8080

1 Like

@JPL @Southside and others, if you manage to get the app to load and clone a repository please let me know with a note about OS version and browser version.

Thanks.

I cloned GitHub - willief/cheats: Community-sourced cheatsheets for navi

Ubuntu 20.04 Firefox 83.0 ← as deliverd by Ubuntu

Could not get any joy out of drag n drop so far, nor any of the three buttons on the left

4 Likes

On Brave ← very chrome-like I get this failure when trying to clone GitHub - willief/go-algorand-doc: Documentation for Algorand's Go implementation

Brave version
Version 1.16.75 Chromium: 86.0.4240.193 (Official Build) (64-bit)