Get started with GG365's blockchain-powered golf booking API built on Camino Network.
🎯 What You'll Learn
In this guide, you'll learn how to:
- Connect your wallet to Camino Network
- Deploy a smart contract booking
- Mint an NFT golf ticket
- Make a crypto payment
Estimated Time: 30 minutes
📋 Prerequisites
Before you begin, make sure you have:
- ✅ Camino Wallet - Download here
- ✅ CAM Tokens - Get testnet CAM from faucet
- ✅ Basic Web3 Knowledge - Familiarity with blockchain concepts
- ✅ Node.js 18+ - For running code examples
🚀 Step 1: Set Up Your Wallet
Install Camino Wallet
# Option 1: Browser Extension
# Visit https://suite.camino.network/ and install the extension
# Option 2: Use MetaMask with Camino Network
# Add Camino Network to MetaMask:
Network Name: Camino Network
RPC URL: https://api.camino.network/ext/bc/C/rpc
Chain ID: 500
Currency Symbol: CAM
Block Explorer: https://suite.camino.network/explorer
Get Testnet CAM Tokens
# Visit the Camino Faucet
https://faucet.camino.network/
# Enter your wallet address
# Receive 10 CAM tokens for testing
🔗 Step 2: Connect to GG365 Smart Contract
Install SDK
npm install @gg365/blockchain-sdk ethers
Initialize Connection
import { GG365Contract } from '@gg365/blockchain-sdk';
import { ethers } from 'ethers';
// Connect to Camino Network
const provider = new ethers.providers.JsonRpcProvider(
'https://api.camino.network/ext/bc/C/rpc'
);
// Connect your wallet
const wallet = new ethers.Wallet(
process.env.PRIVATE_KEY,
provider
);
// Initialize GG365 Contract
const gg365 = new GG365Contract({
network: 'camino',
contractAddress: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb',
wallet: wallet
});
console.log('Connected to GG365 on Camino Network!');
🏌️ Step 3: Search for Golf Courses
// Search for courses (reads from blockchain)
const courses = await gg365.searchCourses({
country: 'ES',
region: 'costa-del-sol',
limit: 10
});
console.log(`Found ${courses.length} courses`);
// Get course details
const course = courses[0];
console.log(`Course: ${course.name}`);
console.log(`Location: ${course.location.city}, ${course.location.country}`);
console.log(`Blockchain: ${course.blockchain.enabled ? 'Enabled' : 'Disabled'}`);
📅 Step 4: Check Availability
// Check tee time availability
const availability = await gg365.checkAvailability({
courseId: course.id,
date: '2025-12-15',
players: 2
});
console.log(`Available tee times: ${availability.length}`);
// Select a tee time
const teeTime = availability[0];
console.log(`Tee Time: ${teeTime.time}`);
console.log(`Price: ${teeTime.pricing.finalPrice} ${teeTime.pricing.currency}`);
console.log(`Smart Contract: ${teeTime.blockchain.smartContractEnabled ? 'Yes' : 'No'}`);
console.log(`NFT Ticket: ${teeTime.blockchain.nftTicketEnabled ? 'Yes' : 'No'}`);
💳 Step 5: Create Smart Contract Booking
// Prepare booking data
const bookingData = {
courseId: course.id,
teeTimeId: teeTime.id,
players: [
{
type: 'lead',
firstName: 'John',
lastName: 'Smith',
email: '[email protected]',
walletAddress: wallet.address
},
{
type: 'additional',
firstName: 'Jane',
lastName: 'Doe',
email: '[email protected]'
}
],
payment: {
method: 'crypto',
token: 'CAM',
amount: teeTime.pricing.finalPrice
},
blockchain: {
smartContract: true,
nftTicket: true,
escrow: true
}
};
// Create booking via smart contract
const booking = await gg365.createBooking(bookingData);
console.log('Booking created!');
console.log(`Booking ID: ${booking.id}`);
console.log(`Reference: ${booking.reference}`);
console.log(`Smart Contract: ${booking.blockchain.smartContract.contractAddress}`);
console.log(`Transaction Hash: ${booking.blockchain.smartContract.transactionHash}`);
🎫 Step 6: Mint NFT Ticket
// NFT ticket is automatically minted with smart contract booking
const nftTicket = booking.blockchain.nftTicket;
console.log('NFT Ticket minted!');
console.log(`Token ID: ${nftTicket.tokenId}`);
console.log(`Contract: ${nftTicket.contractAddress}`);
console.log(`Owner: ${nftTicket.ownerAddress}`);
console.log(`Metadata: ${nftTicket.metadataUri}`);
// View NFT on Camino Explorer
const explorerUrl = `https://suite.camino.network/explorer/token/${nftTicket.contractAddress}/${nftTicket.tokenId}`;
console.log(`View NFT: ${explorerUrl}`);
✅ Step 7: Verify Booking
// Get booking details
const bookingDetails = await gg365.getBooking(booking.id);
console.log('Booking Status:', bookingDetails.status);
console.log('Payment Status:', bookingDetails.payment.status);
console.log('Smart Contract Status:', bookingDetails.blockchain.smartContract.status);
console.log('Escrow Status:', bookingDetails.blockchain.escrow.status);
// Verify on blockchain
const onChainBooking = await gg365.verifyOnChain(booking.id);
console.log('Blockchain Verified:', onChainBooking.verified);
🔄 Complete Example
Here's the complete code to create a blockchain booking:
import { GG365Contract } from '@gg365/blockchain-sdk';
import { ethers } from 'ethers';
async function createBlockchainBooking() {
// 1. Connect to Camino Network
const provider = new ethers.providers.JsonRpcProvider(
'https://api.camino.network/ext/bc/C/rpc'
);
const wallet = new ethers.Wallet(process.env.PRIVATE_KEY, provider);
const gg365 = new GG365Contract({
network: 'camino',
contractAddress: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb',
wallet: wallet
});
// 2. Search courses
const courses = await gg365.searchCourses({
country: 'ES',
limit: 1
});
// 3. Check availability
const availability = await gg365.checkAvailability({
courseId: courses[0].id,
date: '2025-12-15',
players: 2
});
// 4. Create booking
const booking = await gg365.createBooking({
courseId: courses[0].id,
teeTimeId: availability[0].id,
players: [
{
type: 'lead',
firstName: 'John',
lastName: 'Smith',
email: '[email protected]',
walletAddress: wallet.address
}
],
payment: {
method: 'crypto',
token: 'CAM',
amount: availability[0].pricing.finalPrice
},
blockchain: {
smartContract: true,
nftTicket: true,
escrow: true
}
});
console.log('Booking created:', booking.reference);
console.log('NFT Token ID:', booking.blockchain.nftTicket.tokenId);
return booking;
}
// Run the example
createBlockchainBooking()
.then(booking => console.log('Success!', booking))
.catch(error => console.error('Error:', error));
🎉 Next Steps
Congratulations! You've created your first blockchain golf booking!
What's Next?
- Learn about Smart Contracts - Smart Contracts Guide
- Explore NFT Tickets - NFT Tickets Guide
- Integrate Wallet - Wallet Integration Guide
- Two-Way Integration - Outbound | Inbound
💡 Key Concepts
Smart Contract Booking
- Automated escrow holds payment until play date
- Commission distribution happens automatically
- Immutable record on blockchain
- No chargebacks or disputes
NFT Tickets
- Unique, verifiable golf tickets
- Transferable to other players
- Tradeable on secondary markets
- Proof of ownership on blockchain
Crypto Payments
- Pay with CAM, USDC, or DAI
- Instant settlement
- Lower transaction fees
- Global accessibility
🆘 Troubleshooting
Common Issues
Issue: "Insufficient CAM balance"
- Solution: Get testnet CAM from faucet
Issue: "Transaction failed"
- Solution: Check gas price and increase if needed
Issue: "Contract not found"
- Solution: Verify you're on the correct network (testnet vs mainnet)
Issue: "NFT minting failed"
- Solution: Ensure NFT is enabled for the course
📚 Additional Resources
💬 Need Help?
Last modified on