TorramChain

module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 20, 2024 License: MIT

README

TorramChain

=======

Torram Blockchain

This guide provides step-by-step instructions for setting up a Cosmos-SDK-based blockchain using torramd.

Prerequisites

Ensure you have torramd installed and configured on your system before proceeding by running make install.

Steps

1. Initialize the Blockchain

Initialize your blockchain with the following command, specifying your node's moniker and chain ID. Set the default denomination to torram.

sudo ./torramd init torram --chain-id torram --default-denom torram
2. Create Key Pairs

Create a key pair for your validator node. This key will be used to sign blocks and transactions.

sudo ./torramd keys add  torram-node 

Example output:

- address: cosmos18muf4rc9jgzghmcjz2mzkkpe0l70t54uedwlu7  
  name: torram-node  
  pubkey: '{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"Atkt4/rSXc4FCn3jXq98uWg77OfJcYG8MbtfhwNi0laZ"}'  
  type: local
3. Add Genesis Accounts

Add accounts to the genesis file with a specified starting balance. You can add multiple accounts and specify tokens to multiple accounts if needed.

sudo ./torramd genesis add-genesis-account cosmos18muf4rc9jgzghmcjz2mzkkpe0l70t54uedwlu7 1000000torram  
sudo ./torramd genesis add-genesis-account cosmos18muf4rc9jgzghmcjz2mzkkpe0l70t54uedwlu7 2000000torram --append
4. Create and Collect Genesis Transactions

Create the genesis transaction file and collect signatures from the validator and other accounts.

sudo ./torramd genesis gentx torram-node 1000000torram --chain-id torram
sudo ./torramd genesis collect-gentxs  
5. Validate the Genesis File

Ensure your genesis file is correctly structured without errors.

sudo ./torramd genesis validate-genesis  
6. Start the Blockchain Node

Begin running your blockchain node with a specified minimum gas price for transactions.

sudo ./torramd start --minimum-gas-prices "0.01torram"

BITCOIN Implementation Checklist

Basic Module Structure
  • Set up basic Cosmos SDK module structure
  • Implement keeper with basic functionality
  • Set up module genesis handling
  • Set up module service registration
  • Basic module tests
Bitcoin Protocol Integration
1. Bitcoin RPC Client
  • Basic RPC client setup
    • Connection management
    • Authentication handling
    • Error handling
  • RPC Client Tests
  • Block Operations
    • Fetch block by height
    • Fetch block by hash
    • Get block header
  • Block Operations Tests
  • Transaction Operations
    • Get transaction details
    • Transaction broadcast
    • Transaction confirmation tracking
  • Transaction Operations Tests
2. Bitcoin SPV Implementation
  • Add Bitcoin block header structure
  • Header validation logic
  • Chain state management
  • SPV Header Tests
  • Block validation
    • Proof-of-work verification
    • Difficulty adjustment validation
  • Block Validation Tests
  • Chain reorganization handling
  • Chain Reorganization Tests
3. Merkle Tree Implementation
  • Core Merkle Tree
    • Tree node structure
    • Tree building logic
    • Root calculation
  • Merkle Tree Tests
  • Transaction verification
    • Proof generation
    • Proof verification
  • Transaction Verification Tests
Integration Testing
  • End-to-end flow tests
  • Error condition tests
  • Performance benchmarks


## Testing

# Bitcoin client tests
go test ./x/bitcoin/client -v

Directories

Path Synopsis
api
bitcoin/bitcoin
Code generated by protoc-gen-go-pulsar.
Code generated by protoc-gen-go-pulsar.
bitcoin/bitcoin/module
Code generated by protoc-gen-go-pulsar.
Code generated by protoc-gen-go-pulsar.
bitcoin/module
Code generated by protoc-gen-go-pulsar.
Code generated by protoc-gen-go-pulsar.
torram/torram
Code generated by protoc-gen-go-pulsar.
Code generated by protoc-gen-go-pulsar.
torram/torram/module
Code generated by protoc-gen-go-pulsar.
Code generated by protoc-gen-go-pulsar.
cmd
torramd command
testutil
nullify
Package nullify provides methods to init nil values structs for test assertion.
Package nullify provides methods to init nil values structs for test assertion.
x
bitcoin/types
Package types is a reverse proxy.
Package types is a reverse proxy.
torram/types
Package types is a reverse proxy.
Package types is a reverse proxy.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL