Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contracts/IColonyNetwork.sol
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ contract IColonyNetwork is ColonyNetworkDataTypes, IRecovery {
/// Note that the token ownership (if there is one) has to be transferred to the newly created colony
/// @param _tokenAddress Address of an ERC20 token to serve as the colony token
/// Additionally token can optionally support `mint` as defined in `ERC20Extended`
/// Support for `mint` in mandatory only for the Meta Colony Token
/// Support for `mint` is mandatory only for the Meta Colony Token
/// @return colonyAddress Address of the newly created colony
function createColony(address _tokenAddress) public returns (address);

Expand Down
111 changes: 61 additions & 50 deletions docs/_Docs_GetStarted.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
---
title: Get Started
section: Docs
order: 6
order: 7
---

The [glider](https://github.com/JoinColony/colonyNetwork) release is currently live on Görli and will be deployed to mainnet soon.
There are a few ways to get started with the colonyNetwork contracts, depending on who you are and what you want to do.

This page is written for developers contributing features or direct smart contract extensions with the Colony Network.
This page details how to engage purely on the contract-level, and is intended more for developers looking to contribute new features, extensions, or contract-level integrations. See our [guidelines](https://github.com/JoinColony/colonyNetwork/blob/develop/docs/CONTRIBUTING.md) if you're interested in contributing to the colonyNetwork codebase.

See our [guidelines](https://github.com/JoinColony/colonyNetwork/blob/develop/docs/CONTRIBUTING.md) if you're interested in contributing to the colonyNetwork codebase.
If you're a dapp developer looking to integrate with colony, we recommend using [colonyJS](/colonyjs/intro-welcome/) as an entry point. There you'll find analogous instructions better suited to building applications on top of the colonyNetwork. For those without patience, we have built a [colonyStarter kit](/colonystarter/docs-overview/) which contains boilerplate examples for dapp development, including frontend frameworks like react, and is the fastest way to start building with Colony.

If you want to build a dapp or other integration that doesn't directly extend the Colony Network contracts, it's recommended that you use colonyJS. Analogous instructions for colonyJS can be found in [Local Setup](/colonyjs/intro-local-setup/) for colonyJS.
Either way, if you run into trouble or have any questions/comments, please post in our [developer forums](https://build.colony.io/).

An even more 'complete' starting point is the [colonyStarter kit](/colonystarter/docs-overview/), which contains boilerplate examples for dapp development, including frontend frameworks like react.
==TOC==

## Prerequisites

Expand All @@ -24,20 +24,25 @@ You will need to have `node` installed. We recommended using `node` version `10.

You will also need to install `yarn`. We recommended using `yarn` version `1.12.0` or higher. Check out the [Yarn Installation](https://yarnpkg.com/lang/en/docs/install/#mac-stable) documentation and then select your operating system for install instructions.

It is possible to use `npm` instead of `yarn`, but you'll need to adapt any instructions yourself ;).

### Docker

In order to compile the colonyNetwork smart contracts, you will need to have Docker installed and running. We recommend using Docker Community Version `2.0.0.0`. You can find instructions for installing Docker here: [Docker Installation](https://docs.docker.com/install/).

The colonyNetwork smart contracts require the `ethereum/solc:0.4.23` Docker image, so we will need to pull down this image before we can begin.
The colonyNetwork smart contracts require the `ethereum/solc:0.5.8` Docker image, so we will need to pull it down before we can begin.

Make sure Docker is installed and then run the following command.

```
docker pull ethereum/solc:0.4.23
docker pull ethereum/solc:0.5.8
```

## Colony Network

If you intend to work with `glider-rc.1` on the Görli testnet, proceed with installation below, skipping the "local development and testing" section.


### Installation

For testing and development, we will set up a local test network and then deploy the [colonyNetwork](https://github.com/JoinColony/colonyNetwork) smart contracts to that local test network.
Expand Down Expand Up @@ -68,78 +73,84 @@ The final step for installation is copying over some of the files from our submo
yarn run provision:token:contracts
```

### Testing

To deploy all contracts and run all tests, run the following command.

```
yarn run test:contracts
```

### Development
## `glider-rc.1` on the Görli testnet

Alternatively, you can start a local test node and deploy the contracts yourself using the locally installed `truffle` package.
The [Glider release candidate](/colonynetwork/docs-releases/) is in many ways a simpler and easier way to experiment than setting up a local development environment, and can be very useful if you're looking to just get a sense of how the colonyNetwork contracts work, or want to build extensions/integrations that remain inside the EVM.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the link supposed to be to the actual release details?


```
yarn run start:blockchain:client
To connect, you'll need to know the address of the colonyNetwork (which is, in reality, the address of the `etherRouter` contract; see [The Delegate Proxy Pattern](/colonynetwork/docs-the-delegate-proxy-pattern/) for more info).

./node_modules/.bin/truffle migrate --reset --compile-all
```
`ColonyNetwork`: `0x79073fc2117dD054FCEdaCad1E7018C9CbE3ec0B`

For more detailed instructions, and additional steps required to set up an environment for use with [colonyJS](https://github.com/JoinColony/colonyJS), check out the colonyJS [Local Setup](/colonyjs/intro-local-setup/) documentation.
You will also require Görli test ETH, and a deployed ERC20 token to import.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If they plan on creating a Colony and interacting with it they will need a lot more than that 👆 . The following set of transactions are a useful reference as to how to setup and wire a new Colony.
#607

The ENS registration steps are optional (as they are a user friendly UI used by the dApp) and the Extension Contracts steps might also be skipped if Payments aren't a required functionality or Old style permissions aren't needed.


## Reputation Miner

The reputation mining client is usable for testing but it has limited functionality. It currently has no support for the challenge-response process to accommodate multiple submitted reputation root hashes. Still, it is possible to run a single miner instance for usable reputation scores on a local test network.
### Access with Remix (good for experimenting)

### Start Mining Client
For simple interactions, [Remix](http://remix-alpha.ethereum.org/) is a good lightweight way to call specific functions and get network information from the contracts.

You can start the reputation mining client using the following command.
Rather than import the entire set of contracts into remix, use the included `solidity-steamroller` to flatten the needed interface contracts to the `build/flattened/` directory:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should build all interface contracts. Can solidity-steamroller accept wildcards for flattening, e.g. I*.sol 🤔


```
node packages/reputation-miner/bin/index.js --colonyNetworkAddress { COLONYNETWORK_ADDRESS } --minerAddress { MINER_ADDRESS }
$ yarn flatten:contracts
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are missing run from this command

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As @area rightly pointed out to me earlier, this will work even without run. I didn't know that was the case but still I would probably want to be consistent and reference it still.

```

The `minerAddress` in the execution above is the sixth account in `ganache-accounts.json` if running locally.
Navigate to `colonyNetwork/build/flattened/` to find the contracts you need to import to Remix.

In Remix, you'll need to instantiate `flatIColonyNetwork.sol` to the `ColonyNetwork` address `0x79073fc2117dD054FCEdaCad1E7018C9CbE3ec0B` in order to create a new colony.

The `colonyNetwork` address in the execution above is not the address outputted at contract deployment, but is the address of the Colony Network `EtherRouter`. See [Upgrades to the Colony Network](/colonynetwork/docs-the-delegate-proxy-pattern/) for more information about the EtherRouter design pattern.
Use the address of your existing ERC20 token contract to `createColony()`, then immidiately use `getColonyCount()` to get your colony's ID.

### Force Reputation Updates
Call `getColony()` to get your colony's address from the ID, then instantiate `flatIColony.sol` to your colony's address in Remix.

The client is set to provide a reputation update once per hour. For testing, you'll likely want to "fast-forward" your network through a few submissions to see usable reputation.

You can move the network forward by an hour with the following command.
### Access with the Truffle console

First, add a private key of your choice to the `truffle.js` configuration file:
```
curl -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"evm_increaseTime","params":[86400],"id": 1}' localhost:8545
goerli: {
provider: () => {
return new HDWalletProvider("replace-with-private-key-when-using", "https://goerli.infura.io/v3/e21146aa267845a2b7b4da025178196d");
},
network_id: "5"
}
},
```

Once you have moved the network forward by an hour, you can then mine a new block with the following command.

Then, start up the truffle console and connect to testnet:
```
curl -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"evm_mine","params":[]}' localhost:8545
$ yarn truffle console --network goerli
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing run

```

Note that because reputation is awarded for the *previous* submission window, you will need to use the "fast-forward" command above to speed through at least 3 reputation updates before noticing a change in the miner's reputation.

### Get Reputation from the Reputation Oracle

The reputation mining client will answer queries for reputation scores locally over HTTP.
In the truffle console, instantiate the IColonyNetwork interface for `glider-rc.1`:
```
truffle(goerli)> let colonyNetwork = await IColonyNetwork.at("0x79073fc2117dD054FCEdaCad1E7018C9CbE3ec0B")

```
http://127.0.0.1:3000/{reputationState}/{colonyAddress}/{skillId}/{userAddress}
From here, you can create a new colony (with an ERC20 token already deployed):
```
truffle(goerli)> await colonyNetwork.createColony("your-erc20-token-address")
```
And find your colony's id (the newest created colony) after the transaction is mined:
```

The oracle should be able to provide responses to any valid reputation score in all historical states, as well as the current state.
truffle(goerli)> await colonyNetwork.getColonyCount()
```
### Local Development and Testing

For example, you can get the reputation score of the miner in the current reputation state (which after three updates, will be `0x7ad8c25e960b823336fea83f761f5199d690c7b230e846eb29a359187943eb33`) using the address of the Meta Colony (`0x1133560dB4AebBebC712d4273C8e3137f58c3A65`), the skill tag of `2`, and the address of the miner (`0x3a965407ced5e62c5ad71de491ce7b23da5331a4`).
You can start a local test node and deploy the contracts yourself using the locally installed `truffle` package.

```
http://127.0.0.1:3000/0x7ad8c25e960b823336fea83f761f5199d690c7b230e846eb29a359187943eb33/0x1133560dB4AebBebC712d4273C8e3137f58c3A65/2/0x3a965407ced5e62c5ad71de491ce7b23da5331a4
```
yarn run start:blockchain:client

The oracle should return something similar to the following.
yarn truffle migrate --reset --compile-all
```

To deploy all contracts and run all contract tests:
```
yarn test:contracts
```
{"branchMask":"0x8000000000000000000000000000000000000000000000000000000000000000","siblings":["0x32c047a86aec6bbbfc1510bb2dd3a9086ec70b7524bd6f92ce1a12dfc7be32ca"],"key":"0x1133560db4aebbebc712d4273c8e3137f58c3a6500000000000000000000000000000000000000000000000000000000000000023a965407ced5e62c5ad71de491ce7b23da5331a4","value":"0x0000000000000000000000000000000000000000000000410d586a20a4c000000000000000000000000000000000000000000000000000000000000000000003","reputationAmount":"0"}
To deploy all contracts and run all reputation mining tests:
```
yarn test:reputation
```

For more detailed instructions, and additional steps required to set up an environment for use with [colonyJS](https://github.com/JoinColony/colonyJS), check out the colonyJS [Local Setup](/colonyjs/intro-local-setup/) documentation.
30 changes: 15 additions & 15 deletions docs/_Docs_Releases.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,29 @@ section: Docs
order: 3
---

![glider](/docs/img/glider_fullColor.svg)
![glider](img/glider_fullColor.svg)

The current colonyNetwork release is `glider`, which implements some, but not all, of the Colony Protocol:
The [current colonyNetwork release](https://github.com/JoinColony/colonyNetwork/releases/tag/glider-rc.1), `glider`, implements some but not all of the Colony Protocol:

* Tokens and Funding pots
* Reputation
* Funding Pots and payments
* The Reputation system
* Meta Colony and the CLNY Token
* Colony funding and rewards
* Single-level domains
* Skill tags
* Tasks and work ratings
* Payments
* Payments and Tasks
* Work ratings
* Roles and domain-level permissions
* ENS
* Contract upgradability and recovery
* ENS integration
* Extensions

`glider` is deployed to the Görli testnet, and can be accessed with the following information:
`glider-rc.1` is deployed to the Görli testnet, and can be accessed at:

```
ColonyNetwork address: 0x79073fc2117dD054FCEdaCad1E7018C9CbE3ec0B
ColonyNetwork: 0x79073fc2117dD054FCEdaCad1E7018C9CbE3ec0B
```

The extension factories are at:
```
OneTxPaymentFactory: 0x3e03f868450ffD588E2cB2034fA2e0F74F9FFbe3
OldRolesFactory: 0xbe86Bef84fFD76E906e1ffa368a42B538e7aEf75


ColonyNetwork commit: 41b2e0b429c03d1011e1a96506dcbfe504391f2d
ColonyToken commit: 59cf56f18c54c0bc749ddaa8b6d77ebfd0d0aaf4
```
63 changes: 63 additions & 0 deletions docs/_Docs_ReputationMining.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
title: Reputation Mining Client
section: Docs
order: 6
---

## Local Network

### Start Mining Client

You can start the reputation mining client using the following command.

```
node packages/reputation-miner/bin/index.js --colonyNetworkAddress { COLONYNETWORK_ADDRESS } --minerAddress { MINER_ADDRESS }
```

The `minerAddress` in the execution above is the sixth account in `ganache-accounts.json` if running locally.

The `colonyNetwork` address in the execution above is not the address outputted at contract deployment, but is the address of the Colony Network `EtherRouter`. See [Upgrades to the Colony Network](/colonynetwork/docs-the-delegate-proxy-pattern/) for more information about the EtherRouter design pattern.

### Force Reputation Updates

The client is set to provide a reputation update once every 24 hours. For testing, you'll likely want to "fast-forward" your network through a few submissions to see usable reputation.

You can move the network forward by an hour with the following command.

```
curl -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"evm_increaseTime","params":[86400],"id": 1}' localhost:8545
```

Once you have moved the network forward by an hour, you can then mine a new block with the following command.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need 24 hours to mine a reputation cycle


```
curl -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"evm_mine","params":[]}' localhost:8545
```

Note that because reputation is awarded for the *previous* submission window, you will need to use the "fast-forward" command above to speed through at least 3 reputation updates before noticing a change in the miner's reputation.

### Get Reputation from the Reputation Oracle
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'll be useful to add another section on the Visualiser which can be very useful to understand the current reputation mining state. This work will be merged in #582


The reputation mining client will answer queries for reputation scores locally over HTTP.

```
http://127.0.0.1:3000/{reputationState}/{colonyAddress}/{skillId}/{userAddress}
```

The oracle should be able to provide responses to any valid reputation score in all historical states, as well as the current state.

For example, you can get the reputation score of the miner in the current reputation state (which after three updates, will be `0x7ad8c25e960b823336fea83f761f5199d690c7b230e846eb29a359187943eb33`) using the address of the Meta Colony (`0x1133560dB4AebBebC712d4273C8e3137f58c3A65`), the skill tag of `2`, and the address of the miner (`0x3a965407ced5e62c5ad71de491ce7b23da5331a4`).

```
http://127.0.0.1:3000/0x7ad8c25e960b823336fea83f761f5199d690c7b230e846eb29a359187943eb33/0x1133560dB4AebBebC712d4273C8e3137f58c3A65/2/0x3a965407ced5e62c5ad71de491ce7b23da5331a4
```

The oracle should return something similar to the following.

```
{"branchMask":"0x8000000000000000000000000000000000000000000000000000000000000000","siblings":["0x32c047a86aec6bbbfc1510bb2dd3a9086ec70b7524bd6f92ce1a12dfc7be32ca"],"key":"0x1133560db4aebbebc712d4273c8e3137f58c3a6500000000000000000000000000000000000000000000000000000000000000023a965407ced5e62c5ad71de491ce7b23da5331a4","value":"0x0000000000000000000000000000000000000000000000410d586a20a4c000000000000000000000000000000000000000000000000000000000000000000003","reputationAmount":"0"}
```

## Visualizations

The reputation mining client comes with a set of built-in visualizers to make it easier to view reputation states and to see the current state of the mining process. Once a mining client is running and connected to a network, navigate to the client's address in a browser (i.e. `http://localhost:3000/`) to access the available visualization tools.
6 changes: 0 additions & 6 deletions docs/_TLDR_ReputationMining.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,3 @@ Whichever miner is found to have performed the calculation incorrectly is punish
When a new Root Hash is accepted by the network, its corresponding Reputation Update Log is deleted from on-chain memory.

All reputation events that occurred during the current cycle are 'frozen' as the new Reputation Update Log to be used by miners in the next cycle.

## The Reputation Mining Client

### Visualizations

The reputation mining client comes with a set of built-in visualizers to make it easier to view reputation states and to see the current state of the mining process. Once a mining client is running and connected to a network, navigate to the client's address in a browser (i.e. `http://localhost:3000/`) to access the available visualization tools.
4 changes: 2 additions & 2 deletions docs/_bug_rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ Once submitted, the issue will be responded to, verified, accepted, and rewarded

### Submission Branches
Participants in the program are free to submit bugs on two different branches in the colonyNetwork codebase:
* the current testnet release (tagged on the `master` branch) and deployed to Görli
* against the `develop` branch where we merge ongoing work
* the current testnet release (tagged on the `develop` branch) and deployed to Görli
* against the `master` branch which will be tagged as the mainnet release for deployment

### Bug Severity and Bounties
In the same manner as the [Ethereum Bug Bounty Program](https://bounty.ethereum.org/), submissions will be evaluated by the Colony team according to the [OWASP risk rating methodology](https://www.owasp.org/index.php/OWASP_Risk_Rating_Methodology), which grades based on both _Impact_ and _Likelihood_.
Expand Down
Loading