Add Oracle Aggregator and CCIP Integration
- Introduced Aggregator.sol for Chainlink-compatible oracle functionality, including round-based updates and access control. - Added OracleWithCCIP.sol to extend Aggregator with CCIP cross-chain messaging capabilities. - Created .gitmodules to include OpenZeppelin contracts as a submodule. - Developed a comprehensive deployment guide in NEXT_STEPS_COMPLETE_GUIDE.md for Phase 2 and smart contract deployment. - Implemented Vite configuration for the orchestration portal, supporting both Vue and React frameworks. - Added server-side logic for the Multi-Cloud Orchestration Portal, including API endpoints for environment management and monitoring. - Created scripts for resource import and usage validation across non-US regions. - Added tests for CCIP error handling and integration to ensure robust functionality. - Included various new files and directories for the orchestration portal and deployment scripts.
This commit is contained in:
54
sdk/scripts/setup.sh
Executable file
54
sdk/scripts/setup.sh
Executable file
@@ -0,0 +1,54 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Setup script for Tatum SDK integration
|
||||
|
||||
set -e
|
||||
|
||||
echo "Setting up Tatum SDK for ChainID 138..."
|
||||
echo "========================================"
|
||||
echo ""
|
||||
|
||||
# Check if Node.js is installed
|
||||
if ! command -v node &> /dev/null; then
|
||||
echo "Error: Node.js is not installed. Please install Node.js 18+ first."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check Node.js version
|
||||
NODE_VERSION=$(node -v | cut -d'v' -f2 | cut -d'.' -f1)
|
||||
if [ "$NODE_VERSION" -lt 18 ]; then
|
||||
echo "Warning: Node.js version is less than 18. Recommended: Node.js 18+"
|
||||
fi
|
||||
|
||||
echo "Node.js version: $(node -v)"
|
||||
echo ""
|
||||
|
||||
# Install dependencies
|
||||
echo "Installing dependencies..."
|
||||
npm install
|
||||
|
||||
# Create .env file if it doesn't exist
|
||||
if [ ! -f .env ]; then
|
||||
echo "Creating .env file from env.example..."
|
||||
cp env.example .env
|
||||
echo "Please update .env with your RPC endpoint configuration"
|
||||
else
|
||||
echo ".env file already exists"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "Setup complete!"
|
||||
echo ""
|
||||
echo "Next steps:"
|
||||
echo "1. Update .env with your RPC endpoint:"
|
||||
echo " RPC_URL=https://rpc.defi-oracle-meta-mainnet.org"
|
||||
echo ""
|
||||
echo "2. Test connection:"
|
||||
echo " npm run test"
|
||||
echo ""
|
||||
echo "3. Run examples:"
|
||||
echo " npm run example:basic"
|
||||
echo " npm run example:transaction"
|
||||
echo " npm run example:contract"
|
||||
echo ""
|
||||
|
||||
93
sdk/scripts/test-rpc.sh
Executable file
93
sdk/scripts/test-rpc.sh
Executable file
@@ -0,0 +1,93 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Test RPC endpoint connectivity and ChainID 138
|
||||
|
||||
set -e
|
||||
|
||||
RPC_URL="${RPC_URL:-http://localhost:8545}"
|
||||
|
||||
echo "Testing RPC endpoint: $RPC_URL"
|
||||
echo "================================"
|
||||
echo ""
|
||||
|
||||
# Test 1: Check if RPC endpoint is reachable
|
||||
echo "1. Testing RPC endpoint connectivity..."
|
||||
RESPONSE=$(curl -s -X POST "$RPC_URL" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}')
|
||||
|
||||
if [ -z "$RESPONSE" ] || echo "$RESPONSE" | jq -e '.error' > /dev/null 2>&1; then
|
||||
echo " ❌ RPC endpoint is not responding or returned an error"
|
||||
echo " Response: $RESPONSE"
|
||||
exit 1
|
||||
else
|
||||
echo " ✅ RPC endpoint is responding"
|
||||
fi
|
||||
|
||||
# Test 2: Check ChainID
|
||||
echo "2. Testing ChainID..."
|
||||
CHAIN_ID_RESPONSE=$(curl -s -X POST "$RPC_URL" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}')
|
||||
|
||||
CHAIN_ID=$(echo "$CHAIN_ID_RESPONSE" | jq -r '.result')
|
||||
CHAIN_ID_DECIMAL=$(printf "%d" "$CHAIN_ID")
|
||||
|
||||
if [ "$CHAIN_ID_DECIMAL" != "138" ]; then
|
||||
echo " ❌ ChainID mismatch! Expected 138, got $CHAIN_ID_DECIMAL"
|
||||
exit 1
|
||||
else
|
||||
echo " ✅ ChainID is correct (138 / $CHAIN_ID)"
|
||||
fi
|
||||
|
||||
# Test 3: Get block number
|
||||
echo "3. Getting current block number..."
|
||||
BLOCK_NUMBER_RESPONSE=$(curl -s -X POST "$RPC_URL" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}')
|
||||
|
||||
BLOCK_NUMBER=$(echo "$BLOCK_NUMBER_RESPONSE" | jq -r '.result')
|
||||
BLOCK_NUMBER_DECIMAL=$(printf "%d" "$BLOCK_NUMBER")
|
||||
echo " ✅ Current block: $BLOCK_NUMBER_DECIMAL ($BLOCK_NUMBER)"
|
||||
|
||||
# Test 4: Get gas price
|
||||
echo "4. Getting gas price..."
|
||||
GAS_PRICE_RESPONSE=$(curl -s -X POST "$RPC_URL" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"jsonrpc":"2.0","method":"eth_gasPrice","params":[],"id":1}')
|
||||
|
||||
GAS_PRICE=$(echo "$GAS_PRICE_RESPONSE" | jq -r '.result')
|
||||
echo " ✅ Gas price: $GAS_PRICE"
|
||||
|
||||
# Test 5: Get peer count
|
||||
echo "5. Getting peer count..."
|
||||
PEER_COUNT_RESPONSE=$(curl -s -X POST "$RPC_URL" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"jsonrpc":"2.0","method":"net_peerCount","params":[],"id":1}')
|
||||
|
||||
PEER_COUNT=$(echo "$PEER_COUNT_RESPONSE" | jq -r '.result')
|
||||
PEER_COUNT_DECIMAL=$(printf "%d" "$PEER_COUNT")
|
||||
echo " ✅ Peer count: $PEER_COUNT_DECIMAL"
|
||||
|
||||
# Test 6: Check sync status
|
||||
echo "6. Checking sync status..."
|
||||
SYNC_RESPONSE=$(curl -s -X POST "$RPC_URL" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}')
|
||||
|
||||
SYNC_STATUS=$(echo "$SYNC_RESPONSE" | jq -r '.result')
|
||||
if [ "$SYNC_STATUS" = "false" ]; then
|
||||
echo " ✅ Node is fully synced"
|
||||
else
|
||||
echo " ⚠️ Node is still syncing: $SYNC_STATUS"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "================================"
|
||||
echo "✅ All RPC tests passed!"
|
||||
echo "================================"
|
||||
echo ""
|
||||
echo "RPC endpoint is ready for Tatum SDK integration"
|
||||
echo "ChainID: 138 ($CHAIN_ID)"
|
||||
echo "Current Block: $BLOCK_NUMBER_DECIMAL"
|
||||
|
||||
Reference in New Issue
Block a user