https://trofi.one is the production server. This serves the frontend. There are no backend operations as these are all handled using IPFS, web3 integration, and thegraph.com for query caching and indexing. The production server pulls and rebuilds the frontend client repo whenever a pull request is merged.
All problems added to the issue tracker SHOULD follow the C4 Protocol.
The contribution policy we follow is the Collective Code Construction Contract (C4)
If you're wondering why any of the rules in the C4 are there, take a look at the line by line explanation of everything in the C4, this explains the rationale and history behind everything in the protocol and makes it easier to understand.
If your pull request does not comply with the protocol, it probably won't be merged.
What follows here is a quickstart guide only, if carefully followed carefully and accurately, it will guide you to producing a valid patch as defined by the C4 protocol. However to understand why each step is required, read the full protocol.
Make a comment in the issue: I'm claiming this issue to work on it
before you start working on the issue. Or if you're an existing Contributor and can assign yourself to the issue, do that instead.
If at some point you want to abandon the issue and let someone else have a go, let everyone know by unassigning yourself and/or commenting appropriately. If you claim an issue and do not send a pull request within 24 hours a Maintainer MAY remove you from the issue and let someone else claim it.
@: git remote add upstream git://github.com/trofimarket/contracts //apply to whatever repo you are working on, only needs to be done once
@: git checkout master //just to make sure you're on the correct branch
@: git pull upstream master //this grabs any code that has changed, you want to be working on the latest HEAD
@: git push //update your remote fork with the changes you just pulled from upstream master
git checkout -b branch_name
(it's usually a good idea to call the branch something that describes the problem you are solving). Never develop on the master
branch, as the master
branch is exclusively used to accept incoming changes from upstream:master
and you'll run into problems if you try to use it for anything else.@: git stash //save your work locally
@: git checkout master
@: git pull upstream master
@: git push
@: git checkout -b branch_name //from step 5
@: git stash pop //_replay_ your work on the new branch which is now fully up to date with the upstream repository
Note: after running git stash pop
you should run any tests, check that everything compiles properly, etc, and look over your code again and check that everything still works as sometimes a file you worked on was changed in the meantime, breaking one of your changes.
Now you can add your changes:
@: git add changed_file.sol //repeat for each file you changed
And then commit your changes:
@: git commit -m 'problem: <50 characters describing the problem //do _not_ close the '', press ENTER two (2) times
>
>solution: short description of how you solved the problem.' //Now you can close the ''. Be sure to mention the issue number if there is one (e.g. #6)
@: git push //this will send your changes to _your_ fork on Github
Go back to the issue, and make a comment:
Fixed in #(PR_NUMBER)
This will label this issue as complete, and everyone can test your solution and close the issue if it solves the problem.
If your pull request contains a correct patch (read the C4) a maintainer will merge it. If you want to work on another problem while you are waiting for it to merge simply repeat the above steps starting at:
@: git checkout master
Yes, this is sometimes possible.
Your first step is to very carefully read and understand everything above, then start fixing problems and sending pull requests!
If your code is amazing and brilliant and you're some kind of rockstar but you fail to follow the contribution protocol, your pull requests will not be merged and you will not be paid.
It's usually worth following any repositories you are working on to get notified of pull requests and new issues.
Contact TroFi's BDFL (Benevolent Dictator For Life): excessionatesperi@protonmail.com if you've been contributing code to TroFi and want to keep doing it but you need money.
Write tests for your code so that people don't break it later.
Engage in discussion about problems even if you aren't working on them yourself. Be helpful to other contributors, some may be volunteers who just want to be part of the project. You (should) have a pretty good understanding of the codebase and can probably save others a lot of time.
Your code should be very well commented and easy to read. It should be immediately clear what your code is doing. You should be able to look at your code a year later, in the morning before coffee, and immediately know what it's doing. A good mindset to adopt is to write code and comments like you're teaching someone how to code.
Your pull requests should be a glowing example to others of how to work with the C4. Each one should be a model that others can refer to. If they aren't you probably won't be getting paid for it.