Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
31 changes: 31 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Validate node templates

on:
pull_request:
push:
branches: [master]

permissions:
contents: read

jobs:
validate:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install static-analysis tools
run: sudo apt-get update && sudo apt-get install -y shellcheck
- name: Validate role profiles and scripts
run: scripts/validate.sh
- name: Install verified TelosZero Core package
run: |
curl -fLO https://github.com/telosnetwork/teloszero-core/releases/download/teloszero-v1.2.2/teloszero-core_1.2.2_amd64.deb
echo '285fdfc1abde5104892d94b1f380c6d79aba35eac3413f139119ea88574c5007 teloszero-core_1.2.2_amd64.deb' | sha256sum --check --strict
sudo apt-get install -y ./teloszero-core_1.2.2_amd64.deb
- name: Check shell and systemd files
run: |
shellcheck -x start.sh stop.sh tests/test-runner.sh scripts/render-config.sh scripts/validate.sh scripts/smoke-nodeos.sh
sudo useradd --system --home-dir /var/lib/telos --shell /usr/sbin/nologin telos 2>/dev/null || true
systemd-analyze verify systemd/telos-nodeos@.service
- name: Parse every profile with TelosZero
run: scripts/smoke-nodeos.sh
17 changes: 14 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
data
protocol_features
data/
protocol_features/
genesis.json
node-template.log
nodeos.log
nodeos.pid
nohup.out
.idea
.idea/

# Never commit local producer/finalizer secrets or safety state.
*.private.ini
*.secrets
*.key
*.keys
finalizer-*.txt
finalizers/
safety.dat
.nodeos-start.lock/
143 changes: 21 additions & 122 deletions DEV_SETUP.md
Original file line number Diff line number Diff line change
@@ -1,122 +1,21 @@
# Local Dev Network Tutorial


__Clone the node template repo at the root of this directory and follow along to learn how to create a local AntelopeIO developer network.__


Set LOCALIZE_LOG=true in node_config and set the nodeos and cleos binaries to be the name of the binary without a specific path:
```
BUILD_ROOT="/path/to/binaries/2.0.4"
CLIENT_BIN="cleos"
NODEOS_BIN="nodeos"
CPU="0"
LOCALIZE_LOG=true
```
Don't bother with the directories setup, with the log localized, the whole node will be contained within this `node-template` repo's directory


To reset the node, either remove or rename the `data` directory

First, generate a key pair to use for this local network's `eosio` super-user account. **NOTE** SAVE THESE KEYS for creating system accounts at bottom
```bash
cleos create key --to-console
```

Create a dev wallet, save this password:
```bash
cleos wallet create -n dev --to-console
```

Import the key into cleos, paste the private key when prompted:
```bash
cleos wallet import -n dev
```

Then generate a new `genesis.json` file
```bash
nodeos --extract-genesis-json genesis.json
```

Edit the genesis.json and set the `initial_key` to the key that you generated above for `zzzz`:
```bash
vi genesis.json
```

Edit the config.ini to configure this node to produce blocks as `eosio`
```bash
vi config.ini
```
and change these two, seting the key to be the one you generated above
```
producer-name = eosio
signature-provider = EOS6nrS...=KEY:5HxQ...
```
Also, uncomment the producer API plugin
```
plugin = eosio::producer_api_plugin
```

Start the node for the first time
```bash
./start.sh --enable-stale-production --genesis-json genesis.json
```

Observe it is now producing blocks, change the name of the log file depending if you renamed this repo directory
```bash
tail -f node-template.log
```

Stop the node
```bash
./stop.sh
```

Start the node in dev mode, this is how you will start the node from now on:
```bash
./start.sh --enable-stale-production
```
## Create system accounts
Now make sure that you have your key pair that we initialized in the beginning of tutorial.

If you want to double check your using the right key in your wallet simply run the command:
```bash
cleos wallet private_keys -n <YourWalletName>
```


```bash
Instructions for Cleos create account(Usage: cleos create account [OPTIONS] creator name OwnerKey [ActiveKey])


cleos create account eosio eosio.token <OwnerKey> <ActiveKey>
cleos create account eosio eosio.bpay <OwnerKey> <ActiveKey>
cleos create account eosio eosio.vpay <OwnerKey> <ActiveKey>
cleos create account eosio eosio.msig <OwnerKey> <ActiveKey>
cleos create account eosio eosio.names <OwnerKey> <ActiveKey>
cleos create account eosio eosio.ram <OwnerKey> <ActiveKey>
cleos create account eosio eosio.ramfee <OwnerKey> <ActiveKey>
cleos create account eosio eosio.rex <OwnerKey> <ActiveKey>
cleos create account eosio eosio.saving <OwnerKey> <ActiveKey>
cleos create account eosio eosio.stake <OwnerKey> <ActiveKey>
```

## Deploy the token contract

NOTE: Can only create accounts using this command before the system contract is deployed, once it's deployed you must use `cleos system newaccount ...`
```bash
cleos create account eosio eosio.token <OwnerKey> <ActiveKey>
cd contracts/eosio.token
cleos set contract eosio.token . ./eosio.token.wasm ./eosio.token.abi
cleos push action eosio.token create '["eosio","100000000.0000 TLOS"]' -p eosio.token@active
cleos push action eosio.token issue '["eosio","100000000.0000 TLOS","Issue max supply to eosio"]' -p eosio@active
```



## Deploy the system contract
```bash
curl -X POST http://127.0.0.1:8888/v1/producer/schedule_protocol_feature_activations -d '{"protocol_features_to_activate": ["0ec7e080177b2c02b278d5088611686b49d739925a92d9bfcacd7fc6b74053bd"]}' | jq
cd contracts/eosio.system
cleos set contract eosio . ./eosio.system.wasm ./eosio.system.abi
cleos push action eosio init '[0,"4,TLOS"]' -p eosio@active
```
# Local development

The production profiles in this repository target existing Telos networks where
Savanna instant finality is already active. They are not a network-bootstrap
tutorial.

For local protocol, system-contract, or finalizer development, use the test
harness and bootstrap procedures from the exact tagged
[TelosZero Core source](https://github.com/telosnetwork/teloszero-core). Those
tests establish the required protocol features, system state, finalizer policy,
and BLS voting conditions; a single `--enable-stale-production` command does not.

`--enable-stale-production` is acceptable only on an isolated local chain that
cannot connect to mainnet or testnet. `start.sh` refuses it by default. To use it
for that isolated purpose, set `ALLOW_STALE_PRODUCTION=true` in `node_config` and
bind all HTTP/P2P listeners to loopback.

The compiled contract artifacts under `contracts/` are retained only for
historical compatibility. They predate the current Telos finalizer actions and
must not be deployed to Telos mainnet, testnet, or a current Savanna test network.
Build identified contract sources reproducibly instead.
Loading
Loading