fulamobile

package
v1.55.17 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2025 License: MIT Imports: 46 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) 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) ClearCidsFromRecent added in v1.15.0

func (c *Client) ClearCidsFromRecent(cidsBytes []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. 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) Get added in v0.4.9

func (c *Client) Get(key []byte) ([]byte, error)

Get gets the value corresponding to the given key from the local ipld.LinkSystem The key must be a valid ipld.Link and the value returned is encoded ipld.Node. If data is not found locally, an attempt is made to automatically fetch the data from blox at Config.BloxAddr address.

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) GetDatastoreSize added in v1.48.0

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

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) Has added in v0.4.9

func (c *Client) Has(key []byte) (bool, error)

Has checks whether the value corresponding to the given key is present in the local datastore. The key must be a valid ipld.Link.

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 (c *Client) IpniNotifyLink(l string)

func (*Client) ListActivePlugins added in v1.54.13

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

func (*Client) ListFailedPushes added in v0.5.9

func (c *Client) ListFailedPushes() (*LinkIterator, error)

func (*Client) ListFailedPushesAsString added in v1.0.0

func (c *Client) ListFailedPushesAsString() (*StringIterator, 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) ListRecentCidsAsString added in v1.15.0

func (c *Client) ListRecentCidsAsString() (*StringIterator, error)

func (*Client) ListRecentCidsAsStringWithChildren added in v1.53.0

func (c *Client) ListRecentCidsAsStringWithChildren() (*StringIterator, error)

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) 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) Pull added in v0.4.9

func (c *Client) Pull(key []byte) error

Pull downloads the data corresponding to the given key from blox at Config.BloxAddr. The key must be a valid ipld.Link.

func (*Client) Push added in v0.4.9

func (c *Client) Push(key []byte) error

Push requests blox at Config.BloxAddr to download the given key from this node. The key must be a valid ipld.Link, and the addr must be a valid multiaddr that includes peer ID. The value corresponding to the given key must be stored in the local datastore prior to calling this function. See: Client.Put.

func (*Client) Put added in v0.4.9

func (c *Client) Put(value []byte, codec int64) ([]byte, error)

Put stores the given value onto the ipld.LinkSystem and returns its corresponding link. The value is decoded using the decoder that corresponds to the given codec. Therefore, the given value must be a valid ipld.Node. Upon successful local storage of the given value, it is automatically pushed to the blox at Config.BloxAddr address.

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) RetryFailedPushes added in v0.8.1

func (c *Client) RetryFailedPushes() error

RetryFailedPushes retries pushing all links that failed to push. The retry is disrupted as soon as a failure occurs. See ListFailedPushes.

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
}

func NewConfig added in v0.8.4

func NewConfig() *Config

NewConfig instantiates a new Config with default values.

type LinkIterator added in v0.8.0

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

func (*LinkIterator) HasNext added in v0.8.0

func (i *LinkIterator) HasNext() bool

func (*LinkIterator) Next added in v0.8.0

func (i *LinkIterator) Next() ([]byte, error)

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)

type StringIterator added in v1.0.0

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

func (*StringIterator) HasNext added in v1.0.0

func (i *StringIterator) HasNext() bool

func (*StringIterator) Next added in v1.0.0

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

Jump to

Keyboard shortcuts

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