Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gogo2464 committed Jan 30, 2024
1 parent 2a03997 commit 45a751e
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 20 deletions.
4 changes: 0 additions & 4 deletions apps/freenet-email-app/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ IDENTITY_DELEGATE := $(FREENET_ROOT)$(PATH_SEP)modules$(PATH_SEP)identity-manage
WEB_DIR_SRC := $(ROOT)$(PATH_SEP)web$(PATH_SEP)src
FILE := $(IDENTITY_DELEGATE)$(PATH_SEP)build$(PATH_SEP)identity-manager-key.private.pem

IDENTITY_DELEGATE_PRIVATE_KEY := identity-manager-key.private.pem
PATH_TO_IDENTITY_DELEGATE := $(IDENTITY_DELEGATE)/build/$(IDENTITY_DELEGATE_PRIVATE_KEY)


ifeq ($(CARGO_TARGET_DIR),)
$(error CARGO_TARGET_DIR is not set)
endif
Expand Down
4 changes: 1 addition & 3 deletions build-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,4 @@ cargo install --path crates/core --force &&
cargo install --path crates/fdev --force &&
cd ./modules/identity-management/ && make build &&
cd ../antiflood-tokens/ && rm Cargo.lock ; make build &&
cd ../../ &&
make -C ./apps/freenet-microblogging build &&
make -C ./apps/freenet-email-app build
cd ../../
4 changes: 4 additions & 0 deletions build-examples.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
cd ./apps/freenet-microblogging && make build &&
cd ../..
cd ./apps/freenet-email-app && make build &&
cd ../..
92 changes: 90 additions & 2 deletions docs/src/install.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,102 @@
# Build freenet from source On Linux:
# Build freenet from source on Linux:

There is a single line command to build all freenet on Linux.

```
git clone https://github.com/freenet/freenet-core && .\build-all.sh
```

then you could test it by building and deploying any web application:

or
```
.\build-examples.sh
```
.


# Build freenet from source on Linux from command line:

You could also run this:

```bash
wget https://sh.rustup.rs ; sh index.html -y && source "$HOME/.cargo/env" && rustup default stable && rustup target add wasm32-unknown-unknown && (sh curl -L https://git.io/n-install | bash) ; ~/n/bin/n latest ; ~/n/bin/npm install -g typescript webpack && git clone https://github.com/freenet/freenet-core/ && cd freenet-core && git submodule update --init --recursive && export CARGO_TARGET_DIR="$(pwd)/target" && cd stdlib/typescript/ && npm run dev.package && cd ../.. && cargo install --path crates/core --force && cargo install --path crates/fdev --force && cd ./modules/identity-management/ && make build && cd ../antiflood-tokens/ && rm Cargo.lock ; make build && cd ../../apps/freenet-email-app && make build
```

Let's decompose this:

Install rust:

```bash
wget https://sh.rustup.rs ; sh index.html -y && source "$HOME/.cargo/env"
```

then select rustup toolchain and add webasm target with:

```
rustup default stable && rustup target add wasm32-unknown-unknown
```

Install `n` tu update typescript latter:

```
sh curl -L https://git.io/n-install | bash)
```

Update `npm`. Warning: required! You must do that to have the latest npm packages.

```
~/n/bin/n latest
```

Install typescript and `webpack` to `build` `freenet-email-app` example.
```
~/n/bin/npm install -g typescript webpack
```

clone the project:

`git clone https://github.com/freenet/freenet-core/ && cd freenet-core && git submodule update --init --recursive`

set the build environment part (mandatory):

```
export CARGO_TARGET_DIR="$(pwd)/target"
```

build typescript stdlib.
```
cd stdlib/typescript/ && npm run dev.package && cd ../..
```

Finally compile freenet:

```
cargo install --path crates/core --force
cargo install --path crates/fdev --force
```

# Build and deploy freenet contract examples:

Build identity managemenet and antiflood token freent modules:

```
cd ./modules/identity-management/
make build
cd ../antiflood-tokens/
```


Fix a compile issue with:
```
rm Cargo.lock
```


```
make build
```

```
cd ../../apps/freenet-email-app
make build
```
22 changes: 11 additions & 11 deletions modules/antiflood-tokens/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 45a751e

Please sign in to comment.