Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
5131cf0
add uml
claualc Jul 5, 2023
4ff96ef
clean files
claualc Jul 5, 2023
9de9ce5
update docker file and deploy bash
claualc Jul 5, 2023
49d2423
add: init-yaml
claualc Jul 6, 2023
a8b0abd
remove ansible web3 install, already in pip req
claualc Jul 6, 2023
5f60737
run_net.sh to see trans
claualc Jul 6, 2023
894a923
init beacon proxy
claualc Jul 7, 2023
46f3169
add: beacon proxy pattern
claualc Jul 7, 2023
6cb841a
add: constant for contracts abi path
claualc Jul 7, 2023
cec7f03
add: constant path to contracts
claualc Jul 7, 2023
69d0477
add: constant path to contracts
claualc Jul 7, 2023
361cbd0
fix: deploy
claualc Jul 7, 2023
686b4d2
fix: clean repo
claualc Jul 7, 2023
56cac6e
fix: ens spelling error
claualc Jul 7, 2023
fcaf593
fix: add yalm to dydx and darkforest depploy examples
claualc Jul 7, 2023
a2b67ee
add: example contract
claualc Jul 7, 2023
2c29c42
beacon working without test
claualc Jul 27, 2023
1e5d9dc
beacon teste
claualc Jul 27, 2023
e9b6f70
add testes
claualc Jul 27, 2023
90a8b33
add initializer to impplemmentation function
claualc Jul 29, 2023
514b517
beacon correct deployment
claualc Jul 29, 2023
b3a764b
git test working
claualc Jul 29, 2023
bfad4a8
beacon test final
claualc Jul 29, 2023
b9d239a
multiple proxyes test working
claualc Jul 30, 2023
4d4e847
README
claualc Jul 30, 2023
0785897
final formating
claualc Jul 30, 2023
5a2e0ed
fix: README
claualc Jul 30, 2023
0260fa5
multi proxy beacon test working
claualc Aug 22, 2023
1b73635
delete beacon script comments
claualc Aug 23, 2023
4674fd8
add katena.network to source_types
claualc Aug 28, 2023
1ebaa75
add tokens metric files
claualc Aug 28, 2023
d9072d7
add transparent proxy example
claualc Aug 29, 2023
71ff03b
add katena logic of transparent-proxy
claualc Aug 29, 2023
955c4f1
transparent proxy deployed
claualc Aug 29, 2023
489b195
transparent proxy test
claualc Aug 29, 2023
5d80a06
transparent proxy test approved
claualc Aug 29, 2023
e823eb1
UUPSProxy contract deploy and test working
claualc Sep 1, 2023
371294c
print fix
claualc Sep 1, 2023
ee34476
fiz print
claualc Sep 1, 2023
6eb0fa5
little fix test
claualc Sep 1, 2023
4678ab8
fix proxy initializer deploy
claualc Sep 13, 2023
bc5d474
add parameters to upgradablebeacon constructor
claualc Sep 13, 2023
cf202b5
beacon.yaml small error
claualc Sep 13, 2023
856c55e
deleted script
claualc Sep 17, 2023
a80651f
pi-swap deploying
claualc Sep 17, 2023
b978d07
NOT
claualc Sep 18, 2023
6770b61
NOT comparision beacon
claualc Sep 18, 2023
12e4be8
simplle-bebacon app
claualc Sep 18, 2023
b0faaf3
simple apps
claualc Sep 18, 2023
edf1273
hooks opera yaml
claualc Sep 20, 2023
b695208
add optional network fok flag to deploy
claualc Sep 20, 2023
9cc3fb6
hooks protocol deployed
claualc Sep 26, 2023
5107816
hooks tokens count
claualc Sep 26, 2023
a397ac4
web3 simple contracts deployments
claualc Sep 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ input.yml
.vscode/
build/
migrations/
test
nodes/benchmark/
nodes/contracts-try/
log-container.txt
13 changes: 11 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
FROM --platform=linux/amd64 ubuntu:20.04

WORKDIR /
ADD . /

ENV PATH "$PATH:/new/path"

Expand All @@ -14,6 +13,16 @@ RUN tar -xf node-v14.15.4-linux-x64.tar.xz
RUN ln -s /node-v14.15.4-linux-x64/bin/node /usr/local/bin/node
RUN ln -s /node-v14.15.4-linux-x64/bin/npm /usr/local/bin/npm
RUN ln -s /node-v14.15.4-linux-x64/bin/npx /usr/local/bin/npx

RUN npm install -g ganache-cli
RUN npm config set user 0
RUN pip install -r ./requirements.txt


WORKDIR /katena
ADD . /katena/

RUN pip install -r ./requirements.txt

# to avoid: /bin/bash^M: bad interpreter:
# when creating scripts in Windows env and then porting over to run on a Unix environment.
RUN sed -i -e 's/\r$//' *.sh
86 changes: 22 additions & 64 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

Operations on Blockchain with TOSCA.

This repo contains all the files needed to setup and run the experiments used in the evaluation of KATENA.
The prototype has been tested on Ubuntu 20.04.
This repo contains all the files needed to deploy compiled etherum aplications that are complietn with spacific deploy patterns.

**NOTE**: to reproduce the experiments reported in the paper refer to [Experiments Reproducibility](#experiments-reproducibility) section. For each experiment, we provided the required step to run it.
If you want further information on how to use KATENA to deploy your applications refer to [Development](DEVELOPMENT.md) file. For extra information on Number of Tokens computation see [here](./NUMBER_OF_TOKENS.md).
Expand All @@ -26,93 +25,52 @@ The suggested way to reproduce the experiments is to use Docker (if not installe

## Experiments Reproducibility

The KATENA container allows to reproduce both the deployment of benchmark applications and the Number of Tokens analysis as described below.
The KATENA container allows automate the deployment of ethereum applications with different patterns:

**The following commands must be executed within KATENA containers (i.e., after the execution of step 3 of the previous section). The two experiments are independent, so there is no specific order to execute them.**
1. Diamond
2. Proxy (ERC1967)
3. upgradable Beacon

- ### Benchmark application deployment
Examples of this patterns and other apps more comples can be foind in the deploy-examples folder.

To deploy the benchmark applications execute within the KATENA container the following command.
- ### To deploy a custom application

To deploy an applications execute within the KATENA container the following command.

```
./run-deploy.sh
./deploy.sh -f <topology.ylm> -c <dir_containing_abis.yml>
```
Where the <topology.ylm> defines the architcture of the ethereum network being deployed.

The script automatically:

- Bootstraps a Ganache instance.
- Retrieves the credentials of Account 0 (among the ones generated by Ganache) and uses them to pay for transactions on the local Ganache Blockchain.
- Stores these credentials in KATENA
- Instructs KATENA to deploy ENS, Dark Forest, and dydx by providing the TOSCA models (stored in folder `benchmark`) and the smart contract ABIs (stored in folders `nodes/contracts-<APP_NAME>` where APP_NAME can be either ens, dydx or dark-forest).

Note that depending on the hardware configuration this step could take a while (approximatively 10/20 minutes).

The deployment succeeds if this output is printed in the console.

```
deploying ens...
ens deployed successfully
deploying dark-forest...
dark-forest deployed successfully
deploying dydx...
dydx deployed successfully
```

- ### Number of Tokens analysis

To execute the analysis execute within the KATENA container the following command.

```
./run-not-evaluation-all.sh
```
- Instructs KATENA to deploy the input topology

This script compares the difference in Number of Tokens between KATENA specification files used to deploy the applications and the original deployment scripts.
## Run tests

The experiment succeeds if the output is:
Scripts can be used to test deployment. This scripts, must be listed in a `test` folder in the same directory as the contracts ABIs. An example can be found at `deploy-examples/beacon`:

```
dark-forest
YAML: 304
JS: 1765
ens
YAML: 87
JS: 95
dydx
YAML: 559
JS: 923
python ./.katena/contracts/test/<script>.py
```

More information regarding the analysis can be found [here](./NUMBER_OF_TOKENS.md).
Informations about the contracts addres and other paramters can be found in the `deploy.log` file or in the `.katena/.opera` directory.

## Error logs

The errors produced by KATENA (if any) are stored in file `deploy.log` which can be accessed _within KATENA container_.

## Benchmark Applications

- Ethereum Name Service (ENS): a DNS working on Ethereum
- dydx: DeFi application
- Dark Forest: on-chain game that uses the Diamond pattern.

Note that if you want to deploy Dark Forest smart contracts _manually_ (i.e., without using script `run-deploy.sh`), Ganache must be started with the following options to remove smart contract size constraint and to increase the gas limit.

```
ganache-cli -l 10000000 -g 1 --allowUnlimitedContractSize
```
The errors produced by KATENA (if any) are stored in file `deploy.log` at the `.katena` directory.

## Repository structure

- [benchmark](./benchmark/): contains Service Template for app used in evaluation: dydx, dark forest, ens.

- [examples](./examples/): files used to test the implementation. Contains basic use cases to test relationships, library linkage, and diamond pattern.
- [deploy-examples](./deploy-examples/): examples of blockchain deployments.

- [nodes](./nodes/): contains:
- [templates](./templates/) folder contains:

- smart contract ABIs used by xopera to deploy smart contracts (folders `contracts-*`)
- katena building blocks (folder `nodes`)
- Ansible playbooks attached to xopera node and relationships types (folder `playbooks`)
- Python scripts used to communicate with the chain (using Web3.py) (folder `scripts`)
- all the node, relationships, capabilities, and relationships used to model the dApps (files `capabilities.yaml`, `contract.yaml`, `network.yaml`, `relationships.yaml`, `wallet.yaml`)

- [not-comparison](./not-comparison/) files used for the evaluation using the Number of Tokens (NoT) metric.

<!-- - [Smart Contract Example](./smart-contract-example/): contains a truffle project used to test and use JS and TS capabilities to use functions of the benchmark apps -->
- [contracts-examples](./contracts-examples/) Some solidity contracts used in the deploy examples
- [misc](./misc/) miscellaneous folder that holds a mix of different supplementary files,
27 changes: 0 additions & 27 deletions bootstrap-dev.sh

This file was deleted.

Loading