fulamobile

package
v1.58.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 1, 2026 License: MIT Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateEd25519Key added in v0.5.2

func GenerateEd25519Key() ([]byte, error)

GenerateEd25519Key generates a random Ed25519 libp2p private key.

func GenerateEd25519KeyFromString added in v1.0.0

func GenerateEd25519KeyFromString(secret string) ([]byte, error)

Types

type AssetsBalanceResponse added in v1.54.8

type AssetsBalanceResponse struct {
	Amount uint64 `json:"amount"`
}

type Client added in v0.4.9

type Client struct {
	// contains filtered or unexported fields
}

func NewClient added in v0.4.9

func NewClient(cfg *Config) (*Client, error)

func (*Client) AccountBalance added in v0.8.8

func (c *Client) AccountBalance(account string) ([]byte, error)

AccountBalance requests blox at Config.BloxAddr to get the balance of the account. the addr must be a valid multiaddr that includes peer ID.

func (*Client) AccountCreate added in v0.8.8

func (c *Client) AccountCreate() ([]byte, error)

AccountCreate requests blox at Config.BloxAddr to create a account.

func (*Client) AccountExists added in v0.8.8

func (c *Client) AccountExists(account string) ([]byte, error)

AccountExists requests blox at Config.BloxAddr to check if the account exists or not. the addr must be a valid multiaddr that includes peer ID.

func (*Client) AccountFund added in v0.8.8

func (c *Client) AccountFund(account string) ([]byte, error)

AccountFund requests blox at Config.BloxAddr to fund the account. the addr must be a valid multiaddr that includes peer ID.

func (*Client) AssetsBalance added in v1.18.0

func (c *Client) AssetsBalance(account string, assetId int, classId int) ([]byte, error)

AssetsBalance requests blox at Config.BloxAddr to get the balance of the account. the addr must be a valid multiaddr that includes peer ID.

func (*Client) AutoPinPair added in v1.58.0

func (c *Client) AutoPinPair(token string, endpoint string) ([]byte, error)

AutoPinPair sends a pairing request to the blox with pinning service credentials.

func (*Client) AutoPinRefresh added in v1.58.0

func (c *Client) AutoPinRefresh(token string) ([]byte, error)

AutoPinRefresh refreshes the pinning service token on the blox.

func (*Client) AutoPinUnpair added in v1.58.0

func (c *Client) AutoPinUnpair() ([]byte, error)

AutoPinUnpair removes auto-pin configuration from the blox.

func (*Client) BatchUploadManifest added in v1.53.0

func (c *Client) BatchUploadManifest(cidsBytes []byte, poolID int, replicationFactor int) ([]byte, error)

func (*Client) BloxFreeSpace added in v0.8.8

func (c *Client) BloxFreeSpace() ([]byte, error)

BloxFreeSpace requests the blox avail/used free space information.

func (*Client) ChatWithAI added in v1.55.1

func (c *Client) ChatWithAI(aiModel string, userMessage string) ([]byte, error)

func (*Client) ConnectToBlox added in v0.8.0

func (c *Client) ConnectToBlox() error

ConnectToBlox attempts to connect to blox via the configured address with direct → relay → DHT fallback. This function can be used to check if blox is currently accessible.

func (*Client) DeleteFulaConfig added in v1.14.0

func (c *Client) DeleteFulaConfig() ([]byte, error)

DeleteFulaConfig deletes config.yaml file

func (*Client) DeleteWifi added in v1.17.0

func (c *Client) DeleteWifi(name string) ([]byte, error)

Reboot requests the blox to reboot

func (*Client) DisconnectWifi added in v1.17.0

func (c *Client) DisconnectWifi(name string) ([]byte, error)

Reboot requests the blox to reboot

func (*Client) EraseBlData added in v1.30.0

func (c *Client) EraseBlData() ([]byte, error)

EraseBlData requests the blox to erase the data related to blockchain

func (*Client) FetchContainerLogs added in v1.44.0

func (c *Client) FetchContainerLogs(ContainerName string, TailCount string) ([]byte, error)

GetAccount requests blox at Config.BloxAddr to get the balance of the account. the addr must be a valid multiaddr that includes peer ID.

func (*Client) FindBestAndTargetInLogs added in v1.54.9

func (c *Client) FindBestAndTargetInLogs(NodeContainerName string, TailCount string) ([]byte, error)

GetAccount requests blox at Config.BloxAddr to get the balance of the account. the addr must be a valid multiaddr that includes peer ID.

func (*Client) Flush added in v0.8.1

func (c *Client) Flush() error

Flush guarantees that all values stored locally are synced to the baking local storage.

func (*Client) GetAccount added in v1.18.0

func (c *Client) GetAccount() ([]byte, error)

GetAccount requests blox at Config.BloxAddr to get the balance of the account. the addr must be a valid multiaddr that includes peer ID.

func (*Client) GetChatChunk added in v1.55.1

func (c *Client) GetChatChunk(streamID string) (string, error)

func (*Client) GetClusterInfo added in v1.57.2

func (c *Client) GetClusterInfo() ([]byte, error)

GetClusterInfo fetches the ipfs-cluster peer ID and peer name from the blox.

func (*Client) GetDatastoreSize added in v1.48.0

func (c *Client) GetDatastoreSize() ([]byte, error)

func (*Client) GetDockerImageBuildDates added in v1.57.2

func (c *Client) GetDockerImageBuildDates() ([]byte, error)

GetDockerImageBuildDates fetches build dates of all Docker images running on the blox.

func (*Client) GetFolderSize added in v1.45.0

func (c *Client) GetFolderSize(folderPath string) ([]byte, error)

GetAccount requests blox at Config.BloxAddr to get the balance of the account. the addr must be a valid multiaddr that includes peer ID.

func (*Client) GetInstallOutput added in v1.54.15

func (c *Client) GetInstallOutput(pluginName string, params string) ([]byte, error)

InstallPlugin requests the blox to install a specific plugin

func (*Client) GetInstallStatus added in v1.54.15

func (c *Client) GetInstallStatus(pluginName string) ([]byte, error)

InstallPlugin requests the blox to install a specific plugin

func (*Client) GetStreamIterator added in v1.55.1

func (c *Client) GetStreamIterator(streamID string) (*StreamIterator, error)

func (*Client) ID added in v0.5.0

func (c *Client) ID() string

ID returns the libp2p peer ID of the client.

func (*Client) InstallPlugin added in v1.54.13

func (c *Client) InstallPlugin(pluginName string, params string) ([]byte, error)

InstallPlugin requests the blox to install a specific plugin

func (*Client) ListActivePlugins added in v1.54.13

func (c *Client) ListActivePlugins() ([]byte, error)

func (*Client) ListPlugins added in v1.54.13

func (c *Client) ListPlugins() ([]byte, error)

ListPlugins requests the blox to list all available plugins

func (*Client) ManifestAvailable added in v0.8.8

func (c *Client) ManifestAvailable(poolID int) ([]byte, error)

ManifestAvailable requests blox at Config.BloxAddr to list manifests the addr must be a valid multiaddr that includes peer ID.

func (*Client) Partition added in v1.14.0

func (c *Client) Partition() ([]byte, error)

Partition requests the blox to partition ssd and nvme

func (*Client) Ping added in v1.57.0

func (c *Client) Ping() ([]byte, error)

Ping sends libp2p pings to the blox peer and returns a JSON object with results. It first ensures connectivity (direct → relay → DHT fallback), then sends 3 pings. Returns JSON: {"success": true/false, "successes": N, "avg_rtt_ms": N, "errors": [...]} Success is true if at least one ping succeeded.

func (*Client) PoolCancelJoin added in v0.8.8

func (c *Client) PoolCancelJoin(poolID int) ([]byte, error)

PoolJoin requests blox at Config.BloxAddr to cancel a join request for a pool with the id. the addr must be a valid multiaddr that includes peer ID. Note that this call is only allowed on a user's own blox

func (*Client) PoolJoin added in v0.8.8

func (c *Client) PoolJoin(poolID int) ([]byte, error)

PoolJoin requests blox at Config.BloxAddr to join a pool with the id. the addr must be a valid multiaddr that includes peer ID. Note that this call is only allowed on a user's own blox

func (*Client) PoolJoinWithChain added in v1.55.15

func (c *Client) PoolJoinWithChain(poolID int, chainName string) ([]byte, error)

PoolJoinWithChain requests blox at Config.BloxAddr to join a pool with the id on a specific chain. the addr must be a valid multiaddr that includes peer ID. Note that this call is only allowed on a user's own blox

func (*Client) PoolLeave added in v0.8.8

func (c *Client) PoolLeave(poolID int) ([]byte, error)

PoolLeave requests blox at Config.BloxAddr to leave a pool with the id. the addr must be a valid multiaddr that includes peer ID. Note that this call is only allowed on a user's own blox

func (*Client) PoolLeaveWithChain added in v1.55.15

func (c *Client) PoolLeaveWithChain(poolID int, chainName string) ([]byte, error)

PoolLeaveWithChain requests blox at Config.BloxAddr to leave a pool with the id on a specific chain. the addr must be a valid multiaddr that includes peer ID. Note that this call is only allowed on a user's own blox

func (*Client) PoolList added in v0.8.8

func (c *Client) PoolList() ([]byte, error)

PoolList requests blox at Config.BloxAddr to list the pools. the addr must be a valid multiaddr that includes peer ID.

func (*Client) PoolRequests added in v0.8.8

func (c *Client) PoolRequests(poolID int) ([]byte, error)

PoolListRequests requests blox at Config.BloxAddr to list the join request for a pool with the id. the addr must be a valid multiaddr that includes peer ID.

func (*Client) PoolUserList added in v0.8.8

func (c *Client) PoolUserList(poolID int) ([]byte, error)

PoolUserList requests blox at Config.BloxAddr to list the input pool users. the addr must be a valid multiaddr that includes peer ID.

func (*Client) Reboot added in v1.0.0

func (c *Client) Reboot() ([]byte, error)

Reboot requests the blox to reboot

func (*Client) ReplicateInPool added in v1.53.0

func (c *Client) ReplicateInPool(cidsBytes []byte, account string, poolID int) []byte

func (*Client) SetAuth added in v0.8.3

func (c *Client) SetAuth(on string, subject string, allow bool) error

SetAuth sets authorization on the given peer ID for the given subject.

func (*Client) ShowPluginStatus added in v1.54.13

func (c *Client) ShowPluginStatus(pluginName string, lines int) ([]byte, error)

ShowPluginStatus requests the status of a specific plugin

func (*Client) Shutdown added in v0.4.9

func (c *Client) Shutdown() error

Shutdown closes all resources used by Client. After calling this function Client must be discarded.

func (*Client) TransferToFula added in v1.33.0

func (c *Client) TransferToFula(amountStr string, walletAccount string, chain string) ([]byte, error)

func (*Client) UninstallPlugin added in v1.54.13

func (c *Client) UninstallPlugin(pluginName string) ([]byte, error)

UninstallPlugin requests the blox to uninstall a specific plugin

func (*Client) UpdatePlugin added in v1.54.15

func (c *Client) UpdatePlugin(pluginName string) ([]byte, error)

func (*Client) WifiRemoveall added in v1.0.0

func (c *Client) WifiRemoveall() ([]byte, error)

WifiRemoveall requests the blox to remove all saved wifis

type Config added in v0.4.9

type Config struct {
	Identity  []byte
	StorePath string
	// Exchange specifies the DAG exchange protocol for Fula mobile client. If left unspecified,
	// The default FxExchange protocol is used which will attempt to make remote connections
	// when links are stored and retrieved.
	//
	// For testing purposes, the value may be set to `noop`, in which case, no remote connections
	// will be made and the requested exchange is simply logged. When the value is set to `noop`
	// the BloxAddr may also be left empty.
	Exchange string
	BloxAddr string
	// StaticRelays specifies a list of static relays used by libp2p auto-relay.
	// Defaults to fx.land managed relay if unspecified.
	StaticRelays []string

	// ForceReachabilityPrivate configures weather the libp2p should always think that it is behind
	// NAT.
	ForceReachabilityPrivate bool

	// DisableResourceManger sets whether to disable the libp2p resource manager.
	DisableResourceManger bool

	// SyncWrites assures that writes to the local datastore are flushed to the backing store as
	// soon as they are written. By default, writes are not synchronized to disk until either the
	// client is shut down or Client.Flush is explicitly called.
	SyncWrites bool

	// AllowTransientConnection allows transient connectivity via relay when direct connection is
	// not possible. Defaults to enabled if unspecified.
	AllowTransientConnection bool
	PoolName                 string
	BlockchainEndpoint       string

	// IpfsDHTLookupDisabled disables IPFS DHT peer discovery fallback.
	// When false (default), the client will query the standard IPFS DHT to discover
	// kubo's current addresses if direct and relay connections fail.
	IpfsDHTLookupDisabled bool
}

func NewConfig added in v0.8.4

func NewConfig() *Config

NewConfig instantiates a new Config with default values.

type PluginParam added in v1.54.13

type PluginParam struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type StreamIterator added in v1.55.1

type StreamIterator struct {
	// contains filtered or unexported fields
}

func NewStreamIterator added in v1.55.1

func NewStreamIterator(buffer *blockchain.StreamBuffer) *StreamIterator

func (*StreamIterator) Close added in v1.55.1

func (i *StreamIterator) Close()

Close implements automatic cleanup in Go

func (*StreamIterator) HasNext added in v1.55.1

func (i *StreamIterator) HasNext() bool

func (*StreamIterator) IsComplete added in v1.55.1

func (i *StreamIterator) IsComplete() bool

func (*StreamIterator) Next added in v1.55.1

func (i *StreamIterator) Next() (string, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL