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