|
11 | 11 | 1. Create the following environment variables: |
12 | 12 | - `PANTHEON_NODE_PERM_ACCOUNT` - Set the value to the adress of the account used to interact with the permissioning contracts. |
13 | 13 | - `PANTHEON_NODE_PERM_KEY` - Set the value to the private key associated with the account. |
| 14 | + - `INGRESS_CONTRACT_ADDRESS` "0x0000000000000000000000000000000000009999" - must match what is in the genesis file |
14 | 15 | 1. If your node is not using the default JSON-RPC host and port (`http://127.0.0.1:8545`), create a environment variable named `PANTHEON_NODE_PERM_ENDPOINT` and set its value to match your node endpoint. |
15 | 16 |
|
16 | 17 |
|
17 | 18 | ## How to deploy and setup contracts |
18 | | -1. add .env file with the address of the ingress contract (so that the Truffle migration scripts know where to find it) |
19 | | -``` |
20 | | -INGRESS_CONTRACT_ADDRESS="0x0000000000000000000000000000000000009999" |
21 | | -``` |
22 | 19 | 1. Run `truffle migrate` |
23 | 20 |
|
24 | | -After this step, you should have your Rules contract deployed on the network. This will also update the Ingress contract with the name and version of the Rules contract. |
| 21 | +After this step, you should have your Rules and Admin contracts deployed on the network. This will also update the Ingress contract with the name and version of the Rules and Admin contracts. |
25 | 22 |
|
26 | 23 | ## Add and Remove Enodes to the whitelist |
27 | 24 | 1. Run `truffle console` |
@@ -58,22 +55,31 @@ undefined |
58 | 55 |
|
59 | 56 | After this step, you should have the enode added to your whitelist. Please repeat this step for each enode that you want to add to the whitelist. |
60 | 57 |
|
| 58 | +**View the whitelist** |
| 59 | +``` |
| 60 | +Rules.deployed().then(function(instance) {instance.getSize().then(function(txCount) {console.log("size of whitelist: " + txCount); var i=txCount; while(i>=0) {instance.getByIndex(i--).then(function(tx) {console.log(tx)})}});}); |
| 61 | +``` |
| 62 | + |
61 | 63 | ## Add and Remove Admin accounts |
62 | 64 |
|
63 | | -When you first deploy the Rules smart contract, the account used to deploy it will automatically be set as an Admin. Only Admin accounts can add or remove nodes from the whitelist. |
| 65 | +When you first deploy the Rules and Admin smart contracts, the account used to deploy them will automatically be set as an Admin. Only Admin accounts can add or remove nodes from the whitelist. |
64 | 66 |
|
65 | 67 | If you want to add or remove accounts as Admins, use the following commands in `truffle console`: |
66 | 68 |
|
67 | 69 | **Add account `0x627306090abaB3A6e1400e9345bC60c78a8BEf57` to Admin list** |
68 | 70 | ``` |
69 | | -Rules.deployed().then(function(instance) {instance.addAdmin("0x627306090abaB3A6e1400e9345bC60c78a8BEf57").then(function(tx) {console.log(tx)});}); |
| 71 | +Admin.deployed().then(function(instance) {instance.addAdmin("0x627306090abaB3A6e1400e9345bC60c78a8BEf57").then(function(tx) {console.log(tx)});}); |
70 | 72 | ``` |
71 | 73 |
|
72 | 74 | **Remove acccount `0x627306090abaB3A6e1400e9345bC60c78a8BEf57` from Admin list** |
73 | 75 | ``` |
74 | | -Rules.deployed().then(function(instance) {instance.removeAdmin("0x627306090abaB3A6e1400e9345bC60c78a8BEf57").then(function(tx) {console.log(tx)});}); |
| 76 | +Admin.deployed().then(function(instance) {instance.removeAdmin("0x627306090abaB3A6e1400e9345bC60c78a8BEf57").then(function(tx) {console.log(tx)});}); |
75 | 77 | ``` |
76 | 78 |
|
| 79 | +**View Admin list** |
| 80 | +``` |
| 81 | +Admin.deployed().then(function(instance) {instance.getAdmins().then(function(tx) {console.log(tx)});}); |
| 82 | +``` |
77 | 83 | ## Development |
78 | 84 |
|
79 | 85 | ### Linting |
|
0 commit comments