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

Commit 936616a

Browse files
Removed duplicate content (#42)
1 parent 916d6e7 commit 936616a

File tree

1 file changed

+5
-77
lines changed

1 file changed

+5
-77
lines changed

README.md

Lines changed: 5 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,13 @@
11
# Permissioning Smart Contracts
22

3-
## Requirements
4-
1. [NodeJS](https://nodejs.org/en/) v8.9.4 or later
5-
1. A [Pantheon node](https://github.com/PegaSysEng/pantheon) running with a [permissioning enabled genesis](genesis.json) file (genesis file with the Ingress contract embedded).
6-
1. [Truffle installed](https://truffleframework.com/docs/truffle/getting-started/installation)
3+
**Note:** The contracts in this repository are currently in the process of going through a third party audit. [Please
4+
contact us](support@pegasys.tech) before using in a production environment.
75

8-
## Initial setup
9-
1. Run `npm install`.
10-
1. Open `truffle-config.js`.
11-
1. Create the following environment variables:
12-
- `PANTHEON_NODE_PERM_ACCOUNT` - Set the value to the adress of the account used to interact with the permissioning contracts.
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
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.
6+
## Using
167

8+
The [Pantheon documentation](https://docs.pantheon.pegasys.tech/en/stable/Permissions/Onchain-Permissioning/)
9+
describes how to use the contracts for onchain permissioning.
1710

18-
## How to deploy and setup contracts
19-
1. Run `truffle migrate`
20-
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.
22-
23-
## Add and Remove Enodes to the whitelist
24-
1. Run `truffle console`
25-
1. Open https://permissioning-tools.pegasys.tech/
26-
1. Type the enode that you want to include in the whitelist in the input box.
27-
1. Click "Process".
28-
1. Copy the truffe command output.
29-
1. Paste the truffle command into the console and press enter.
30-
31-
Example output:
32-
```
33-
$ truffle console
34-
$ truffle(development)> Rules.deployed().then(function(instance) {instance.addEnode("0x6f8a80d14311c39f35f516fa664deaaaa13e85b2f7493f37f6144d86991ec012", "0x937307647bd3b9a82abe2974e1407241d54947bbb39763a4cac9f77166ad92a0", "0x0a033a06", "30303").then(function(tx) {console.log(tx)});});
35-
undefined
36-
truffle(development)> { tx: '0xaecbc376089d8eba7154f93d08c6be3bdf7fa13bfe2d8dbdfe4cd323fec77160',
37-
receipt:
38-
{ blockHash: '0x553007bb40a52e3f37f3c9b8e559816d029c9e272590efac69b96926431ebfdd',
39-
blockNumber: 22264,
40-
contractAddress: null,
41-
cumulativeGasUsed: 596203,
42-
from: '0xfe3b557e8fb62b89f4916b721be55ceb828dbd73',
43-
gasUsed: 596203,
44-
logs: [],
45-
logsBloom: '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
46-
status: true,
47-
to: '0xa86eb77c09ae0f2164065ab14094565011b0bfca',
48-
transactionHash: '0xaecbc376089d8eba7154f93d08c6be3bdf7fa13bfe2d8dbdfe4cd323fec77160',
49-
transactionIndex: 0,
50-
rawLogs: [] },
51-
logs: [] }
52-
53-
undefined
54-
```
55-
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.
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-
63-
## Add and Remove Admin accounts
64-
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.
66-
67-
If you want to add or remove accounts as Admins, use the following commands in `truffle console`:
68-
69-
**Add account `0x627306090abaB3A6e1400e9345bC60c78a8BEf57` to Admin list**
70-
```
71-
Admin.deployed().then(function(instance) {instance.addAdmin("0x627306090abaB3A6e1400e9345bC60c78a8BEf57").then(function(tx) {console.log(tx)});});
72-
```
73-
74-
**Remove acccount `0x627306090abaB3A6e1400e9345bC60c78a8BEf57` from Admin list**
75-
```
76-
Admin.deployed().then(function(instance) {instance.removeAdmin("0x627306090abaB3A6e1400e9345bC60c78a8BEf57").then(function(tx) {console.log(tx)});});
77-
```
78-
79-
**View Admin list**
80-
```
81-
Admin.deployed().then(function(instance) {instance.getAdmins().then(function(tx) {console.log(tx)});});
82-
```
8311
## Development
8412

8513
### Linting

0 commit comments

Comments
 (0)