Documentation ¶
Index ¶
- Constants
- type AccountBalanceRequest
- type AccountBalanceResponse
- type AccountCreateRequest
- type AccountCreateResponse
- type AccountExistsRequest
- type AccountExistsResponse
- type AccountFundRequest
- type AccountFundResponse
- type BigInt
- type Blockchain
- type Config
- type FxBlockchain
- func (bl *FxBlockchain) AccountBalance(ctx context.Context, to peer.ID, r AccountBalanceRequest) ([]byte, error)
- func (bl *FxBlockchain) AccountCreate(ctx context.Context, to peer.ID) ([]byte, error)
- func (bl *FxBlockchain) AccountExists(ctx context.Context, to peer.ID, r AccountExistsRequest) ([]byte, error)
- func (bl *FxBlockchain) AccountFund(ctx context.Context, to peer.ID, r AccountFundRequest) ([]byte, error)
- func (bl *FxBlockchain) BloxFreeSpace(ctx context.Context, to peer.ID) ([]byte, error)
- func (bl *FxBlockchain) ManifestAvailable(ctx context.Context, to peer.ID, r ManifestAvailableRequest) ([]byte, error)
- func (bl *FxBlockchain) ManifestRemove(ctx context.Context, to peer.ID, r ManifestRemoveRequest) ([]byte, error)
- func (bl *FxBlockchain) ManifestRemoveStored(ctx context.Context, to peer.ID, r ManifestRemoveStoredRequest) ([]byte, error)
- func (bl *FxBlockchain) ManifestRemoveStorer(ctx context.Context, to peer.ID, r ManifestRemoveStorerRequest) ([]byte, error)
- func (bl *FxBlockchain) ManifestStore(ctx context.Context, to peer.ID, r ManifestStoreRequest) ([]byte, error)
- func (bl *FxBlockchain) ManifestUpload(ctx context.Context, to peer.ID, r ManifestUploadRequest) ([]byte, error)
- func (bl *FxBlockchain) PlugSeedIfNeeded(ctx context.Context, action string, req interface{}) interface{}
- func (bl *FxBlockchain) PoolCancelJoin(ctx context.Context, to peer.ID, r PoolCancelJoinRequest) ([]byte, error)
- func (bl *FxBlockchain) PoolCreate(ctx context.Context, to peer.ID, r PoolCreateRequest) ([]byte, error)
- func (bl *FxBlockchain) PoolJoin(ctx context.Context, to peer.ID, r PoolJoinRequest) ([]byte, error)
- func (bl *FxBlockchain) PoolLeave(ctx context.Context, to peer.ID, r PoolLeaveRequest) ([]byte, error)
- func (bl *FxBlockchain) PoolList(ctx context.Context, to peer.ID, r PoolListRequest) ([]byte, error)
- func (bl *FxBlockchain) PoolRequests(ctx context.Context, to peer.ID, r PoolRequestsRequest) ([]byte, error)
- func (bl *FxBlockchain) PoolUserList(ctx context.Context, to peer.ID, r PoolUserListRequest) ([]byte, error)
- func (bl *FxBlockchain) PoolVote(ctx context.Context, to peer.ID, r PoolVoteRequest) ([]byte, error)
- func (bl *FxBlockchain) Reboot(ctx context.Context, to peer.ID) ([]byte, error)
- func (bl *FxBlockchain) Seeded(ctx context.Context, to peer.ID, r SeededRequest) ([]byte, error)
- func (bl *FxBlockchain) SetAuth(ctx context.Context, on peer.ID, subject peer.ID, allow bool) error
- func (bl *FxBlockchain) Shutdown(ctx context.Context) error
- func (bl *FxBlockchain) Start(ctx context.Context) error
- func (bl *FxBlockchain) WifiRemoveall(ctx context.Context, to peer.ID) ([]byte, error)
- type KeyStorer
- type Manifest
- type ManifestAvailableRequest
- type ManifestAvailableResponse
- type ManifestData
- type ManifestJob
- type ManifestMetadata
- type ManifestRemoveRequest
- type ManifestRemoveResponse
- type ManifestRemoveStoredRequest
- type ManifestRemoveStoredResponse
- type ManifestRemoveStorerRequest
- type ManifestRemoveStorerResponse
- type ManifestStoreRequest
- type ManifestStoreResponse
- type ManifestUploadRequest
- type ManifestUploadResponse
- type Option
- type Pool
- type PoolCancelJoinRequest
- type PoolCancelJoinResponse
- type PoolCreateRequest
- type PoolCreateResponse
- type PoolJoinRequest
- type PoolJoinResponse
- type PoolLeaveRequest
- type PoolLeaveResponse
- type PoolListRequest
- type PoolListResponse
- type PoolRequest
- type PoolRequestsRequest
- type PoolRequestsResponse
- type PoolUserListRequest
- type PoolUserListResponse
- type PoolVoteRequest
- type PoolVoteResponse
- type ReqInterface
- type SeededRequest
- type SeededResponse
- type SimpleKeyStorer
- type User
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 BigInt `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 AccountFundRequest ¶
type AccountFundResponse ¶
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) 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) 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) WifiRemoveall(context.Context, peer.ID) ([]byte, error) Reboot(context.Context, peer.ID) ([]byte, error) }
type FxBlockchain ¶
type FxBlockchain struct {
// contains filtered or unexported fields
}
func NewFxBlockchain ¶
func (*FxBlockchain) AccountBalance ¶
func (bl *FxBlockchain) AccountBalance(ctx context.Context, to peer.ID, r AccountBalanceRequest) ([]byte, error)
func (*FxBlockchain) AccountCreate ¶
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) BloxFreeSpace ¶
func (*FxBlockchain) ManifestAvailable ¶
func (bl *FxBlockchain) ManifestAvailable(ctx context.Context, to peer.ID, r ManifestAvailableRequest) ([]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) 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) Seeded ¶
func (bl *FxBlockchain) Seeded(ctx context.Context, to peer.ID, r SeededRequest) ([]byte, error)
func (*FxBlockchain) WifiRemoveall ¶ added in v1.0.0
type KeyStorer ¶
type KeyStorer interface { SaveKey(ctx context.Context, key []byte) error LoadKey(ctx context.Context) ([]byte, error) }
Implementations for this interface should be responsible for saving/loading a single key.
type Manifest ¶
type Manifest struct { PoolID int `json:"pool_id"` ReplicationAvailable int `json:"replication_available"` ManifestData ManifestData `json:"manifest_data"` }
type ManifestAvailableRequest ¶
type ManifestAvailableRequest struct {
PoolID int `json:"pool_id"`
}
type ManifestAvailableResponse ¶
type ManifestAvailableResponse struct {
Manifests []Manifest `json:"manifests"`
}
type ManifestData ¶
type ManifestData struct { Uploader string `json:"uploader"` ManifestMetadata ManifestMetadata `json:"manifest_metadata"` }
type ManifestJob ¶
type ManifestMetadata ¶
type ManifestMetadata struct {
Job ManifestJob `json:"job"`
}
type ManifestRemoveRequest ¶
type ManifestRemoveResponse ¶
type ManifestStoreRequest ¶
type ManifestStoreResponse ¶
type ManifestUploadRequest ¶
type ManifestUploadRequest struct { PoolID int `json:"pool_id"` ReplicationFactor int `json:"replication_factor"` ManifestMetadata ManifestMetadata `json:"manifest_metadata"` }
type ManifestUploadResponse ¶
type ManifestUploadResponse struct { Uploader string `json:"uploader"` Storage []string `json:"storage"` ManifestMetadata ManifestMetadata `json:"manifest_metadata"` PoolID int `json:"pool_id"` }
type Option ¶
type Option func(*options) error
func WithAuthorizer ¶
func WithBlockchainEndPoint ¶
func WithTimeout ¶
type PoolCancelJoinRequest ¶
type PoolCancelJoinRequest struct {
PoolID int `json:"pool_id"`
}
type PoolCancelJoinResponse ¶
type PoolCreateRequest ¶
type PoolCreateResponse ¶
type PoolJoinRequest ¶
type PoolJoinResponse ¶
type PoolLeaveRequest ¶
type PoolLeaveRequest struct {
PoolID int `json:"pool_id"`
}
type PoolLeaveResponse ¶
type PoolListRequest ¶
type PoolListRequest struct { }
type PoolListResponse ¶
type PoolListResponse struct {
Pools []Pool `json:"pools"`
}
type PoolRequest ¶
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"`
}
type PoolUserListResponse ¶
type PoolUserListResponse struct {
Users []User `json:"users"`
}
type PoolVoteRequest ¶
type PoolVoteResponse ¶
type ReqInterface ¶
type ReqInterface interface{}
type SeededRequest ¶
type SeededRequest struct {
Seed string `json:"seed"`
}
type SeededResponse ¶
type SimpleKeyStorer ¶
type SimpleKeyStorer struct {
// contains filtered or unexported fields
}
func NewSimpleKeyStorer ¶
func NewSimpleKeyStorer() *SimpleKeyStorer
Click to show internal directories.
Click to hide internal directories.