publisher

package
v0.0.0-...-135b226 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2024 License: GPL-3.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const PrivateKeySize = 256 / 8

Variables

View Source
var DefaultDeploymentPath = "~/.apocryph/deployment"
View Source
var DefaultPodFile = "manifest.yaml"

Functions

func AuthorizeAndFundApplication

func AuthorizeAndFundApplication(ctx context.Context, response *pb.ProvisionPodResponse, deployment *pb.Deployment, ethClient *ethclient.Client, publisherAuth *bind.TransactOpts, publisherKey string, amount int64) error

func FundAddress

func FundAddress(ctx context.Context, key string, from, to common.Address, ethClient *ethclient.Client, amount *big.Int) error

func FundPaymentChannel

func FundPaymentChannel(ethClient *ethclient.Client, publisherAuth *bind.TransactOpts, deployment *pb.Deployment, funds *big.Int, unlockTimeInt *big.Int, mintFunds bool) error

func GenerateDeploymentFilename

func GenerateDeploymentFilename(podFile string, deploymentFormat string) (deploymentFile string, relPodFile string, err error)

func GetPricingTableSubscribers

func GetPricingTableSubscribers(ethClient *ethclient.Client, registryContract common.Address, tableId *big.Int) ([]common.Address, error)

func GetProviderHostInfo

func GetProviderHostInfo(ipfs iface.CoreAPI, ethClient *ethclient.Client, registryContract common.Address, providerId common.Address) (*pb.HostInfo, error)

func LinkUploadsFromDeployment

func LinkUploadsFromDeployment(pod *pb.Pod, deployment *pb.Deployment) *pb.Pod

func ReadPodAndDeployment

func ReadPodAndDeployment(args []string, manifestFormat string, deploymentFormat string) (podFile string, deploymentFile string, pod *pb.Pod, deployment *pb.Deployment, err error)

func SaveDeployment

func SaveDeployment(deploymentFile string, deploymentFormat string, deployment *pb.Deployment) error

func SendToProvider

func SendToProvider(ctx context.Context, ipfsP2p *ipfs.P2pApi, pod *pb.Pod, deployment *pb.Deployment, client *P2pProvisionPodServiceClient) (interface{}, error)

func UploadImages

func UploadImages(ctx context.Context, client *containerd.Client, IPFSAddress string, pod *pb.Pod, deployment *pb.Deployment) error

func UploadSecrets

func UploadSecrets(ctx context.Context, ipfs iface.CoreAPI, basepath string, pod *pb.Pod, deployment *pb.Deployment) error

Types

type P2pProvisionPodServiceClient

type P2pProvisionPodServiceClient struct {
	*tpipfs.IpfsAddr
	pbcon.ProvisionPodServiceClient
}

func ConnectToProvider

func ConnectToProvider(ipfsP2p *ipfs.P2pApi, deployment *pb.Deployment, interceptor *pbcon.AuthInterceptorClient) (*P2pProvisionPodServiceClient, error)

func SetFirstConnectingProvider

func SetFirstConnectingProvider(ipfsp2p *tpipfs.P2pApi, availableProviders ProviderHostInfoList, deployment *pb.Deployment, interceptor *protoconnect.AuthInterceptorClient) (*P2pProvisionPodServiceClient, error)

type PricingTableList

type PricingTableList []*abi.RegistryNewPricingTable

func FilterPricingTables

func FilterPricingTables(tables PricingTableList, filter *abi.RegistryNewPricingTable) PricingTableList

func GetPricingTables

func GetPricingTables(ethClient *ethclient.Client, registryContract common.Address, tokenAddress common.Address) (PricingTableList, error)

type ProviderHostInfoList

type ProviderHostInfoList map[common.Address]*pb.HostInfo

func FilterProviderHostInfos

func FilterProviderHostInfos(region string, peerId string, providers ProviderHostInfoList) (ProviderHostInfoList, error)

func GetProviderHostInfos

func GetProviderHostInfos(ipfs iface.CoreAPI, ethClient *ethclient.Client, registryContract common.Address, tables PricingTableList) (ProviderHostInfoList, error)

Jump to

Keyboard shortcuts

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