Forest Explorer is a server-less inspector of the Filecoin blockchain.
Rust + Leptos application which is compiled to a server WASM module and a client WASM module. The server module is hosted by CloudFlare. It pre-renders a HTML response and hydrates it (i.e. add reactivity) via the client WASM module.
Anything pushed to main
will automatically be deployed at
https://forest-explorer.chainsafe.dev.
Installing node(LTS versions recommended).
Running corepack enable
to opt-in corepack, see
docs for details.
Running yarn
or yarn --immutable
once to install all required npm
dependencies.
Running yarn start
will spawn a local copy of the explorer.
To speed up the build during development, you can run yarn dev
which will skip
the optimization step.
You can define secrets for your local faucet in the .dev.vars
file. This file
is ignored by git.
SECRET_WALLET=
SECRET_MAINNET_WALLET=
RATE_LIMITER_DISABLED=true
Note - the RATE_LIMITER_DISABLED
variable is required to be set to true
in
order to bypass the rate limiter in the local environment if you want to test
the faucet.
- In
wrangler.toml
, setaccount_id
to your CloudFlare account ID. - In
wrangler.toml
, setpattern
in routes to match your domain.
In order to deploy to a different CloudFlare account, you need to do the following:
If you have a paid CloudFlare account:
- Create a KV store in CloudFlare. It can be found under the Storage & Databases tab. The name can be anything.
- In
wrangler.toml
, setid
inkv_namespaces
to your KV store id (from step 1).
If you have a free CloudFlare account, you will need to disable the rate
limiter.
- In
wrangler.toml
, remove or comment out[durable_objects]
and[migrations]
sections. Additionally, removekv_namespaces
from the[env.quick]
section. - Run
npx wrangler@latest secret put RATE_LIMITER_DISABLED true
.
Set SECRET_WALLET
(calibnet) and/or SECRET_MAINNET_WALLET
(mainnet) using
npx wrangler@latest secret put
(values are exported private keys, see
forest-wallet export
).
Run npx wrangler@latest deploy
.