pseudoyu

pseudoyu

Blockchain | Programming | Photography | Boyi
github
twitter
telegram
mastodon
bilibili
jike

Weekly Report #38 - Foundry Contract Testing, Logseq Task Management, and Surge Ponte Remote Development

Preface#

This article is a record and reflection on life from 2023-04-19 to 2023-04-30.

The last weekly report mentioned a journey across multiple cities. After returning to Hangzhou, I gradually resumed my original life rhythm. I have had much more alone time, with plenty of input, thoughts, and interesting things to do, but it seems that the time for organizing and conversing with myself has decreased. I often realize the passage of time only after several days. I pride myself on being someone who is not overly reliant on social interactions and has strong adaptability, but I think I might just be overly entrusting my state of life to the virtual world, leading to a sense of disconnection from reality.

Now, on a late-night flight, after a brief nap, my drowsiness has faded, so I decided to take out my laptop and write something. Perhaps due to the lack of internet and external distractions, my thoughts seem clearer.

Work Atmosphere and Freedom#

It has been over a month since I joined the new team. Perhaps because I was busy running around for the first two or three weeks, I often felt detached from reality. Now, I am gradually adapting to the rhythm and getting back on track. The atmosphere in my group is great; even remotely, I do not feel a sense of alienation. Meetings often transition from work topics to discussing takeout options and then to what Vlog camera to buy (Sony is great). I, who used to be socially anxious, have gradually started to talk more in the group.

Interestingly, after participating in team-building activities in Shenzhen, the Hong Kong Web3 Festival, and a wave of team-building in Hangzhou, I have already met nearly 20 colleagues from the company. It is not easy in a fully remote work model. I was also fortunate to catch the online annual meeting, where I met many interesting colleagues who only existed in Slack chat (various talents). Performing a show could uncover a rapper, and even playing Tetris could showcase the diversity among people.

After some communication, I made some adjustments to my work content, allowing me to continue doing some smart contract development and blockchain-related research and exploration, and to participate more deeply in products I like (let's see who hasn't used xLog and xSync, you can check out this article "Weekly Report #25 - Personal Information Output and Synchronization System Based on Crossbell"). Although it may require more balance in terms of workload and time, I am still a bit happy to have such freedom of choice.

Foundry and Contract Testing#

As I began to understand the projects of another group I joined, I clearly felt that although I had done some blockchain research and written contracts for about half a year, I still lacked complexity and practical development experience. I plan to fill this gap, so this week I reviewed many contracts and research documents and decided to switch from Hardhat to Foundry.

Previously, Noy and some other friends had enthusiastically recommended the Foundry framework to me, but since the previous project did not have high requirements for contract unit testing, and I had relied on JavaScript to write many utility scripts, I continued using Hardhat. It wasn't until I actually ran some projects and wrote some demo unit tests that I felt its huge advantages and instantly switched sides. The Solidity contract development series, which was almost gathering dust, is finally going to welcome new updates (I’m writing it, if you don’t believe it, look at the picture

foundry_framework_outline

Currently, there are still relatively few enterprise-level practices regarding contracts, and since some of the contracts I will be working on are open source, I plan to gradually document some of the pitfalls and best practices (the advantage of being fully open source).

Logseq and Task Management#

As my personal arrangements and work tasks have become more complex, I have re-enabled Logseq as my personal task management tool. I had previously been using Notion for my personal Kanban, but I always felt it was too mentally burdensome. My severe obsessive-compulsive tendencies led me to constantly optimize task categories and descriptions, which instead put a lot of pressure on myself. I also tried using TickTick and Todoist, which are more conventional applications, but I still needed to sort through various tasks and tags every day, making it inconvenient to trace back.

I later discovered Logseq, a note-taking software. Initially, I only regarded it as a block-granularity markdown note-taking software and wanted to try out the concept of bi-directional linking, which I felt had been frequently mentioned. I adapted quite well to it, so I gradually migrated my Knowledge Base from Notion. I also experimented with using Joplin to sync my web annotations, but soon found it a bit cumbersome and abandoned it.

Until I came across Randy's video "How I Use Logseq to Manage My Life and Notes," where he mentioned using Logseq's Daily Journal for various note-taking and TODO management, eliminating the need to create a plan before presenting it like in Notion.

logseq_daily_journal

Therefore, when I suddenly remember something I want to do, I don't need to create a new task in a Kanban or task management software; I can simply add an entry in my Daily Journal like writing a note and use simple syntax like TODO or LATER for basic task management.

However, some tasks may span multiple days, and our tasks may be scattered across various dates in the Journal, making unified management difficult. This is where another powerful feature of Logseq comes into play—Query. This feature can be understood as block-granularity querying (similar to querying a record in SQL), filtering through some tags, syntax, and other internal logic to display the blocks we want.

I referred to Randy's practice and created a Dashboard page that displays my various query results. I mainly used the following queries (the statements in parentheses are their corresponding query statements; friends who need them can take them and modify them as needed):

  1. In Progress ({{query (todo now)}})
  2. Todo ({{query (todo later)}})
  3. Writing Plan ({{query (and (todo later) [[writing]] )}})
  4. Reading ({{query (and (todo now) [[books]] )}})
  5. Read It Later ({{query (and (todo later) [[books]])}})

The results are presented as follows:

logseq_dashboard_in_progress

logseq_dashboard_todo

logseq_dashboard_other_queries

Since this is Randy's practice, I won't write a separate blog post to introduce it; I just briefly introduced my usage in the weekly report. Those interested can check out his original video.

Surge Ponte and Remote Development#

I belong to the type of person who is both inexperienced and loves to tinker with networks, various hardware devices, and systems. I have previously explored some best practices for thin client development; details can be found in this article:

The most critical and challenging point is how to access home devices, such as servers and Mac hosts, in an external network environment. In my previous solution, I used the FRP tool for intranet penetration. After more than half a year, it remains stable and is still my top recommendation.

However, when I saw Yachen Liu's article "Surge Ponte Development Notes," I felt the urge to tinker again.

With the May Day holiday approaching, I planned to be out for a few days. Since my daily development is done on my home machine, I wanted to access it while away. Coincidentally, I had just reinstalled the system and hadn't configured the FRP client, so I thought I might as well try Surge Ponte directly.

So, the night before my departure, I upgraded Surge 5 and configured Surge Ponte. After some exploration, I found that compared to FRP or other similar solutions, Surge Ponte has absolute advantages in configuration usability and extensibility.

The tinkering with Surge Ponte definitely deserves a detailed blog post, so I won't explain the principles and configuration details in this weekly report; I will simply showcase some of the features I am currently using.

When I enabled Surge Ponte on both my 16-inch MBP and my home Mac Studio (I am using the NAT traversal via proxy mode, which only requires a line that supports UDP, such as a self-built Trojan protocol proxy), I could see it among the registered devices.

surge_ponte_config

At this point, when the device has remote login permissions enabled, I can directly log in to the host remotely using a command like ssh [username]@[surgepontename].sgponte, thus supporting remote development with VS Code.

surge_ponte_ssh

Of course, this is something that FRP can also easily achieve, but a more powerful aspect is that the services we start on our home machine can also be accessed directly via a URL like [surgepontename].sgponte:[port]. For example, after SSHing into my home Mac Studio and starting a local Next.js web service, I can access it directly on my MBP via http://yu-macstudio.sgponte:3000 (although FRP can also map services, it requires writing port mapping rules on the FRP client side).

surge_ponte_servies

So theoretically, by connecting to the host via VS Code and modifying code files using the [surgepontename].sgponte:[port] method, I can achieve a complete local debugging experience, balancing portability and performance (Alright, I’ll sell the MBP and get an Air).

Another practical scenario is that we often have services that can only be accessed within our home LAN, such as soft router configurations, NAS, Raspberry Pi, etc. In this case, using FRP would require configuring each one individually, while Surge Ponte can achieve external access directly by setting DEVICE rules. For example, I can now access my home router's configuration page directly using http://router.asus.com while away, which is very convenient for remotely managing some permanent services at home.

surge_ponte_router

There are many other fun applications, such as directly accessing files on home devices via the SMB protocol, etc. Future blog posts will try to cover some interesting application scenarios, so interested friends can keep an eye out (please urge me to update).

Recent Updates#

nie_nie_in_painting

My friend is painting oil paintings of Nie Nie!!! This is just a draft, and there will be a few more details added, but I couldn't help but want to showcase it; it's so beautiful!!!

nie_nie_and_new_toys_01

nie_nie_and_new_toys_02

A new cat climbing frame, starting vacation mode early!

I’m a bit nervous about taking her for spaying after May Day, hoping everything goes well.

Interesting Things and Items#

Input#

Although most interesting inputs will automatically sync in the "Yu's Life" Telegram channel, I still selected a portion to list here, making it feel more like a newsletter.

Articles#

Videos#

Similarly, I also recorded some interesting videos I watched:

Anime#

  • Demon Slayer: Swordsmith Village Arc, super looking forward to it!!! Hope it doesn't collapse.
  • The Child I Push, seems to have high discussion, but I've heard it's a bit bloody; I watched a bit of the beginning.
Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.