Skip to content

Minimal useful Web4 contract. Can be used together with web4-deploy to deploy static websites

Notifications You must be signed in to change notification settings

vgrichina/web4-min-contract

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 

Repository files navigation

web4-min-contract

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.

Building from source

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.

Deploying smart contract

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.

Deploying website

Run web4-deploy using npx:

npx web4-deploy path/to/your/website <your-account>.near

How it works

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.

About

Minimal useful Web4 contract. Can be used together with web4-deploy to deploy static websites

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published