Build safe_launcher for local tests failing

@Ross With testnet3 / community1 testnets not working I tried to build safe_launcher with mock routing for testing but I’m getting errors.

I build safe_core and copied to safe_launcher as follows:

cd ~/src/safe-stable/mock
cd safe_core
cargo build --release --features use-mock-routing
cp target/release/libsafe_core.so ~/src/safe-stable/mock/safe_launcher/app/api/ffi

Then I get the following problems building safe_launcher

$ npm install
npm WARN package.json @ No repository field.
npm WARN package.json @ No license field.
npm WARN optional dep failed, continuing appdmg@0.3.10

> @ postinstall /home/mrh/src/safe-stable/mock/safe_launcher
> cd app && npm install && bower install

npm WARN package.json safe-launcher@0.4.4 No repository field.
npm WARN package.json safe-launcher@0.4.4 No README data
npm WARN package.json safe-launcher@0.4.4 No license field.

> safe-launcher@0.4.4 postinstall /home/mrh/src/safe-stable/mock/safe_launcher/app
> node ../tasks/rebuild_native

module.js:338
    throw err;
    ^

Error: Cannot find module 'babel-runtime/regenerator'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:286:25)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/home/mrh/src/safe-stable/mock/safe_launcher/node_modules/electron-rebuild/lib/main.js:3:27)
    at Module._compile (module.js:434:26)
    at Object.Module._extensions..js (module.js:452:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)

npm ERR! Linux 3.16.0-4-amd64
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v4.1.2
npm ERR! npm  v2.14.4
npm ERR! code ELIFECYCLE
npm ERR! safe-launcher@0.4.4 postinstall: `node ../tasks/rebuild_native`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the safe-launcher@0.4.4 postinstall script 'node ../tasks/rebuild_native'.
npm ERR! This is most likely a problem with the safe-launcher package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node ../tasks/rebuild_native
npm ERR! You can get their info via:
npm ERR!     npm owner ls safe-launcher
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/mrh/src/safe-stable/mock/safe_launcher/app/npm-debug.log

npm ERR! Linux 3.16.0-4-amd64
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v4.1.2
npm ERR! npm  v2.14.4
npm ERR! code ELIFECYCLE
npm ERR! @ postinstall: `cd app && npm install && bower install`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @ postinstall script 'cd app && npm install && bower install'.
npm ERR! This is most likely a problem with the  package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     cd app && npm install && bower install
npm ERR! You can get their info via:
npm ERR!     npm owner ls 
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/mrh/src/safe-stable/mock/safe_launcher/npm-debug.log
1 Like

There, I knew as soon as I did this testnet3 would start working again :wink:

1 Like

are you a happy being again, happybeing?

Not quite… my code doesn’t work :frowning2: …yet! :slight_smile:

At least I know though.

1 Like

You’ll get there.
Wish I had time to properly join in this fun, my own projects are taking every waking minute.
Im too busy even to look for the “jealous” emoji :slight_smile:

1 Like

I will indeed… and I enjoy this bit most: problem solving. But it is bedtime for now. Hopefully the testnet will be running tomorrow. Hope your projects are going well :slight_smile: Night night :night_with_stars:

Firstly, sorry for missing this one @happybeing - what nodejs version are you using?

2 Likes
{ npm: '2.14.4',
  ares: '1.10.1-DEV',
  http_parser: '2.5.0',
  modules: '46',
  node: '4.1.2',
  openssl: '1.0.2d',
  uv: '1.7.5',
  v8: '4.5.103.35',
  zlib: '1.2.8' }
1 Like

Hi @happybeing - I just walked through the instructions and managed to get it to work on Ubuntu 16.04

I did upgrade to Node.js v6 - I have let @Krishna_Kumar know as well - he is away just now - but will pick this up when he can (if upgrading doesn’t help you out) :slight_smile:

2 Likes

Much better @Ross, thanks.

I get a window up briefly on npm start which has an alert about not being able to load ffi and then aborts. Console output includes this:

Ffi load error [Error: Dynamic Linking Error: /home/mrh/src/safe-stable/mock/safe_launcher/build/api/ffi/libsafe_core.so: undefined symbol: sodium_increment]

I know nothing about Node.js, but does this build require Sodium to be installed on the host system?

I describe my Sodium saga here.

Feel free to ignore this if I don’t know what I’m talking about.

I already have it, but thanks for the suggestion. I’ve been building it for a while (though not with use-mock-routing) so this is probably something recent.

I got what I needed today before the testnet went down, so can just try coding for a bit but I’ll need something to test against again soon.

1 Like

The “community1” testnet is suitable for app testing, and you’re welcome to run it there. I plan to maintain the seeder vault until the next official test (although whether there is a network depends largely on people joining). I think I’m starting to get the hang of managing these things and there are currently 16 vaults in the routing table. Data seems persistent if accessed fairly often (my current estimate is one hour) and network crashes are avoided.

1 Like

I’ll certainly give it a go - I did try it earlier in the week but it had lost momentum. Thanks again. It all helps :slight_smile:

@Ross @bluebird @Krishna_Kumar Solved!

I had libsodium but it needed updating - so thanks for the hint @bluebird. I do now have a safe_launcher that my web app can talk to without needing a real network :slight_smile:

4 Likes

Nice one! @happybeing :grinning:

1 Like