• Stars
    star
    153
  • Rank 235,569 (Top 5 %)
  • Language
    Rust
  • License
    Apache License 2.0
  • Created almost 2 years ago
  • Updated 10 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

WebAssembly Registry (Warg)

WebAssembly Registry (Warg)

A Bytecode Alliance project

The reference implementation of the Warg protocol, client, and server for distributing WebAssembly components and interfaces as well as core modules.

build status Crates.io version Download docs.rs docs

Overview

This repository contains the reference implementation of the Warg protocol, a client, server, and CLI.

A Warg client and server can be used to distribute WebAssembly components to various component tooling.

See the introduction for the design decisions and scope.

Prerequisites

Installation

To install warg, first you'll want to install the latest stable Rust and then you'll execute to install the subcommand:

cargo install --git https://github.com/bytecodealliance/registry

The currently published crate on crates.io is a nonfunctional placeholder and these instructions will be updated to install the crates.io package once a proper release is made.

Getting Started

Running the server

Before running the server, set the WARG_OPERATOR_KEY environment variable:

export WARG_OPERATOR_KEY="ecdsa-p256:I+UlDo0HxyBBFeelhPPWmD+LnklOpqZDkrFP5VduASk="

WARG_OPERATOR_KEY is the private key of the server operator.

Currently this is sourced through an environment variable, but soon this will be sourced via command line arguments or integration with system key rings.

Use cargo to run the server:

mkdir content
cargo run -p warg-server -- --content-dir content

The content directory created here is where the server will store package contents.

Note: currently the server stores its state only in memory, so it will be lost when the server is restarted. A persistence layer will be added in the near future.

Setting up the client

Start by configuring the client to use the local server's URL:

warg config --registry http://127.0.0.1:8090

This creates a $CONFIG_DIR/warg/config.json configuration file; the configuration file will specify the default registry URL to use so that the --registry option does not need to be specified for every command.

Data downloaded by the client is stored in $CACHE_DIR/warg by default.

Next, create a new signing key to publish packages with:

warg key new 127.0.0.1:8090

The new signing key will be stored in your operating system's key store and used to sign package log entries when publishing to the registry.

Publishing a package

A new package can be initialized by running:

warg publish init example:hello

This creates a new package in the example namespace with the name hello.

A version of the package can be published by running:

warg publish release --name example:hello --version 0.1.0 hello.wasm

This publishes a package named example:hello with version 0.1.0 and content from hello.wasm.

Alternatively, the above can be batched into a single publish operation:

warg publish start example:hello
warg publish init example:hello
warg publish release --name example:hello --version 0.1.0 hello.wasm
warg publish submit

Here the records created from initializing the package and releasing version 0.1.0 are made as part of the same transaction.

Use warg publish abort to abort a pending publish operation.

Managing package permissions

Note: The package permissions system is a work in progress.

You can grant permissions to another public key with the warg publish grant subcommand:

warg publish grant --name example:hello ecdsa-p256:ABC...

You can get your own public key with the warg key info subcommand.

By default, both publish and yank permissions are granted. This can be modified with the --permission flag.

Similarly, permissions may be revoked via warg publish revoke. Note that keys are identified by ID (fingerprint) for revocation:

warg publish revoke --name example:hello sha256:abc...

Running a package

For demonstration purposes, the run command in warg will download and run a package using Wasmtime.

The package is expected to be a Wasm module implementing a WASI command.

A demo module that implements a simple "grep" tool is available in demo/simple-grep-1.0.0.wasm.

To publish the demo module:

warg publish start demo:simple-grep
warg publish init demo:simple-grep
warg publish release --name demo:simple-grep --version 1.0.0 demo/simple-grep-1.0.0.wasm
warg publish submit

To run the demo package:

echo 'hello world' | warg run demo:simple-grep hello

This should download and run the package, and print out the line hello world as it matches the pattern hello.

Resetting and clearing local data

To reset local data for the default registry:

warg reset

To reset local data for a specific registry, such as registry.example.com:

warg reset --registry registry.example.com

To reset local data for all registries:

warg reset --all

To clear local content for all registries:

warg clear

Contributing

This is a Bytecode Alliance project, and follows the Bytecode Alliance's Code of Conduct and Organizational Code of Conduct.

Getting the Code

You'll clone the code via git:

git clone https://github.com/bytecodealliance/registry

Testing Changes

Ideally, there should be tests written for all changes. Test can be run via:

cargo test --all

Testing with Containers

See the local infra documentation on how to develop and test with locally running containers.

Submitting Changes

Changes to this repository are managed through pull requests (PRs). Everyone is welcome to submit a pull request! We'll try to get to reviewing it or responding to it in at most a few days.

Code Formatting

Code is required to be formatted with the current Rust stable's cargo fmt command. This is checked on CI.

Continuous Integration

The CI for the repository is relatively significant. It tests changes on Windows, macOS, and Linux.

More Repositories

1

wasmtime

A fast and secure runtime for WebAssembly
Rust
14,541
star
2

wasm-micro-runtime

WebAssembly Micro Runtime (WAMR)
C
4,528
star
3

lucet

Lucet, the Sandboxing WebAssembly Compiler.
Rust
4,074
star
4

cranelift

Cranelift code generator
2,482
star
5

javy

JS to WebAssembly toolchain
Rust
1,958
star
6

rustix

Safe Rust bindings to POSIX-ish APIs
Rust
1,286
star
7

wasm-tools

CLI and Rust libraries for low-level manipulation of WebAssembly modules
Rust
1,105
star
8

wit-bindgen

A language binding generator for WebAssembly interface types
Rust
887
star
9

wizer

The WebAssembly Pre-Initializer
Rust
859
star
10

wasmtime-go

Go WebAssembly runtime powered by Wasmtime
Go
729
star
11

cap-std

Capability-oriented version of the Rust standard library
Rust
614
star
12

cranelift-jit-demo

JIT compiler and runtime for a toy language, using Cranelift
Rust
588
star
13

jco

JavaScript tooling for working with WebAssembly Components
Rust
468
star
14

cargo-wasi

A lightweight Cargo subcommand to build Rust code for the `wasm32-wasi` target
Rust
435
star
15

cargo-component

A Cargo subcommand for creating WebAssembly components based on the component model proposal.
Rust
405
star
16

wasmtime-dotnet

.NET embedding of Wasmtime https://bytecodealliance.github.io/wasmtime-dotnet/
C#
391
star
17

wasmtime-py

Python WebAssembly runtime powered by Wasmtime
Python
352
star
18

wasi

Experimental WASI API bindings for Rust
Rust
210
star
19

wasmparser

A simple event-driven library for parsing WebAssembly binary files
178
star
20

regalloc2

A new register allocator
Rust
178
star
21

wasi.dev

HTML
170
star
22

ComponentizeJS

JS -> WebAssembly Component
Rust
163
star
23

wasmtime-demos

Historical and dated demos for Wasmtime usage and WASI content
C#
152
star
24

wat

Rust WAT and WAST parser (WebAssembly Text Format)
113
star
25

regalloc.rs

Modular register allocator algorithms
Rust
107
star
26

WASI-Virt

Virtual implementations of WASI APIs
Rust
98
star
27

componentize-py

Rust
89
star
28

spidermonkey-wasm-rs

Rust
86
star
29

preview2-prototyping

Polyfill adapter for preview1-using wasm modules to call preview2 functions.
Rust
78
star
30

wasmtime-rb

Ruby WebAssembly runtime powered by Wasmtime
Rust
73
star
31

wasmtime-cpp

C++
70
star
32

wasm-interface-types

Raw Rust toolchain support for Wasm Interface Types
Rust
70
star
33

wac

WebAssembly Composition (WAC) tooling
Rust
69
star
34

sightglass

A benchmark suite and tool to compare different implementations of the same primitives.
C
64
star
35

rfcs

RFC process for Bytecode Alliance projects
57
star
36

component-docs

Documentation around creating and using WebAssembly Components
Rust
46
star
37

target-lexicon

Target "triple" support
Rust
44
star
38

userfaultfd-rs

Rust bindings for the Linux userfaultfd functionality
Rust
42
star
39

system-interface

Extensions to the Rust standard library
Rust
40
star
40

wasi-nn

High-level bindings for wasi-nn system calls
CSS
36
star
41

wasmprinter

Rust library to print a WebAssembly binary to its textual format
32
star
42

spidermonkey-wasm-build

Utilities to compile SpiderMonkey to wasm32-wasi
JavaScript
22
star
43

wit-deps

WIT dependency manager
Rust
20
star
44

meetings

Python
20
star
45

filecheck

Library for writing tests for utilities that read text files and produce text output
Rust
20
star
46

vscode-wit

Visual Studio Code extension to recognize and highlight the WebAssembly Interface Type (WIT) IDL.
TypeScript
19
star
47

wamr-rust-sdk

Rust
15
star
48

wasm-score

A benchmark for standalone WebAssembly
C
15
star
49

cranelift.vim

Vim editor configuration for working with cranelift IR (clif) files
Vim Script
14
star
50

arf-strings

Encoding and decoding for ARF strings
C
12
star
51

SIG-Registries

11
star
52

bytecodealliance.org

CSS
10
star
53

subscribe-to-label-action

A GitHub action that allows users to subscribe to a label and automatically get @'d when the label is applied
JavaScript
10
star
54

SIG-Guest-Languages

Special Interest Group (SIG) whose goal is to investigate how best to integrate Wasm and components into dynamic programming language ecosystems in a way that feels native to those ecosystems.
10
star
55

wasm-spec-interpreter

Rust bindings for the Wasm spec interpreter.
Rust
8
star
56

governance

7
star
57

wasm-parallel-gzip

Some example scripts for building a parallel compression/decompression tool for WebAssembly
Makefile
6
star
58

wamr-python

Python
6
star
59

fs-set-times

Set filesystem timestamps
Rust
5
star
60

arena-btree

Rust
5
star
61

wasmtime-libfuzzer-corpus

libFuzzer corpus for our wasmtime fuzz targets
Shell
5
star
62

wamr.dev

The WAMR homepage
HTML
5
star
63

wasmtime.dev

The Wasmtime homepage
CSS
4
star
64

cm-go

4
star
65

libc-test

Mirror of git://nsz.repo.hu:49100/repo/libc-test (see https://wiki.musl-libc.org/libc-test.html for more information)
C
3
star
66

wamr-app-framework

WebAssembly Micro Runtime Application Framework
C
2
star
67

wasmtime-wasi-nn

2
star
68

actions

GitHub actions to setup wasm-tools and wasmtime
TypeScript
1
star
69

label-messager-action

Automatically leave a message when an issue or pull request has a certain label
JavaScript
1
star
70

wasm-ml-meetings

Informal working group for machine learning and WebAssembly, especially wasi-nn
1
star