New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@blockless/gateway-core

Package Overview
Dependencies
Maintainers
0
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@blockless/gateway-core

[![CI](https://github.com/blocklessnetwork/gateway/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/blocklessnetwork/gateway/actions/workflows/ci.yml)

0.0.24
latest
npm
Version published
Maintainers
0
Created
Source

@blockless/gateway-core

CI

Gateway to communicate with the Blockless Network.

Install

npm i @blockless/gateway-core

Basic Usage

List functions

import Gateway from '@blockless/gateway-core'

const gateway = new Gateway({
	mongoUri: process.env.MONGO_DB_URI!,
	headNodeUri: process.env.HEAD_NODE_HOST!
})

const functions = await gateway.functions.list()
console.log(functions)
// [{ name: 'Hello World Fn', functionId: 'bafybefgibuxruy...' }]

Invoke a function

import Gateway from '@blockless/gateway-core'

const gateway = new Gateway({
	mongoUri: process.env.MONGO_DB_URI!,
	headNodeUri: process.env.HEAD_NODE_HOST!
})

const domain = 'hello-world-fn.bls.xyz'
const response = await gateway.functions.invoke('domain', domain)
console.log(response)
// { code: 200, headers: [], type: 'text/html', body: 'Hello World' }

Documentation

For the latest documentation, visit Blockless Docs

Contributing

Refer to the CONTRIBUTING.md guide for details.

FAQs

Package last updated on 23 Aug 2024

Did you know?

Socket

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.

Install

Related posts