Skip to content

Commit

Permalink
Fix paths
Browse files Browse the repository at this point in the history
  • Loading branch information
DimaStebaev committed Sep 20, 2024
1 parent 8680fa2 commit 0d9acf1
Show file tree
Hide file tree
Showing 76 changed files with 827 additions and 9,259 deletions.
4 changes: 3 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ module.exports = {

},
ignorePatterns: [

"coverage/**",
"typechain-types/**",
"**/venv/**"
]
};
16 changes: 9 additions & 7 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
version: 2
updates:
- package-ecosystem: npm
directory: "/proxy"
schedule:
interval: "weekly"
day: "saturday"
allow:
- dependency-type: "production"
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"

- package-ecosystem: "pip"
directory: "/scripts/"
schedule:
interval: "weekly"
12 changes: 7 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
name: publish

# cspell:words PYPI_TOKEN ncipollo

on:
pull_request:
types: [closed]
Expand Down Expand Up @@ -103,17 +105,17 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: data
path: proxy/data
path: data

- name: Create Release
uses: ncipollo/release-action@v1
with:
tag: ${{ env.VERSION }}
prerelease: ${{ env.PRERELEASE }}
artifacts: "proxy/predeployed/dist/*,\
proxy/predeployed/data/*,\
proxy/data/ima-schain-*-manifest.json,\
proxy/data/*-abi.json"
artifacts: "predeployed/dist/*,\
predeployed/data/*,\
data/ima-schain-*-manifest.json,\
data/*-abi.json"

- name: Build and publish image
env:
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "dictionary"]
path = dictionary
url = https://github.com/skalenetwork/dictionary.git
3 changes: 0 additions & 3 deletions CODEOWNERS

This file was deleted.

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM node:18
RUN mkdir /app

COPY VERSION /app
COPY proxy /app
COPY ./ /app

WORKDIR /app

Expand Down
22 changes: 22 additions & 0 deletions cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"version": "0.2",
"language": "en",
"ignorePaths": [
".gitignore",
"artifacts/**",
"cache/**",
"coverage/**",
"coverage.json",
"data/**",
"typechain-types/**",
"**/venv/**"
],
"dictionaries": ["domain-terms", "libraries", "names", "skale-terms", "solidity"],
"dictionaryDefinitions": [
{ "name": "skale-terms", "path": "dictionary/skale-terms.txt"},
{ "name": "libraries", "path": "dictionary/libraries.txt"},
{ "name": "domain-terms", "path": "dictionary/domain-terms.txt"},
{ "name": "names", "path": "dictionary/names.txt"},
{ "name": "solidity", "path": "dictionary/solidity.txt"}
]
}
11 changes: 6 additions & 5 deletions deployer/README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
<!-- SPDX-License-Identifier: (AGPL-3.0-only OR CC-BY-4.0) -->
<!-- cspell:words creds -->

# SKALE IMA Deployer

These helper scripts will deploy `IMA` on a SKALE chain.

## Usage

1) Place credentials files for each SKALE chain into the `creds` directory
2) Run `python deployer.py`
1) Place credentials files for each SKALE chain into the `creds` directory
2) Run `python deployer.py`

## Requirements

- python 3.6+
- scp
- all dependencies for truffle deployment (see `proxy` folder)
- python 3.6+
- scp
- all dependencies for truffle deployment (see root folder)
1 change: 1 addition & 0 deletions dictionary
Submodule dictionary added at cb4838
71 changes: 36 additions & 35 deletions docs/deployment.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<!-- SPDX-License-Identifier: (AGPL-3.0-only OR CC-BY-4.0) -->
<!-- cspell:words npms privateKey_skalechain ipcpath ipcx -->

# IMA Deployment and Initialization

Expand All @@ -18,7 +19,7 @@ Deploy process includes:

2) `SKALE Chain` network with known HTTP(S) URL of **Web3** interface.

3) Preliminary deployed **Skale Manager** software with known address of **ContractManager** smart contract saved into the `proxy/data/skaleManagerComponents.json` file like shown in the following example:
3) Preliminary deployed **Skale Manager** software with known address of **ContractManager** smart contract saved into the `data/skaleManagerComponents.json` file like shown in the following example:

```json
{
Expand All @@ -39,7 +40,7 @@ Deploy process includes:
6) Node modules should be initialized in the following folders:
```shell
export IMA_ROOT=.....
cd $IMA_ROOT/proxy; npm install
cd $IMA_ROOT; npm install
cd $IMA_ROOT/npms/skale-owasp; npm install
cd $IMA_ROOT/npms/skale-ima; npm install
cd $IMA_ROOT/agent; npm install
Expand All @@ -49,10 +50,10 @@ Deploy process includes:

### Configure Truffle

Edit the `$IMA_ROOT/proxy/truffle-config.js` and specify needed networks (`Mainnet` and `SKALE Chain`) and account addresses which will own contracts on these blockchains:
Edit the `$IMA_ROOT/truffle-config.js` and specify needed networks (`Mainnet` and `SKALE Chain`) and account addresses which will own contracts on these blockchains:

```shell
cd $IMA_ROOT/proxy
cd $IMA_ROOT
nano ./truffle-config.js
```

Expand Down Expand Up @@ -83,7 +84,7 @@ Initialize required environment variables. Example of `.env` file can be found i
Build all the contracts once to ensure everything initialized OK:

```shell
cd $IMA_ROOT/proxy
cd $IMA_ROOT
mkdir -p data || true
rm -rf ./build
rm -rf ./data/proxy*
Expand All @@ -94,7 +95,7 @@ ls -1 ./data/
### Smart contract Deployment for Main Net

```shell
cd $IMA_ROOT/proxy
cd $IMA_ROOT
npm run deploy-to-mainnet
ls -1 ./data/
```
Expand All @@ -104,7 +105,7 @@ You should see **proxyMainnet.json** file listed.
#### Smart contract Deployment for S-Chain

```shell
cd $IMA_ROOT/proxy
cd $IMA_ROOT
npm run deploy-to-schain
ls -1 ./data/
```
Expand All @@ -126,8 +127,8 @@ node ./main.js --verbose=9 \
--id-s-chain=Bob \
--cid-main-net=-4 \
--cid-s-chain=-4 \
--abi-main-net=../proxy/data/proxyMainnet.json \
--abi-s-chain=../proxy/data/proxySchain_Bob.json \
--abi-main-net=../data/proxyMainnet.json \
--abi-s-chain=../data/proxySchain_Bob.json \
--key-main-net=[YOUR_PRIVATE_KEY] \
--key-s-chain=[YOUR_PRIVATE_KEY]
```
Expand All @@ -143,8 +144,8 @@ node ./main.js --verbose=9 \
--id-s-chain=Bob \
--cid-main-net=-4 \
--cid-s-chain=-4 \
--abi-main-net=../proxy/data/proxyMainnet.json \
--abi-s-chain=../proxy/data/proxySchain_Bob.json \
--abi-main-net=../data/proxyMainnet.json \
--abi-s-chain=../data/proxySchain_Bob.json \
--key-main-net=[YOUR_ETH_PRIVATE_KEY] \
--key-s-chain=[YOUR_PRIVATE_KEY]
```
Expand All @@ -162,8 +163,8 @@ node ./main.js --verbose=9 \
--id-s-chain=Bob \
--cid-main-net=-4 \
--cid-s-chain=-4 \
--abi-main-net=../proxy/data/proxyMainnet.json \
--abi-s-chain=../proxy/data/proxySchain_Bob.json \
--abi-main-net=../data/proxyMainnet.json \
--abi-s-chain=../data/proxySchain_Bob.json \
--key-main-net=[YOUR_ETH_PRIVATE_KEY] \
--key-s-chain=[YOUR_PRIVATE_KEY]
```
Expand Down Expand Up @@ -210,8 +211,8 @@ node ./main.js --verbose=9 \
--id-s-chain=Bob \
--cid-main-net=-4 \
--cid-s-chain=-4 \
--abi-main-net=../proxy/data/proxyMainnet.json \
--abi-s-chain=../proxy/data/proxySchain_Bob.json \
--abi-main-net=../data/proxyMainnet.json \
--abi-s-chain=../data/proxySchain_Bob.json \
--key-main-net=[YOUR_ETH_PRIVATE_KEY] \
--address-s-chain=0x66c5a87f4a49dd75e970055a265e8dd5c3f8f852
```
Expand All @@ -232,8 +233,8 @@ node ./main.js --verbose=9 \
--id-s-chain=Bob \
--cid-main-net=-4 \
--cid-s-chain=-4 \
--abi-main-net=../proxy/data/proxyMainnet.json \
--abi-s-chain=../proxy/data/proxySchain_Bob.json \
--abi-main-net=../data/proxyMainnet.json \
--abi-s-chain=../data/proxySchain_Bob.json \
--address-main-net=[ADDRESS] \
--key-s-chain=[YOUR_PRIVATE_KEY]
```
Expand All @@ -253,8 +254,8 @@ node ./main.js --verbose=9 \
--cid-main-net=-4 \
--cid-s-chain=-4 \
--id-s-chain=Bob \
--abi-main-net=../proxy/data/proxyMainnet.json \
--abi-s-chain=../proxy/data/proxySchain_Bob.json \
--abi-main-net=../data/proxyMainnet.json \
--abi-s-chain=../data/proxySchain_Bob.json \
--key-main-net=[YOUR_ETH_PRIVATE_KEY]
```

Expand All @@ -273,8 +274,8 @@ node ./main.js --verbose=9 \
--id-s-chain=Bob \
--cid-main-net=-4 \
--cid-s-chain=-4 \
--abi-main-net=../proxy/data/proxyMainnet.json \
--abi-s-chain=../proxy/data/proxySchain_Bob.json \
--abi-main-net=../data/proxyMainnet.json \
--abi-s-chain=../data/proxySchain_Bob.json \
--key-main-net=[YOUR_ETH_PRIVATE_KEY]
```

Expand Down Expand Up @@ -312,8 +313,8 @@ node ./main.js --verbose=9 \
--id-s-chain=Bob \
--cid-main-net=-4 \
--cid-s-chain=-4 \
--abi-main-net=../proxy/data/proxyMainnet.json \
--abi-s-chain=../proxy/data/proxySchain_Bob.json \
--abi-main-net=../data/proxyMainnet.json \
--abi-s-chain=../data/proxySchain_Bob.json \
--key-main-net=[YOUR_ETH_PRIVATE_KEY] \
--key-s-chain=[YOUR_PRIVATE_KEY]
```
Expand All @@ -331,8 +332,8 @@ node ./main.js --verbose=9 \
--id-s-chain=Bob \
--cid-main-net=-4 \
--cid-s-chain=-4 \
--abi-main-net=../proxy/data/proxyMainnet.json \
--abi-s-chain=../proxy/data/proxySchain_Bob.json \
--abi-main-net=../data/proxyMainnet.json \
--abi-s-chain=../data/proxySchain_Bob.json \
--key-main-net=[YOUR_ETH_PRIVATE_KEY] \
--key-s-chain=[YOUR_PRIVATE_KEY]
```
Expand All @@ -350,8 +351,8 @@ node ./main.js --verbose=9 \
--id-s-chain=Bob \
--cid-main-net=-4 \
--cid-s-chain=-4 \
--abi-main-net=../proxy/data/proxyMainnet.json \
--abi-s-chain=../proxy/data/proxySchain_Bob.json \
--abi-main-net=../data/proxyMainnet.json \
--abi-s-chain=../data/proxySchain_Bob.json \
--key-main-net=[YOUR_ETH_PRIVATE_KEY] \
--key-s-chain=[YOUR_PRIVATE_KEY]
```
Expand Down Expand Up @@ -399,8 +400,8 @@ node ./main.js --verbose=9 \
--id-s-chain=Bob \
--cid-main-net=-4 \
--cid-s-chain=-4 \
--abi-main-net=../proxy/data/proxyMainnet.json \
--abi-s-chain=../proxy/data/proxySchain_Bob.json \
--abi-main-net=../data/proxyMainnet.json \
--abi-s-chain=../data/proxySchain_Bob.json \
--erc20-main-net=data-mn.json \
--erc20-s-chain=data-sc.json \
--key-main-net=[YOUR_ETH_PRIVATE_KEY] \
Expand Down Expand Up @@ -428,8 +429,8 @@ node ./main.js --verbose=9 \
--id-s-chain=Bob \
--cid-main-net=-4 \
--cid-s-chain=-4 \
--abi-main-net=../proxy/data/proxyMainnet.json \
--abi-s-chain=../proxy/data/proxySchain_Bob.json \
--abi-main-net=../data/proxyMainnet.json \
--abi-s-chain=../data/proxySchain_Bob.json \
--erc20-main-net=data-mn.json \
--erc20-s-chain=data-sc.json \
--address-main-net=[ADDRESS] \
Expand Down Expand Up @@ -536,8 +537,8 @@ reset; node ./main.js --verbose=9 \
--id-s-chain=Bob \
--cid-main-net=-4 \
--cid-s-chain=-4 \
--abi-main-net=../proxy/data/proxyMainnet.json \
--abi-s-chain=../proxy/data/proxySchain_Bob.json \
--abi-main-net=../data/proxyMainnet.json \
--abi-s-chain=../data/proxySchain_Bob.json \
--key-main-net=[YOUR_ETH_PRIVATE_KEY] \
--key-s-chain=[YOUR_PRIVATE_KEY] \
--sign-messages \
Expand All @@ -553,8 +554,8 @@ reset; node ./main.js --verbose=9 \
--id-s-chain=Bob \
--cid-main-net=-4 \
--cid-s-chain=-4 \
--abi-main-net=../proxy/data/proxyMainnet.json \
--abi-s-chain=../proxy/data/proxySchain_Bob.json \
--abi-main-net=../data/proxyMainnet.json \
--abi-s-chain=../data/proxySchain_Bob.json \
--key-main-net=[YOUR_ETH_PRIVATE_KEY] \
--key-s-chain=[YOUR_PRIVATE_KEY] \
--sign-messages \
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"test": "yarn tsc && npx hardhat test",
"tsc": "tsc --noEmit",
"slither": "slither .",
"fullcheck": "yarn lint && yarn tsc && yarn eslint && yarn slither",
"hooks": "git config core.hooksPath proxy/.githooks",
"fullCheck": "yarn lint && yarn tsc && yarn eslint && yarn slither",
"hooks": "git config core.hooksPath .githooks",
"no-hooks": "git config core.hooksPath .git/hooks"
},
"dependencies": {
Expand Down Expand Up @@ -50,6 +50,7 @@
"chai": "^4.2.0",
"chai-almost": "^1.0.1",
"chai-as-promised": "^7.1.1",
"cspell": "^8.14.4",
"eslint": "^8.46.0",
"ethereum-waffle": "^4.0.10",
"ganache": "7.9.2",
Expand Down
Loading

0 comments on commit 0d9acf1

Please sign in to comment.