Native contracts complete - all tests passing

This commit is contained in:
Tutus Development 2025-12-27 15:45:47 +00:00
parent a63b3dcb70
commit f006f1623c
1056 changed files with 603 additions and 603 deletions

0
.docker/tutus-entrypoint.sh Normal file → Executable file
View File

0
.github/workflows/build.yml vendored Normal file → Executable file
View File

0
CHANGELOG.md Normal file → Executable file
View File

0
README.md Normal file → Executable file
View File

0
ROADMAP.md Normal file → Executable file
View File

View File

@ -1,143 +1,143 @@
# Tutus Testnet Deployment Guide # Tutus Testnet Deployment Guide
## Overview ## Overview
This guide deploys two sovereign Tutus blockchain instances for testing: This guide deploys two sovereign Tutus blockchain instances for testing:
| Instance | Magic | Validators | RPC Port | Purpose | | Instance | Magic | Validators | RPC Port | Purpose |
|----------|-------|------------|----------|---------| |----------|-------|------------|----------|---------|
| Alpha | 88890 | 3 | 10332 | Primary test chain | | Alpha | 88890 | 3 | 10332 | Primary test chain |
| Beta | 88891 | 3 | 11332 | Bridge testing chain | | Beta | 88891 | 3 | 11332 | Bridge testing chain |
## Quick Start ## Quick Start
```bash ```bash
cd tutus/chain cd tutus/chain
# Build images (first time or after code changes) # Build images (first time or after code changes)
docker-compose build docker-compose build
# Start both instances (6 nodes total) # Start both instances (6 nodes total)
docker-compose up -d docker-compose up -d
# Check status # Check status
docker-compose ps docker-compose ps
# View logs # View logs
docker-compose logs -f alpha_one docker-compose logs -f alpha_one
docker-compose logs -f beta_one docker-compose logs -f beta_one
# Stop all nodes # Stop all nodes
docker-compose down docker-compose down
# Stop and remove all data (fresh start) # Stop and remove all data (fresh start)
docker-compose down -v docker-compose down -v
``` ```
## Starting Individual Instances ## Starting Individual Instances
```bash ```bash
# Alpha only (3 validators) # Alpha only (3 validators)
docker-compose up -d alpha_one alpha_two alpha_three docker-compose up -d alpha_one alpha_two alpha_three
# Beta only (3 validators) # Beta only (3 validators)
docker-compose up -d beta_one beta_two beta_three docker-compose up -d beta_one beta_two beta_three
``` ```
## RPC Endpoints ## RPC Endpoints
### Instance Alpha ### Instance Alpha
| Node | RPC | P2P | Prometheus | | Node | RPC | P2P | Prometheus |
|------|-----|-----|------------| |------|-----|-----|------------|
| alpha_one | http://localhost:10332 | :10333 | :2112 | | alpha_one | http://localhost:10332 | :10333 | :2112 |
| alpha_two | http://localhost:10342 | :10343 | :2122 | | alpha_two | http://localhost:10342 | :10343 | :2122 |
| alpha_three | http://localhost:10352 | :10353 | :2132 | | alpha_three | http://localhost:10352 | :10353 | :2132 |
### Instance Beta ### Instance Beta
| Node | RPC | P2P | Prometheus | | Node | RPC | P2P | Prometheus |
|------|-----|-----|------------| |------|-----|-----|------------|
| beta_one | http://localhost:11332 | :11333 | :2113 | | beta_one | http://localhost:11332 | :11333 | :2113 |
| beta_two | http://localhost:11342 | :11343 | :2123 | | beta_two | http://localhost:11342 | :11343 | :2123 |
| beta_three | http://localhost:11352 | :11353 | :2133 | | beta_three | http://localhost:11352 | :11353 | :2133 |
## Verify Nodes Are Running ## Verify Nodes Are Running
```bash ```bash
# Check Alpha block height # Check Alpha block height
curl -s -X POST http://localhost:10332 \ curl -s -X POST http://localhost:10332 \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"getblockcount","params":[],"id":1}' -d '{"jsonrpc":"2.0","method":"getblockcount","params":[],"id":1}'
# Check Beta block height # Check Beta block height
curl -s -X POST http://localhost:11332 \ curl -s -X POST http://localhost:11332 \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"getblockcount","params":[],"id":1}' -d '{"jsonrpc":"2.0","method":"getblockcount","params":[],"id":1}'
# Get native contracts # Get native contracts
curl -s -X POST http://localhost:10332 \ curl -s -X POST http://localhost:10332 \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"getnativecontracts","params":[],"id":1}' | jq '.result[].manifest.name' -d '{"jsonrpc":"2.0","method":"getnativecontracts","params":[],"id":1}' | jq '.result[].manifest.name'
``` ```
## Validator Configuration ## Validator Configuration
### Instance Alpha Committee ### Instance Alpha Committee
Uses wallet1, wallet2, wallet3: Uses wallet1, wallet2, wallet3:
- `02b3622bf4017bdfe317c58aed5f4c753f206b7db896046fa7d774bbc4bf7f8dc2` - `02b3622bf4017bdfe317c58aed5f4c753f206b7db896046fa7d774bbc4bf7f8dc2`
- `02103a7f7dd016558597f7960d27c516a4394fd968b9e65155eb4b013e4040406e` - `02103a7f7dd016558597f7960d27c516a4394fd968b9e65155eb4b013e4040406e`
- `03d90c07df63e690ce77912e10ab51acc944b66860237b608c4f8f8309e71ee699` - `03d90c07df63e690ce77912e10ab51acc944b66860237b608c4f8f8309e71ee699`
### Instance Beta Committee ### Instance Beta Committee
Uses wallet2, wallet3, wallet4 (different committee): Uses wallet2, wallet3, wallet4 (different committee):
- `02103a7f7dd016558597f7960d27c516a4394fd968b9e65155eb4b013e4040406e` - `02103a7f7dd016558597f7960d27c516a4394fd968b9e65155eb4b013e4040406e`
- `03d90c07df63e690ce77912e10ab51acc944b66860237b608c4f8f8309e71ee699` - `03d90c07df63e690ce77912e10ab51acc944b66860237b608c4f8f8309e71ee699`
- `02a7bc55fe8684e0119768d104ba30795bdcc86619e864add26156723ed185cd62` - `02a7bc55fe8684e0119768d104ba30795bdcc86619e864add26156723ed185cd62`
## Consensus Requirements ## Consensus Requirements
With 3 validators (dBFT): With 3 validators (dBFT):
- Block production: 2-of-3 validators required - Block production: 2-of-3 validators required
- Network can tolerate 1 validator failure - Network can tolerate 1 validator failure
## Testing Bridge Protocol ## Testing Bridge Protocol
Once both instances are running: Once both instances are running:
1. Register a Vita on Alpha 1. Register a Vita on Alpha
2. Use Federation contract to register as visitor on Beta 2. Use Federation contract to register as visitor on Beta
3. Test Pons contract for cross-border verification 3. Test Pons contract for cross-border verification
## Troubleshooting ## Troubleshooting
### Nodes not producing blocks ### Nodes not producing blocks
```bash ```bash
# Check if all validators are connected # Check if all validators are connected
docker-compose logs alpha_one | grep -i "connected" docker-compose logs alpha_one | grep -i "connected"
# Restart with fresh data # Restart with fresh data
docker-compose down -v docker-compose down -v
docker-compose up -d docker-compose up -d
``` ```
### Build fails ### Build fails
```bash ```bash
# Ensure Go 1.24+ is used in Dockerfile # Ensure Go 1.24+ is used in Dockerfile
# Clean rebuild # Clean rebuild
docker-compose build --no-cache docker-compose build --no-cache
``` ```
### Port conflicts ### Port conflicts
```bash ```bash
# Check what's using the ports # Check what's using the ports
netstat -tlnp | grep -E "1033|1133" netstat -tlnp | grep -E "1033|1133"
``` ```
## Native Contracts Available ## Native Contracts Available
Both instances include all Tutus native contracts: Both instances include all Tutus native contracts:
- Vita (identity), Annos (lifespan), VTS (stablecoin) - Vita (identity), Annos (lifespan), VTS (stablecoin)
- Scire (education), Salus (healthcare), Sese (life planning) - Scire (education), Salus (healthcare), Sese (life planning)
- Eligere (voting), Lex (rights), Collocatio (investments) - Eligere (voting), Lex (rights), Collocatio (investments)
- Tribute (anti-hoarding), Opus (AI workforce) - Tribute (anti-hoarding), Opus (AI workforce)
- Federation, Pons, Palam (cross-chain) - Federation, Pons, Palam (cross-chain)
- Tutus (governance), Lub (utility) - Tutus (governance), Lub (utility)

0
cli/app/app.go Normal file → Executable file
View File

0
cli/app/main_test.go Normal file → Executable file
View File

0
cli/cmdargs/parser.go Normal file → Executable file
View File

0
cli/cmdargs/parser_test.go Normal file → Executable file
View File

0
cli/flags/address.go Normal file → Executable file
View File

0
cli/flags/address_test.go Normal file → Executable file
View File

0
cli/flags/fixed8.go Normal file → Executable file
View File

0
cli/flags/fixed8_test.go Normal file → Executable file
View File

0
cli/input/input.go Normal file → Executable file
View File

0
cli/input/readpass_unix.go Normal file → Executable file
View File

0
cli/input/readpass_windows.go Normal file → Executable file
View File

0
cli/main.go Normal file → Executable file
View File

0
cli/nep_test/nep11_test.go Normal file → Executable file
View File

0
cli/nep_test/nep17_test.go Normal file → Executable file
View File

0
cli/options/cli_options_test.go Normal file → Executable file
View File

0
cli/options/filtering_core.go Normal file → Executable file
View File

0
cli/options/options.go Normal file → Executable file
View File

0
cli/options/options_test.go Normal file → Executable file
View File

0
cli/paramcontext/context.go Normal file → Executable file
View File

0
cli/query/query.go Normal file → Executable file
View File

0
cli/query/query_test.go Normal file → Executable file
View File

0
cli/server/cli_dump_test.go Normal file → Executable file
View File

0
cli/server/cli_server_test.go Normal file → Executable file
View File

0
cli/server/dump.go Normal file → Executable file
View File

0
cli/server/dump_bin.go Normal file → Executable file
View File

0
cli/server/dump_bin_test.go Normal file → Executable file
View File

0
cli/server/dump_test.go Normal file → Executable file
View File

0
cli/server/metrics.go Normal file → Executable file
View File

0
cli/server/server.go Normal file → Executable file
View File

0
cli/server/server_test.go Normal file → Executable file
View File

0
cli/server/signals_unix.go Normal file → Executable file
View File

0
cli/server/signals_windows.go Normal file → Executable file
View File

0
cli/smartcontract/contract_test.go Normal file → Executable file
View File

0
cli/smartcontract/generate.go Normal file → Executable file
View File

0
cli/smartcontract/generate_test.go Normal file → Executable file
View File

0
cli/smartcontract/manifest.go Normal file → Executable file
View File

0
cli/smartcontract/permission.go Normal file → Executable file
View File

View File

View File

View File

View File

View File

View File

View File

View File

0
cli/smartcontract/smart_contract.go Normal file → Executable file
View File

0
cli/smartcontract/smart_contract_test.go Normal file → Executable file
View File

0
cli/smartcontract/testdata/deploy/main.go vendored Normal file → Executable file
View File

0
cli/smartcontract/testdata/deploy/sub/put.go vendored Normal file → Executable file
View File

0
cli/smartcontract/testdata/deploy/update.manifest.json vendored Normal file → Executable file
View File

0
cli/smartcontract/testdata/deploy/updated.go vendored Normal file → Executable file
View File

0
cli/smartcontract/testdata/gas/gas.go vendored Normal file → Executable file
View File

0
cli/smartcontract/testdata/gas/gas.manifest.json vendored Normal file → Executable file
View File

0
cli/smartcontract/testdata/invalid1/invalid.go vendored Normal file → Executable file
View File

0
cli/smartcontract/testdata/invalid2/invalid.go vendored Normal file → Executable file
View File

0
cli/smartcontract/testdata/invalid3/invalid.go vendored Normal file → Executable file
View File

0
cli/smartcontract/testdata/invalid4/invalid.go vendored Normal file → Executable file
View File

0
cli/smartcontract/testdata/nameservice/nns.go vendored Normal file → Executable file
View File

0
cli/smartcontract/testdata/nameservice/nns.manifest.json vendored Normal file → Executable file
View File

0
cli/smartcontract/testdata/nex/nex.go vendored Normal file → Executable file
View File

0
cli/smartcontract/testdata/nonepiter/iter.go vendored Normal file → Executable file
View File

0
cli/smartcontract/testdata/rpcbindings/invalid1/invalid.go vendored Normal file → Executable file
View File

0
cli/smartcontract/testdata/rpcbindings/invalid2/invalid.go vendored Normal file → Executable file
View File

0
cli/smartcontract/testdata/rpcbindings/invalid3/invalid.go vendored Normal file → Executable file
View File

0
cli/smartcontract/testdata/rpcbindings/invalid4/invalid.go vendored Normal file → Executable file
View File

0
cli/smartcontract/testdata/rpcbindings/invalid5/invalid.go vendored Normal file → Executable file
View File

0
cli/smartcontract/testdata/rpcbindings/invalid6/invalid.go vendored Normal file → Executable file
View File

0
cli/smartcontract/testdata/rpcbindings/invalid7/invalid.go vendored Normal file → Executable file
View File

0
cli/smartcontract/testdata/rpcbindings/invalid8/invalid.go vendored Normal file → Executable file
View File

View File

0
cli/smartcontract/testdata/rpcbindings/royalty/royalty.go vendored Normal file → Executable file
View File

0
cli/smartcontract/testdata/rpcbindings/structs/structs.go vendored Normal file → Executable file
View File

0
cli/smartcontract/testdata/rpcbindings/types/types.go vendored Normal file → Executable file
View File

0
cli/smartcontract/testdata/verify.bindings.yml vendored Normal file → Executable file
View File

0
cli/smartcontract/testdata/verify.go vendored Normal file → Executable file
View File

0
cli/smartcontract/testdata/verify.manifest.json vendored Normal file → Executable file
View File

0
cli/smartcontract/testdata/verify.nef vendored Normal file → Executable file
View File

0
cli/smartcontract/testdata/verifyrpc/verify.manifest.json vendored Normal file → Executable file
View File

0
cli/txctx/tx.go Normal file → Executable file
View File

0
cli/util/audit-bin.go Normal file → Executable file
View File

0
cli/util/cancel.go Normal file → Executable file
View File

0
cli/util/convert.go Normal file → Executable file
View File

0
cli/util/dump.go Normal file → Executable file
View File

0
cli/util/send.go Normal file → Executable file
View File

0
cli/util/upload_bin.go Normal file → Executable file
View File

0
cli/util/upload_state.go Normal file → Executable file
View File

0
cli/util/util_test.go Normal file → Executable file
View File

0
cli/vm/cli.go Normal file → Executable file
View File

Some files were not shown because too many files have changed in this diff Show More