In the previous 2 posts, I showed you how to use the Remix IDE tool, the structure of the tool as well as their functions, and tested a HelloWorld post so that you know how to code, compile and deploy 1. smart contract in this tool. However, in those 2 articles, the source code is only temporarily saved on the browser. If there is a cookie, it is also temporarily saved, ie, the entire source code can be lost.
In this article, I will show you how to synchronize the source code between the Local machine and the Remix IDE, that is, when we program on the Ethereum Blockchain, all changes to the source code, or configuration in the workspace will be saved to the computer. Local. And the next day you can connect and restore the source code in Local to Ethereum Blockchain to continue coding.
Step 1: Installing NPM (Node Package Manager)
1.1 Checking NPM Installation
Open the command line and enter the following command to check if NPM is installed:
If recognized, your computer already has NPM. If not, proceed to install NodeJS, which includes NPM.
1.2 Installing NodeJS
Install NodeJS by following the steps outlined in previous blog posts or relevant documentation.
1.3 Verifying NPM Installation
After installing NodeJS, restart your computer and retest NPM. Ensure the version is displayed, indicating a successful installation.
Step 2: Installing remixd Daemon
To enable the system to access local files from Remix IDE on the Ethereum blockchain, the remixd daemon must be installed. Follow these steps:
2.1 Installing remixd Daemon
In the command line, enter the following command:
npm install -g @remix-project/remixd
Wait for the installation to complete.
2.2 Verifying remixd Installation
Confirm that remixd is installed successfully by checking its version:
If the version is displayed, the installation was successful.
Step 3: Running remixd Daemon
Now, let’s run the remixd daemon to connect our local machine with Remix IDE on the Ethereum blockchain.
3.1 Setting Up the Workspace
Create a folder on your local machine where you want to sync the Ethereum blockchain projects. For example:
Navigate to the SmartContract folder using the command line.
3.2 Running remixd Daemon
Run the following command in the command line to start the remixd daemon:
remixd -s HelloWorld --remix-ide https://remix.ethereum.org
Replace “HelloWorld” with your chosen folder name.
Step 4: Connecting Locally to Sync Source Code
With the remixd daemon running, connect Remix IDE to the local machine for source code synchronization.
4.1 Connecting from Remix IDE
In the Remix IDE Ethereum Blockchain, choose “Connect to localhost” from the Workspaces section.
4.2 Successful Connection
Click “Connect” and wait for the successful connection message. Simultaneously, the command line running remixd will display a notification for the connected workspace.
4.3 Synchronization Verification
Observe the comparison between local and Ethereum on Remix IDE. The local machine remains empty initially.
Create a new folder “Lucy” on Remix Ethereum to demonstrate the synchronization process.
Conclusion: Streamlining Blockchain Development Workflow
Source code synchronization between the local machine and Remix IDE on the Ethereum blockchain is a critical aspect of efficient and collaborative blockchain development. By following these steps, developers can seamlessly transition between coding sessions, ensuring that all changes are saved locally and can be restored for continued development.
Adjust the folder names and paths as needed for your specific projects.
Statistical Insights: Impact on Development Efficiency
While statistical data specific to this process may not be available, the impact on development efficiency can be inferred from the streamlined workflow. By automating source code synchronization, developers can save significant time during coding sessions, leading to increased overall productivity.