-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add marketplace service #810
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I run some manual tests and seems ok, let's merge 👍
description: "" | ||
inputs: | ||
sid: *sid | ||
price: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any reason why price is in string ? what's the format ? why not number ?
Same for duration
It makes more sense to have number here, the contract definition accepts number and string and I think we will not use bignumber for duration or price.
Also could be good to add some details on the duration is it seconds / hours / months... maybe having duration
+ unit
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Every number that can be big or too many decimal are as String in the JSON and as BigNumber in the service.
I can add more comment and description for sure ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work everything is working great.
Some stuff that could be improved:
- Documentation
- Error handling on the transactions for now it's a bit ugly
› Error: Error: Transaction has been reverted by the EVM:
› {
› "blockHash": "0xdf6eee18dc677118d4923101c008b39c9430da5345fc268cb904c18732e11498",
› "blockNumber": 5232953,
› "contractAddress": null,
› "cumulativeGasUsed": 1105990,
› "from": "0xf46109df80c953dc747c44b0c18482e252ee59c9",
› "gasUsed": 25806,
› "logs": [],
› "logsBloom":
› "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
› 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
› 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
› 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
› 0000000000000000000000000000000000000000000000000000000000000000000000000000000",
› "status": false,
› "to": "0x94f4cb92fe9f547574aec617b1594b13abd47ad3",
› "transactionHash": "0xd841b618d4140cc5ab4aec1259d933e484f8b70dc87601a75c7b4ce1535db710",
› "transactionIndex": 16
› }
If you get error like
error while downloading manifest ipfs :: QmUoE4fsthoirJRWtqosNMQF79DYBWbgtGw37Sgg2eMdre RequestError: Error: ESOCKETTIMEDOUT
it's because ipfs gateway remove the file from its cache. We need to host an IPFS node to guarantee availability. The first version's manifest file is not on ipfs anymore, but I upload the second recently, so it should work.Start service
List service
Get service
Publish service version
Send sign transaction
Create service offer
Purchase
Is Authorized
with hash
with sid
Note:
To send the transaction returned by some commands, execute:
With
sign.json
file like (you need to replace the data):Then, publish transaction, copy past after
signedTransaction=
the tx outputted: