Skip to content

Conversation

gyan-sharma
Copy link
Contributor

@gyan-sharma gyan-sharma commented Mar 28, 2025

added dedicated-ai-and-template-section

Summary by Sourcery

Add dedicated AI and template sections to the documentation, introducing new content for blockchain and AI integration, smart contract templates, and AI-powered development tools

New Features:

  • Added comprehensive documentation for Model Context Protocol (MCP)
  • Introduced AI code assistant (RooCode) documentation
  • Created template libraries for EVM and Fabric smart contracts
  • Added OpenAI and pgvector integration guide

Documentation:

  • Expanded platform documentation with new sections on AI and blockchain integration
  • Added detailed guides for using AI tools in blockchain development
  • Created template documentation for smart contract development

Chores:

  • Reorganized documentation structure
  • Added new meta.json files for new documentation sections

Copy link

sourcery-ai bot commented Mar 28, 2025

Reviewer's Guide by Sourcery

This pull request introduces several new features and documentation updates, including a dedicated AI and template section. It adds documentation for connecting to Besu nodes, consensus mechanisms, and Javascript APIs. It also includes new smart contract templates for Land Registry, Health Records, CBDC Chaincode, State Machine, ERC20, and ERC721, as well as documentation for AI code assistant and Open AI nodes with pgvector. Typos and link styles were also corrected.

Updated class diagram for LandRegistry smart contract

classDiagram
  class LandRegistry {
    -Counters.Counter _parcelIdCounter
    -Counters.Counter _buildingIdCounter
    -mapping(uint256 => LandParcel) _parcels
    -mapping(uint256 => Building) _buildings
    -mapping(string => bool) _usedNationalIds
    -mapping(bytes32 => bool) _usedSignatures
    -mapping(uint256 => SplitMergeRequest) _splitMergeRequests
    -mapping(uint256 => uint256) _parcelToRequest
    +uint256 baseTaxRate
    +uint256 foreignTransferSurcharge
    +uint256 lateTaxPenalty
    +uint256 governanceApprovalThreshold
    +event ParcelRegistered(uint256 indexed id, address owner)
    +event ParcelTransferred(uint256 indexed id, address from, address to, uint256 taxPaid)
    +event BuildingAdded(uint256 indexed parcelId, uint256 buildingId)
    +event TaxPaid(uint256 indexed parcelId, uint256 amount, string currency)
    +event DisputeFiled(uint256 indexed parcelId, string details)
    +event DisputeResolved(uint256 indexed parcelId)
    +event SplitRequested(uint256 indexed requestId, uint256 indexed originalParcelId)
    +event MergeRequested(uint256 indexed requestId, uint256[] sourceParcelIds)
    +event SplitCompleted(uint256 indexed requestId, uint256[] newParcelIds)
    +event MergeCompleted(uint256 indexed requestId, uint256 newParcelId)
    +registerParcel(address owner, string parcelNumber, uint256 area, string gpsPolygon, string jurisdiction, string landUseType, uint256 landRate, string nationalId, string ipfsHash, bytes kycSignature) uint256
    +transferParcel(uint256 parcelId, address buyer, string buyerNationalId, PaymentDetail payment)
    +addBuilding(uint256 parcelId, string name, uint256 stories, uint256 builtArea, string constructionType) uint256
    +requestSplit(uint256 parcelId, uint256[] newAreas, string[] newParcelNumbers, string[] newGpsPolygons)
    +requestMerge(uint256[] parcelIds, string newParcelNumber)
    +approveRequest(uint256 requestId, bytes signature)
    +fileDispute(uint256 parcelId, string details)
    +resolveDispute(uint256 parcelId)
    +setTaxRate(uint256 newRate)
    +collectDelayedTax(uint256 parcelId, uint256 monthsDelayed)
    +getParcelDetails(uint256 parcelId) (LandParcel parcel, Building[] buildings, PaymentDetail[] payments)
    +getRequestDetails(uint256 requestId) (SplitMergeRequest request, LandParcel[] parcels)
  }
  class LandParcel {
    uint256 id
    string parcelNumber
    address owner
    uint256 area
    string gpsPolygon
    string jurisdiction
    string landUseType
    uint256 landRate
    bool hasDispute
    uint256[] buildingIds
    uint256[] parentParcels
    PaymentDetail[] paymentHistory
    uint256 lastTaxPaid
    string ipfsHash
  }
  class Building {
    uint256 id
    string name
    uint256 stories
    uint256 builtArea
    string constructionType
  }
  class PaymentDetail {
        string paymentReference
        string currency
        uint256 amount
        bool isForeign
        string sourceBank
        string proofOfPayment
        uint256 timestamp
  }
  class SplitMergeRequest {
        uint256[] parcelIds
        uint256[] newAreas
        string[] newParcelNumbers
        string[] newGpsPolygons
        bool isMerge
        bool approved
        bytes[] approvalSignatures
  }

  LandRegistry -- LandParcel : contains
  LandRegistry -- Building : contains
  LandRegistry -- PaymentDetail : contains
  LandRegistry -- SplitMergeRequest : contains
Loading

File-Level Changes

Change Details Files
Introduced a section on consensus mechanisms, detailing Proof of Work (PoW) and Proof of Authority (PoA), and highlighting SettleMint's use of QBFT in Enterprise Ethereum networks.
  • Added a new section titled 'Consensus mechanisms'.
  • Explained Proof of Work (PoW) and Proof of Authority (PoA).
  • Mentioned that SettleMint's Enterprise Ethereum networks use QBFT.
  • Provided a brief overview of how IBFT 2.0 works.
  • Included a link to the Hyperledger Besu documentation.
content/docs/platform-components/blockchain-infrastructure/blockchain-nodes.mdx
Added a section on Backend APIs, detailing how to connect to a Besu node using JSON-RPC, JSON-WS, and GraphQL endpoints.
  • Added a new section titled 'Backend APIs'.
  • Described JSON-RPC, JSON-WS, and GraphQL endpoints.
  • Provided examples of JSON-RPC requests and wscat commands for JSON-WS.
  • Explained how to test the different methods and Curl command lines.
  • Explained how to test out the different graphql queries with cURL.
content/docs/platform-components/blockchain-infrastructure/blockchain-nodes.mdx
Added a section on Javascript API, explaining how to connect to a node using plain Javascript and convenience libraries like Ethers.
  • Added a new section titled 'Javascript API'.
  • Mentioned the possibility of using plain Javascript to connect to a node.
  • Explained the use of convenience libraries within the different ecosystem.
  • Provided an example using the Ethers library.
content/docs/platform-components/blockchain-infrastructure/blockchain-nodes.mdx
Corrected a typo in the Attestation Indexer documentation across multiple files.
  • Changed 'How eas works' to 'How EAS works'.
content/docs/building-with-settlemint/evm-chains-guide/attestation-indexer.mdx
content/docs/building-with-settlemint/hedera-hashgraph-guide/attestation-indexer.mdx
content/docs/platform-components/middleware-and-api-layer/attestation-indexer.mdx
content/docs/use-case-guides/attestation-service.mdx
Corrected labels in the Attestation Indexer documentation across multiple files.
  • Changed 'Verification using the eas sdk' to 'Verification using the EAS sdk'.
content/docs/building-with-settlemint/evm-chains-guide/attestation-indexer.mdx
content/docs/building-with-settlemint/hedera-hashgraph-guide/attestation-indexer.mdx
content/docs/platform-components/middleware-and-api-layer/attestation-indexer.mdx
content/docs/use-case-guides/attestation-service.mdx
Replaced instances of 'eas' with 'EAS' in code snippets within the Attestation Indexer documentation across multiple files.
  • Replaced 'const eas = new EAS(config.easAddress);' with 'const EAS = new EAS(config.easAddress);'
  • Replaced 'eas.connect(signer);' with 'EAS.connect(signer);'
  • Replaced 'const eas = global.get('eas');' with 'const EAS = global.get('eas');'
  • Replaced 'const attestation = await eas.getAttestation(attestationUID);' with 'const attestation = await EAS.getAttestation(attestationUID);'
content/docs/building-with-settlemint/evm-chains-guide/attestation-indexer.mdx
content/docs/building-with-settlemint/hedera-hashgraph-guide/attestation-indexer.mdx
content/docs/platform-components/middleware-and-api-layer/attestation-indexer.mdx
content/docs/use-case-guides/attestation-service.mdx
Updated the 'Inputs' name in the Attestation Indexer documentation across multiple files.
  • Changed 'Inputs: RpcUrl, registry address, eas address, private key' to 'Inputs: RpcUrl, registry address, EAS address, private key'.
content/docs/building-with-settlemint/evm-chains-guide/attestation-indexer.mdx
content/docs/building-with-settlemint/hedera-hashgraph-guide/attestation-indexer.mdx
content/docs/platform-components/middleware-and-api-layer/attestation-indexer.mdx
content/docs/use-case-guides/attestation-service.mdx
Updated link styles on the index page.
  • Replaced 'className="no-underline text-blue-600 dark:text-blue-300 hover:text-blue-700 dark:hover:text-blue-200 hover:underline"' with 'className="no-underline text-sm-accent hover:underline"'
content/docs/index.mdx
Added 'EAS' and 'LLM' to the list of abbreviations in format-headings.ts.
  • Added 'EAS' to the ABBREVIATIONS array.
  • Added 'LLM' to the ABBREVIATIONS array.
format-headings.ts
Added a new template for a Land Registry smart contract.
  • Created a new file 'content/docs/use-case-guides/template-libraries/evm-smart-contracts/land-registry.mdx'.
content/docs/use-case-guides/template-libraries/evm-smart-contracts/land-registry.mdx
Added a new document on Blockchain and AI.
  • Created a new file 'content/docs/blockchain-and-ai/blockchain-and-ai.mdx'.
content/docs/blockchain-and-ai/blockchain-and-ai.mdx
Added a new template for a Health Records smart contract.
  • Created a new file 'content/docs/use-case-guides/template-libraries/evm-smart-contracts/health-records.mdx'.
content/docs/use-case-guides/template-libraries/evm-smart-contracts/health-records.mdx
Added a new document on Model Context Protocol (MCP).
  • Created a new file 'content/docs/blockchain-and-ai/mcp.mdx'.
content/docs/blockchain-and-ai/mcp.mdx
Added a new template for a CBDC Chaincode.
  • Created a new file 'content/docs/use-case-guides/template-libraries/fabric-chaincodes/cbdc.mdx'.
content/docs/use-case-guides/template-libraries/fabric-chaincodes/cbdc.mdx
Added a new template for a State Machine Smart Contract.
  • Created a new file 'content/docs/use-case-guides/template-libraries/evm-smart-contracts/state-machine.mdx'.
content/docs/use-case-guides/template-libraries/evm-smart-contracts/state-machine.mdx
Added a new template for an ERC20 Smart Contract.
  • Created a new file 'content/docs/use-case-guides/template-libraries/evm-smart-contracts/erc20.mdx'.
content/docs/use-case-guides/template-libraries/evm-smart-contracts/erc20.mdx
Added a new document on AI code assistant.
  • Created a new file 'content/docs/blockchain-and-ai/ai-code-assistant.mdx'.
content/docs/blockchain-and-ai/ai-code-assistant.mdx
Added a new template for an ERC721 Smart Contract.
  • Created a new file 'content/docs/use-case-guides/template-libraries/evm-smart-contracts/erc721.mdx'.
content/docs/use-case-guides/template-libraries/evm-smart-contracts/erc721.mdx
Added a new document on Open AI nodes and pgvector.
  • Created a new file 'content/docs/blockchain-and-ai/open-ai-nodes-and-pg-vector.mdx'.
content/docs/blockchain-and-ai/open-ai-nodes-and-pg-vector.mdx

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@gyan-sharma gyan-sharma requested review from snigdha920 and SaeeDawod and removed request for snigdha920 March 28, 2025 06:10
@github-actions github-actions bot added the feat New feature label Mar 28, 2025
@gyan-sharma gyan-sharma requested review from bl0up and roderik and removed request for snigdha920 March 28, 2025 06:10
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @gyan-sharma - I've reviewed your changes and found some issues that need to be addressed.

Blocking issues:

  • The private key is hardcoded in the documentation. (link)
  • The private key is hardcoded in the documentation. (link)
  • The private key is hardcoded in the documentation. (link)
  • The private key is hardcoded in the documentation. (link)
  • The private key is hardcoded in the documentation. (link)
  • The private key is hardcoded in the documentation. (link)

Overall Comments:

  • The addition of the Javascript API section could benefit from a brief explanation of its purpose and how it relates to the other APIs.
Here's what I looked at during the review
  • 🟡 General issues: 2 issues found
  • 🔴 Security: 6 blocking issues
  • 🟢 Review instructions: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment on lines +305 to 306
const EAS = new EAS(config.easAddress);
eas.connect(signer);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: Variable renaming inconsistency in the attestation indexer.

As with the EVM chains guide, the instance is declared as 'EAS' but later methods are still called on 'eas'. Ensuring consistent naming across all attestation indexer flows will prevent potential runtime issues.

your own setup.
- If you don't have Docker installed, you can find the installation
instructions [here](https://docs.docker.com/get-docker/).
- If you don't have Docker Composer installed, you can find the installation
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick (typo): Typo in Docker Compose reference

It appears that 'Docker Composer' is used instead of 'Docker Compose'. Correcting this will avoid potential confusion.

Suggested change
- If you don't have Docker Composer installed, you can find the installation
- If you don't have Docker Compose installed, you can find the installation

@@ -303,7 +303,7 @@ const config = {
// Connect to the blockchain
const provider = new ethers.JsonRpcProvider(config.rpcUrl);
const signer = new ethers.Wallet(config.privateKey, provider);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 issue (security): The private key is hardcoded in the documentation.

@@ -638,7 +638,7 @@
"id": "setup_inject",
"type": "inject",
"z": "eas_flow",
"name": "Inputs: RpcUrl, registry address, eas address, private key",
"name": "Inputs: RpcUrl, registry address, EAS address, private key",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 issue (security): The private key is hardcoded in the documentation.

@@ -302,7 +302,7 @@
// Connect to the blockchain
const provider = new ethers.JsonRpcProvider(config.rpcUrl);
const signer = new ethers.Wallet(config.privateKey, provider);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 issue (security): The private key is hardcoded in the documentation.

@@ -637,7 +637,7 @@
"id": "setup_inject",
"type": "inject",
"z": "eas_flow",
"name": "Inputs: RpcUrl, registry address, eas address, private key",
"name": "Inputs: RpcUrl, registry address, EAS address, private key",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 issue (security): The private key is hardcoded in the documentation.

@@ -281,7 +281,7 @@ const config = {
// Connect to the blockchain
const provider = new ethers.JsonRpcProvider(config.rpcUrl);
const signer = new ethers.Wallet(config.privateKey, provider);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 issue (security): The private key is hardcoded in the documentation.

@@ -281,7 +281,7 @@ const config = {
// Connect to the blockchain
const provider = new ethers.JsonRpcProvider(config.rpcUrl);
const signer = new ethers.Wallet(config.privateKey, provider);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 issue (security): The private key is hardcoded in the documentation.

@gyan-sharma gyan-sharma enabled auto-merge (squash) March 28, 2025 06:56
@gyan-sharma gyan-sharma merged commit 07c156a into main Mar 28, 2025
2 checks passed
@gyan-sharma gyan-sharma deleted the gyan/dedicated-ai-and-template-section branch March 28, 2025 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants