Technical Layer
Last updated
Last updated
This document provides a detailed look at the comprehensive technical overview of the recent developments made to Activelink. This highlights the smooth integration of smart contracts through NEAR and Polygon to intricate interactions facilitated by near-api-js.
The objective of these improvements is to optimize NFT operations within the Activelink ecosystem. From minting and transferring of tokens to the easy buying, viewing, and IPFS uploading processes every aspect has been carefully refined to ensure a smooth and user-friendly experience on the platform.
Activelink has teamed up using a specialized JavaScript library called ‘near-api-js’ to interact with the NEAR and Polygon. This familiar integration allows Activelink's user interface to communicate directly with NEAR core smart contracts. This simplifies and improves the user experience for NFT-related actions within the Activelink platform.
By seamlessly connecting these different components, Activelink provides an easy-to-use experience that boosts user engagement and efficiency across its ecosystem.
Account Authentication: Leveraging near-api-js, Activelink employs robust account authentication mechanisms, ensuring secure and customized access for users to explore and utilize its features securely.
Smart Contract Interactions: Activelink facilitates seamless interaction with NEAR + Polygon smart contracts through direct integration with the web interface. This integration empowers users with a cohesive and intuitive journey, enabling them to engage in various NFT activities effortlessly.
Decentralized Data Storage: Implementing IPFS, Activelink stores NFT images and metadata in a decentralized manner, enhancing data security and accessibility. By maintaining reference data on-chain, the platform enables efficient retrieval of metadata and image information from off-chain storage, ensuring a seamless experience for users accessing NFT content.
The NEAR Relayer operates as an HTTP server that sends transactions to the NEAR network on behalf of users. It follows the NEP-366: Meta Transactions standard, allowing users to transact without NEAR tokens. The entity managing the relayer covers the gas costs for these transactions, providing a smooth experience for users engaging with the NEAR ecosystem.
Prerequisites:
Rust
Create Keys
Should just be cargo
SignedDelegateAction: Users initiate this action by creating transaction data, which is then signed and transmitted to the relayer for processing.
SignedTransaction: Subsequently, the relayer signs a transaction using its key, incorporating the data from the SignedDelegateAction, and forwards it to the NEAR network for execution.
Cost Efficiency: The relayer optimizes capital utilization by centrally managing gas fees from a pooled resource, rather than requiring individual users to allocate NEAR tokens. This approach enhances affordability and accessibility for users engaging with the NEAR network.
Server and NEAR Account Setup Server Preparation: Set up a dedicated server to host the relayer, managing incoming transactions from your application and relaying them to the NEAR network. NEAR Account Creation: Create a NEAR account designated for relayer transactions. Ensure sufficient funding to cover gas costs and securely store the account credentials on the server.
Relayer Installation and Configuration Relayer Installation: Refer to the Pagoda Relayer GitHub repository for installation instructions and set up the relayer on your server. Configuration: Customize the relayer's settings to align with your requirements. This includes tasks such as whitelisting contract addresses, defining gas cost allowances, and integrating necessary SDKs like Fastauth.
API Integration Routing Transactions: Develop backend routing in your application to direct transactions to the relayer. This involves transmitting SignedDelegateActions from your client to the relayer.
Handling Responses: Implement mechanisms to manage responses received from the relayer, ensuring seamless synchronization with your application's state.
Testing and Deployment Rigorous Testing: Conduct comprehensive testing to validate the correct transaction relay and ensure that the relayer's configurations meet specified criteria.
Deployment: Once testing concludes successfully, deploy the integration to your production environment.
User Onboarding: Simplifies the onboarding process by eliminating the initial requirement for users to possess NEAR tokens.
Cost Efficiency: Enhances capital efficiency by enabling strategic allocation of funds for gas costs.
Flexibility: Provides configurable features to tailor the relayer's operations according to specific needs.