1
0
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:
Ahmed Ali 2020-06-26 11:31:56 +02:00
parent ae39f7df28
commit 5433d1e07f
2 changed files with 8 additions and 7 deletions

View File

@ -3,7 +3,7 @@ import { noZeroX } from '../utils'
import { Instantiable, InstantiableConfig } from '../Instantiable.abstract'
import { File } from '../ddo/interfaces/File'
const apiPath = '/api/v1/provider/services'
const apiPath = '/api/v1/services'
/**
* 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> {
const signature = this.ocean.utils.signature.signWithHash(
const signature = await this.ocean.utils.signature.signWithHash(
did,
account.getId(),
account.getPassword()
@ -52,15 +52,12 @@ export class Provider extends Instantiable {
document: JSON.stringify(document),
publisherAddress: account.getId()
}
console.log(args)
try {
const response = await this.ocean.utils.fetch.post(
this.getEncryptEndpoint(),
decodeURI(JSON.stringify(args))
)
if (!response.ok) {
throw new Error('HTTP request failed')
}
return await response.text()
} catch (e) {
this.logger.error(e)

View File

@ -7,7 +7,8 @@ const Web3 = require('web3')
const web3 = new Web3('http://127.0.0.1:8545')
export default {
metadataStoreUri: 'http://localhost:5000',
// metadataStoreUri: 'http://localhost:5000',
metadataStoreUri: 'https://aquarius.marketplace.dev-ocean.com',
providerUri: 'http://localhost:8030',
nodeUri: `http://localhost:${process.env.ETH_PORT || 8545}`,
parityUri: 'http://localhost:9545',
@ -15,3 +16,6 @@ export default {
verbose: LogLevel.Error,
web3Provider: web3
} as Config
// export PROVIDER_ADDRESS=0x94aeb88c9C7B933D131CAF4571eab7eE1Cb35e1D
// export PROVIDER_KEY=0x87e6661e4846e29dc478148f33899aea068e1da5996fe13e1dc64d675c06922f