This guide provides information for developers who want to contribute to ChaosChain or build applications on top of it.
- Go 1.24+
- Node.js 19+
- Docker
- Git
- OpenAI API key
- Clone the repository:
git clone https://github.com/NethermindEth/chaoschain-launchpad.git
cd chaoschain-launchpad
- Install Go dependencies:
go mod download
- Set up the frontend:
cd client/agent-launchpad
npm install
- Create a
.env
file in the root directory:
OPENAI_API_KEY=your_api_key_here
- Start NATS server:
docker run -p 4222:4222 -p 8222:8222 nats
chaoschain-launchpad/
├── ai/ # AI integration
├── api/ # API endpoints
│ └── handlers/ # Request handlers
├── client/ # Web interface
│ └── agent-launchpad/# Next.js application
├── cmd/ # Command-line tools
│ ├── keygen/ # Key generation utility
│ └── main.go # Main application entry point
├── communication/ # Messaging components
├── config/ # Configuration management
├── consensus/ # Consensus implementation
├── core/ # Core blockchain components
├── crypto/ # Cryptographic utilities
├── docs/ # Documentation
├── mempool/ # Transaction pool
├── p2p/ # Peer-to-peer networking
├── producer/ # Block producer
├── validator/ # Validator implementation
├── go.mod # Go module definition
├── go.sum # Go dependencies checksum
├── main.go # Alternative entry point
└── README.md # Project overview
- Identify which package should contain your feature
- Create or modify the necessary files
- Add tests in a
_test.go
file - Update any relevant documentation
- Run tests:
go test ./...
- Navigate to the client directory:
cd client/agent-launchpad
- Create or modify components in
src/components/
- Add new pages in
src/app/
- Update API services in
src/services/
- Run the development server:
npm run dev
You can extend the validator system by adding new personality traits:
- Modify
validator/validator.go
to include new traits - Update the AI prompts in
ai/ai.go
to incorporate these traits - Add UI elements to the web interface for configuring these traits
To add custom transaction types:
- Extend the
Transaction
struct incore/transaction.go
- Add validation logic for the new transaction type
- Update the mempool to handle the new transaction type
- Add API endpoints for submitting the new transaction type
To modify the consensus mechanism:
- Update the discussion logic in
consensus/discussion.go
- Modify the voting process in
consensus/manager.go
- Adjust the finalization criteria as needed
# Run all tests
go test ./...
# Run tests for a specific package
go test ./core
# Run tests with coverage
go test -cover ./...
cd client/agent-launchpad
npm test
go build -o chaoschain cmd/main.go
cd client/agent-launchpad
npm run build
See the Deployment Guide for information on deploying ChaosChain to production environments.
- Fork the repository
- Create a feature branch:
git checkout -b feature/my-new-feature
- Make your changes
- Run tests
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin feature/my-new-feature
- Create a new Pull Request
Please follow the Contribution Guidelines for more details.