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. Below command uses v0.13.0.
Then run:
zig build-exe web4-min.zig -target wasm32-freestanding -O ReleaseSmall --export=web4_get --export=web4_setStaticUrl --export=web4_setOwner -fno-entry
You should get web4-min.wasm
file.
Install near-cli-rs 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.