Skip to content
This repository was archived by the owner on Jan 16, 2023. It is now read-only.

Commit 916d6e7

Browse files
macfarlalucassaldanha
authored andcommitted
Update README (#41)
1 parent afb5e72 commit 916d6e7

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

README.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,14 @@
1111
1. Create the following environment variables:
1212
- `PANTHEON_NODE_PERM_ACCOUNT` - Set the value to the adress of the account used to interact with the permissioning contracts.
1313
- `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
1415
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.
1516

1617

1718
## 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-
```
2219
1. Run `truffle migrate`
2320

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.
2522

2623
## Add and Remove Enodes to the whitelist
2724
1. Run `truffle console`
@@ -58,22 +55,31 @@ undefined
5855

5956
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.
6057

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+
6163
## Add and Remove Admin accounts
6264

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.
6466

6567
If you want to add or remove accounts as Admins, use the following commands in `truffle console`:
6668

6769
**Add account `0x627306090abaB3A6e1400e9345bC60c78a8BEf57` to Admin list**
6870
```
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)});});
7072
```
7173

7274
**Remove acccount `0x627306090abaB3A6e1400e9345bC60c78a8BEf57` from Admin list**
7375
```
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)});});
7577
```
7678

79+
**View Admin list**
80+
```
81+
Admin.deployed().then(function(instance) {instance.getAdmins().then(function(tx) {console.log(tx)});});
82+
```
7783
## Development
7884

7985
### Linting

0 commit comments

Comments
 (0)