blockchain

package
v1.54.9 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	B  = 1
	KB = 1024 * B
	MB = 1024 * KB
	GB = 1024 * MB
)
View Source
const (
	FxBlockchainProtocolID = "/fx.land/blockchain/0.0.1"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountBalanceRequest

type AccountBalanceRequest struct {
	Account string `json:"account"`
}

type AccountBalanceResponse

type AccountBalanceResponse struct {
	Amount string `json:"amount"`
}

type AccountCreateRequest

type AccountCreateRequest struct {
	Account string `json:"account"`
}

type AccountCreateResponse

type AccountCreateResponse struct {
	Account string `json:"account"`
}

type AccountExistsRequest

type AccountExistsRequest struct {
	Account string `json:"account"`
}

type AccountExistsResponse

type AccountExistsResponse struct {
	Account string `json:"account"`
	Exists  bool   `json:"exists"`
}

type AccountFundRequest

type AccountFundRequest struct {
	Amount BigInt `json:"amount"`
	To     string `json:"to"`
}

type AccountFundResponse

type AccountFundResponse struct {
	From   string `json:"from"`
	To     string `json:"to"`
	Amount string `json:"amount"`
}

type AssetsBalanceRequest added in v1.18.0

type AssetsBalanceRequest struct {
	Account string `json:"account"`
	ClassId uint64 `json:"class_id"`
	AssetId uint64 `json:"asset_id"`
}

type AssetsBalanceResponse added in v1.18.0

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

type AvailableAllaccountsBatchRequest added in v1.54.9

type AvailableAllaccountsBatchRequest struct {
	Cids   []string `json:"cids"`
	PoolID int      `json:"pool_id"`
}

type BatchManifest added in v1.53.0

type BatchManifest struct {
	Cid                  string `json:"cid"`
	ReplicationAvailable int    `json:"replication_available"`
}

type BatchManifestAllaccounts added in v1.54.9

type BatchManifestAllaccounts struct {
	Cid string `json:"cid"`
}

type BatchManifestAllaccountsResponse added in v1.54.9

type BatchManifestAllaccountsResponse struct {
	Manifests []BatchManifestAllaccounts `json:"manifests"`
}

type BigInt

type BigInt struct {
	big.Int
}

func (BigInt) MarshalJSON

func (b BigInt) MarshalJSON() ([]byte, error)

func (*BigInt) UnmarshalJSON

func (b *BigInt) UnmarshalJSON(p []byte) error

type Blockchain

type Blockchain interface {
	Seeded(context.Context, peer.ID, SeededRequest) ([]byte, error)
	AccountExists(context.Context, peer.ID, AccountExistsRequest) ([]byte, error)
	AccountCreate(context.Context, peer.ID) ([]byte, error)
	AccountFund(context.Context, peer.ID, AccountFundRequest) ([]byte, error)
	AccountBalance(context.Context, peer.ID, AccountBalanceRequest) ([]byte, error)
	AssetsBalance(context.Context, peer.ID, AssetsBalanceRequest) ([]byte, error)
	TransferToFula(context.Context, peer.ID, TransferToFulaRequest) ([]byte, error)
	PoolCreate(context.Context, peer.ID, PoolCreateRequest) ([]byte, error)
	PoolJoin(context.Context, peer.ID, PoolJoinRequest) ([]byte, error)
	PoolCancelJoin(context.Context, peer.ID, PoolCancelJoinRequest) ([]byte, error)
	PoolRequests(context.Context, peer.ID, PoolRequestsRequest) ([]byte, error)
	PoolList(context.Context, peer.ID, PoolListRequest) ([]byte, error)
	PoolUserList(context.Context, peer.ID, PoolUserListRequest) ([]byte, error)
	PoolVote(context.Context, peer.ID, PoolVoteRequest) ([]byte, error)
	PoolLeave(context.Context, peer.ID, PoolLeaveRequest) ([]byte, error)
	ManifestUpload(context.Context, peer.ID, ManifestUploadRequest) ([]byte, error)
	ManifestBatchStore(context.Context, peer.ID, ManifestBatchStoreRequest) ([]byte, error)
	ManifestBatchUpload(context.Context, peer.ID, ManifestBatchUploadMobileRequest) ([]byte, error)
	ReplicateInPool(context.Context, peer.ID, ReplicateRequest) ([]byte, error)
	ManifestStore(context.Context, peer.ID, ManifestStoreRequest) ([]byte, error)
	ManifestAvailable(context.Context, peer.ID, ManifestAvailableRequest) ([]byte, error)
	ManifestRemove(context.Context, peer.ID, ManifestRemoveRequest) ([]byte, error)
	ManifestRemoveStorer(context.Context, peer.ID, ManifestRemoveStorerRequest) ([]byte, error)
	ManifestRemoveStored(context.Context, peer.ID, ManifestRemoveStoredRequest) ([]byte, error)
	SetAuth(context.Context, peer.ID, peer.ID, bool) error

	//Hardware
	BloxFreeSpace(context.Context, peer.ID) ([]byte, error)
	EraseBlData(context.Context, peer.ID) ([]byte, error)
	WifiRemoveall(context.Context, peer.ID) ([]byte, error)
	Reboot(context.Context, peer.ID) ([]byte, error)
	DeleteWifi(context.Context, peer.ID, wifi.DeleteWifiRequest) ([]byte, error)
	DisconnectWifi(context.Context, peer.ID, wifi.DeleteWifiRequest) ([]byte, error)
	Partition(context.Context, peer.ID) ([]byte, error)
	DeleteFulaConfig(context.Context, peer.ID) ([]byte, error)
	GetAccount(context.Context, peer.ID) ([]byte, error)
	FetchContainerLogs(context.Context, peer.ID, wifi.FetchContainerLogsRequest) ([]byte, error)
	FindBestAndTargetInLogs(context.Context, peer.ID, wifi.FindBestAndTargetInLogsRequest) ([]byte, error)
	GetFolderSize(context.Context, peer.ID, wifi.GetFolderSizeRequest) ([]byte, error)
	GetDatastoreSize(context.Context, peer.ID, wifi.GetDatastoreSizeRequest) ([]byte, error)
}

type Config

type Config struct {
	StoreDir string `yaml:"storeDir"`
}

type FxBlockchain

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

func NewFxBlockchain

func NewFxBlockchain(h host.Host, p *ping.FxPing, a *announcements.FxAnnouncements, keyStorer KeyStorer, o ...Option) (*FxBlockchain, error)

func (*FxBlockchain) AccountBalance

func (bl *FxBlockchain) AccountBalance(ctx context.Context, to peer.ID, r AccountBalanceRequest) ([]byte, error)

func (*FxBlockchain) AccountCreate

func (bl *FxBlockchain) AccountCreate(ctx context.Context, to peer.ID) ([]byte, error)

func (*FxBlockchain) AccountExists

func (bl *FxBlockchain) AccountExists(ctx context.Context, to peer.ID, r AccountExistsRequest) ([]byte, error)

func (*FxBlockchain) AccountFund

func (bl *FxBlockchain) AccountFund(ctx context.Context, to peer.ID, r AccountFundRequest) ([]byte, error)

func (*FxBlockchain) AssetsBalance added in v1.18.0

func (bl *FxBlockchain) AssetsBalance(ctx context.Context, to peer.ID, r AssetsBalanceRequest) ([]byte, error)

func (*FxBlockchain) BloxFreeSpace

func (bl *FxBlockchain) BloxFreeSpace(ctx context.Context, to peer.ID) ([]byte, error)

func (*FxBlockchain) DeleteFulaConfig added in v1.14.0

func (bl *FxBlockchain) DeleteFulaConfig(ctx context.Context, to peer.ID) ([]byte, error)

func (*FxBlockchain) DeleteWifi added in v1.17.0

func (bl *FxBlockchain) DeleteWifi(ctx context.Context, to peer.ID, r wifi.DeleteWifiRequest) ([]byte, error)

func (*FxBlockchain) DisconnectWifi added in v1.17.0

func (bl *FxBlockchain) DisconnectWifi(ctx context.Context, to peer.ID, r wifi.DeleteWifiRequest) ([]byte, error)

func (*FxBlockchain) EraseBlData added in v1.30.0

func (bl *FxBlockchain) EraseBlData(ctx context.Context, to peer.ID) ([]byte, error)

func (*FxBlockchain) FetchContainerLogs added in v1.44.0

func (bl *FxBlockchain) FetchContainerLogs(ctx context.Context, to peer.ID, r wifi.FetchContainerLogsRequest) ([]byte, error)

func (*FxBlockchain) FetchUsersAndPopulateSets added in v1.15.0

func (bl *FxBlockchain) FetchUsersAndPopulateSets(ctx context.Context, topicString string, initiate bool, timeout time.Duration) error

func (*FxBlockchain) FindBestAndTargetInLogs added in v1.54.9

func (bl *FxBlockchain) FindBestAndTargetInLogs(ctx context.Context, to peer.ID, r wifi.FindBestAndTargetInLogsRequest) ([]byte, error)

func (*FxBlockchain) GetAccount added in v1.18.0

func (bl *FxBlockchain) GetAccount(ctx context.Context, to peer.ID) ([]byte, error)

func (*FxBlockchain) GetDatastoreSize added in v1.48.0

func (bl *FxBlockchain) GetDatastoreSize(ctx context.Context, to peer.ID, r wifi.GetDatastoreSizeRequest) ([]byte, error)

func (*FxBlockchain) GetFolderSize added in v1.45.0

func (bl *FxBlockchain) GetFolderSize(ctx context.Context, to peer.ID, r wifi.GetFolderSizeRequest) ([]byte, error)

func (*FxBlockchain) GetMemberStatus added in v1.15.0

func (bl *FxBlockchain) GetMemberStatus(id peer.ID) (common.MemberStatus, bool)

func (*FxBlockchain) GetMembers added in v1.15.0

func (bl *FxBlockchain) GetMembers() map[peer.ID]common.MemberStatus

func (*FxBlockchain) HandleGetAccount added in v1.18.0

func (bl *FxBlockchain) HandleGetAccount(ctx context.Context, from peer.ID, w http.ResponseWriter, r *http.Request)

func (*FxBlockchain) HandleManifestAvailableAllaccountsBatch added in v1.54.9

func (bl *FxBlockchain) HandleManifestAvailableAllaccountsBatch(ctx context.Context, poolIDString string, links []ipld.Link) ([]ipld.Link, error)

func (*FxBlockchain) HandleManifestBatchStore added in v1.16.0

func (bl *FxBlockchain) HandleManifestBatchStore(ctx context.Context, poolIDString string, links []ipld.Link) ([]string, error)

func (*FxBlockchain) HandleManifestsAvailable added in v1.16.0

func (bl *FxBlockchain) HandleManifestsAvailable(ctx context.Context, poolIDString string, limit int) ([]LinkWithLimit, error)

func (*FxBlockchain) HandlePoolCancelJoin added in v1.41.0

func (bl *FxBlockchain) HandlePoolCancelJoin(method string, action string, from peer.ID, w http.ResponseWriter, r *http.Request)

func (*FxBlockchain) HandlePoolJoin added in v1.41.0

func (bl *FxBlockchain) HandlePoolJoin(method string, action string, from peer.ID, w http.ResponseWriter, r *http.Request)

func (*FxBlockchain) HandlePoolJoinRequest added in v1.15.0

func (bl *FxBlockchain) HandlePoolJoinRequest(ctx context.Context, from peer.ID, account string, topicString string, withMemberListUpdate bool) error

func (*FxBlockchain) HandlePoolList added in v1.54.8

func (bl *FxBlockchain) HandlePoolList(ctx context.Context) (PoolListResponse, error)

func (*FxBlockchain) HandleSeeded added in v1.18.0

func (bl *FxBlockchain) HandleSeeded(ctx context.Context, req *SeededRequest) (string, error)

func (*FxBlockchain) IsMembersEmpty added in v1.15.0

func (bl *FxBlockchain) IsMembersEmpty() bool

func (*FxBlockchain) ManifestAvailable

func (bl *FxBlockchain) ManifestAvailable(ctx context.Context, to peer.ID, r ManifestAvailableRequest) ([]byte, error)

func (*FxBlockchain) ManifestBatchStore added in v1.53.0

func (bl *FxBlockchain) ManifestBatchStore(ctx context.Context, to peer.ID, r ManifestBatchStoreRequest) ([]byte, error)

func (*FxBlockchain) ManifestBatchUpload added in v1.53.0

func (bl *FxBlockchain) ManifestBatchUpload(ctx context.Context, to peer.ID, r ManifestBatchUploadMobileRequest) ([]byte, error)

func (*FxBlockchain) ManifestRemove

func (bl *FxBlockchain) ManifestRemove(ctx context.Context, to peer.ID, r ManifestRemoveRequest) ([]byte, error)

func (*FxBlockchain) ManifestRemoveStored

func (bl *FxBlockchain) ManifestRemoveStored(ctx context.Context, to peer.ID, r ManifestRemoveStoredRequest) ([]byte, error)

func (*FxBlockchain) ManifestRemoveStorer

func (bl *FxBlockchain) ManifestRemoveStorer(ctx context.Context, to peer.ID, r ManifestRemoveStorerRequest) ([]byte, error)

func (*FxBlockchain) ManifestStore

func (bl *FxBlockchain) ManifestStore(ctx context.Context, to peer.ID, r ManifestStoreRequest) ([]byte, error)

func (*FxBlockchain) ManifestUpload

func (bl *FxBlockchain) ManifestUpload(ctx context.Context, to peer.ID, r ManifestUploadRequest) ([]byte, error)

func (*FxBlockchain) Partition added in v1.14.0

func (bl *FxBlockchain) Partition(ctx context.Context, to peer.ID) ([]byte, error)

func (*FxBlockchain) PlugSeedIfNeeded

func (bl *FxBlockchain) PlugSeedIfNeeded(ctx context.Context, action string, req interface{}) interface{}

func (*FxBlockchain) PoolCancelJoin

func (bl *FxBlockchain) PoolCancelJoin(ctx context.Context, to peer.ID, r PoolCancelJoinRequest) ([]byte, error)

func (*FxBlockchain) PoolCreate

func (bl *FxBlockchain) PoolCreate(ctx context.Context, to peer.ID, r PoolCreateRequest) ([]byte, error)

func (*FxBlockchain) PoolJoin

func (bl *FxBlockchain) PoolJoin(ctx context.Context, to peer.ID, r PoolJoinRequest) ([]byte, error)

func (*FxBlockchain) PoolLeave

func (bl *FxBlockchain) PoolLeave(ctx context.Context, to peer.ID, r PoolLeaveRequest) ([]byte, error)

func (*FxBlockchain) PoolList

func (bl *FxBlockchain) PoolList(ctx context.Context, to peer.ID, r PoolListRequest) ([]byte, error)

func (*FxBlockchain) PoolRequests

func (bl *FxBlockchain) PoolRequests(ctx context.Context, to peer.ID, r PoolRequestsRequest) ([]byte, error)

func (*FxBlockchain) PoolUserList

func (bl *FxBlockchain) PoolUserList(ctx context.Context, to peer.ID, r PoolUserListRequest) ([]byte, error)

func (*FxBlockchain) PoolVote

func (bl *FxBlockchain) PoolVote(ctx context.Context, to peer.ID, r PoolVoteRequest) ([]byte, error)

func (*FxBlockchain) Reboot added in v1.0.0

func (bl *FxBlockchain) Reboot(ctx context.Context, to peer.ID) ([]byte, error)

func (*FxBlockchain) ReplicateInPool added in v1.53.0

func (bl *FxBlockchain) ReplicateInPool(ctx context.Context, to peer.ID, r ReplicateRequest) ([]byte, error)

func (*FxBlockchain) Seeded

func (bl *FxBlockchain) Seeded(ctx context.Context, to peer.ID, r SeededRequest) ([]byte, error)

func (*FxBlockchain) SetAuth

func (bl *FxBlockchain) SetAuth(ctx context.Context, on peer.ID, subject peer.ID, allow bool) error

func (*FxBlockchain) Shutdown

func (bl *FxBlockchain) Shutdown(ctx context.Context) error

func (*FxBlockchain) Start

func (bl *FxBlockchain) Start(ctx context.Context) error

func (*FxBlockchain) StartPingServer added in v1.15.0

func (bl *FxBlockchain) StartPingServer(ctx context.Context) error

func (*FxBlockchain) StopPingServer added in v1.15.0

func (bl *FxBlockchain) StopPingServer(ctx context.Context) error

func (*FxBlockchain) TransferToFula added in v1.33.0

func (bl *FxBlockchain) TransferToFula(ctx context.Context, to peer.ID, r TransferToFulaRequest) ([]byte, error)

func (*FxBlockchain) WifiRemoveall added in v1.0.0

func (bl *FxBlockchain) WifiRemoveall(ctx context.Context, to peer.ID) ([]byte, error)

type GetAccountRequest added in v1.18.0

type GetAccountRequest struct {
}

type GetAccountResponse added in v1.18.0

type GetAccountResponse struct {
	Account string `json:"account"`
}

type KeyStorer

type KeyStorer interface {
	SaveKey(ctx context.Context, key string) error
	LoadKey(ctx context.Context) (string, error)
}

Implementations for this interface should be responsible for saving/loading a single key.

type LinkWithLimit added in v1.16.0

type LinkWithLimit struct {
	Link  ipld.Link
	Limit int
}

type Manifest

type Manifest struct {
	PoolID               int              `json:"pool_id"`
	ReplicationAvailable int              `json:"replication_available"`
	ManifestMetadata     ManifestMetadata `json:"manifest_metadata"`
}

type ManifestAvailableRequest

type ManifestAvailableRequest struct {
	PoolID int `json:"pool_id"`
}

type ManifestAvailableResponse

type ManifestAvailableResponse struct {
	Manifests []Manifest `json:"manifests"`
}

type ManifestBatchStoreRequest added in v1.16.0

type ManifestBatchStoreRequest struct {
	Cid    []string `json:"cid"`
	PoolID int      `json:"pool_id"`
}

type ManifestBatchStoreResponse added in v1.16.0

type ManifestBatchStoreResponse struct {
	PoolID int      `json:"pool_id"`
	Storer string   `json:"storer"`
	Cid    []string `json:"cid"`
}

type ManifestBatchUploadMobileRequest added in v1.53.0

type ManifestBatchUploadMobileRequest struct {
	Cid               []string `json:"cid"`
	PoolID            int      `json:"pool_id"`
	ReplicationFactor int      `json:"replication_factor"`
}

type ManifestBatchUploadRequest added in v1.53.0

type ManifestBatchUploadRequest struct {
	Cid               []string           `json:"cid"`
	PoolID            int                `json:"pool_id"`
	ReplicationFactor []int              `json:"replication_factor"`
	ManifestMetadata  []ManifestMetadata `json:"manifest_metadata"`
}

type ManifestBatchUploadResponse added in v1.53.0

type ManifestBatchUploadResponse struct {
	PoolID int      `json:"pool_id"`
	Storer string   `json:"storer"`
	Cid    []string `json:"cid"`
}

type ManifestData

type ManifestData struct {
	Uploader         string           `json:"uploader"`
	ManifestMetadata ManifestMetadata `json:"manifest_metadata"`
}

type ManifestJob

type ManifestJob struct {
	Work   string `json:"work"`
	Engine string `json:"engine"`
	Uri    string `json:"uri"`
}

type ManifestMetadata

type ManifestMetadata struct {
	Job ManifestJob `json:"job"`
}

type ManifestRemoveRequest

type ManifestRemoveRequest struct {
	Cid    string `json:"cid"`
	PoolID int    `json:"pool_id"`
}

type ManifestRemoveResponse

type ManifestRemoveResponse struct {
	Uploader string `json:"uploader"`
	Cid      string `json:"cid"`
	PoolID   int    `json:"pool_id"`
}

type ManifestRemoveStoredRequest

type ManifestRemoveStoredRequest struct {
	Uploader string `json:"uploader"`
	Cid      string `json:"cid"`
	PoolID   int    `json:"pool_id"`
}

type ManifestRemoveStoredResponse

type ManifestRemoveStoredResponse struct {
	Uploader string `json:"uploader"`
	Storage  string `json:"storage"`
	Cid      string `json:"cid"`
	PoolID   int    `json:"pool_id"`
}

type ManifestRemoveStorerRequest

type ManifestRemoveStorerRequest struct {
	Storage string `json:"storage"`
	Cid     string `json:"cid"`
	PoolID  int    `json:"pool_id"`
}

type ManifestRemoveStorerResponse

type ManifestRemoveStorerResponse struct {
	Uploader string `json:"uploader"`
	Storage  string `json:"storage"`
	Cid      string `json:"cid"`
	PoolID   int    `json:"pool_id"`
}

type ManifestStoreRequest

type ManifestStoreRequest struct {
	Uploader string `json:"uploader"`
	Cid      string `json:"cid"`
	PoolID   int    `json:"pool_id"`
}

type ManifestStoreResponse

type ManifestStoreResponse struct {
	PoolID   int    `json:"pool_id"`
	Storage  string `json:"storage"`
	Uploader string `json:"uploader"`
	Cid      string `json:"cid"`
}

type ManifestUploadRequest

type ManifestUploadRequest struct {
	PoolID            int              `json:"pool_id"`
	ReplicationFactor int              `json:"replication_factor"`
	ManifestMetadata  ManifestMetadata `json:"manifest_metadata"`
	Cid               string           `json:"cid"`
}

type ManifestUploadResponse

type ManifestUploadResponse struct {
	Uploader         string           `json:"uploader"`
	Storage          []string         `json:"storage"`
	ManifestMetadata ManifestMetadata `json:"manifest_metadata"`
	PoolID           int              `json:"pool_id"`
}

type MobileAssetsBalanceResponse added in v1.54.8

type MobileAssetsBalanceResponse struct {
	Amount string `json:"amount"`
}

type Option

type Option func(*options) error

func WithAllowTransientConnection

func WithAllowTransientConnection(t bool) Option

func WithAuthorizedPeers added in v1.14.0

func WithAuthorizedPeers(l []peer.ID) Option

func WithAuthorizer

func WithAuthorizer(a peer.ID) Option

func WithBlockchainEndPoint

func WithBlockchainEndPoint(b string) Option

func WithFetchFrequency added in v1.15.0

func WithFetchFrequency(t time.Duration) Option

func WithGetPoolName added in v1.54.8

func WithGetPoolName(getPoolName func() string) Option

func WithIpfsClient added in v1.48.0

func WithIpfsClient(n *rpc.HttpApi) Option

func WithIpfsClusterAPI added in v1.53.0

func WithIpfsClusterAPI(n ipfsCluster.Client) Option

func WithMaxPingTime added in v1.15.0

func WithMaxPingTime(t int) Option

func WithMinSuccessPingCount added in v1.15.0

func WithMinSuccessPingCount(sr int) Option

func WithRelays added in v1.15.0

func WithRelays(r []string) Option

WithStoreDir sets a the store directory we are using for datastore Required.

func WithSecretsPath added in v1.41.0

func WithSecretsPath(b string) Option

func WithTimeout

func WithTimeout(to int) Option

func WithTopicName added in v1.15.0

func WithTopicName(n string) Option

func WithUpdatePoolName added in v1.15.0

func WithUpdatePoolName(updatePoolName func(string) error) Option

func WithWg added in v1.15.0

func WithWg(wg *sync.WaitGroup) Option

type PingResponse added in v1.53.0

type PingResponse struct {
	Success bool   `json:"Success"`
	Time    int64  `json:"Time"`
	Text    string `json:"Text"`
}

type Pool

type Pool struct {
	PoolID       int      `json:"pool_id"`
	Creator      string   `json:"creator"`
	PoolName     string   `json:"pool_name"`
	Parent       string   `json:"parent"`
	Participants []string `json:"participants"`
	Region       string   `json:"region"`
}

type PoolCancelJoinRequest

type PoolCancelJoinRequest struct {
	PoolID int `json:"pool_id"`
}

type PoolCancelJoinResponse

type PoolCancelJoinResponse struct {
	Account string `json:"account"`
	PoolID  int    `json:"pool_id"`
}

type PoolCreateRequest

type PoolCreateRequest struct {
	PoolName string `json:"pool_name"`
	PeerID   string `json:"peer_id"`
}

type PoolCreateResponse

type PoolCreateResponse struct {
	Owner  string `json:"owner"`
	PoolID int    `json:"pool_id"`
}

type PoolJoinRequest

type PoolJoinRequest struct {
	PoolID int    `json:"pool_id"`
	PeerID string `json:"peer_id"`
}

type PoolJoinResponse

type PoolJoinResponse struct {
	Account string `json:"account"`
	PoolID  int    `json:"pool_id"`
}

type PoolLeaveRequest

type PoolLeaveRequest struct {
	PoolID int `json:"pool_id"`
}

type PoolLeaveResponse

type PoolLeaveResponse struct {
	Account string `json:"account"`
	PoolID  int    `json:"pool_id"`
}

type PoolListRequest

type PoolListRequest struct {
}

type PoolListRequestWithPoolId added in v1.53.0

type PoolListRequestWithPoolId struct {
	PoolID int `json:"pool_id"`
}

type PoolListResponse

type PoolListResponse struct {
	Pools []Pool `json:"pools"`
}

type PoolRequest

type PoolRequest struct {
	PoolID        int      `json:"pool_id"`
	Account       string   `json:"account"`
	Voted         []string `json:"voted"`
	PositiveVotes int      `json:"positive_votes"`
	PeerID        string   `json:"peer_id"`
}

type PoolRequestsRequest

type PoolRequestsRequest struct {
	PoolID int `json:"pool_id"`
}

type PoolRequestsResponse

type PoolRequestsResponse struct {
	PoolRequests []PoolRequest `json:"poolrequests"`
}

type PoolUserListRequest

type PoolUserListRequest struct {
	PoolID        int `json:"pool_id"`
	RequestPoolID int `json:"request_pool_id"`
}

type PoolUserListResponse

type PoolUserListResponse struct {
	Users []User `json:"users"`
}

type PoolVoteRequest

type PoolVoteRequest struct {
	PoolID    int    `json:"pool_id"`
	Account   string `json:"account"`
	VoteValue bool   `json:"vote_value"`
	PeerID    string `json:"peer_id"`
}

type PoolVoteResponse

type PoolVoteResponse struct {
	Account string `json:"account"`
	PoolID  int    `json:"pool_id"`
	Result  string `json:"result"`
}

type ReplicateRequest added in v1.53.0

type ReplicateRequest struct {
	Cids    []string `json:"cids"`
	Account string   `json:"uploader"`
	PoolID  int      `json:"pool_id"`
}

type ReplicateResponse added in v1.53.0

type ReplicateResponse struct {
	Manifests []BatchManifest `json:"manifests"`
}

type SeededRequest

type SeededRequest struct {
}

type SeededResponse

type SeededResponse struct {
	Seed    string `json:"seed"`
	Account string `json:"account"`
}

type SimpleKeyStorer

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

func NewSimpleKeyStorer

func NewSimpleKeyStorer(dbPath string) *SimpleKeyStorer

func (*SimpleKeyStorer) LoadKey

func (s *SimpleKeyStorer) LoadKey(ctx context.Context) (string, error)

func (*SimpleKeyStorer) SaveKey

func (s *SimpleKeyStorer) SaveKey(ctx context.Context, key string) error

type TransferToFulaRequest added in v1.33.0

type TransferToFulaRequest struct {
	Wallet string `json:"wallet_account"`
	Amount uint64 `json:"amount"`
	Chain  string `json:"chain"`
}

type TransferToFulaResponse added in v1.33.0

type TransferToFulaResponse struct {
	Msg         string `json:"msg"`
	Description string `json:"description"`
}

type User

type User struct {
	PoolID        *int   `json:"pool_id"`
	RequestPoolID *int   `json:"request_pool_id"`
	Account       string `json:"account"`
	PeerID        string `json:"peer_id"`
}

Jump to

Keyboard shortcuts

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