TCPDUG 台中波卡使用者群組

資源

社群

Links

TCPDUG 台中波卡使用者群組

call for volunteers

徵求志工貢獻,需求條件如下:

志工貢獻時數依照 github 上面的 commit 紀錄以 Generic Asset Module (AssetId 100)點數資產形式發放。

TCPDUG 台中波卡使用者群組

PKC

為了讓群組分享激勵較為簡單例如贊助一杯咖啡,這時需要有個容易說明的換算單位,故採用普朗克咖啡 ( Planck Coffee )為換算單位,利用普朗克常數來計算波卡生態圈內代幣近似一杯普通咖啡的換算單位,簡稱普咖也就是PKC。

一杯普咖 = 1 PKC = 6,626,070,150 Planck = 0.662607015 DOT (可以想像約一杯咖啡價)

Events

Event2020

2020-0902-burn-dot

中元流動性普渡

去年本來要燒 Grin 結果太隱密很難燒換燒比特幣,今年波卡上線加上以太坊流動性挖礦風潮,趕流行徵求流動性提供者 Liquidity Provider (LP),不需合約,直接先燒 0.5 DOT 到 11111111111111111111111111111Gzr8zVsW 地址後保證 200% 返還 1 DOT,名額有限只有五名,欲燒從速,但須等台北時間中元子時過後才開始算,注意單一地址只能燒一次。話說不管是金爐合約還是金爐跑環RUNTIME現在都還沒辦法上波卡主鏈,燒完 DOT 沒辦法自動燒出 LP token 來換個素果之類的。

// 2020年中元在國曆9月2日
const { encodeAddress } = require('@polkadot/keyring');

const zero = '0x' + '00'.repeat(28) + '20200715';
// https://github.com/paritytech/substrate/wiki/External-Address-Format-(SS58)
// 00000000b (0) Polkadot Live (SS58 checksum preimage)
// 00000001b (1) Polkadot Live (reserved for secondary use)
// 00000010b (2) Polkadot Canary (SS58 checksum preimage)
// 00000011b (3) Polkadot Canary (reserved for secondary use)
// 00101010b (42) Generic Substrate wildcard (SS58 checksum preimage)
const SS58FormatPolkadot = 0;
const SS58FormatKusama = 2;
console.log(encodeAddress(zero, SS58FormatPolkadot).toString());
// 11111111111111111111111111111Gzr8zVsW
console.log(encodeAddress(zero, SS58FormatKusama).toString());
// CaKWz5omakTK7ovp4m3koXrHyHb7NG3Nt7GENHcCi37ZFKP

參考資料

開發日誌

2020-11

PQC and TCPDUG

後量子密碼學簽名鏈實做參考資料

2020 10

upgrading to rustc v1.47 has broken builds on master branch · Issue #1796 · paritytech/polkadot

rustup override set nightly-2020-10-05 && rustup target add wasm32-unknown-unknown --toolchain nightly-2020-10-05

install opensk to Nordic nRF52840 USB Dongle

$ pip3 install nrfutil
$ nrfutil version
nrfutil version 6.1.0
$ git clone https://github.com/google/OpenSK.git
$ cd OpenSk 
$ ./setup.sh
$ sudo chmod a+rw /dev/ttyACM0
$ ./deploy.py --board=nrf52840_dongle_dfu --opensk --programmer=nordicdfu
$ sudo cp rules.d/55-opensk.rules /etc/udev/rules.d/ && sudo udevadm control --reload

一開始買來的插上去會點紅燈代表可以燒入,如果燒入完成狀態插入不會有紅燈亮,後續瀏覽器登入要求插入後會閃兩邊的燈。

info: Please insert the dongle and switch it to DFU mode by keeping the button pressed while inserting..

要再次點紅燈裡面有提到按住一個按鈕,注意不是明顯確認那個按鈕,而是下方有個方向不同的 reset 按鈕需要按住才能點紅燈。只有閃紅燈狀態可以燒入,如果出現 Permission denied: /dev/ttyACM0 權限問題就必須再執行一次 chmod a+rw /dev/ttyACM0

2020 09

2020-0920

2020-0917

github 的容器庫有兩種版本,可以無登入公開拉取的容器庫需推到 ghcr.io

$ docker tag foo ghcr.io/dltdojo/substrate:2.0.0-rc6-1
$ docker push ghcr.io/dltdojo/substrate:2.0.0-rc6-1

2020-0916

$ cd chains/sntpl-2.0.0-rc6-1
$ scripts/docker_build.sh
$ docker tag foo docker.pkg.github.com/dltdojo/tcpdug/substrate:2.0.0-rc6-1
$ docker push docker.pkg.github.com/dltdojo/tcpdug/substrate:2.0.0-rc6-1

2020-0914

外接需要 Set up Secure WebSocket for Remote Connections · Polkadot Wiki,只是要設定 nginx 會佔去機器的 443 port。

支援 Ethereum 的公鏈專案,Avalanche 架構將以太坊支援直接放在 C-Chains 上是直接出廠配備,另外波卡的 Ink! 一直改版未穩定,可直接使用 Ethereum 的 frontier 也是,而 Cosmos ethermint 只出到 0.1.0 版本。

2020-0913

dev chain sntpl-2.0.0-rc6-1 (DD0J1)

目前建立平行鏈 實做多資產的方式採用整合 pallet-generic-asset 方式,修改的部份 dev testnet dd0j1 with pallet-generic-assets · dltdojo/tcpdug@18ba9d5 請參考。要注意的是目前整個 substrate 的狀態即使到 rc6 還是不固定,如果版本不對,修改支援 pallet-generic-asset 的地方也必須因應改變,等到版本出來會在製作一版。

另一個修改的是 Substrate_ | Chain Specification 加上測試鏈的名稱與原生幣的單位 DD0J。

測試採用 Polkadot/Substrate Portal 來進行,除了瀏覽器不須安裝其他程式,於 Extrinsic submission 執行修改狀態之交易,另外用 Chain state 讀取狀態。

img1

img1

tcpdug/chains/sntpl-2.0.0-rc6-1$ target/debug/node-template purge-chain --dev
tcpdug/chains/sntpl-2.0.0-rc6-1$ target/debug/node-template --dev
2020-09-13 16:01:45.285 main WARN sc_cli::commands::run_cmd  Running in --dev mode, RPC CORS has been disabled.
2020-09-13 16:01:45.285 main INFO sc_cli::runner  Substrate Node
2020-09-13 16:01:45.285 main INFO sc_cli::runner  ✌️  version 2.0.0-rc6-75c8517-x86_64-linux-gnu
2020-09-13 16:01:45.285 main INFO sc_cli::runner  ❤️  by Substrate DevHub <https://github.com/substrate-developer-hub>, 2017-2020
2020-09-13 16:01:45.285 main INFO sc_cli::runner  📋 Chain specification: DD0J1
2020-09-13 16:01:45.285 main INFO sc_cli::runner  🏷  Node name: humorous-mark-0633
2020-09-13 16:01:45.285 main INFO sc_cli::runner  👤 Role: AUTHORITY
2020-09-13 16:01:45.285 main INFO sc_cli::runner  💾 Database: RocksDb at /home/foo/.local/share/node-template/chains/dev/db
2020-09-13 16:01:45.285 main INFO sc_cli::runner  ⛓  Native runtime: node-template-1 (node-template-1.tx1.au1)
2020-09-13 16:01:45.578 main INFO sc_service::client::client  🔨 Initializing Genesis block/state (state: 0x8acb…319b, header-hash: 0x29fd…0203)
2020-09-13 16:01:45.580 main INFO afg  👴 Loading GRANDPA authority set from genesis on what appears to be first startup.
2020-09-13 16:01:45.732 main INFO sc_consensus_slots  ⏱  Loaded block-time = 6000 milliseconds from genesis on first-launch
2020-09-13 16:01:45.734 main INFO sub-libp2p  🏷  Local node identity is: 12D3KooWEXv1Uycg2JAfPF8W5517vd3E3i4QcqMUUCCMGyNvvGvp (legacy representation: QmXHs2s7QTY6zGhehnQBaaqb3ZyDZjKHEzmiJK1333P3Wf)
2020-09-13 16:01:45.941 main INFO sc_service::builder  📦 Highest known block at #0
2020-09-13 16:01:45.942 tokio-runtime-worker INFO substrate_prometheus_endpoint::known_os  〽 Prometheus server started at 127.0.0.1:9615
2020-09-13 16:01:48.142 tokio-runtime-worker INFO sc_basic_authorship::basic_authorship  🙌 Starting consensus session on top of parent 0x29fd8c02b8245939800299eb5f05b6be53bc08a4038e7a6fa218646852f10203
2020-09-13 16:01:48.241 tokio-blocking-driver INFO sc_basic_authorship::basic_authorship  🎁 Prepared block for proposing at 1 [hash: 0x0ddbf622c96a0505999e1bee913986b75d95da4f2d3b6bd5601487e662500789; parent_hash: 0x29fd…0203; extrinsics (1): [0x4c72…5fde]]
2020-09-13 16:01:48.316 tokio-runtime-worker INFO sc_consensus_slots  🔖 Pre-sealed block for proposal at 1. Hash now 0xb247b277111ed2826d8f073fac6aa48cf4327a949e9297050aeeb17ae0a88c04, previously 0x0ddbf622c96a0505999e1bee913986b75d95da4f2d3b6bd5601487e662500789.
2020-09-13 16:01:48.317 tokio-runtime-worker INFO substrate  ✨ Imported #1 (0xb247…8c04)
2020-09-13 16:01:50.947 tokio-runtime-worker INFO substrate  💤 Idle (0 peers), best: #1 (0xb247…8c04), finalized #0 (0x29fd…0203), ⬇ 0 ⬆ 0
2020-09-13 16:01:54.080 tokio-runtime-worker INFO sc_basic_authorship::basic_authorship  🙌 Starting consensus session on top of parent 0xb247b277111ed2826d8f073fac6aa48cf4327a949e9297050aeeb17ae0a88c04
2020-09-13 16:01:54.084 tokio-blocking-driver INFO sc_basic_authorship::basic_authorship  🎁 Prepared block for proposing at 2 [hash: 0xd820b547f6c22d061710424b35d913e80433c3d33dbfc6a4df9266e4e4dabb5b; parent_hash: 0xb247…8c04; extrinsics (1): [0x6389…247c]]
2020-09-13 16:01:54.158 tokio-runtime-worker INFO sc_consensus_slots  🔖 Pre-sealed block for proposal at 2. Hash now 0x1fcfffdfaa78fba345483cbd57c333fefb066d61bcefcb180f65d64cf14d0002, previously 0xd820b547f6c22d061710424b35d913e80433c3d33dbfc6a4df9266e4e4dabb5b.
2020-09-13 16:01:54.159 tokio-runtime-worker INFO substrate  ✨ Imported #2 (0x1fcf…0002)
2020-09-13 16:01:55.948 tokio-runtime-worker INFO substrate  💤 Idle (0 peers), best: #2 (0x1fcf…0002), finalized #0 (0x29fd…0203), ⬇ 0 ⬆ 0
2020-09-13 16:02:00.086 tokio-runtime-worker INFO sc_basic_authorship::basic_authorship  🙌 Starting consensus session on top of parent 0x1fcfffdfaa78fba345483cbd57c333fefb066d61bcefcb180f65d64cf14d0002
2020-09-13 16:02:00.092 tokio-blocking-driver INFO sc_basic_authorship::basic_authorship  🎁 Prepared block for proposing at 3 [hash: 0x310c6457f43aad2d9dcb5e647d54c69806bdbbc55c3137e162ed1e3b67e99588; parent_hash: 0x1fcf…0002; extrinsics (1): [0x578f…adba]]
2020-09-13 16:02:00.172 tokio-runtime-worker INFO sc_consensus_slots  🔖 Pre-sealed block for proposal at 3. Hash now 0x0d8b308561d6986fab59870aed55062f8aee027609fd924edeebd196d35383d0, previously 0x310c6457f43aad2d9dcb5e647d54c69806bdbbc55c3137e162ed1e3b67e99588.
2020-09-13 16:02:00.173 tokio-runtime-worker INFO substrate  ✨ Imported #3 (0x0d8b…83d0)
2020-09-13 16:02:00.948 tokio-runtime-worker INFO substrate  💤 Idle (0 peers), best: #3 (0x0d8b…83d0), finalized #0 (0x29fd…0203), ⬇ 0 ⬆ 0
2020-09-13 16:02:05.951 tokio-runtime-worker INFO substrate  💤 Idle (0 peers), best: #3 (0x0d8b…83d0), finalized #1 (0xb247…8c04), ⬇ 0 ⬆ 0
2020-09-13 16:02:06.082 tokio-runtime-worker INFO sc_basic_authorship::basic_authorship  🙌 Starting consensus session on top of parent 0x0d8b308561d6986fab59870aed55062f8aee027609fd924edeebd196d35383d0
2020-09-13 16:02:06.087 tokio-blocking-driver INFO sc_basic_authorship::basic_authorship  🎁 Prepared block for proposing at 4 [hash: 0xf1210a9be44be3c3834bb1230fd23e38478f86b1bdcb53d8c6148caffa3ba9a7; parent_hash: 0x0d8b…83d0; extrinsics (1): [0xcf37…b69a]]
2020-09-13 16:02:06.161 tokio-runtime-worker INFO sc_consensus_slots  🔖 Pre-sealed block for proposal at 4. Hash now 0x65c9786710a5086451ff83d003cc1e31d182c2b703900825473e44c3354377fb, previously 0xf1210a9be44be3c3834bb1230fd23e38478f86b1bdcb53d8c6148caffa3ba9a7.
2020-09-13 16:02:06.163 tokio-runtime-worker INFO substrate  ✨ Imported #4 (0x65c9…77fb)
2020-09-13 16:02:10.952 tokio-runtime-worker INFO substrate  💤 Idle (0 peers), best: #4 (0x65c9…77fb), finalized #2 (0x1fcf…0002), ⬇ 0 ⬆ 0
2020-09-13 16:02:12.114 tokio-runtime-worker INFO sc_basic_authorship::basic_authorship  🙌 Starting consensus session on top of parent 0x65c9786710a5086451ff83d003cc1e31d182c2b703900825473e44c3354377fb

2020-0912

pallet-generic-asset

pallet-uniswap