Skip to content

Commit

Permalink
Bump Jörmungandr installation to eb0b7bb1
Browse files Browse the repository at this point in the history
Also took the opportunity to clean up a bit binary specs
for Jörmungandr and remove superfluous tests (already covered
by the arbitrarily generate blocks)
  • Loading branch information
Anviking authored and KtorZ committed Nov 5, 2019
1 parent 11b051d commit e67d034
Show file tree
Hide file tree
Showing 121 changed files with 88 additions and 235 deletions.
1 change: 1 addition & 0 deletions lib/jormungandr/cardano-wallet-jormungandr.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ test-suite unit
, cardano-wallet-jormungandr
, containers
, directory
, filepath
, fmt
, generic-arbitrary
, generic-lens
Expand Down
22 changes: 20 additions & 2 deletions lib/jormungandr/src/Cardano/Wallet/Jormungandr/Binary.hs
Original file line number Diff line number Diff line change
Expand Up @@ -301,9 +301,13 @@ getMessage = label "getMessage" $ do
0 -> Initial <$> getInitial
1 -> Transaction <$> getLegacyTransaction fragId
2 -> Transaction <$> getTransaction fragId
3 -> unimpl -- Certificate
3 -> unimpl -- OwnerStakeDelegation
4 -> StakeDelegation <$> getStakeDelegation fragId
5 -> unimpl -- UpdateVote
5 -> unimpl -- PoolRegistration
6 -> unimpl -- PoolRetirement
7 -> unimpl -- PoolUpdate
8 -> unimpl -- UpdateProposal
9 -> unimpl -- UpdateVote
other -> fail $ "Unexpected content type tag " ++ show other

messageTypeTag :: MessageType -> Word8
Expand Down Expand Up @@ -355,6 +359,11 @@ getStakeDelegation tid = do
accId <- getByteString 32
poolId <- getByteString 32
(tx, wits) <- getGenericTransaction tid
-- NOTE
-- Haven't quite figured what these 64 bytes are. We need some help or
-- documentation from Jörmungandr's team as this will be needed to fix
-- 'putStakeDelegationTx'.
_ <- getByteString 64
pure (PoolId poolId, ChimericAccount accId, tx, wits )

putStakeCertificate
Expand All @@ -375,6 +384,9 @@ putStakeDelegationTx
putStakeDelegationTx poolId accId inputs outputs witnesses = do
putStakeCertificate poolId accId
putSignedTx inputs outputs witnesses
-- FIXME
-- Likely, some authentication payload is needed here but this is somewhat
-- hard to figure out with the current state of affairs in Jörmungandr...

-- | Decode the contents of a @Transaction@-message.
getTransaction :: Hash "Tx" -> Get (Tx, [TxWitness])
Expand Down Expand Up @@ -515,6 +527,7 @@ data ConfigParam
| KesUpdateSpeed (Quantity "second/update" Word32)
-- ^ Maximum number of seconds per update for KES keys known by the system
-- after start time.
| UnimplementedConfigParam Word16
deriving (Eq, Show)

getConfigParam :: Get ConfigParam
Expand All @@ -527,6 +540,7 @@ getConfigParam = label "getConfigParam" $ do
taglen <- getWord16be
let tag = taglen `shift` (-6)
let len = fromIntegral $ taglen .&. (63) -- 0b111111
let unimpl = skip len >> return (UnimplementedConfigParam tag)
isolate len $ case tag of
1 -> Discrimination <$> getNetworkDiscriminant
2 -> Block0Date . W.StartTime . posixSecondsToUTCTime . fromIntegral
Expand All @@ -544,6 +558,10 @@ getConfigParam = label "getConfigParam" $ do
14 -> ConfigLinearFee <$> getLinearFee
15 -> ProposalExpiration . Quantity <$> getWord32be
16 -> KesUpdateSpeed . Quantity <$> getWord32be
17 -> unimpl -- treasury
18 -> unimpl -- treasury params
19 -> unimpl -- reward pot
20 -> unimpl -- reward params
other -> fail $ "Invalid config param with tag " ++ show other
where
-- NOTE
Expand Down
Binary file modified lib/jormungandr/test/data/block0s/arbitrary-block0-1.bin
Binary file not shown.
Binary file modified lib/jormungandr/test/data/block0s/arbitrary-block0-10.bin
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified lib/jormungandr/test/data/block0s/arbitrary-block0-2.bin
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified lib/jormungandr/test/data/block0s/arbitrary-block0-3.bin
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified lib/jormungandr/test/data/block0s/arbitrary-block0-4.bin
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified lib/jormungandr/test/data/block0s/arbitrary-block0-5.bin
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified lib/jormungandr/test/data/block0s/arbitrary-block0-6.bin
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified lib/jormungandr/test/data/block0s/arbitrary-block0-7.bin
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified lib/jormungandr/test/data/block0s/arbitrary-block0-8.bin
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified lib/jormungandr/test/data/block0s/arbitrary-block0-9.bin
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified lib/jormungandr/test/data/jormungandr/block0.bin
Binary file not shown.
15 changes: 15 additions & 0 deletions lib/jormungandr/test/data/jormungandr/funds/regenerate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash
set -euo pipefail

# This script can be used to re-generate delegation certificates.

# First argument is the index for the account. (e.g. "1")
# Second argument is the folder-name for the stake-pool (e.g. "a")
delegate () {
jcli certificate new stake-delegation $(cat ../stake_pools/$2/pool_id) $(cat account$1.pub) > stake_delegation$1.cert
cat stake_delegation$1.cert | jcli certificate sign -k account$1.prv > stake_delegation$1.signedcert
}

delegate 1 a
delegate 2 b
delegate 3 c

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
signedcert1qxkalz75s4vtw2e9wsy2q9jvsu3qtz6d2vm3xj4e5q4ufejpjjfn5nh6xwyyppjw3u2fksnahv3dcmjyllmd89g9vcwcvjv3jntn8yrsw23q5zv7q8f2yjj68zre69c0eqgmzpsp8dwsgnul60nacr6qv926dmu6f4zlgk8pylcezuu98aemn4pgmus66rz8k60qm0eggklykrs8wxl2n
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
signedcert1q8qtmpgefmhlwrwlm48kxq43hpkxnvz8fey2jlmce5lea3mxnskfqk4vpz28p9pcx98vrj9sd9uzplpwl2kfz3mgk5l9f45tp08p02dgpddtc3kl7l78v2x58zq93ffdenrgu5ucvqmgsau9a7j4tjzfygs67c0t9rh97v66w0tanfh809rpxsnmruk7tfr0kg90ggg2637dwrq3kedmw
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cert1qxzn99jx8a2rw80gp9uea47tmcndv7gm28vy9as6akevy32204aq05lfpyq54v70rvr94d0r0yljvasu7rw2pmj0uj070zkq92qr0qp0xzauxw
cert1qxzn99jx8a2rw80gp9uea47tmcndv7gm28vy9as6akevy32204aqwh8mklm7cqzsfx0m68re29fpd3ddvd4e05v5f00g5lde3e73y6qrgvkag3
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
signedcert1qxzn99jx8a2rw80gp9uea47tmcndv7gm28vy9as6akevy32204aqwh8mklm7cqzsfx0m68re29fpd3ddvd4e05v5f00g5lde3e73y6qrjcu9yplavupdmka9y4aprfy3ewcwv0mr7n98r00l9a6h45k969tmwuhgle0hcd9ttywv0sne58s5zt5ftj47phgmc5yqetse6wlq7pswxlgzj
26 changes: 10 additions & 16 deletions lib/jormungandr/test/data/jormungandr/genesis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6068,8 +6068,6 @@ initial:
# https://input-output-hk.github.io/jormungandr/advanced/03_starting_genesis_praos_blockchain.html
#
# (The faucet-addresses above don't delegate.)
#
# An account address:
- fund:
# account1
# $ jcli address account (cat funds/account1.pub) --testing
Expand All @@ -6084,18 +6082,14 @@ initial:
- address: ca1skzn99jx8a2rw80gp9uea47tmcndv7gm28vy9as6akevy32204aqwzpsctx
value: 1

# Stake pool registration certificates (signed):
# a:
- cert: cert1qvqqqqqqqqqqqqqqqqqqq0p5avfqqqqqqqqqqqqqqqqsqqf2kafzla95d8k2h7kk3870r5hlq76tmp539a02esh9x6jsxk7fhuqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqpqqqqqqqqqqqqqu3ed0wgwnzwff5hzmy3jtalnzhtnp8z4ee8ps6p8tafarwky06ln5djzklrfj288ngcah69frvqg9kz5wpjyx6qg08zvs0xce4vja8qx54sy6
# b
- cert: cert1qvqqqqqqqqqqqqqqqqqqq0p5avfqqqqqqqqqqqqqqqqsqqf2kafzla95d8k2h7kk3870r5hlq76tmp539a02esh9x6jsxk7fhuqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqpqqqqqqqqqqqqpkpuhrghy89ppkeyvgvf6u2kn6wp2dmvwpa6tnddtdv0fy9hfme39ayqhwr76399cec9vmfqu4jpmlk52lt5xakhp8r9trauzwuzg2uqlmyl2n
# c
- cert: cert1qvqqqqqqqqqqqqqqqqqqq0p5avfqqqqqqqqqqqqqqqqsqq2f09gng476l3cnsjs7vr0ayw95nr0tkduzafgv9atxftup0e352vqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqpqqqqqqqqqqqqp4rqy9u7fs5e8u77q42a0uuju962jans7ad7y5qn8k2cq9p6ay63gp0lxeydu3pmfw62lacxfn0qdyaam297qgeze03ues7elm7ju5xsvnrhse
# Stake pool registration certificates
# $ cat stake_pools/{a,b,c}/stake_pool_signed.cert
- cert: signedcert1qvqqqqqqqqqqqqqqqqqqq0p5avfqqqqqqqqqqqqqqqqsqqf2kafzla95d8k2h7kk3870r5hlq76tmp539a02esh9x6jsxk7fhuqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqpqqqqqqqqqqqqqu3ed0wgwnzwff5hzmy3jtalnzhtnp8z4ee8ps6p8tafarwky06ln5djzklrfj288ngcah69frvqg9kz5wpjyx6qg08zvs0xce4vja8qqqgqqz070rdj0uf7gumvu9jkgz35e9rjejl9ktfrwrvut9tyhcfqpdfg53tmp9y95xw0fp5ejkjac3hyawr9mkpv0hk62nzt33wfh6d5u5s9qayyg7
- cert: signedcert1qvqqqqqqqqqqqqqqqqqqq0p5avfqqqqqqqqqqqqqqqqsqqf2kafzla95d8k2h7kk3870r5hlq76tmp539a02esh9x6jsxk7fhuqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqpqqqqqqqqqqqqpkpuhrghy89ppkeyvgvf6u2kn6wp2dmvwpa6tnddtdv0fy9hfme39ayqhwr76399cec9vmfqu4jpmlk52lt5xakhp8r9trauzwuzg2uqqqgqqpf7kwyfrqtzxwx06nnd2yd5m7g5pzuy98f3zqxvahcefx5kcm9a9fdp356vdttsz35nnfjanryagtyx2y06nr0snrznpqw2f60aaxcgmqmxek
- cert: signedcert1qvqqqqqqqqqqqqqqqqqqq0p5avfqqqqqqqqqqqqqqqqsqqf2kafzla95d8k2h7kk3870r5hlq76tmp539a02esh9x6jsxk7fhuqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqpqqqqqqqqqqqqp4rqy9u7fs5e8u77q42a0uuju962jans7ad7y5qn8k2cq9p6ay63gp0lxeydu3pmfw62lacxfn0qdyaam297qgeze03ues7elm7ju5xsqqgqqrz0xqrjl9cp3uqvl8a3s7jfsfkq623zfnc88wlsyz7yw8z53j4fe8nu6q97fw5znt36rjdr7fwj9nvcgt8sdqnvddwtz7zqu9z503s00q5umg

# Stake delegation certificates
# account1 -> pool a
- cert: cert1qxkalz75s4vtw2e9wsy2q9jvsu3qtz6d2vm3xj4e5q4ufejpjjfn5nh6xwyyppjw3u2fksnahv3dcmjyllmd89g9vcwcvjv3jntn8yrshpgwfx
# account2 -> pool b
- cert: cert1q8qtmpgefmhlwrwlm48kxq43hpkxnvz8fey2jlmce5lea3mxnskfqk4vpz28p9pcx98vrj9sd9uzplpwl2kfz3mgk5l9f45tp08p02dg98g8zy
# account3 -> pool c
- cert: cert1qxzn99jx8a2rw80gp9uea47tmcndv7gm28vy9as6akevy32204aq05lfpyq54v70rvr94d0r0yljvasu7rw2pmj0uj070zkq92qr0qp0xzauxw
# Delegation certificates — delegating from the account addresses to the pools
# $ cat funds/stake_delegation{1,2,3}.signedcert
- cert: signedcert1qxkalz75s4vtw2e9wsy2q9jvsu3qtz6d2vm3xj4e5q4ufejpjjfn5nh6xwyyppjw3u2fksnahv3dcmjyllmd89g9vcwcvjv3jntn8yrsw23q5zv7q8f2yjj68zre69c0eqgmzpsp8dwsgnul60nacr6qv926dmu6f4zlgk8pylcezuu98aemn4pgmus66rz8k60qm0eggklykrs8wxl2n
- cert: signedcert1q8qtmpgefmhlwrwlm48kxq43hpkxnvz8fey2jlmce5lea3mxnskfqk4vpz28p9pcx98vrj9sd9uzplpwl2kfz3mgk5l9f45tp08p02dgpddtc3kl7l78v2x58zq93ffdenrgu5ucvqmgsau9a7j4tjzfygs67c0t9rh97v66w0tanfh809rpxsnmruk7tfr0kg90ggg2637dwrq3kedmw
- cert: signedcert1qxzn99jx8a2rw80gp9uea47tmcndv7gm28vy9as6akevy32204aqwh8mklm7cqzsfx0m68re29fpd3ddvd4e05v5f00g5lde3e73y6qrjcu9yplavupdmka9y4aprfy3ewcwv0mr7n98r00l9a6h45k969tmwuhgle0hcd9ttywv0sne58s5zt5ftj47phgmc5yqetse6wlq7pswxlgzj
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cert1qvqqqqqqqqqqqqqqqqqqq0p5avfqqqqqqqqqqqqqqqqsqqf2kafzla95d8k2h7kk3870r5hlq76tmp539a02esh9x6jsxk7fhuqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqpqqqqqqqqqqqqqu3ed0wgwnzwff5hzmy3jtalnzhtnp8z4ee8ps6p8tafarwky06ln5djzklrfj288ngcah69frvqg9kz5wpjyx6qg08zvs0xce4vja8qx54sy6
signedcert1qvqqqqqqqqqqqqqqqqqqq0p5avfqqqqqqqqqqqqqqqqsqqf2kafzla95d8k2h7kk3870r5hlq76tmp539a02esh9x6jsxk7fhuqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqpqqqqqqqqqqqqqu3ed0wgwnzwff5hzmy3jtalnzhtnp8z4ee8ps6p8tafarwky06ln5djzklrfj288ngcah69frvqg9kz5wpjyx6qg08zvs0xce4vja8qqqgqqz070rdj0uf7gumvu9jkgz35e9rjejl9ktfrwrvut9tyhcfqpdfg53tmp9y95xw0fp5ejkjac3hyawr9mkpv0hk62nzt33wfh6d5u5s9qayyg7
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cert1qvqqqqqqqqqqqqqqqqqqq0p5avfqqqqqqqqqqqqqqqqsqqf2kafzla95d8k2h7kk3870r5hlq76tmp539a02esh9x6jsxk7fhuqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqpqqqqqqqqqqqqqu3ed0wgwnzwff5hzmy3jtalnzhtnp8z4ee8ps6p8tafarwky06ln5djzklrfj288ngcah69frvqg9kz5wpjyx6qg08zvs0xce4vja8qx54sy6
signedcert1qvqqqqqqqqqqqqqqqqqqq0p5avfqqqqqqqqqqqqqqqqsqqf2kafzla95d8k2h7kk3870r5hlq76tmp539a02esh9x6jsxk7fhuqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqpqqqqqqqqqqqqqu3ed0wgwnzwff5hzmy3jtalnzhtnp8z4ee8ps6p8tafarwky06ln5djzklrfj288ngcah69frvqg9kz5wpjyx6qg08zvs0xce4vja8qqqgqqz070rdj0uf7gumvu9jkgz35e9rjejl9ktfrwrvut9tyhcfqpdfg53tmp9y95xw0fp5ejkjac3hyawr9mkpv0hk62nzt33wfh6d5u5s9qayyg7
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cert1qvqqqqqqqqqqqqqqqqqqq0p5avfqqqqqqqqqqqqqqqqsqqf2kafzla95d8k2h7kk3870r5hlq76tmp539a02esh9x6jsxk7fhuqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqpqqqqqqqqqqqqpkpuhrghy89ppkeyvgvf6u2kn6wp2dmvwpa6tnddtdv0fy9hfme39ayqhwr76399cec9vmfqu4jpmlk52lt5xakhp8r9trauzwuzg2uqlmyl2n
signedcert1qvqqqqqqqqqqqqqqqqqqq0p5avfqqqqqqqqqqqqqqqqsqqf2kafzla95d8k2h7kk3870r5hlq76tmp539a02esh9x6jsxk7fhuqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqpqqqqqqqqqqqqpkpuhrghy89ppkeyvgvf6u2kn6wp2dmvwpa6tnddtdv0fy9hfme39ayqhwr76399cec9vmfqu4jpmlk52lt5xakhp8r9trauzwuzg2uqqqgqqpf7kwyfrqtzxwx06nnd2yd5m7g5pzuy98f3zqxvahcefx5kcm9a9fdp356vdttsz35nnfjanryagtyx2y06nr0snrznpqw2f60aaxcgmqmxek
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cert1qvqqqqqqqqqqqqqqqqqqq0p5avfqqqqqqqqqqqqqqqqsqqf2kafzla95d8k2h7kk3870r5hlq76tmp539a02esh9x6jsxk7fhuqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqpqqqqqqqqqqqqpkpuhrghy89ppkeyvgvf6u2kn6wp2dmvwpa6tnddtdv0fy9hfme39ayqhwr76399cec9vmfqu4jpmlk52lt5xakhp8r9trauzwuzg2uqlmyl2n
signedcert1qvqqqqqqqqqqqqqqqqqqq0p5avfqqqqqqqqqqqqqqqqsqqf2kafzla95d8k2h7kk3870r5hlq76tmp539a02esh9x6jsxk7fhuqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqpqqqqqqqqqqqqpkpuhrghy89ppkeyvgvf6u2kn6wp2dmvwpa6tnddtdv0fy9hfme39ayqhwr76399cec9vmfqu4jpmlk52lt5xakhp8r9trauzwuzg2uqqqgqqpf7kwyfrqtzxwx06nnd2yd5m7g5pzuy98f3zqxvahcefx5kcm9a9fdp356vdttsz35nnfjanryagtyx2y06nr0snrznpqw2f60aaxcgmqmxek
Original file line number Diff line number Diff line change
@@ -1 +1 @@
d3e909014ab3cf1b065ab5e3793f26761cf0dca0ee4fe49fe78ac02a8037802f
5cfbb7f7ec0050499fbd1c79515216c5ad636b97d1944bde8a7db98e7d126803
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cert1qvqqqqqqqqqqqqqqqqqqq0p5avfqqqqqqqqqqqqqqqqsqq2f09gng476l3cnsjs7vr0ayw95nr0tkduzafgv9atxftup0e352vqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqpqqqqqqqqqqqqp4rqy9u7fs5e8u77q42a0uuju962jans7ad7y5qn8k2cq9p6ay63gp0lxeydu3pmfw62lacxfn0qdyaam297qgeze03ues7elm7ju5xsvnrhse
signedcert1qvqqqqqqqqqqqqqqqqqqq0p5avfqqqqqqqqqqqqqqqqsqqf2kafzla95d8k2h7kk3870r5hlq76tmp539a02esh9x6jsxk7fhuqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqpqqqqqqqqqqqqp4rqy9u7fs5e8u77q42a0uuju962jans7ad7y5qn8k2cq9p6ay63gp0lxeydu3pmfw62lacxfn0qdyaam297qgeze03ues7elm7ju5xsqqgqqrz0xqrjl9cp3uqvl8a3s7jfsfkq623zfnc88wlsyz7yw8z53j4fe8nu6q97fw5znt36rjdr7fwj9nvcgt8sdqnvddwtz7zqu9z503s00q5umg
Original file line number Diff line number Diff line change
@@ -1 +1 @@
d3e909014ab3cf1b065ab5e3793f26761cf0dca0ee4fe49fe78ac02a8037802f
5cfbb7f7ec0050499fbd1c79515216c5ad636b97d1944bde8a7db98e7d126803
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cert1qvqqqqqqqqqqqqqqqqqqq0p5avfqqqqqqqqqqqqqqqqsqq2f09gng476l3cnsjs7vr0ayw95nr0tkduzafgv9atxftup0e352vqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqpqqqqqqqqqqqqp4rqy9u7fs5e8u77q42a0uuju962jans7ad7y5qn8k2cq9p6ay63gp0lxeydu3pmfw62lacxfn0qdyaam297qgeze03ues7elm7ju5xsvnrhse
signedcert1qvqqqqqqqqqqqqqqqqqqq0p5avfqqqqqqqqqqqqqqqqsqqf2kafzla95d8k2h7kk3870r5hlq76tmp539a02esh9x6jsxk7fhuqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqpqqqqqqqqqqqqp4rqy9u7fs5e8u77q42a0uuju962jans7ad7y5qn8k2cq9p6ay63gp0lxeydu3pmfw62lacxfn0qdyaam297qgeze03ues7elm7ju5xsqqgqqrz0xqrjl9cp3uqvl8a3s7jfsfkq623zfnc88wlsyz7yw8z53j4fe8nu6q97fw5znt36rjdr7fwj9nvcgt8sdqnvddwtz7zqu9z503s00q5umg
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,23 @@ set -euo pipefail
# To create a stake pool in a folder "a":
# .create-stake-pool.sh a
#
# To only regenerate the certificate only (using existing keys), run:
# .create-stake-pool.sh a --update
# For context, see also:
# https://input-output-hk.github.io/jormungandr/stake_pool/registering_stake_pool.html

echo "creating certificates for a new stake pool in the folder $1"
mkdir $1
cd $1

jcli key generate --type=Curve25519_2HashDH > stake_pool_vrf.prv
cat stake_pool_vrf.prv | jcli key to-public > stake_pool_vrf.pub
jcli key generate --type=SumEd25519_12 > stake_pool_kes.prv
cat stake_pool_kes.prv | jcli key to-public > stake_pool_kes.pub
if [[ $* == *--update* ]]; then
echo "regenerating stake pool certificates the folder $1 using existing keys"
cd $1
else
echo "creating certificates for a new stake pool in the folder $1"
mkdir $1
cd $1
jcli key generate --type=Curve25519_2HashDH > stake_pool_vrf.prv
cat stake_pool_vrf.prv | jcli key to-public > stake_pool_vrf.pub
jcli key generate --type=SumEd25519_12 > stake_pool_kes.prv
cat stake_pool_kes.prv | jcli key to-public > stake_pool_kes.pub
fi

jcli certificate new stake-pool-registration \
--kes-key $(cat stake_pool_kes.pub) \
Expand All @@ -36,6 +42,6 @@ jcli certificate new stake-pool-registration \
--owner $(cat ../owner.pub) \
--management-threshold 1 > stake_pool.cert

cat stake_pool.cert | jcli certificate sign ../owner.prv | tee stake_pool.cert > stake_pool_signed.cert
cat stake_pool.cert | jcli certificate sign -k ../owner.prv | tee stake_pool.cert > stake_pool_signed.cert

cat stake_pool.cert | jcli certificate get-stake-pool-id | tee stake_pool.id > pool_id
Loading

0 comments on commit e67d034

Please sign in to comment.