1
0
mirror of https://github.com/oceanprotocol/ocean.js.git synced 2024-11-26 20:39:05 +01:00

allow customProvider on publish

This commit is contained in:
alexcos20 2020-09-16 06:28:08 -07:00
parent 671c170377
commit 5655909623
3 changed files with 16 additions and 1 deletions

View File

@ -393,7 +393,11 @@ export class Assets extends Instantiable {
return {
type: 'access',
index: 2,
<<<<<<< HEAD
serviceEndpoint: customProvider || this.ocean.provider.url,
=======
serviceEndpoint: customProvider || this.ocean.provider.getConsumeEndpoint(),
>>>>>>> 17e61d0... allow customProvider on publish
attributes: {
main: {
creator: creator.getId(),

View File

@ -94,7 +94,7 @@ export class Compute extends Instantiable {
if (did && txId) {
const provider = new Provider(this.instanceConfig)
provider.setBaseUrl(serviceEndpoint)
const computeJobsList = await this.ocean.provider.compute(
const computeJobsList = await provider.compute(
'post',
did,
consumerAccount,
@ -293,9 +293,13 @@ export class Compute extends Instantiable {
const service = {
type: 'compute',
index: 3,
<<<<<<< HEAD
serviceEndpoint: customProvider
? customProvider + this.ocean.provider.getComputeEndpointShort()
: this.ocean.provider.getComputeEndpoint(),
=======
serviceEndpoint: customProvider || this.ocean.provider.getComputeEndpoint(),
>>>>>>> 17e61d0... allow customProvider on publish
attributes: {
main: {
name,

View File

@ -298,17 +298,24 @@ export class Provider extends Instantiable {
return `${this.url}${apiPath}/download`
}
<<<<<<< HEAD
/** Check for a valid provider at URL
* @param {String} url
* @return {Promise<boolean>} string
*/
=======
>>>>>>> 17e61d0... allow customProvider on publish
public async isValidProvider(url: string): Promise<boolean> {
const fetch = this.ocean.utils.fetch.get(url)
await fetch
.then((response: Response) => {
if (response.ok) {
const params = response.json()
<<<<<<< HEAD
if (params['provider-address']) return true
=======
if (params) return true
>>>>>>> 17e61d0... allow customProvider on publish
}
return false
})