oceanprotocol-archive / bounties

🎣 Bounties for Ocean Protocol
Apache License 2.0
11 stars 0 forks source link

Ocean bounty : Ocean Faucet Server for Trilobite Testnet #8

Closed Anirudh2490 closed 5 years ago

Anirudh2490 commented 5 years ago

Server-side Implementation of Ocean Faucet for Trilobite Testnet

How can you help?

We want to create a server side implementation that allows us to distribute Ocean tokens to be used in testnet to user accounts. The final solution should distribute a given number of testnet tokens to the user's account address after the user places a request for tokens.

What needs to be done?

Functionality

  1. User sends HTTP GET request to server with Account Address in the request query .
  2. The timestamp of last deposit of testnet tokens to address is checked. If tokens have been requested and deposited to the account in the last 24 hours, then message is returned stating ‘Sorry, we cannot deposit more tokens in your account for the next hh:mm (hours & minutes, the difference between current time of request and last deposited timestamp) since it has been done’.
  3. If the timestamp of last deposit is greater than 24 hours, then this server transfers 10 Ocean Tokens to the given account. Timestamp of the deposit is also recorded (which is later used to check spamming token requests).

Technical stack

Request/Response Schema

The JSON endpoints from the server may include (but not limited to) a) Account address b) Request Agent c) Transfer is a success or failure.

Sample Request Body

{
    "address": <string>,  //required
    "agent": <string>, //optional, Possible values - twitter, telegram, gitter  
}

Sample Response Body

200
{
    "success": true, // whether the tokens have been transferred successfully or not.
    "message": <string> (X tokens have been transferred to your account xxxxxxx.  
}

Another example of a response body with outcome:false

not 500 (Expected Errors or non-positive flows)
{
    "success": false,
    "message": <string> (Tokens were last transferred to this account 2hrs:26mins ago. The next transfer can be done in 21hrs:34mins.)
}

500 (Internal Server Error)
{
        "success": false,
    "message": <string> (Oops! Something went wrong on our end. We will fix it asap.)
}

You will need

We are very happy when

[ ] Server is written using Express.js (v4.x.x) [ ] All dependencies like testnet etc are up and running using npm command or docker compose. You can use our docker-images for each dependent component like keeper-contracts etc and use it here. [ ] Proper validation for schemas are done for incoming requests. [ ] Code is written in ES6. [ ] Unit tests are written with Mocha with coverage > 80%.

Note- The PR for this bounty submission should go in ocean faucet repo

Seen this problem before?

Any help solving this is welcome. Feel free to leave any comments and help someone else to solve it. We might airdrop tokens to someone even if not directly completing bounty.

Questions & Reviews

Pull requests will be reviewed by one of the maintainers or long-term contributors. In case of any additional questions feel free to ask in this thread and we will do our best to add the missing info :)

Things to know

The bounty lifecycle process including payout will be managed using Gitcoin. We'll be responding to your questions here, but for discussion and clarification we recommend to join also our Gitter channel where our tech community is accessible. In order to see the PROCN balance in your wallet you'll need to reference the related token contract with address 0xf2aabdd898a0139195b2b5da7387d43a45ded254. If you use a Metamask plugin you'll find the the exact steps here. Lastly, even if it is a contest bounty, we will reward all valuable contributions and efforts. We greatly appreciate the value our open source community brings to Ocean and will always award some tokens to all great contributions! :smiley:

Reward

Once the project was reviewed and merged in the master branch, you will receive the reward. PROCN is a proto-Ocean token. Bounty hunters that earn PROCN will be able to convert them 1:1 to Ocean tokens on network launch (currently Ocean Token is valued at 0.20 EUR). Network launch is expected to happen by Mar 31, 2019. Until then PROCN will be locked and non-transferrable in the ETH wallet to which it is delivered to.

gitcoinbot commented 5 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 2500.0 PROCN attached to it as part of the Ocean Protocol Foundation fund.

gitcoinbot commented 5 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work has been started.

These users each claimed they can complete the work by 3 years, 2 months ago. Please review their action plans below:

1) santteegt has been approved to start work.

I have applied to your Ambassador program, so I'll happy to work on this bounty in order to complete the challenges. Steps to fulfil the requirements are clear. 2) nosregor has been approved to start work.

I will create a rest api in node.js, mongodb and use docker.

Learn more on the Gitcoin Issue Details page.

Anirudh2490 commented 5 years ago

Welcome @santteegt! I work at Ocean Protocol and will be your contact point for this bounty project. Good to have you on board! If you have any question or get stuck please post to our gitter channel: https://gitter.im/oceanprotocol/Lobby.

It would be great if you can share here how you are going to approach the work, what will be your steps and when you are planning to complete. Don't hesitate to ping me incase of any issues!

santteegt commented 5 years ago

Hi @Anirudh2490,

Cool!. I'm currently playing with a local testnet and all resources provided in the bounty description. I'll be posting my implementation approach in the following days

Anirudh2490 commented 5 years ago

@santteegt that sounds great! If you have any doubts, feel free to reach out to us on Gitter - https://gitter.im/oceanprotocol/Lobby

Anirudh2490 commented 5 years ago

@nosregor welcome! Thanks for applying for this bounty, it's great to have you on board. If you've got any doubts on how to proceed, we're available on chat - https://gitter.im/oceanprotocol/Lobby. You can also tell us more approach the work, what will be your steps and when you are planning to complete. Cheers!

Anirudh2490 commented 5 years ago

@santteegt have you been able to make any progress on this task?

santteegt commented 5 years ago

Hi @Anirudh2490,

Yes, but I'm having a couple of issues running the testnet, and I couldn't find some answers in the Gitter chat. It is possible to reach someone through DM?

Anirudh2490 commented 5 years ago

@santteegt come on over to gitter! https://gitter.im/oceanprotocol/Lobby Just post your issues on the lobby and our developers will help you out. =)

Anirudh2490 commented 5 years ago

@santteegt someone will respond to you on gitter soon. I see you are interacting with us.

gitcoinbot commented 5 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work for 2500.0 PROCN has been submitted by:

  1. @santteegt

@chalidbdb please take a look at the submitted work:


gitcoinbot commented 5 years ago

⚡️ A tip worth 1250.00000 PROCN has been granted to @santteegt for this issue from @chalidbdb. ⚡️

Nice work @santteegt! Your tip has automatically been deposited in the ETH address we have on file.

gitcoinbot commented 5 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


The funding of 2500.0 PROCN attached to this issue has been approved & issued to @santteegt.

Additional Tips for this Bounty:


Anirudh2490 commented 5 years ago

@santteegt closing issue as we have successfully merged.