Commit 529bb37a authored by Jared Pereira's avatar Jared Pereira

Merge branch 'deployToRinkeby' into 'master'

add deploy to rinkeby functionality

See merge request fathom/assess!93
parents 404f2b93 c246b23c
Pipeline #14918542 passed with stage
in 1 minute and 50 seconds
......@@ -5,21 +5,40 @@ An Ethereum based solution for peer assessment based on a participatory token ec
Concept Structure
============
To define an assessment we use a hierarchical structure from most general to most specific. For example, if you wanted to be assessed in creating a Hello World program in Python you would create that assessment on the Hello World concept, which would be a child of the Python concept, which would be a child of the Programming concept, etcetera. This allows us to pull assessors accurately, and group similar tasks together.
To define an assessment we use a hierarchical structure from most general to most specific. For example, if you wanted to be assessed in creating a Hello World program in Python you would create that assessment on the Hello World concept, which would be a child of the Python concept, which would be a child of the Programming concept, etcetera. This allows us to pull assessors accurately, and group similar tasks together.
Deployment
========
These are all the contracts required for the network to run. The only ones that must be deployed are `userRegistry` and `conceptRegistry` while the others are managed and created by those two.
The steps for deployment are a bit tricky. First `conceptRegistry` must be deployed, followed by `userRegistry`, which takes the `conceptRegistry` address as a parameter. Next, `setUserRegistryAddress` must be called from `conceptRegistry` with the `userRegistry` address.
To your private testnet just run
>'truffle migrate'
To deploy to the rinkeby-testnet:
Next, the initial concept and user must be created. First one must create the "mew" concept in `conceptRegistry`. This is the base that all other concepts will be a child of, and every user must earn. It essentially acts as a spam preventer, and as a token faucet for users. Once this is done the first User must be created from `userRegistry`.
Create a file secrets.json in where you save a seed-phrase that will be used
to pay for the deployment. (Make sure that the first account holds some ether).
like this:
{seed: "baseball poet vague session shrimp humus embrace glare monkey donkey balony bread"}
If you just want to deploy the contracts, temporariliy remove the third and
fourth migration file. If you want to distribute the token and and add users to
the mew-concept, leave them in and create a specific list of accounts, which you
save it as './intitialMembers.json'. Then uncomment the respective lines in the
migration files.
{accounts: ['0x...', 0x...', ... ]}
Then run
>'truffle migrate --rinkeby'
Contract Structure
==============
The system is based upon two data store and management contracts, `conceptRegistry` and `userRegistry`. Concepts manage the creation and storage of `assessments`. Users are defined by User Contracts, which are created and added to `userRegistry`.
The system is based upon a data store and management contract:
`conceptRegistry`, which can be used to create new Concepts. Concepts manage the
creation and storage of `assessments`. Assessments are paid for in the native
token of the network, defined in `FathomToken`.
Contributing
=========
Feel free to submit a pull request or send an email at <jared@otlw.co> if you would like to get in contact, or join us on Gitter.
Feel free to submit a pull request or send an email at <contact@fathom.network> if you would like to get in contact.
......@@ -81,3 +81,4 @@ exports.getRandomInt = function(min, max) {
max = Math.floor(max);
return Math.floor(Math.random() * (max - min)) + min; //The maximum is exclusive and the minimum is inclusive
}
......@@ -4,8 +4,14 @@ var Assessment = artifacts.require("./Assessment.sol");
var ConceptRegistry = artifacts.require("./ConceptRegistry.sol");
var FathomToken = artifacts.require("./FathomToken.sol");
var Distributor = artifacts.require("./Distributor.sol");
var accounts = web3.eth.accounts
// uncomment this to deploy to rinkeby with specific users
// var setup = require("./../initialMembers.json")
// var accounts = setup.accounts
// var nInitialUsers = accounts.length;
// deploy to development-network
var accounts = web3.eth.accounts
var nInitialUsers = 6;
module.exports = function(deployer) {
......
var FathomToken = artifacts.require("./FathomToken.sol");
// uncomment this when you deploying to rinkeby and wanting to fund specific addresses
// also comment out line 11
// var setup = require("./../initialMembers.json")
// var accounts = setup.accounts
module.exports = function(deployer) {
accounts = web3.eth.accounts
deployer.then(function(){
return FathomToken.deployed()
}).then(function(instance){
for(i=1; i < accounts.length; i++) {
instance.transfer(accounts[i], 10000000000, {from: accounts[0]})
instance.transfer(accounts[i], 10000000000 )
}
})
}
var ConceptRegistry = artifacts.require("./ConceptRegistry.sol");
var Distributor = artifacts.require("./Distributor.sol");
var accounts = web3.eth.accounts
// development-network:
// minimal Setup: 6 members in mew with weight 100
// note: 5 accounts are needed for the mininal valid assessment, +1 for burnStakes-test
var accounts = web3.eth.accounts
var nInitialUsers = 6
let initialMewMembers = accounts.slice(0,nInitialUsers)
// rinkeby: addresses to be in mew
// var setup = require("./../initialMembers.json")
// var initialMewMembers = setup.accounts;
let initialWeights = new Array(initialMewMembers.length).fill(100)
module.exports = function(deployer) {
......
......@@ -8,7 +8,7 @@
},
"scripts": {
"compile": "truffle compile",
"test": "ganache-cli -a 50 > /dev/null 2>&1 & truffle test"
"test": "ganache-cli > /dev/null 2>&1 & truffle test"
},
"author": "Jared Pereira",
"license": "ISC",
......@@ -18,6 +18,7 @@
"truffle": "4.0.1"
},
"dependencies": {
"ethereumjs-abi": "^0.6.4"
"ethereumjs-abi": "^0.6.4",
"truffle-hdwallet-provider": "0.0.3"
}
}
var HDWalletProvider = require("truffle-hdwallet-provider");
// let mnemonic = require("./secrets.json");
let mnemonic = {seed: "put your seed words here or in a file called secret. json"}
module.exports = {
networks: {
development: {
......@@ -8,6 +12,10 @@ module.exports = {
host: "localhost",
port: 8545,
}
},
rinkeby: {
provider: new HDWalletProvider(mnemonic.seed, "https://rinkeby.infura.io/2FBsjXKlWVXGLhKn7PF7"),
network_id: 4
}
},
solc: {
......@@ -16,5 +24,4 @@ module.exports = {
runs: 200
}
}
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment