Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@open-rpc/mock-server
Advanced tools
Provide a Mock server for an OpenRPC Document.
Given an OpenRPC document, Mock server will provide a mock implementation of the JSON-RPC api that:
method.result.schema: JSONSchema
.Running the mock server in service mode will run a JSON-RPC service that:
mock
. It takes an openrpc document, returns a url path postfix. Appending the path to the services url will give us a mock server for the document provided.https://mock.open-rpc.org
Mock server is generally meant to be run via CLI, however it can also be imported to your project. doing so will:
npm i -g @open-rpc/mock-server
npm i -S @open-rpc/mock-server
The default settings expect to find a file in the root of your project called open-rpc.json
. It will must be a valid OpenRPC document as validated by OpenRPC Metaschema, or an error will be returned.
npm run mock-server
this will start an HTTP server on http://localhost:3333 (default settings)
Where my-open-rpc-document.json is a file in the current directory which is a valid OpenRPC document as validated by OpenRPC Metaschema.
open-rpc-mock-server -d my-open-rpc-document.json
You can also provide a URL that will resolve the OpenRPC document in JSON format:
open-rpc-mock-server -d https://raw.githubusercontent.com/open-rpc/examples/master/service-descriptions/simple-math-openrpc.json
Allows you to add documents to the running server as a JSON-RPC request. One mock server in service mode can handle a large number of mocked services at once with this configuration.
open-rpc-mock-server --mode service
A server is running on http://localhost:3333 now. You can call the mock
method, and pass it your OpenRPC document, which will start mocking that service (under the returned url path).
https://mock.open-rpc.org/
hereHow to contribute, build and release are outlined in CONTRIBUTING.md, BUILDING.md and RELEASING.md respectively. Commits in this repository follow the CONVENTIONAL_COMMITS.md specification.
FAQs
Provides a mock JSON-RPC API given an OpenRPC Document
The npm package @open-rpc/mock-server receives a total of 280 weekly downloads. As such, @open-rpc/mock-server popularity was classified as not popular.
We found that @open-rpc/mock-server demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.