You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/parsec_architecture.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ Therefore transaction throughput is horizontally scalable with additional server
25
25
For example, in contrast to the Ethereum blockchain, this system executes native value transfers and smart contract transactions (e.g. [ERC20 token](https://ethereum.org/en/developers/docs/standards/tokens/erc-20/) transfers) in parallel for independent addresses.
This guide runs through setting up the PArSEC system with the EVM runner, and then interacting with it using Hardhat and MetaMask. This assumes that the system has been set up as described in the [README](https://github.com/mit-dci/opencbdc-tx#readme).
3
+
This guide runs through setting up the PArSEC system with the EVM runner, and then interacting with it using Hardhat and MetaMask.
4
+
This assumes that the system has been set up as described in the [README](https://github.com/mit-dci/opencbdc-tx#readme).
4
5
5
6
## Prerequisites
6
7
7
8
Make sure you have [NodeJS installed](https://github.com/nodesource/distributions/blob/master/README.md).
8
9
We recommend using `v18` or `v20`, as Hardhat [actively supports these versions](https://github.com/nodejs/release#release-schedule) currently.
9
-
We also provide a [.nvmrc](https://github.com/mit-dci/opencbdc-tx/blob/trunk/.nvmrc).
10
+
We also provide a [.nvmrc](../.nvmrc).
10
11
## Running the Server
11
12
### Run with Docker
12
13
13
-
Spawns an agent running the EVM runner by default.
14
-
Lua runner may be used by modifying the --runner_type flag in the command keyed by agent0, in the file [`docker-compose-PArSEC.yml`](https://github.com/mit-dci/opencbdc-tx/blob/trunk/docker-compose-PArSEC.yml).
14
+
Spawns an agent running the EVM runner by default.
15
+
Lua runner may be used by modifying the --runner_type flag in the command keyed by agent0, in the file [`docker-compose-parsec.yml`](https://github.com/mit-dci/opencbdc-tx/blob/trunk/docker-compose-parsec.yml).
15
16
16
17
### Start it up
17
18
```console
18
-
# docker compose -f docker-compose-PArSEC.yml up -d
19
+
# docker compose -f docker-compose-parsec.yml up -d
19
20
```
20
21
21
22
The agent is now available on `http://localhost:8080/`.
@@ -27,7 +28,7 @@ If you are using MacOS or an Ubuntu-like distribution, you can run the system wi
27
28
Build and run the system:
28
29
```console
29
30
$ ./scripts/build.sh
30
-
$ ./scripts/PArSEC-run-local.sh [OPTIONS] # use --help flag for help
31
+
$ ./scripts/parsec-run-local.sh [OPTIONS] # use --help flag for help
31
32
```
32
33
The agent is now available on the specified IP address and port (defaults to localhost:8888).
33
34
@@ -37,12 +38,13 @@ Follow below for a demo.
37
38
38
39
### Setup Hardhat environment
39
40
40
-
Go to a new separate directory and run `npm init` and `npm install --save-dev hardhat @nomiclabs/hardhat-waffle`:
41
+
Go to a new separate directory and run the following:
41
42
42
43
```console
43
-
$ mkdir PArSEC-playground &&cd PArSEC-playground
44
-
$ npm init # all fields may be left as defaults (or blank)
@@ -51,17 +53,19 @@ Finish with initializing Hardhat using:
51
53
$ npx hardhat
52
54
```
53
55
54
-
Select to create a JavaScript project. All default values are sufficient for instantiating this project.
56
+
Select to create a JavaScript project.
57
+
All default values are sufficient for instantiating this project.
55
58
56
59
Note: This will create new subdirectories and files in this directory.
57
-
These can all be overwritten for the purpose of this guide.
60
+
These can all be overwritten for the purpose of this guide.
58
61
However, to use the Hardhat compiler, all Solidity files should be stored in the
59
62
`contracts` subdirectory.
60
63
61
-
Copy the example [hardhat.config.js](https://github.com/mit-dci/opencbdc-tx/blob/trunk/scripts/hardhat.config.js) into this directory.
64
+
Copy the example [hardhat.config.js](../scripts/hardhat.config.js) into this directory.
62
65
63
-
Edit the `url:` value in the `hardhat.config.js` file to correspond with the url of the agent RPC server.
64
-
Using Docker this will be `http://localhost:8080/`. If running outside of Docker, use the IP and port specified when running `./scripts/PArSEC-run-local.sh` (default is `http://localhost:8888/`).
66
+
Edit the `url:` value in the `hardhat.config.js` file to correspond with the url of the agent RPC server.
67
+
Using Docker this will be `http://localhost:8080/`.
68
+
If running outside of Docker, use the IP and port specified when running `./scripts/parsec-run-local.sh` (default is `http://127.0.0.1:8888/`).
65
69
66
70
Note: the value in the `accounts` array is the private key of one of the hard-coded, pre-minted accounts in PArSEC/EVM.
67
71
@@ -77,7 +81,8 @@ browse the [Hardhat getting started guide](https://hardhat.org/hardhat-runner/do
77
81
78
82
### Using the MetaMask Web3 Client
79
83
80
-
Install [MetaMask](https://metamask.io/) as a browser add-on. After initialization with seed phrases and all, [add a custom network](https://metamask.zendesk.com/hc/en-us/articles/360043227612-How-to-add-a-custom-network-RPC).
84
+
Install [MetaMask](https://metamask.io/) as a browser add-on.
85
+
After initialization with seed phrases and all, [add a custom network](https://metamask.zendesk.com/hc/en-us/articles/360043227612-How-to-add-a-custom-network-RPC).
@@ -86,21 +91,22 @@ Install [MetaMask](https://metamask.io/) as a browser add-on. After initializati
86
91
| New RPC URL |`http://<agent IP address>:<agent port>/`|
87
92
| Currency symbol |`CBDC`|
88
93
89
-
The agent IP address and agent port are the IP address and port specified for the agent when spawning the system.
90
-
Using Docker, this defaults to {IP: localhost, port: 8080}
94
+
The agent IP address and agent port are the IP address and port specified for the agent when spawning the system.
95
+
Using Docker, this defaults to {IP: localhost, port: 8080}
91
96
Running outside of Docker, this defaults to {IP: localhost, port:8888}.
92
97
### Funding MetaMask
93
98
94
-
Once you have MetaMask set up, there will be "Account 1" with a trucated address up top, with a button to copy the address. You can use that to send yourself some coins:
99
+
Once you have MetaMask set up, there will be "Account 1" with a trucated address up top, with a button to copy the address.
100
+
You can use that to send yourself some coins:
95
101
96
-
To issue yourself native tokens, execute the following commands:
102
+
To issue yourself native tokens, execute the following commands:
@@ -111,50 +117,51 @@ You should see the balance appear after a few moments.
111
117
112
118
### Try deploying en ERC20 token!
113
119
114
-
An example ERC20 token contract is provided at [opencbdc-tx/contracts/MITCoin.sol](https://github.com/mit-dci/opencbdc-tx/blob/trunk/contracts/MITCoin.sol). Use this file as a basis, or create one [from scratch](https://dev.to/yakult/a-concise-hardhat-tutorial-part-2-writing-erc20-2jpm).
120
+
An example ERC20 token contract is provided at [opencbdc-tx/contracts/MITCoin.sol](../contracts/MITCoin.sol).
121
+
Use this file as a basis, or create one [from scratch](https://dev.to/yakult/a-concise-hardhat-tutorial-part-2-writing-erc20-2jpm).
115
122
Follow the below directions to deploy your token.
116
123
117
124
Note: To compile the example contract, `@openzeppelin/contracts` is a required install.
118
125
```console
119
126
$ npm install @openzeppelin/contracts
120
127
```
121
-
Create a deploy script for the token. An example is provided in [opencbdc-tx/scripts/deploy.js](https://github.com/mit-dci/opencbdc-tx/blob/trunk/docs/PArSEC_user_guide.md).
122
-
As written, this script requires the name of the ERC20 token to be changed to match the name of the token which is to be deployed.
128
+
Create a deploy script for the token. An example is provided in [opencbdc-tx/scripts/deploy.js](../scripts/deploy.js).
129
+
As written, this script requires the name of the ERC20 token to be changed to match the name of the token which is to be deployed.
123
130
124
131
Note: When the Hardhat project was initialized, a `scripts/deploy.js` file was created.
125
132
It corresponds to the file `contracts/Lock.sol` that was also created upon initialization.
126
133
For the purposes of this guide, that script can be overwritten, and we do not require `contracts/Lock.sol`.
127
134
128
-
Spawn the system using above instructions, then run:
135
+
To deploy [opencbdc-tx/contracts/MITCoin.sol](../contracts/MITCoin.sol), spawn the system using above instructions, then run:
0 commit comments