Minimal useful Web4 contract. Can be used together with web4-deploy
to deploy website tied to your .near
account, with static content hosted on IPFS.
Install Zig first.
Then run:
zig build-lib web4-min.zig -target wasm32-freestanding -dynamic -rdynamic -OReleaseSmall
You should get web4-min.wasm
file.
Install near-cli first.
Then run:
near deploy --wasmFile web4-min.wasm --accountId <your-account>.near
See more on how to deploy NEAR smart contracts.
Run web4-deploy using npx
:
npx web4-deploy path/to/your/website <your-account>.near
web4-deploy
will upload your website to IPFS and then call web4_setStaticUrl
method in this smart contract to set IPFS hash of your website.
Then you can access your website using https://<your-account>.near.page
Web4 gateway.