Eric Lee

@happyeric77

Joined on Jun 15, 2020

  • Migrate existing Django project from SaaS (Heroku) to cloud VM (Oracle VPS) Source: draw.io Here is the tutorial to guide through how to migrate the django project including postgresql db from Heroku to Oracle VPS. Make Django project production by Nginx & gunicorn Source: draw.io
     Like  Bookmark
  • When doing the integration with notifi.network notification service, testing the "card" (can be registered from notifi admin panel) in development environment is important to ensure the DAPP is working as expected. This playground makes use of the following three key SDKs' example code. You will be able to fill in your own card info (or credential) to try out the result. @notifi-network/@notifi-network/notifi-node @notifi-network/notifi-react-card @notifi-network/notifi-react-hook TRY IT OUT Playground Source code: Githug repo
     Like  Bookmark
  • This project is inspired from Typechain truffle-v5 example. Debugging EVM solidity project is always a pain when writing "JS" test script. The video here is to guid you through how to use Turrfle framework with typescript. source code video hackMD Just clone the boilderplate and yarn install the dependancy. And we are ready to go.
     Like  Bookmark
  • We can use ssh reverse tunnel as an approach to access our local device under the localnet work behind the firewall or NAT. Please check the detail from Video tutorial Flow diagram Cmd ssh -N -R localhost:1234:localhost:22 -i </path/to/ssh/private/key> ubuntu@<cloud.vm.ip.address> Service file
     Like  Bookmark
  • Section#1 deploying multi docker application onto cloud server Video work-through
     Like  Bookmark
  • In this section, we will create two servers graphQL server with dummy database Frontend web server to get data from database in our graphQL server. And most importantly, we are using JWT (JsonWebToken) to restrict only the frontend can access graphQL server to query data. See the detail from the youtube Reference Section#1: Graphql endpoint
     Like  Bookmark
  • Solana's lending protocol is inspired by EVM AAVE & Compound. In this article, we will go through the basic idea of spl token-lending protocol to get to know how it work in very high level concept. The Account architecture There are 3 very important PDA account categories in token-lending protocol Lending market Reserve
     Like  Bookmark
  • Normal access through ssh SSH has both server and client side. we can install thorugh following command // server sudo apt install openssh-server // client sudo apt install openssh-client Normal unix base system has deault client installed
     Like  Bookmark
  • In this article, I am trying to dig into anchor feature more deeply by adpoting a simple and widely used concept in blockchain field called Locker (or vesting) It will cover: Two types of PDA in Anchor Derivation PDA Creation PDA Access control
     Like 1 Bookmark
  • Managing the server side data (API request ..etc) is always a pain. We need to handle all possible case when we start fetching the data. UseEffect: To decide when to update data Many useState: To handle all kind of possible fetch states in order to show it on page (isLoading/ error/ refetch ...etc) Create custom hook and provider to feed it to all compoents react-query is a perfect tool to make our life easier in such case. Start with react-query with nextJS In this case, we will utilize our existing project of "solana-dapp" since managing solana blockchain's complicated state is alwasy a pain.
     Like  Bookmark
  • The concept of NFT in Solana is quite different from it is in EVM blockchain. I would say it is more flexable and intuitive in Solana. Basic concept of Solana NFT Unlike EVM, NFT in Solana is just a normal SPL (ERC20 in EVM) token with supply = 1. Then we just simply link an Metadata to this SPL token. Metaplex is the one which is incharge of creating the metadata. We can get more clear idea from the graph below: How to mint a NFT Prepare the target image (png/jpeg/gif ...)
     Like  Bookmark
  • The error msg shows whne trying to update the submodule of my github repo (git submodule update --init --recursive) Issue (base) macbookpro4eric@Erics-MacBook-Pro dappio-ui-v2 % git submodule update --init --recursive Submodule 'nft-staking' (git@github.com:DappioWonderland/nft-staking.git) registered for path 'nft-staking' Cloning into '/Users/macbookpro4eric/Projects/dappio/dappio-ui-v2/nft-staking'... git@github.com: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights
     Like  Bookmark
  • Observer pattern is the most common used pattern in web development. It can be almost commonly seen everywhere when using DOM's evenLisener There are two key factors in such pattern: Subject class: subject changes will trigger the event sending the updated value to all the observers Observer class: Passively listen to the event sent from Subject object Lets dive into the code: Firstly, we can define the interfaces for Observer (subscriber) and Subject (Event sender)
     Like  Bookmark
  • Decorator design pattern is nothing about the syntax of decorator. It is just a pattern of organize the code in case that we want to extend one or more feature base on the existing object. Taking an example if we have an restaurant which have many menu. We can use decorator pattern to set a base meal class, instanciate it and wrap many option around it. This is much better than setting a list of properties in the meal class, check if the certain properties are met and then calc the condition. Lets dive into the code to see the implimentation. abstract class MealSet {
     Like  Bookmark
  • In this article, we are going to deploy a production server that we created on docker section The flow will like below: Runing the docker application on port 3000 (this one is already done on previous section) Start very first Nginx server on VPS Apply for a Doman and direct it to our VPS public IP Use certbot to create a SSL certification Config Nginx
     Like  Bookmark
  • It is the simple blueprint of what we are going to build over this article Local Frontend express application Get backend db working with official mongodb container To make thing easier, we will need two containers mongodb: this is the official container of mongodb database mongo-express: this is the express ui to let us to manipulate the db easier.
     Like  Bookmark
  • Use Anchor framework to create a swap smart contract in Solana blockchain Before start, make sure the following pre-requisision is done anchor-cli 0.19.0 cargo 1.58.0 (f01b232bc 2022-01-19) rustc 1.58.1 (db9d1b20b 2022-01-20) We also need to have typescript and node (>12) installed.
     Like 2 Bookmark
  • This is the example of connection.getProgramAddress. The function the get all the PDA under a certain programId In this case, we want to filter out a PDA which has following data struct export const FARM_LEDGER_LAYOUT_V5_2 = struct([ u64("state"), publicKey("id"), publicKey("owner"), u64("deposited"),
     Like  Bookmark
  • Background Migarte the frontend query logic as a sql. Issue Not able to use native browser function. need to migrate it to node env Native node module does not support typescript Setting
     Like  Bookmark
  • Set up Heroku environment Heroku account is needed. Please sign one up for this application. Install heroku CLI brew tap heroku/brew && brew install heroku Log into Heroku account and create a new project
     Like  Bookmark