📓
SANDSHREWサンド
  • Welcome to Sandshrew
    • What is SANDSHREWサンド ?
    • Getting Started
  • Sandshrew Namespaces
    • ord (inscriptions/runes)
    • esplora (Block Explorer APIs)
    • btc (Standard Bitcoin RPC)
    • Multicall
    • Runes
  • Metashrew
    • What is METASHREW?
  • Metashrew Open Source Repositories
    • metashrew
    • metashrew-cli
    • metashrew-view-rs
    • metashrew-as
    • metashrew-ord
    • metashrew-runes
  • Important Links
    • Discord
    • GitHub
    • sandshrew.io
Powered by GitBook
On this page
  • Overview
  • Install
  • Usage
  • metashrew_view
  1. Metashrew Open Source Repositories

metashrew-view-rs

Overview

Parallelizable view layer for metashrew. Exposes the metashrew_view JSON-RPC method and can be reverse proxied by the complete RPC provider to surface data for a single index.

The concept is simple: we do not scale up the r/w performance of the rocksdb instance that owns the index we care about, but we can scale up the amount of WebAssembly instances that run the index to compute a view result.

Install

git clone https://github.com/sandshrew/metashrew-view-rs
cd metashrew-view-rs
cargo

Usage

Set environment variables HOST, PORT, DB_LOCATION and PROGRAM_PATH then run the command

metashrew-view-rs

This will run the HTTP service and can be reverse proxied.

The remote rocksdb database must be mounted over FUSE, nfs, or something similar that exposes native filesystem access to the remote index. The database is opened in read-only mode and a handle is instantiated for every call to metashrew_view. It is expected that a metashrew process will own the rocksdb volume where the index is built. This same filesystem mount is intended to be provided over the network to metashrew-view such that it may be opened in read-only mode.

metashrew_view

The metashrew_view RPC call takes three params:

[ programHash, functionName, inputHexString, blockTag ]

It returns a hex encoded byte string as the JSON-RPC result.

Previousmetashrew-cliNextmetashrew-as
Page cover image