あなたのアカウントのインポータンスを安全にノードと共有します
注釈
July 30, 2020: This guide is outdated and not compatible with latest 0.9.6 milestone. We will publish up-to-date instructions on how to activate delegated harvesting soon.
デリゲートハーベスティング によってノードを運用せずにブロック報酬をアカウントで得ることができます。次のガイドではアカウントの資産を毀損せずに、アカウントのインポータンスをデリゲートする方法をガイドします。
In this process, you will delegate your main account (M) importance to a proxy public key (R). Then, you will request a node to add your remote account (R) as a delegated harvester with the announcer account (A).
Delegated harvesting activation diagram¶
Before you can activate delegated harvesting, you need to have three accounts:
10,000
harvesting mosaic units.symbol.xym
units to announce a transaction. // replace with network type
const networkType = NetworkType.TEST_NET;
// replace with private key
const mainAccountPrivateKey = '0000000000000000000000000000000000000000000000000000000000000000';
const mainAccount = Account.createFromPrivateKey(mainAccountPrivateKey, networkType);
const remoteAccount = Account.generateNewAccount(networkType);
// replace with private key
const announcerAccountPrivateKey = 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF';
const announcerAccount = Account.createFromPrivateKey(announcerAccountPrivateKey, networkType);
// replace with network type
const networkType = symbol_sdk_1.NetworkType.TEST_NET;
// replace with private key
const mainAccountPrivateKey = '0000000000000000000000000000000000000000000000000000000000000000';
const mainAccount = symbol_sdk_1.Account.createFromPrivateKey(mainAccountPrivateKey, networkType);
const remoteAccount = symbol_sdk_1.Account.generateNewAccount(networkType);
// replace with private key
const announcerAccountPrivateKey = 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF';
const announcerAccount = symbol_sdk_1.Account.createFromPrivateKey(announcerAccountPrivateKey, networkType);
const accountLinkTransaction = AccountKeyLinkTransaction.create(
Deadline.create(),
remoteAccount.publicKey,
LinkAction.Link,
networkType,
UInt64.fromUint(2000000));
// replace with node endpoint
const nodeUrl = 'http://api-01.us-east-1.096x.symboldev.network:3000';
// replace with meta.networkGenerationHash (nodeUrl + '/node/info')
const networkGenerationHash = '1DFB2FAA9E7F054168B0C5FCB84F4DEB62CC2B4D317D861F3168D161F54EA78B';
const repositoryFactory = new RepositoryFactoryHttp(nodeUrl);
const transactionHttp = repositoryFactory.createTransactionRepository();
const signedTransaction = mainAccount.sign(accountLinkTransaction, networkGenerationHash);
transactionHttp
.announce(signedTransaction)
.subscribe((x) => console.log(x), (err) => console.error(err));
// replace with node endpoint
const nodeUrl = 'http://api-01.us-east-1.096x.symboldev.network:3000';
// replace with meta.networkGenerationHash (nodeUrl + '/node/info')
const networkGenerationHash = '1DFB2FAA9E7F054168B0C5FCB84F4DEB62CC2B4D317D861F3168D161F54EA78B';
const repositoryFactory = new symbol_sdk_1.RepositoryFactoryHttp(nodeUrl);
const transactionHttp = repositoryFactory.createTransactionRepository();
const signedTransaction = mainAccount.sign(accountLinkTransaction, networkGenerationHash);
transactionHttp
.announce(signedTransaction)
.subscribe((x) => console.log(x), (err) => console.error(err));
トランザクションが承認されたら、デリゲートハーベスティングで接続したい ノードと R の秘密鍵を共有 します。
4. Create a PersistentDelegationRequestTransaction. Add the node’s public key as the transaction recipient and share the R’s private key by creating a special encrypted message as follows:
注釈
ノードの公開鍵を http://<node-url>:3000/node/info
に問い合わせて取得します。
// replace with node publicKey (nodeUrl + '/node/info')
const nodePublicKey = '3A537D5A1AF51158C42F80A199BB58351DBF3253C4A6A1B7BD1014682FB595EA';
const nodePublicAccount = PublicAccount.createFromPublicKey(nodePublicKey, networkType);
const persistentDelegationRequestTransaction = PersistentDelegationRequestTransaction
.createPersistentDelegationRequestTransaction(
Deadline.create(),
remoteAccount.privateKey,
nodePublicAccount.publicKey,
networkType,
UInt64.fromUint(2000000));
// replace with node publicKey (nodeUrl + '/node/info')
const nodePublicKey = '3A537D5A1AF51158C42F80A199BB58351DBF3253C4A6A1B7BD1014682FB595EA';
const nodePublicAccount = symbol_sdk_1.PublicAccount.createFromPublicKey(nodePublicKey, networkType);
const persistentDelegationRequestTransaction = symbol_sdk_1.PersistentDelegationRequestTransaction
.createPersistentDelegationRequestTransaction(symbol_sdk_1.Deadline.create(), remoteAccount.privateKey, nodePublicAccount.publicKey, networkType, symbol_sdk_1.UInt64.fromUint(2000000));
特別な暗号化メッセージ により R のプロキシ秘密鍵 が安全に共有され、ノード所有者のみが読み取り可能になります。さらに、リモートアカウントはモザイクを保有していません。価値あるアセットはメインアカウントに安全に残っており、ノード所有者によってそのセキュリティを犯すことはできません。
// replace with meta.networkGenerationHash (nodeUrl + '/node/info')
const networkGenerationHash = '1DFB2FAA9E7F054168B0C5FCB84F4DEB62CC2B4D317D861F3168D161F54EA78B';
const signedTransaction = announcerAccount.sign(persistentDelegationRequestTransaction, networkGenerationHash);
// replace with node endpoint
const nodeUrl = 'http://api-01.us-east-1.096x.symboldev.network:3000';
const repositoryFactory = new RepositoryFactoryHttp(nodeUrl);
const transactionHttp = repositoryFactory.createTransactionRepository();
transactionHttp
.announce(signedTransaction)
.subscribe((x) => console.log(x), (err) => console.error(err));
// replace with meta.networkGenerationHash (nodeUrl + '/node/info')
const networkGenerationHash = '1DFB2FAA9E7F054168B0C5FCB84F4DEB62CC2B4D317D861F3168D161F54EA78B';
const signedTransaction = announcerAccount.sign(persistentDelegationRequestTransaction, networkGenerationHash);
// replace with node endpoint
const nodeUrl = 'http://api-01.us-east-1.096x.symboldev.network:3000';
const repositoryFactory = new symbol_sdk_1.RepositoryFactoryHttp(nodeUrl);
const transactionHttp = repositoryFactory.createTransactionRepository();
transactionHttp
.announce(signedTransaction)
.subscribe((x) => console.log(x), (err) => console.error(err));
注釈
M でトランザクションをアナウンスすることもできますが、インポータンスの移転に関する情報を秘密にするために、3番目のアカウントを使用することをお勧めします。
すべてが成功すると、ノードは WebSockets を通じて暗号化メッセージを受信します。ノードがデリゲートハーベスティングをする秘密鍵を復号すると、次の条件を満たす場合、ノードの所有者は デリゲートハーベスターとして R を追加 できます。
注釈
妥当な PersistentDelegationRequestTransaction のアナウンスはデリゲートハーベスターとして追加することを保証するわけではありません。現状、アカウントがデリゲートハーベスティングを正常にアクティブ化したことを確認する唯一の方法は、新しいブロックの署名者になることです。
10,000
symbol.xym
を保有する メインアカウント (M) を読み込みます。 symbol-cli profile import --private-key 0000000000000000000000000000000000000000000000000000000000000000 --network TEST_NET --url http://api-01.us-east-1.096x.symboldev.network:3000 --profile main
symbol-cli account generate --network-type TEST_NET
symbol-cli transaction accountlink --public-key 98DB319D390F8B52E29A5FB2B4109FD709218CA505BB38D4BC54F51E1102FCDA --action Link --profile main
symbol.xym
の残高を保つ必要があります。 symbol-cli profile import --private-key FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF --network TEST_NET --url http://api-01.us-east-1.096x.symboldev.network:3000 --profile announcer
<recipient-public-key>``をノードの公開鍵で、 ``<remote-private-key>
を R の秘密鍵 で置き換えます。注釈
ノードの公開鍵を http://<node-url>:3000/node/info
に問い合わせて取得します。
symbol-cli transaction persistentharvestdelegation --recipient-public-key <recipientPublicKey> --remote-private-key <remotePrivateKey> --profile announcer
ノードが潜在的な委任ハーベスタの秘密鍵を復号すると、ノード所有者はあなたを委任ハーベスタとして追加します。
お探しのものは見つかりましたか? フィードバックをください。