
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
@leosprograms/graphql-client-holochain
Advanced tools
ValueFlows GraphQLClient configurations, providing pluggable backend datasources for different distributed, federated and client/server infrastructure.
Binds Holochain cell connections for hREA to a GraphQLClient
interface for connecting to distributed, agent-centric ValueFlows coordination spaces.
Simply await the results of this asynchronous function (the default export) to get a handle on a hREA collaboration space.
With the resulting ApolloClient
you can integrate it into many different user interface frameworks, or no framework. It will
error if it cannot establish a websocket connection with a running holochain service which itself has a running instance of a
valid hREA
hApp.
In a Svelte application, simple app initialisation logic for connecting to one collaboration space might look something like this:
<script>
import { setClient } from 'svelte-apollo'
import graphqlClientHolochain from '@vf-ui/graphql-client-holochain'
import App from './my-happ-ui'
// init and manage GraphQL client connection
let client = null
let loading = true
let error = null
async function initConnection() {
try {
// it can be called with no direct options passed
// but if doing so, be aware that certain values may need
// to be set by environment variables alternatively
client = await graphqlClientHolochain()
} catch (e) {
error = e
}
loading = false
error = null
}
initConnection()
// workaround to set the context outside of init action
$: {
if (client) {
setClient(client)
}
}
</script>
<main>
{#if loading}
<h1>Loading...</h1>
{:else if error}
<h1>Cannot connect to Holochain</h1>
<p>{error.message}</p>
{:else}
<App />
{/if}
</main>
Note that you can connect to multiple conductors and sets of Holochain DNAs in order to naively connect to multiple collaboration spaces; and you can also connect to other non-Holochain ValueFlows-compatible GraphQL client APIs in order to manage data across contexts. In reactive UI applications built with frameworks like React, Svelte etc this means that you can simply swap out the active GraphQLClient
with another by wrapping UI elements in a different connection provider in order to target different networks.
TODO: provide an example of this
It is possible to omit any or all of these options, and even to leave the options object undefined. Below the type definition are descriptions of each.
interface ClientOptions {
dnaConfig?: DNAIdMappings
conductorUri?: string
adminConductorUri?: string
appID?: string
enabledVFModules?: VfModule[]
extensionSchemas?: string[]
extensionResolvers?: IResolvers
traceAppSignals?: SignalCb
}
dnaConfig
Mapping of hREA module IDs to Holochain CellIds. If omitted,
the client will attempt to sniff them by inspecting the names
of active app cells. Any Cell with a known 'hrea_*_X' format
will be matched.
conductorUri
A websocket URI to connect to a running holochain
service which has websocket ports open.
An example is "ws://localhost:4000".
There are two main circumstances that define what to pass here:
conductorUri
will be auto-discovered, and can thus be omittedadminConductorUri
A websocket URI to connect to a running holochain
"admin" service which has websocket ports open.
An example is "ws://localhost:4000".
There are two main circumstances that define what to pass here:
adminConductorUri
will be auto-discovered, and can thus be omittedappID
When a hApp is installed to holochain
, an app_id
value is always provided. There are two main circumstances that define what to pass here:
app_id
will be auto-discovered, and can thus be omittedenabledVFModules
This defines which Valueflows Modules or VfModule
s are enabled within your hApp. This will actually trim the schema and resolvers down to only include the scope of the modules you enable, and requests outside of those modules will result in graphql
schema errors being thrown. It is optional because it will by default take on the value of the "full set" of all VfModule
s
which have been developed so far.
extensionSchemas
TODO
extensionResolvers
TODO
traceAppSignals
As of this writing, the hREA hApp backends have not been configured to emit "signals" (which are like events that your connected client can subscribe to), and so there is no point in setting this value. In the future there may be, and this is how you would listen for signals from holochain
in your client.
package.json
& commit to the repositorypnpm run build
from this directory or pnpm run build:graphql:client
from the root of the hREA repositorypnpm publish --access public
from this directoryorigin
Licensed under an Apache 2.0 license.
FAQs
ValueFlows GraphQLClient configurations, providing pluggable backend datasources for different distributed, federated and client/server infrastructure.
We found that @leosprograms/graphql-client-holochain demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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 how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.