Fetch SAFE demonstrates a simple SAFE app, written in Rust using the Yew framework, deployed as WebAssembly and running in SAFE Browser

Looks good to me on the shared-vault :slight_smile:

mild amount of footering required…
willie@gagarin:~/projects/maidsafe/fetchsafe/scripts$ sh build-develop
build-develop: 2: set: Illegal option -o pipefail
willie@gagarin:~/projects/maidsafe/fetchsafe/scripts$ less build-develop
willie@gagarin:~/projects/maidsafe/fetchsafe/scripts$ chmod +x build-develop
willie@gagarin:~/projects/maidsafe/fetchsafe/scripts$ ./build-develop
[INFO]: Checking for the Wasm target…
[INFO]: Compiling to Wasm…
Compiling proc-macro2 v1.0.8
Compiling unicode-xid v0.2.0

Compiling fetchsafe v0.1.0 (/home/willie/projects/maidsafe/fetchsafe)
Finished dev [unoptimized + debuginfo] target(s) in 1m 12s
[INFO]: Installing wasm-bindgen…
[INFO]: Optional fields missing from Cargo.toml: ‘description’, ‘repository’, and ‘license’. These are not necessary, but recommended
[INFO]: :slight_smile: Done in 1m 14s
[INFO]: :slight_smile: Your wasm pkg is ready to publish at /home/willie/projects/maidsafe/fetchsafe/pkg.
:slight_smile: [WARN]: There’s a newer version of wasm-pack available, the new version is: 0.9.1, you are using: 0.9.0. To update, navigate to: https://rustwasm.github.io/wasm-pack/installer/

/home/willie/projects/maidsafe/fetchsafe/scripts/…/main.js → dist/fetchsafe.js…
created dist/fetchsafe.js in 307ms
sed: can’t read s/pkg/fetchsafe_bg.wasm/fetchsafe.wasm/g: No such file or directory

I just ignored the last bit and it Just Works :slight_smile:



Enter that XOR-URL into the text input of the Fetch SAFE app at the XOR-URL of the FilesContainer of the dist directory and press your enter key.

I don’t observe the error. After it, what does the init line of fetchsafe.js (790 for me) contain?

await init('/fetchsafe.wasm');

is expected.

When I said “looks good” that was before I read the code - or tried to - WASM is totally new to me- so I should see a text box that I put the XOR-URL for

willie@gagarin:~/projects/maidsafe/fetchsafe$ safe files put dist/ --recursive
FilesContainer created at: "safe://hnyynyiceqh3f6jwewfaxiibusdzcyahicsqwg596eijkp61pnsdtk8rwnbnc"
+  dist/fetchsafe.css   safe://hbhyyynsxerinwom7o4w5sya8h3giheusihmkq9setpc6d4jti8r3ghxyw 
+  dist/fetchsafe.js    safe://hbkygydn8qe474xgu646fa8yu5tgkjnwae5iumwkcyhbjts7hqs6jtk95c 
+  dist/fetchsafe.json  safe://hbkygony7b8kajf6i9pan37mxa5ujt9regiqg8o93wqtubk9pi8fintf6f 
+  dist/index.html      safe://hbhybyd6hbjyw888949zzdzqxuuszrcpjcs1ob3g9pxapwgmsncuzwcj7b 

3) Run

  1. Open the XOR-URL of the FilesContainer created when deploying with SAFE Browser

    no content displayed
    should I see an input field?
  2. Enter the XOR-URL of fetchsafe.json to observe failure
  • dist/fetchsafe.json safe://hbkygony7b8kajf6i9pan37mxa5ujt9regiqg8o93wqtubk9pi8fintf6f

    That looked like success to me, no failure…
    until I read the code…
  1. Enter fetchsafe.json to observe success

not yet…

line 790 of fetchsafe.js

 `   await init('/pkg/fetchsafe_bg.wasm');`

I edited that line and syncd to the shared vault

  • can you see it at ?

safe cat safe://hbkygyn14owrnzwuw4zpi61bdifg3o1a7gbafgzk91orgp5epdwozxwh3m

return wasm;

    async function main() {
        await init('fetchsafe.wasm');


but when I revisit thr Files Container XOR_URL on the browser

I still get a blank page, for each or the versions

1 Like

Should we try to encourage some others to have a try at it with by putting this on the main forum?

1 Like


What messages does the console contain?


These projects target developers and as such I don’t believe so.

1 Like

One way to get more developers is to ask punters to help solve problems. I’m no dev, just a guy who likes to test things and report back

1 Like

Indeed Willie, and very helpful it is to have you and others willing to poke around.

1 Like

If you can put up with the daft questions…

1 Like


Thanks. If you

  1. delete dist
  2. delete pkg
  3. delete the sed -i '' 's/pkg\/fetchsafe_bg.wasm/fetchsafe.wasm/g' $__dir/../dist/fetchsafe.js line from scripts/build-develop
  4. run scripts/build-develop
  5. replace await init('/pkg/fetchsafe_bg.wasm'); with await init('/fetchsafe.wasm'); in dist/fetchsafe.js
  6. run safe files put dist/ --recursive
  7. open the FilesContainer XOR-URL in SAFE Browser v0.16.0-alpha.2

do the results differ?

1 Like

I’ll have a go.
Just opened a beer though…

Drowning your sorrows?

1 Like

I don’t see that line…



It would take the output of several breweries and most distilleries west of the Spey to drown my sorrows at the xenophobic idiocy of your countrymen that dragged me out of the EU…

I have failed miserably to find the Ben Elton clip that should go here - but YKWIM

1 Like

OH FFS… 20 char

1 Like

willie@gagarin:~/projects/maidsafe/fetchsafe$ safe files put dist/ --recursive
FilesContainer created at: “safe://hnyynyi631tnsh8o5o8bfg8jgk461j79yew4hj5nm9awntihxf3d4whcpgbnc”

  • dist/fetchsafe.css safe://hbhyyynsxerinwom7o4w5sya8h3giheusihmkq9setpc6d4jti8r3ghxyw
  • dist/fetchsafe.js safe://hbkygyn14owrnzwuw4zpi61bdifg3o1a7gbafgzk91orgp5epdwozxwh3m
  • dist/fetchsafe.json safe://hbkygony7b8kajf6i9pan37mxa5ujt9regiqg8o93wqtubk9pi8fintf6f
  • dist/fetchsafe.wasm safe://hbyyyyd89nskmwxm5ypiut3bjruw8fns3c87nb5n9yns8k999bcu4nwjcd
  • dist/index.html safe://hbhybyd6hbjyw888949zzdzqxuuszrcpjcs1ob3g9pxapwgmsncuzwcj7b

looking good so far…

Enter the XOR-URL of fetchsafe.json to observe failure

but when I hit enter, nothing happens

1 Like


That’s the issue I’ve reported. If you instead enter “fetchsafe.json” you’ll see its contents displayed in the console.

1 Like

like this?

I get a panic

1 Like