Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
mikevoronov committed Jun 29, 2020
1 parent 88142c9 commit ae52a70
Showing 1 changed file with 0 additions and 35 deletions.
35 changes: 0 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,38 +14,3 @@ or by Makefile with [wasi-sdk](https://github.com/CraneStation/wasi-sdk) install
```bash
make
```

## Prerequisites before deploying to Fluence

The built Redis would have four imports WASI syscalls and before deploying it to the Fluence network, it needs to get rid of them. The most simplest way is to use wasm2wat/wat2wasm utilities from [binaryen](https://github.com/WebAssembly/binaryen):
- translate obtained wasm file to the text representation
```bash
wasm2wat redis.wasm -o redis.wat
```
- replace the following strings
```wasm
(import "wasi_unstable" "fd_fdstat_get" (func $__wasi_fd_fdstat_get (type 1)))
(import "wasi_unstable" "fd_close" (func $__wasi_fd_close (type 5)))
(import "wasi_unstable" "fd_seek" (func $__wasi_fd_seek (type 9)))
(import "wasi_unstable" "fd_write" (func $__wasi_fd_write (type 6)))
```
with
```wasm
(func $__wasi_fd_close (type 5) (param i32)(result i32)
i32.const 0
)
(func $__wasi_fd_fdstat_get (type 1) (param i32 i32)(result i32)
i32.const 0
)
(func $__wasi_fd_seek (type 9) (param i32 i64 i32 i32)(result i32)
i32.const 0
)
(func $__wasi_fd_write (type 6) (param i32 i32 i32 i32)(result i32)
i32.const 0
)
```
- finally, translate it back to the Wasm:
```bash
wat2wasm redis.wat -o redis.wasm
```

0 comments on commit ae52a70

Please sign in to comment.