humanprotocol / fortune Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
I'm trying to make the fortune app work on a network other than the one deployed on AWS or locally.
I've deployed the Escrow Factory here on polygon Mumbai : https://mumbai.polygonscan.com/address/0x5D65C42cF4a140863744889BAd07f246C0211754
It's currently setup to work with the USDC contract (easier to get for testing with faucet already in place): https://mumbai.polygonscan.com/address/0xe11a86849d99f524cac3e7a0ec1241828e332c62
I've changed constants.js
to work with those contracts :
export const HMT_ADDRESS = "0xe11A86849d99F524cAC3E7A0Ec1241828e332C62";
export const ESCROW_FACTORY_ADDRESS = "0x5D65C42cF4a140863744889BAd07f246C0211754";
export const REC_ORACLE_ADDRESS = "0x61F9F0B31eacB420553da8BCC59DC617279731Ac";
export const REP_ORACLE_ADDRESS = "0xD979105297fB0eee83F7433fC09279cb5B94fFC6";
export const EXCHANGE_ORACLE_ADDRESS = "0x6b7E3C31F34cF38d1DFC1D9A8A59482028395809";
Those steps works ok :
{
"job_title": "Requesting fortunes from the fortunes teller",
"job_type": "fortune",
"fortunes_requested": 2,
"recording_oracle_address": "0x61F9F0B31eacB420553da8BCC59DC617279731Ac",
"reputation_oracle_address": "0xD979105297fB0eee83F7433fC09279cb5B94fFC6",
"echange_oracle_address": "0x6b7E3C31F34cF38d1DFC1D9A8A59482028395809",
"recording_oracle_url": "http://localhost:3005/job/results",
"reputation_oracle_url": "http://reputation-oracle:3006/job/results",
"exchange_oracle_url": "http://localhost:3001"
}
3.Sending message with the exchange app => Not working
Front :
Back :
I have an ABI error. Is this possible because ABI provided is for HMT and not USDC? Or am I missing something else?
Step :
{
"job_title": "Requesting fortunes from the fortunes teller",
"job_type": "fortune",
"fortunes_requested": 2,
"recording_oracle_address": "0x61F9F0B31eacB420553da8BCC59DC617279731Ac",
"reputation_oracle_address": "0xD979105297fB0eee83F7433fC09279cb5B94fFC6",
"echange_oracle_address": "0x6b7E3C31F34cF38d1DFC1D9A8A59482028395809",
"recording_oracle_url": "http://localhost:3005/job/results",
"reputation_oracle_url": "http://localhost:3006/job/results",
"exchange_oracle_url": "http://localhost:3001/"
}
Right now everyone is able to see the manifest and the output results. Ideally, the data should be encrypted and only recording oracle and reputation oracle can see it. To learn more about the oracles, checkout https://github.com/humanprotocol/.github/wiki
Find a way, how to safely store manifest and job output on-chain and implement it.
You would store a PGP public key associated with the address with https://github.com/humanprotocol/eth-kvstore
The simplest solution is to merge it into hmt-escrow and archive this repo.
Fortune recording oracle should actually do it's job on smart contract and with steady storage
Currently https://github.com/humanprotocol/fortune/blob/master/examples/recording-oracle/index.js doesn't actually write to the smart contract or store temporary results. This should do both
When running the app using the Local Testnet (https://github.com/humanprotocol/fortune#creating-a-job-local-testnet), the manifest file is not generated in minio. This prevents me from being able to complete the job creation process, the manifest url is required to create the job.
1.Ensure that you are connected to Fortune Ganache (or whatever you named it above) under Networks in Metamask.
2. Navigate to http://localhost:3000/ to access the Job Launcher
3. Click on connect to connect your metamask wallet
4. To begin deploying a new job click on 'Create Escrow', Metamask will ask you to sign this transaction
5. Assuming the above transaction was successful you will now have a new Escrow address under the "Escrow created" field, this address represents the job, copy it down. Next we must fund the escrow.
6. Enter the Escrow address in to the search box and click the 'Search Escrow' button. You should now be presented with information about the Escrow, such as the status etc. Enter any amount into the box titled 'Fund the escrow' and click the 'Fund' button.
7. To complete the job creation process we must add the manifest URL. This URL points to the manifest.json file, which contains job specific data. For this example the data has already been created for you and stored in a local datastore (minio) which can be accessed at http://localhost:9001/ (To login you must use the default username: 'dev' and password 'devdevdev')
8. Once you are logged into the minio dashboard, click on the 'Manage' button, you will be taken to a Summary page for the manifest bucket. From this screen change the 'Access Policy' to 'public' and click 'Set' to confirm changes. We can now exit the minio dashboard and return to the Job creation process.
9. Navigate back to the job launcher (http://localhost:3000/), enter the manifest URL (http://localhost:9000/manifests/manifest.json) into the form and hit 'Setup Escrow'.
The manifest.json file is missing see below:
When navigating to the manifest url (http://localhost:9000/manifests/manifest.json):
<Error>
<script/>
<Code>NoSuchKey</Code>
<Message>The specified key does not exist.</Message>
<Key>manifest.json</Key>
<BucketName>manifests</BucketName>
<Resource>/manifests/manifest.json</Resource>
<RequestId>170897B736E0A39D</RequestId>
<HostId>125690c9-785f-42cd-aba5-9a71d1e46496</HostId>
</Error>
Chrome
This example was working previously, I think this could be related to recent changes in the deployment (CI/CD)
Need to add a docker-compose test setup which should include all services that are currently represented in the docker-compose.yml
Add test run for every pull request using the GA
Test cases:
TC 1.
Positive flow
TC 2.
Positive flow + adding the same fortunes. Make sure that only one unique fortune teller got paid
TC 3.
Test the cancel Escrow flow. Check balances of the Escrow and canceler accounts
TC 4.
Check that oracles don't work with invalid Escrows or with Escrows in an invalid state
Add a new oracle for validation purposes. Validator is responsible for initial data validation
In the case of the Fortune App - it may be a simple manifest JSON validation
In case the input data(manifest) is not valid, the validator should initiate the cancel logic for the job, which will lead to transferring all funds back to the job requester
For this purpose, the initial Escrow.sol contract should be changed and include new statuses and logic for supporting the validators work
To fix #29 (comment)
Currently, oracles are supposed to shift the job status only when all work is done. This might not be a good case when the job is massive. Oracles should send batches instead of all required fortunes
This will improve the overall experience of the protocol usage from everyone perspective
When trying to use the deployed playground version of the application, I cannot create an Escrow contract as there is no test ETH in the pre-configured Ganache wallets.
At this stage we require a very small amount of ETH for gas fee's. The pre-configured wallets have 0 ETH and hence we receive the error above. I would suggest funding the wallets with some test ETH.
No response
Chrome
No response
I deployed the Factory Escrow contract here: https://mumbai.polygonscan.com/address/0x2dd72db2bBA65cE663e476bA8b84A1aAF802A8e3
And I deployed it to work with USDC (for easy testing): https://mumbai.polygonscan.com/address/0xe11a86849d99f524cac3e7a0ec1241828e332c62
In constants.js
I changed the value to make it work :
export const HMT_ADDRESS = "0xe11A86849d99F524cAC3E7A0Ec1241828e332C62";
export const ESCROW_FACTORY_ADDRESS = "0x2dd72db2bBA65cE663e476bA8b84A1aAF802A8e3";
I started the fortune exchange and launcher docker image locally. Creation of Escrow worked ok. Funding the Escrow (with USDC) and providing manifest.json worked ok.
Here is the manifest I provide :
{
"job_title": "Requesting fortunes from the fortunes teller",
"job_type": "fortune",
"fortunes_requested": 2,
"recording_oracle_address": "0x61F9F0B31eacB420553da8BCC59DC617279731Ac",
"reputation_oracle_address": "0xD979105297fB0eee83F7433fC09279cb5B94fFC6",
"echange_oracle_address": "0x6b7E3C31F34cF38d1DFC1D9A8A59482028395809",
"recording_oracle_url": "http://ec2-3-15-230-238.us-east-2.compute.amazonaws.com:3005/job/results",
"reputation_oracle_url": "http://ec2-3-15-230-238.us-east-2.compute.amazonaws.com:3006/job/results",
"exchange_oracle_url": "http://ec2-3-15-230-238.us-east-2.compute.amazonaws.com:3001/"
}
I get the exchange URL, I can go to it, but when I want to send the fortune message from Agent 2 and 3 accounts, I get this error :
From my understanding, the oracles are running on this RPC http://ec2-3-15-230-238.us-east-2.compute.amazonaws.com:8545/ hosted on Amazon AWS.
Can the polygon Escrow contract created on Polygon Mumbai interact with the oracles hosted on AWS? If yes, what do I need to change?
Because on the AWS chain, the fortune app works ok.
Automatically set Minio bucket access policy as public when running docker-compose up
It is already done in docker-compose test file
Followed all the steps in the readme , everything was working perfectly but, still Metamask is not allowing the transaction and doesn't make the confirmations. keeps showing transaction failed.
Failed to comfirm the transaction (Metamask)
Chrome, Firefox, Microsoft Edge
No response
The current version is not stable and some situations are not handled properly:
This project has a variety of different components and a complex interaction with the blockchain. Document it out and create a drawing in the repo. Consider a c4 or equivalent model to capture the blockchain interactions. Please use this as a reference for the dapp architecture doc, and feel free to enhance and add wherever needed.
We can then link to webpage
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.