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:
parent
671c170377
commit
5655909623
@ -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(),
|
||||
|
@ -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,
|
||||
|
@ -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
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user