Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
329 commits
Select commit Hold shift + click to select a range
8e45cdd
Update node-side-monitor.sh
oleksandrSydorenkoJ Jun 19, 2025
210e842
278-node-side-monitor-update: Add logs matcher for: CWT, TLWT, SBPT, …
andriy66 Jun 20, 2025
e2566ff
Update docker compose mirage template
dmytrotkk Jun 23, 2025
8b33dc7
Merge branch 'support-mirage-boot-building-from-sources' of github.co…
dmytrotkk Jun 23, 2025
2258c79
Merge pull request #116 from skalenetwork/node-side-monitor-update
dmytrotkk Jun 23, 2025
e61e2b5
Sync mirage compose for mirage_boot and mirage node_type
badrogger Jun 23, 2025
5397197
Update node-side-monitor.sh
oleksandrSydorenkoJ Jun 19, 2025
274ff78
Merge branch 'develop' into node-side-monitor-update
andriy66 Jun 23, 2025
9dc8164
Update docker compose mirage template
dmytrotkk Jun 23, 2025
c11ee65
Fix mirage contracts env
dmytrotkk Jun 23, 2025
836ae3f
Add playbook for deploying Mirage contracts
alexgex Jun 24, 2025
3a458b3
Merge branch 'support-mirage-boot-building-from-sources' into add-cre…
alexgex Jun 24, 2025
a5380e1
Save Mirage Contract Address to group vars
alexgex Jun 25, 2025
140e534
Remove unused IMA parameters
alexgex Jun 26, 2025
035746b
Add boot endpoint for transaction-manager
dmytrotkk Jun 27, 2025
fb7c434
Add `CHAIN_TYPE` variable
alexgex Jun 30, 2025
2a23182
Create a chain depending on its type
alexgex Jul 1, 2025
dea34b5
Deploy the Mirage manager only if node_type is set to "mirage_boot"
alexgex Jul 1, 2025
f106348
Run Mirage migrate only if node_type is set to "mirage"
alexgex Jul 1, 2025
4c69fe3
Merge pull request #114 from skalenetwork/support-mirage-boot-buildin…
dmytrotkk Jul 2, 2025
580c637
Add STET metric
andriy66 Jul 2, 2025
2d7b570
Apply code linting
alexgex Jul 2, 2025
58a31fb
Fix the indentation
alexgex Jul 2, 2025
9b9c21d
Refactor to remove `tasks_from` usage
alexgex Jul 2, 2025
f197055
Merge pull request #118 from skalenetwork/add-creating-schain
dmytrotkk Jul 2, 2025
c16f38d
Add playbook and script for deleting chain
alexgex Jul 3, 2025
2c8d533
Add playbook and modify script for deleting chains and nodes on contract
alexgex Jul 4, 2025
7a9fdf1
Improve naming
alexgex Jul 4, 2025
cd1f4f7
Fix naming
alexgex Jul 4, 2025
ba2ccb1
Replace `boot_endpoint` variable by `endpoint`
alexgex Jul 4, 2025
c0f890b
Add Mirage network creation instructions
alexgex Jul 4, 2025
a89db41
Update license headers
alexgex Jul 7, 2025
17dd419
Fix `boot_endpoint` usage
alexgex Jul 7, 2025
67c6ef6
Add cleanup tags
alexgex Jul 7, 2025
db4bdce
Fix tm env
dmytrotkk Jul 7, 2025
6bc5dd4
Fix config for MIRAGE
badrogger Jul 7, 2025
76d39a5
Merge pull request #119 from skalenetwork/add-chain-and-node-deleting…
dmytrotkk Jul 7, 2025
9703217
Add hotfix for zero node
dmytrotkk Jul 7, 2025
90c4f6c
Merge branch 'develop' of github.com:skalenetwork/node-provisioning i…
dmytrotkk Jul 7, 2025
fbcdc45
Merge branch 'develop' of github.com:skalenetwork/node-provisioning i…
alexgex Jul 7, 2025
b6e379e
Update readme
alexgex Jul 7, 2025
89758a1
Add setup Mirage nodes instructions
alexgex Jul 7, 2025
206a33a
Add playbook for regular Mirage node setup
alexgex Jul 7, 2025
c00693e
Fix zero node issue
alexgex Jul 10, 2025
0264c2f
Uncomment main playbooks
alexgex Jul 14, 2025
258f759
Fix Mirage node registration command
alexgex Jul 14, 2025
ae8d6d4
Transfer funds before Mirage node registration
alexgex Jul 14, 2025
fabb418
Merge pull request #121 from skalenetwork/add-mirage-creation-instruc…
dmytrotkk Jul 15, 2025
c16cb2d
Merge pull request #123 from skalenetwork/add-new-mirage-node-registe…
dmytrotkk Jul 15, 2025
c07c5ae
Mirage to Fair renaming
dmytrotkk Jul 15, 2025
a9770c4
Update README.md
dmytrotkk Jul 15, 2025
cc31b5a
Merge pull request #124 from skalenetwork/fair-naming
dmytrotkk Jul 15, 2025
53abd13
Update skale.py, fix script
dmytrotkk Jul 15, 2025
fd68253
Uncomment tasks for funds transfer preparation
alexgex Jul 16, 2025
f3cbf60
Set default value for `fair_contracts` variable
alexgex Jul 16, 2025
b7b0012
Add `set_rng` script
alexgex Jul 16, 2025
e9420b9
Uncomment transfer funds
dmytrotkk Jul 17, 2025
b4b3999
Execute `set_rng` script on localhost
alexgex Jul 24, 2025
f4a97d6
Fix typo
alexgex Jul 24, 2025
78d36f0
Move `rng_address` variable to constants
alexgex Jul 24, 2025
6eec03d
Bump skale.py to 7.3.dev1
alexgex Jul 24, 2025
3d7f85e
Run `set_rng` script without sudo
alexgex Jul 24, 2025
11f0f9f
Add license info
alexgex Jul 24, 2025
7e34ae9
Merge branch 'develop' of github.com:skalenetwork/node-provisioning i…
alexgex Jul 25, 2025
6406f72
Add script for generating valid random IP address
alexgex Jul 27, 2025
8a4eaeb
Add a task for changing Fair node IP address
alexgex Jul 27, 2025
1d9e188
Run `change_ip` task for Fair nodes only
alexgex Jul 28, 2025
13fcbb3
Delete empty lines
alexgex Jul 28, 2025
7d359c1
Update README.md
dmytrotkk Jul 28, 2025
fbb869b
Merge pull request #126 from skalenetwork/set-rng
dmytrotkk Jul 29, 2025
0302952
Fix docker-compose-fair.yml template
badrogger Jul 29, 2025
cd889ea
Merge pull request #128 from skalenetwork/fix-compose-template
dmytrotkk Jul 29, 2025
fe64660
Fix cleanup
badrogger Jul 29, 2025
2542e87
Fix create_chain.py
badrogger Jul 29, 2025
1e37462
Merge branch 'develop' of github.com:skalenetwork/node-provisioning i…
alexgex Jul 30, 2025
6a69691
Add explorer url for fair manager deployment
dmytrotkk Jul 30, 2025
9999c67
Merge pull request #127 from skalenetwork/add-change-ip-functionality
dmytrotkk Jul 30, 2025
7d312ad
Merge branch 'develop' into fix-cleanup
badrogger Jul 30, 2025
1ad5576
Rename container configs stream to node version
dmytrotkk Jul 31, 2025
e9f9ef7
Merge branch 'develop' of github.com:skalenetwork/node-provisioning i…
dmytrotkk Jul 31, 2025
cf45b39
Update helper-scripts
dmytrotkk Aug 5, 2025
d9b59f2
Merge pull request #117 from skalenetwork/node-side-monitor-update
oleksandrSydorenkoJ Aug 8, 2025
d56c6c5
Add skale network type to watchdog
dmytrotkk Aug 9, 2025
0fd8cb6
Merge branch 'develop' of github.com:skalenetwork/node-provisioning i…
dmytrotkk Aug 9, 2025
3fe081c
Add passive node support
dmytrotkk Aug 11, 2025
7bc51f2
Rename fair passive node services
dmytrotkk Aug 11, 2025
2f0e747
Add fixes for passive node
dmytrotkk Aug 12, 2025
21ba712
Remove separate file for fair passive node
dmytrotkk Aug 14, 2025
3cca8c9
Set `SGX_SERVER_URL` depending on node type
alexgex Aug 17, 2025
73e4983
Bump skale.py version to 7.3.dev8
alexgex Aug 18, 2025
9f41c3d
Add script for registering FAIR passive nodes
alexgex Aug 18, 2025
f9b307c
Update .gitignore
alexgex Aug 18, 2025
70bc1fc
Add playbook and role for registering passive nodes
alexgex Aug 18, 2025
d7e6505
Sort imports
alexgex Aug 18, 2025
e28aa96
Build two binary types only
alexgex Aug 18, 2025
88bdde9
Support FAIR passive nodes init
alexgex Aug 19, 2025
e5b923f
Fix naming
alexgex Aug 19, 2025
a042561
Fix endpoint and IP retrieval from inventory
alexgex Aug 19, 2025
04d3838
Return back the utf-8 coding string (fix for running Python scripts)
alexgex Aug 19, 2025
3cdca01
Merge pull request #129 from skalenetwork/fix-cleanup
dmytrotkk Aug 20, 2025
294fd6c
Merge branch 'develop' into add-passive-node-support
dmytrotkk Aug 20, 2025
e9dba10
Merge pull request #132 from skalenetwork/add-passive-node-support
dmytrotkk Aug 21, 2025
6354094
Rename disk mountpoint
dmytrotkk Aug 21, 2025
f62a728
Add `fair passive-node cleanup` command
alexgex Aug 26, 2025
3073f34
Remove unused `Set sgx url` task
alexgex Aug 26, 2025
3467115
Always run fix node id
badrogger Aug 27, 2025
de797cf
Merge pull request #135 from skalenetwork/add-fair-passive-node-cleanup
alexgex Aug 27, 2025
999c4d5
Merge pull request #136 from skalenetwork/always-run-fix-node-id
badrogger Aug 27, 2025
894bcbd
Update docker compose fair template
dmytrotkk Aug 29, 2025
a03e7d8
Merge branch 'develop' of github.com:skalenetwork/node-provisioning i…
dmytrotkk Aug 29, 2025
9a21883
Update container names
dmytrotkk Sep 3, 2025
3632a1c
Merge pull request #138 from skalenetwork/update-container-names
dmytrotkk Sep 5, 2025
21d76a9
Minor improvements
badrogger Sep 15, 2025
d06592d
Merge pull request #139 from skalenetwork/minor-improvements
dmytrotkk Sep 15, 2025
91edbb1
Run `backup_schains.yaml` for SKALE nodes only
alexgex Sep 16, 2025
ca1cf32
Update node backup to support FAIR nodes
alexgex Sep 16, 2025
0320ac9
Revert to import
alexgex Sep 16, 2025
96e5eb9
Remove unused variable
alexgex Sep 16, 2025
4e0a09a
Fix including
alexgex Sep 16, 2025
7e34dbd
Run schain backup for SKALE nodes only
alexgex Sep 16, 2025
6184e50
Run `node_backup` and `node_restore` roles if node_type in ['skale', …
alexgex Sep 17, 2025
68a1d61
Replace `include` by `import_tasks`
alexgex Sep 17, 2025
553b52c
Clear code
alexgex Sep 17, 2025
4149f4f
Update node restoring procedure to support FAIR nodes
alexgex Sep 17, 2025
e5df02e
Refactor code
alexgex Sep 17, 2025
ba84107
Validate `node_type` before running `restore_chain` playbook
alexgex Sep 17, 2025
96fa549
Remove compounded 'backup' and 'restore' playbooks
alexgex Sep 17, 2025
d5f0489
Merge pull request #141 from skalenetwork/support-backup-and-restore-…
dmytrotkk Sep 18, 2025
86e705b
Move `deploy_fair` to a separate role
alexgex Sep 18, 2025
d0f012a
Addd python script for whitelisting and staking fair boot nodes
alexgex Sep 18, 2025
b3b4e6b
Addd the new role for whitelisting and staking fair boot nodes
alexgex Sep 18, 2025
de59e5f
Refactor code
alexgex Sep 18, 2025
ab682fe
Fix node_id type
alexgex Sep 18, 2025
3f23b0c
Sort imports
alexgex Sep 18, 2025
db00a63
Use sys.exit(1) instead of return and write errors to stderr for Ansible
alexgex Sep 19, 2025
197c4a2
Do not use `init_default_logger`
alexgex Sep 19, 2025
dd7a2d1
Remove extra logging
alexgex Sep 19, 2025
ef9db13
Use yaml callback to make Ansible output more compact and clear
alexgex Sep 19, 2025
7da0769
Remove ansible.cfg from .gitignore
alexgex Sep 19, 2025
5cfa9a6
Add `snapshot` parameter for FAIR nodes
alexgex Sep 22, 2025
24c477f
Decrease WEI_AMOUNT to 1 wei
alexgex Sep 23, 2025
0a964f3
Merge pull request #143 from skalenetwork/whitelist-and-stake-after-f…
dmytrotkk Sep 24, 2025
d05b83d
Add `deploy_fair` and `whitelist_and_stake` tags
alexgex Sep 24, 2025
d8ad602
Merge pull request #145 from skalenetwork/whitelist-and-stake-after-f…
dmytrotkk Sep 24, 2025
da179ab
Bump skale.py version to 7.4dev6
alexgex Sep 25, 2025
77114aa
Temporary comment `set_rng`
alexgex Sep 25, 2025
2e89187
Set `ALLOWED_TS_DIFF` to -1 to use anvil without `--block-time` param…
alexgex Sep 25, 2025
6097a97
Temporary comment `wait_for_next_block` to support anvil
alexgex Sep 26, 2025
c7f40f1
Add anvil support to `transfer_funds` script
alexgex Sep 29, 2025
a05519c
Add the role for transferring funds before deploying to anvil
alexgex Sep 29, 2025
9d689a1
Set and use `allowed_ts_diff` variable
alexgex Sep 29, 2025
8ecf8c1
Uncomment `Execute set_rng script` task
alexgex Sep 29, 2025
c951fb1
Cleanup group_vars `fair_contracts` and `allowed_ts_diff`
alexgex Sep 29, 2025
11611c4
Set endpoint for anvil
alexgex Sep 30, 2025
df41064
Improve updating `group_vars/all`
alexgex Sep 30, 2025
a349454
Save `allowed_ts_diff` to group vars
alexgex Sep 30, 2025
e1ae5c5
Run anvil container
alexgex Sep 30, 2025
bbb9e68
Add tasks dor running anvil to `deploy_contracts` role
alexgex Sep 30, 2025
f350bab
Change anvil image and make container available from outside
alexgex Sep 30, 2025
9eaca8b
Publish endpoint to all nodes for subsequent plays
alexgex Sep 30, 2025
faf4213
Improve updating `group_vars/all`
alexgex Sep 30, 2025
7322074
Import new playbook for running anvil
alexgex Sep 30, 2025
e9870c6
Run anvil container on the first node from host file
alexgex Sep 30, 2025
0785386
Update helper-scripts submodule
dmytrotkk Oct 2, 2025
5514351
Merge branch 'develop' of github.com:skalenetwork/node-provisioning i…
dmytrotkk Oct 2, 2025
54f67f3
Add quotes for contract addresses and private key
alexgex Oct 2, 2025
550e124
Set anvil endpoint
alexgex Oct 2, 2025
b4de295
Stop and remove anvil container
alexgex Oct 2, 2025
29e38f5
Delete extra anvil endpoint publishing
alexgex Oct 3, 2025
73396c4
Add new playbook for complete FAIR nodes setup
alexgex Oct 3, 2025
235ca96
Comment `Execute set_rng script` task
alexgex Oct 3, 2025
0fd84f1
Set node_type to "fair" before migration process
alexgex Oct 3, 2025
2f5757a
Change node_type to "fair" before migration process
alexgex Oct 3, 2025
78810b3
Wait for chain to start on boot nodes
alexgex Oct 3, 2025
962a0ed
Publish `fair_contracts` variable to all nodes for subsequent plays
alexgex Oct 3, 2025
f5b2c17
Change anvil docker image and set up memory limit to Gb
alexgex Oct 3, 2025
b5ca2ce
Turn on anvil detailed logging
alexgex Oct 3, 2025
bd7ba05
Merge branch 'develop' of github.com:skalenetwork/node-provisioning i…
dmytrotkk Oct 6, 2025
765b3d9
Update local cleanup
alexgex Oct 6, 2025
93ebd30
Add `--block-time` parameter and increase anvil log level
alexgex Oct 6, 2025
9e5870f
Merge branch 'add-local-anvil-setup' of github.com:skalenetwork/node-…
dmytrotkk Oct 7, 2025
fcf5dde
Enable anvil state saving and disable auto mining
alexgex Oct 7, 2025
c049e34
Remove anvil state directory
alexgex Oct 7, 2025
d6c5ff9
Merge remote-tracking branch 'origin/add-local-anvil-setup' into add-…
alexgex Oct 7, 2025
3b00f10
Enable `set_rng` with `skip_dry_run=True`
alexgex Oct 7, 2025
4b73c88
Add new role for setting up `node_type` variable to 'fair_boot'
alexgex Oct 10, 2025
914e60d
Add new playbook for setting up `node_type` variable to 'fair_boot'
alexgex Oct 10, 2025
bd95070
Remove node_type from group_vars/all after FAIR migrating
alexgex Oct 10, 2025
05956cc
Update cleaning `group_vars/all`
alexgex Oct 10, 2025
cfb3358
Fix setting `node_type` to 'fair_boot'
alexgex Oct 10, 2025
8aa2cf5
Bump anvil docker image version to v1.4.0
alexgex Oct 13, 2025
9dbf178
Delete commented lines
alexgex Oct 13, 2025
08a60c3
Fix Removing `node_type` from 'group_vars/all' on localhost
alexgex Oct 13, 2025
4d79705
Add `become: false` to avoid using `sudo`
alexgex Oct 13, 2025
d1e858b
Wait for next block to be mined if ALLOWED_TS_DIFF > 0 (not anvil setup)
alexgex Oct 13, 2025
4ce7dd0
Bump `skale.py` version to 7.6dev5
alexgex Oct 28, 2025
1c75cc4
Merge pull request #146 from skalenetwork/add-local-anvil-setup
alexgex Oct 28, 2025
7a51aed
Do not run `Hotfix for zero node` for SKALE nodes
alexgex Oct 30, 2025
fa890f7
Fix tasks for removing containers
alexgex Oct 30, 2025
18c2f7b
Set default value for `boot_endpoint`
alexgex Oct 31, 2025
d2dbfb6
Transfer env variable `ALLOWED_TS_DIFF` to transfer_funds.py
alexgex Oct 31, 2025
18fd8b4
Turn on anvil auto mining when `node_type` == 'skale'
alexgex Oct 31, 2025
45c17f7
Import playbook `create_chain.yaml`
alexgex Oct 31, 2025
dbbfeb5
Rename main.yaml to main_skale.yaml
alexgex Oct 31, 2025
58fa8e0
Rename main FAIR and SKALE playbooks
alexgex Nov 3, 2025
eea9cef
Add cleanup `command_prefix` for SKALE nodes
alexgex Nov 5, 2025
d0ee73d
Update docker-compose files to match `skale-node`
alexgex Nov 5, 2025
408e0a6
Check if node is Passive
alexgex Nov 5, 2025
c206c56
Delete unused playbook 'nodes.yaml'
alexgex Nov 5, 2025
0c21b72
Force removing old binary builder image
alexgex Nov 24, 2025
26ea769
Fix passive node skale
dmytrotkk Dec 26, 2025
833cfef
Merge pull request #148 from skalenetwork/fix-skale-node-support
dmytrotkk Dec 30, 2025
eee515d
Run docker-lvmpy cleanup for active nodes only
alexgex Jan 5, 2026
dccfda0
Check if docker-lvmpy service exists
alexgex Jan 5, 2026
001c2c9
Use l2.py as unified entry point for active/passive modes of SKALE node
alexgex Jan 6, 2026
983726e
Bump redis docker image version to 8.4.0-alpine
alexgex Jan 6, 2026
2016430
Remove passive/active mode check for docker-lvmpy cleanup
alexgex Jan 6, 2026
bd192b6
Add `SKALE_LIB_PATH` mount for passive nodes
alexgex Jan 6, 2026
0f663b1
Update admin service command to support passive node mode
alexgex Jan 7, 2026
4b5c38f
Set permissions for redis data directory (temperory solution)
alexgex Jan 8, 2026
71ffd99
Don't wait sgx certs exchange for passive nodes
alexgex Jan 8, 2026
38cd206
Add `SKALE_LIB_PATH` mount for api container
alexgex Jan 8, 2026
7bcaf25
Remove permissions for redis data directory (implemented in node-cli)
alexgex Jan 8, 2026
3d6de7d
Delete unused 'CONFIRMATION_BLOCKS'
alexgex Jan 8, 2026
53436a6
Add skale_node_passive.yaml for skale passive nodes provisioning
alexgex Jan 8, 2026
cdbffc1
Delete unused docker-compose-passive.yml.j2
alexgex Jan 16, 2026
a0c0d11
Delete `docker-compose-passive file sync` task
alexgex Jan 22, 2026
ddcd12d
Add `BITE` variable
alexgex Jan 23, 2026
d1f7f27
Add `BITE` variable for SKALE sync node
alexgex Jan 25, 2026
704f12f
Bump filebeat version to 9.1.5
alexgex Feb 2, 2026
c021c55
Clean anvil
alexgex Feb 2, 2026
95a7ffe
update node provisioning - new settings structure
dmytrotkk Feb 17, 2026
50621c4
Merge pull request #152 from skalenetwork/update-settings-structure
dmytrotkk Feb 17, 2026
913bf98
update admin entrypoint
dmytrotkk Feb 19, 2026
b90e9e6
remove docker compose passive
dmytrotkk Feb 19, 2026
43f1425
Merge pull request #154 from skalenetwork/update-settings-structure
dmytrotkk Feb 19, 2026
798ccf1
add bite option to init-env
dmytrotkk Feb 24, 2026
189b236
Merge branch 'develop' of github.com:skalenetwork/node-provisioning i…
dmytrotkk Feb 24, 2026
7e143b8
Merge pull request #155 from skalenetwork/update-settings-structure
dmytrotkk Feb 24, 2026
318ab2f
add settings volume to watchdog
dmytrotkk Feb 25, 2026
d92a052
Merge pull request #156 from skalenetwork/update-settings-structure
dmytrotkk Feb 25, 2026
2e73379
Bump skale.py version to 7.11dev6
alexgex Feb 26, 2026
c700b37
Create schain with new gas price parameters
alexgex Feb 26, 2026
04b8302
Merge remote-tracking branch 'origin/develop' into merge-skale-active…
alexgex Feb 26, 2026
b9359df
Rename inventory variable `schain_name` to 'chain_name'
alexgex Feb 26, 2026
5d13948
Update inventory template
alexgex Feb 26, 2026
35d227d
Reorganize inventory template
alexgex Feb 27, 2026
1506396
Fix template
badrogger Mar 4, 2026
4fcb563
Merge pull request #158 from skalenetwork/template-fix
dmytrotkk Mar 4, 2026
211a317
Merge pull request #157 from skalenetwork/merge-skale-active-and-pass…
dmytrotkk Mar 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[flake8]
max-line-length = 100
exclude = .git,__pycache__,docs/source/conf.py,old,build,dist,venv,.venv,node_modules,helper-scripts
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,19 @@ wallets/*
# ansible
skale-nodes/ansible/my-inventory
skale-nodes/ansible/inventory/
skale-nodes/ansible/inventory*
skale-nodes/ansible/files/base-key*.txt
skale-nodes/ansible/files/dev*
skale-nodes/ansible/files/authorized_keys
skale-nodes/ansible/files/validator-id*.txt
skale-nodes/ansible/terraform/do/hosts
skale-nodes/ansible/terraform/aws/hosts*
skale-nodes/ansible/ansible.cfg
skale-nodes/ansible/sgx/ansible.cfg

skale-nodes/ansible/files/base-key.txt
skale-nodes/ansible/files/validator-key.txt
skale-nodes/ansible/files/validator-id.txt
skale-nodes/ansible/files/passive-id.txt

skale-nodes/ansible/files/cert.pem
skale-nodes/ansible/files/privkey.pem
Expand Down Expand Up @@ -54,3 +55,4 @@ bare-metal/ansible/files/restart_vm*
bare-metal/ansible/conf*

skale-nodes/ansible/group_vars/all
skale-nodes/ansible/roles/base_provision/files/files/authorized_keys
65 changes: 63 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
# SKALE Node Provisoning
# SKALE and Fair Node Provisioning

[![Discord](https://img.shields.io/discord/534485763354787851.svg)](https://discord.gg/vvUtWJB)

This repo will help deploy and register multiple SKALE nodes in the cloud automatically.
This repo will help deploy and register multiple SKALE and Fair nodes in the cloud automatically.

NOTE: This is for QA and testing purposes only.

- [Fair Node Provisoning](#fair-node-provisoning)
- [Fair network creating](#fair-network-creating)
- [Setup Fair boot nodes](#1-prepare-inventory)
- [Prepare inventory](#2-setup-fair-boot-nodes)
- [Create schain](#3-create-schain)
- [Deploy Fair contracts](#4-deploy-fair-contracts)
- [Migrate Fair boot nodes](#5-migrate-fair-boot-nodes)
- [Setup Fair nodes](#6-setup-fair-nodes)

- [SKALE Node Provisoning](#skale-node-provisoning)
- [Host requirements](#host-requirements)
- [Supported providers](#supported-providers)
Expand All @@ -21,6 +30,57 @@ NOTE: This is for QA and testing purposes only.
- [Run main script without IMA deployment](#run-main-script-without-ima-deployment)
- [Run skaled monitor](#run-skaled-monitor)


# Fair Node Provisioning

## Fair network creation

### 1. Prepare inventory
1) Set `node_type=fair_boot`
2) Set `build_type=git` (to use Docker image versions specified in the corresponding branch of the
`skale-node` repository on GitHub), or `build_type=source` (to build from source). In the second
case, set the appropriate local paths to the required cloned repositories and set
`container_configs_dir` variable (usually it's `/root/skale-node`).
3) Don't forget to set all other necessary variables like `eth_private_key`, `endpoint`, etc.

### 2. Setup Fair boot nodes
```bash
ansible-playbook -i inventory main.yaml
```
The following playbooks are processed here: _deploy_contracts.yaml, sgx_sim.yaml, setup.yaml,
validator.yaml, signature.yaml, link_addresses.yaml, register.yaml_

### 3. Create schain
1) Set the schain name (it must match the name specified in the `fair_static_params.yaml` file for
the corresponding network in the relevant branch of the `skale-node` repository). For example, for
the **devnet**, the typical name is `fair-devnet1`.
2) Set the desired `chain_type` (for example, LARGE4 - for 4-nodes chain )
3) Run the following playbook:
```bash
ansible-playbook -i inventory create_chain.yaml
```
### 4. Deploy Fair contracts
1) Set `fair_tag` variable (Fair manager version)
2) Set `boot_endpoint` variable (endpoint of schain that was created before)
3) Run the following playbook:
```bash
ansible-playbook -i inventory deploy_fair_manager.yaml
```
### 5. Migrate Fair boot nodes
1) Set `node_type=fair`
2) Run the following playbook:
```bash
ansible-playbook -i inventory fair_migrate.yaml
```
### 6. Setup Fair nodes
1) Set `node_type=fair`
2) Run the following playbook:
```bash
ansible-playbook -i inventory main_fair.yaml
```

# SKALE Node Provisioning

## Host requirements

- Terraform >= 0.12
Expand Down Expand Up @@ -177,3 +237,4 @@ bash utils/generate_hosts.sh
```bash
ansible-playbook -i inventory run_monitor.yaml
```

2 changes: 1 addition & 1 deletion bare-metal/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ When Vagrant provision is completed `hosts` file will be created in `bare-metal/
ansible-playbook -i inventory -v main.yaml
```

Default `DISK_MOUNTPOINT` for VirtualBox VMs: `/dev/sdb`
Default `BLOCK_DEVICE` for VirtualBox VMs: `/dev/sdb`

## Destroy machines

Expand Down
4 changes: 4 additions & 0 deletions ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
line-length = 100

[format]
quote-style = "single"
4 changes: 4 additions & 0 deletions skale-nodes/ansible/ansible.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[defaults]
host_key_checking = False
stdout_callback = yaml
inventory = ./inventory
2 changes: 1 addition & 1 deletion skale-nodes/ansible/archive.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
roles:
- role: sync
tags: sync
when: env is defined and env == "dev"
when: build_type == "source"

- role: skale_cli
tags: cli
Expand Down
2 changes: 0 additions & 2 deletions skale-nodes/ansible/backup.yaml

This file was deleted.

9 changes: 5 additions & 4 deletions skale-nodes/ansible/backup_nodes.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
- name: Backup node
- name: Backup SKALE or FAIR nodes
hosts: nodes
vars:
- ip_address: "{{ hostvars[inventory_hostname].ansible_host }}"

roles:
- node_backup
- role: node_backup
when: node_type is defined and node_type in ['skale', 'fair']
tags: backup_node
12 changes: 11 additions & 1 deletion skale-nodes/ansible/backup_schains.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
- name: Fetch schain nodes script
hosts: localhost
connection: local
gather_facts: false
serial: True

tasks:
- name: Validate node_type
fail:
msg: >
The 'node_type' variable must be defined and set to 'skale' for sChain backup.
Current value: '{{ node_type | default('undefined') }}'
when: node_type is not defined or node_type != 'skale'

- name: Run fetch schain nodes script
script: fetch_node_schains.py -u
environment:
ETH_PRIVATE_KEY: "{{ eth_private_key }}"
ENDPOINT: "{{ endpoint }}"
MANAGER_CONTRACTS: "{{ manager_contracts }}"
BASE_DIR: "files"
args:
executable: python3
Expand All @@ -31,7 +41,7 @@
node_schains: "{{ hostvars['localhost'].node_schains }}"

- name: Make snapshot
include: tasks/schains_backup.yaml
include_tasks: tasks/schains_backup.yaml
vars:
schains: "{{ node_schains[ip_address] }}"
when: ip_address in node_schains
6 changes: 6 additions & 0 deletions skale-nodes/ansible/cleanup_contracts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- name: Cleanup contracts from chains and nodes
hosts: 127.0.0.1
connection: local
roles:
- role: cleanup_contracts
tags: cleanup_contracts
2 changes: 1 addition & 1 deletion skale-nodes/ansible/cleanup_sgx.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- name: Cleanup sgx
hosts: sgx
hosts: sgx,nodes
become: true
roles:
- name: Remove all sgx skale software from the machines
Expand Down
7 changes: 7 additions & 0 deletions skale-nodes/ansible/create_chain.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- name: Create chain on SKALE or Fair nodes
hosts: 127.0.0.1
connection: local
roles:
- role: create_chain
tags:
- create_chain
7 changes: 7 additions & 0 deletions skale-nodes/ansible/delete_chain.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- name: Delete chain on SKALE or Fair nodes
hosts: 127.0.0.1
connection: local
roles:
- role: delete_chain
tags:
- delete_chain
14 changes: 14 additions & 0 deletions skale-nodes/ansible/deploy_fair_manager.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
- name: Deploy Fair manager contracts
hosts: 127.0.0.1
connection: local
pre_tasks:
- name: Fail if node_type is not 'fair_boot'
fail:
msg: "Stopping playbook. This play requires node_type to be 'fair_boot', but it is '{{ node_type }}'."
when: node_type != "fair_boot"
roles:
- role: deploy_fair
tags:
- deploy_fair


19 changes: 19 additions & 0 deletions skale-nodes/ansible/fair_migrate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
- name: Migrate Fair boot node to regular Fair node
hosts: nodes
become: true
pre_tasks:
- name: Set node_type to fair for migration
set_fact:
node_type: "fair"
when: node_type is defined and node_type == 'fair_boot'

roles:
- role: sync
when: build_type == "source"
tags: sync

- role: config
tags: config

- role: fair_migrate
tags: fair_migrate
4 changes: 4 additions & 0 deletions skale-nodes/ansible/fair_node.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- import_playbook: sgx_sim.yaml
- import_playbook: setup.yaml
- import_playbook: transfer_funds.yaml
- import_playbook: register.yaml
2 changes: 2 additions & 0 deletions skale-nodes/ansible/fair_node_passive.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- import_playbook: register_passive_fair.yaml
- import_playbook: setup.yaml
12 changes: 12 additions & 0 deletions skale-nodes/ansible/fair_pipeline.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
- import_playbook: set_fair_boot_node_type.yaml
- import_playbook: run_anvil.yaml
- import_playbook: deploy_contracts.yaml
- import_playbook: sgx_sim.yaml
- import_playbook: setup.yaml
- import_playbook: validator.yaml
- import_playbook: signature.yaml
- import_playbook: link_addresses.yaml
- import_playbook: register.yaml
- import_playbook: create_chain.yaml
- import_playbook: deploy_fair_manager.yaml
- import_playbook: fair_migrate.yaml
62 changes: 42 additions & 20 deletions skale-nodes/ansible/files/cleanup_contracts.py
Original file line number Diff line number Diff line change
@@ -1,49 +1,71 @@
import logging
import os
import sys
from eth_typing import HexStr

from skale import Skale
from skale import SkaleManager
from skale.wallets import Web3Wallet
from skale.utils.web3_utils import init_web3
from skale.utils.helper import init_default_logger
from skale.utils.contracts_provision.main import cleanup_nodes

logger = logging.getLogger(__name__)
init_default_logger()

BASE_DIR = os.getenv('BASE_DIR')
ENDPOINT = os.getenv('ENDPOINT')
ABI_FILEPATH = os.path.join(BASE_DIR, 'manager.json')
MANAGER_CONTRACTS = os.getenv('MANAGER_CONTRACTS')
ETH_PRIVATE_KEY = os.getenv('ETH_PRIVATE_KEY')

web3 = init_web3(ENDPOINT)
wallet = Web3Wallet(ETH_PRIVATE_KEY, web3)
skale = Skale(ENDPOINT, ABI_FILEPATH, wallet)

def init_skale_manager(
endpoint: str, alias_or_address: str, eth_private_key: HexStr
) -> SkaleManager:
web3 = init_web3(endpoint)
wallet = Web3Wallet(eth_private_key, web3)
return SkaleManager(endpoint, alias_or_address, wallet)

def remove_active_nodes():
for node_id in skale.nodes.get_active_node_ids():
skale.manager.node_exit(node_id, wait_for=True)

def remove_active_nodes(skale):
logger.info('Removing all active nodes...')
cleanup_nodes(skale)
logger.info('Finished removing active nodes')


def get_all_schains_names(skale):
schains_ids = skale.schains_internal.get_all_schains_ids()
print(schains_ids)
names = [
skale.schains.get(sid).get('name')
for sid in schains_ids
]
logger.info(f'Found chain IDs: {schains_ids}')
names = [skale.schains.get(sid).name for sid in schains_ids]
return names


def remove_all_schains():
def remove_all_schains(skale):
logger.info('Removing all chains...')
schain_names = get_all_schains_names(skale)
if not schain_names:
logger.info('No chains found to remove')
return
for name in schain_names:
logger.info(f'Deleting chain: {name}')
skale.manager.delete_schain(name, wait_for=True)
logger.info('Finished removing chains')


def cleanup():
remove_all_schains()
remove_active_nodes()
def cleanup(skale):
remove_all_schains(skale)
remove_active_nodes(skale)


if __name__ == "__main__":
cleanup()
if __name__ == '__main__':
skale = init_skale_manager(ENDPOINT, MANAGER_CONTRACTS, HexStr(ETH_PRIVATE_KEY))
if len(sys.argv) > 1:
action = sys.argv[1]
if action == 'remove_chains':
remove_all_schains(skale)
elif action == 'remove_nodes':
remove_active_nodes(skale)
else:
logger.error(f'Unknown action: {action}. Please use "remove_chains" or "remove_nodes"')
sys.exit(1)
else:
logger.info('No action specified, running full cleanup')
cleanup(skale)
Loading
Loading