見出し画像

Lisk SDK を使ってブロックチェーンアプリを作りたい ~デリゲート登録編~

今回の内容

Lisk SDKのアプリケーションでデリゲート登録し、forging設定する方法


デリゲート登録をする

Lisk Desktopで登録する。

25LSK使うけどDevnetではお金もちだから大丈夫


パスフレーズの暗号化とパブリックキーの取得

Lisk ElementsのencryptPassphraseWithPasswordとかで取得する
例えば下みたいなので取得する

const config = require('./config')
const { cryptography } = require('lisk-sdk')

module.exports.forgingInfo = (p) => {
   const s = cryptography.encryptPassphraseWithPassword(p, config.configDevnet.modules.chain.forging.defaultPassword)
   const a = cryptography.getAddressAndPublicKeyFromPassphrase(p)

   return {
       address: a.address,
       publicKey: a.publicKey,
       encryptoPassphrase: cryptography.stringifyEncryptedPassphrase(s)
   }
}
console.log(this.forgingInfo('ぱすふれーず'))
lisk-sdk の cryptography は公式ドキュメント参照
Lisk Elements Cryptography


config_devnet.jsonに設定

modules.chain.forging.delegates内に設定

{
    "encryptedPassphrase""自分の暗号化したパスフレーズ",
    "publicKey": "自分のアドレスのpublicKey"
}
設定したらアプリ再起動

※forgingで報酬がもらえるようになるのはblock hightが app.genesisConfig.OFFSET に達してからなので、早くほしければ減らしましょ (0はだめよ)


おまけ:genesis_xx のアドレスとパスフレーズ

{
   address: '8273455169423958419L',
   passPhrase: 'robust swift grocery peasant forget share enable convince deputy road keep cheap'
},
{
   address: '12254605294831056546L',
   passPhrase: 'weapon van trap again sustain write useless great pottery urge month nominee'
},
{
   address: '14018336151296112016L',
   passPhrase: 'course genuine appear elite library fabric armed chat pipe scissors mask novel'
},
{
   address: '2003981962043442425L',
   passPhrase: 'unknown critic shield network goat detail grid dry surround clay wrap six'
},
{
   address: '15685993315437640088L',
   passPhrase: 'head miracle inquiry body salt hedgehog purity tilt kit magic chat evolve'
},
{
   address: '13796903232533379929L',
   passPhrase: 'trial offer detail flee gadget elevator fix unhappy panda ordinary goat glide'
},
{
   address: '10395427086746342233L',
   passPhrase: 'pencil rescue over bachelor team rib venue broom axis bonus nominee volcano'
},
{
   address: '10555862272344793163L',
   passPhrase: 'latin swamp simple bridge pilot become topic summer budget dentist hollow seed'
},
{
   address: '9090572627256317041L',
   passPhrase: 'acid catch quit barely siege smile witness pass artwork forget quote disease'
},
{
   address: '6147291942291731858L',
   passPhrase: 'eye split major insect please across index taste mention drastic alert fault'
},
{
   address: '1478505779553195737L',
   passPhrase: 'topic arena assault must dolphin team fine ranch robust green cruise expect'
},
{
   address: '3485190523478756562L',
   passPhrase: 'deer myself jaguar swarm mistake start club search theme hope flip tag'
},
{
   address: '7749538982696555450L',
   passPhrase: 'warfare mask code net chronic dress case toss celery unable pact obscure'
},
{
   address: '11858068254874463650L',
   passPhrase: 'life express when pepper mechanic goat again sustain announce decrease legend concert'
},
{
   address: '11959294293312794939L',
   passPhrase: 'hidden view brave foot early you latin globe elite maid unlock student'
},
{
   address: '6572481065061292413L',
   passPhrase: 'lounge label clap camera zebra junk analyst citizen arrest caution odor figure'
},
{
   address: '537318935439898807L',
   passPhrase: 'recipe bomb asset salon coil symbol tiger engine assist pact pumpkin visit'
},
{
   address: '11194005483892021001L',
   passPhrase: 'famous weapon poverty blast announce observe discover prosper mystery adapt tuna office'
},
{
   address: '12689367895996075612L',
   passPhrase: 'defy defense guard sauce tip film glad horror foam kiss panda weekend'
},
{
   address: '12937672077630275226L',
   passPhrase: 'journey egg tool shaft upset erode decrease stuff extra federal again soda'
},
{
   address: '6719024567117648644L',
   passPhrase: 'cupboard gym plastic goose honey humble cattle dynamic boring chief vital perfect'
},
{
   address: '2185933284430885504L',
   passPhrase: 'donate random boring charge reason brick false police stamp plunge tape level'
},
{
   address: '263761216888896549L',
   passPhrase: 'middle time skate claim planet piano two crawl toilet heavy because long'
},
{
   address: '6996737717246838071L',
   passPhrase: 'flavor type stone episode capable usage save sniff notable liar gas someone'
},
{
   address: '17769700073017685523L',
   passPhrase: 'game balance venue jacket volume typical advice design gentle rib drink shock'
},
{
   address: '18101328368221611426L',
   passPhrase: 'draw ocean damp thank sauce ready light cupboard ball hat hero enact'
},
{
   address: '3654804916322462690L',
   passPhrase: 'era tube inspire unhappy august change eternal dose tooth tape december private'
},
{
   address: '6214967903930344618L',
   passPhrase: 'swarm height soul jump cancel mountain blouse pass zero catalog shallow surround'
},
{
   address: '6700417780469657062L',
   passPhrase: 'cheese retreat stone point episode fiber chef chief nest shuffle crush any'
},
{
   address: '17416795040643460696L',
   passPhrase: 'illegal reveal summer stomach cover laugh victory mother blush subway certain lock'
},
{
   address: '7806545753492919148L',
   passPhrase: 'olympic fatigue end humor base later olympic pony salmon crash kind enforce'
},
{
   address: '16807489144327319524L',
   passPhrase: 'secret allow steak summer chase gate tongue cereal indoor delay bring fee'
},
{
   address: '11009807324631489084L',
   passPhrase: 'agent grain helmet entry oblige tag pipe omit width lake lend enjoy'
},
{
   address: '5380829552614149409L',
   passPhrase: 'doll special grid student gaze almost receive candy scrub say sphere sunset'
},
{
   address: '18181157191600196376L',
   passPhrase: 'shadow donkey fall satisfy resemble hotel resource plastic throw soup change science'
},
{
   address: '15279149762694772854L',
   passPhrase: 'burden ski shock write student gown sugar oppose grass voyage have stable'
},
{
   address: '15867701141673224975L',
   passPhrase: 'retire gallery fury question rose jealous shuffle equip water call follow rely'
},
{
   address: '13787002016364430124L',
   passPhrase: 'flip relief play educate address plastic doctor fix must frown oppose segment'
},
{
   address: '5312766513260345125L',
   passPhrase: 'wing ring rate erase horse double duty situate guitar color resist unit'
},
{
   address: '11613981515632820140L',
   passPhrase: 'assist congress future wheel aisle mammal else giant buddy point purpose cook'
},
{
   address: '4351572711388220555L',
   passPhrase: 'gallery wasp task access remind dust mushroom choose mushroom middle oval yellow'
},
{
   address: '11595026565287740051L',
   passPhrase: 'invite divide cry retreat shy agent pledge sorry knee vacuum uniform kingdom'
},
{
   address: '3466073897179860882L',
   passPhrase: 'horn antenna tenant convince drum like later bubble kitten system hazard crazy'
},
{
   address: '4331258378288911563L',
   passPhrase: 'brief empower hub antenna milk impose stage comic twenty hunt morning thank'
},
{
   address: '9928719876370886655L',
   passPhrase: 'route bind pencil sniff medal when bone refuse juice caution space shiver'
},
{
   address: '11805364634236927749L',
   passPhrase: 'require ankle exhibit umbrella endorse express inquiry unique jacket element symbol cotton'
},
{
   address: '9703017731198160198L',
   passPhrase: 'flock butter pole attitude remain science minor disorder soldier rookie organ light'
},
{
   address: '162664226572374905L',
   passPhrase: 'monkey admit festival oxygen neither buddy vapor apart cycle carpet glow artwork'
},
{
   address: '14754807200586084685L',
   passPhrase: 'jaguar rifle leader thing lottery index north industry express access typical illegal'
},
{
   address: '6596445655213033387L',
   passPhrase: 'leaf liberty slender corn effort advice clerk blast grid icon orange nominee'
},
{
   address: '2581762640681118072L',
   passPhrase: 'outdoor right flat quarter cancel stadium urban law rhythm club spatial muscle'
},
{
   address: '15064680481049926459L',
   passPhrase: 'web evolve empty assault trim service choose increase sister box wet depth'
},
{
   address: '6253486079725348800L',
   passPhrase: 'fortune project stable road outside spoil team quantum journey fall cloud great'
},
{
   address: '7838076639178338424L',
   passPhrase: 'satoshi summer poet acid absorb useful hedgehog turn sure true crunch library'
},
{
   address: '9824483707960713406L',
   passPhrase: 'lake either purchase wall core move broken accident install family region spawn'
},
{
   address: '12144255005482188703L',
   passPhrase: 'betray banana sketch have risk coral stumble invest poverty panic step menu'
},
{
   address: '2037513790649430470L',
   passPhrase: 'age solar olive fine scheme soon alert grass section infant fiscal real'
},
{
   address: '2371768942272884594L',
   passPhrase: 'subject clip engage orphan agree major marriage arrow friend assault element ankle'
},
{
   address: '309766985700168161L',
   passPhrase: 'pipe goddess avoid earth fault limb ecology agent wall glimpse access worth'
},
{
   address: '17110047919889272525L',
   passPhrase: 'know chat master congress slam property ability leave daughter hover nose wing'
},
{
   address: '17271297386479765505L',
   passPhrase: 'kiss badge wreck ask crumble appear game entry smart world clown canyon'
},
{
   address: '11229203525038722103L',
   passPhrase: 'join bid whale slender rapid gauge about access slice calm leaf chair'
},
{
   address: '1998811414849260567L',
   passPhrase: 'fiction judge vanish tape liberty chronic nerve unique sibling arch match away'
},
{
   address: '1039287838469525702L',
   passPhrase: 'enact inquiry insect pluck paper venture faith angry diesel enter tray muffin'
},
{
   address: '9829702676947904862L',
   passPhrase: 'autumn foil east grape walnut mother hello favorite wink shaft fancy about'
},
{
   address: '11776976371460504977L',
   passPhrase: 'imitate tenant wreck vacuum green image crack abandon copper side spell this'
},
{
   address: '10718602563400390049L',
   passPhrase: 'daring comfort trophy sketch dilemma hour lunar coffee riot kick elevator taste'
},
{
   address: '3978875557882351502L',
   passPhrase: 'clock artwork supreme super join sea shiver never answer bring thought solution'
},
{
   address: '15196907279410793719L',
   passPhrase: 'party wet point science surge blanket sniff oak cram pupil excuse nasty'
},
{
   address: '14846615469478045551L',
   passPhrase: 'simple before tortoise spike raven fever genre chat pattern noble boring this'
},
{
   address: '9528507096611161860L',
   passPhrase: 'matrix favorite pole blur whale bike ribbon search impact good merry umbrella'
},
{
   address: '5225235021585670513L',
   passPhrase: 'ceiling prison resource twenty cage reject figure around place floor afford worth'
},
{
   address: '8579664070066716758L',
   passPhrase: 'weather vendor accuse grow rely diagram rebuild borrow forward eager brand walnut'
},
{
   address: '13607583239938732846L',
   passPhrase: 'lend crime turkey diary muscle donkey arena street industry innocent network lunar'
},
{
   address: '2460251951231579923L',
   passPhrase: 'wait know goose ordinary draft embrace three super fog portion fog jewel'
},
{
   address: '1081724521551096934L',
   passPhrase: 'despair broom face hamster field account aware armor blame clean ship genre'
},
{
   address: '11004588490103196952L',
   passPhrase: 'sad axis cruise false buzz jelly east congress jacket riot domain eyebrow'
},
{
   address: '3038510178697972178L',
   passPhrase: 'brother absurd apple vital shove hockey catalog all spring denial coffee spring'
},
{
   address: '11506830473925742632L',
   passPhrase: 'lizard trigger price mechanic total affair proof ocean team hammer board blur'
},
{
   address: '1156554003019098747L',
   passPhrase: 'return nerve sort strategy wink lake fringe metal under grape rule vacuum'
},
{
   address: '15675505605575781355L',
   passPhrase: 'vessel universe profit comic dust milk dolphin chronic range habit section apple'
},
{
   address: '1330932780504881464L',
   passPhrase: 'copy leisure enforce ice floor coyote dash cradle phrase admit fish yellow'
},
{
   address: '2393437289429474816L',
   passPhrase: 'column spin grain broom blur uniform tennis miss fault quarter idle dilemma'
},
{
   address: '9373453086736696113L',
   passPhrase: 'term stable snap size half hotel unique biology amateur fortune easily tribe'
},
{
   address: '13996264772258038665L',
   passPhrase: 'tiger festival soldier deputy rich drink father vapor type produce moral better'
},
{
   address: '15441829200899900957L',
   passPhrase: 'category burden churn buddy crowd drink wedding exercise submit jaguar lounge final'
},
{
   address: '9617151563281131501L',
   passPhrase: 'correct awful month shift govern snack small ridge bitter shop luxury sun'
},
{
   address: '11231201826468807624L',
   passPhrase: 'soup situate eternal used base dune depart segment satisfy carbon suspect zone'
},
{
   address: '8696372244926065755L',
   passPhrase: 'decline where harsh alarm spoon consider filter razor energy boil history blur'
},
{
   address: '13227119536266737242L',
   passPhrase: 'prosper waste art carpet model settle license matrix lion exist much already'
},
{
   address: '5179180534922237219L',
   passPhrase: 'rally one magnet dune junior panic head token direct choose win place'
},
{
   address: '15357346183081898956L',
   passPhrase: 'urban grunt panther voice drink famous such useful tiny race heavy best'
},
{
   address: '5728878764625100394L',
   passPhrase: 'imitate brain only inhale fancy garment exercise promote extend reopen help festival'
},
{
   address: '15692920659979620367L',
   passPhrase: 'void annual occur spice elephant spring good ski myself away share lesson'
},
{
   address: '9950029393097476480L',
   passPhrase: 'false narrow garage menu valve universe come lava uncle domain episode climb'
},
{
   address: '13047943150548380336L',
   passPhrase: 'armed senior cage sing example piece syrup curtain renew swap slush field'
},
{
   address: '677098303101863197L',
   passPhrase: 'option print luggage drill staff addict myth route confirm legal peanut nurse'
},
{
   address: '68059329122227204L',
   passPhrase: 'place lawsuit turkey trophy key recall young bench mask drink mutual embody'
},
{
   address: '15300035861842713585L',
   passPhrase: 'sibling matter suspect marine clean glory amused egg bean transfer profit addict'
},
{
   address: '10881167371402274308L',
   passPhrase: 'actress route auction pudding shiver crater forum liquid blouse imitate seven front'
}
わすれるのでメモ
genesis_block_devnet.json でデリゲート登録の指定がされている101のアドレス


おわりに

これでforgingで報酬がもらえるようになりました。
蛇口作るときとかしておくといいかもですね (`・ω・´)b


万博おじについて

万博記念公園と新しいものが好きなプログラムやさん
お金がなくていつもこまっているので支援おねがします(;^ω^)
Twitter:@ys_mdmg
github:lisknonanika
Discord:@mdmg
Lisk:mdmg(5380827711560203827L)

その他加入している非公式コミュニティ
Lisk Japan
・Lisk 情報システム部 (Twitter内グループ)
・Lisk ゲーム部 (Twitter内グループ)

この記事が気に入ったらサポートをしてみませんか?