mirror of
https://github.com/oceanprotocol/ocean.js.git
synced 2024-11-26 20:39:05 +01:00
fix singature
This commit is contained in:
parent
ae39f7df28
commit
5433d1e07f
@ -3,7 +3,7 @@ import { noZeroX } from '../utils'
|
|||||||
import { Instantiable, InstantiableConfig } from '../Instantiable.abstract'
|
import { Instantiable, InstantiableConfig } from '../Instantiable.abstract'
|
||||||
import { File } from '../ddo/interfaces/File'
|
import { File } from '../ddo/interfaces/File'
|
||||||
|
|
||||||
const apiPath = '/api/v1/provider/services'
|
const apiPath = '/api/v1/services'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides an interface for provider service.
|
* Provides an interface for provider service.
|
||||||
@ -40,7 +40,7 @@ export class Provider extends Instantiable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async encrypt(did: string, document: any, account: Account): Promise<string> {
|
public async encrypt(did: string, document: any, account: Account): Promise<string> {
|
||||||
const signature = this.ocean.utils.signature.signWithHash(
|
const signature = await this.ocean.utils.signature.signWithHash(
|
||||||
did,
|
did,
|
||||||
account.getId(),
|
account.getId(),
|
||||||
account.getPassword()
|
account.getPassword()
|
||||||
@ -52,15 +52,12 @@ export class Provider extends Instantiable {
|
|||||||
document: JSON.stringify(document),
|
document: JSON.stringify(document),
|
||||||
publisherAddress: account.getId()
|
publisherAddress: account.getId()
|
||||||
}
|
}
|
||||||
|
console.log(args)
|
||||||
try {
|
try {
|
||||||
const response = await this.ocean.utils.fetch.post(
|
const response = await this.ocean.utils.fetch.post(
|
||||||
this.getEncryptEndpoint(),
|
this.getEncryptEndpoint(),
|
||||||
decodeURI(JSON.stringify(args))
|
decodeURI(JSON.stringify(args))
|
||||||
)
|
)
|
||||||
if (!response.ok) {
|
|
||||||
throw new Error('HTTP request failed')
|
|
||||||
}
|
|
||||||
return await response.text()
|
return await response.text()
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.logger.error(e)
|
this.logger.error(e)
|
||||||
|
@ -7,7 +7,8 @@ const Web3 = require('web3')
|
|||||||
const web3 = new Web3('http://127.0.0.1:8545')
|
const web3 = new Web3('http://127.0.0.1:8545')
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
metadataStoreUri: 'http://localhost:5000',
|
// metadataStoreUri: 'http://localhost:5000',
|
||||||
|
metadataStoreUri: 'https://aquarius.marketplace.dev-ocean.com',
|
||||||
providerUri: 'http://localhost:8030',
|
providerUri: 'http://localhost:8030',
|
||||||
nodeUri: `http://localhost:${process.env.ETH_PORT || 8545}`,
|
nodeUri: `http://localhost:${process.env.ETH_PORT || 8545}`,
|
||||||
parityUri: 'http://localhost:9545',
|
parityUri: 'http://localhost:9545',
|
||||||
@ -15,3 +16,6 @@ export default {
|
|||||||
verbose: LogLevel.Error,
|
verbose: LogLevel.Error,
|
||||||
web3Provider: web3
|
web3Provider: web3
|
||||||
} as Config
|
} as Config
|
||||||
|
|
||||||
|
// export PROVIDER_ADDRESS=0x94aeb88c9C7B933D131CAF4571eab7eE1Cb35e1D
|
||||||
|
// export PROVIDER_KEY=0x87e6661e4846e29dc478148f33899aea068e1da5996fe13e1dc64d675c06922f
|
Loading…
x
Reference in New Issue
Block a user