Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!
openssl genrsa -des3 -out rootCA.key 4096
... | |
2023-09-07 14:07:10 ✨ Imported #107380 (0x129c…30f9) | |
2023-09-07 14:07:10 💤 Idle (22 peers), best: #107378 (0xdaed…f1e7), finalized #107376 (0xd4ea…535d), ⬇ 9.4MiB/s ⬆ 10.9MiB/s | |
2023-09-07 14:07:15 💤 Idle (26 peers), best: #107378 (0xdaed…f1e7), finalized #107377 (0x517f…e155), ⬇ 9.7MiB/s ⬆ 9.1MiB/s | |
2023-09-07 14:07:15 ✨ Imported #107379 (0xe84b…4ee5) | |
2023-09-07 14:07:18 ♻️ Reorg on #107379,0xe84b…4ee5 to #107379,0x5703…6cd6, common ancestor #107378,0xdaed…f1e7 | |
2023-09-07 14:07:18 ✨ Imported #107379 (0x5703…6cd6) | |
2023-09-07 14:07:20 💤 Idle (28 peers), best: #107379 (0x5703…6cd6), finalized #107377 (0x517f…e155), ⬇ 6.0MiB/s ⬆ 11.6MiB/s | |
2023-09-07 14:07:25 💤 Idle (29 peers), best: #107378 (0xb1db…fc77), finalized #107378 (0xb1db…fc77), ⬇ 4.2MiB/s ⬆ 10.1MiB/s | |
2023-09-07 14:07:30 💤 Idle (29 peers), best: #107378 (0xb1db…fc77), finalized #107378 (0xb1db…fc77), ⬇ 2.0MiB/s ⬆ 3.3MiB/s |
const accountPair = keyring.getPair(accountAddress); |
target/release/node-template purge-chain --dev | |
//... | |
import { SubstrateContextProvider, useSubstrate } from './substrate-lib'; | |
import { DeveloperConsole } from './substrate-lib/components'; | |
//... | |
function Main() { | |
const [accountAddress, setAccountAddress] = useState(null); | |
const { apiState, keyring, keyringState } = useSubstrate(); | |
const accountPair = | |
accountAddress && |
api.query.<pallet_名字>.<pallet 存儲名字>(回調函數) |
const val = await api.query.templateModule.something(); |
{ | |
..., | |
"CUSTOM_TYPES": { | |
"Price": { | |
"dollars": "u32", | |
"cents": "u32", | |
"currency": "Vec" | |
}, | |
} | |
} |
// This module's storage items. | |
decl_storage! { | |
trait Store for Module as TemplateModule { | |
Something get(fn something): Option; | |
} | |
} |
# -- 安裝 NodeJS v12 (https://nodejs.org/en/download/), | |
# 及 yarn 工具 (https://classic.yarnpkg.com/en/docs/install) | |
# -- 下載 Substrate 前端模版並跑起來 | |
cd .. | |
git clone https://github.com/substrate-developer-hub/substrate-front-end-template front-end-template | |
cd front-end-template | |
yarn install | |
yarn start |