============
== vtranq ==
============

Crypto

Takeaway

News sources

  • coin24h.co

TODO

  • Nghiên cứu chi tiết về Solana (code, cách tạo ra, lịch sử, điểm mạnh, tiềm năng, khả năng tăng đến bao nhiêu)
  • List các coin, công nghệ, use-case, số lượng nodes, current/total/max supply là bao nhiêu
  • Verify bank account để có thể rút tiền

Các bước

  1. Tìm hiểu / phân tích coin
  2. Tạo wallet có hỗ trợ coin đó
  3. Tạo account trên sàn giao dịch uy tín và có hỗ trợ coin đó
  4. Mua coin trên sàn & lưu coin vào wallet

Để gia tăng tài sản

  • Dùng leverage truyền thống: vay/mượn để có khoản tiền lớn hơn
  • Dùng công cụ leverage trên các sàn: rủi ro rất cao, do đặc tín biến động lớn của các coin

Cơ bản về 1 coin nào đó

  • Giải thuật bên dưới là gì?
  • Market cap ntn
  • Hệ thống network hỗ trợ ntn
  • Tốc độ xử lý các giao dịch như thế nào?
  • Phí mỗi giao dịch ntn?

Tạo wallet như thế nào?

  • Các loại wallet: Phần mềm, phần cứng
  • Không nên lưu tại các wallet trên sàn, vì sàn dễ bị tấn công. Sàn chỉ là kết nối giữa người mua và người bán mà thôi, giao dịch thực hiện trên hệ thống blockchain chứ không phải trên sàn
  • Một số loại wallet mềm
  • Hướng dẫn chuyển coin từ sàn vào wallet: https://help.phantom.app/hc/en-us/articles/4406393831187-How-to-deposit-SOL
    • NOTE: bản thân sàn và wallet cũng không lưu coin, mà chỉ lưu tham chiếu đến block trên Solana chain mà thôi

Deposit như thế nào?

  • Deposit từ VN ntn?
  • Có hỗ trợ deposite từ card?

Cơ chế mua, bán, lưu trữ coin ntn?

Top các coin đáng quan tâm

Các câu hỏi

  • Các đồng tiền ảo cứ tạo ra quá trời, nếu cứ tăng giá cao, toàn bộ market cap rất lớn –> lạm phát ah???
  • Tại sao đồng tiền ảo biến động?
  • Khi nào biến động lên?
  • Khi nào biến động xuống?
  • Open source của tiền ảo có nghĩa gì?
  • Tại sao một coin open source lại có khả năng tăng giá cao?
  • Tạo ra coin token như thế nào?

Solana

  • Github: https://github.com/solana-labs/solana
  • Docs: https://docs.solana.com/introduction
  • Viết bằng Rust
  • Tốc độ nhanh gấp nhiều lần Etherium
  • Đã tăng giá hơn 1000 lần
  • Solana is an open source project implementing a new, high-performance, permissionless blockchain.
  • It is possible for a centralized database to process 710,000 transactions per second on a standard gigabit network if the transactions are, on average, no more than 176 bytes. A centralized database can also replicate itself and maintain high availability without significantly compromising that transaction rate
  • Solana open source project, a blockchain built from the ground up for scale. They cover why Solana is useful, how to use it, how it works, and why it will continue to work long after the company Solana closes its doors. The goal of the Solana architecture is to demonstrate there exists a set of software algorithms that when used in combination to implement a blockchain, removes software as a performance bottleneck, allowing transaction throughput to scale proportionally with network bandwidth. The architecture goes on to satisfy all three desirable properties of a proper blockchain: it is scalable, secure and decentralized.
  • The architecture describes a theoretical upper bound of 710 thousand transactions per second (tps) on a standard gigabit network and 28.4 million tps on 40 gigabit.
  • A Solana cluster is a set of independently owned computers working together (and sometimes against each other) to verify the output of untrusted, user-submitted programs
  • A SOL is the name of Solana’s native token, which can be passed to nodes in a Solana cluster in exchange for running an on-chain program or validating its output. The system may perform micropayments of fractional SOLs, which are called lamports. They are named in honor of Solana’s biggest technical influence, Leslie Lamport. A lamport has a value of 0.000000001 SOL.
  • Like an account at a traditional bank, a Solana account may hold funds called lamports. Like a file in Linux, it is addressable by a key, often referred to as a public key or pubkey
  • In November of 2017, Anatoly Yakovenko published a whitepaper describing Proof of History, a technique for keeping time between computers that do not trust one another. From Anatoly’s previous experience designing distributed systems at Qualcomm, Mesosphere and Dropbox, he knew that a reliable clock makes network synchronization very simple. When synchronization is simple the resulting network can be blazing fast, bound only by network bandwidth.
  • Anatoly watched as blockchain systems without clocks, such as Bitcoin and Ethereum, struggled to scale beyond 15 transactions per second worldwide when centralized payment systems such as Visa required peaks of 65,000 tps. Without a clock, it was clear they’d never graduate to being the global payment system or global supercomputer most had dreamed them to be. When Anatoly solved the problem of getting computers that don’t trust each other to agree on time, he knew he had the key to bring 40 years of distributed systems research to the world of blockchain. The resulting cluster wouldn’t be just 10 times faster, or a 100 times, or a 1,000 times, but 10,000 times faster, right out of the gate!
  • In June of 2018, the team scaled up the technology to run on cloud-based networks and on July 19th, published a 50-node, permissioned, public testnet consistently supporting bursts of 250,000 transactions per second. In a later release in December, called v0.10 Pillbox, the team published a permissioned testnet running 150 nodes on a gigabit network and demonstrated soak tests processing an average of 200 thousand transactions per second with bursts over 500 thousand. The project was also extended to support on-chain programs written in the C programming language and run concurrently in a safe execution environment called BPF
  • Solana aims to be much more scalable than ethereum with lower transaction fees and faster block times (under a second)!
  • Là blockchain web-scale đầu tiên trên thế giới
Solana có nguồn gốc ra đời vào năm 2017, khi Anatoly Yakovenko – một nhà phát triển có nhiều kinh nghiệm đến từ Qualcomm xuất bản bản thảo whitepaper mô tả chi tiết kỹ thuật chấm công mới cho các hệ thống phân tán, được gọi là thuật toán Proof of History (PoH).

Trong các nền tảng như Bitcoin hay Ethereum, hạn chế duy nhất với khả năng mở rộng chính là thời gian cần thiết nhằm đạt sự đồng thuận về thứ tự giao dịch. Anatoly tin tưởng vào kỹ thuật mới của mình có thể giúp tự động hoá quy trình đặt hàng giao dịch cho các blockchain, giúp mạng lưới tiền điện tử có thể mở rộng quy mô ra ngoài khả năng của chúng.

Sau đó, Anatoly đã hợp tác với đồng nghiệp cũ của Qualcomm là Greg Fitzgerald để xây dựng mạng blockchain duy nhất trong Rust, nhằm để sử dụng PoH làm “đồng hồ nội bộ” riêng cho nó. Anatoly và Greg phát hành testnet và bản chính thức, whitepaper của dự án vào tháng 2 năm 2018.

Nhận thấy được tiềm năng đặc biệt của Solana, những tên tuổi lớn trong ngành công nghệ cũng đang đứng đằng sau để hỗ trợ cho dự án này phải kể đến Qualcomm, Google, Microsoft,… Ngoài ra còn có một số quỹ đầu tư lớn như Foundarion Capitan, CMCC Global, Multicoin Capital,.. cũng đang chú ý và quan sát quá trình phát triển của Solana từng ngày.
  • Chi phí giao dịch trên Solana chỉ mất 10 USD cho 1 triệu lượt giao dịch. Đây là một chi phí quá rẻ nên thị trường tiền kỹ thuật số hiện nay.
  • Ngoài tính năng đặc biệt là Proof of History (PoH) thì Solana còn mang trên mình những tính năng nổi trội khác như:
Tower BFT: phiên bản đã được tối ưu hoá PoH của hệ thống chịu lỗi Byzantine.
Turbine: một giao thức truyền khối.
Gulf Stream: giao thức chuyển tiếp giao dịch mà không cần đến Mempool.
Sealevel: thời gian để chạy các hợp đồng thông minh song song nhau.
Pipelining: đơn vị để xử lý các giao dịch, giúp tối ưu hoá xác thực.
Cloudbreak: đây là cơ sở dữ liệu của tài khoản mở rộng theo chiều ngang.
Archivers: lưu trữ sổ cái phân tán
  • Solana còn có tốc độ giao dịch và tạo khối cực kỳ nhanh, đồng thời không cần phải lo ngại về vấn đề mở rộng của blockchain và có thể bảo mật ở cấp độ doanh nghiệp.
  • Độ trễ thấp của Solana chỉ rơi vào tầm khoảng ~1 giây. Nhờ thuật toán PoS mà chi phí giao dịch của Solana được xếp vào hạng thấp nhất trên thị trường. Đây cũng có thể coi là một ưu điểm lớn thu hút người dùng tham gia vào mạng lưới này.
  • THÔNG TIN CƠ BẢN VỀ ĐỒNG SOLANA (SOL)
Name: Solana
Ticker: SOL
Blockchain: Solana
Consensus: PoS
Token type: Utility Token
Total Supply: 1.000.000.000 SOL
Initial Total Supply: 500.000.000 SOL

  • Solana đã phân phối token trong 5 vòng tài trợ khác nhau. 4 vòng trong số đó là bán riêng từ quý 1 năm 2018.
  • Người dùng có thể mua và bán SOL trên các sàn giao dịch lớn vì SOL được đánh giá rất cao trên thị trường. Một trong những sàn ví dụ như là Binance, OKEx, Hoo, Bitmax, MXC, Bithumb Global, Gate.io, Huobi global,…
  • Đội ngũ dự án của Solana bao gồm các nhân sự chất lượng hàng đầu, đều từng có nhiều kinh nghiệm tại các công ty công nghệ lớn trên thế giới.
  • “Solana vẫn đang chứng tỏ mình là một giải pháp thay thế linh hoạt và tốt hơn Ethereum. Nền tảng còn một chặng đường dài để trở thành cơ sở hạ tầng DeFi và NFT chính … Tuy nhiên, cần phải có các nâng cấp và tính năng tốt hơn để duy trì sự phát triển và đánh bại sự cạnh tranh từ nhiều blockchain khác, bao gồm cả Cardano và Ethereum”
  • Mặc dù mới chỉ ra mắt từ năm 2020, nhưng hệ sinh thái trên Solana đã phát triển rất phong phú và đa dạng. Có tới hàng trăm dự án đã và đang được xây dựng trên nền tảng này.
  • Top coin tiềm năng thuộc hệ sinh thái Solana
Oxygen (OXY)
Star atlas (ATLAS và POLIS)
Synthetify (SNY)
Solanium (SLIM)
Solfarm (TULIP)
Raydium (RAY)
Serum (SRM)
Bonfida (FIDA)
Orca (ORCA)
Mango (MNGO)

Refs

Create a token

Exchange

Wallet

  • Finally if you have large amount of cryptocurrencies and don’t plan on trading them then you should move them from the exchange to your wallet. Keeping coins on your exchange account is highly not recommended. You don’t own the private keys. If the exchange gets hacked you’ll lose all your holdings.

Trust wallet

  • Trust wallet was acquired by Binance in 2018 and is currently the official wallet of Binance.

  • While it is acquired by a centralized exchange the wallet itself is decentralized. Meaning users control their wallet and the private keys are stored on users own device. Moreover the wallet is open source and community driven. Anybody can be part of it, review the code and contribute to the development.

Tạo wallet

Blockchain in Rust

Blockchain education

Programming

Create a wallet

Blockchain to watch

Misc

  • Các blockchain
bitcoin     Bitcoin blockchain
cyber       cyber blockchain
ethereum    Ethereum blockchain
kusama      Kusama blockchain
monero      Monero blockchain
polkadot    Polkadot blockchain

Polkadot

  • https://github.com/paritytech/polkadot
  • cuộc đấu giá parachain đầu tiên của Polkadot sẽ diễn ra vào ngày 11 tháng 11
  • Nói một cách chi tiết, các parachains của Polkadot là chuỗi song song, dành riêng cho ứng dụng – các sổ cái con được gắn với một sổ cái mẹ duy nhất được gọi là Chuỗi chuyển tiếp. Do tính chất song song của chúng, các parachains có xu hướng xử lý nhiều giao dịch đồng thời, duy trì và ghi lại dữ liệu của chúng trên sổ cái chính bằng cách giao tiếp với các chuỗi khác.
  • 5 years after the vision of a heterogeneous multichain framework was first outlined in the Polkadot Whitepaper, parachains are now ready to launch on Polkadot
  • DOT, đóng vai trò như một mã thông báo tiện ích cho phí, quản trị, khả năng tương tác và liên kết bên trong hệ sinh thái Polkadot, đã tăng hơn 24% sau thông báo đấu giá parachain.
  • Polkadot (DOT) is available on Coinbase.com and in the Coinbase Android and iOS apps. … Trading for this asset is also supported on Coinbase Pro
  • Polkadot is a network protocol that allows arbitrary data—not just tokens—to be transferred across blockchains.
  • This means Polkadot is a true multi-chain application environment where things like cross-chain registries and cross-chain computation are possible.
  • Polkadot can transfer this data across public, open, permissionless blockchains as well as private, permissioned blockchains.
  • The Polkadot runtime environment is being coded in Rust, C++, and Golang

Cardano

  • Cardano is an open-source, decentralized public blockchain and cryptocurrency project, developing a smart contract platform that includes advanced features. The Cardano team says that its blockchain platform evolved out of scientific philosophy and research-driven approach, executed through global collective of expert engineers and researchers. ADA is the native cryptocurrency of the Cardano platform, available for purchase on the Binance exchange.

Binance

  • Binance accepts a wide range of currencies and makes it easy for you to buy crypto using USD , EUR, CNY, AUD, INR, RUB,and other fiat currencies. You can also use a wide range of accepted stablecoins such as Binance USD (BUSD), Coinbase USD Coin (USDC), and Tether (USDT) to buy crypto.

Shiba

  • Shiba Inu coin started as a copy of joke coin DOGE this year but has quickly overtaken the popular altcoin.

Các câu hỏi

  • Mua trực tiếp coin X bằng thẻ hay phải thông qua USDT?
  • Bán coin X rút tiền về ngân hàng như thế nào? Tổng thời gian bao lâu? Có những rủi ro gì?
  • Verify bank account để rút tiền? –> phải thử xem quy trình ntn? Khi tiền về có báo tin nhắn???
  • Sử dụng sàn giao dịch nào cho an toàn? FTX? eToro?
  • Sau khi mua coin ở sàn Binance rồi thì chuyển sang ví bên ngoài ok ko? Nên dùng ví nào cho an toàn?
  • Có thể chuyển coin từ sàn Binance sang các sàn khác được không?
    • Yes, you can transfer cryptocurrency directly between exchanges and you don’t need a wallet in between. It works the same way as sending Bitcoin from your wallet to another address.
    • There are many reasons for one to move coins from one exchange to another. It may be to regional exchange to cash out their crypto. It can be to buy their favorite altcoin which is only listed on that particular exchange. Or it can be their favorite trade exchange.
    • Before sending your coins in and out of the exchange you must note that there are three things involved in every transaction: Withdrawal fee, network fee and transaction time.

Deposit

Php Tips

Session timeout

REF: https://solutionfactor.net/blog/2014/02/08/implementing-session-timeout-with-php/

So despite the session ini settings available, if you want a reliable session timeout, you’re forced to implement your own. Fortunately doing so is pretty easy.

First, set session.gc_maxlifetime to the desired session timeout, in seconds. E.g. if you want your sessions to timeout after 30 minutes, set session.gc_maxlifetime to 1800 (60 seconds in a minute * 30 minutes = 1,800 seconds). What this does is ensure a given session file on the server can live for at least that long.

Second, and what a lot of other posts out there don’t mention, is that you also need to set session.cookie_lifetime to at least the same value (1,800 seconds, in this case). Otherwise, the phpsessid cookie may expire before 30 minutes is up. If that happens, the cookie is removed and the client has no way of identifying its session id to the server anymore. That effectively terminates the session before our 30 minute session window.

Third, add the following code to your app’s entry point, or any point in your app that’s executed on every request (usually an index.php file, front controller, bootstrap file, etc.).

$time = $_SERVER['REQUEST_TIME'];

/**
* for a 30 minute timeout, specified in seconds
*/
$timeout_duration = 1800;

/**
* Here we look for the user's LAST_ACTIVITY timestamp. If
* it's set and indicates our $timeout_duration has passed,
* blow away any previous $_SESSION data and start a new one.
*/
if (isset($_SESSION['LAST_ACTIVITY']) &&
   ($time - $_SESSION['LAST_ACTIVITY']) > $timeout_duration) {
    session_unset();
    session_destroy();
    session_start();
}

/**
* Finally, update LAST_ACTIVITY so that our timeout
* is based on it and not the user's login time.
*/
$_SESSION['LAST_ACTIVITY'] = $time;

What that does is keep track of the time a user’s session started. That’s tested on every request to see if their session has expired a 30 minute window. If so, a new session is created. This might also be where you’d handle re authenticating the user somehow, if needed, usually by giving them a login expired, or login UI, of some sort.

Worklog - Week 11/10

MỤC TIÊU:

  • Hoàn chỉnh template và nội dung cho dev.vms
  • Finalize phần accounting 2020 cho VMS và cập nhật các báo cáo năm trước 2019
  • Plan nội dung và launch phiên bản draft cho cargotek cho các giải pháp logistics/warehouse
  • In phiếu thu cho OLC
  • Thiết lập price và customer list cho e-invoice
  • Tích hợp Varsome API (vì nó cung cấp đầy đủ ACMG annotation, tổng hợp từ nhiều nguồn dữ liệu; mà trong các phân tích gene thì việc check Varsome là thường xuyên) –> dùng API là một cách cost-effective, thay vì tốn công sức để build một hệ thống tương tự; hỗ trợ Varsome API và charge khách hàng về chức năng này

PHÁT SINH:

TAKE-AWAY:

VMS

Genome

  • Takeaway: Varsome cung cấp ACMG classification đầy đủ nhất » đầy đủ hơn Clinvar và Intervar
    • Xem có cách nào automate lấy kết quả hàng loạt từ Varsome, vd: thông qua API, hoặc cách khác…
  • VarSome API charges per megabyte of data transferred, subject to a minimum monthly fee
  • Sample API link: https://api.varsome.com/lookup/NM_001256850.1:c.18199C%3EA/1038?add-all-data=0&add-ACMG-annotation=1&annotation-mode=germline Trong đó, chỉ cần quan tâm mục acmg_annotation
  • Varsome API có hỗ trợ cung cấp các thông tin như giới tính, độ tuổi, chủng tộc
  • Không scrape Varsome được (cho dù dùng proxy) vì Varsome check authentication, rồi check limit của user đó
  • Tạm thời tắt DIRECT_MUTATION_TASTING để chức năng lọc All variants có thể chạy nhanh hơn

VNPT invoice decimal price hack

Vấn đề

Bên danh mục sản phẩm không cho nhập chữ số thập phân, do họ set NumberBehindComma khi post thông tin update đến https://3800102447-cadmin.vnpt-invoice.com.vn/Product/Update

  • Việc set này là thông qua một hidden input NumberBehindComma trên form

Cách fix

  • Đầu tiên, inspect trên Chrome rồi sửa lại NumberBehindComma như sau:
<input data-val="true" data-val-number="The field Int32 must be a number." data-val-required="The Int32 field is required." id="NumberBehindComma" name="NumberBehindComma" type="hidden" value="4">
  • Tiếp đó, sửa lại đơn giá trên form với phần số thập phân, VD: 18827,2727
  • Sau đó nhấn nút “Lưu” để cập nhật lại giá. Giá sẽ được cập nhật vào database, nhưng trên danh mục sản phẩm nó vẫn hiển thị làm tròn giá; Tuy nhiên, khi tạo hóa đơn thì nó lấy giá từ database nên vẫn thể hiện được phần thập phân

Cách fix 2

  • Dùng chức năng upload sản phẩm để cập nhật giá cho các sản phẩm
    • Không cần xóa các sản phẩm có sẵn; nếu trùng mã thì nó sẽ cập nhật; nếu khác mã nó sẽ tạo mới
    • Dùng dấu chấm (.) cho phần thập phân trong đơn giá
    • Bắt buộc phải có đơn giá; có thể dùng số 0 cho đơn giá

Nhận giao hàng

  • Là hub để user đăng ký giao hàng; có kết nối với các đơn vị vận chuyển; đơn vị nào được giao thì sẽ biết thông tin của khách để đến lấy hàng
  • Khách hàng có nhu cầu thì họ ra VNPT Post, Viettel post gởi một phát là xong, việc gì phải lên website này?
    • -> chỉ có thể dùng cho nhu cầu giao nhanh local trong khu vực; ship đồ ăn, đồ uống, đi chợ…
    • Có thể hợp tác với các siêu thị, cửa hàng để giao hàng…
    • Như vậy phải hình thành một service giao hàng riêng biệt
    • Giao hàng là một phần trong miếng bánh logistics –> cần phải duy trì phát triển, có nhiều tiềm năng tương lai
    • Nhận giao hàng cũng có thể đăng danh sách các cty giao hàng container…/ trên đó có nhiều category, mỗi category thì có một list các công ty vận tải đăng ký trên đó

Crypto & blockchain

  • Tin tức coin: https://webgiacoin.com/tin-tuc/DeFi
  • Nắm kiến thức nền tảng thì mới tự do lựa chọn và quyết định
    • GREAT: hướng dẫn mua coin: https://www.benzinga.com/money/how-to-buy-solana/
      • Trước mắt, nên đứng như nhà quan sát, khoan vội nhảy vào
    • Detect các mover để xem basics behind nó là gì; nếu là tiềm năng lớn thì có thể đầu tư
  • Chi tiết về các coins: https://en.wikipedia.org/wiki/List_of_cryptocurrencies
  • Tìm hiểu Consensus mechanism: POW, POS
  • All coins: https://coinmarketcap.com/all/views/all/
  • https://www.investopedia.com/news/top-marijuana-cryptocurrencies/
  • Có các sàn giao dịch tiền ảo, với thanh toán bằng fiat currencies like USD, CAD, INR, EUR, etc. or cryptocurrencies like BTC, ETH, USDT, XMR, LTC, NEO, etc
  • Dùng blockchain cho lĩnh vực bảo hiểm: https://www.cryptoground.com/a/linux-foundation-unveils-a-blockchain-based-platform-for-american-association-of-insurance-services
  • Binance coin runs on the Ethereum blockchain and follows the ERC-20 standards, which states the strict limit of 200 million BNB tokens at max
  • Many other exchanges other than Binance list BNB but it is not really any use other than its own platform. On other platforms the liquidity of Binance Coin is low and most users buy BNB to reduce trading costs on the Binance exchange because it can be used as an alternate fee at lower costs.
  • Chi tiết về binance coin: https://www.cryptoground.com/a/binance-coin
  • Rất nhiều đồng tiền ảo chạy trên nền Ethereum
  • Stablecoin provider Tether continues to offer more evidence that its reserves fully back the USDT coins in circulation
  • The U.S Office of the Comptroller of Currency (OCC) has issued an interpretive letter that allows banks to leverage stablecoins and independent node verification networks (INVNs) in their operations.
  • Tìm hiểu chi tiết về Stablecoin & Litecoin
  • Litecoin (LTC/USD)
  • The Tether was traded in exchange for the first time around 25 Feb 2015. It is in various exchanges since then.
  • Tether price is highly volatile. It depends on various factors like news, laws, policies, etc.
  • cardano
    • Cardano Slips to 5th-Largest Crypto Market Position — ADA Down 30% Since All-Time High Last Month
  • Các yếu tố đánh giá giá trị của 1 crypto là gì?
    • The fundamentals are also solid, with good tech, a good team and many real-world use cases
    • Số lượng block validating nodes
  • One expert on the panel, Sarah Bergstrand, estimated ETH could reach $100,000 by 2025. The biggest upgrade being eyed by investors is EIP-1559, which will overhaul the transaction fee system used by Ethereum
  • Coin quá nhiều –> lạm phát coin ah? –> khi đó coin lại xuống giá ah?
  • Polkadot, often referred to as the Ethereum-Killer, has announced the schedule for the much-anticipated debut of its Parachain slot auctions.
  • Solana, also called the ‘Ethereum Killer’ hit an all time high of $124 at 5:30pm on August 31 Indian Standard Time (IST). The cryptocurrency which only made its debut 18 months ago is now the seventh largest player in the crypto market. Solana’s price has quadrupled over the last one month
  • The Motley Fool reported that Solana is faster than Ethereum, processing 50,000 transactions per second or more compared to Ethereum’s 15 to 45 TPS rate. … Ethereum has the advantage of being first, but Solana could prove to be faster and better.
  • altcoin
  • Ethereum still seems to be the one true altcoin to Bitcoin. No one has stolen its thunder. Can Polkadot take some of that? “Yes. Definitely. I believe Polkadot is in prime position to take over the altcoin space currently occupied by Ethereum,”
  • Solana, a cryptocurrency that provides decentralised finance (DeFi) solutions, is now among one of the most promising candidates to take down Ethereum’s dominance — at least according to the crypto community.
  • While other DeFi cryptocurrencies — like Cardano, Polkadot and Ethereum — have also surged, their rise has not been as massive as Solana’s
  • Solana is also different from its competitors since it runs on the proof-of-history (PoH) method rather than on proof-of-work (PoW) like Bitcoin or proof-of-stake (PoS) like Cardano — and soon Ethereum
  • These reasons make Solana cheaper and faster than Ethereum when it comes to executing smart contracts, and in turn, lure in investors as well as developers alike
  • “Yet, it would very difficult for Solana to replace Ethereum, mainly because Ethereum has a better hold on the market, thanks to its early entry and eventually having very high brand recognition. Solana, no doubt, has better technology, but it takes time for people to adopt new technology,” said Ranga of Zebpay
  • Following this logic, with a TPS of 29,000 and a transaction finality of 2.5 seconds, Solana is the fastest cryptocurrency and takes the crown. Bitcoin Cash has a fundamental difference from Bitcoin, and it aims to solve one of cryptocurrency’s biggest issues.
  • Solana Prices Have Skyrocketed More Than 13,000% Year-To-Date
  • As of August 2021, there are about 400 block validating nodes (referred to as bakers) on the Tezos network.[1]
  • Giải thuật proof-of-stake thân thiện môi trường hơn proof-of-work
    • Due to its energy-efficient proof-of-stake algorithm[6][7][8][9] which became a popular topic amid concerns of the energy requirements of alternative proof of work platforms, Tezos has been selected by brands to build their Non-Fungible Tokens (NFTs) platforms and fan experiences
  • In Tezos' LPoS model, network nodes that validate blocks and add them to the blockchain – known as bakers – are selected to perform those actions proportionally to their share of rolls of 8,000 XTZ that they put up for stake, and a baker receives staking rewards in the form of newly minted XTZ after successfully validating a block and adding it to the blockchain.[30] Holders of XTZ can delegate their XTZ to bakers to share in the staking rewards that bakers receive.[30] Holders of XTZ who do not stake or delegate their XTZ risk suffering a loss in value due to inflation as new XTZ are created and distributed to bakers for validating new blocks and adding them to the blockchain. The current annual inflation rate is 3.6%.[30] As of January 2021, nearly 80% of all XTZ in circulation were either directly staked by bakers or delegated to bakers for staking.
  • Solana’s native cryptocurrency is SOL, which is used to pay transaction fees and for staking
  • Solana is available to U.S customers on a few notable exchanges, including Binance, Coinbase and Crypto.com. If you’re a U.S based investor, then Coinbase is a great place to start investing in crypto, as it’s 1 of the oldest and most established cryptocurrency exchanges in the industry.
  • The cryptocurrency’s price has climbed rapidly amid rising interest in decentralized finance applications and non-fungible tokens. With its blockchain network capable of supporting smart contracts, application development, and fast transaction times, Solana has emerged as a top competitor to Ethereum
  • The token began trading in April 2020 for about $0.75. Throughout the year, Solana roughly doubled in price. It wasn’t until 2021 when Solana gained mainstream attention, quickly rising to the 10th largest cryptocurrency by market capitalization. At the time of writing, Solana is trading hands around $130, and it has a market cap of over $35 billion.
  • Solana outperformed almost every digital asset this summer, as investors are focusing their attention on scalable blockchains that support smart contract functionality. Other competitors to Solana include Binance Smart Chain, Ethereum and Cardano.
  • You can buy Solana on Binance using USDT or Bitcoin. Tether (USDT) is a stablecoin pegged to $1, so it simulates investing with fiat currency. Some cryptocurrency investors like to trade against Bitcoin, as this provides a metric for how well an investment does in terms of Bitcoin.
  • Phí chuyển tiền SWIFT ra nước ngoài quá cao (25 USD cho mỗi lần chuyển)

Coin hype

Web templates

Rust

Misc

Genome App

Takeaway

  • Varsome cung cấp ACMG classification đầy đủ nhất » đầy đủ hơn Clinvar và Intervar
  • Cách cost-effective là tích hợp Varsome API vào app
  • Không scrape Varsome được (cho dù dùng proxy) vì Varsome check authentication, rồi check limit của user đó

Overview

Filter

  • Trên client response, user có thể lọc kết quả theo gene (hỗ trợ 1 danh sách nhiều gene cách nhau bằng dấu phẩy)
  • Khi filter thì nó sẽ tự động add thêm 1 header ADDITIONAL_USER_CLINSIG ở cuối; và tự động thêm giá trị cho cột này (lấy thông tin từ table CLINVAR)

Troubleshooting

ERROR 1: Cứ quay quay hoài khi xử lý file tsv lớn (VD: > 100MB), hoặc bị hết memory khi xử lý

  • Có thể do tập tin error.bed không writable, dẫn tới việc liftOver bị loop khi xử lý

ClinVar

Chứa các thông tin clinical significance của các variant

ACGM

Annotation tools

git clone https://github.com/WGLab/InterVar.git

and then access the InterVar directory in which you find the python script InterVar.py Call it on a normal VCF file with, as example (I use python3.7 but any distribution >3.3 should work properly):

python3.7 InterVar.py  \
    -b hg19 \
    -i <your_input.vcf> \
     --input_type=VCF \
     -o <your_output>

And then you will find your output files where you specified. Please note, in the same InterVar directory you must download Annovar executables (annotate_variation.pl, convert2annovar.pl, retrieve_seq_from_fasta.pl, coding_change.pl, table_annovar.pl, variants_reduction.pl) and the first time you run it will take long in order for Annovar to download all its reference databases in the "humandb" directory that will appear in the same "InterVar" directory where you launch the script.

Genome testing labs

ClinPred data

NOTE: trong dbNSFP cũng có tích hợp tính các điểm ClinPred

API

dbNSFP

REF: https://sites.google.com/site/jpopgen/dbNSFP

dbNSFP is a database developed for functional prediction and annotation of all potential non-synonymous single-nucleotide variants (nsSNVs) in the human genome. Its current version is based on the Gencode release 29 / Ensembl version 94 and includes a total of 84,013,490 nsSNVs and ssSNVs (splicing-site SNVs). It compiles prediction scores from 37 prediction algorithms (SIFT, SIFT4G, Polyphen2-HDIV, Polyphen2-HVAR, LRT, MutationTaster2, MutationAssessor, FATHMM, MetaSVM, MetaLR, CADD, CADD_hg19, VEST4, PROVEAN, FATHMM-MKL coding, FATHMM-XF coding, fitCons x 4, LINSIGHT, DANN, GenoCanyon, Eigen, Eigen-PC, M-CAP, REVEL, MutPred, MVP, MPC, PrimateAI, GEOGEN2, BayesDel_addAF, BayesDel_noAF, ClinPred, LIST-S2, ALoFT), 9 conservation scores (PhyloP x 3, phastCons x 3, GERP++, SiPhy and bStatistic) and other related information including allele frequencies observed in the 1000 Genomes Project phase 3 data, UK10K cohorts data, ExAC consortium data, gnomAD data and the NHLBI Exome Sequencing Project ESP6500 data, various gene IDs from different databases, functional descriptions of genes, gene expression and gene interaction information, etc.

Some dbNSFP contents (may not be up-to-date though) can also be accessed through variant tools, ANNOVAR, KGGSeq, VarSome, UCSC Genome Browser’s Variant Annotation Integrator, Ensembl Variant Effect Predictor, SnpSift and HGMD. Please cite our papers (see below) if you used dbNSFP contents through those tools.

Varsome API

    "acmg_annotation": {
        "verdict": {
            "ACMG_rules": {
                "approx_score": -7,
                "verdict": "Benign",
                "pathogenic_subscore": "Uncertain Significance",
                "clinical_score": 1.245138902391938,
                "benign_subscore": "Benign"
            },
            "classifications": [
                "BS1",
                "BS2",
                "BP1"
            ]
        },
        "version_name": "10.2.4",
        "classifications": [
            {
                "user_explain": [
                    "GnomAD exomes allele frequency = 0.00304 is greater than 0.00161  (threshold derived from the 17 011 clinically reported variants in gene TTN) (unable to check gnomAD exomes coverage)."
                ],
                "met_criteria": true,
                "name": "BS1"
            },
            {
                "user_explain": [
                    "Observed in healthy adults: gnomAD genomes allele count = 343 is greater than 5 for dominant gene TTN (good gnomAD genomes coverage = 31.5)."
                ],
                "met_criteria": true,
                "name": "BS2"
            },
            {
                "user_explain": [
                    "1 141 out of 1 185 non-VUS missense variants in gene TTN are benign = 96.3% which is more than threshold of 51.0%, and 5 708 out of 17 011 clinically reported variants in gene TTN are benign = 33.6% which is more than threshold of 24.0%."
                ],
                "met_criteria": true,
                "name": "BP1"
            }
        ],
        "coding_impact": "missense",
        "gene_symbol": "TTN",
        "transcript": "NM_001256850.1",
        "transcript_reason": "user-selected",
        "gene_id": 35160
    },
  • Varsome API có hỗ trợ cung cấp các thông tin như giới tính, độ tuổi, chủng tộc
Available GET parameters:
-----------------------

add-all-data = 1 or 0
add-region-databases = 1 or 0
expand-pubmed-articles = 1 or 0
add-main-data-points = 1 or 0
add-varsome-user-entries = 1 or 0
add-source-databases = all or none or dbnsfp-premium,uniprot-variants,sanger-cosmic,refseq-transcripts,iarc-tp53-somatic,gnomad-genomes-coverage,ncbi-clinvar2,gerp,iarc-tp53-germline,gnomad-exomes,wustl-civic,gwas,ensembl-transcripts,nih-gdc,isb-kaviar3,ncbi-dbsnp,pharmgkb,dbnsfp,gnomad-genomes,cadd,dann-snvs,saphetor-known-pathogenicity,cancer-hotspots,bravo,dbnsfp-dbscsnv,mitomap,sanger-cosmic-licensed,jax-ckb,weill-cornell-medicine-pmkb,variant-pubmed-automap,phastcons100way,gnomad-mito,cbio-portal,gnomad-exomes-coverage,phylop100way,icgc-somatic
allele-frequency-threshold = float
add-ACMG-annotation = 1 or 0
minimum-clinvar-stars = 0 or 1 or 2 or 3 or 4
exclude-source-databases = dbnsfp-premium,uniprot-variants,sanger-cosmic,refseq-transcripts,iarc-tp53-somatic,gnomad-genomes-coverage,ncbi-clinvar2,gerp,iarc-tp53-germline,gnomad-exomes,wustl-civic,gwas,ensembl-transcripts,nih-gdc,isb-kaviar3,ncbi-dbsnp,pharmgkb,dbnsfp,gnomad-genomes,cadd,dann-snvs,saphetor-known-pathogenicity,cancer-hotspots,bravo,dbnsfp-dbscsnv,mitomap,sanger-cosmic-licensed,jax-ckb,weill-cornell-medicine-pmkb,variant-pubmed-automap,phastcons100way,gnomad-mito,cbio-portal,gnomad-exomes-coverage,phylop100way,icgc-somatic
use-canonical-transcript = 1 or 0
override-transcript = str
add-AMP-annotation = 1 or 0
cancer-type = str
tissue-type = str
sex = Female or Male or f or m or female or male
age = int
ethnicity = AFR or ASJ or EAS or FIN or NFE or AMR or SAS or OTH
annotation-mode = somatic or germline

Papers

  • GREAT: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7584987/
    • Có sử dụng Varsome, CLinvar, Intervar, CLinPred
    • Implement với MongoDB
      • The database is built on MongoDB v4.2.1, a NoSQL query engine, to speed up database user queries and the variant calling file (VCF)-oriented analysis (Figure 2). HADA is built in Shiny v1.3.2, an R v3.6.1 package (R Foundation for Statistical Computing, Vienna, Austria) for building web apps. Specifically, we used ShinyJS v1.0 to run JavaScript code within the web app frontend and Plotly v4.9.0 to generate interactive plots. ANNOVAR v18.04.16 is used to provide annotations from the database in the uploads. To preserve potentially sensitive information included in the uploaded VCFs, HADA uses an encrypting code based on Cryfa [20] that automatically secures the access to the file and decrypts it once returned to the user. This provides a high level of security and transfers the data control to the user. No sensitive sample information is stored or maintained in the server.
    • (Great) HADA: https://github.com/genomicsITER/HADA
    • Có dùng Innovar
    • not all variants affecting function in HAE are described in current ClinVar or InterVar versions
    • Pathogenic probabilities according to ClinPred [17] and the ACMG pathogenic classification as determined by ClinVar [18] (March 5, 2019 release), InterVar [19] (January 18, release), and VarSome (accessed June 13, 2020) were also annotated
    • ClinVar offered very limited information on this set of variants affecting function, as only 34 of them (7.6%) had corresponding ACMG class assignment: 2 are reported as benign or likely benign, 6 are indicated as VUS, and 26 are classified as pathogenic and likely pathogenic. InterVar included information for half of the set (226/450, 50.2%). However, 171 (75.7%) of these were classified as VUS. VarSome was the only resource that allowed assigning ACMG classes to all retrieved variants affecting function. According to VarSome, most of the HAE variants affecting function are classified as pathogenic (183/450, 40.6%) or likely pathogenic (171/450, 38.0%) (Figure 3). Although VarSome did not classify any of the HAE variants affecting function as benign or likely benign, 96 of them (21.3%) were still reported as VUS. Besides, precalculated pathogenicity predictors were available for a mean of 243 of the variants affecting function in the database. Taken together, these results highlight the existing gap in current interpretations of variant pathogenicity

gs.force.vn

  • Tạm thời tắt DIRECT_MUTATION_TASTING (chức năng chuyển đổi location 38 sang location 37 và tạo link đến mutationtasting cho cột Uploaded_variation)
    • Do nếu bật chức năng này thì khi lọc All variants chương trình sẽ chạy rất lâu khi xử lý các file dữ liệu lớn

Resources

Rust Tips

Installation

curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh
rustc --version

Prepare data

wget https://ftp.ncbi.nlm.nih.gov/pub/clinvar/tab_delimited/variant_summary.txt.gz
gunzip variant_summary.txt.gz

Hello world

  • Tạo hello.rs
fn main() {
    println!("Hello");
}
  • Compile
rustc hello.rs
  • Run
./hello

Hello world with Cargo

  • Tạo project
cargo new hello
cd hello
  • Edit /src/main.rs
fn main() {
    println!("Hello");
}
  • Compile
cargo build
  • Run
cargo run

Tối ưu hóa khi chạy

cargo run --release

Working with MySQL

use mysql::*;
use mysql::prelude::*;
use chrono::prelude::*; //For date and time

fn main() {
    let opts = OptsBuilder::new()
        .ip_or_hostname(Some("127.0.0.1"))
        .user(Some("username"))
        .pass(Some("password"))
        .db_name(Some("database"));

    let pool = Pool::new(opts).unwrap();

    let mut conn = pool.get_conn().unwrap();
}

Query

    conn.query_iter("select TITLE, MIM_NUMBER from CLINICAL_SYNOPSIS LIMIT 0, 10")
    .unwrap()
    .for_each(|row| {
        let r:(String, String) = from_row(row.unwrap());
        println!("{:?}, {:?}", r.0, r.1);
    });

Insert

pub struct Clinvar {
    pub VARIANT: String,
    pub CLINICAL: String,
    pub PHENOTYPE: String
}

fn main() {

    ...

    let clinvar = Clinvar {
        VARIANT: String::from("NM_139007.3(HFE):c.77-273G>C"),
        CLINICAL: String::from("Pathogenic"),
        PHENOTYPE: String::from("xxx")
    };

    match insert_clinvar(&mut conn, &clinvar) {
        Ok(last_id) => println!("Inserted product with ID {}", last_id),
        Err(e) => println!("Error: {:?}", e),
    }
}

fn insert_clinvar(
    conn: &mut PooledConn,
    clinvar: &Clinvar) -> std::result::Result<u64, mysql::error::Error> {

    let uuid = ::uuid::Uuid::new_v4();

    conn.exec_drop(
        "insert into CLINVAR (VARIANT, CLINICAL, PHENOTYPE, GUID, UDID, UUID) values (:variant, :clinical, :phenotype, 1, 1, :uuid)",
        params! {
            "variant" => &clinvar.VARIANT,
            "clinical" => &clinvar.CLINICAL,
            "phenotype" => &clinvar.PHENOTYPE,
            "uuid" => uuid.simple().to_string()
        },
    )
    .and_then(|_| Ok(conn.last_insert_id()))
}

UUID

Thêm vào trong Cargo.toml ở mục dependencies như sau:

[dependencies]
uuid = { version = "0.6", features = ["serde", "v4"] }

Trong code, tạo UUID như sau:

let uuid = ::uuid::Uuid::new_v4();
let uuid_string = uuid.simple().to_string();
let uuid_string_2 = uuid.hyphenated().to_string();

Ellapsed time

REF: https://rust-lang-nursery.github.io/rust-cookbook/datetime/duration.html

use std::time::{Duration, Instant};

fn main() {
    let start = Instant::now();
    expensive_function();
    let duration = start.elapsed();

    println!("Time elapsed in expensive_function() is: {:?}", duration);
}

String replacement using regex

Add to Cargo.toml

[dependencies]
lazy_static = "*"
regex = "*"

Sample code:

use lazy_static::lazy_static;
use regex::Regex;
use std::borrow::Cow;

fn ensure_variant_name(name: &str) -> Cow<str> {
    lazy_static! {
        static ref NAME_REGEX : Regex = Regex::new(
            r"(?P<p1>[^\(]+)\([A-Z0-9]+\)(?P<p2>[^\(]+)\(?.*"
            ).unwrap();
    }
    NAME_REGEX.replace_all(name, "$p1$p2")
}

Chạy code xử lý genome

cp9
cd dev/rust/hello/
cargo run --release

Curl & proxy

HTTP client

  • If you want a low-level HTTP library in Rust, I recommend using hyper. It’s production-ready and fully written in Rust so you don’t have to worry too much about safety issues. Moreover, it’s the only library that mentions production-readiness.
  • For a more high-level HTTP library, I would go with reqwest. The library is built on top of hyper, so it offers many of the same advantages as hyper and has a more convenient syntax to boot.

Rust & blockchain

Rust & bitcoin

Scraper

  • Dùng thư viện https://crates.io/crates/scraper
  • Scrapping is io bound so I wouldn’t bother choosing the language with performance as the criterion. Instead, I focus more on what the frameworks provide and ease of coding.

Count by lines

// We want to use the lines method from this trait
use std::io::BufRead;

// Let's us use ? for simple error handling
fn main() -> Result<(), std::io::Error> {
    // Try to open the file
    let file = std::fs::File::open("input.txt")?;
    // Create a buffered version of the file so we can use lines
    let buffered = std::io::BufReader::new(file);

    // Iterate through each line in the file
    for line in buffered.lines() {
        // But we get a Result each time, get rid of the errors
        let line = line?;
        // And print out the line length and content
        println!("{} {}", line.len(), line);
    }

    // Everything went fine, so we return Ok
    Ok(())
}

Web server

  • Nên dùng actix-web cho web API
use actix_web::{web, App, HttpRequest, HttpServer, Responder};

async fn greet(req: HttpRequest) -> impl Responder {
    let name = req.match_info().get("name").unwrap_or("World");
    format!("Hello {}!", &name)
}

#[actix_web::main]
async fn main() -> std::io::Result<()> {
    HttpServer::new(|| {
        App::new()
            .route("/", web::get().to(greet))
            .route("/{name}", web::get().to(greet))
    })
    .bind(("127.0.0.1", 8080))?
    .run()
    .await
}

References

Css Tips

Equal-height columns

<div class="row">
    <div class="col"></div>
    <div class="col"></div>
    <div class="col"></div>
    <div class="col"></div>
    <div class="col"></div>
</div>

Để các column có cùng chiều cao thì dùng CSS như sau:

.row {
    display: flex; /* equal height of the children */
    flex-wrap: wrap;
}
.col {
    flex: 1; /* additionally, equal width */
}

Digital Transformation

default

Bitcoin

2021/10

Ethereum losing Steam To Solana, Cardano, Polygon

Troublesome time for Ethereum and is causing concern for investors and developers.

High transaction fees and slow network speed continue to be a problem. Despite the London upgrade from August, it has had little impact on volatility of transaction fees.

In the meantime, rival blockchains deemed “ethereum killers” are exploiting ethereum’s weaknesses.

Nonetheless, Ethereum, which is the building block for all sorts of crypto projects, including non-fungible tokens (NFTs), smart contracts, and decentralized finance (DeFi), faces some major challenges to fend off the competition.

As a result, companies are looking into platforms like Cardano, which is used to build dApps, and Solana, which has seen a nearly 4,800% growth since September 2020. Due to its cheaper and faster price and faster usage than ethereum, Solana is gaining traction in the NFT and DeFi eco-systems.

A Solana website states the company processes 50,000 transactions per second at a cost of $ 0.00025 per transaction. The transaction speed on Ethereum is limited to about 13 transactions per second, and the fees are substantially higher than on Solana.

There is a flow of institutional funds. Andreessen Horowitz and Polychain Capital led a $ 314 million token sale for Solana.

As investors diversify away from ethereum, alternative blockchains like Tezos, Solana, and Cardano are rallying.

Blockchain

default

SAAS

Indian SaaS industry is gearing up to move onto global platforms

  • With digital transformation boosting enterprise tech intensity, Indian software-as-a-service players have gained immensely
  • India could well be on the cusp of unlocking a $1 trillion opportunity.
  • The global SaaS market is expected to cross $500 billion in revenues by 2025, growing at 18-20 per cent a year, and to reach $1.3 trillion by 2030. But the question is, why is the Indian SaaS …
  • Over the last one year, Indian SaaS companies leveraged Covid tailwinds and in 2020, $1.5 billion was invested in SaaS companies, representing a 4x jump over the last two years. The sector also minted six new unicorns including Postman, Zenoti, Innovacer, Highradius, Chargebee and Browserstack.
  • Girish Mathrubootham, founder and CEO, Freshworks, said that the ability of Indian product companies to sell to global enterprises from India remotely is the SaaS industry’s biggest strength. “More than half of our revenue [at Freshworks] comes from remote selling,” he added.
  • However, with majority SaaS companies, especially B2B SaaS startups, choosing to set up holding companies in the US or Singapore to tide over India’s tight regulatory environment, value creation largely occurs outside India even though job creation happens here.
  • the enormous growth potential that remains, and describe a few areas we are seeking to capitalize on for client portfolios.
  • The flexibility and agility provided by SaaS solutions is also expanding the total addressable market (TAM) for software vendors, enabling them to target new customers and end-markets.
  • From an investment perspective, SaaS vendors who have reached scale operate a highly attractive business model characterized by steady recurring revenue streams, low marginal costs, and high incremental margins (operating margins of 30-40% are not uncommon).
  • The days of downloading software to your desktop or a local server now seem like a distant memory. Today, software is increasingly hosted in a remote datacenter (aka the “cloud”) and accessed on the Internet via a web browser or mobile app.
  • Instead of the customer investing in servers and networking gear, the hardware running the software resides in a remote datacenter managed by the SaaS provider. The software application is then delivered “as-a-service” to the end-user in exchange for a monthly or annual subscription fee.
  • This new cloud-based SaaS world is a win-win. Customers win by always having access to the most up-to-date software, increased security, and a lower total cost of ownership (by virtue of outsourcing hosting and maintenance). For vendors, SaaS improves the consistency and visibility of revenues while simultaneously enabling them to generate more revenue over the life of a customer.
  • Small businesses who historically couldn’t afford the relatively high up-front costs associated with building data centers and buying software licenses can now subscribe to a wide variety of SaaS applications online without any up-front investment. These purpose-built, easy-to-use SaaS apps are increasingly replacing heavily manual and/or labor-intensive processes that historically relied on emails and spreadsheets. As a result, software is experiencing a ‘Cambrian explosion’ that is dramatically increasing the breadth and diversity of vendors and applications.
  • Our investment teams will continue to monitor the entire enterprise software space for emerging opportunities and rising risks
Previous Page 2 of 4 Next Page