Skip to content

jlwaugh/multivac

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Multivac

Demo: Web4 + JSinRust

inspired by this example, courtesy of quickjs-rust-near

GUIDE

1. Deploy Contract

First, download and unzip example_contracts from here: https://github.com/petersalomonsen/quickjs-rust-near/releases/tag/v0.0.4

Then, via CLI, navigate to the unzipped folder and run these commands:

near login

BEWARE - This costs 9 NEAR!

near deploy <account_id> minimum_web4.wasm

2. Download & Setup

Clone this repository:

git clone https://github.com/jlwaugh/multivac.git && cd multivac

Install dependencies:

npm install

3. Post JS & HTML

Prepare arguments:

export JSON_ARGS=$(cat ./main.js | jq -Rs '{javascript: .}')

Call post_javascript first:

near contract call-function as-transaction <account_id> post_javascript json-args $JSON_ARGS prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' sign-as <account_id> network-config testnet sign-with-keychain send

Call post_content to publish HTML:

near call <account_id> post_content '{
  "key": "/index.html",
  "valuebase64": "'"$(base64 < index.html | tr -d '\n')"'"
}' --accountId <account_id> --gas 30000000000000 --deposit 0

TESTING

Navigate to your site: https://<account_id>.page

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published