예제 #1
0
func GetBlock(apiClient pfs.APIClient, hash string, writer io.Writer) error {
	apiGetBlockClient, err := apiClient.GetBlock(
		context.Background(),
		&pfs.GetBlockRequest{
			Block: &pfs.Block{
				Hash: hash,
			},
		},
	)
	if err != nil {
		return err
	}
	if err := protostream.WriteFromStreamingBytesClient(apiGetBlockClient, writer); err != nil {
		return err
	}
	return nil
}