├── .buildkite ├── nightly.yml └── pipeline.yml ├── .editorconfig ├── .gitattributes ├── .gitignore ├── .hindent.yaml ├── .hlint.yaml ├── .stylish-haskell.yaml ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE ├── Makefile ├── NOTICE ├── README.md ├── Setup.hs ├── acid-state-exts ├── README.md ├── Setup.hs ├── acid-state-exts.cabal └── src │ └── Serokell │ └── AcidState │ ├── ExtendedState.hs │ ├── Instances.hs │ └── Util.hs ├── appveyor.yml ├── auxx ├── LICENSE ├── Main.hs ├── Makefile ├── NOTICE ├── README.md ├── Setup.hs ├── cardano-sl-auxx.cabal ├── src │ ├── AuxxOptions.hs │ ├── Command.hs │ ├── Command │ │ ├── BlockGen.hs │ │ ├── Help.hs │ │ ├── Proc.hs │ │ ├── Rollback.hs │ │ ├── Tx.hs │ │ ├── TyProjection.hs │ │ └── Update.hs │ ├── Lang.hs │ ├── Lang │ │ ├── Argument.hs │ │ ├── Command.hs │ │ ├── DisplayError.hs │ │ ├── Interpreter.hs │ │ ├── Lexer.hs │ │ ├── Name.hs │ │ ├── Parser.hs │ │ ├── Syntax.hs │ │ └── Value.hs │ ├── Mode.hs │ ├── Plugin.hs │ └── Repl.hs └── test │ ├── Spec.hs │ ├── Test.hs │ └── Test │ └── Auxx │ └── Lang │ ├── ArgumentSpec.hs │ ├── LexerSpec.hs │ └── ParserSpec.hs ├── binary ├── LICENSE ├── NOTICE ├── README.md ├── Setup.hs ├── cardano-sl-binary.cabal ├── src │ └── Pos │ │ └── Binary │ │ ├── Class.hs │ │ ├── Class │ │ ├── Core.hs │ │ ├── Primitive.hs │ │ └── TH.hs │ │ ├── Limit.hs │ │ └── SafeCopy.hs └── test │ ├── LICENSE │ ├── NOTICE │ ├── Spec.hs │ ├── Test │ └── Pos │ │ ├── Binary │ │ ├── BiSerialize.hs │ │ ├── BiSizeBounds.hs │ │ ├── Cbor │ │ │ └── CborSpec.hs │ │ ├── Helpers.hs │ │ └── Helpers │ │ │ └── GoldenRoundTrip.hs │ │ └── Cbor │ │ ├── Canonicity.hs │ │ └── RefImpl.hs │ ├── cardano-sl-binary-test.cabal │ ├── golden │ ├── TestSimpleIndexed1 │ ├── TestSimpleIndexed2 │ ├── TestSimpleIndexed3 │ ├── TestSimpleIndexed4 │ └── TestSimpleIndexed5 │ └── test.hs ├── bors.toml ├── cabal.project ├── cabal.project.freeze ├── chain ├── LICENSE ├── Makefile ├── NOTICE ├── README.md ├── Setup.hs ├── bench │ └── block-bench.hs ├── cardano-sl-chain.cabal ├── shell.nix ├── src │ └── Pos │ │ └── Chain │ │ ├── Block.hs │ │ ├── Block │ │ ├── Block.hs │ │ ├── ComponentBlock.hs │ │ ├── Configuration.hs │ │ ├── Error.hs │ │ ├── Genesis.hs │ │ ├── HasPrevBlock.hs │ │ ├── Header.hs │ │ ├── IsHeader.hs │ │ ├── JsonLog.hs │ │ ├── Logic.hs │ │ ├── Logic │ │ │ └── Integrity.hs │ │ ├── Main.hs │ │ ├── Slog.hs │ │ ├── Slog │ │ │ ├── LastBlkSlots.hs │ │ │ └── Types.hs │ │ ├── Types.hs │ │ └── Util.hs │ │ ├── Delegation.hs │ │ ├── Delegation │ │ ├── Cede.hs │ │ ├── Cede │ │ │ ├── Class.hs │ │ │ └── Types.hs │ │ ├── Class.hs │ │ ├── Configuration.hs │ │ ├── HeavyDlgIndex.hs │ │ ├── LightDlgIndices.hs │ │ ├── Payload.hs │ │ ├── Proof.hs │ │ └── Types.hs │ │ ├── Genesis.hs │ │ ├── Genesis │ │ ├── AvvmBalances.hs │ │ ├── Config.hs │ │ ├── Data.hs │ │ ├── Delegation.hs │ │ ├── Generate.hs │ │ ├── Hash.hs │ │ ├── Initializer.hs │ │ ├── NonAvvmBalances.hs │ │ ├── ProtocolConstants.hs │ │ ├── Spec.hs │ │ └── WStakeholders.hs │ │ ├── Lrc.hs │ │ ├── Lrc │ │ ├── Core.hs │ │ ├── Error.hs │ │ ├── Fts.hs │ │ ├── Genesis.hs │ │ ├── OBFT.hs │ │ ├── RichmenComponent.hs │ │ └── Types.hs │ │ ├── Script.hs │ │ ├── Security.hs │ │ ├── Security │ │ ├── Params.hs │ │ └── Util.hs │ │ ├── Ssc.hs │ │ ├── Ssc │ │ ├── Base.hs │ │ ├── Behavior.hs │ │ ├── Commitment.hs │ │ ├── CommitmentAndOpening.hs │ │ ├── CommitmentsMap.hs │ │ ├── Configuration.hs │ │ ├── Error.hs │ │ ├── Error │ │ │ ├── Seed.hs │ │ │ └── Verify.hs │ │ ├── Functions.hs │ │ ├── Mem.hs │ │ ├── Message.hs │ │ ├── Opening.hs │ │ ├── OpeningsMap.hs │ │ ├── Payload.hs │ │ ├── Proof.hs │ │ ├── Seed.hs │ │ ├── Shares.hs │ │ ├── SharesDistribution.hs │ │ ├── SharesMap.hs │ │ ├── Toss.hs │ │ ├── Toss │ │ │ ├── Base.hs │ │ │ ├── Class.hs │ │ │ ├── Logic.hs │ │ │ ├── Pure.hs │ │ │ └── Types.hs │ │ ├── Types.hs │ │ ├── VssCertData.hs │ │ ├── VssCertificate.hs │ │ └── VssCertificatesMap.hs │ │ ├── Txp.hs │ │ ├── Txp │ │ ├── Base.hs │ │ ├── Configuration.hs │ │ ├── Error.hs │ │ ├── GenesisUtxo.hs │ │ ├── Toil.hs │ │ ├── Toil │ │ │ ├── Failure.hs │ │ │ ├── Logic.hs │ │ │ ├── Monad.hs │ │ │ ├── Stakes.hs │ │ │ ├── Types.hs │ │ │ ├── Utxo.hs │ │ │ └── Utxo │ │ │ │ ├── Functions.hs │ │ │ │ └── Util.hs │ │ ├── Topsort.hs │ │ ├── Tx.hs │ │ ├── TxAux.hs │ │ ├── TxMsg.hs │ │ ├── TxOutAux.hs │ │ ├── TxPayload.hs │ │ ├── TxProof.hs │ │ ├── TxWitness.hs │ │ └── Undo.hs │ │ ├── Update.hs │ │ └── Update │ │ ├── ApplicationName.hs │ │ ├── BlockVersion.hs │ │ ├── BlockVersionData.hs │ │ ├── BlockVersionModifier.hs │ │ ├── Configuration.hs │ │ ├── Constants.hs │ │ ├── Data.hs │ │ ├── Params.hs │ │ ├── Payload.hs │ │ ├── Poll.hs │ │ ├── Poll │ │ ├── Class.hs │ │ ├── Failure.hs │ │ ├── Modifier.hs │ │ └── Types.hs │ │ ├── Proof.hs │ │ ├── SoftforkRule.hs │ │ ├── SoftwareVersion.hs │ │ ├── SystemTag.hs │ │ ├── Util.hs │ │ └── Vote.hs └── test │ ├── LICENSE │ ├── NOTICE │ ├── Setup.hs │ ├── Spec.hs │ ├── Test │ └── Pos │ │ └── Chain │ │ ├── Block │ │ ├── Arbitrary.hs │ │ ├── Arbitrary │ │ │ └── Generate.hs │ │ ├── Bi.hs │ │ ├── BlockSpec.hs │ │ ├── CborSpec.hs │ │ ├── Gen.hs │ │ ├── SafeCopySpec.hs │ │ └── Slog │ │ │ └── LastBlkSlots.hs │ │ ├── Delegation │ │ ├── Arbitrary.hs │ │ ├── Bi.hs │ │ ├── Example.hs │ │ └── Gen.hs │ │ ├── Genesis │ │ ├── Arbitrary.hs │ │ ├── Dummy.hs │ │ ├── Example.hs │ │ ├── Gen.hs │ │ └── Json.hs │ │ ├── Lrc │ │ ├── Arbitrary.hs │ │ ├── FtsSpec.hs │ │ ├── ObftRoundRobinSpec.hs │ │ └── StakeAndHolder.hs │ │ ├── Ssc │ │ ├── Arbitrary.hs │ │ ├── Bi.hs │ │ ├── CborSpec.hs │ │ ├── Example.hs │ │ ├── Gen.hs │ │ └── Json.hs │ │ ├── Txp │ │ ├── Arbitrary.hs │ │ ├── Arbitrary │ │ │ └── Unsafe.hs │ │ ├── Bi.hs │ │ ├── CoreSpec.hs │ │ ├── Example.hs │ │ ├── Gen.hs │ │ ├── Json.hs │ │ └── Toil │ │ │ └── UtxoSpec.hs │ │ └── Update │ │ ├── Arbitrary.hs │ │ ├── Bi.hs │ │ ├── CborSpec.hs │ │ ├── Example.hs │ │ ├── Gen.hs │ │ └── Json.hs │ ├── cardano-sl-chain-test.cabal │ ├── golden │ ├── bi │ │ ├── block │ │ │ ├── BlockBodyAttributes │ │ │ ├── BlockHeaderAttributes │ │ │ ├── BlockHeaderMain │ │ │ ├── BlockHeader_Genesis │ │ │ ├── BlockSignature │ │ │ ├── BlockSignature_Heavy │ │ │ ├── BlockSignature_Light │ │ │ ├── GenesisBlockHeader │ │ │ ├── GenesisBody │ │ │ ├── GenesisConsensusData │ │ │ ├── GenesisProof │ │ │ ├── HeaderHash │ │ │ ├── MainBlockHeader │ │ │ ├── MainBody │ │ │ ├── MainConsensusData │ │ │ ├── MainExtraBodyData │ │ │ ├── MainExtraHeaderData │ │ │ ├── MainProof │ │ │ ├── MainToSign │ │ │ └── Undo │ │ ├── delegation │ │ │ ├── DlgPayload │ │ │ ├── HeavyDlgIndex │ │ │ ├── LightDlgIndices │ │ │ ├── ProxySKBlockInfo_Just │ │ │ ├── ProxySKBlockInfo_Nothing │ │ │ └── ProxySKHeavy │ │ ├── ssc │ │ │ ├── Commitment │ │ │ ├── CommitmentSignature │ │ │ ├── CommitmentsMap │ │ │ ├── InnerSharesMap │ │ │ ├── Opening │ │ │ ├── OpeningsMap │ │ │ ├── SharesDistribution │ │ │ ├── SharesMap │ │ │ ├── SignedCommitment │ │ │ ├── SscPayload_CertificatesPayload │ │ │ ├── SscPayload_CommitmentsPayload │ │ │ ├── SscPayload_OpeningsPayload │ │ │ ├── SscPayload_SharesPayload │ │ │ ├── SscProof_CertificatesProof │ │ │ ├── SscProof_CommitmentsProof │ │ │ ├── SscProof_OpeningsProof │ │ │ ├── SscProof_SharesProof │ │ │ ├── VssCertificate │ │ │ ├── VssCertificatesHash │ │ │ └── VssCertificatesMap │ │ ├── txp │ │ │ ├── HashTx │ │ │ ├── Tx │ │ │ ├── TxAttributes │ │ │ ├── TxId │ │ │ ├── TxInList │ │ │ ├── TxInWitness_PkWitness │ │ │ ├── TxInWitness_RedeemWitness │ │ │ ├── TxInWitness_ScriptWitness │ │ │ ├── TxInWitness_UnknownWitnessType │ │ │ ├── TxIn_Unknown │ │ │ ├── TxIn_Utxo │ │ │ ├── TxOut │ │ │ ├── TxOutAux │ │ │ ├── TxOutList │ │ │ ├── TxProof │ │ │ ├── TxSig │ │ │ ├── TxSigData │ │ │ └── TxWitness │ │ └── update │ │ │ ├── ApplicationName │ │ │ ├── BlockVersion │ │ │ ├── BlockVersionData │ │ │ ├── BlockVersionModifier │ │ │ ├── HashRaw │ │ │ ├── SoftforkRule │ │ │ ├── SoftwareVersion │ │ │ ├── SystemTag │ │ │ ├── UpAttributes │ │ │ ├── UpId │ │ │ ├── UpdateData │ │ │ ├── UpdatePayload │ │ │ ├── UpdateProof │ │ │ ├── UpdateProposal │ │ │ ├── UpdateProposalToSign │ │ │ ├── UpdateProposals │ │ │ ├── UpdateVote │ │ │ └── VoteId │ ├── canonical-json │ │ ├── GenesisData0_Legacy_HasNetworkMagic │ │ ├── GenesisData1_Legacy_HasNetworkMagic │ │ └── GenesisData2_Legacy_HasNetworkMagic │ ├── json │ │ ├── AttackTarget_NetworkAddressTarget │ │ ├── AttackTarget_PubKeyAddressTarget │ │ ├── GenesisProtocolConstants0_Legacy_HasNetworkMagic │ │ ├── GenesisProtocolConstants1_Legacy_HasNetworkMagic │ │ ├── GenesisProtocolConstants2_Legacy_HasNetworkMagic │ │ ├── StaticConfig_GCSpec0_Legacy_HasNetworkMagic │ │ ├── StaticConfig_GCSpec1_Legacy_HasNetworkMagic │ │ ├── StaticConfig_GCSpec2_Legacy_HasNetworkMagic │ │ ├── StaticConfig_GCSrc │ │ ├── TxValidationRulesConfig │ │ ├── TxpConfiguration0 │ │ ├── TxpConfiguration1 │ │ └── TxpConfiguration2 │ ├── oldCanonical-json │ │ ├── GenesisData0_Legacy_HasNetworkMagic │ │ ├── GenesisData1_Legacy_HasNetworkMagic │ │ └── GenesisData2_Legacy_HasNetworkMagic │ ├── oldJson │ │ ├── AttackTarget_NetworkAddressTarget │ │ ├── AttackTarget_PubKeyAddressTarget │ │ ├── GenesisProtocolConstants0_Legacy_HasNetworkMagic │ │ ├── GenesisProtocolConstants1_Legacy_HasNetworkMagic │ │ ├── GenesisProtocolConstants2_Legacy_HasNetworkMagic │ │ ├── StaticConfig_GCSpec0_Legacy_HasNetworkMagic │ │ ├── StaticConfig_GCSpec1_Legacy_HasNetworkMagic │ │ ├── StaticConfig_GCSpec2_Legacy_HasNetworkMagic │ │ ├── StaticConfig_GCSrc │ │ ├── TxpConfiguration0 │ │ ├── TxpConfiguration1 │ │ └── TxpConfiguration2 │ └── yaml │ │ └── TxValidationRulesConfig │ └── test.hs ├── client ├── LICENSE ├── Makefile ├── NOTICE ├── README.md ├── Setup.hs ├── cardano-sl-client.cabal ├── src │ └── Pos │ │ └── Client │ │ ├── KeyStorage.hs │ │ ├── Txp.hs │ │ ├── Txp │ │ ├── Addresses.hs │ │ ├── Balances.hs │ │ ├── History.hs │ │ ├── Network.hs │ │ └── Util.hs │ │ ├── Update.hs │ │ └── Update │ │ └── Network.hs └── test │ ├── Spec.hs │ ├── Test.hs │ └── Test │ └── Pos │ └── Client │ └── Txp │ ├── Mode.hs │ └── UtilSpec.hs ├── cluster ├── LICENSE ├── NOTICE ├── README.md ├── app │ ├── demo │ │ └── Main.hs │ └── prepare-environment │ │ └── Main.hs ├── cardano-sl-cluster.cabal ├── src │ └── Cardano │ │ ├── Cluster.hs │ │ └── Cluster │ │ ├── Environment.hs │ │ └── Util.hs └── test │ ├── Cardano │ └── Cluster │ │ ├── Environment │ │ ├── Arbitrary.hs │ │ └── Spec.hs │ │ └── Util │ │ ├── Arbitrary.hs │ │ └── Spec.hs │ └── Main.hs ├── core ├── LICENSE ├── Makefile ├── NOTICE ├── README.md ├── Setup.hs ├── cardano-sl-core.cabal ├── src │ └── Pos │ │ ├── Core.hs │ │ └── Core │ │ ├── Aeson.hs │ │ ├── Aeson │ │ └── Orphans.hs │ │ ├── Attributes.hs │ │ ├── Binary.hs │ │ ├── Binary │ │ └── Orphans.hs │ │ ├── Chrono.hs │ │ ├── Common.hs │ │ ├── Common │ │ ├── AddrAttributes.hs │ │ ├── AddrSpendingData.hs │ │ ├── AddrStakeDistribution.hs │ │ ├── Address.hs │ │ ├── AddressHash.hs │ │ ├── BlockCount.hs │ │ ├── ChainDifficulty.hs │ │ ├── Coeff.hs │ │ ├── Coin.hs │ │ ├── CoinPortion.hs │ │ ├── Script.hs │ │ ├── SharedSeed.hs │ │ ├── SlotLeaders.hs │ │ ├── StakeholderId.hs │ │ ├── Stakes.hs │ │ ├── TxFeePolicy.hs │ │ └── TxSizeLinear.hs │ │ ├── Conc.hs │ │ ├── Constants.hs │ │ ├── Context.hs │ │ ├── Context │ │ └── PrimaryKey.hs │ │ ├── Exception.hs │ │ ├── JsonLog.hs │ │ ├── JsonLog │ │ ├── CanJsonLog.hs │ │ ├── Event.hs │ │ ├── JsonLogT.hs │ │ └── LogEvents.hs │ │ ├── Limits.hs │ │ ├── Merkle.hs │ │ ├── Metrics │ │ └── Constants.hs │ │ ├── NetworkAddress.hs │ │ ├── NetworkMagic.hs │ │ ├── ProtocolConstants.hs │ │ ├── Reporting.hs │ │ ├── Reporting │ │ ├── MemState.hs │ │ ├── Methods.hs │ │ └── Metrics.hs │ │ ├── Slotting.hs │ │ ├── Slotting │ │ ├── Class.hs │ │ ├── EpochIndex.hs │ │ ├── EpochOrSlot.hs │ │ ├── LocalSlotIndex.hs │ │ ├── MemState.hs │ │ ├── SlotCount.hs │ │ ├── SlotId.hs │ │ ├── TimeDiff.hs │ │ ├── Timestamp.hs │ │ ├── Types.hs │ │ └── Util.hs │ │ └── Util │ │ ├── LogSafe.hs │ │ └── TimeLimit.hs └── test │ ├── LICENSE │ ├── NOTICE │ ├── Setup.hs │ ├── Spec.hs │ ├── Test │ └── Pos │ │ └── Core │ │ ├── AddressSpec.hs │ │ ├── Arbitrary.hs │ │ ├── Arbitrary │ │ ├── Slotting.hs │ │ ├── Txp.hs │ │ └── Unsafe.hs │ │ ├── Bi.hs │ │ ├── CborSpec.hs │ │ ├── Chrono.hs │ │ ├── ChronoSpec.hs │ │ ├── CoinSpec.hs │ │ ├── Dummy.hs │ │ ├── ExampleHelpers.hs │ │ ├── Gen.hs │ │ ├── Json.hs │ │ ├── LimitsSpec.hs │ │ ├── SafeCopy.hs │ │ ├── SeedSpec.hs │ │ └── SlottingSpec.hs │ ├── cardano-sl-core-test.cabal │ ├── golden │ ├── AddrSpendingData_PubKey │ ├── AddrSpendingData_Redeem │ ├── AddrSpendingData_Script │ ├── AddrSpendingData_Unknown │ ├── AddrStakeDistribution_Bootstrap │ ├── AddrStakeDistribution_SingleKey │ ├── AddrStakeDistribution_UnsafeMultiKey │ ├── AddrType_PK │ ├── AddrType_R │ ├── AddrType_S │ ├── AddrType_U │ ├── Attributes │ ├── BlockCount │ ├── ChainDifficulty │ ├── Coeff │ ├── Coin │ ├── CoinPortion │ ├── EpochIndex │ ├── EpochOrSlotEI │ ├── EpochOrSlotSI │ ├── FlatSlotId │ ├── InvReqDataFlowLog_InvReqAccepted │ ├── InvReqDataFlowLog_InvReqException │ ├── InvReqDataFlowLog_InvReqRejected │ ├── LocalSlotIndex │ ├── MerkleRoot │ ├── MerkleTree │ ├── Script │ ├── ScriptVersion │ ├── SharedSeed │ ├── SlotCount │ ├── SlotId │ ├── SlotLeaders │ ├── StakeholderId │ ├── StakesList │ ├── StakesMap │ ├── TimeDiff │ ├── TimeStamp │ ├── TxFeePolicy_Linear │ ├── TxFeePolicy_Unknown │ ├── TxSizeLinear │ ├── bi │ │ ├── Address0 │ │ ├── Address1 │ │ ├── Address2 │ │ ├── Address3 │ │ └── Address4 │ ├── json │ │ ├── Address0 │ │ ├── Address1 │ │ ├── Address2 │ │ ├── Address3 │ │ └── Address4 │ └── safecopy │ │ ├── Address'0_Legacy_NoNetworkMagic │ │ ├── Address'1_Legacy_NoNetworkMagic │ │ ├── Address'2_Legacy_NoNetworkMagic │ │ ├── Address'3_Legacy_NoNetworkMagic │ │ ├── Address'4_Legacy_NoNetworkMagic │ │ ├── Address'5_HasNetworkMagic │ │ ├── Address'6_HasNetworkMagic │ │ ├── Address'7_HasNetworkMagic │ │ ├── Address0_Legacy_NoNetworkMagic │ │ ├── Address1_Legacy_NoNetworkMagic │ │ ├── Address2_Legacy_NoNetworkMagic │ │ ├── Address3_Legacy_NoNetworkMagic │ │ ├── Address4_Legacy_NoNetworkMagic │ │ ├── Address5_HasNetworkMagic │ │ ├── Address6_HasNetworkMagic │ │ └── Address7_HasNetworkMagic │ └── test.hs ├── crypto ├── LICENSE ├── NOTICE ├── Pos │ ├── Crypto.hs │ └── Crypto │ │ ├── Configuration.hs │ │ ├── Encryption.hs │ │ ├── HD.hs │ │ ├── Hashing.hs │ │ ├── Limits.hs │ │ ├── Orphans.hs │ │ ├── Random.hs │ │ ├── SafeCopy.hs │ │ ├── Scrypt.hs │ │ ├── SecretSharing.hs │ │ ├── Signing.hs │ │ └── Signing │ │ ├── Check.hs │ │ ├── Redeem.hs │ │ ├── Safe.hs │ │ ├── Signing.hs │ │ ├── Tag.hs │ │ ├── Types.hs │ │ └── Types │ │ ├── Redeem.hs │ │ ├── Safe.hs │ │ ├── Signing.hs │ │ └── Tag.hs ├── README.md ├── Setup.hs ├── cardano-sl-crypto.cabal ├── shell.nix └── test │ ├── LICENSE │ ├── NOTICE │ ├── Setup.hs │ ├── Spec.hs │ ├── Test │ └── Pos │ │ └── Crypto │ │ ├── Arbitrary.hs │ │ ├── Arbitrary │ │ └── Unsafe.hs │ │ ├── Bi.hs │ │ ├── CborSpec.hs │ │ ├── CryptoSpec.hs │ │ ├── CryptoSpec2.hs │ │ ├── Dummy.hs │ │ ├── Example.hs │ │ ├── Gen.hs │ │ └── Json.hs │ ├── cardano-sl-crypto-test.cabal │ ├── golden │ ├── AbstractHash │ ├── DecShare │ ├── EncShare │ ├── EncryptedSecretKey │ ├── HDAddressPayload │ ├── PassPhrase │ ├── ProxyCert │ ├── ProxySecretKey │ ├── ProxySignature │ ├── PublicKey │ ├── RedeemPublicKey │ ├── RedeemSecretKey │ ├── RedeemSignature │ ├── Secret │ ├── SecretKey │ ├── SecretProof │ ├── Signature │ ├── Signed │ ├── VssPublicKey │ ├── WithHash │ └── json │ │ ├── ProtocolMagic0_Legacy_HasNetworkMagic │ │ ├── ProtocolMagic1_Legacy_HasNetworkMagic │ │ ├── ProtocolMagic2_Legacy_HasNetworkMagic │ │ ├── ProtocolMagic_Legacy_NMMustBeJust │ │ └── ProtocolMagic_Legacy_NMMustBeNothing │ └── test.hs ├── db ├── LICENSE ├── Makefile ├── NOTICE ├── README.md ├── Setup.hs ├── cardano-sl-db.cabal ├── shell.nix ├── src │ └── Pos │ │ ├── DB.hs │ │ └── DB │ │ ├── BatchOp.hs │ │ ├── Block.hs │ │ ├── Block │ │ ├── BListener.hs │ │ ├── Epoch.hs │ │ ├── GState │ │ │ ├── BlockExtra.hs │ │ │ └── SanityCheck.hs │ │ ├── Internal.hs │ │ ├── Load.hs │ │ ├── Logic │ │ │ ├── Creation.hs │ │ │ ├── Header.hs │ │ │ ├── Internal.hs │ │ │ ├── SplitByEpoch.hs │ │ │ ├── Types.hs │ │ │ ├── Util.hs │ │ │ └── VAR.hs │ │ ├── Lrc.hs │ │ └── Slog │ │ │ ├── Context.hs │ │ │ └── Logic.hs │ │ ├── BlockIndex.hs │ │ ├── Class.hs │ │ ├── Delegation.hs │ │ ├── Delegation │ │ ├── Cede │ │ │ ├── Holders.hs │ │ │ └── Logic.hs │ │ ├── Core.hs │ │ ├── Logic │ │ │ ├── Common.hs │ │ │ ├── Mempool.hs │ │ │ └── VAR.hs │ │ └── Var.hs │ │ ├── Epoch │ │ └── Index.hs │ │ ├── Error.hs │ │ ├── Functions.hs │ │ ├── GState │ │ ├── Common.hs │ │ ├── Lock.hs │ │ └── Stakes.hs │ │ ├── Lrc.hs │ │ ├── Lrc │ │ ├── Common.hs │ │ ├── Consumer.hs │ │ ├── Consumer │ │ │ ├── Delegation.hs │ │ │ ├── Ssc.hs │ │ │ └── Update.hs │ │ ├── Consumers.hs │ │ ├── Context.hs │ │ ├── Issuers.hs │ │ ├── Leaders.hs │ │ ├── Lrc.hs │ │ ├── Mode.hs │ │ ├── OBFT.hs │ │ ├── Richmen.hs │ │ ├── RichmenBase.hs │ │ └── Seed.hs │ │ ├── Misc │ │ └── Common.hs │ │ ├── Pure.hs │ │ ├── Rocks.hs │ │ ├── Rocks │ │ ├── Functions.hs │ │ └── Types.hs │ │ ├── Ssc.hs │ │ ├── Ssc │ │ ├── GState.hs │ │ ├── Logic.hs │ │ ├── Logic │ │ │ ├── Global.hs │ │ │ ├── Local.hs │ │ │ └── VAR.hs │ │ ├── SecretStorage.hs │ │ ├── State.hs │ │ └── State │ │ │ ├── Global.hs │ │ │ └── Local.hs │ │ ├── Sum.hs │ │ ├── Txp.hs │ │ ├── Txp │ │ ├── Logic.hs │ │ ├── Logic │ │ │ ├── Common.hs │ │ │ ├── Global.hs │ │ │ └── Local.hs │ │ ├── MemState.hs │ │ ├── MemState │ │ │ ├── Class.hs │ │ │ ├── Holder.hs │ │ │ ├── Metrics.hs │ │ │ └── Types.hs │ │ ├── Settings.hs │ │ ├── Stakes.hs │ │ └── Utxo.hs │ │ ├── Update.hs │ │ └── Update │ │ ├── Context.hs │ │ ├── GState.hs │ │ ├── GState │ │ └── Misc.hs │ │ ├── Logic.hs │ │ ├── Logic │ │ ├── Global.hs │ │ └── Local.hs │ │ ├── MemState.hs │ │ ├── MemState │ │ ├── Functions.hs │ │ └── Types.hs │ │ └── Poll │ │ ├── DBPoll.hs │ │ ├── Logic.hs │ │ ├── Logic │ │ ├── Apply.hs │ │ ├── Base.hs │ │ ├── Normalize.hs │ │ ├── Rollback.hs │ │ ├── Softfork.hs │ │ └── Version.hs │ │ ├── PollState.hs │ │ └── Pure.hs └── test │ ├── LICENSE │ ├── NOTICE │ ├── Setup.hs │ ├── Test │ └── Pos │ │ └── DB │ │ ├── Block │ │ ├── Arbitrary.hs │ │ └── Logic │ │ │ └── SplitByEpoch.hs │ │ ├── Epoch │ │ └── Index.hs │ │ ├── Functions.hs │ │ ├── Mode.hs │ │ └── Update │ │ ├── Arbitrary.hs │ │ ├── Arbitrary │ │ ├── MemState.hs │ │ └── Poll.hs │ │ └── Poll │ │ └── Logic │ │ └── Version.hs │ ├── cardano-sl-db-test.cabal │ └── test.hs ├── default.nix ├── docs ├── PULL_REQUEST_TEMPLATE.md ├── README.md ├── auxx.md ├── block-processing │ ├── overall.md │ ├── slog.md │ ├── txp.md │ ├── types.md │ ├── us-bv-states.png │ ├── us-proposal-states.png │ └── us.md ├── code-organisation-guidelines.md ├── configuration.md ├── databases.md ├── exceptions.md ├── exchange-onboarding.md ├── git │ ├── cheat-sheet.md │ └── getting-started.md ├── hd.md ├── how-to │ ├── README.md │ ├── bors.md │ ├── build-cardano-sl-and-daedalus-from-source-code.md │ ├── connect-to-cluster.md │ ├── demo-cluster.md │ ├── deploy-cluster.md │ ├── generate-blockchain.md │ ├── generate-genesis.md │ ├── launch-testnet.md │ ├── push-update-on-mainnet.md │ ├── rollback-blocks.md │ ├── run-explorer-web-ui.md │ ├── send-requests-to-explorer-api.md │ ├── send-requests-to-wallet-api.md │ ├── test-update-system-locally.md │ └── test-update-system.md ├── launcher.md ├── network │ ├── example-topologies │ │ ├── behind-nat-no-dns.yaml │ │ ├── behind-nat-with-dns.yaml │ │ ├── mainnet-staging.yaml │ │ ├── p2p.yaml │ │ ├── static-no-dns.yaml │ │ ├── static-with-dns.yaml │ │ └── traditional.yaml │ ├── policy.md │ ├── shelley │ │ ├── BlockRetrievalRecovery.md │ │ ├── CommunicationPatterns.md │ │ ├── CoreDIF.md │ │ ├── CoreDIF_Questions.md │ │ ├── DeltaQ.md │ │ ├── Discovery.md │ │ ├── Interface.hs │ │ ├── Interface.md │ │ ├── Serialization.md │ │ └── UI.md │ └── topology-configuration.md ├── new-dependency-policy.md ├── nix.md ├── on-the-wire │ ├── Makefile │ ├── README.md │ ├── binary.tex │ ├── current-spec.cddl │ ├── latexmkrc │ └── shell.nix ├── profiling.md ├── proposals │ ├── block-storage.md │ ├── csl-2104-crypto-scheme-changes-in-address.md │ ├── fast-sync │ │ └── README.md │ ├── serialization.md │ └── update-downloader.md ├── rollback-reaction.md ├── rules │ ├── .gitignore │ ├── Makefile │ ├── README.md │ ├── latexmkrc │ ├── property-testing.org │ ├── rules.tex │ └── shell.nix ├── style-guide.md ├── tls-authentication.md └── tx │ ├── binary-format.md │ ├── processing.md │ └── signing.md ├── explorer ├── CHANGELOG.md ├── CODEOWNERS ├── LICENSE ├── Makefile ├── NOTICE ├── PULL_REQUEST_TEMPLATE.md ├── README.md ├── Setup.hs ├── bench │ ├── Bench │ │ └── Pos │ │ │ └── Explorer │ │ │ └── ServerBench.hs │ ├── Main.hs │ └── results │ │ └── ServerBackend.html ├── cardano-sl-explorer.cabal ├── frontend │ ├── .gitignore │ ├── .gitmodules │ ├── ARCHITECTURE.md │ ├── README.md │ ├── bower.json │ ├── default.nix │ ├── nix │ │ ├── bower-generated.nix │ │ ├── generate-frontend-deps.hs │ │ ├── purescript-derive-lenses.nix │ │ └── shell.nix │ ├── package.json │ ├── postcss.config.js │ ├── scripts │ │ ├── build-explorer-frontend.sh │ │ ├── build.sh │ │ └── generate-explorer-lenses.sh │ ├── shell.nix │ ├── src │ │ ├── Control │ │ │ └── SocketIO │ │ │ │ ├── Client.js │ │ │ │ └── Client.purs │ │ ├── Data │ │ │ └── Time │ │ │ │ ├── NominalDiffTime.Test.purs │ │ │ │ └── NominalDiffTime.purs │ │ ├── Explorer │ │ │ ├── Api │ │ │ │ ├── Helper.purs │ │ │ │ ├── Http.purs │ │ │ │ ├── Socket.Test.purs │ │ │ │ ├── Socket.purs │ │ │ │ └── Types.purs │ │ │ ├── I18n │ │ │ │ ├── DE.purs │ │ │ │ ├── EN.purs │ │ │ │ ├── JP.purs │ │ │ │ ├── Lang.js │ │ │ │ ├── Lang.purs │ │ │ │ └── Types.purs │ │ │ ├── Images.purs │ │ │ ├── Routes.Test.purs │ │ │ ├── Routes.purs │ │ │ ├── State.Test.purs │ │ │ ├── State.purs │ │ │ ├── Types │ │ │ │ ├── Actions.purs │ │ │ │ ├── App.purs │ │ │ │ └── State.purs │ │ │ ├── Update.Test.purs │ │ │ ├── Update.purs │ │ │ ├── Util │ │ │ │ ├── Config.Test.purs │ │ │ │ ├── Config.js │ │ │ │ ├── Config.purs │ │ │ │ ├── DOM.js │ │ │ │ ├── DOM.purs │ │ │ │ ├── Data.Test.purs │ │ │ │ ├── Data.purs │ │ │ │ ├── Factory.purs │ │ │ │ ├── QRCode.js │ │ │ │ ├── QRCode.purs │ │ │ │ ├── String.Test.purs │ │ │ │ ├── String.js │ │ │ │ ├── String.purs │ │ │ │ ├── Time.Test.purs │ │ │ │ └── Time.purs │ │ │ └── View │ │ │ │ ├── Address.purs │ │ │ │ ├── Block.purs │ │ │ │ ├── Blocks.purs │ │ │ │ ├── CSS.Test.purs │ │ │ │ ├── CSS.purs │ │ │ │ ├── Calculator.purs │ │ │ │ ├── Common.Test.purs │ │ │ │ ├── Common.purs │ │ │ │ ├── Dashboard │ │ │ │ ├── Api.purs │ │ │ │ ├── Blocks.purs │ │ │ │ ├── Dashboard.purs │ │ │ │ ├── Hero.purs │ │ │ │ ├── Lenses.purs │ │ │ │ ├── Network.purs │ │ │ │ ├── Offer.purs │ │ │ │ ├── Shared.purs │ │ │ │ ├── Transactions.purs │ │ │ │ ├── Types.purs │ │ │ │ ├── api.css │ │ │ │ ├── dashboard.css │ │ │ │ ├── hero.css │ │ │ │ └── transactions.css │ │ │ │ ├── Footer.purs │ │ │ │ ├── GenesisBlock.purs │ │ │ │ ├── Header.purs │ │ │ │ ├── Layout.purs │ │ │ │ ├── NotFound.purs │ │ │ │ ├── Playground.purs │ │ │ │ ├── Search.purs │ │ │ │ ├── Transaction.purs │ │ │ │ ├── Types.purs │ │ │ │ ├── address.css │ │ │ │ ├── block.css │ │ │ │ ├── blocks.css │ │ │ │ ├── calculator.css │ │ │ │ ├── common.css │ │ │ │ ├── footer.css │ │ │ │ ├── genesis.css │ │ │ │ ├── header.css │ │ │ │ ├── layout.css │ │ │ │ ├── notfound.css │ │ │ │ ├── search.css │ │ │ │ └── transaction.css │ │ ├── Lib │ │ │ ├── BigNumber │ │ │ │ ├── BigNumber.Test.purs │ │ │ │ ├── BigNumber.js │ │ │ │ └── BigNumber.purs │ │ │ └── Waypoints │ │ │ │ ├── Waypoints.js │ │ │ │ └── Waypoints.purs │ │ ├── Main.Test.purs │ │ ├── Main.purs │ │ ├── Test │ │ │ └── MockFactory.purs │ │ ├── global.css │ │ ├── index.css │ │ ├── index.js │ │ └── index.tpl.html │ ├── static │ │ ├── favicon.ico │ │ ├── favicon.svg │ │ ├── fonts │ │ │ ├── Montserrat-ExtraBold.otf │ │ │ ├── Montserrat-ExtraLight.otf │ │ │ ├── Montserrat-Medium.otf │ │ │ ├── Montserrat-SemiBold.otf │ │ │ ├── Montserrat-Thin.otf │ │ │ ├── MontserratAlternates-Black.otf │ │ │ ├── MontserratAlternates-Bold.otf │ │ │ ├── MontserratAlternates-ExtraBold.otf │ │ │ ├── MontserratAlternates-ExtraLight.otf │ │ │ ├── MontserratAlternates-Light.otf │ │ │ ├── MontserratAlternates-Medium.otf │ │ │ ├── MontserratAlternates-Regular.otf │ │ │ ├── MontserratAlternates-SemiBold.otf │ │ │ ├── MontserratAlternates-Thin.otf │ │ │ ├── montserrat-black_[allfont.ru].ttf │ │ │ ├── montserrat-bold_[allfont.ru].ttf │ │ │ ├── montserrat-hairline_[allfont.ru].ttf │ │ │ ├── montserrat-light_[allfont.ru].ttf │ │ │ └── montserrat_[allfont.ru].ttf │ │ └── images │ │ │ ├── ada-currency-symbol-dark.svg │ │ │ ├── ada-currency-symbol.svg │ │ │ ├── arrow-bottom.svg │ │ │ ├── arrow-right.svg │ │ │ ├── arrow-up.svg │ │ │ ├── cardano-logo-name.svg │ │ │ ├── cardano-logo.svg │ │ │ ├── header_300517.jpg │ │ │ ├── icon-cross.svg │ │ │ ├── icon-email.svg │ │ │ ├── icon-github.svg │ │ │ ├── icon-lang-de.svg │ │ │ ├── icon-lang-en.svg │ │ │ ├── icon-lang-ja.svg │ │ │ ├── icon-menu.svg │ │ │ ├── icon-search.svg │ │ │ ├── icon-twitter.svg │ │ │ ├── image-404.svg │ │ │ ├── iohk-logo.svg │ │ │ ├── transaction-arrow-blue.svg │ │ │ ├── triangle-right.svg │ │ │ └── usd-currency-symbol-dark.svg │ ├── test │ │ ├── rename-placeholders.js │ │ └── setup.js │ ├── webpack.config.babel.js │ └── yarn.lock ├── log-config.yaml ├── python-api │ ├── README.md │ ├── app.py │ ├── default.nix │ ├── explorer_python_api │ │ ├── ExplorerDumper.py │ │ ├── __init__.py │ │ ├── app.py │ │ ├── db-tables.sql │ │ ├── db.py │ │ ├── dump.py │ │ ├── explorer.py │ │ ├── logger.py │ │ └── pgtune.txt │ └── setup.py ├── scripts │ ├── build.sh │ ├── fetch_dependencies.sh │ ├── generate_cabal2nix.sh │ └── launch │ │ ├── qa.sh │ │ └── staging.sh ├── src │ ├── Pos │ │ └── Explorer │ │ │ ├── Aeson │ │ │ └── ClientTypes.hs │ │ │ ├── BListener.hs │ │ │ ├── Core.hs │ │ │ ├── Core │ │ │ └── Types.hs │ │ │ ├── DB.hs │ │ │ ├── ExplorerMode.hs │ │ │ ├── ExtraContext.hs │ │ │ ├── Socket.hs │ │ │ ├── Socket │ │ │ ├── App.hs │ │ │ ├── Holder.hs │ │ │ ├── Methods.hs │ │ │ └── Util.hs │ │ │ ├── TestUtil.hs │ │ │ ├── Txp.hs │ │ │ ├── Txp │ │ │ ├── Common.hs │ │ │ ├── Global.hs │ │ │ ├── Local.hs │ │ │ ├── Toil.hs │ │ │ └── Toil │ │ │ │ ├── Logic.hs │ │ │ │ ├── Monad.hs │ │ │ │ └── Types.hs │ │ │ ├── Web.hs │ │ │ └── Web │ │ │ ├── Api.hs │ │ │ ├── ClientTypes.hs │ │ │ ├── Error.hs │ │ │ ├── Server.hs │ │ │ ├── TestServer.hs │ │ │ └── Transform.hs │ ├── documentation │ │ └── Main.hs │ ├── explorer │ │ ├── ExplorerNodeOptions.hs │ │ └── Main.hs │ ├── mock │ │ └── Main.hs │ └── purescript │ │ ├── Main.hs │ │ ├── PSOptions.hs │ │ └── PSTypes.hs ├── start-dev.sh └── test │ ├── Spec.hs │ ├── Test.hs │ └── Test │ └── Pos │ └── Explorer │ ├── Arbitrary.hs │ ├── BListenerSpec.hs.unused │ ├── Identity │ └── BinarySpec.hs │ ├── MockFactory.hs │ ├── Socket │ ├── AppSpec.hs │ ├── MethodsSpec.hs │ └── UtilSpec.hs │ └── Web │ ├── ClientTypesSpec.hs │ └── ServerSpec.hs ├── faucet ├── LICENSE ├── NOTICE ├── Setup.hs ├── cardano-sl-faucet.cabal ├── frontend │ ├── default.nix │ └── index.html ├── logging.cfg ├── server │ └── Main.hs ├── src │ └── Cardano │ │ ├── Faucet.hs │ │ ├── Faucet │ │ ├── Endpoints.hs │ │ ├── Init.hs │ │ ├── Metrics.hs │ │ ├── Swagger.hs │ │ ├── Types.hs │ │ └── Types │ │ │ ├── API.hs │ │ │ ├── Config.hs │ │ │ └── Recaptcha.hs │ │ └── WalletClient.hs ├── test-config.json.template ├── test │ ├── Spec.hs │ ├── captcha-resp-err.json │ ├── captcha-resp-ok.json │ ├── multi-line-secret.txt │ └── valid-secret.txt └── wallet-source.json.template ├── generator ├── LICENSE ├── Makefile ├── NOTICE ├── README.md ├── Setup.hs ├── app │ └── VerificationBench.hs ├── bench │ ├── Bench │ │ └── Pos │ │ │ └── Criterion │ │ │ └── Block │ │ │ └── Logic.hs │ └── Main.hs ├── cardano-sl-generator.cabal ├── src │ ├── Pos │ │ ├── Generator.hs │ │ └── Generator │ │ │ ├── Block.hs │ │ │ ├── Block │ │ │ ├── Error.hs │ │ │ ├── Logic.hs │ │ │ ├── Mode.hs │ │ │ ├── Orphans.hs │ │ │ ├── Param.hs │ │ │ └── Payload.hs │ │ │ ├── BlockEvent.hs │ │ │ └── BlockEvent │ │ │ └── DSL.hs │ └── Test │ │ └── Pos │ │ └── Block │ │ └── Logic │ │ ├── Emulation.hs │ │ ├── Event.hs │ │ ├── Mode.hs │ │ └── Util.hs └── test │ ├── Spec.hs │ ├── Test.hs │ └── Test │ └── Pos │ ├── Binary │ └── CommunicationSpec.hs │ ├── Block │ ├── Logic │ │ ├── CreationSpec.hs │ │ └── VarSpec.hs │ └── Property.hs │ └── Generator │ └── Block │ └── LrcSpec.hs ├── infra ├── LICENSE ├── Makefile ├── NOTICE ├── README.md ├── Setup.hs ├── cardano-sl-infra.cabal ├── default.nix ├── shell.nix ├── src │ └── Pos │ │ └── Infra │ │ ├── Communication │ │ ├── BiP.hs │ │ ├── Constants.hs │ │ ├── Limits │ │ │ └── Instances.hs │ │ ├── Listener.hs │ │ ├── Protocol.hs │ │ ├── Relay.hs │ │ ├── Relay │ │ │ ├── Class.hs │ │ │ ├── Logic.hs │ │ │ ├── Types.hs │ │ │ └── Util.hs │ │ ├── Specs.hs │ │ └── Types │ │ │ ├── Protocol.hs │ │ │ └── Relay.hs │ │ ├── Diffusion │ │ ├── Subscription │ │ │ ├── Common.hs │ │ │ ├── Dns.hs │ │ │ ├── Status.hs │ │ │ └── Subscriber.hs │ │ ├── Transport │ │ │ └── TCP.hs │ │ └── Types.hs │ │ ├── Discovery.hs │ │ ├── Discovery │ │ └── Model │ │ │ └── Class.hs │ │ ├── HealthCheck │ │ └── Route53.hs │ │ ├── InjectFail.hs │ │ ├── Network │ │ ├── CLI.hs │ │ ├── DnsDomains.hs │ │ ├── Policy.hs │ │ ├── Types.hs │ │ ├── Windows │ │ │ └── DnsDomains.hs │ │ └── Yaml.hs │ │ ├── Recovery │ │ ├── Info.hs │ │ └── Types.hs │ │ ├── Reporting.hs │ │ ├── Reporting │ │ ├── Ekg.hs │ │ ├── Exceptions.hs │ │ ├── Health │ │ │ └── Types.hs │ │ ├── Http.hs │ │ ├── Methods.hs │ │ ├── NodeInfo.hs │ │ ├── Statsd.hs │ │ └── Wlog.hs │ │ ├── Shutdown.hs │ │ ├── Shutdown │ │ ├── Class.hs │ │ ├── Logic.hs │ │ └── Types.hs │ │ ├── Slotting.hs │ │ ├── Slotting │ │ ├── Class.hs │ │ ├── Error.hs │ │ ├── Impl.hs │ │ ├── Impl │ │ │ ├── Simple.hs │ │ │ └── Util.hs │ │ ├── Types.hs │ │ └── Util.hs │ │ ├── StateLock.hs │ │ ├── Statistics.hs │ │ ├── Statistics │ │ ├── Ekg.hs │ │ └── Statsd.hs │ │ └── Util │ │ ├── JsonLog │ │ └── Events.hs │ │ ├── LogSafe.hs │ │ ├── Monitor.hs │ │ ├── SigHandler.hs │ │ ├── TimeLimit.hs │ │ └── TimeWarp.hs └── test │ ├── LICENSE │ ├── NOTICE │ ├── Setup.hs │ ├── Spec.hs │ ├── Test │ └── Pos │ │ └── Infra │ │ ├── Arbitrary.hs │ │ ├── Arbitrary │ │ ├── Communication.hs │ │ ├── Slotting.hs │ │ ├── Ssc.hs │ │ ├── Txp.hs │ │ └── Update.hs │ │ ├── Bi.hs │ │ ├── Diffusion │ │ └── Subscription │ │ │ ├── StatusSpec.hs │ │ │ └── SubscriptionSpec.hs │ │ ├── Gen.hs │ │ └── Json.hs │ ├── cardano-sl-infra-test.cabal │ ├── golden │ ├── HandlerSpec_ConvHandler │ ├── HandlerSpec_UnknownHandler │ ├── NodeMetadata │ ├── TopologyBehindNAT │ ├── TopologyP2P │ ├── TopologyStatic │ └── TopologyTraditional │ └── test.hs ├── lib.nix ├── lib ├── LICENSE ├── Makefile ├── NOTICE ├── README.md ├── Setup.hs ├── bench │ ├── Bench │ │ ├── Configuration.hs │ │ └── Pos │ │ │ ├── Criterion │ │ │ ├── FollowTheSatoshiBench.hs │ │ │ └── TxSigningBench.hs │ │ │ └── Diffusion │ │ │ └── BlockDownload.hs │ └── Local │ │ └── Criterion.hs ├── cardano-sl.cabal ├── configuration.yaml ├── default.nix ├── mainnet-ci-genesis.json ├── mainnet-genesis-dryrun-with-stakeholders.json ├── mainnet-genesis.json ├── mainnet-staging-short-epoch-genesis.json ├── shell.nix ├── shelley-staging-genesis.json ├── shelley-staging-short-genesis.json ├── src │ ├── Pos │ │ ├── AllSecrets.hs │ │ ├── Behavior.hs │ │ ├── Binary.hs │ │ ├── Binary │ │ │ └── Communication.hs │ │ ├── Client │ │ │ ├── CLI.hs │ │ │ └── CLI │ │ │ │ ├── NodeOptions.hs │ │ │ │ ├── Options.hs │ │ │ │ ├── Params.hs │ │ │ │ ├── Secrets.hs │ │ │ │ └── Util.hs │ │ ├── Communication.hs │ │ ├── Communication │ │ │ ├── Limits.hs │ │ │ ├── Server.hs │ │ │ └── Types.hs │ │ ├── Configuration.hs │ │ ├── Constants.hs │ │ ├── Context.hs │ │ ├── Context │ │ │ └── Context.hs │ │ ├── DB │ │ │ └── DB.hs │ │ ├── Diffusion │ │ │ ├── Full.hs │ │ │ └── Full │ │ │ │ ├── Block.hs │ │ │ │ ├── Delegation.hs │ │ │ │ ├── Ssc.hs │ │ │ │ ├── Txp.hs │ │ │ │ └── Update.hs │ │ ├── GState.hs │ │ ├── GState │ │ │ ├── Context.hs │ │ │ └── GState.hs │ │ ├── Launcher.hs │ │ ├── Launcher │ │ │ ├── Configuration.hs │ │ │ ├── Launcher.hs │ │ │ ├── Mode.hs │ │ │ ├── Param.hs │ │ │ ├── Resource.hs │ │ │ ├── Runner.hs │ │ │ └── Scenario.hs │ │ ├── Listener │ │ │ ├── Delegation.hs │ │ │ ├── Txp.hs │ │ │ └── Update.hs │ │ ├── Logic │ │ │ ├── Full.hs │ │ │ ├── Pure.hs │ │ │ └── Types.hs │ │ ├── Network │ │ │ ├── Block │ │ │ │ ├── Logic.hs │ │ │ │ ├── Retrieval.hs │ │ │ │ ├── RetrievalQueue.hs │ │ │ │ ├── Types.hs │ │ │ │ └── WorkMode.hs │ │ │ └── Update │ │ │ │ └── Download.hs │ │ ├── Node │ │ │ └── API.hs │ │ ├── Recovery.hs │ │ ├── Recovery │ │ │ └── Types.hs │ │ ├── Reporting │ │ │ └── Production.hs │ │ ├── Util │ │ │ ├── Config.hs │ │ │ ├── Example.hs │ │ │ ├── Jsend.hs │ │ │ ├── KnownSymbols.hs │ │ │ ├── OutboundQueue.hs │ │ │ ├── Pagination.hs │ │ │ ├── Servant.hs │ │ │ ├── Swagger.hs │ │ │ ├── UnitsOfMeasure.hs │ │ │ ├── UserKeyError.hs │ │ │ └── UserSecret.hs │ │ ├── Web.hs │ │ ├── Web │ │ │ ├── Api.hs │ │ │ ├── Mode.hs │ │ │ ├── Server.hs │ │ │ └── Types.hs │ │ ├── WorkMode.hs │ │ ├── WorkMode │ │ │ └── Class.hs │ │ ├── Worker.hs │ │ └── Worker │ │ │ ├── Block.hs │ │ │ ├── Delegation.hs │ │ │ ├── Ssc.hs │ │ │ └── Update.hs │ └── Test │ │ └── Pos │ │ ├── Configuration.hs │ │ └── Helpers.hs ├── test │ ├── Spec.hs │ ├── Test.hs │ ├── Test │ │ └── Pos │ │ │ ├── Block │ │ │ ├── Arbitrary │ │ │ │ └── Message.hs │ │ │ └── CborSpec.hs │ │ │ ├── Cbor │ │ │ ├── Arbitrary │ │ │ │ └── UserSecret.hs │ │ │ └── CborSpec.hs │ │ │ ├── ConstantsSpec.hs │ │ │ ├── Diffusion │ │ │ └── BlockSpec.hs │ │ │ ├── Genesis │ │ │ └── CanonicalSpec.hs │ │ │ ├── Infra │ │ │ └── Slotting │ │ │ │ └── TypesSpec.hs │ │ │ ├── Launcher │ │ │ ├── Configuration.hs │ │ │ ├── ConfigurationSpec.hs │ │ │ ├── Gen.hs │ │ │ └── Json.hs │ │ │ ├── MerkleSpec.hs │ │ │ ├── Slotting │ │ │ └── TypesSpec.hs │ │ │ ├── Ssc │ │ │ ├── ComputeSharesSpec.hs │ │ │ ├── Identity │ │ │ │ └── SafeCopySpec.hs │ │ │ ├── SeedSpec.hs │ │ │ ├── Toss │ │ │ │ ├── BaseSpec.hs │ │ │ │ └── PureSpec.hs │ │ │ └── VssCertDataSpec.hs │ │ │ ├── Types │ │ │ └── Identity │ │ │ │ ├── SafeCopySpec.hs │ │ │ │ └── ShowReadSpec.hs │ │ │ └── Update │ │ │ ├── Identity │ │ │ └── SafeCopySpec.hs │ │ │ ├── MemStateSpec.hs │ │ │ └── PollSpec.hs │ └── golden │ │ └── json │ │ └── Configuration_Legacy_NoNetworkMagicField └── testnet-genesis.json ├── log-configs ├── cluster.yaml ├── connect-to-cluster.yaml ├── daedalus.yaml ├── greppable.yaml └── template-demo.yaml ├── mnemonic ├── LICENSE ├── NOTICE ├── README.md ├── cardano-sl-mnemonic.cabal ├── generate-mnemonic │ └── Main.hs ├── src │ └── Cardano │ │ └── Mnemonic.hs └── test │ ├── Cardano │ └── MnemonicSpec.hs │ └── Main.hs ├── networking ├── LICENSE ├── NOTICE ├── QUEUE_METRICS.md ├── README.md ├── bench │ ├── LogReader │ │ ├── LogReaderOptions.hs │ │ └── Main.hs │ ├── Receiver │ │ ├── Main.hs │ │ └── ReceiverOptions.hs │ ├── Sender │ │ ├── Main.hs │ │ └── SenderOptions.hs │ ├── calc-template.ods │ ├── launch.sh │ └── logging.yaml ├── cardano-sl-networking.cabal ├── examples │ └── PingPong.hs ├── src │ ├── Bench │ │ └── Network │ │ │ └── Commons.hs │ ├── Data │ │ └── NonEmptySet.hs │ ├── Network │ │ ├── Broadcast │ │ │ ├── OutboundQueue.hs │ │ │ └── OutboundQueue │ │ │ │ ├── ConcurrentMultiQueue.hs │ │ │ │ ├── Demo.hs │ │ │ │ └── Types.hs │ │ └── QDisc │ │ │ ├── Fair.hs │ │ │ └── Simulation.hs │ ├── Node.hs │ ├── Node │ │ ├── Conversation.hs │ │ ├── Internal.hs │ │ ├── Message │ │ │ ├── Binary.hs │ │ │ ├── Class.hs │ │ │ └── Decoder.hs │ │ └── Util │ │ │ └── Monitor.hs │ └── Ntp │ │ ├── Client.hs │ │ ├── Packet.hs │ │ └── Util.hs └── test │ ├── Spec.hs │ ├── Test.hs │ └── Test │ ├── Network │ └── Broadcast │ │ └── OutboundQueueSpec.hs │ ├── NodeSpec.hs │ ├── NtpSpec.hs │ └── Util.hs ├── nix ├── .stack.nix │ ├── acid-state-exts.nix │ ├── acid-state.nix │ ├── canonical-json.nix │ ├── cardano-crypto.nix │ ├── cardano-report-server.nix │ ├── cardano-sl-auxx.nix │ ├── cardano-sl-binary-test.nix │ ├── cardano-sl-binary.nix │ ├── cardano-sl-chain-test.nix │ ├── cardano-sl-chain.nix │ ├── cardano-sl-client.nix │ ├── cardano-sl-cluster.nix │ ├── cardano-sl-core-test.nix │ ├── cardano-sl-core.nix │ ├── cardano-sl-crypto-test.nix │ ├── cardano-sl-crypto.nix │ ├── cardano-sl-db-test.nix │ ├── cardano-sl-db.nix │ ├── cardano-sl-explorer.nix │ ├── cardano-sl-faucet.nix │ ├── cardano-sl-generator.nix │ ├── cardano-sl-infra-test.nix │ ├── cardano-sl-infra.nix │ ├── cardano-sl-mnemonic.nix │ ├── cardano-sl-networking.nix │ ├── cardano-sl-node-ipc.nix │ ├── cardano-sl-node.nix │ ├── cardano-sl-script-runner.nix │ ├── cardano-sl-tools-post-mortem.nix │ ├── cardano-sl-tools.nix │ ├── cardano-sl-util-test.nix │ ├── cardano-sl-util.nix │ ├── cardano-sl-utxo.nix │ ├── cardano-sl-x509.nix │ ├── cardano-sl.nix │ ├── cardano-wallet.nix │ ├── clock.nix │ ├── default.nix │ ├── engine-io-wai.nix │ ├── engine-io.nix │ ├── hedgehog.nix │ ├── inspector.nix │ ├── ip.nix │ ├── kademlia.nix │ ├── log-warper.nix │ ├── network-transport-tcp.nix │ ├── network-transport.nix │ ├── rocksdb-haskell-ng.nix │ ├── serokell-util.nix │ ├── socket-io.nix │ ├── time-units.nix │ ├── universum.nix │ └── yaml-validation.nix ├── acceptance │ └── default.nix ├── cardano-sl-config.nix ├── commit-id.nix ├── config.nix ├── daedalus-bridge.nix ├── docker.nix ├── iohk-binary-cache.nix ├── iohk-common.nix ├── iohk-nix-src.json ├── launch │ ├── connect-to-cluster │ │ └── default.nix │ ├── demo-cluster │ │ ├── default.nix │ │ └── make-topology.nix │ └── proposal-ui │ │ └── default.nix ├── nix-tools.nix ├── patches │ ├── cardano-sl.patch │ └── libiserv-network-3.patch ├── pkgs.nix ├── regenerate.sh ├── scripts.nix ├── sources.json ├── sources.nix ├── tests.nix ├── tests │ ├── swaggerSchemaValidation.nix │ └── yamlValidation.nix └── update-iohk-nix.sh ├── nixos-tests ├── default.nix └── wallet-api.nix ├── node-ipc ├── LICENSE ├── NOTICE ├── Setup.hs ├── cardano-sl-node-ipc.cabal ├── server.js ├── shell.nix ├── src │ └── Cardano │ │ └── NodeIPC.hs └── wallet-topology.yaml ├── node ├── LICENSE ├── Makefile ├── NOTICE ├── README.md ├── app │ └── Main.hs ├── cardano-sl-node.cabal ├── src │ └── Cardano │ │ └── Node │ │ ├── API.hs │ │ ├── API │ │ └── Swagger.hs │ │ ├── Client.hs │ │ ├── Manager.hs │ │ └── NodeStateAdaptor.hs └── test │ ├── Chain │ ├── Abstract.hs │ ├── Abstract │ │ ├── FinitelySupportedFunction.hs │ │ ├── Repartition.hs │ │ └── Translate │ │ │ ├── FromUTxO.hs │ │ │ ├── Policies.hs │ │ │ └── ToCardano.hs │ └── Policy.hs │ ├── ChainExtension.hs │ ├── Infrastructure │ └── Generator.hs │ ├── Spec.hs │ └── Translation.hs ├── pkgs ├── cryptonite-segfault-blake.patch ├── default.nix ├── generate.sh ├── hfsevents.nix └── regen.nix ├── release.nix ├── sample-wallet-config.nix ├── script-runner ├── BlockParser.hs ├── LICENSE ├── NOTICE ├── README.md ├── Setup.hs ├── TestCases.hs ├── cardano-sl-script-runner.cabal ├── common │ ├── AutomatedTestRunner.hs │ ├── BrickUI.hs │ ├── BrickUITypes.hs │ ├── NodeControl.hs │ ├── OrphanedLenses.hs │ ├── PocMode.hs │ └── Types.hs ├── log-config.yaml ├── runtest.nix ├── shell.nix ├── stack-gui ├── stack-test ├── topology-local.yaml ├── topology-mainnet.yaml ├── topology-staging.yaml ├── topology-testnet.yaml └── topology.yaml ├── scripts ├── README.md ├── analyze │ ├── block-events.sh │ └── logs.hs ├── avvm-files │ ├── avvm-utxo.json │ └── utxo-dump-last-new.json ├── bench │ ├── buildbench.sh │ ├── count_tps_sent.sh │ ├── count_tps_written.sh │ ├── runbench.sh │ └── topology │ │ ├── kademlia4.yaml │ │ ├── kademlia5.yaml │ │ ├── topology.yaml │ │ ├── topology0.yaml │ │ ├── topology1.yaml │ │ ├── topology2.yaml │ │ ├── topology3.yaml │ │ ├── topology4.yaml │ │ └── topology5.yaml ├── build │ └── cardano-sl.sh ├── check-stack2nix.sh ├── check_deps.sh ├── ci │ ├── appveyor-retry.cmd │ ├── check-hydra.sh │ ├── update-cli-docs.sh │ ├── update-explorer-web-api-docs.sh │ ├── update-haddock.sh │ └── update-wallet-web-api-docs.sh ├── clean │ ├── all.sh │ ├── db.sh │ └── explorer-bridge.sh ├── common-functions.sh ├── generate │ └── certificates.sh ├── grep.sh ├── hash-installer.sh ├── haskell │ ├── dependencies.hs │ ├── git-pre-commit-hook │ ├── lint.sh │ ├── recover-from-stack-clean.sh │ ├── stylish.sh │ └── update-cabal-versions.sh ├── js │ ├── avvm-utxo-to-yaml.js │ ├── genesis-hash.js │ └── package.json ├── launch │ ├── Test.hs │ ├── auxx.sh │ ├── connect-to-cluster │ │ ├── README.md │ │ └── mainnet-staging.sh │ ├── daedalus-example.sh │ ├── demo-nix.sh │ ├── explorer-with-nodes.sh │ ├── explorer.sh │ ├── ui-simulator.sh │ └── us-test.sh ├── package-dep-graph.sh ├── policies │ ├── policy_core.yaml │ ├── policy_edge_exchange.yaml │ ├── policy_edge_nat.yaml │ ├── policy_edge_p2p.yaml │ ├── policy_relay.yaml │ └── policy_script-runner.yaml ├── prepare-genesis │ ├── README.md │ ├── build-cardano.sh │ ├── default.nix │ ├── gen-avvm-seeds.sh │ ├── gen-delegate-keys.sh │ ├── genesis-prep-test.sh │ └── keys-and-certs.sh ├── set-git-rev │ ├── default.nix │ └── set-git-rev.hs ├── set_nixpath.sh ├── test │ ├── hlint.nix │ ├── shellcheck.nix │ ├── stylish.nix │ └── wallet │ │ ├── many-addrs-test.sh │ │ ├── many-tx-test.sh │ │ └── swaggerSchemaValidation.nix ├── tls-files │ ├── ca.crt │ ├── ca.pem │ ├── client.crt │ ├── client.pem │ ├── server.crt │ ├── server.key │ └── server.pem └── workflow │ └── merge_master.sh ├── secrets └── mainnet-staging-short-epoch │ ├── generated-keys │ ├── dlg-issuers │ │ ├── key0.sk │ │ ├── key1.sk │ │ └── key2.sk │ └── rich │ │ ├── key0.sk │ │ ├── key1.sk │ │ └── key2.sk │ └── keys-fakeavvm │ ├── fake-0.seed │ ├── fake-1.seed │ ├── fake-2.seed │ ├── fake-3.seed │ └── fake-4.seed ├── shell.nix ├── stack.yaml ├── tools ├── LICENSE ├── NOTICE ├── README.md ├── Setup.hs ├── cardano-sl-tools.cabal ├── post-mortem │ ├── LICENSE │ ├── NOTICE │ ├── README.md │ ├── cardano-sl-tools-post-mortem.cabal │ └── src │ │ ├── JSONLog.hs │ │ ├── Main.hs │ │ ├── Options.hs │ │ ├── Statistics.hs │ │ ├── Statistics │ │ ├── Block.hs │ │ ├── CSV.hs │ │ ├── Chart.hs │ │ ├── Focus.hs │ │ ├── Graph.hs │ │ ├── MemPool.hs │ │ ├── Report.hs │ │ ├── Throughput.hs │ │ └── Tx.hs │ │ ├── Types.hs │ │ └── Util │ │ ├── Aeson.hs │ │ ├── Pipes.hs │ │ └── Safe.hs ├── src │ ├── Pos │ │ └── Tools │ │ │ └── Launcher │ │ │ ├── Environment.hs │ │ │ └── Logging.hs │ ├── addr-convert │ │ └── Main.hs │ ├── blockchain-analyser │ │ ├── Main.hs │ │ ├── Options.hs │ │ ├── Rendering.hs │ │ └── Types.hs │ ├── cli-docs │ │ └── Main.hs │ ├── gencerts │ │ ├── Main.hs │ │ ├── README.md │ │ └── configuration.yaml.example │ ├── genesis-hash │ │ └── Main.hs │ ├── genupdate │ │ └── Main.hs │ ├── keygen │ │ ├── Dump.hs │ │ ├── KeygenOptions.hs │ │ └── Main.hs │ ├── launcher │ │ ├── Main.hs │ │ └── launcher-config.yaml │ ├── topology-gen │ │ └── Main.hs │ ├── validate-json │ │ ├── README.md │ │ ├── __init__.py │ │ ├── default.nix │ │ ├── setup.py │ │ ├── swagger-meta-2.0.json │ │ └── validate_json.py │ └── wallet-extractor │ │ └── Main.hs └── test │ ├── Spec.hs │ ├── Test.hs │ ├── Test │ └── Pos │ │ └── Tools │ │ └── Launcher │ │ └── Environment.hs │ └── golden │ ├── AccountSpec │ ├── AddressRange │ ├── DistributionAmount │ ├── FakeTxsHistory │ ├── FakeUtxoCoinDistribution │ ├── GenSpec │ └── WalletSpec ├── util ├── LICENSE ├── NOTICE ├── README.md ├── Setup.hs ├── cardano-sl-util.cabal ├── default.nix ├── src │ └── Pos │ │ ├── Util.hs │ │ └── Util │ │ ├── AssertMode.hs │ │ ├── CompileInfo.hs │ │ ├── CompileInfoGit.hs │ │ ├── Concurrent.hs │ │ ├── Concurrent │ │ ├── PriorityLock.hs │ │ └── RWLock.hs │ │ ├── Filesystem.hs │ │ ├── Future.hs │ │ ├── Json │ │ ├── Canonical.hs │ │ └── Parse.hs │ │ ├── Justify.hs │ │ ├── LRU.hs │ │ ├── Lens.hs │ │ ├── Log.hs │ │ ├── Log │ │ ├── Internal.hs │ │ ├── LogSafe.hs │ │ ├── LoggerConfig.hs │ │ ├── LoggerName.hs │ │ ├── Rotator.hs │ │ ├── Scribes.hs │ │ ├── Severity.hs │ │ └── Structured.hs │ │ ├── LoggerName.hs │ │ ├── Modifier.hs │ │ ├── OptParse.hs │ │ ├── Orphans.hs │ │ ├── Queue.hs │ │ ├── Some.hs │ │ ├── Timer.hs │ │ ├── Trace.hs │ │ ├── Trace │ │ ├── Named.hs │ │ └── Unstructured.hs │ │ ├── Util.hs │ │ ├── Wlog.hs │ │ └── Wlog │ │ └── Compatibility.hs └── test │ ├── LICENSE │ ├── NOTICE │ ├── Setup.hs │ ├── Spec.hs │ ├── Test │ ├── Pos.hs │ └── Pos │ │ └── Util │ │ ├── Base16.hs │ │ ├── Gen.hs │ │ ├── Golden.hs │ │ ├── LogSpec.hs │ │ ├── LogStructuredSpec.hs │ │ ├── Modifier.hs │ │ ├── ModifierSpec.hs │ │ ├── Orphans.hs │ │ ├── Parallel │ │ └── Parallelize.hs │ │ ├── QuickCheck.hs │ │ ├── QuickCheck │ │ ├── Arbitrary.hs │ │ └── Property.hs │ │ ├── TimerSpec.hs │ │ ├── TraceSpec.hs │ │ ├── Tripping.hs │ │ └── WlogSpec.hs │ ├── cardano-sl-util-test.cabal │ └── test.hs ├── utxo ├── ChangeLog.md ├── LICENSE ├── NOTICE ├── Setup.hs ├── cardano-sl-utxo.cabal └── src │ ├── Data │ └── Validated.hs │ └── UTxO │ ├── Bootstrap.hs │ ├── Context.hs │ ├── Crypto.hs │ ├── DSL.hs │ ├── Generator.hs │ ├── IntTrans.hs │ ├── Translate.hs │ ├── Util.hs │ └── Verify.hs ├── wallet ├── .editorconfig ├── .github │ ├── ISSUE_TEMPLATE │ │ ├── adr.md │ │ └── bug_report.md │ ├── PULL_REQUEST_TEMPLATE.md │ ├── images │ │ └── cardano-logo.png │ └── iohk-signature.gif ├── .gitignore ├── .hlint.yaml ├── .stylish-haskell.yaml ├── .travis.yml ├── LICENSE ├── Makefile ├── NOTICE ├── README.md ├── Setup.hs ├── cardano-sl.yaml ├── cardano-wallet.cabal ├── generate-swagger-file │ ├── Main.hs │ └── README.md ├── integration.tix ├── server │ └── Main.hs ├── shell.nix ├── src │ └── Cardano │ │ └── Wallet │ │ ├── API.hs │ │ ├── API │ │ ├── Indices.hs │ │ ├── Internal.hs │ │ ├── Internal │ │ │ └── Handlers.hs │ │ ├── Request.hs │ │ ├── Request │ │ │ ├── Filter.hs │ │ │ ├── Pagination.hs │ │ │ ├── Parameters.hs │ │ │ └── Sort.hs │ │ ├── Response.hs │ │ ├── Response │ │ │ ├── Filter │ │ │ │ └── IxSet.hs │ │ │ ├── JSend.hs │ │ │ └── Sort │ │ │ │ └── IxSet.hs │ │ ├── Types.hs │ │ ├── Types │ │ │ └── UnitOfMeasure.hs │ │ ├── V1.hs │ │ └── V1 │ │ │ ├── Accounts.hs │ │ │ ├── Addresses.hs │ │ │ ├── Errors.hs │ │ │ ├── Generic.hs │ │ │ ├── Handlers.hs │ │ │ ├── Handlers │ │ │ ├── Accounts.hs │ │ │ ├── Addresses.hs │ │ │ ├── Info.hs │ │ │ ├── Settings.hs │ │ │ ├── Transactions.hs │ │ │ └── Wallets.hs │ │ │ ├── Headers.hs │ │ │ ├── Info.hs │ │ │ ├── Internal │ │ │ └── Update.hs │ │ │ ├── LegacyHandlers │ │ │ └── Settings.hs │ │ │ ├── Parameters.hs │ │ │ ├── ReifyWalletError.hs │ │ │ ├── Settings.hs │ │ │ ├── Swagger.hs │ │ │ ├── Swagger │ │ │ └── Example.hs │ │ │ ├── Transactions.hs │ │ │ ├── Types.hs │ │ │ └── Wallets.hs │ │ ├── Action.hs │ │ ├── Client.hs │ │ ├── Client │ │ └── Http.hs │ │ ├── Kernel.hs │ │ ├── Kernel │ │ ├── Accounts.hs │ │ ├── Actions.hs │ │ ├── Addresses.hs │ │ ├── BListener.hs │ │ ├── CoinSelection.hs │ │ ├── CoinSelection │ │ │ ├── FromGeneric.hs │ │ │ ├── Generic.hs │ │ │ └── Generic │ │ │ │ ├── Fees.hs │ │ │ │ ├── Grouped.hs │ │ │ │ ├── LargestFirst.hs │ │ │ │ └── Random.hs │ │ ├── DB │ │ │ ├── AcidState.hs │ │ │ ├── BlockContext.hs │ │ │ ├── BlockMeta.hs │ │ │ ├── Compression.hs │ │ │ ├── HdWallet.hs │ │ │ ├── HdWallet │ │ │ │ ├── Create.hs │ │ │ │ ├── Delete.hs │ │ │ │ ├── Derivation.hs │ │ │ │ ├── Read.hs │ │ │ │ └── Update.hs │ │ │ ├── InDb.hs │ │ │ ├── Read.hs │ │ │ ├── Resolved.hs │ │ │ ├── Spec.hs │ │ │ ├── Spec │ │ │ │ ├── Pending.hs │ │ │ │ ├── Read.hs │ │ │ │ └── Update.hs │ │ │ ├── Sqlite.hs │ │ │ ├── TxMeta.hs │ │ │ ├── TxMeta │ │ │ │ └── Types.hs │ │ │ ├── Updates.hs │ │ │ └── Util │ │ │ │ ├── AcidState.hs │ │ │ │ ├── IxSet.hs │ │ │ │ └── Zoomable.hs │ │ ├── Decrypt.hs │ │ ├── Diffusion.hs │ │ ├── Internal.hs │ │ ├── Invariants.hs │ │ ├── Keystore.hs │ │ ├── Migration.hs │ │ ├── Mode.hs │ │ ├── NodeStateAdaptor.hs │ │ ├── Pending.hs │ │ ├── PrefilterTx.hs │ │ ├── Read.hs │ │ ├── Restore.hs │ │ ├── Submission.hs │ │ ├── Submission │ │ │ └── Worker.hs │ │ ├── Transactions.hs │ │ ├── Types.hs │ │ ├── Util │ │ │ ├── Core.hs │ │ │ ├── NonEmptyMap.hs │ │ │ ├── Strict.hs │ │ │ ├── StrictList.hs │ │ │ ├── StrictNonEmpty.hs │ │ │ └── StrictStateT.hs │ │ └── Wallets.hs │ │ ├── Server.hs │ │ ├── Server │ │ ├── CLI.hs │ │ ├── Middlewares.hs │ │ ├── Plugins.hs │ │ └── Plugins │ │ │ └── AcidState.hs │ │ ├── TypeLits.hs │ │ ├── Types │ │ └── UtxoStatistics.hs │ │ ├── Util.hs │ │ ├── WalletLayer.hs │ │ └── WalletLayer │ │ ├── ExecutionTimeLimit.hs │ │ ├── Kernel.hs │ │ ├── Kernel │ │ ├── Accounts.hs │ │ ├── Active.hs │ │ ├── Addresses.hs │ │ ├── Conv.hs │ │ ├── Info.hs │ │ ├── Internal.hs │ │ ├── Settings.hs │ │ ├── Transactions.hs │ │ └── Wallets.hs │ │ └── README.md ├── stack.yaml ├── test │ ├── integration │ │ ├── .gitkeep │ │ ├── Main.hs │ │ ├── README.md │ │ ├── Test │ │ │ └── Integration │ │ │ │ ├── Documentation.hs │ │ │ │ ├── Framework │ │ │ │ ├── Cluster.hs │ │ │ │ ├── DSL.hs │ │ │ │ ├── Request.hs │ │ │ │ └── Scenario.hs │ │ │ │ └── Scenario │ │ │ │ ├── Accounts.hs │ │ │ │ ├── Addresses.hs │ │ │ │ ├── Node.hs │ │ │ │ ├── Transactions.hs │ │ │ │ └── Wallets.hs │ │ └── configuration.yaml │ ├── manual │ │ └── .gitkeep │ ├── nightly │ │ ├── Main.hs │ │ └── TxMetaStorage.hs │ └── unit │ │ ├── API │ │ ├── MarshallingSpec.hs │ │ ├── RequestSpec.hs │ │ └── SwaggerSpec.hs │ │ ├── Arbitrary.hs │ │ ├── Golden │ │ ├── APILayout.hs │ │ ├── WalletError.hs │ │ └── golden │ │ │ ├── JSONValidationError_JSONValidationFailed │ │ │ ├── MigrationError_MigrationFailed │ │ │ ├── UnsupportedMimeTypeError_UnsupportedMimeTypePresent │ │ │ ├── WalletError_AddressNotFound │ │ │ ├── WalletError_CannotCreateAddress │ │ │ ├── WalletError_InvalidAddressFormat │ │ │ ├── WalletError_InvalidPublicKey │ │ │ ├── WalletError_MissingRequiredParams │ │ │ ├── WalletError_NodeIsStillSyncing │ │ │ ├── WalletError_NotEnoughMoneyAvailableBalanceIsInsufficient │ │ │ ├── WalletError_NotEnoughMoneyCannotCoverFee │ │ │ ├── WalletError_OutputIsRedeem │ │ │ ├── WalletError_SignedTxSubmitError │ │ │ ├── WalletError_TooBigTransaction │ │ │ ├── WalletError_TxFailedToStabilize │ │ │ ├── WalletError_TxRedemptionDepleted │ │ │ ├── WalletError_TxSafeSignerNotFound │ │ │ ├── WalletError_UnknownError │ │ │ ├── WalletError_UnsignedTxCreationError │ │ │ ├── WalletError_WalletAlreadyExists │ │ │ ├── WalletError_WalletIsNotReadyToProcessPayments │ │ │ ├── WalletError_WalletNotFound │ │ │ └── api-layout.txt │ │ ├── InputSelection │ │ ├── Evaluation.hs │ │ ├── Evaluation │ │ │ ├── Events.hs │ │ │ ├── Generic.hs │ │ │ ├── Options.hs │ │ │ ├── Replot.hs │ │ │ └── TimeSeries.hs │ │ ├── FromGeneric.hs │ │ ├── SortedUtxo.hs │ │ └── TxStats.hs │ │ ├── Main.hs │ │ ├── Test │ │ ├── Infrastructure │ │ │ ├── Generator.hs │ │ │ └── Genesis.hs │ │ └── Spec │ │ │ ├── Accounts.hs │ │ │ ├── AddressPool.hs │ │ │ ├── AddressPoolGap.hs │ │ │ ├── Addresses.hs │ │ │ ├── BlockMetaScenarios.hs │ │ │ ├── CoinSelection.hs │ │ │ ├── CoinSelection │ │ │ └── Generators.hs │ │ │ ├── DeltaCompression.hs │ │ │ ├── Fixture.hs │ │ │ ├── GetTransactions.hs │ │ │ ├── Kernel.hs │ │ │ ├── Keystore.hs │ │ │ ├── Models.hs │ │ │ ├── NewPayment.hs │ │ │ ├── Submission.hs │ │ │ ├── Translation.hs │ │ │ ├── TxMetaScenarios.hs │ │ │ ├── TxMetaStorage.hs │ │ │ ├── WalletWorker.hs │ │ │ └── Wallets.hs │ │ ├── UTxO │ │ └── ToCardano │ │ │ └── Interpreter.hs │ │ ├── Util │ │ ├── Buildable.hs │ │ ├── Buildable │ │ │ ├── Hspec.hs │ │ │ └── QuickCheck.hs │ │ ├── Distr.hs │ │ ├── GenHash.hs │ │ ├── Histogram.hs │ │ ├── MultiSet.hs │ │ ├── QuickCheck.hs │ │ └── Range.hs │ │ └── Wallet │ │ ├── Abstract.hs │ │ ├── Basic.hs │ │ ├── Incremental.hs │ │ ├── Inductive.hs │ │ ├── Inductive │ │ ├── Cardano.hs │ │ ├── ExtWalletEvent.hs │ │ ├── Generator.hs │ │ ├── History.hs │ │ ├── Interpreter.hs │ │ ├── Invariants.hs │ │ └── Validation.hs │ │ ├── Prefiltered.hs │ │ └── Rollback │ │ ├── Basic.hs │ │ └── Full.hs └── topology-examples │ └── testnet.yaml ├── x509 ├── LICENSE ├── NOTICE ├── README.md ├── cardano-sl-x509.cabal ├── configuration.yaml.example ├── src │ ├── Cardano │ │ └── X509 │ │ │ └── Configuration.hs │ └── Data │ │ └── X509 │ │ └── Extra.hs └── test │ ├── Main.hs │ └── Test │ └── Cardano │ └── X509 │ ├── Configuration.hs │ └── Configuration │ └── Arbitrary.hs └── yaml-validation ├── Main.hs └── yaml-validation.cabal /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | end_of_line = lf 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | 11 | [Makefile] 12 | indent_style = tab 13 | indent_size = 8 14 | 15 | [*.hs] 16 | indent_size = 4 17 | max_line_length = 80 18 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # GitHub Linguist annotations. 2 | # Hide nix/.stack.nix/*.nix 3 | # That is stuff that is generated by nix-tools stack-to-nix 4 | 5 | nix/.stack.nix/*.nix linguist-generated=true 6 | .stack-to-nix.cache linguist-generated=true 7 | nix/.stack-pkgs.nix linguist-generated=true 8 | -------------------------------------------------------------------------------- /.hindent.yaml: -------------------------------------------------------------------------------- 1 | indent-size: 4 2 | line-length: 80 3 | force-trailing-newline: true 4 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | Copyright 2019 Input Output (Hong Kong) Ltd. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /acid-state-exts/README.md: -------------------------------------------------------------------------------- 1 | # `acid-state-exts` 2 | 3 | Some extensions to `acid-state` initially written by Serokell. 4 | They have been factored out into this package for use in `cardano-sl`. 5 | -------------------------------------------------------------------------------- /acid-state-exts/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | version: 1.0.{build} 2 | image: Visual Studio 2015 3 | 4 | build: off 5 | 6 | test_script: 7 | - ps: echo "No Longer Used, windows binaries cross compiled in hydra" 8 | -------------------------------------------------------------------------------- /auxx/Makefile: -------------------------------------------------------------------------------- 1 | help: ## Print documentation 2 | @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' 3 | 4 | ghcid: ## Run ghcid with the cardano-sl-auxx package 5 | ghcid \ 6 | --command "stack ghci cardano-sl-auxx --ghci-options=-fno-code" 7 | 8 | ghcid-test: ## Have ghcid run the test suite on successful recompile 9 | ghcid \ 10 | --command "stack ghci cardano-sl-auxx:lib cardano-sl-auxx:test:cardano-auxx-test --ghci-options=-fobject-code" \ 11 | --test "Main.main" 12 | 13 | .PHONY: ghcid ghcid-test help 14 | -------------------------------------------------------------------------------- /auxx/NOTICE: -------------------------------------------------------------------------------- 1 | Copyright 2019 Input Output (Hong Kong) Ltd. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /auxx/README.md: -------------------------------------------------------------------------------- 1 | # cardano-sl-auxx 2 | 3 | This package implements a tool and language for connecting to Cardano SL node 4 | running locally and performing operations like inspecting the node's state and 5 | sending commands to the node. 6 | 7 | It is documented more fully in the file [docs/auxx.md] of the git repository. 8 | -------------------------------------------------------------------------------- /auxx/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /auxx/src/Command.hs: -------------------------------------------------------------------------------- 1 | -- | Command. 2 | 3 | module Command 4 | ( module Command.BlockGen 5 | , module Command.Help 6 | , module Command.Proc 7 | , module Command.Rollback 8 | , module Command.Tx 9 | , module Command.TyProjection 10 | , module Command.Update 11 | ) where 12 | 13 | import Command.BlockGen 14 | import Command.Help 15 | import Command.Proc 16 | import Command.Rollback 17 | import Command.Tx 18 | import Command.TyProjection 19 | import Command.Update 20 | -------------------------------------------------------------------------------- /auxx/test/Spec.hs: -------------------------------------------------------------------------------- 1 | {-# OPTIONS_GHC -F -pgmF hspec-discover -optF --module-name=Spec #-} 2 | -------------------------------------------------------------------------------- /auxx/test/Test.hs: -------------------------------------------------------------------------------- 1 | import Universum 2 | 3 | import Test.Hspec (hspec) 4 | 5 | import Spec (spec) 6 | 7 | main :: IO () 8 | main = hspec spec 9 | -------------------------------------------------------------------------------- /auxx/test/Test/Auxx/Lang/ParserSpec.hs: -------------------------------------------------------------------------------- 1 | module Test.Auxx.Lang.ParserSpec 2 | ( spec 3 | ) where 4 | 5 | import Universum 6 | 7 | import Test.Hspec (Expectation, Spec, describe, it, shouldSatisfy) 8 | 9 | import Lang.Parser (parse) 10 | 11 | spec :: Spec 12 | spec = describe "Auxx.Lang.Parser" $ do 13 | it "handles sample-1" unitParserSample1 14 | 15 | unitParserSample1 :: Expectation 16 | unitParserSample1 = parse input `shouldSatisfy` isRight 17 | where 18 | input = "wait (epoch 6);; propose-patak kek:15 \"lel\" mem:(epoch 7) zaz:(get (rekt mem: to-next ses: \"zaz\" ))" 19 | -------------------------------------------------------------------------------- /binary/NOTICE: -------------------------------------------------------------------------------- 1 | Copyright 2019 Input Output (Hong Kong) Ltd. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /binary/README.md: -------------------------------------------------------------------------------- 1 | # cardano-sl-binary 2 | 3 | Binary serialisation and deserialisation for Cardano SL. 4 | 5 | This library is built on top of the [binary] and [cborg] packages and implement 6 | space efficient serialising and deserialising of Haskell data types to and from 7 | binary representations via a `Bi` type class and associated machinery. 8 | 9 | The library includes ability the derive `Bi` instances (requires a `Typeable` 10 | constraint). 11 | 12 | [binary]: https://hackage.haskell.org/package/binary 13 | [cborg]: https://hackage.haskell.org/package/cborg 14 | -------------------------------------------------------------------------------- /binary/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /binary/src/Pos/Binary/Class.hs: -------------------------------------------------------------------------------- 1 | {-# OPTIONS_GHC -Wno-unused-imports #-} 2 | {-# OPTIONS_GHC -Wno-dodgy-exports #-} 3 | 4 | module Pos.Binary.Class 5 | ( module Pos.Binary.Class.Core 6 | , module Pos.Binary.Class.Primitive 7 | , module Pos.Binary.Class.TH 8 | ) where 9 | 10 | import Pos.Binary.Class.Core 11 | import Pos.Binary.Class.Primitive 12 | import Pos.Binary.Class.TH 13 | -------------------------------------------------------------------------------- /binary/test/Spec.hs: -------------------------------------------------------------------------------- 1 | {-# OPTIONS_GHC -F -pgmF hspec-discover -optF --module-name=Spec #-} 2 | -------------------------------------------------------------------------------- /binary/test/golden/TestSimpleIndexed1: -------------------------------------------------------------------------------- 1 | 00: 83068306830264f0a5b2b264f181a48b 2 | 10: 8204811b2b2a532ff2876ba1830264f2 3 | 20: 97bc8c64f2aa83ba 4 | -------------------------------------------------------------------------------- /binary/test/golden/TestSimpleIndexed2: -------------------------------------------------------------------------------- 1 | 00: 83068306830264f387a09064f489bba0 2 | 10: 8306830264f0b88fb164f4848f888201 3 | 20: 9f1b07311d2d7939272f1b2b0c8c405c 4 | 30: 0e8e3c1b2a07099ad0952d273b18df61 5 | 40: bcb490a7dc3b38236a76175bb823ff83 6 | 50: 0564f099a59a64f1a891b0 7 | -------------------------------------------------------------------------------- /binary/test/golden/TestSimpleIndexed3: -------------------------------------------------------------------------------- 1 | 00: 83068203c34a6d1914fff090beabc44b 2 | 10: 82001b000f0ede417a505f 3 | -------------------------------------------------------------------------------- /binary/test/golden/TestSimpleIndexed4: -------------------------------------------------------------------------------- 1 | 00: 8306830264f09cbcb464f486baa98306 2 | 10: 8204811b1d436b0eb5e90fb583068203 3 | 20: c34a9be0913b92f5a2edd8a283068200 4 | 30: 1b53245398189d8af982003b69041e5e 5 | 40: d4785f55 6 | -------------------------------------------------------------------------------- /binary/test/test.hs: -------------------------------------------------------------------------------- 1 | import Universum 2 | 3 | import Test.Hspec (hspec) 4 | 5 | import Spec (spec) 6 | 7 | import qualified Test.Pos.Binary.BiSerialize 8 | import qualified Test.Pos.Binary.BiSizeBounds 9 | import Test.Pos.Util.Tripping (runTests) 10 | 11 | main :: IO () 12 | main = do 13 | hspec spec 14 | runTests 15 | [ Test.Pos.Binary.BiSerialize.tests 16 | , Test.Pos.Binary.BiSizeBounds.tests 17 | ] 18 | -------------------------------------------------------------------------------- /bors.toml: -------------------------------------------------------------------------------- 1 | status = [ 2 | # Hydra: Aggregate job from release.nix 3 | "ci/hydra:Cardano:cardano-sl:required", 4 | 5 | # Buildkite: stack2nix checks, etc. 6 | "buildkite/cardano-sl", 7 | 8 | # Windows: builds are too unreliable to use at present 9 | # "continuous-integration/appveyor/branch", 10 | ] 11 | timeout_sec = 7200 12 | required_approvals = 1 13 | cut_body_after = "## Type of change" 14 | delete_merged_branches = true 15 | block_labels = [ "DO NOT MERGE", "wip" ] 16 | -------------------------------------------------------------------------------- /cabal.project: -------------------------------------------------------------------------------- 1 | packages: 2 | */*.cabal 3 | */test/*.cabal 4 | -------------------------------------------------------------------------------- /chain/Makefile: -------------------------------------------------------------------------------- 1 | help: ## Print documentation 2 | @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' 3 | 4 | ghcid: ## Run ghcid with the cardano-sl-chain package 5 | ghcid \ 6 | --command "stack ghci cardano-sl-chain --ghci-options=-fno-code" 7 | 8 | ghcid-test: ## Have ghcid run the chain-test test suite on successful recompile 9 | ghcid \ 10 | --command "stack ghci cardano-sl-chain:lib cardano-sl-chain:test:chain-test --ghci-options=-fobject-code" \ 11 | --test "Main.main" 12 | 13 | .PHONY: ghcid ghcid-test help 14 | -------------------------------------------------------------------------------- /chain/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /chain/shell.nix: -------------------------------------------------------------------------------- 1 | let 2 | self = import ../. {}; 3 | in (self.nix-tools.shellFor { 4 | name = "cardano-chain"; 5 | packages = ps: [ ps.cardano-sl-chain ]; 6 | }) 7 | -------------------------------------------------------------------------------- /chain/src/Pos/Chain/Block/Logic.hs: -------------------------------------------------------------------------------- 1 | -- | This module re-exports everything from 'Pos.Chain.Block.Logic.*'. 2 | module Pos.Chain.Block.Logic 3 | ( module Pos.Chain.Block.Logic.Integrity 4 | ) where 5 | 6 | import Pos.Chain.Block.Logic.Integrity 7 | -------------------------------------------------------------------------------- /chain/src/Pos/Chain/Block/Slog.hs: -------------------------------------------------------------------------------- 1 | -- | You can treat this part as another block component which deals 2 | -- with all data not related directly to any other component, while 3 | -- another part of 'Pos.Chain.Block' is dedicated to whole blocks. 4 | 5 | module Pos.Chain.Block.Slog 6 | ( module Pos.Chain.Block.Slog.Types 7 | ) where 8 | 9 | import Pos.Chain.Block.Slog.Types 10 | -------------------------------------------------------------------------------- /chain/src/Pos/Chain/Delegation.hs: -------------------------------------------------------------------------------- 1 | -- | Reexport module 2 | 3 | module Pos.Chain.Delegation 4 | ( module X 5 | ) where 6 | 7 | import Pos.Chain.Delegation.Cede as X 8 | import Pos.Chain.Delegation.Class as X 9 | import Pos.Chain.Delegation.Configuration as X 10 | import Pos.Chain.Delegation.HeavyDlgIndex as X 11 | import Pos.Chain.Delegation.LightDlgIndices as X 12 | import Pos.Chain.Delegation.Payload as X 13 | import Pos.Chain.Delegation.Proof as X 14 | import Pos.Chain.Delegation.Types as X 15 | -------------------------------------------------------------------------------- /chain/src/Pos/Chain/Delegation/Cede.hs: -------------------------------------------------------------------------------- 1 | -- | Re-exports of everything from 'Pos.Chain.Delegation.Cede*'. 2 | 3 | module Pos.Chain.Delegation.Cede 4 | ( module Pos.Chain.Delegation.Cede.Class 5 | , module Pos.Chain.Delegation.Cede.Types 6 | ) where 7 | 8 | import Pos.Chain.Delegation.Cede.Class 9 | import Pos.Chain.Delegation.Cede.Types 10 | 11 | 12 | -------------------------------------------------------------------------------- /chain/src/Pos/Chain/Delegation/Proof.hs: -------------------------------------------------------------------------------- 1 | module Pos.Chain.Delegation.Proof 2 | ( DlgProof 3 | , mkDlgProof 4 | ) where 5 | 6 | import Pos.Crypto (Hash, hash) 7 | 8 | import Pos.Chain.Delegation.Payload 9 | 10 | -- | Proof of delegation payload. 11 | type DlgProof = Hash DlgPayload 12 | 13 | -- | Creates 'DlgProof' out of delegation payload. 14 | mkDlgProof :: DlgPayload -> DlgProof 15 | mkDlgProof = hash 16 | -------------------------------------------------------------------------------- /chain/src/Pos/Chain/Genesis/Hash.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE Rank2Types #-} 2 | 3 | module Pos.Chain.Genesis.Hash 4 | ( GenesisHash (..) 5 | ) where 6 | 7 | import Pos.Crypto.Hashing (Hash) 8 | 9 | newtype GenesisHash = GenesisHash { getGenesisHash :: forall a . Hash a } 10 | -------------------------------------------------------------------------------- /chain/src/Pos/Chain/Lrc.hs: -------------------------------------------------------------------------------- 1 | module Pos.Chain.Lrc 2 | ( module X 3 | ) where 4 | 5 | import Pos.Chain.Lrc.Core as X 6 | import Pos.Chain.Lrc.Error as X 7 | import Pos.Chain.Lrc.Fts as X 8 | import Pos.Chain.Lrc.Genesis as X 9 | import Pos.Chain.Lrc.OBFT as X 10 | import Pos.Chain.Lrc.RichmenComponent as X 11 | import Pos.Chain.Lrc.Types as X 12 | -------------------------------------------------------------------------------- /chain/src/Pos/Chain/Security.hs: -------------------------------------------------------------------------------- 1 | module Pos.Chain.Security 2 | ( module X 3 | ) where 4 | 5 | import Pos.Chain.Security.Params as X 6 | import Pos.Chain.Security.Util as X 7 | -------------------------------------------------------------------------------- /chain/src/Pos/Chain/Ssc/Error.hs: -------------------------------------------------------------------------------- 1 | module Pos.Chain.Ssc.Error 2 | ( module Pos.Chain.Ssc.Error.Seed 3 | , module Pos.Chain.Ssc.Error.Verify 4 | ) where 5 | 6 | import Pos.Chain.Ssc.Error.Seed 7 | import Pos.Chain.Ssc.Error.Verify 8 | -------------------------------------------------------------------------------- /chain/src/Pos/Chain/Ssc/Opening.hs: -------------------------------------------------------------------------------- 1 | module Pos.Chain.Ssc.Opening 2 | ( Opening (..) 3 | ) where 4 | 5 | import Universum 6 | 7 | import Data.SafeCopy (base, deriveSafeCopySimple) 8 | 9 | import Pos.Binary.Class (AsBinary, Bi (..)) 10 | import Pos.Crypto (Secret) 11 | 12 | -- | Opening reveals secret. 13 | newtype Opening = Opening 14 | { getOpening :: AsBinary Secret 15 | } deriving (Show, Eq, Generic, Buildable, NFData) 16 | 17 | instance Bi Opening where 18 | encode = encode . getOpening 19 | decode = Opening <$> decode 20 | 21 | deriveSafeCopySimple 0 'base ''Opening 22 | -------------------------------------------------------------------------------- /chain/src/Pos/Chain/Ssc/OpeningsMap.hs: -------------------------------------------------------------------------------- 1 | module Pos.Chain.Ssc.OpeningsMap 2 | ( OpeningsMap 3 | ) where 4 | 5 | import Universum 6 | 7 | import Pos.Core.Common (StakeholderId) 8 | 9 | import Pos.Chain.Ssc.Opening 10 | 11 | type OpeningsMap = HashMap StakeholderId Opening 12 | -------------------------------------------------------------------------------- /chain/src/Pos/Chain/Ssc/Toss.hs: -------------------------------------------------------------------------------- 1 | -- | Toss abstraction and logic. 2 | module Pos.Chain.Ssc.Toss 3 | ( module Pos.Chain.Ssc.Toss.Base 4 | , module Pos.Chain.Ssc.Toss.Class 5 | , module Pos.Chain.Ssc.Toss.Logic 6 | , module Pos.Chain.Ssc.Toss.Pure 7 | , module Pos.Chain.Ssc.Toss.Types 8 | ) where 9 | 10 | import Pos.Chain.Ssc.Toss.Base 11 | import Pos.Chain.Ssc.Toss.Class 12 | import Pos.Chain.Ssc.Toss.Logic 13 | import Pos.Chain.Ssc.Toss.Pure 14 | import Pos.Chain.Ssc.Toss.Types 15 | -------------------------------------------------------------------------------- /chain/src/Pos/Chain/Txp/Toil.hs: -------------------------------------------------------------------------------- 1 | -- | Toil is a pure part of transaction processing. 2 | 3 | module Pos.Chain.Txp.Toil 4 | ( module Pos.Chain.Txp.Toil.Failure 5 | , module Pos.Chain.Txp.Toil.Logic 6 | , module Pos.Chain.Txp.Toil.Monad 7 | , module Pos.Chain.Txp.Toil.Types 8 | , module Pos.Chain.Txp.Toil.Utxo 9 | ) where 10 | 11 | import Pos.Chain.Txp.Toil.Failure 12 | import Pos.Chain.Txp.Toil.Logic 13 | import Pos.Chain.Txp.Toil.Monad 14 | import Pos.Chain.Txp.Toil.Types 15 | import Pos.Chain.Txp.Toil.Utxo 16 | -------------------------------------------------------------------------------- /chain/src/Pos/Chain/Txp/Toil/Utxo.hs: -------------------------------------------------------------------------------- 1 | -- | Utxo functionality re-exports. 2 | 3 | module Pos.Chain.Txp.Toil.Utxo 4 | ( module Pos.Chain.Txp.Toil.Utxo.Functions 5 | , module Pos.Chain.Txp.Toil.Utxo.Util 6 | ) where 7 | 8 | import Pos.Chain.Txp.Toil.Utxo.Functions 9 | import Pos.Chain.Txp.Toil.Utxo.Util 10 | -------------------------------------------------------------------------------- /chain/src/Pos/Chain/Txp/Undo.hs: -------------------------------------------------------------------------------- 1 | module Pos.Chain.Txp.Undo 2 | ( TxpUndo 3 | , TxUndo 4 | ) where 5 | 6 | import Universum 7 | 8 | import Pos.Chain.Txp.TxOutAux 9 | 10 | type TxpUndo = [TxUndo] 11 | 12 | -- | Particular undo needed for transactions 13 | -- Just means we know transaction input, hence know TxOutAux corresponding to it, 14 | -- Nothing otherwise. 15 | type TxUndo = NonEmpty (Maybe TxOutAux) 16 | -------------------------------------------------------------------------------- /chain/src/Pos/Chain/Update/Params.hs: -------------------------------------------------------------------------------- 1 | module Pos.Chain.Update.Params 2 | ( UpdateParams(..) 3 | ) where 4 | 5 | import Universum 6 | 7 | data UpdateParams = UpdateParams 8 | { -- | Path to update installer executable, downloaded by update system 9 | upUpdatePath :: !FilePath 10 | , -- | If `True` then use installer update mechanism 11 | upUpdateWithPkg :: !Bool 12 | , -- | List of update server URLs 13 | upUpdateServers :: ![Text] 14 | } 15 | deriving (Show) 16 | -------------------------------------------------------------------------------- /chain/src/Pos/Chain/Update/Poll.hs: -------------------------------------------------------------------------------- 1 | -- | Poll is an abstraction used for verifying data used in US. 2 | 3 | module Pos.Chain.Update.Poll 4 | ( module Pos.Chain.Update.Poll.Class 5 | , module Pos.Chain.Update.Poll.Failure 6 | , module Pos.Chain.Update.Poll.Modifier 7 | , module Pos.Chain.Update.Poll.Types 8 | ) where 9 | 10 | import Pos.Chain.Update.Poll.Class 11 | import Pos.Chain.Update.Poll.Failure 12 | import Pos.Chain.Update.Poll.Modifier 13 | import Pos.Chain.Update.Poll.Types 14 | -------------------------------------------------------------------------------- /chain/src/Pos/Chain/Update/Proof.hs: -------------------------------------------------------------------------------- 1 | module Pos.Chain.Update.Proof 2 | ( UpdateProof 3 | , mkUpdateProof 4 | ) where 5 | 6 | import Pos.Crypto (Hash, hash) 7 | 8 | import Pos.Chain.Update.Payload 9 | 10 | -- | Proof that body of update message contains 'UpdatePayload'. 11 | type UpdateProof = Hash UpdatePayload 12 | 13 | mkUpdateProof :: UpdatePayload -> UpdateProof 14 | mkUpdateProof = hash 15 | -------------------------------------------------------------------------------- /chain/test/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /chain/test/Spec.hs: -------------------------------------------------------------------------------- 1 | {-# OPTIONS_GHC -F -pgmF hspec-discover -optF --module-name=Spec #-} 2 | -------------------------------------------------------------------------------- /chain/test/Test/Pos/Chain/Ssc/CborSpec.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE TypeApplications #-} 2 | 3 | module Test.Pos.Chain.Ssc.CborSpec 4 | ( spec 5 | ) where 6 | 7 | import Universum 8 | 9 | import Test.Hspec (Spec, describe) 10 | 11 | import Pos.Chain.Ssc (VssCertificate) 12 | 13 | import Test.Pos.Binary.Helpers (binaryTest) 14 | import Test.Pos.Chain.Ssc.Arbitrary () 15 | 16 | spec :: Spec 17 | spec = describe "Cbor Bi instances" $ binaryTest @VssCertificate 18 | -------------------------------------------------------------------------------- /chain/test/Test/Pos/Chain/Txp/Arbitrary/Unsafe.hs: -------------------------------------------------------------------------------- 1 | {-# OPTIONS_GHC -fno-warn-orphans #-} 2 | 3 | -- | 'Arbitrary' unsafe instances for some types from Txp types 4 | 5 | module Test.Pos.Chain.Txp.Arbitrary.Unsafe () where 6 | 7 | import Universum 8 | 9 | import Pos.Chain.Txp (TxOut (..)) 10 | 11 | import Test.Pos.Core.Arbitrary.Unsafe () 12 | import Test.Pos.Util.QuickCheck.Arbitrary (ArbitraryUnsafe (..)) 13 | 14 | instance ArbitraryUnsafe TxOut where 15 | arbitraryUnsafe = TxOut <$> arbitraryUnsafe <*> arbitraryUnsafe 16 | -------------------------------------------------------------------------------- /chain/test/golden/bi/block/BlockBodyAttributes: -------------------------------------------------------------------------------- 1 | a0 -------------------------------------------------------------------------------- /chain/test/golden/bi/block/BlockHeaderAttributes: -------------------------------------------------------------------------------- 1 | a0 -------------------------------------------------------------------------------- /chain/test/golden/bi/block/BlockHeader_Genesis: -------------------------------------------------------------------------------- 1 | 00: 820085005820f7077d40c94a36e7df95 2 | 10: b6f99a86f08bcf06ea3b24e68dd30393 3 | 20: 33fa53141775582074840ea4e9e28b2f 4 | 30: 906a1530270131bc5ab07106024d6f9c 5 | 40: 8f4773e478c343a2820b810081a0 6 | -------------------------------------------------------------------------------- /chain/test/golden/bi/block/BlockSignature: -------------------------------------------------------------------------------- 1 | 00: 8200584067d583469c7bb28c232d5cea 2 | 10: 2d04f4d21c5d36ab25925c7e339c69f2 3 | 20: 29b5c86ccaa76fa4f7641f36d0489c3e 4 | 30: 691db8393b86ce1b13e19d5c12816a68 5 | 40: 7daf0b0c 6 | -------------------------------------------------------------------------------- /chain/test/golden/bi/block/GenesisBlockHeader: -------------------------------------------------------------------------------- 1 | 00: 85005820f7077d40c94a36e7df95b6f9 2 | 10: 9a86f08bcf06ea3b24e68dd3039333fa 3 | 20: 53141775582074840ea4e9e28b2f906a 4 | 30: 1530270131bc5ab07106024d6f9c8f47 5 | 40: 73e478c343a2820b810081a0 6 | -------------------------------------------------------------------------------- /chain/test/golden/bi/block/GenesisBody: -------------------------------------------------------------------------------- 1 | 00: 9f581c5125b558daa14b5338e904cc2a 2 | 10: 75a8b7b3a4738de9cb28a6819576db58 3 | 20: 1cd25597dd7d416ff91e12c8ca78c6bc 4 | 30: 9a1327cc56119969a7d18ea921581c66 5 | 40: 79321696358dac9d16cf8befe4adf181 6 | 50: 8096fd2a329c200fc2ebcfff 7 | -------------------------------------------------------------------------------- /chain/test/golden/bi/block/GenesisConsensusData: -------------------------------------------------------------------------------- 1 | 820e8119270f -------------------------------------------------------------------------------- /chain/test/golden/bi/block/GenesisProof: -------------------------------------------------------------------------------- 1 | 00: 582074840ea4e9e28b2f906a15302701 2 | 10: 31bc5ab07106024d6f9c8f4773e478c3 3 | 20: 43a2 4 | -------------------------------------------------------------------------------- /chain/test/golden/bi/block/HeaderHash: -------------------------------------------------------------------------------- 1 | 00: 5820125bbf1daefc2897d8db48999d09 2 | 10: b4eae439f0dfed83bc43246ca039fa4b 3 | 20: 1213 4 | -------------------------------------------------------------------------------- /chain/test/golden/bi/block/MainConsensusData: -------------------------------------------------------------------------------- 1 | 00: 84820b182f58404b6d7977346c445345 2 | 10: 3553346653483665744e6f756958657a 3 | 20: 4379456a4b63337447346a61306b466a 4 | 30: 4f38717a616932365a4d5055454a6645 5 | 40: 7931356f78356b8119270f8200584067 6 | 50: d583469c7bb28c232d5cea2d04f4d21c 7 | 60: 5d36ab25925c7e339c69f229b5c86cca 8 | 70: a76fa4f7641f36d0489c3e691db8393b 9 | 80: 86ce1b13e19d5c12816a687daf0b0c 10 | -------------------------------------------------------------------------------- /chain/test/golden/bi/block/MainExtraBodyData: -------------------------------------------------------------------------------- 1 | 81a0 -------------------------------------------------------------------------------- /chain/test/golden/bi/block/MainExtraHeaderData: -------------------------------------------------------------------------------- 1 | 00: 84830101018266476f6c64656e1863a0 2 | 10: 58204ba92aa320c60acc9ad7b9a64f2e 3 | 20: da55c4d2ec28e604faf186708b4f0c4e 4 | 30: 8edf 5 | -------------------------------------------------------------------------------- /chain/test/golden/bi/block/MainProof: -------------------------------------------------------------------------------- 1 | 00: 8483182058205e46ceb20538afeeb45c 2 | 10: b8f7030512af34b4ff363a8c7e94d441 3 | 20: a257500ffab75820e32c9549bc3acbe0 4 | 30: e848b2d7ad26331b7d8497580364cb2b 5 | 40: c6c8bda9aa0975b883005820006a4a2b 6 | 50: 269afe61e894701640d1ca59639d92af 7 | 60: 3095814f9836143bd5d40b9658209fbb 8 | 70: b2f0eff7472fe19e462fd88c495ac90f 9 | 80: 9ad58c4dd6cb204515710b0fe1325820 10 | 90: b5f2d3cb5a94d3e7dc9d812ebf56003e 11 | a0: 4f9fb02296034f5d5bcd073811ebe6b3 12 | b0: 5820a9d2e0af73f175d0eab5d96c8b48 13 | c0: 0edfa8226f4c2a9037d637f6aa3cd9f3 14 | d0: b575 15 | -------------------------------------------------------------------------------- /chain/test/golden/bi/delegation/HeavyDlgIndex: -------------------------------------------------------------------------------- 1 | 05 -------------------------------------------------------------------------------- /chain/test/golden/bi/delegation/LightDlgIndices: -------------------------------------------------------------------------------- 1 | 82071858 -------------------------------------------------------------------------------- /chain/test/golden/bi/delegation/ProxySKBlockInfo_Nothing: -------------------------------------------------------------------------------- 1 | 80 -------------------------------------------------------------------------------- /chain/test/golden/bi/delegation/ProxySKHeavy: -------------------------------------------------------------------------------- 1 | 00: 840558404a30754b446269376936644c 2 | 10: 586b756573565a394a6648676a726374 3 | 20: 734c4674324e766f76586e6368734f76 4 | 30: 58303559364c6f686c544e74356d6b50 5 | 40: 4668556f58404b6d7977346c44534535 6 | 50: 53346653483665744e6f756958657a43 7 | 60: 79456a4b63337447346a61306b466a4f 8 | 70: 38717a616932365a4d5055454a664579 9 | 80: 31356f78356b5840feccc189c702707f 10 | 90: 3a71d772559cebaee1a60c0eb99a9c28 11 | a0: f3ad22b6a69db65cdc913016f20133f4 12 | b0: f52f8074b75f7f678cf165f411a53609 13 | c0: 2404c536762f470a 14 | -------------------------------------------------------------------------------- /chain/test/golden/bi/ssc/CommitmentSignature: -------------------------------------------------------------------------------- 1 | 00: 58407803232dd492dacd3c0f7c5401a5 2 | 10: 77a4bfa2891cf5c9da07134ac2414522 3 | 20: c51b397e183602768910747ca3f2e065 4 | 30: f14a625b278cc2d8b3bca5bae84bbab6 5 | 40: bb03 6 | -------------------------------------------------------------------------------- /chain/test/golden/bi/ssc/Opening: -------------------------------------------------------------------------------- 1 | 00: 58235821026a8923b61ed176f49b726f 2 | 10: d5c1c06d0ce7433e3be82030a5c85e54 3 | 20: 8d0b0a3082 4 | -------------------------------------------------------------------------------- /chain/test/golden/bi/ssc/OpeningsMap: -------------------------------------------------------------------------------- 1 | 00: a1581c5125b558daa14b5338e904cc2a 2 | 10: 75a8b7b3a4738de9cb28a6819576db58 3 | 20: 235821026a8923b61ed176f49b726fd5 4 | 30: c1c06d0ce7433e3be82030a5c85e548d 5 | 40: 0b0a3082 6 | -------------------------------------------------------------------------------- /chain/test/golden/bi/ssc/SharesDistribution: -------------------------------------------------------------------------------- 1 | 00: a1581c5125b558daa14b5338e904cc2a 2 | 10: 75a8b7b3a4738de9cb28a6819576db19 3 | 20: 0539 4 | -------------------------------------------------------------------------------- /chain/test/golden/bi/ssc/SscProof_CertificatesProof: -------------------------------------------------------------------------------- 1 | 00: 820358209fbbb2f0eff7472fe19e462f 2 | 10: d88c495ac90f9ad58c4dd6cb20451571 3 | 20: 0b0fe132 4 | -------------------------------------------------------------------------------- /chain/test/golden/bi/ssc/SscProof_CommitmentsProof: -------------------------------------------------------------------------------- 1 | 00: 83005820006a4a2b269afe61e8947016 2 | 10: 40d1ca59639d92af3095814f9836143b 3 | 20: d5d40b9658209fbbb2f0eff7472fe19e 4 | 30: 462fd88c495ac90f9ad58c4dd6cb2045 5 | 40: 15710b0fe132 6 | -------------------------------------------------------------------------------- /chain/test/golden/bi/ssc/SscProof_OpeningsProof: -------------------------------------------------------------------------------- 1 | 00: 830158205d5c70f2397c29b3f064b84f 2 | 10: b53dcef6813e4033dd9cc6f313a482e2 3 | 20: 4ec102d658209fbbb2f0eff7472fe19e 4 | 30: 462fd88c495ac90f9ad58c4dd6cb2045 5 | 40: 15710b0fe132 6 | -------------------------------------------------------------------------------- /chain/test/golden/bi/ssc/SscProof_SharesProof: -------------------------------------------------------------------------------- 1 | 00: 8302582036e799e376b8a5bc0127b933 2 | 10: dcef926c56d30f00b1d717c498b6f23d 3 | 20: 4f2c4e5558209fbbb2f0eff7472fe19e 4 | 30: 462fd88c495ac90f9ad58c4dd6cb2045 5 | 40: 15710b0fe132 6 | -------------------------------------------------------------------------------- /chain/test/golden/bi/ssc/VssCertificate: -------------------------------------------------------------------------------- 1 | 00: 845823582103e5bb5c7fcea0440ba972 2 | 10: f98efffc38927db6c79d5b92d9ea41ec 3 | 20: f8ca10c32a310b58408a71f0f263c8c3 4 | 30: d8cc25a013b47d1a9535e8521fcdee95 5 | 40: 4ef552c894f482f7f9ad0ea977259ca4 6 | 50: 9a4dde3cd74421ccf2902fb4d02b3507 7 | 60: b040447f0bd724300e5840644c586b75 8 | 70: 6573565a394a6648676a726374734c46 9 | 80: 74324e766f76586e6368734f76583035 10 | 90: 59364c6f686c544e74356d6b50466855 11 | a0: 6f587531455a534a544979 12 | -------------------------------------------------------------------------------- /chain/test/golden/bi/ssc/VssCertificatesHash: -------------------------------------------------------------------------------- 1 | 00: 58209fbbb2f0eff7472fe19e462fd88c 2 | 10: 495ac90f9ad58c4dd6cb204515710b0f 3 | 20: e132 4 | -------------------------------------------------------------------------------- /chain/test/golden/bi/txp/HashTx: -------------------------------------------------------------------------------- 1 | 00: 58204ba839c420b3d2bd439530f891ca 2 | 10: e9a5d4c4d812044630dac72e8e0962fe 3 | 20: eecc 4 | -------------------------------------------------------------------------------- /chain/test/golden/bi/txp/Tx: -------------------------------------------------------------------------------- 1 | 00: 839f8200d81858258258204ba839c420 2 | 10: b3d2bd439530f891cae9a5d4c4d81204 3 | 20: 4630dac72e8e0962feeecc182fff9f82 4 | 30: 82d818582183581caa5372095aaa680d 5 | 40: 19d4ca496983a145709c3be18b0d4c83 6 | 50: cb7bdc5ea0001a32dc988e182fffa0 7 | -------------------------------------------------------------------------------- /chain/test/golden/bi/txp/TxAttributes: -------------------------------------------------------------------------------- 1 | a0 -------------------------------------------------------------------------------- /chain/test/golden/bi/txp/TxId: -------------------------------------------------------------------------------- 1 | 00: 58204ba839c420b3d2bd439530f891ca 2 | 10: e9a5d4c4d812044630dac72e8e0962fe 3 | 20: eecc 4 | -------------------------------------------------------------------------------- /chain/test/golden/bi/txp/TxInList: -------------------------------------------------------------------------------- 1 | 00: 9f8200d81858258258204ba839c420b3 2 | 10: d2bd439530f891cae9a5d4c4d8120446 3 | 20: 30dac72e8e0962feeecc182fff 4 | -------------------------------------------------------------------------------- /chain/test/golden/bi/txp/TxInWitness_PkWitness: -------------------------------------------------------------------------------- 1 | 00: 8200d81858858258404b6d7977346c44 2 | 10: 53453553346653483665744e6f756958 3 | 20: 657a4379456a4b63337447346a61306b 4 | 30: 466a4f38717a616932365a4d5055454a 5 | 40: 66457931356f78356b5840688aad857b 6 | 50: c7ff30fc6862da1be281f420c65271b7 7 | 60: 6ab19782ff40e2955af88819c38e5c79 8 | 70: 138f28073abae152c882258b4420a0c1 9 | 80: c9fdd26c98812697fc3e00 10 | -------------------------------------------------------------------------------- /chain/test/golden/bi/txp/TxInWitness_RedeemWitness: -------------------------------------------------------------------------------- 1 | 00: 8202d8185865825820538960a916726b 2 | 10: 09f05c9d4d4a922b85b4e11acfcc1434 3 | 20: 673d95019b7a9a52d258407d1479e7fd 4 | 30: d86a35eed51654fe5b3a76d12184eb5d 5 | 40: 9be8a455981479369537393b99b1cdaf 6 | 50: 2ec70c8fa60bd25dfd71fa206ef686a2 7 | 60: 8b195fe78583648e8fb10b 8 | -------------------------------------------------------------------------------- /chain/test/golden/bi/txp/TxInWitness_ScriptWitness: -------------------------------------------------------------------------------- 1 | 00: 8201d818582b8282182f517365726961 2 | 10: 6c697a65642073637269707482182f51 3 | 20: 73657269616c697a6564207363726970 4 | 30: 74 5 | -------------------------------------------------------------------------------- /chain/test/golden/bi/txp/TxInWitness_UnknownWitnessType: -------------------------------------------------------------------------------- 1 | 00: 82182fd8184b666f7274792073657665 2 | 10: 6e 3 | -------------------------------------------------------------------------------- /chain/test/golden/bi/txp/TxIn_Unknown: -------------------------------------------------------------------------------- 1 | 00: 82182fd8184b666f7274792073657665 2 | 10: 6e 3 | -------------------------------------------------------------------------------- /chain/test/golden/bi/txp/TxIn_Utxo: -------------------------------------------------------------------------------- 1 | 00: 8200d81858258258204ba839c420b3d2 2 | 10: bd439530f891cae9a5d4c4d812044630 3 | 20: dac72e8e0962feeecc182f 4 | -------------------------------------------------------------------------------- /chain/test/golden/bi/txp/TxOut: -------------------------------------------------------------------------------- 1 | 00: 8282d818582183581caa5372095aaa68 2 | 10: 0d19d4ca496983a145709c3be18b0d4c 3 | 20: 83cb7bdc5ea0001a32dc988e182f 4 | -------------------------------------------------------------------------------- /chain/test/golden/bi/txp/TxOutAux: -------------------------------------------------------------------------------- 1 | 00: 818282d818582183581caa5372095aaa 2 | 10: 680d19d4ca496983a145709c3be18b0d 3 | 20: 4c83cb7bdc5ea0001a32dc988e182f 4 | -------------------------------------------------------------------------------- /chain/test/golden/bi/txp/TxOutList: -------------------------------------------------------------------------------- 1 | 00: 9f8282d818582183581caa5372095aaa 2 | 10: 680d19d4ca496983a145709c3be18b0d 3 | 20: 4c83cb7bdc5ea0001a32dc988e182fff 4 | -------------------------------------------------------------------------------- /chain/test/golden/bi/txp/TxProof: -------------------------------------------------------------------------------- 1 | 00: 83182058205e46ceb20538afeeb45cb8 2 | 10: f7030512af34b4ff363a8c7e94d441a2 3 | 20: 57500ffab75820e32c9549bc3acbe0e8 4 | 30: 48b2d7ad26331b7d8497580364cb2bc6 5 | 40: c8bda9aa0975b8 6 | -------------------------------------------------------------------------------- /chain/test/golden/bi/txp/TxSig: -------------------------------------------------------------------------------- 1 | 00: 5840688aad857bc7ff30fc6862da1be2 2 | 10: 81f420c65271b76ab19782ff40e2955a 3 | 20: f88819c38e5c79138f28073abae152c8 4 | 30: 82258b4420a0c1c9fdd26c98812697fc 5 | 40: 3e00 6 | -------------------------------------------------------------------------------- /chain/test/golden/bi/txp/TxSigData: -------------------------------------------------------------------------------- 1 | 00: 58204ba839c420b3d2bd439530f891ca 2 | 10: e9a5d4c4d812044630dac72e8e0962fe 3 | 20: eecc 4 | -------------------------------------------------------------------------------- /chain/test/golden/bi/txp/TxWitness: -------------------------------------------------------------------------------- 1 | 00: 818200d81858858258404b6d7977346c 2 | 10: 4453453553346653483665744e6f7569 3 | 20: 58657a4379456a4b63337447346a6130 4 | 30: 6b466a4f38717a616932365a4d505545 5 | 40: 4a66457931356f78356b5840688aad85 6 | 50: 7bc7ff30fc6862da1be281f420c65271 7 | 60: b76ab19782ff40e2955af88819c38e5c 8 | 70: 79138f28073abae152c882258b4420a0 9 | 80: c1c9fdd26c98812697fc3e00 10 | -------------------------------------------------------------------------------- /chain/test/golden/bi/update/ApplicationName: -------------------------------------------------------------------------------- 1 | 66476f6c64656e -------------------------------------------------------------------------------- /chain/test/golden/bi/update/BlockVersion: -------------------------------------------------------------------------------- 1 | 83010101 -------------------------------------------------------------------------------- /chain/test/golden/bi/update/BlockVersionData: -------------------------------------------------------------------------------- 1 | 00: 8e1903e71903e71903e71903e71903e7 2 | 10: 1903e718631863186318631863831863 3 | 20: 186318638200d81846821903e7184d18 4 | 30: 63 5 | -------------------------------------------------------------------------------- /chain/test/golden/bi/update/BlockVersionModifier: -------------------------------------------------------------------------------- 1 | 00: 8e811903e7811903e7811903e7811903 2 | 10: e7811903e7811903e781186381186381 3 | 20: 18638118638118638183186318631863 4 | 30: 818200d81846821903e7184d811863 5 | -------------------------------------------------------------------------------- /chain/test/golden/bi/update/HashRaw: -------------------------------------------------------------------------------- 1 | 00: 582096b23a356c80ba706dbf08c0c2b2 2 | 10: 05576a6affd6f43b43ba8b7dc53d0355 3 | 20: 5938 4 | -------------------------------------------------------------------------------- /chain/test/golden/bi/update/SoftforkRule: -------------------------------------------------------------------------------- 1 | 83186318631863 -------------------------------------------------------------------------------- /chain/test/golden/bi/update/SoftwareVersion: -------------------------------------------------------------------------------- 1 | 8266476f6c64656e1863 -------------------------------------------------------------------------------- /chain/test/golden/bi/update/SystemTag: -------------------------------------------------------------------------------- 1 | 00: 704b6d7977346c445345355334665348 2 | 10: 36 3 | -------------------------------------------------------------------------------- /chain/test/golden/bi/update/UpAttributes: -------------------------------------------------------------------------------- 1 | a0 -------------------------------------------------------------------------------- /chain/test/golden/bi/update/UpId: -------------------------------------------------------------------------------- 1 | 00: 58205329d1c029205f3ca30468d00e1e 2 | 10: da309efcb50ee44fe0f929f988afbbf5 3 | 20: f28e 4 | -------------------------------------------------------------------------------- /chain/test/golden/bi/update/UpdateData: -------------------------------------------------------------------------------- 1 | 00: 845820cec02b41a5c236069cb3fd3fa6 2 | 10: 58a013e230873c2013f783c0504037dc 3 | 20: 8595875820cec02b41a5c236069cb3fd 4 | 30: 3fa658a013e230873c2013f783c05040 5 | 40: 37dc8595875820cec02b41a5c236069c 6 | 50: b3fd3fa658a013e230873c2013f783c0 7 | 60: 504037dc8595875820cec02b41a5c236 8 | 70: 069cb3fd3fa658a013e230873c2013f7 9 | 80: 83c0504037dc859587 10 | -------------------------------------------------------------------------------- /chain/test/golden/bi/update/UpdateProof: -------------------------------------------------------------------------------- 1 | 00: 5820a9d2e0af73f175d0eab5d96c8b48 2 | 10: 0edfa8226f4c2a9037d637f6aa3cd9f3 3 | 20: b575 4 | -------------------------------------------------------------------------------- /chain/test/golden/bi/update/UpdateVote: -------------------------------------------------------------------------------- 1 | 00: 8458404a30754b446269376936644c58 2 | 10: 6b756573565a394a6648676a72637473 3 | 20: 4c4674324e766f76586e6368734f7658 4 | 30: 303559364c6f686c544e74356d6b5046 5 | 40: 68556f58205329d1c029205f3ca30468 6 | 50: d00e1eda309efcb50ee44fe0f929f988 7 | 60: afbbf5f28ef55840101bc0f91d86c749 8 | 70: b45b22fcafb4a812e8239e72b62f4bae 9 | 80: 46cb9c14edd1dadf4b31cf3a931d3c30 10 | 90: 327592fdee651bd578b63db07c747e36 11 | a0: 9042beb0f5bf6d0c 12 | -------------------------------------------------------------------------------- /chain/test/golden/bi/update/VoteId: -------------------------------------------------------------------------------- 1 | 00: 8358205329d1c029205f3ca30468d00e 2 | 10: 1eda309efcb50ee44fe0f929f988afbb 3 | 20: f5f28e58404b6d7977346c4453453553 4 | 30: 346653483665744e6f756958657a4379 5 | 40: 456a4b63337447346a61306b466a4f38 6 | 50: 717a616932365a4d5055454a66457931 7 | 60: 356f78356bf4 8 | -------------------------------------------------------------------------------- /chain/test/golden/json/AttackTarget_NetworkAddressTarget: -------------------------------------------------------------------------------- 1 | { 2 | "Network": "ggv:32313" 3 | } -------------------------------------------------------------------------------- /chain/test/golden/json/AttackTarget_PubKeyAddressTarget: -------------------------------------------------------------------------------- 1 | { 2 | "PubKey": "cae922c720ea93e5ead49b4652fb24caf4948e31eee378a4c4513f11" 3 | } -------------------------------------------------------------------------------- /chain/test/golden/json/GenesisProtocolConstants0_Legacy_HasNetworkMagic: -------------------------------------------------------------------------------- 1 | { 2 | "vssMinTTL": 744040476, 3 | "k": 37, 4 | "vssMaxTTL": 1477558317, 5 | "protocolMagic": 1783847074 6 | } -------------------------------------------------------------------------------- /chain/test/golden/json/GenesisProtocolConstants1_Legacy_HasNetworkMagic: -------------------------------------------------------------------------------- 1 | { 2 | "vssMinTTL": 310228653, 3 | "k": 64, 4 | "vssMaxTTL": 126106167, 5 | "protocolMagic": 135977977 6 | } -------------------------------------------------------------------------------- /chain/test/golden/json/GenesisProtocolConstants2_Legacy_HasNetworkMagic: -------------------------------------------------------------------------------- 1 | { 2 | "vssMinTTL": 1341799941, 3 | "k": 2, 4 | "vssMaxTTL": 402296078, 5 | "protocolMagic": 1780893186 6 | } -------------------------------------------------------------------------------- /chain/test/golden/json/StaticConfig_GCSrc: -------------------------------------------------------------------------------- 1 | { 2 | "src": { 3 | "file": "dRaMwdYsH3QA3dChe", 4 | "hash": "bc9a1c2d86ddf023a39d8ae0abaf209fe4a95a3741cb99ecc0f011b48a5b69b9" 5 | } 6 | } -------------------------------------------------------------------------------- /chain/test/golden/json/TxValidationRulesConfig: -------------------------------------------------------------------------------- 1 | { 2 | "addrAttribSize": 128, 3 | "txAttribSize": 128, 4 | "attribResrictEpoch": 2 5 | } -------------------------------------------------------------------------------- /chain/test/golden/json/TxpConfiguration0: -------------------------------------------------------------------------------- 1 | { 2 | "memPoolLimitTx": 99, 3 | "assetLockedSrcAddrs": [ 4 | "2RhQhCGqYPDpFgTsnBTbnvPvCwpqAkjwLqQkWpkqXbLRmNxd4xNd262nGsr8JiynyKRUeMLSJ9Ntho9i76uvBTrVXdJJG5yiNLb8frmUe5qX7E" 5 | ] 6 | } -------------------------------------------------------------------------------- /chain/test/golden/json/TxpConfiguration2: -------------------------------------------------------------------------------- 1 | { 2 | "memPoolLimitTx": 700, 3 | "assetLockedSrcAddrs": [ 4 | "2RhQhCGqYPDpFgTsnBTbnvPvCwpqAkjwLqQkWpkqXbLRmNxd4xNd262nGsr8JiynyKRUeMLSJ9Ntho9i76uvBTrVXdJJG5yiNLb8frmUe5qX7E", 5 | "5FCjkr138i9wjRVwawmYMd4Vc9KxU7TuQhMyjMGpnykg9yb2qMpUCerDFzXvfAJMFgJTHyD7Sn4ybLXm2M6zeWAaWe7ctjq5QjVL427vGRx" 6 | ] 7 | } -------------------------------------------------------------------------------- /chain/test/golden/oldJson/AttackTarget_NetworkAddressTarget: -------------------------------------------------------------------------------- 1 | {"Network":"ggv:32313"} -------------------------------------------------------------------------------- /chain/test/golden/oldJson/AttackTarget_PubKeyAddressTarget: -------------------------------------------------------------------------------- 1 | {"PubKey":"cae922c720ea93e5ead49b4652fb24caf4948e31eee378a4c4513f11"} -------------------------------------------------------------------------------- /chain/test/golden/oldJson/GenesisProtocolConstants0_Legacy_HasNetworkMagic: -------------------------------------------------------------------------------- 1 | {"k":37,"protocolMagic":1783847074,"vssMaxTTL":1477558317,"vssMinTTL":744040476} -------------------------------------------------------------------------------- /chain/test/golden/oldJson/GenesisProtocolConstants1_Legacy_HasNetworkMagic: -------------------------------------------------------------------------------- 1 | {"k":64,"protocolMagic":135977977,"vssMaxTTL":126106167,"vssMinTTL":310228653} -------------------------------------------------------------------------------- /chain/test/golden/oldJson/GenesisProtocolConstants2_Legacy_HasNetworkMagic: -------------------------------------------------------------------------------- 1 | {"k":2,"protocolMagic":1780893186,"vssMaxTTL":402296078,"vssMinTTL":1341799941} -------------------------------------------------------------------------------- /chain/test/golden/oldJson/StaticConfig_GCSrc: -------------------------------------------------------------------------------- 1 | {"src":{"file":"dRaMwdYsH3QA3dChe","hash":"bc9a1c2d86ddf023a39d8ae0abaf209fe4a95a3741cb99ecc0f011b48a5b69b9"}} -------------------------------------------------------------------------------- /chain/test/golden/oldJson/TxpConfiguration0: -------------------------------------------------------------------------------- 1 | {"memPoolLimitTx":99,"assetLockedSrcAddrs":["2RhQhCGqYPDpFgTsnBTbnvPvCwpqAkjwLqQkWpkqXbLRmNxd4xNd262nGsr8JiynyKRUeMLSJ9Ntho9i76uvBTrVXdJJG5yiNLb8frmUe5qX7E"]} -------------------------------------------------------------------------------- /chain/test/golden/oldJson/TxpConfiguration1: -------------------------------------------------------------------------------- 1 | {"memPoolLimitTx":9,"assetLockedSrcAddrs":["a2x5MVsL5Pr1SESUZbGb7d64coe2VpRJhEFsYCUHfaimAE3wvmNHd44H7ue1wFx1RqrS9vnAmTVri19FttwaRLWG5L2rLMe1tCSzZ4zJjeUwej8kEX4VmYbL7t7o1rmucebNvz8qGod2s6LKCkAxN6dWVv9jZ3gCkWrNsXq3JeSjaBLPT7RNwSExRmPAwJ6geZmadnKSArbiPjYXkaJa5GQyDUYbni8jCyXmMHB7Qsj1Pgc7qCKA7AebV13kADRv3wSbMgWEAbBrxEmBRnHgXw5Nh6EJ5n7ejVYJAJY3kJ8Q2xisLJxW54Y48BK8a4AW7M3fU","Ae2tdPwUPEZDoUnyXuAgqzhkjNXNJeiZ5nqwprg9sArZmRNjySfJ5uz4FjB","dRNpRgY7sgwXaGbEZQ7KtFprY5PE3sxejht9kFEKLmSowgUegSinCjx3yuKGHQbRHL2EUP89BuAurEScfrgWxahCjD1M9QKYoTj5KrbR5TDnqBE3oSNx7UcXhrGKM9aau48SASu8i88Sq8hPb3z5K662spTXX"]} -------------------------------------------------------------------------------- /chain/test/golden/oldJson/TxpConfiguration2: -------------------------------------------------------------------------------- 1 | {"memPoolLimitTx":700,"assetLockedSrcAddrs":["2RhQhCGqYPDpFgTsnBTbnvPvCwpqAkjwLqQkWpkqXbLRmNxd4xNd262nGsr8JiynyKRUeMLSJ9Ntho9i76uvBTrVXdJJG5yiNLb8frmUe5qX7E","5FCjkr138i9wjRVwawmYMd4Vc9KxU7TuQhMyjMGpnykg9yb2qMpUCerDFzXvfAJMFgJTHyD7Sn4ybLXm2M6zeWAaWe7ctjq5QjVL427vGRx"]} -------------------------------------------------------------------------------- /chain/test/golden/yaml/TxValidationRulesConfig: -------------------------------------------------------------------------------- 1 | addrAttribSize: 128 2 | txAttribSize: 128 3 | attribResrictEpoch: 2 4 | -------------------------------------------------------------------------------- /client/Makefile: -------------------------------------------------------------------------------- 1 | help: ## Print documentation 2 | @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' 3 | 4 | ghcid: ## Run ghcid with the cardano-sl-client package 5 | ghcid \ 6 | --command "stack ghci cardano-sl-client --ghci-options=-fno-code" 7 | 8 | ghcid-test: ## Have ghcid run the test suite on successful recompile 9 | ghcid \ 10 | --command "stack ghci cardano-sl-client:lib cardano-sl-client:test:cardano-client-test --ghci-options=-fobject-code" \ 11 | --test "Main.main" 12 | 13 | .PHONY: ghcid ghcid-test help 14 | -------------------------------------------------------------------------------- /client/README.md: -------------------------------------------------------------------------------- 1 | # cardano-sl-client 2 | 3 | This package implements some of the functionality required for a client of the 4 | Cardano SL network. This includes: 5 | 6 | * Generation of addresses and change addresses. 7 | * Calculating coin balances. 8 | * Calculating transactions history. 9 | * Preparing and submitting new transactions to the network. 10 | -------------------------------------------------------------------------------- /client/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /client/src/Pos/Client/Txp.hs: -------------------------------------------------------------------------------- 1 | -- | Reexport of Pos.Client.Txp.* modules. 2 | 3 | module Pos.Client.Txp 4 | ( module Pos.Client.Txp.Addresses 5 | , module Pos.Client.Txp.Balances 6 | , module Pos.Client.Txp.History 7 | , module Pos.Client.Txp.Network 8 | , module Pos.Client.Txp.Util 9 | ) where 10 | 11 | import Pos.Client.Txp.Addresses 12 | import Pos.Client.Txp.Balances 13 | import Pos.Client.Txp.History 14 | import Pos.Client.Txp.Network 15 | import Pos.Client.Txp.Util 16 | 17 | -------------------------------------------------------------------------------- /client/src/Pos/Client/Update.hs: -------------------------------------------------------------------------------- 1 | -- | Reexport of Pos.Client.Update.* modules. 2 | 3 | module Pos.Client.Update 4 | ( module Pos.Client.Update.Network 5 | ) where 6 | 7 | import Pos.Client.Update.Network 8 | 9 | -------------------------------------------------------------------------------- /client/test/Spec.hs: -------------------------------------------------------------------------------- 1 | {-# OPTIONS_GHC -F -pgmF hspec-discover -optF --module-name=Spec #-} 2 | -------------------------------------------------------------------------------- /client/test/Test.hs: -------------------------------------------------------------------------------- 1 | import Universum 2 | 3 | import Test.Hspec (hspec) 4 | 5 | import Spec (spec) 6 | import Test.Pos.Configuration (defaultTestConf) 7 | 8 | main :: IO () 9 | main = do 10 | putText $ "default configuration: " <> show defaultTestConf 11 | hspec spec 12 | -------------------------------------------------------------------------------- /core/Makefile: -------------------------------------------------------------------------------- 1 | help: ## Print documentation 2 | @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' 3 | 4 | ghcid: ## Run ghcid with the cardano-sl-core package 5 | ghcid \ 6 | --command "stack ghci cardano-sl-core --ghci-options=-fno-code" 7 | 8 | ghcid-test: ## Have ghcid run the core-test test suite on successful recompile 9 | ghcid \ 10 | --command "stack ghci cardano-sl-core:lib cardano-sl-core:test:core-test --ghci-options=-fobject-code" \ 11 | --test "Main.main" 12 | 13 | .PHONY: ghcid ghcid-test help 14 | -------------------------------------------------------------------------------- /core/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /core/src/Pos/Core/Aeson.hs: -------------------------------------------------------------------------------- 1 | {-# OPTIONS_GHC -Wno-dodgy-exports #-} 2 | 3 | module Pos.Core.Aeson 4 | ( module Pos.Core.Aeson.Orphans 5 | ) where 6 | 7 | import Pos.Core.Aeson.Orphans () 8 | -------------------------------------------------------------------------------- /core/src/Pos/Core/Aeson/Orphans.hs: -------------------------------------------------------------------------------- 1 | {-# OPTIONS_GHC -fno-warn-orphans #-} 2 | 3 | -- | Aeson orphan instances for core 4 | 5 | module Pos.Core.Aeson.Orphans 6 | ( 7 | ) where 8 | 9 | import qualified Data.Aeson.Options as S (defaultOptions) 10 | import Data.Aeson.TH (deriveJSON) 11 | import Data.Time.Units (Microsecond, Millisecond, Second) 12 | 13 | deriveJSON S.defaultOptions ''Millisecond 14 | deriveJSON S.defaultOptions ''Microsecond 15 | deriveJSON S.defaultOptions ''Second 16 | -------------------------------------------------------------------------------- /core/src/Pos/Core/Binary.hs: -------------------------------------------------------------------------------- 1 | {-# OPTIONS_GHC -Wno-unused-imports #-} 2 | {-# OPTIONS_GHC -Wno-dodgy-exports #-} 3 | 4 | module Pos.Core.Binary 5 | ( module Pos.Core.Binary.Orphans 6 | ) where 7 | 8 | import Pos.Core.Binary.Orphans () 9 | -------------------------------------------------------------------------------- /core/src/Pos/Core/Common/Stakes.hs: -------------------------------------------------------------------------------- 1 | module Pos.Core.Common.Stakes 2 | ( StakesMap 3 | , StakesList 4 | ) where 5 | 6 | import Universum 7 | 8 | import Pos.Core.Common.Coin 9 | import Pos.Core.Common.StakeholderId 10 | 11 | -- | A mapping between stakeholders and they stakes. 12 | type StakesMap = HashMap StakeholderId Coin 13 | 14 | -- | Stakeholders and their stakes. 15 | type StakesList = [(StakeholderId, Coin)] 16 | -------------------------------------------------------------------------------- /core/src/Pos/Core/Context.hs: -------------------------------------------------------------------------------- 1 | module Pos.Core.Context 2 | ( 3 | module Pos.Core.Context.PrimaryKey 4 | ) where 5 | 6 | import Pos.Core.Context.PrimaryKey 7 | -------------------------------------------------------------------------------- /core/src/Pos/Core/JsonLog.hs: -------------------------------------------------------------------------------- 1 | {-| 2 | Module : JsonLog 3 | Description : Logging to JSON files 4 | License: MIT 5 | Maintainer: lars.bruenjes@iohk.io 6 | Stability: experimental 7 | Portability: GHC 8 | 9 | This module provides types and functions to support 10 | logging to JSON files. 11 | -} 12 | 13 | module Pos.Core.JsonLog 14 | ( module Pos.Core.JsonLog.CanJsonLog 15 | , module Pos.Core.JsonLog.Event 16 | , module Pos.Core.JsonLog.JsonLogT 17 | ) where 18 | 19 | import Pos.Core.JsonLog.CanJsonLog 20 | import Pos.Core.JsonLog.Event 21 | import Pos.Core.JsonLog.JsonLogT 22 | -------------------------------------------------------------------------------- /core/src/Pos/Core/Metrics/Constants.hs: -------------------------------------------------------------------------------- 1 | module Pos.Core.Metrics.Constants ( 2 | cardanoNamespace 3 | , withCardanoNamespace 4 | ) where 5 | 6 | import Universum 7 | 8 | cardanoNamespace :: Text 9 | cardanoNamespace = "cardano" 10 | 11 | withCardanoNamespace :: Text -> Text 12 | withCardanoNamespace label = cardanoNamespace <> "." <> label 13 | -------------------------------------------------------------------------------- /core/src/Pos/Core/Reporting.hs: -------------------------------------------------------------------------------- 1 | module Pos.Core.Reporting 2 | ( module X 3 | ) where 4 | 5 | import Pos.Core.Reporting.MemState as X 6 | import Pos.Core.Reporting.Methods as X 7 | import Pos.Core.Reporting.Metrics as X 8 | -------------------------------------------------------------------------------- /core/test/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /core/test/Spec.hs: -------------------------------------------------------------------------------- 1 | {-# OPTIONS_GHC -F -pgmF hspec-discover -optF --module-name=Spec #-} 2 | -------------------------------------------------------------------------------- /core/test/Test/Pos/Core/Chrono.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DeriveTraversable #-} 2 | {-# LANGUAGE TypeFamilies #-} 3 | 4 | {-# OPTIONS_GHC -fno-warn-orphans #-} 5 | 6 | 7 | -- | Chronological sequences. 8 | 9 | module Test.Pos.Core.Chrono 10 | ( 11 | ) where 12 | 13 | import Pos.Core.Chrono 14 | 15 | import Test.QuickCheck (Arbitrary) 16 | 17 | deriving instance Arbitrary (f a) => Arbitrary (NewestFirst f a) 18 | deriving instance Arbitrary (f a) => Arbitrary (OldestFirst f a) 19 | -------------------------------------------------------------------------------- /core/test/golden/AddrSpendingData_PubKey: -------------------------------------------------------------------------------- 1 | 00: 820058404b6d7977346c445345355334 2 | 10: 6653483665744e6f756958657a437945 3 | 20: 6a4b63337447346a61306b466a4f3871 4 | 30: 7a616932365a4d5055454a6645793135 5 | 40: 6f78356b 6 | -------------------------------------------------------------------------------- /core/test/golden/AddrSpendingData_Redeem: -------------------------------------------------------------------------------- 1 | 00: 82025820538960a916726b09f05c9d4d 2 | 10: 4a922b85b4e11acfcc1434673d95019b 3 | 20: 7a9a52d2 4 | -------------------------------------------------------------------------------- /core/test/golden/AddrSpendingData_Script: -------------------------------------------------------------------------------- 1 | 00: 8201821902595820346c445345355334 2 | 10: 6653483665744e6f756958657a437945 3 | 20: 6a4b63337447346a 4 | -------------------------------------------------------------------------------- /core/test/golden/AddrSpendingData_Unknown: -------------------------------------------------------------------------------- 1 | 00: 8218f7d818582077346c445345355334 2 | 10: 6653483665744e6f756958657a437945 3 | 20: 6a4b6333744734 4 | -------------------------------------------------------------------------------- /core/test/golden/AddrStakeDistribution_Bootstrap: -------------------------------------------------------------------------------- 1 | 80 -------------------------------------------------------------------------------- /core/test/golden/AddrStakeDistribution_SingleKey: -------------------------------------------------------------------------------- 1 | 00: 8200581c5125b558daa14b5338e904cc 2 | 10: 2a75a8b7b3a4738de9cb28a6819576db 3 | -------------------------------------------------------------------------------- /core/test/golden/AddrStakeDistribution_UnsafeMultiKey: -------------------------------------------------------------------------------- 1 | 00: a3581c4577144e4954c6ba257ff8b51d 2 | 10: 5f6d9f3cf44a16084dbeb1413394b51b 3 | 20: 0001c6bf52634000581c5125b558daa1 4 | 30: 4b5338e904cc2a75a8b7b3a4738de9cb 5 | 40: 28a6819576db1b000110d9316ec00058 6 | 50: 1cbd3c9fb63a795fde3a199468e83f5f 7 | 60: 51d20f19d082f2458dbb703aad1b0000 8 | 70: b5e620f48000 9 | -------------------------------------------------------------------------------- /core/test/golden/AddrType_PK: -------------------------------------------------------------------------------- 1 | 00 -------------------------------------------------------------------------------- /core/test/golden/AddrType_R: -------------------------------------------------------------------------------- 1 | 02 -------------------------------------------------------------------------------- /core/test/golden/AddrType_S: -------------------------------------------------------------------------------- 1 | 01 -------------------------------------------------------------------------------- /core/test/golden/AddrType_U: -------------------------------------------------------------------------------- 1 | 1839 -------------------------------------------------------------------------------- /core/test/golden/Attributes: -------------------------------------------------------------------------------- 1 | a0 -------------------------------------------------------------------------------- /core/test/golden/BlockCount: -------------------------------------------------------------------------------- 1 | 1903e7 -------------------------------------------------------------------------------- /core/test/golden/ChainDifficulty: -------------------------------------------------------------------------------- 1 | 8119270f -------------------------------------------------------------------------------- /core/test/golden/Coeff: -------------------------------------------------------------------------------- 1 | 1865 -------------------------------------------------------------------------------- /core/test/golden/Coin: -------------------------------------------------------------------------------- 1 | 192604 -------------------------------------------------------------------------------- /core/test/golden/CoinPortion: -------------------------------------------------------------------------------- 1 | 1925e6 -------------------------------------------------------------------------------- /core/test/golden/EpochIndex: -------------------------------------------------------------------------------- 1 | 0e -------------------------------------------------------------------------------- /core/test/golden/EpochOrSlotEI: -------------------------------------------------------------------------------- 1 | 82000e -------------------------------------------------------------------------------- /core/test/golden/EpochOrSlotSI: -------------------------------------------------------------------------------- 1 | 8201820b182f -------------------------------------------------------------------------------- /core/test/golden/FlatSlotId: -------------------------------------------------------------------------------- 1 | 191389 -------------------------------------------------------------------------------- /core/test/golden/InvReqDataFlowLog_InvReqAccepted: -------------------------------------------------------------------------------- 1 | {"invReqAccepted":{"reqSent":3,"reqStart":1,"reqClosed":4,"reqReceived":2}} -------------------------------------------------------------------------------- /core/test/golden/InvReqDataFlowLog_InvReqException: -------------------------------------------------------------------------------- 1 | {"invReqException":"test"} -------------------------------------------------------------------------------- /core/test/golden/InvReqDataFlowLog_InvReqRejected: -------------------------------------------------------------------------------- 1 | {"invReqRejected":{"reqStart":1,"reqReceived":2}} -------------------------------------------------------------------------------- /core/test/golden/LocalSlotIndex: -------------------------------------------------------------------------------- 1 | 1834 -------------------------------------------------------------------------------- /core/test/golden/MerkleRoot: -------------------------------------------------------------------------------- 1 | 00: 5820c4df3798353de80db323417c513b 2 | 10: 0d647fdac1944f959211b4db35d4bd86 3 | 20: ca28 4 | -------------------------------------------------------------------------------- /core/test/golden/MerkleTree: -------------------------------------------------------------------------------- 1 | 00: 9f582096b23a356c80ba706dbf08c0c2 2 | 10: b205576a6affd6f43b43ba8b7dc53d03 3 | 20: 555938ff 4 | -------------------------------------------------------------------------------- /core/test/golden/Script: -------------------------------------------------------------------------------- 1 | 00: 821902595820346c4453453553346653 2 | 10: 483665744e6f756958657a4379456a4b 3 | 20: 63337447346a 4 | -------------------------------------------------------------------------------- /core/test/golden/ScriptVersion: -------------------------------------------------------------------------------- 1 | 191771 -------------------------------------------------------------------------------- /core/test/golden/SharedSeed: -------------------------------------------------------------------------------- 1 | 00: 815820453553346653483665744e6f75 2 | 10: 6958657a4379456a4b63337447346a61 3 | 20: 306b46 4 | -------------------------------------------------------------------------------- /core/test/golden/SlotCount: -------------------------------------------------------------------------------- 1 | 1a00073e7b -------------------------------------------------------------------------------- /core/test/golden/SlotId: -------------------------------------------------------------------------------- 1 | 820b182f -------------------------------------------------------------------------------- /core/test/golden/SlotLeaders: -------------------------------------------------------------------------------- 1 | 00: 9f581c5125b558daa14b5338e904cc2a 2 | 10: 75a8b7b3a4738de9cb28a6819576db58 3 | 20: 1cd25597dd7d416ff91e12c8ca78c6bc 4 | 30: 9a1327cc56119969a7d18ea921581c66 5 | 40: 79321696358dac9d16cf8befe4adf181 6 | 50: 8096fd2a329c200fc2ebcfff 7 | -------------------------------------------------------------------------------- /core/test/golden/StakeholderId: -------------------------------------------------------------------------------- 1 | 00: 581c5125b558daa14b5338e904cc2a75 2 | 10: a8b7b3a4738de9cb28a6819576db 3 | -------------------------------------------------------------------------------- /core/test/golden/StakesList: -------------------------------------------------------------------------------- 1 | 00: 9f82581c5125b558daa14b5338e904cc 2 | 10: 2a75a8b7b3a4738de9cb28a6819576db 3 | 20: 184f82581cdca13a8d80a2080b3c7848 4 | 30: 557ef4a4db6aa3cf8c55d5d2736f8c8f 5 | 40: b2182c82581c321b790bdbb2a5773a2b 6 | 50: 9493974d3e0fa74fdf9a43ce82e449d3 7 | 60: 26031a0098967fff 8 | -------------------------------------------------------------------------------- /core/test/golden/StakesMap: -------------------------------------------------------------------------------- 1 | 00: a3581c321b790bdbb2a5773a2b949397 2 | 10: 4d3e0fa74fdf9a43ce82e449d326031a 3 | 20: 0098967f581c5125b558daa14b5338e9 4 | 30: 04cc2a75a8b7b3a4738de9cb28a68195 5 | 40: 76db184f581cdca13a8d80a2080b3c78 6 | 50: 48557ef4a4db6aa3cf8c55d5d2736f8c 7 | 60: 8fb2182c 8 | -------------------------------------------------------------------------------- /core/test/golden/TimeDiff: -------------------------------------------------------------------------------- 1 | 19128b -------------------------------------------------------------------------------- /core/test/golden/TimeStamp: -------------------------------------------------------------------------------- 1 | 182f -------------------------------------------------------------------------------- /core/test/golden/TxFeePolicy_Linear: -------------------------------------------------------------------------------- 1 | 8200d81846821863190309 -------------------------------------------------------------------------------- /core/test/golden/TxFeePolicy_Unknown: -------------------------------------------------------------------------------- 1 | 00: 821865d81858206a4f38717a61693236 2 | 10: 5a4d5055454a66457931356f78356b4a 3 | 20: 30754b44626937 4 | -------------------------------------------------------------------------------- /core/test/golden/TxSizeLinear: -------------------------------------------------------------------------------- 1 | 821903e7184d -------------------------------------------------------------------------------- /core/test/golden/bi/Address0: -------------------------------------------------------------------------------- 1 | 00: 82d818584683581cabeaaa8f95c4529b 2 | 10: b494e648c2e8e3522713f466a9dec1f1 3 | 20: decea1b7a101582258207447346a6130 4 | 30: 6b466a4f38717a616932365a4d505545 5 | 40: 4a66457931356f78356b001a03f38741 6 | -------------------------------------------------------------------------------- /core/test/golden/bi/Address1: -------------------------------------------------------------------------------- 1 | 00: 82d818582183581caa5372095aaa680d 2 | 10: 19d4ca496983a145709c3be18b0d4c83 3 | 20: cb7bdc5ea0001a32dc988e 4 | -------------------------------------------------------------------------------- /core/test/golden/bi/Address2: -------------------------------------------------------------------------------- 1 | 00: 82d818586983581ce269a51e06c374cb 2 | 10: 7bf5a4d36e6d673560ebfa8f2d0cfac4 3 | 20: 3ed4672ca20058208200581c5125b558 4 | 30: daa14b5338e904cc2a75a8b7b3a4738d 5 | 40: e9cb28a6819576db0158225820366574 6 | 50: 4e6f756958657a4379456a4b63337447 7 | 60: 346a61306b466a4f38717a6169021a28 8 | 70: 7cce6a 9 | -------------------------------------------------------------------------------- /core/test/golden/bi/Address3: -------------------------------------------------------------------------------- 1 | 00: 82d81858e483581c41574eefbf61b89d 2 | 10: 19ddbc68c760dbf2fe59fc386bae1bd9 3 | 20: 87083453a200589b8201a4581c41cad7 4 | 30: 50a98f3ccd30a8d0b641253151de8fd8 5 | 40: 45ee12e6ff44cf899c1b000000e8d4a5 6 | 50: 1000581c5125b558daa14b5338e904cc 7 | 60: 2a75a8b7b3a4738de9cb28a6819576db 8 | 70: 1b00038c831b679369581c67f62c82d6 9 | 80: 3613496ae4a8b2f7461d7a8a5a31cdb4 10 | 90: 961b26a58db04a1b000000123ede4000 11 | a0: 581ca0f124f5f822d9fa2093ede304b6 12 | b0: 43741a980fc1e5c10e8c932560d31a75 13 | c0: db9c970158225820744e6f756958657a 14 | d0: 4379456a4b63337447346a61306b466a 15 | e0: 4f38717a61693236011a3ac2e65f 16 | -------------------------------------------------------------------------------- /core/test/golden/bi/Address4: -------------------------------------------------------------------------------- 1 | 00: 82d818584483581ceb7f1fc78b406264 2 | 10: c7e41bd42648978aaf5ad7c2c8632af7 3 | 20: f1ed7375a10058208200581c5125b558 4 | 30: daa14b5338e904cc2a75a8b7b3a4738d 5 | 40: e9cb28a6819576db071a9c486f4b 6 | -------------------------------------------------------------------------------- /core/test/golden/json/Address0: -------------------------------------------------------------------------------- 1 | "2RhQhCGqYPDpFgTsnBTbnvPvCwpqAkjwLqQkWpkqXbLRmNxd4xNd262nGsr8JiynyKRUeMLSJ9Ntho9i76uvBTrVXdJJG5yiNLb8frmUe5qX7E" -------------------------------------------------------------------------------- /core/test/golden/json/Address1: -------------------------------------------------------------------------------- 1 | "Ae2tdPwUPEZDoUnyXuAgqzhkjNXNJeiZ5nqwprg9sArZmRNjySfJ5uz4FjB" -------------------------------------------------------------------------------- /core/test/golden/json/Address2: -------------------------------------------------------------------------------- 1 | "dRNpRgY7sgwXaGbEZQ7KtFprY5PE3sxejht9kFEKLmSowgUegSinCjx3yuKGHQbRHL2EUP89BuAurEScfrgWxahCjD1M9QKYoTj5KrbR5TDnqBE3oSNx7UcXhrGKM9aau48SASu8i88Sq8hPb3z5K662spTXX" -------------------------------------------------------------------------------- /core/test/golden/json/Address3: -------------------------------------------------------------------------------- 1 | "a2x5MVsL5Pr1SESUZbGb7d64coe2VpRJhEFsYCUHfaimAE3wvmNHd44H7ue1wFx1RqrS9vnAmTVri19FttwaRLWG5L2rLMe1tCSzZ4zJjeUwej8kEX4VmYbL7t7o1rmucebNvz8qGod2s6LKCkAxN6dWVv9jZ3gCkWrNsXq3JeSjaBLPT7RNwSExRmPAwJ6geZmadnKSArbiPjYXkaJa5GQyDUYbni8jCyXmMHB7Qsj1Pgc7qCKA7AebV13kADRv3wSbMgWEAbBrxEmBRnHgXw5Nh6EJ5n7ejVYJAJY3kJ8Q2xisLJxW54Y48BK8a4AW7M3fU" -------------------------------------------------------------------------------- /core/test/golden/json/Address4: -------------------------------------------------------------------------------- 1 | "5FCjkr138i9wjRVwawmYMd4Vc9KxU7TuQhMyjMGpnykg9yb2qMpUCerDFzXvfAJMFgJTHyD7Sn4ybLXm2M6zeWAaWe7ctjq5QjVL427vGRx" -------------------------------------------------------------------------------- /core/test/golden/safecopy/Address'0_Legacy_NoNetworkMagic: -------------------------------------------------------------------------------- 1 | Kmyw4lDSE5S4fSH6etNouiXezCyEjKc3 tG4ja0kFjO8qzai26ZMPUEJfEy15ox5k tG4ja0kFjO8qzai26ZMPUEJfEy15ox5k -------------------------------------------------------------------------------- /core/test/golden/safecopy/Address'1_Legacy_NoNetworkMagic: -------------------------------------------------------------------------------- 1 | Kmyw4lDSE5S4fSH6etNouiXezCyEjKc3 tG4ja0kFjO8qzai26ZMPUEJfEy15ox5k -------------------------------------------------------------------------------- /core/test/golden/safecopy/Address'2_Legacy_NoNetworkMagic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/core/test/golden/safecopy/Address'2_Legacy_NoNetworkMagic -------------------------------------------------------------------------------- /core/test/golden/safecopy/Address'3_Legacy_NoNetworkMagic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/core/test/golden/safecopy/Address'3_Legacy_NoNetworkMagic -------------------------------------------------------------------------------- /core/test/golden/safecopy/Address'4_Legacy_NoNetworkMagic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/core/test/golden/safecopy/Address'4_Legacy_NoNetworkMagic -------------------------------------------------------------------------------- /core/test/golden/safecopy/Address'5_HasNetworkMagic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/core/test/golden/safecopy/Address'5_HasNetworkMagic -------------------------------------------------------------------------------- /core/test/golden/safecopy/Address'6_HasNetworkMagic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/core/test/golden/safecopy/Address'6_HasNetworkMagic -------------------------------------------------------------------------------- /core/test/golden/safecopy/Address'7_HasNetworkMagic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/core/test/golden/safecopy/Address'7_HasNetworkMagic -------------------------------------------------------------------------------- /core/test/golden/safecopy/Address0_Legacy_NoNetworkMagic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/core/test/golden/safecopy/Address0_Legacy_NoNetworkMagic -------------------------------------------------------------------------------- /core/test/golden/safecopy/Address1_Legacy_NoNetworkMagic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/core/test/golden/safecopy/Address1_Legacy_NoNetworkMagic -------------------------------------------------------------------------------- /core/test/golden/safecopy/Address2_Legacy_NoNetworkMagic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/core/test/golden/safecopy/Address2_Legacy_NoNetworkMagic -------------------------------------------------------------------------------- /core/test/golden/safecopy/Address3_Legacy_NoNetworkMagic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/core/test/golden/safecopy/Address3_Legacy_NoNetworkMagic -------------------------------------------------------------------------------- /core/test/golden/safecopy/Address4_Legacy_NoNetworkMagic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/core/test/golden/safecopy/Address4_Legacy_NoNetworkMagic -------------------------------------------------------------------------------- /core/test/golden/safecopy/Address5_HasNetworkMagic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/core/test/golden/safecopy/Address5_HasNetworkMagic -------------------------------------------------------------------------------- /core/test/golden/safecopy/Address6_HasNetworkMagic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/core/test/golden/safecopy/Address6_HasNetworkMagic -------------------------------------------------------------------------------- /core/test/golden/safecopy/Address7_HasNetworkMagic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/core/test/golden/safecopy/Address7_HasNetworkMagic -------------------------------------------------------------------------------- /core/test/test.hs: -------------------------------------------------------------------------------- 1 | import Universum 2 | 3 | import Test.Hspec (hspec) 4 | 5 | import Spec (spec) 6 | 7 | import qualified Test.Pos.Core.Bi 8 | import qualified Test.Pos.Core.Json 9 | import qualified Test.Pos.Core.SafeCopy 10 | import Test.Pos.Util.Tripping (runTests) 11 | 12 | main :: IO () 13 | main = do 14 | hspec spec 15 | runTests 16 | [ Test.Pos.Core.Bi.tests 17 | , Test.Pos.Core.Json.tests 18 | , Test.Pos.Core.SafeCopy.tests 19 | ] 20 | -------------------------------------------------------------------------------- /crypto/Pos/Crypto/Signing.hs: -------------------------------------------------------------------------------- 1 | module Pos.Crypto.Signing 2 | ( module Pos.Crypto.Signing.Check 3 | , module Pos.Crypto.Signing.Redeem 4 | , module Pos.Crypto.Signing.Safe 5 | , module Pos.Crypto.Signing.Signing 6 | , module Pos.Crypto.Signing.Tag 7 | , module Pos.Crypto.Signing.Types 8 | ) where 9 | 10 | import Pos.Crypto.Signing.Check 11 | import Pos.Crypto.Signing.Redeem 12 | import Pos.Crypto.Signing.Safe 13 | import Pos.Crypto.Signing.Signing 14 | import Pos.Crypto.Signing.Tag 15 | import Pos.Crypto.Signing.Types 16 | 17 | -------------------------------------------------------------------------------- /crypto/Pos/Crypto/Signing/Types.hs: -------------------------------------------------------------------------------- 1 | module Pos.Crypto.Signing.Types 2 | ( module Pos.Crypto.Signing.Types.Redeem 3 | , module Pos.Crypto.Signing.Types.Safe 4 | , module Pos.Crypto.Signing.Types.Signing 5 | , module Pos.Crypto.Signing.Types.Tag 6 | ) where 7 | 8 | import Pos.Crypto.Signing.Types.Redeem 9 | import Pos.Crypto.Signing.Types.Safe 10 | import Pos.Crypto.Signing.Types.Signing 11 | import Pos.Crypto.Signing.Types.Tag 12 | -------------------------------------------------------------------------------- /crypto/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /crypto/shell.nix: -------------------------------------------------------------------------------- 1 | let 2 | self = import ../. {}; 3 | in (self.nix-tools.shellFor { 4 | name = "cardano-sl-crypto"; 5 | packages = ps: [ ps.cardano-sl-crypto ps.cabal-install ]; 6 | }) 7 | -------------------------------------------------------------------------------- /crypto/test/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /crypto/test/Spec.hs: -------------------------------------------------------------------------------- 1 | {-# OPTIONS_GHC -F -pgmF hspec-discover -optF --module-name=Spec #-} 2 | -------------------------------------------------------------------------------- /crypto/test/golden/AbstractHash: -------------------------------------------------------------------------------- 1 | 00: 582001f4b788593d4f70de2a45c2e1e8 2 | 10: 7088bfbdfa29577ae1b62aba60e095e3 3 | 20: ab53 4 | -------------------------------------------------------------------------------- /crypto/test/golden/DecShare: -------------------------------------------------------------------------------- 1 | 00: 58610379a7cfbc3c66ad878629f79505 2 | 10: 10f9fd7ac85977306c53f3a6450c0725 3 | 20: d8da31bfc752b92868d6f3276d15a14c 4 | 30: d7b95979d30b32fc33f1f988a149f63b 5 | 40: 6105a540c532f93b8bd26eb85570a3c7 6 | 50: 7a1114942d23a2d9711f23918d4975a7 7 | 60: d46fb7 8 | -------------------------------------------------------------------------------- /crypto/test/golden/EncShare: -------------------------------------------------------------------------------- 1 | 00: 582102d0ca9ebbac514ebfd135172a06 2 | 10: 1e5f0bcf56babbe5781cdcefa1adb71e 3 | 20: dc2588 4 | -------------------------------------------------------------------------------- /crypto/test/golden/EncryptedSecretKey: -------------------------------------------------------------------------------- 1 | 00: 82588053346653483665744e6f756958 2 | 10: 657a4379456a4b63337447346a61306b 3 | 20: 466a4f38717a616932365a4d5055454a 4 | 30: 66457931356f78356b4a30754b446269 5 | 40: 376936644c586b756573565a394a6648 6 | 50: 676a726374734c4674324e766f76586e 7 | 60: 6368734f7658303559364c6f686c544e 8 | 70: 74356d6b504668556f587531455a534a 9 | 80: 544979583831347c387c317c59413d3d 10 | 90: 7c5463492f69436b5a556d3341724a7a 11 | a0: 6a6372774832462f3651674233365469 12 | b0: 4a6e2b67304441626f69514d3d 13 | -------------------------------------------------------------------------------- /crypto/test/golden/HDAddressPayload: -------------------------------------------------------------------------------- 1 | 00: 5238cf895ceba7b457f968dd626e9cee 2 | 10: ee78d4 3 | -------------------------------------------------------------------------------- /crypto/test/golden/PassPhrase: -------------------------------------------------------------------------------- 1 | 00: 582077346c4453453553346653483665 2 | 10: 744e6f756958657a4379456a4b633374 3 | 20: 4734 4 | -------------------------------------------------------------------------------- /crypto/test/golden/ProxyCert: -------------------------------------------------------------------------------- 1 | 00: 5840162821275262c9d020834d7834a6 2 | 10: 7eebb4f5469d3a219d197fb5af7d4723 3 | 20: 78cf22ac5f01bd0c8beee2ef8d6eadff 4 | 30: 02f8324659623d28e7a3f6d71535808c 5 | 40: 9008 6 | -------------------------------------------------------------------------------- /crypto/test/golden/ProxySecretKey: -------------------------------------------------------------------------------- 1 | 00: 84f65840644c586b756573565a394a66 2 | 10: 48676a726374734c4674324e766f7658 3 | 20: 6e6368734f7658303559364c6f686c54 4 | 30: 4e74356d6b504668556f587531455a53 5 | 40: 4a54497958404b6d7977346c44534535 6 | 50: 53346653483665744e6f756958657a43 7 | 60: 79456a4b63337447346a61306b466a4f 8 | 70: 38717a616932365a4d5055454a664579 9 | 80: 31356f78356b5840162821275262c9d0 10 | 90: 20834d7834a67eebb4f5469d3a219d19 11 | a0: 7fb5af7d472378cf22ac5f01bd0c8bee 12 | b0: e2ef8d6eadff02f8324659623d28e7a3 13 | c0: f6d71535808c9008 14 | -------------------------------------------------------------------------------- /crypto/test/golden/PublicKey: -------------------------------------------------------------------------------- 1 | 00: 58404b6d7977346c4453453553346653 2 | 10: 483665744e6f756958657a4379456a4b 3 | 20: 63337447346a61306b466a4f38717a61 4 | 30: 6932365a4d5055454a66457931356f78 5 | 40: 356b 6 | -------------------------------------------------------------------------------- /crypto/test/golden/RedeemPublicKey: -------------------------------------------------------------------------------- 1 | 00: 5820538960a916726b09f05c9d4d4a92 2 | 10: 2b85b4e11acfcc1434673d95019b7a9a 3 | 20: 52d2 4 | -------------------------------------------------------------------------------- /crypto/test/golden/RedeemSecretKey: -------------------------------------------------------------------------------- 1 | 00: 58404b6d7977346c4453453553346653 2 | 10: 483665744e6f756958657a4379456a4b 3 | 20: 6333538960a916726b09f05c9d4d4a92 4 | 30: 2b85b4e11acfcc1434673d95019b7a9a 5 | 40: 52d2 6 | -------------------------------------------------------------------------------- /crypto/test/golden/RedeemSignature: -------------------------------------------------------------------------------- 1 | 00: 584011cf71f75af2d73d3afa61af5cc2 2 | 10: cc53a98704d78b97b7daec06ccf7eb7c 3 | 20: 6607a954f3fda82b80832290c646bf31 4 | 30: 074c15aaef8eacda84b993882088be60 5 | 40: 5701 6 | -------------------------------------------------------------------------------- /crypto/test/golden/Secret: -------------------------------------------------------------------------------- 1 | 00: 582103a889b85070721af446a282e8d2 2 | 10: 3934612eb6ffc7c422f15aa85ad5c072 3 | 20: 267c79 4 | -------------------------------------------------------------------------------- /crypto/test/golden/SecretKey: -------------------------------------------------------------------------------- 1 | 00: 588053346653483665744e6f75695865 2 | 10: 7a4379456a4b63337447346a61306b46 3 | 20: 6a4f38717a616932365a4d5055454a66 4 | 30: 457931356f78356b4a30754b44626937 5 | 40: 6936644c586b756573565a394a664867 6 | 50: 6a726374734c4674324e766f76586e63 7 | 60: 68734f7658303559364c6f686c544e74 8 | 70: 356d6b504668556f587531455a534a54 9 | 80: 4979 10 | -------------------------------------------------------------------------------- /crypto/test/golden/Signature: -------------------------------------------------------------------------------- 1 | 00: 5840b28bf6b4c08892f5b82dc11e9df0 2 | 10: 8c0c4374a8f7e2b2558d42a83ed43ec2 3 | 20: b6b76dabf1293a561971d772d3f96097 4 | 30: f96f40a363b4201616202ef18fe52f27 5 | 40: f806 6 | -------------------------------------------------------------------------------- /crypto/test/golden/Signed: -------------------------------------------------------------------------------- 1 | 00: 82f65840b28bf6b4c08892f5b82dc11e 2 | 10: 9df08c0c4374a8f7e2b2558d42a83ed4 3 | 20: 3ec2b6b76dabf1293a561971d772d3f9 4 | 30: 6097f96f40a363b4201616202ef18fe5 5 | 40: 2f27f806 6 | -------------------------------------------------------------------------------- /crypto/test/golden/VssPublicKey: -------------------------------------------------------------------------------- 1 | 00: 582102294842accb1d76aaa64bc1af23 2 | 10: 1378e1a01a67c0fc8010824caa021097 3 | 20: 0275c4 4 | -------------------------------------------------------------------------------- /crypto/test/golden/WithHash: -------------------------------------------------------------------------------- 1 | 00: 582001f4b788593d4f70de2a45c2e1e8 2 | 10: 7088bfbdfa29577ae1b62aba60e095e3 3 | 20: ab53 4 | -------------------------------------------------------------------------------- /crypto/test/golden/json/ProtocolMagic0_Legacy_HasNetworkMagic: -------------------------------------------------------------------------------- 1 | 31337 -------------------------------------------------------------------------------- /crypto/test/golden/json/ProtocolMagic1_Legacy_HasNetworkMagic: -------------------------------------------------------------------------------- 1 | 2147000001 -------------------------------------------------------------------------------- /crypto/test/golden/json/ProtocolMagic2_Legacy_HasNetworkMagic: -------------------------------------------------------------------------------- 1 | -58952 -------------------------------------------------------------------------------- /crypto/test/golden/json/ProtocolMagic_Legacy_NMMustBeJust: -------------------------------------------------------------------------------- 1 | {"pm":31337,"requiresNetworkMagic":"NMMustBeJust"} -------------------------------------------------------------------------------- /crypto/test/golden/json/ProtocolMagic_Legacy_NMMustBeNothing: -------------------------------------------------------------------------------- 1 | {"pm":-500,"requiresNetworkMagic":"NMMustBeNothing"} -------------------------------------------------------------------------------- /crypto/test/test.hs: -------------------------------------------------------------------------------- 1 | import Universum 2 | 3 | import Test.Hspec (hspec) 4 | 5 | import Spec (spec) 6 | 7 | import qualified Test.Pos.Crypto.Bi 8 | import qualified Test.Pos.Crypto.Json 9 | import Test.Pos.Util.Tripping (runTests) 10 | 11 | main :: IO () 12 | main = do 13 | hspec spec 14 | runTests 15 | [ Test.Pos.Crypto.Bi.tests 16 | , Test.Pos.Crypto.Json.tests 17 | ] 18 | -------------------------------------------------------------------------------- /db/Makefile: -------------------------------------------------------------------------------- 1 | help: ## Print documentation 2 | @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' 3 | 4 | ghcid: ## Run ghcid with the cardano-sl-db package 5 | ghcid \ 6 | --command "stack ghci cardano-sl-db --ghci-options=-fno-code" 7 | 8 | ghcid-test: ## Have ghcid run the test suite on successful recompile 9 | ghcid \ 10 | --command "stack ghci cardano-sl-db:lib cardano-sl-db:test:test --ghci-options=-fobject-code" \ 11 | --test "Main.main" 12 | 13 | .PHONY: ghcid ghcid-test help 14 | -------------------------------------------------------------------------------- /db/NOTICE: -------------------------------------------------------------------------------- 1 | Copyright 2019 Input Output (Hong Kong) Ltd. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /db/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /db/shell.nix: -------------------------------------------------------------------------------- 1 | let 2 | self = import ../. {}; 3 | in (self.nix-tools.shellFor { 4 | name = "cardano-db"; 5 | packages = ps: [ ps.cardano-sl-db ]; 6 | }) 7 | -------------------------------------------------------------------------------- /db/src/Pos/DB/Rocks.hs: -------------------------------------------------------------------------------- 1 | -- | Reexports of "Pos.DB.Rocks.*". 2 | module Pos.DB.Rocks 3 | ( module Pos.DB.Rocks.Functions 4 | , module Pos.DB.Rocks.Types 5 | ) where 6 | import Pos.DB.Rocks.Functions 7 | import Pos.DB.Rocks.Types 8 | -------------------------------------------------------------------------------- /db/src/Pos/DB/Ssc.hs: -------------------------------------------------------------------------------- 1 | module Pos.DB.Ssc 2 | ( module Pos.DB.Ssc.GState 3 | , module Pos.DB.Ssc.Logic 4 | , module Pos.DB.Ssc.SecretStorage 5 | , module Pos.DB.Ssc.State 6 | ) where 7 | 8 | import Pos.DB.Ssc.GState 9 | import Pos.DB.Ssc.Logic 10 | import Pos.DB.Ssc.SecretStorage 11 | import Pos.DB.Ssc.State 12 | -------------------------------------------------------------------------------- /db/src/Pos/DB/Ssc/Logic.hs: -------------------------------------------------------------------------------- 1 | module Pos.DB.Ssc.Logic 2 | ( module Pos.DB.Ssc.Logic.Global 3 | , module Pos.DB.Ssc.Logic.Local 4 | , module Pos.DB.Ssc.Logic.VAR 5 | ) where 6 | 7 | import Pos.DB.Ssc.Logic.Global 8 | import Pos.DB.Ssc.Logic.Local 9 | import Pos.DB.Ssc.Logic.VAR 10 | -------------------------------------------------------------------------------- /db/src/Pos/DB/Txp.hs: -------------------------------------------------------------------------------- 1 | -- | LRC DB stores leaders and richmen, i. e. data computed by LRC. 2 | 3 | module Pos.DB.Txp 4 | ( module Pos.DB.Txp.Logic 5 | , module Pos.DB.Txp.MemState 6 | , module Pos.DB.Txp.Settings 7 | , module Pos.DB.Txp.Stakes 8 | , module Pos.DB.Txp.Utxo 9 | ) where 10 | 11 | import Pos.DB.Txp.Logic 12 | import Pos.DB.Txp.MemState 13 | import Pos.DB.Txp.Settings 14 | import Pos.DB.Txp.Stakes 15 | import Pos.DB.Txp.Utxo 16 | -------------------------------------------------------------------------------- /db/src/Pos/DB/Txp/Logic.hs: -------------------------------------------------------------------------------- 1 | -- Pos.DB.Txp.Logic 2 | module Pos.DB.Txp.Logic 3 | ( module Pos.DB.Txp.Logic.Common 4 | , module Pos.DB.Txp.Logic.Global 5 | , module Pos.DB.Txp.Logic.Local 6 | ) where 7 | 8 | import Pos.DB.Txp.Logic.Common 9 | import Pos.DB.Txp.Logic.Global 10 | import Pos.DB.Txp.Logic.Local 11 | -------------------------------------------------------------------------------- /db/src/Pos/DB/Txp/MemState.hs: -------------------------------------------------------------------------------- 1 | -- Pos.Chain.Txp.Memstate 2 | module Pos.DB.Txp.MemState 3 | ( module Pos.DB.Txp.MemState.Class 4 | , module Pos.DB.Txp.MemState.Holder 5 | , module Pos.DB.Txp.MemState.Metrics 6 | , module Pos.DB.Txp.MemState.Types 7 | ) where 8 | 9 | import Pos.DB.Txp.MemState.Class 10 | import Pos.DB.Txp.MemState.Holder 11 | import Pos.DB.Txp.MemState.Metrics 12 | import Pos.DB.Txp.MemState.Types 13 | -------------------------------------------------------------------------------- /db/src/Pos/DB/Update/Logic.hs: -------------------------------------------------------------------------------- 1 | -- | Major logic of Update System (US). 2 | 3 | module Pos.DB.Update.Logic 4 | ( module Pos.DB.Update.Logic.Global 5 | , module Pos.DB.Update.Logic.Local 6 | ) where 7 | 8 | import Pos.DB.Update.Logic.Global 9 | import Pos.DB.Update.Logic.Local 10 | -------------------------------------------------------------------------------- /db/src/Pos/DB/Update/MemState.hs: -------------------------------------------------------------------------------- 1 | -- | In-memory state of Update System. 2 | 3 | module Pos.DB.Update.MemState 4 | ( module Pos.DB.Update.MemState.Functions 5 | , module Pos.DB.Update.MemState.Types 6 | ) where 7 | 8 | import Pos.DB.Update.MemState.Functions 9 | import Pos.DB.Update.MemState.Types 10 | -------------------------------------------------------------------------------- /db/test/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /db/test/Test/Pos/DB/Update/Arbitrary.hs: -------------------------------------------------------------------------------- 1 | {-# OPTIONS_GHC -Wno-unused-imports #-} 2 | {-# OPTIONS_GHC -Wno-dodgy-exports #-} 3 | 4 | module Test.Pos.DB.Update.Arbitrary 5 | ( module Test.Pos.DB.Update.Arbitrary.Poll 6 | , module Test.Pos.DB.Update.Arbitrary.MemState 7 | ) where 8 | 9 | import Test.Pos.DB.Update.Arbitrary.MemState 10 | import Test.Pos.DB.Update.Arbitrary.Poll 11 | -------------------------------------------------------------------------------- /db/test/test.hs: -------------------------------------------------------------------------------- 1 | import Universum 2 | 3 | import qualified Test.Pos.DB.Block.Logic.SplitByEpoch 4 | import qualified Test.Pos.DB.Epoch.Index 5 | import qualified Test.Pos.DB.Functions 6 | import qualified Test.Pos.DB.Update.Poll.Logic.Version 7 | import Test.Pos.Util.Tripping (runTests) 8 | 9 | main :: IO () 10 | main = runTests [ Test.Pos.DB.Epoch.Index.tests 11 | , Test.Pos.DB.Functions.tests 12 | , Test.Pos.DB.Update.Poll.Logic.Version.tests 13 | , Test.Pos.DB.Block.Logic.SplitByEpoch.tests 14 | ] 15 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | ## Internal Technical Documentation 2 | 3 | Official documentation for Cardano SL can be found at [cardanodocs.com](https://cardanodocs.com/). 4 | 5 | The purpose of this directory is to store our **internal** developers-oriented technical documentation. 6 | -------------------------------------------------------------------------------- /docs/block-processing/us-bv-states.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/docs/block-processing/us-bv-states.png -------------------------------------------------------------------------------- /docs/block-processing/us-proposal-states.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/docs/block-processing/us-proposal-states.png -------------------------------------------------------------------------------- /docs/how-to/README.md: -------------------------------------------------------------------------------- 1 | ## How-To 2 | 3 | This directory contains short manuals with step-by-step instructions for common tasks. 4 | -------------------------------------------------------------------------------- /docs/network/example-topologies/behind-nat-no-dns.yaml: -------------------------------------------------------------------------------- 1 | wallet: 2 | relays: [[{"addr": "10.0.0.1"},{"addr": "10.0.0.2", "port": 1234}]] 3 | -------------------------------------------------------------------------------- /docs/network/example-topologies/behind-nat-with-dns.yaml: -------------------------------------------------------------------------------- 1 | wallet: 2 | relays: [[{"host": "domain1"},{"host": "domain2", "port": 1234}]] 3 | valency: 3 # optional 4 | fallbacks: 2 # optional 5 | -------------------------------------------------------------------------------- /docs/network/example-topologies/mainnet-staging.yaml: -------------------------------------------------------------------------------- 1 | # Topology for connecting to the mainnet-staging cluster. 2 | 3 | wallet: 4 | relays: [[{ host: relays.awstest.iohkdev.io }]] 5 | valency: 1 6 | fallbacks: 7 7 | -------------------------------------------------------------------------------- /docs/network/example-topologies/p2p.yaml: -------------------------------------------------------------------------------- 1 | p2p: 2 | variant: normal 3 | valency: 3 4 | fallbacks: 1 5 | -------------------------------------------------------------------------------- /docs/network/example-topologies/static-no-dns.yaml: -------------------------------------------------------------------------------- 1 | nodes: 2 | "node0": 3 | type: core 4 | region: undefined 5 | static-routes: [["node1"], ["node2"]] 6 | addr: 127.0.0.1 7 | port: 3000 8 | "node1": 9 | type: core 10 | region: undefined 11 | static-routes: [["node0"], ["node2"]] 12 | addr: 127.0.0.1 13 | port: 3001 14 | "node2": 15 | type: core 16 | region: undefined 17 | static-routes: [["node0"], ["node1"]] 18 | addr: 127.0.0.1 19 | # default port 20 | -------------------------------------------------------------------------------- /docs/network/example-topologies/static-with-dns.yaml: -------------------------------------------------------------------------------- 1 | nodes: 2 | node0: 3 | type: core 4 | region: eu-central-1 5 | static-routes: [["node1"], ["node2"]] 6 | host: node0.local 7 | # default port 8 | node1: 9 | type: core 10 | region: eu-west-1 11 | static-routes: [["node0"], ["node2"]] 12 | addr: 12.34.56.78 13 | # default port 14 | node2: 15 | type: relay 16 | region: eu-west-2 17 | static-routes: [["node0"], ["node1"]] 18 | # uses 'node2' as the hostname 19 | port: 3000 20 | kademlia: true 21 | -------------------------------------------------------------------------------- /docs/network/example-topologies/traditional.yaml: -------------------------------------------------------------------------------- 1 | p2p: 2 | variant: traditional 3 | valency: 3 4 | fallbacks: 1 5 | -------------------------------------------------------------------------------- /docs/network/shelley/UI.md: -------------------------------------------------------------------------------- 1 | From slack: 2 | Duncan Coutts @alexvieth a couple extra minor requirements that the UI folks would like: how many peers we're connected to, and what bandwidth we're getting from the block cache layer during a blockchain sync operation. 3 | -------------------------------------------------------------------------------- /docs/on-the-wire/Makefile: -------------------------------------------------------------------------------- 1 | # See `./latexmkrc` for latexmk configuration 2 | LATEX = latexmk 3 | PVC = -pvc 4 | 5 | F.tex = $(wildcard *.tex) 6 | F.pdf = $(F.tex:%.tex=%.pdf) $(F.lhs:%.lhs=%.pdf) 7 | F = $(F.tex:%.tex=%) $(F.lhs:%.lhs=%) 8 | 9 | .PHONY: default 10 | default: all 11 | 12 | .PHONY: all 13 | all: $(F.pdf) 14 | 15 | %.pdf: %.tex 16 | $(LATEX) $< 17 | 18 | $(F): 19 | $(LATEX) $(PVC) -use-make $@.tex 20 | -------------------------------------------------------------------------------- /docs/on-the-wire/latexmkrc: -------------------------------------------------------------------------------- 1 | $pdf_mode = "1"; 2 | $pdflatex = "xelatex --shell-escape -halt-on-error -synctex=1"; 3 | $clean_ext = "bbl synctex.gz synctex.gz(busy)"; 4 | 5 | # When a file required for the compilation of the main latex file 6 | # (such as an image for `\includegraphics`) latexmk will call `make` 7 | # in order to have it built. 8 | $use_make_for_missing_files = "1"; 9 | -------------------------------------------------------------------------------- /docs/rules/.gitignore: -------------------------------------------------------------------------------- 1 | ## Generated pdf files 2 | *.pdf 3 | 4 | ## Latex 5 | *.aux 6 | *.fdb_latexmk 7 | *.fls 8 | *.log 9 | *.out 10 | 11 | ## other specific Latex 12 | *.lof 13 | *.lol 14 | *.lot 15 | *.synctex.gz 16 | *.toc 17 | *.vrb 18 | *.ptb 19 | _region_.tex 20 | 21 | ## Bibtex 22 | *.bbl 23 | *.blg 24 | 25 | ## Beamer 26 | *.nav 27 | *.snm 28 | 29 | ## Minted/Pygments 30 | /_minted* 31 | -------------------------------------------------------------------------------- /docs/rules/Makefile: -------------------------------------------------------------------------------- 1 | # See `./latexmkrc` for latexmk configuration 2 | LATEX = latexmk 3 | PVC = -pvc 4 | 5 | F.tex = $(wildcard *.tex) 6 | F.pdf = $(F.tex:%.tex=%.pdf) $(F.lhs:%.lhs=%.pdf) 7 | F = $(F.tex:%.tex=%) $(F.lhs:%.lhs=%) 8 | 9 | .PHONY: default 10 | default: all 11 | 12 | .PHONY: all 13 | all: $(F.pdf) 14 | 15 | %.pdf: %.tex 16 | $(LATEX) $< 17 | 18 | $(F): 19 | $(LATEX) $(PVC) -use-make $@.tex 20 | -------------------------------------------------------------------------------- /docs/rules/latexmkrc: -------------------------------------------------------------------------------- 1 | $pdf_mode = "1"; 2 | $pdflatex = "xelatex --shell-escape -halt-on-error -synctex=1"; 3 | $clean_ext = "bbl synctex.gz synctex.gz(busy)"; 4 | 5 | # When a file required for the compilation of the main latex file 6 | # (such as an image for `\includegraphics`) latexmk will call `make` 7 | # in order to have it built. 8 | $use_make_for_missing_files = "1"; 9 | -------------------------------------------------------------------------------- /explorer/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # Unless a later match takes precedence, @akegalj will be requested 2 | # for review when someone opens a pull request. 3 | 4 | * @akegalj 5 | 6 | # Order is important; the last matching pattern takes the most precedence. 7 | 8 | *.purs @sectore 9 | frontend/ @sectore 10 | 11 | src/ @ksaric 12 | src/Pos/Explorer/Socket/ @martoon 13 | test/ @ksaric 14 | -------------------------------------------------------------------------------- /explorer/Makefile: -------------------------------------------------------------------------------- 1 | help: ## Print documentation 2 | @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' 3 | 4 | ghcid: ## Run ghcid with the cardano-sl-explorer package 5 | ghcid \ 6 | --command "stack ghci cardano-sl-explorer --ghci-options=-fno-code" 7 | 8 | ghcid-test: ## Have ghcid run the test suite on successful recompile 9 | ghcid \ 10 | --command "stack ghci cardano-sl-explorer:lib cardano-sl-explorer:test:cardano-explorer-test --ghci-options=-fobject-code" \ 11 | --test "Main.main" 12 | 13 | .PHONY: ghcid ghcid-test help 14 | -------------------------------------------------------------------------------- /explorer/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | # PR 2 | 3 | --- 4 | 5 | Youtrack issue URL - **LINK** 6 | 7 | --- 8 | 9 | Short description - **DESCRIBE** 10 | 11 | --- 12 | 13 | How did I test this new functionality/bug fix? 14 | 15 | 1. branch I used 16 | 2. how did I run the project - was it on _DEV_, _TESTNET_, something else? 17 | 3. steps to reproduce the new behaviour, if I have additional tests, please write them down 18 | 19 | --- 20 | 21 | - [ ] PR was tested, and is linted. 22 | 23 | -------------------------------------------------------------------------------- /explorer/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /explorer/bench/Main.hs: -------------------------------------------------------------------------------- 1 | module Main 2 | ( main 3 | ) where 4 | 5 | import Universum 6 | 7 | import System.IO (hSetEncoding, stdout, utf8) 8 | 9 | import qualified Bench.Pos.Explorer.ServerBench as SB 10 | 11 | -- stack bench cardano-sl-explorer 12 | main :: IO () 13 | main = do 14 | hSetEncoding stdout utf8 15 | 16 | SB.runTimeBenchmark 17 | -- SB.runSpaceBenchmark 18 | -------------------------------------------------------------------------------- /explorer/frontend/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | bower_components 3 | dist 4 | output 5 | .DS_Store 6 | typings 7 | npm-debug.log 8 | package-lock.json 9 | .psc-ide-port 10 | .psci_modules 11 | # generated backend types + lenses 12 | src/Generated/* 13 | # generated lenses 14 | src/Data/Time/Lenses/* 15 | src/Explorer/I18n/Lenses.purs 16 | src/Explorer/Lenses/* 17 | src/Explorer/View/Lenses/* 18 | -------------------------------------------------------------------------------- /explorer/frontend/.gitmodules: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/explorer/frontend/.gitmodules -------------------------------------------------------------------------------- /explorer/frontend/nix/shell.nix: -------------------------------------------------------------------------------- 1 | let 2 | localLib = import ../../../lib.nix; 3 | in 4 | { system ? builtins.currentSystem 5 | , config ? {} 6 | , pkgs ? (import (localLib.nixpkgs) { inherit system config; }) 7 | }: 8 | 9 | let 10 | ghc = pkgs.haskellPackages.ghcWithPackages (ps: [ps.turtle ps.universum]); 11 | 12 | in 13 | # This is an environment for running the frontend deps regeneration script. 14 | pkgs.stdenv.mkDerivation { 15 | name = "explorer-frontend-shell"; 16 | buildInputs = with pkgs; [ nodePackages.bower2nix ghc coreutils ]; 17 | shellHook = "eval $(egrep ^export ${ghc}/bin/ghc)"; 18 | src = null; 19 | } 20 | -------------------------------------------------------------------------------- /explorer/frontend/scripts/build-explorer-frontend.sh: -------------------------------------------------------------------------------- 1 | rm -rf .psci_modules/ .pulp-cache/ node_modules/ bower_components/ output/ 2 | yarn install 3 | ./scripts/generate-explorer-lenses.sh 4 | yarn build:prod 5 | echo "Done generating explorer purescript frontend." 6 | -------------------------------------------------------------------------------- /explorer/frontend/src/Explorer/I18n/Lang.js: -------------------------------------------------------------------------------- 1 | 2 | // -- Based on https://github.com/input-output-hk/vending-application/blob/master/web-client/src/Data/I18N.js 3 | 4 | exports.detectLocaleImpl = function() { 5 | return window.navigator.languages ? 6 | window.navigator.languages[0] : 7 | window.navigator.language || window.navigator.userLanguage; 8 | } 9 | -------------------------------------------------------------------------------- /explorer/frontend/src/Explorer/Images.purs: -------------------------------------------------------------------------------- 1 | module Explorer.Images where 2 | 3 | import Prelude ((<>)) 4 | 5 | imagePath :: String -> String 6 | imagePath = (<>) "/images/" 7 | 8 | examplePath :: String 9 | examplePath = imagePath "any-image.jpg" 10 | -------------------------------------------------------------------------------- /explorer/frontend/src/Explorer/Types/App.purs: -------------------------------------------------------------------------------- 1 | module Explorer.Types.App where 2 | 3 | import Control.Monad.Eff.Console (CONSOLE) 4 | import Control.Monad.Eff.Now (NOW) 5 | import Control.SocketIO.Client (SocketIO) 6 | import DOM (DOM) 7 | import DOM.HTML.Types (HISTORY) 8 | import Network.HTTP.Affjax (AJAX) 9 | import Waypoints (WAYPOINT) 10 | 11 | type AppEffects eff = 12 | ( dom :: DOM 13 | , ajax :: AJAX 14 | , socket :: SocketIO 15 | , now :: NOW 16 | , waypoint :: WAYPOINT 17 | , history :: HISTORY 18 | , console :: CONSOLE 19 | | eff 20 | ) 21 | -------------------------------------------------------------------------------- /explorer/frontend/src/Explorer/Util/Config.js: -------------------------------------------------------------------------------- 1 | exports.versionImpl = $VERSION; // set by webpack 2 | exports.commitHashImpl = $COMMIT_HASH; // set by webpack 3 | exports.isProductionImpl = $PRODUCTION; // set by webpack 4 | -------------------------------------------------------------------------------- /explorer/frontend/src/Explorer/Util/DOM.js: -------------------------------------------------------------------------------- 1 | 2 | exports.scrollTopImpl = function() { 3 | return window.scrollTo(0, 0); 4 | } 5 | 6 | exports.classList = function (element) { 7 | return function () { 8 | return element.classList; 9 | }; 10 | }; 11 | 12 | exports.addClassImpl = function(clazzList, clazz) { 13 | return clazzList.add(clazz); 14 | } 15 | 16 | exports.removeClassImpl = function(clazzList, clazz) { 17 | return clazzList.remove(clazz); 18 | } 19 | -------------------------------------------------------------------------------- /explorer/frontend/src/Explorer/Util/String.js: -------------------------------------------------------------------------------- 1 | 2 | // Based on sformat by underscore.string 3 | // https://github.com/prantlf/underscore.string/blob/sformat/lib/underscore.string.js#L192 4 | exports.substituteImpl = function(str) { 5 | return function(args) { 6 | return str.replace(/\{\{|\}\}|\{(\d+)\}/g, function (match, group) { 7 | var value = args[parseInt(group, 10)]; 8 | return value ? value.toString() : ""; 9 | }); 10 | }; 11 | }; 12 | -------------------------------------------------------------------------------- /explorer/frontend/src/Explorer/View/Dashboard/Types.purs: -------------------------------------------------------------------------------- 1 | module Explorer.View.Dashboard.Types where 2 | 3 | import Data.Maybe (Maybe) 4 | import Explorer.Types.Actions (Action) 5 | 6 | 7 | newtype HeaderOptions = HeaderOptions 8 | { headline :: String 9 | , link :: Maybe HeaderLink 10 | } 11 | 12 | newtype HeaderLink = HeaderLink 13 | { label :: String 14 | , action :: Action 15 | } 16 | -------------------------------------------------------------------------------- /explorer/frontend/src/Explorer/View/Playground.purs: -------------------------------------------------------------------------------- 1 | module Explorer.View.Playground where 2 | 3 | import Prelude 4 | 5 | import Explorer.Types.Actions (Action) 6 | import Explorer.Types.State (State) 7 | import Pux.DOM.HTML (HTML) as P 8 | import Text.Smolder.HTML (div) as S 9 | import Text.Smolder.HTML.Attributes (className) as S 10 | import Text.Smolder.Markup ((!)) 11 | import Text.Smolder.Markup (text) as S 12 | 13 | playgroundView :: State -> P.HTML Action 14 | playgroundView state = 15 | S.div ! S.className "explorer-calculator" 16 | $ S.div ! S.className "explorer-calculator__container" 17 | $ S.text "" 18 | -------------------------------------------------------------------------------- /explorer/frontend/src/Explorer/View/calculator.css: -------------------------------------------------------------------------------- 1 | 2 | .explorer-calculator { 3 | background-color: var(--color4); 4 | 5 | &__container { 6 | @extend .outer-container; 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /explorer/frontend/src/Lib/Waypoints/Waypoints.js: -------------------------------------------------------------------------------- 1 | require('@noframework.waypoints'); 2 | 3 | exports.waypointImpl = function (elementId, callback, offset) { 4 | return new Waypoint({ 5 | element: document.getElementById(elementId), 6 | handler: function(direction) { 7 | callback(direction)(); 8 | }, 9 | offset: offset 10 | }); 11 | } 12 | 13 | exports.destroyImpl = function (waypoint) { 14 | return waypoint.destroy(); 15 | } 16 | -------------------------------------------------------------------------------- /explorer/frontend/src/index.js: -------------------------------------------------------------------------------- 1 | // styles 2 | import './index.css'; 3 | // app 4 | import Main from './Main.purs'; 5 | import {initialState} from './Explorer/State.purs'; 6 | 7 | // HMR 8 | if(module.hot) { 9 | var main = Main.main(window.__puxLastState || initialState)() 10 | main.state.subscribe(function (state) { 11 | window.__puxLastState = state; 12 | }); 13 | module.hot.accept(); 14 | } else { 15 | Main.main(initialState)(); 16 | } 17 | -------------------------------------------------------------------------------- /explorer/frontend/src/index.tpl.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Cardano Blockchain Explorer 6 | 7 | 8 | 9 | 10 | 13 | 14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /explorer/frontend/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/explorer/frontend/static/favicon.ico -------------------------------------------------------------------------------- /explorer/frontend/static/fonts/Montserrat-ExtraBold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/explorer/frontend/static/fonts/Montserrat-ExtraBold.otf -------------------------------------------------------------------------------- /explorer/frontend/static/fonts/Montserrat-ExtraLight.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/explorer/frontend/static/fonts/Montserrat-ExtraLight.otf -------------------------------------------------------------------------------- /explorer/frontend/static/fonts/Montserrat-Medium.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/explorer/frontend/static/fonts/Montserrat-Medium.otf -------------------------------------------------------------------------------- /explorer/frontend/static/fonts/Montserrat-SemiBold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/explorer/frontend/static/fonts/Montserrat-SemiBold.otf -------------------------------------------------------------------------------- /explorer/frontend/static/fonts/Montserrat-Thin.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/explorer/frontend/static/fonts/Montserrat-Thin.otf -------------------------------------------------------------------------------- /explorer/frontend/static/fonts/MontserratAlternates-Black.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/explorer/frontend/static/fonts/MontserratAlternates-Black.otf -------------------------------------------------------------------------------- /explorer/frontend/static/fonts/MontserratAlternates-Bold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/explorer/frontend/static/fonts/MontserratAlternates-Bold.otf -------------------------------------------------------------------------------- /explorer/frontend/static/fonts/MontserratAlternates-ExtraBold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/explorer/frontend/static/fonts/MontserratAlternates-ExtraBold.otf -------------------------------------------------------------------------------- /explorer/frontend/static/fonts/MontserratAlternates-ExtraLight.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/explorer/frontend/static/fonts/MontserratAlternates-ExtraLight.otf -------------------------------------------------------------------------------- /explorer/frontend/static/fonts/MontserratAlternates-Light.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/explorer/frontend/static/fonts/MontserratAlternates-Light.otf -------------------------------------------------------------------------------- /explorer/frontend/static/fonts/MontserratAlternates-Medium.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/explorer/frontend/static/fonts/MontserratAlternates-Medium.otf -------------------------------------------------------------------------------- /explorer/frontend/static/fonts/MontserratAlternates-Regular.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/explorer/frontend/static/fonts/MontserratAlternates-Regular.otf -------------------------------------------------------------------------------- /explorer/frontend/static/fonts/MontserratAlternates-SemiBold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/explorer/frontend/static/fonts/MontserratAlternates-SemiBold.otf -------------------------------------------------------------------------------- /explorer/frontend/static/fonts/MontserratAlternates-Thin.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/explorer/frontend/static/fonts/MontserratAlternates-Thin.otf -------------------------------------------------------------------------------- /explorer/frontend/static/fonts/montserrat-black_[allfont.ru].ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/explorer/frontend/static/fonts/montserrat-black_[allfont.ru].ttf -------------------------------------------------------------------------------- /explorer/frontend/static/fonts/montserrat-bold_[allfont.ru].ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/explorer/frontend/static/fonts/montserrat-bold_[allfont.ru].ttf -------------------------------------------------------------------------------- /explorer/frontend/static/fonts/montserrat-hairline_[allfont.ru].ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/explorer/frontend/static/fonts/montserrat-hairline_[allfont.ru].ttf -------------------------------------------------------------------------------- /explorer/frontend/static/fonts/montserrat-light_[allfont.ru].ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/explorer/frontend/static/fonts/montserrat-light_[allfont.ru].ttf -------------------------------------------------------------------------------- /explorer/frontend/static/fonts/montserrat_[allfont.ru].ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/explorer/frontend/static/fonts/montserrat_[allfont.ru].ttf -------------------------------------------------------------------------------- /explorer/frontend/static/images/arrow-up.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /explorer/frontend/static/images/header_300517.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/explorer/frontend/static/images/header_300517.jpg -------------------------------------------------------------------------------- /explorer/frontend/static/images/icon-cross.svg: -------------------------------------------------------------------------------- 1 | 2 | 453C10ED-A8D9-4AA9-BC7C-B4885F94A321 3 | 4 | 5 | -------------------------------------------------------------------------------- /explorer/frontend/static/images/icon-lang-de.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /explorer/frontend/static/images/icon-lang-ja.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /explorer/frontend/static/images/icon-menu.svg: -------------------------------------------------------------------------------- 1 | 2 | 2084171A-1988-4FFF-AE90-C04B51F95A2C 3 | 4 | 5 | -------------------------------------------------------------------------------- /explorer/frontend/static/images/triangle-right.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /explorer/log-config.yaml: -------------------------------------------------------------------------------- 1 | rotation: 2 | logLimit: 5242880 # 5MB 3 | keepFiles: 20 4 | severity: Debug 5 | file: explorer-node.log 6 | node: 7 | plugin: 8 | notifier: 9 | severity: Debug 10 | file: explorer.log 11 | socket-io: 12 | severity: Debug 13 | file: socket-io.log 14 | drop: 15 | severity: Error 16 | 17 | -------------------------------------------------------------------------------- /explorer/python-api/README.md: -------------------------------------------------------------------------------- 1 | # Explorer Python API 2 | -------------------------------------------------------------------------------- /explorer/python-api/app.py: -------------------------------------------------------------------------------- 1 | from explorer_python_api import app 2 | -------------------------------------------------------------------------------- /explorer/python-api/explorer_python_api/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/explorer/python-api/explorer_python_api/__init__.py -------------------------------------------------------------------------------- /explorer/scripts/build.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | stack --nix build --fast --ghc-options="-j +RTS -A128m -n2m -RTS" 3 | -------------------------------------------------------------------------------- /explorer/src/Pos/Explorer/Core.hs: -------------------------------------------------------------------------------- 1 | -- | Core of explorer. 2 | 3 | module Pos.Explorer.Core 4 | ( module Pos.Explorer.Core.Types 5 | ) where 6 | 7 | import Pos.Explorer.Core.Types 8 | -------------------------------------------------------------------------------- /explorer/src/Pos/Explorer/Socket.hs: -------------------------------------------------------------------------------- 1 | -- | Web API parts of cardano-explorer 2 | 3 | module Pos.Explorer.Socket 4 | ( module Socket 5 | ) where 6 | 7 | import Pos.Explorer.Socket.App as Socket 8 | import Pos.Explorer.Socket.Methods as Socket 9 | import Pos.Explorer.Socket.Util as Socket 10 | -------------------------------------------------------------------------------- /explorer/src/Pos/Explorer/Txp.hs: -------------------------------------------------------------------------------- 1 | -- | Explorer's Txp. 2 | 3 | module Pos.Explorer.Txp 4 | ( module Pos.Explorer.Txp.Global 5 | , module Pos.Explorer.Txp.Local 6 | , module Pos.Explorer.Txp.Toil 7 | ) where 8 | 9 | import Pos.Explorer.Txp.Global 10 | import Pos.Explorer.Txp.Local 11 | import Pos.Explorer.Txp.Toil 12 | -------------------------------------------------------------------------------- /explorer/src/Pos/Explorer/Txp/Toil.hs: -------------------------------------------------------------------------------- 1 | -- | Explorer's toil. 2 | 3 | module Pos.Explorer.Txp.Toil 4 | ( module Pos.Explorer.Txp.Toil.Logic 5 | , module Pos.Explorer.Txp.Toil.Monad 6 | , module Pos.Explorer.Txp.Toil.Types 7 | ) where 8 | 9 | import Pos.Explorer.Txp.Toil.Logic 10 | import Pos.Explorer.Txp.Toil.Monad 11 | import Pos.Explorer.Txp.Toil.Types 12 | -------------------------------------------------------------------------------- /explorer/src/Pos/Explorer/Web.hs: -------------------------------------------------------------------------------- 1 | -- | Web API parts of cardano-explorer 2 | 3 | module Pos.Explorer.Web 4 | ( module Web 5 | ) where 6 | 7 | import Pos.Explorer.Web.Server as Web 8 | import Pos.Explorer.Web.Transform as Web 9 | -------------------------------------------------------------------------------- /explorer/src/Pos/Explorer/Web/Error.hs: -------------------------------------------------------------------------------- 1 | -- | Types describing runtime errors related to Explorer 2 | 3 | module Pos.Explorer.Web.Error 4 | ( ExplorerError (..) 5 | ) where 6 | 7 | import Formatting (bprint, stext, (%)) 8 | import qualified Formatting.Buildable 9 | import Universum 10 | 11 | newtype ExplorerError = 12 | -- | Some internal error. 13 | Internal Text 14 | deriving (Show, Generic) 15 | 16 | instance Exception ExplorerError 17 | 18 | instance Buildable ExplorerError where 19 | build (Internal msg) = bprint ("Internal explorer error ("%stext%")") msg 20 | -------------------------------------------------------------------------------- /explorer/src/purescript/PSTypes.hs: -------------------------------------------------------------------------------- 1 | module PSTypes 2 | ( psPosixTime 3 | ) where 4 | 5 | import Language.PureScript.Bridge.TypeInfo (PSType, TypeInfo (..)) 6 | 7 | psPosixTime :: PSType 8 | psPosixTime = TypeInfo "" "Data.Time.NominalDiffTime" "NominalDiffTime" [] 9 | -------------------------------------------------------------------------------- /explorer/start-dev.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Remove logs 4 | rm ./*.log 5 | 6 | # Optional path for `cardano-sl` 7 | cardano_path=${1:-../} 8 | 9 | date=$(date +%s) 10 | export system_start=$((date + 1)) 11 | 12 | ./scripts/run.sh "$cardano_path"/scripts/common-functions.sh & PIDEX=$! 13 | WALLET_TEST=1 "$cardano_path"/scripts/launch/demo-with-wallet-api.sh & PIDNODE=$! 14 | 15 | wait $PIDEX 16 | wait $PIDNODE 17 | -------------------------------------------------------------------------------- /explorer/test/Spec.hs: -------------------------------------------------------------------------------- 1 | {-# OPTIONS_GHC -F -pgmF hspec-discover -optF --module-name=Spec #-} 2 | -------------------------------------------------------------------------------- /explorer/test/Test.hs: -------------------------------------------------------------------------------- 1 | import Universum 2 | 3 | import Spec (spec) 4 | import Test.Hspec (hspec) 5 | 6 | main :: IO () 7 | main = hspec spec 8 | -------------------------------------------------------------------------------- /explorer/test/Test/Pos/Explorer/Arbitrary.hs: -------------------------------------------------------------------------------- 1 | {-# OPTIONS_GHC -fno-warn-orphans #-} 2 | 3 | -- | Arbitrary instances for Explorer types. 4 | 5 | module Test.Pos.Explorer.Arbitrary () where 6 | 7 | import Test.QuickCheck (Arbitrary (..)) 8 | import Test.QuickCheck.Arbitrary.Generic (genericArbitrary, 9 | genericShrink) 10 | 11 | import Pos.Explorer.Core (TxExtra (..)) 12 | 13 | import Test.Pos.Chain.Txp.Arbitrary () 14 | import Test.Pos.Core.Arbitrary () 15 | 16 | instance Arbitrary TxExtra where 17 | arbitrary = genericArbitrary 18 | shrink = genericShrink 19 | -------------------------------------------------------------------------------- /explorer/test/Test/Pos/Explorer/Identity/BinarySpec.hs: -------------------------------------------------------------------------------- 1 | -- | This module tests Binary instances for 'Pos.Explorer' types. 2 | 3 | module Test.Pos.Explorer.Identity.BinarySpec 4 | ( spec 5 | ) where 6 | 7 | import Universum 8 | 9 | import Test.Hspec (Spec, describe) 10 | 11 | import Pos.Explorer.Core (TxExtra) 12 | 13 | import Test.Pos.Binary.Helpers (binaryTest) 14 | import Test.Pos.Explorer.Arbitrary () 15 | 16 | spec :: Spec 17 | spec = describe "Explorer types" $ do 18 | describe "Bi instances" $ do 19 | binaryTest @TxExtra 20 | -------------------------------------------------------------------------------- /faucet/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /faucet/logging.cfg: -------------------------------------------------------------------------------- 1 | termSeveritiesErr: All 2 | loggerTree: 3 | severity: Info+ # severities for «root» logger 4 | withdraw: # logger named «new-logger» 5 | severity: Debug+ # severities for logger «new-logger» 6 | -------------------------------------------------------------------------------- /faucet/test/captcha-resp-err.json: -------------------------------------------------------------------------------- 1 | { 2 | "success": false, 3 | "error-codes": ["error"] 4 | } 5 | -------------------------------------------------------------------------------- /faucet/test/captcha-resp-ok.json: -------------------------------------------------------------------------------- 1 | { 2 | "success": true, 3 | "challenge_ts": "2018-06-01T00:00:00Z", 4 | "hostname": "test", 5 | "error-codes": [] 6 | } 7 | -------------------------------------------------------------------------------- /faucet/test/multi-line-secret.txt: -------------------------------------------------------------------------------- 1 | one 2 | two 3 | -------------------------------------------------------------------------------- /faucet/test/valid-secret.txt: -------------------------------------------------------------------------------- 1 | test 2 | -------------------------------------------------------------------------------- /faucet/wallet-source.json.template: -------------------------------------------------------------------------------- 1 | { 2 | "wallet-id": "XXX" 3 | , "account-index": 1111 4 | , "spending-password": "XXX" 5 | } 6 | -------------------------------------------------------------------------------- /generator/Makefile: -------------------------------------------------------------------------------- 1 | help: ## Print documentation 2 | @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' 3 | 4 | ghcid: ## Run ghcid with the cardano-sl-generator package 5 | ghcid \ 6 | --command "stack ghci cardano-sl-generator --ghci-options=-fno-code" 7 | 8 | ghcid-test: ## Have ghcid run the test suite on successful recompile 9 | ghcid \ 10 | --command "stack ghci cardano-sl-generator:lib cardano-sl-generator:test:cardano-generator-test --ghci-options=-fobject-code" \ 11 | --test "Main.main" 12 | 13 | .PHONY: ghcid ghcid-test help 14 | -------------------------------------------------------------------------------- /generator/README.md: -------------------------------------------------------------------------------- 1 | # cardano-sl-generator 2 | 3 | This package defines types and functions to generate random but valid blocks 4 | for Cardano SL. 5 | -------------------------------------------------------------------------------- /generator/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /generator/bench/Main.hs: -------------------------------------------------------------------------------- 1 | module Main 2 | ( main 3 | ) where 4 | 5 | import Universum 6 | 7 | import System.IO (hSetEncoding, stdout, utf8) 8 | 9 | import qualified Bench.Pos.Criterion.Block.Logic as L 10 | 11 | main :: IO () 12 | main = do 13 | hSetEncoding stdout utf8 14 | L.runBenchmark 15 | -------------------------------------------------------------------------------- /generator/src/Pos/Generator.hs: -------------------------------------------------------------------------------- 1 | -- | Generators of arbitrary data. 2 | 3 | module Pos.Generator 4 | ( module Pos.Generator.BlockEvent 5 | , module Pos.Generator.BlockEvent.DSL 6 | , module Pos.Generator.Block 7 | ) 8 | where 9 | 10 | import Pos.Generator.Block 11 | import Pos.Generator.BlockEvent 12 | import Pos.Generator.BlockEvent.DSL 13 | -------------------------------------------------------------------------------- /generator/src/Pos/Generator/Block/Orphans.hs: -------------------------------------------------------------------------------- 1 | {-# OPTIONS_GHC -fno-warn-orphans #-} 2 | 3 | module Pos.Generator.Block.Orphans 4 | ( 5 | ) where 6 | 7 | import Universum 8 | 9 | import qualified Control.Monad.Catch as UnsafeExc 10 | import Control.Monad.Random.Strict (RandT) 11 | 12 | instance MonadThrow m => MonadThrow (RandT g m) where 13 | throwM = lift . UnsafeExc.throwM 14 | -------------------------------------------------------------------------------- /generator/test/Spec.hs: -------------------------------------------------------------------------------- 1 | {-# OPTIONS_GHC -F -pgmF hspec-discover -optF --module-name=Spec #-} 2 | -------------------------------------------------------------------------------- /generator/test/Test.hs: -------------------------------------------------------------------------------- 1 | import Universum 2 | 3 | import Test.Hspec (hspec, parallel) 4 | 5 | import Spec (spec) 6 | import Test.Pos.Configuration (defaultTestConf) 7 | import Test.Pos.Util.Parallel.Parallelize (parallelizeAllCores) 8 | 9 | main :: IO () 10 | main = do 11 | parallelizeAllCores 12 | putText $ "default configuration: " <> show defaultTestConf 13 | hspec $ parallel spec 14 | -------------------------------------------------------------------------------- /infra/Makefile: -------------------------------------------------------------------------------- 1 | help: ## Print documentation 2 | @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' 3 | 4 | ghcid: ## Run ghcid with the cardano-sl-infra package 5 | ghcid \ 6 | --command "stack ghci cardano-sl-infra --ghci-options=-fno-code" 7 | 8 | ghcid-test: ## Have ghcid run the test suite on successful recompile 9 | ghcid \ 10 | --command "stack ghci cardano-sl-infra:lib cardano-sl-infra:test:test --ghci-options=-fobject-code" \ 11 | --test "Main.main" 12 | 13 | .PHONY: ghcid ghcid-test help 14 | -------------------------------------------------------------------------------- /infra/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /infra/default.nix: -------------------------------------------------------------------------------- 1 | # Running `nix-shell` on this file puts you in an environment where all the 2 | # dependencies needed to work on this package using `Cabal` are available. 3 | # 4 | # Running `nix-build` builds this package. 5 | let 6 | drv = nixpkgs.cardano-sl-infra; 7 | nixpkgs = import ../. {}; 8 | in 9 | if nixpkgs.pkgs.lib.inNixShell 10 | then drv.env 11 | else drv 12 | -------------------------------------------------------------------------------- /infra/shell.nix: -------------------------------------------------------------------------------- 1 | let 2 | self = import ../. {}; 3 | in (self.nix-tools.shellFor { 4 | name = "cardano-infra"; 5 | packages = ps: [ ps.cardano-sl-infra ]; 6 | }) 7 | -------------------------------------------------------------------------------- /infra/src/Pos/Infra/Communication/Constants.hs: -------------------------------------------------------------------------------- 1 | module Pos.Infra.Communication.Constants 2 | ( maxReqSize 3 | , maxMempoolMsgSize 4 | , maxInvSize 5 | ) where 6 | 7 | import Universum 8 | 9 | maxReqSize :: Word32 10 | maxReqSize = 102 11 | 12 | maxMempoolMsgSize :: Word32 13 | maxMempoolMsgSize = 100 14 | 15 | maxInvSize :: Word32 16 | maxInvSize = 102 17 | -------------------------------------------------------------------------------- /infra/src/Pos/Infra/Communication/Relay.hs: -------------------------------------------------------------------------------- 1 | module Pos.Infra.Communication.Relay 2 | ( module Pos.Infra.Communication.Relay.Class 3 | , module Pos.Infra.Communication.Relay.Logic 4 | , module Pos.Infra.Communication.Relay.Types 5 | , module Pos.Infra.Communication.Relay.Util 6 | ) where 7 | 8 | import Pos.Infra.Communication.Relay.Class 9 | import Pos.Infra.Communication.Relay.Logic 10 | import Pos.Infra.Communication.Relay.Types 11 | import Pos.Infra.Communication.Relay.Util 12 | -------------------------------------------------------------------------------- /infra/src/Pos/Infra/Discovery.hs: -------------------------------------------------------------------------------- 1 | module Pos.Infra.Discovery 2 | ( module Pos.Infra.Discovery.Model.Class 3 | , module Pos.Infra.Discovery.Model.Neighbours 4 | ) where 5 | 6 | import Pos.Infra.Discovery.Model.Class 7 | import Pos.Infra.Discovery.Model.Neighbours 8 | -------------------------------------------------------------------------------- /infra/src/Pos/Infra/HealthCheck/Route53.hs: -------------------------------------------------------------------------------- 1 | module Pos.Infra.HealthCheck.Route53 2 | ( route53HealthCheckOption 3 | ) where 4 | 5 | import qualified Options.Applicative as Opt 6 | import Pos.Core.NetworkAddress (NetworkAddress, addrParser) 7 | import Pos.Util.OptParse (fromParsec) 8 | import Universum 9 | 10 | route53HealthCheckOption :: Opt.Parser NetworkAddress 11 | route53HealthCheckOption = Opt.option (fromParsec addrParser) $ 12 | Opt.long "route53-health-check" <> 13 | Opt.metavar "IP:PORT" <> 14 | Opt.help "Host and port for the Route53 DNS health check." 15 | -------------------------------------------------------------------------------- /infra/src/Pos/Infra/Recovery/Types.hs: -------------------------------------------------------------------------------- 1 | module Pos.Infra.Recovery.Types 2 | ( RecoveryHeaderTag 3 | , RecoveryHeader 4 | ) where 5 | 6 | import Control.Concurrent.STM (TMVar) 7 | 8 | import Pos.Chain.Block (BlockHeader) 9 | import Pos.Infra.Communication.Types.Protocol (NodeId) 10 | 11 | data RecoveryHeaderTag 12 | 13 | type RecoveryHeader = TMVar (NodeId, BlockHeader) 14 | -------------------------------------------------------------------------------- /infra/src/Pos/Infra/Reporting.hs: -------------------------------------------------------------------------------- 1 | -- | Reexports of error reporting functionality 2 | 3 | module Pos.Infra.Reporting 4 | ( module X 5 | ) where 6 | 7 | import Pos.Infra.Reporting.Ekg as X 8 | import Pos.Infra.Reporting.Exceptions as X 9 | import Pos.Infra.Reporting.Http as X 10 | import Pos.Infra.Reporting.Methods as X 11 | import Pos.Infra.Reporting.NodeInfo as X 12 | import Pos.Infra.Reporting.Statsd as X 13 | import Pos.Infra.Reporting.Wlog as X 14 | -------------------------------------------------------------------------------- /infra/src/Pos/Infra/Reporting/Health/Types.hs: -------------------------------------------------------------------------------- 1 | -- | Types relevant to health reporting. 2 | 3 | module Pos.Infra.Reporting.Health.Types 4 | ( HealthStatus (..) 5 | ) where 6 | 7 | import Data.Text (Text) 8 | 9 | data HealthStatus = HSHealthy Text | HSUnhealthy Text 10 | -------------------------------------------------------------------------------- /infra/src/Pos/Infra/Shutdown.hs: -------------------------------------------------------------------------------- 1 | module Pos.Infra.Shutdown 2 | ( module Pos.Infra.Shutdown.Class 3 | , module Pos.Infra.Shutdown.Logic 4 | , module Pos.Infra.Shutdown.Types 5 | ) where 6 | 7 | import Pos.Infra.Shutdown.Class 8 | import Pos.Infra.Shutdown.Logic 9 | import Pos.Infra.Shutdown.Types 10 | -------------------------------------------------------------------------------- /infra/src/Pos/Infra/Shutdown/Class.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE TypeFamilies #-} 2 | 3 | module Pos.Infra.Shutdown.Class 4 | ( HasShutdownContext(..) 5 | ) where 6 | 7 | import Universum 8 | 9 | import Control.Lens.Lens (lens) 10 | import Pos.Infra.Shutdown.Types (ShutdownContext) 11 | 12 | class HasShutdownContext ctx where 13 | shutdownContext :: Lens' ctx ShutdownContext 14 | 15 | instance HasShutdownContext ShutdownContext where 16 | shutdownContext = lens identity (\_ x -> x) 17 | -------------------------------------------------------------------------------- /infra/src/Pos/Infra/Slotting.hs: -------------------------------------------------------------------------------- 1 | -- | Slotting functionality. 2 | 3 | module Pos.Infra.Slotting 4 | ( module Pos.Infra.Slotting.Class 5 | , module Pos.Infra.Slotting.Error 6 | , module Pos.Infra.Slotting.Impl 7 | , module Pos.Core.Slotting 8 | , module Pos.Infra.Slotting.Util 9 | ) where 10 | 11 | import Pos.Core.Slotting 12 | import Pos.Infra.Slotting.Class 13 | import Pos.Infra.Slotting.Error 14 | import Pos.Infra.Slotting.Impl 15 | import Pos.Infra.Slotting.Util 16 | -------------------------------------------------------------------------------- /infra/src/Pos/Infra/Slotting/Class.hs: -------------------------------------------------------------------------------- 1 | module Pos.Infra.Slotting.Class 2 | ( module X 3 | ) where 4 | 5 | import Pos.Core.Slotting as X 6 | -------------------------------------------------------------------------------- /infra/src/Pos/Infra/Slotting/Impl.hs: -------------------------------------------------------------------------------- 1 | -- | This module re-exports slotting implementations. 2 | 3 | module Pos.Infra.Slotting.Impl 4 | ( module Pos.Infra.Slotting.Impl.Simple 5 | , module Pos.Infra.Slotting.Impl.Util 6 | ) where 7 | 8 | import Pos.Infra.Slotting.Impl.Simple 9 | import Pos.Infra.Slotting.Impl.Util 10 | -------------------------------------------------------------------------------- /infra/src/Pos/Infra/Slotting/Types.hs: -------------------------------------------------------------------------------- 1 | module Pos.Infra.Slotting.Types 2 | ( module X 3 | ) where 4 | 5 | import Pos.Core.Slotting as X 6 | -------------------------------------------------------------------------------- /infra/src/Pos/Infra/StateLock.hs: -------------------------------------------------------------------------------- 1 | module Pos.Infra.StateLock 2 | ( module X 3 | ) where 4 | 5 | import Pos.DB.GState.Lock as X 6 | -------------------------------------------------------------------------------- /infra/src/Pos/Infra/Statistics.hs: -------------------------------------------------------------------------------- 1 | -- | Implementation of statistics gathering and processing utilities. 2 | 3 | module Pos.Infra.Statistics 4 | ( module Pos.Infra.Statistics.Ekg 5 | , module Pos.Infra.Statistics.Statsd 6 | ) where 7 | 8 | import Pos.Infra.Statistics.Ekg 9 | import Pos.Infra.Statistics.Statsd 10 | -------------------------------------------------------------------------------- /infra/src/Pos/Infra/Util/LogSafe.hs: -------------------------------------------------------------------------------- 1 | module Pos.Infra.Util.LogSafe 2 | ( module X 3 | ) where 4 | 5 | import Pos.Core.Util.LogSafe as X 6 | -------------------------------------------------------------------------------- /infra/src/Pos/Infra/Util/TimeLimit.hs: -------------------------------------------------------------------------------- 1 | module Pos.Infra.Util.TimeLimit 2 | ( module X 3 | ) where 4 | 5 | import Pos.Core.Util.TimeLimit as X 6 | -------------------------------------------------------------------------------- /infra/test/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /infra/test/Spec.hs: -------------------------------------------------------------------------------- 1 | module Spec 2 | ( spec 3 | ) where 4 | 5 | import Prelude 6 | import Test.Hspec 7 | import qualified Test.Pos.Infra.Diffusion.Subscription.StatusSpec (spec) 8 | import qualified Test.Pos.Infra.Diffusion.Subscription.SubscriptionSpec (spec) 9 | 10 | spec :: Spec 11 | spec = describe "Subscription" $ do 12 | Test.Pos.Infra.Diffusion.Subscription.StatusSpec.spec 13 | Test.Pos.Infra.Diffusion.Subscription.SubscriptionSpec.spec 14 | -------------------------------------------------------------------------------- /infra/test/Test/Pos/Infra/Arbitrary/Slotting.hs: -------------------------------------------------------------------------------- 1 | module Test.Pos.Infra.Arbitrary.Slotting () where 2 | 3 | import Test.Pos.Core.Arbitrary.Slotting () 4 | -------------------------------------------------------------------------------- /infra/test/golden/HandlerSpec_ConvHandler: -------------------------------------------------------------------------------- 1 | 8200d81843193cc1 -------------------------------------------------------------------------------- /infra/test/golden/HandlerSpec_UnknownHandler: -------------------------------------------------------------------------------- 1 | 821868d81849c3b8553dc3a8c2a709 -------------------------------------------------------------------------------- /infra/test/golden/NodeMetadata: -------------------------------------------------------------------------------- 1 | {"fallbacks":1,"static-routes":[["YBQX"],["iXAP0JNYwx"],["c5"],["9YWMZZMcXA"],["QCQeWoFE"],["Mh4N3zyduO"],["JXSlSLRV"]],"kademlia":true,"dynamic-subscribe":[],"valency":2,"region":"4WM8","host":"BTemPBYBLBxVdLLzugXEdLfNHOICYZEXsmLGUUVnLvVitDZixHVJBXeJbAddwugsFhFXSFxxdzJWRkwpySNAlLhrxHsyfQdLmrmkBmGWsiiuFMuwpIdDRwdRXK","type":"core","maxSubscrs":null,"port":6732,"public":true} -------------------------------------------------------------------------------- /infra/test/golden/TopologyBehindNAT: -------------------------------------------------------------------------------- 1 | {"wallet":{"fallbacks":50,"valency":42,"relays":[[{"addr":"185.255.111.139","port":65413}],[{"host":"QGrCxCYPaqJgFFympdkGamCUQSsTWv","port":53415}],[{"host":"wcrSGCKclFbbZUnTypSGJnvZcOlGTdVgWuAfUiUKFDtKEGfPcQKWSFfZbTbgPAKewXbXaGcqdFSdDYqsbyKQZIBlUcxNqonGMVIEYBiM","port":19071}]]}} -------------------------------------------------------------------------------- /infra/test/golden/TopologyP2P: -------------------------------------------------------------------------------- 1 | {"p2p":{"fallbacks":50,"variant":"normal","valency":42,"maxSubscrs":100}} -------------------------------------------------------------------------------- /infra/test/golden/TopologyStatic: -------------------------------------------------------------------------------- 1 | {"nodes":{"m1ZDkWY":{"fallbacks":1,"static-routes":[["TOORKIKeT"],["7fm"],["eue2vV1hi"],["mFFL"],["84v"],["8N"],["xBD75E"],["Yd78Fb"]],"kademlia":true,"dynamic-subscribe":[],"valency":1,"region":"4XKfn3F2N","host":"ekKxWFhuqyvriOtsMUMQfUkhffLkpd","type":"core","maxSubscrs":null,"port":16071,"public":false}}} -------------------------------------------------------------------------------- /infra/test/golden/TopologyTraditional: -------------------------------------------------------------------------------- 1 | {"p2p":{"fallbacks":50,"variant":"traditional","valency":42,"maxSubscrs":100}} -------------------------------------------------------------------------------- /infra/test/test.hs: -------------------------------------------------------------------------------- 1 | import Prelude (IO) 2 | 3 | import Test.Hspec (hspec) 4 | 5 | import Spec (spec) 6 | import qualified Test.Pos.Infra.Bi 7 | import qualified Test.Pos.Infra.Json 8 | import Test.Pos.Util.Tripping (runTests) 9 | 10 | main :: IO () 11 | main = do 12 | hspec spec 13 | runTests 14 | [ Test.Pos.Infra.Bi.tests 15 | , Test.Pos.Infra.Json.tests 16 | ] 17 | -------------------------------------------------------------------------------- /lib/Makefile: -------------------------------------------------------------------------------- 1 | help: ## Print documentation 2 | @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' 3 | 4 | ghcid: ## Run ghcid with the cardano-sl package 5 | ghcid \ 6 | --command "stack ghci cardano-sl --ghci-options=-fno-code" 7 | 8 | ghcid-test: ## Have ghcid run the test suite on successful recompile 9 | ghcid \ 10 | --command "stack ghci cardano-sl:lib cardano-sl:test:cardano-test --ghci-options=-fobject-code" \ 11 | --test "main" 12 | 13 | .PHONY: ghcid ghcid-test help 14 | 15 | -------------------------------------------------------------------------------- /lib/NOTICE: -------------------------------------------------------------------------------- 1 | Copyright 2019 Input Output (Hong Kong) Ltd. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /lib/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /lib/bench/Local/Criterion.hs: -------------------------------------------------------------------------------- 1 | module Main 2 | ( main 3 | ) where 4 | 5 | import Universum 6 | 7 | import System.IO (hSetEncoding, stdout, utf8) 8 | 9 | import qualified Bench.Pos.Criterion.FollowTheSatoshiBench as FTS 10 | import qualified Bench.Pos.Criterion.TxSigningBench as TS 11 | import qualified Bench.Pos.Diffusion.BlockDownload as BD 12 | 13 | main :: IO () 14 | main = do 15 | hSetEncoding stdout utf8 16 | FTS.runBenchmark 17 | TS.runBenchmark 18 | BD.runBenchmark 19 | -------------------------------------------------------------------------------- /lib/default.nix: -------------------------------------------------------------------------------- 1 | # Running `nix-shell` on this file puts you in an environment where all the 2 | # dependencies needed to work on this package using `Cabal` are available. 3 | # 4 | # Running `nix-build` builds this package. 5 | let 6 | drv = nixpkgs.cardano-sl; 7 | nixpkgs = import ../. {}; 8 | in 9 | if nixpkgs.pkgs.lib.inNixShell 10 | then drv.env 11 | else drv 12 | -------------------------------------------------------------------------------- /lib/shell.nix: -------------------------------------------------------------------------------- 1 | let 2 | self = import ../. {}; 3 | in (self.nix-tools.shellFor { 4 | name = "cardano-lib"; 5 | packages = ps: [ ps.cardano-sl ]; 6 | }) 7 | -------------------------------------------------------------------------------- /lib/src/Pos/Binary.hs: -------------------------------------------------------------------------------- 1 | -- | Reexports of Pos.Binary.* classes 2 | 3 | module Pos.Binary 4 | ( 5 | module Pos.Binary.Class 6 | ) where 7 | 8 | import Pos.Binary.Class 9 | import Pos.Binary.Communication () 10 | -------------------------------------------------------------------------------- /lib/src/Pos/Client/CLI.hs: -------------------------------------------------------------------------------- 1 | 2 | module Pos.Client.CLI 3 | ( module Pos.Client.CLI.NodeOptions 4 | , module Pos.Client.CLI.Options 5 | , module Pos.Client.CLI.Params 6 | , module Pos.Client.CLI.Secrets 7 | , module Pos.Client.CLI.Util 8 | ) where 9 | 10 | import Pos.Client.CLI.NodeOptions 11 | import Pos.Client.CLI.Options 12 | import Pos.Client.CLI.Params 13 | import Pos.Client.CLI.Secrets 14 | import Pos.Client.CLI.Util 15 | -------------------------------------------------------------------------------- /lib/src/Pos/Communication.hs: -------------------------------------------------------------------------------- 1 | -- | Re-exports of Pos.Communication.* 2 | 3 | module Pos.Communication 4 | ( module M 5 | ) where 6 | 7 | import Pos.Communication.Limits as M 8 | import Pos.Communication.Server as M 9 | import Pos.Communication.Types as M 10 | import Pos.Infra.Communication.BiP as M 11 | import Pos.Infra.Communication.Listener as M 12 | import Pos.Infra.Communication.Protocol as M 13 | import Pos.Infra.Communication.Relay as M 14 | import Pos.Infra.Communication.Specs as M 15 | -------------------------------------------------------------------------------- /lib/src/Pos/Communication/Server.hs: -------------------------------------------------------------------------------- 1 | -- | Server part. 2 | 3 | module Pos.Communication.Server 4 | ( serverLoggerName 5 | ) where 6 | 7 | import Pos.Util.Wlog (LoggerName) 8 | 9 | -- | Logger name for server. 10 | serverLoggerName :: LoggerName 11 | serverLoggerName = "server" 12 | -------------------------------------------------------------------------------- /lib/src/Pos/Communication/Types.hs: -------------------------------------------------------------------------------- 1 | -- | Types used for communication. 2 | 3 | module Pos.Communication.Types 4 | ( -- * Messages and socket state 5 | module Pos.Infra.Communication.Types.Protocol 6 | , module Pos.Infra.Communication.Types.Relay 7 | ) where 8 | 9 | import Pos.Infra.Communication.Types.Protocol 10 | import Pos.Infra.Communication.Types.Relay 11 | -------------------------------------------------------------------------------- /lib/src/Pos/Constants.hs: -------------------------------------------------------------------------------- 1 | {-| Constants used by algorithm. See paper for more details. 2 | -} 3 | 4 | module Pos.Constants 5 | ( 6 | module Pos.Core.Constants 7 | , module Pos.Chain.Genesis 8 | , module Pos.Chain.Update 9 | ) where 10 | 11 | -- Reexports 12 | import Pos.Chain.Genesis 13 | import Pos.Chain.Update 14 | import Pos.Core.Constants 15 | -------------------------------------------------------------------------------- /lib/src/Pos/Context.hs: -------------------------------------------------------------------------------- 1 | -- | Re-exports of Pos.Context.* functionality. 2 | 3 | module Pos.Context 4 | ( module Pos.Context.Context 5 | , module Pos.Core.Context 6 | , module Pos.Infra.Recovery.Info 7 | ) where 8 | 9 | import Pos.Context.Context 10 | import Pos.Core.Context 11 | import Pos.Infra.Recovery.Info 12 | -------------------------------------------------------------------------------- /lib/src/Pos/Recovery.hs: -------------------------------------------------------------------------------- 1 | -- | Information about recovery/synchronization status. 2 | 3 | module Pos.Recovery 4 | ( module Pos.Infra.Recovery.Info 5 | ) where 6 | 7 | import Pos.Infra.Recovery.Info 8 | -------------------------------------------------------------------------------- /lib/src/Pos/Recovery/Types.hs: -------------------------------------------------------------------------------- 1 | 2 | module Pos.Recovery.Types 3 | ( MonadRecoveryHeader 4 | ) where 5 | 6 | import Universum 7 | 8 | import Pos.Infra.Recovery.Types (RecoveryHeader, RecoveryHeaderTag) 9 | import Pos.Util.Util (HasLens (..)) 10 | 11 | type MonadRecoveryHeader ctx m 12 | = (MonadReader ctx m, HasLens RecoveryHeaderTag ctx RecoveryHeader) 13 | -------------------------------------------------------------------------------- /lib/src/Pos/Web.hs: -------------------------------------------------------------------------------- 1 | -- | Web-related part of cardano-sl. 2 | 3 | module Pos.Web 4 | ( module Pos.Web.Api 5 | , module Pos.Web.Mode 6 | , module Pos.Web.Server 7 | , module Pos.Web.Types 8 | ) where 9 | 10 | import Pos.Web.Api 11 | import Pos.Web.Mode 12 | import Pos.Web.Server 13 | import Pos.Web.Types 14 | -------------------------------------------------------------------------------- /lib/test/Spec.hs: -------------------------------------------------------------------------------- 1 | {-# OPTIONS_GHC -F -pgmF hspec-discover -optF --module-name=Spec #-} 2 | -------------------------------------------------------------------------------- /lib/test/Test.hs: -------------------------------------------------------------------------------- 1 | import Universum 2 | 3 | import Test.Hspec (hspec) 4 | 5 | import Spec (spec) 6 | 7 | import Test.Pos.Configuration (defaultTestConf) 8 | import qualified Test.Pos.Launcher.Configuration 9 | import qualified Test.Pos.Launcher.Json 10 | import Test.Pos.Util.Tripping (runTests) 11 | 12 | main :: IO () 13 | main = do 14 | putText $ "default configuration: " <> show defaultTestConf 15 | hspec spec 16 | runTests [ Test.Pos.Launcher.Json.tests 17 | , Test.Pos.Launcher.Configuration.tests 18 | ] 19 | -------------------------------------------------------------------------------- /lib/test/Test/Pos/Types/Identity/ShowReadSpec.hs: -------------------------------------------------------------------------------- 1 | -- | This module tests Show/Read instances. 2 | 3 | module Test.Pos.Types.Identity.ShowReadSpec 4 | ( spec 5 | ) where 6 | 7 | import Universum 8 | 9 | import Pos.Core (Timestamp (..)) 10 | import Test.Hspec (Spec, describe) 11 | 12 | import Test.Pos.Binary.Helpers (showReadTest) 13 | import Test.Pos.Core.Arbitrary () 14 | 15 | spec :: Spec 16 | spec = describe "Types" $ do 17 | describe "Show/Read instances" $ do 18 | showReadTest @Timestamp 19 | -------------------------------------------------------------------------------- /log-configs/cluster.yaml: -------------------------------------------------------------------------------- 1 | # This config is used by cluster nodes (core, relay, explorer) 2 | 3 | rotation: 4 | logLimit: 16777216 5 | keepFiles: 20 6 | 7 | loggerTree: 8 | severity: Debug+ 9 | 10 | handlers: 11 | - { name: "JSON" 12 | , filepath: "node.json" 13 | , logsafety: SecretLogLevel 14 | , severity: Debug+ 15 | , backend: FileJsonBE } 16 | 17 | -------------------------------------------------------------------------------- /log-configs/daedalus.yaml: -------------------------------------------------------------------------------- 1 | # This config is used by Daedalus (in production). 2 | 3 | rotation: 4 | logLimit: 5242880 # 5MB 5 | keepFiles: 10 6 | loggerTree: 7 | severity: Info+ 8 | cardano-sl.syncWalletWorker: Error+ 9 | files: 10 | - node 11 | 12 | handlers: 13 | - { name: "JSON" 14 | , filepath: "pub/node.json" 15 | , logsafety: PublicLogLevel 16 | , severity: Info 17 | , backend: FileJsonBE } 18 | 19 | -------------------------------------------------------------------------------- /log-configs/greppable.yaml: -------------------------------------------------------------------------------- 1 | # This template is used to grep the output. 2 | # It's used only for developers' needs. 3 | 4 | termSeveritiesOut: All 5 | -------------------------------------------------------------------------------- /log-configs/template-demo.yaml: -------------------------------------------------------------------------------- 1 | # This template is used in local demo. 2 | 3 | rotation: 4 | logLimit: 104857600 # 100 MB 5 | keepFiles: 20 6 | loggerTree: 7 | severity: Debug+ 8 | file: tmpFileName 9 | handlers: 10 | - { name: "json" 11 | , filepath: "tmpFileName.json" 12 | , logsafety: PublicLogLevel 13 | , severity: Debug 14 | , backend: FileJsonBE } 15 | -------------------------------------------------------------------------------- /mnemonic/README.md: -------------------------------------------------------------------------------- 1 | # Cardano-SL-Mnemonic 2 | 3 | Custom Mnemonic module, previously located in cardano-wallet 4 | 5 | It includes an executable too: 6 | ```shell 7 | $ stack exec cardano-sl-generate-mnemonic 8 | ["squirrel","material","silly","twice","direct","slush","pistol","razor","become","junk","kingdom","flee"] 9 | ``` 10 | -------------------------------------------------------------------------------- /mnemonic/test/Main.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | import Universum 4 | 5 | import Test.Hspec 6 | 7 | import qualified Cardano.MnemonicSpec 8 | 9 | 10 | main :: IO () 11 | main = hspec $ do 12 | Cardano.MnemonicSpec.spec 13 | -------------------------------------------------------------------------------- /networking/bench/calc-template.ods: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/networking/bench/calc-template.ods -------------------------------------------------------------------------------- /networking/bench/logging.yaml: -------------------------------------------------------------------------------- 1 | severity: Warning 2 | sender: 3 | severity: Info 4 | comm: 5 | severity: Error 6 | receiver: 7 | severity: Info 8 | comm: 9 | severity: Error 10 | 11 | -------------------------------------------------------------------------------- /networking/test/Spec.hs: -------------------------------------------------------------------------------- 1 | {-# OPTIONS_GHC -F -pgmF hspec-discover -optF --module-name=Spec #-} 2 | -------------------------------------------------------------------------------- /networking/test/Test.hs: -------------------------------------------------------------------------------- 1 | import Spec (spec) 2 | import Test.Hspec (hspec) 3 | 4 | main :: IO () 5 | main = hspec spec 6 | -------------------------------------------------------------------------------- /nix/cardano-sl-config.nix: -------------------------------------------------------------------------------- 1 | { runCommand }: 2 | 3 | runCommand "cardano-sl-config" {} '' 4 | mkdir -p $out/lib 5 | cp -R ${../log-configs} $out/log-configs 6 | cp ${../lib}/configuration.yaml $out/lib 7 | cp ${../lib}/*genesis*.json $out/lib 8 | '' 9 | -------------------------------------------------------------------------------- /nix/iohk-binary-cache.nix: -------------------------------------------------------------------------------- 1 | # This is a sample NixOS configuration file which you can import into 2 | # your own configuration.nix in order to enable the IOHK binary cache. 3 | 4 | { config, lib, pkgs, ... }: 5 | 6 | { 7 | nix = { 8 | binaryCachePublicKeys = [ "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" ]; 9 | binaryCaches = [ "https://hydra.iohk.io" ]; 10 | }; 11 | } 12 | -------------------------------------------------------------------------------- /nix/iohk-common.nix: -------------------------------------------------------------------------------- 1 | # Imports the iohk-nix library. 2 | # The version can be overridden for debugging purposes by setting 3 | # NIX_PATH=iohk_nix=/path/to/iohk-nix 4 | import ( 5 | let try = builtins.tryEval ; 6 | in if try.success 7 | then builtins.trace "using host " try.value 8 | else 9 | let 10 | spec = builtins.fromJSON (builtins.readFile ./iohk-nix-src.json); 11 | in builtins.fetchTarball { 12 | url = "${spec.url}/archive/${spec.rev}.tar.gz"; 13 | inherit (spec) sha256; 14 | }) {} 15 | -------------------------------------------------------------------------------- /nix/iohk-nix-src.json: -------------------------------------------------------------------------------- 1 | { 2 | "url": "https://github.com/input-output-hk/iohk-nix", 3 | "rev": "0c0c2b69d44d067ef0fee60a95bcd06ecfdea53c", 4 | "date": "2019-08-19T13:42:41-04:00", 5 | "sha256": "0h716win6biipy37k5xx4br5v6vx1kpi8kixrg8iwrm72c7p3v74", 6 | "fetchSubmodules": false 7 | } 8 | -------------------------------------------------------------------------------- /nix/nix-tools.nix: -------------------------------------------------------------------------------- 1 | { ... }@args: 2 | 3 | let 4 | commonLib = import ./iohk-common.nix; 5 | 6 | in commonLib.nix-tools.default-nix ./pkgs.nix args 7 | -------------------------------------------------------------------------------- /nix/patches/cardano-sl.patch: -------------------------------------------------------------------------------- 1 | diff --git a/src/Pos/Util/Config.hs b/src/Pos/Util/Config.hs 2 | index 2450b4e0a9..801a12928e 100644 3 | --- a/src/Pos/Util/Config.hs 4 | +++ b/src/Pos/Util/Config.hs 5 | @@ -38,7 +38,7 @@ embedYamlObject name marker parser = do 6 | Just dir -> return (dir name) 7 | Nothing -> error $ toText $ 8 | "Could not find " ++ marker ++ " for path: " ++ srcFP 9 | - TH.qAddDependentFile path 10 | + -- TH.qAddDependentFile path 11 | TH.runIO (Y.decodeFileEither path) >>= \case 12 | Right x -> parser x 13 | Left err -> templateHaskellError $ 14 | -------------------------------------------------------------------------------- /nix/regenerate.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -euo pipefail 4 | 5 | 6 | exec "$(nix-build "$(dirname "$0")/iohk-common.nix" -A nix-tools.regeneratePackages --no-out-link --option substituters "https://hydra.iohk.io https://cache.nixos.org" --option trusted-substituters "" --option trusted-public-keys "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=")" 7 | -------------------------------------------------------------------------------- /nix/tests/swaggerSchemaValidation.nix: -------------------------------------------------------------------------------- 1 | { writeScript, cardanoWallet, validateJson }: 2 | 3 | let 4 | generate-swagger-file = "${cardanoWallet}/bin/cardano-generate-swagger-file"; 5 | validate-json = "${validateJson}/bin/validate_json"; 6 | schema = ./../../tools/src/validate-json/swagger-meta-2.0.json; 7 | in writeScript "validate-swagger-schema" '' 8 | ${generate-swagger-file} --target wallet@v1 --output-file swagger.v1.json 9 | ${validate-json} --schema ${schema} swagger.v1.json 10 | EXIT_STATUS=$? 11 | rm -f swagger.*.json 12 | exit $EXIT_STATUS 13 | '' 14 | -------------------------------------------------------------------------------- /nix/update-iohk-nix.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env nix-shell 2 | #!nix-shell -A devops ../shell.nix -i bash 3 | niv update iohk-nix 4 | -------------------------------------------------------------------------------- /nixos-tests/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | walletAPI = import ./wallet-api.nix; 3 | } 4 | -------------------------------------------------------------------------------- /node-ipc/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /node-ipc/shell.nix: -------------------------------------------------------------------------------- 1 | { commonLib ? import ../lib.nix 2 | , iohkPkgs ? import ../. {} 3 | , pkgs ? commonLib.pkgs 4 | }: 5 | 6 | pkgs.mkShell { 7 | name = "node-ipc-env"; 8 | buildInputs = [ pkgs.nodejs iohkPkgs.nix-tools.exes.cardano-wallet ]; 9 | } 10 | -------------------------------------------------------------------------------- /node-ipc/wallet-topology.yaml: -------------------------------------------------------------------------------- 1 | wallet: 2 | fallbacks: 7 3 | valency: 1 4 | relays: 5 | - - host: relays.awstest.iohkdev.io 6 | -------------------------------------------------------------------------------- /node/Makefile: -------------------------------------------------------------------------------- 1 | help: ## Print documentation 2 | @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' 3 | 4 | ghcid: ## Run ghcid with the cardano-sl-node package 5 | ghcid \ 6 | --command "stack ghci cardano-sl-node --ghci-options=-fno-code" 7 | 8 | .PHONY: ghcid help 9 | -------------------------------------------------------------------------------- /node/README.md: -------------------------------------------------------------------------------- 1 | # Cardano SL simple node 2 | 3 | This package provides a minimum working CSL node without wallet capabilities. 4 | -------------------------------------------------------------------------------- /node/test/ChainExtension.hs: -------------------------------------------------------------------------------- 1 | module ChainExtension 2 | ( spec 3 | ) where 4 | 5 | import Test.Hspec 6 | import Universum 7 | 8 | spec :: Spec 9 | spec = do 10 | describe "Chain extension verification" $ do 11 | it "New block must specify previous block as predecessor" $ 12 | pending 13 | 14 | it "New block does not live in a slot in the past" $ 15 | pending 16 | 17 | it "Issuer is the slot leader" $ 18 | pending 19 | -------------------------------------------------------------------------------- /node/test/Spec.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE AllowAmbiguousTypes #-} 2 | {-# LANGUAGE ScopedTypeVariables #-} 3 | 4 | module Main where 5 | 6 | import Universum 7 | 8 | import Test.Hspec 9 | 10 | import qualified ChainExtension as CE 11 | import qualified Translation as Tr 12 | 13 | -- | Tests whether or not some instances (JSON, Bi, etc) roundtrips. 14 | main :: IO () 15 | main = hspec $ do 16 | CE.spec 17 | Tr.spec 18 | -------------------------------------------------------------------------------- /pkgs/cryptonite-segfault-blake.patch: -------------------------------------------------------------------------------- 1 | diff --git a/Crypto/Hash/Blake2b.hs b/Crypto/Hash/Blake2b.hs 2 | index c22c284..19c68ba 100644 3 | --- a/Crypto/Hash/Blake2b.hs 4 | +++ b/Crypto/Hash/Blake2b.hs 5 | @@ -85,7 +85,7 @@ instance HashAlgorithm Blake2b_512 where 6 | foreign import ccall unsafe "cryptonite_blake2b_init" 7 | c_blake2b_init :: Ptr (Context a) -> Word32 -> IO () 8 | 9 | -foreign import ccall "cryptonite_blake2b_update" 10 | +foreign import ccall unsafe "cryptonite_blake2b_update" 11 | c_blake2b_update :: Ptr (Context a) -> Ptr Word8 -> Word32 -> IO () 12 | 13 | foreign import ccall unsafe "cryptonite_blake2b_finalize" 14 | -------------------------------------------------------------------------------- /pkgs/generate.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Regenerate the `pkgs/default.nix` file based on the current 4 | # contents of cardano-sl.cabal and stack.yaml, with a hackage snapshot. 5 | 6 | set -euo pipefail 7 | git submodule update --init 8 | cd "$(dirname -- "$(readlink -f -- "${BASH_SOURCE[0]}")")" 9 | exec "$(nix-build --no-out-link regen.nix)" "$@" 10 | -------------------------------------------------------------------------------- /script-runner/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /script-runner/common/OrphanedLenses.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE NoImplicitPrelude #-} 2 | {-# LANGUAGE TemplateHaskell #-} 3 | 4 | module OrphanedLenses () where 5 | 6 | import Control.Lens (makeLensesWith) 7 | 8 | import Pos.Chain.Update (BlockVersionData, BlockVersionModifier) 9 | import Pos.Util (postfixLFields) 10 | 11 | makeLensesWith postfixLFields ''BlockVersionModifier 12 | makeLensesWith postfixLFields ''BlockVersionData 13 | -------------------------------------------------------------------------------- /script-runner/topology-local.yaml: -------------------------------------------------------------------------------- 1 | wallet: 2 | relays: 3 | - - addr: 127.0.0.1 4 | valency: 1 5 | fallbacks: 7 6 | -------------------------------------------------------------------------------- /script-runner/topology-mainnet.yaml: -------------------------------------------------------------------------------- 1 | wallet: 2 | relays: 3 | - - host: relays.cardano-mainnet.iohk.io 4 | valency: 1 5 | fallbacks: 7 6 | -------------------------------------------------------------------------------- /script-runner/topology-staging.yaml: -------------------------------------------------------------------------------- 1 | wallet: 2 | relays: 3 | - - host: relays.awstest.iohkdev.io 4 | valency: 1 5 | fallbacks: 7 6 | -------------------------------------------------------------------------------- /script-runner/topology-testnet.yaml: -------------------------------------------------------------------------------- 1 | wallet: 2 | relays: 3 | - - host: relays.cardano-testnet.iohkdev.io 4 | valency: 1 5 | fallbacks: 7 6 | -------------------------------------------------------------------------------- /script-runner/topology.yaml: -------------------------------------------------------------------------------- 1 | wallet: 2 | relays: 3 | - - addr: 127.0.0.1 4 | port: 3100 5 | valency: 1 6 | fallbacks: 7 7 | -------------------------------------------------------------------------------- /scripts/analyze/block-events.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | for f in node*.log; do 4 | grep -E 'New slot|I am leader|Created a new block|Received block has been adopted|chain has been adopted|considered useful' "$f" \ 5 | | sed -r 's/^(\S*)\s(.*)$/\2 \1/' | while read -r l; do 6 | echo "$l [$f]" 7 | done 8 | done|sort 9 | -------------------------------------------------------------------------------- /scripts/bench/buildbench.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | stack build --flag cardano-sl-core:-asserts cardano-sl cardano-sl-auxx cardano-sl-explorer cardano-sl-tools 4 | -------------------------------------------------------------------------------- /scripts/bench/count_tps_sent.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Count number of blocks sent by last invocation of the runbench 4 | 5 | grep "submitted" < tps-sent.csv | cut -f2 -d',' | awk '{s+=$1} END {print s}' 6 | -------------------------------------------------------------------------------- /scripts/bench/count_tps_written.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Count number of transactions that ended up in a block in latest logs/ 4 | 5 | last=$(find logs/ -maxdepth 1 -name "*.json" | sort | tail -1) 6 | 7 | jq -Mr '[.timestamp, .event.createdBlock.txs | length] | @csv' "./logs/$last/node*.json" | grep -v ',0' | cut -f2 -d',' | awk '{s+=$1} END {print s}' 8 | -------------------------------------------------------------------------------- /scripts/bench/topology/kademlia4.yaml: -------------------------------------------------------------------------------- 1 | peers: 2 | - host: '127.0.0.1' 3 | port: 3004 4 | address: 5 | host: '127.0.0.1' 6 | port: 3004 7 | -------------------------------------------------------------------------------- /scripts/bench/topology/kademlia5.yaml: -------------------------------------------------------------------------------- 1 | peers: 2 | - host: '127.0.0.1' 3 | port: 3004 4 | address: 5 | host: '127.0.0.1' 6 | port: 3004 7 | -------------------------------------------------------------------------------- /scripts/bench/topology/topology0.yaml: -------------------------------------------------------------------------------- 1 | topology.yaml -------------------------------------------------------------------------------- /scripts/bench/topology/topology1.yaml: -------------------------------------------------------------------------------- 1 | topology.yaml -------------------------------------------------------------------------------- /scripts/bench/topology/topology2.yaml: -------------------------------------------------------------------------------- 1 | topology.yaml -------------------------------------------------------------------------------- /scripts/bench/topology/topology3.yaml: -------------------------------------------------------------------------------- 1 | wallet: 2 | relays: [[{"addr": "127.0.0.1", "port": 3005}]] 3 | -------------------------------------------------------------------------------- /scripts/bench/topology/topology4.yaml: -------------------------------------------------------------------------------- 1 | topology.yaml -------------------------------------------------------------------------------- /scripts/bench/topology/topology5.yaml: -------------------------------------------------------------------------------- 1 | topology.yaml -------------------------------------------------------------------------------- /scripts/ci/check-hydra.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | eval "$(nix-build -A check-hydra lib.nix --no-out-link)" 4 | -------------------------------------------------------------------------------- /scripts/clean/all.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | set -o pipefail 4 | 5 | echo "Cleaning all databases and artifacts..." 6 | 7 | echo "Are you sure you want to remove .stack-work directory? You will have to rebuild Cardano SL completely. Type 'yes' to continue..." 8 | read -r DECISION 9 | if [ "${DECISION}" == "yes" ]; then 10 | echo "Cleaning Cardano SL stack-work..." 11 | rm -rf .stack-work 12 | ./scripts/clean/db.sh 13 | ./scripts/clean/explorer-bridge.sh 14 | exit 0 15 | else 16 | echo "Abort."; 17 | exit 1 18 | fi 19 | -------------------------------------------------------------------------------- /scripts/clean/db.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | set -o pipefail 4 | 5 | # Cleans all data according to docs to prepare for wallets running: 6 | # https://cardanodocs.com/technical/wallets/ 7 | 8 | echo "Cleaning Cardano SL db..." 9 | 10 | rm -rf run/* 11 | rm -rf wallet-db/ 12 | rm -rf node-db/ 13 | rm -rf db-testnet-staging/ 14 | rm -rf wdb-testnet-staging/ 15 | rm -rf db-testnet-public/ 16 | rm -rf wdb-testnet-public/ 17 | rm -rf db-mainnet/ 18 | rm -rf wdb-mainnet/ 19 | rm -rf node-*.*key* 20 | rm -rf kademlia-abc.dump 21 | rm -rf kademlia.dump 22 | 23 | -------------------------------------------------------------------------------- /scripts/clean/explorer-bridge.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | set -o pipefail 4 | 5 | echo "Cleaning Explorer Bridge artifacts..." 6 | 7 | cd explorer/frontend 8 | rm -rf .psci_modules/ .pulp-cache/ node_modules/ bower_components/ output/ 9 | -------------------------------------------------------------------------------- /scripts/grep.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # This utility script searchs prints lines matching a pattern in 3 | # Haskell source code. 4 | # N.B. If you want to find something in all files in the repostiory, 5 | # consider using `git grep'. 6 | 7 | # grep --color=auto -r "$@" lib/src lib/test lib/bench core/Pos update/Pos db/Pos lrc/Pos infra/Pos ssc/Pos tools/src txp/Pos auxx/src auxx/*.hs wallet node/*hs explorer/src --exclude-dir='.stack-work' 8 | grep --color=auto -r --exclude-dir={.stack-work,.git} --include ./\*.hs "$@" ./* 9 | -------------------------------------------------------------------------------- /scripts/hash-installer.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | cardano-auxx cmd --commands "hash-installer $1" --mode=light 3 | -------------------------------------------------------------------------------- /scripts/haskell/stylish.sh: -------------------------------------------------------------------------------- 1 | find . -type f -name "*hs" -not -path '.git' -not -path '*.stack-work*' -not -name 'HLint.hs' -exec stylish-haskell -i {} \; 2 | -------------------------------------------------------------------------------- /scripts/haskell/update-cabal-versions.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if [ -z "$1" ]; then 4 | echo "Supply single argument -- version to update CSL to" 5 | exit 6 | fi 7 | 8 | newVersion=$1 9 | 10 | function updateVersion() { 11 | sed -E -i -e "s/^(version\\:\\s+)(.+)/\\1$newVersion/" "$1" 12 | } 13 | 14 | for CB in $(git ls-files '*/cardano-*.cabal'); do 15 | echo " ${CB}" 16 | updateVersion "${CB}" 17 | done 18 | 19 | echo "Updated to version $newVersion" 20 | -------------------------------------------------------------------------------- /scripts/js/avvm-utxo-to-yaml.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | var yaml = require('js-yaml'); 4 | 5 | var fs = require('fs') 6 | 7 | var avvmFile = fs.readFileSync(process.argv[2]); 8 | var avvmJson = JSON.parse(avvmFile.toString('ascii')) 9 | 10 | var avvmMap = {}; 11 | avvmJson.utxo.forEach(function(v){ 12 | avvmMap[v.address] = v.coin*1000000; 13 | }) 14 | 15 | console.log(yaml.dump(avvmMap)); 16 | -------------------------------------------------------------------------------- /scripts/js/genesis-hash.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | var blake = require('blakejs'); 4 | var canonize = require('canonical-json') 5 | 6 | var fs = require('fs') 7 | 8 | var pretty = fs.readFileSync(process.argv[2]); 9 | var json = JSON.parse(pretty.toString('ascii')) 10 | var can = canonize(json) 11 | console.log(blake.blake2bHex(can, null, 32)) 12 | -------------------------------------------------------------------------------- /scripts/js/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "csl-scripts", 3 | "version": "0.0.1", 4 | "description": "", 5 | "author": "Serokell", 6 | "license": "ISC", 7 | "dependencies": { 8 | "blakejs": "latest", 9 | "canonical-json": "latest", 10 | "js-yaml": "latest" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /scripts/launch/connect-to-cluster/README.md: -------------------------------------------------------------------------------- 1 | See `docs/how-to/connect-to-cluster.md` 2 | -------------------------------------------------------------------------------- /scripts/launch/daedalus-example.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | SCRIPT=$(readlink -f "$0") 4 | SCRIPT_PATH=$(dirname "$SCRIPT") 5 | 6 | NODE_TLS_REJECT_UNAUTHORIZED=0 "$SCRIPT_PATH/../../daedalus/release/linux-x64/Daedalus-linux-x64/Daedalus" 7 | -------------------------------------------------------------------------------- /scripts/launch/explorer-with-nodes.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | system_start=$(($(date +%s) + 15)) 4 | 5 | system_start=$system_start ./scripts/launch/demo.sh & PIDNODE=$! 6 | system_start=$system_start ./scripts/launch/explorer.sh & PIDEX=$! 7 | 8 | wait $PIDEX 9 | wait $PIDNODE 10 | -------------------------------------------------------------------------------- /scripts/set_nixpath.sh: -------------------------------------------------------------------------------- 1 | update_NIX_PATH() { 2 | local readlink 3 | local scriptDir 4 | readlink=$(nix-instantiate --eval -E "/. + (import ).coreutils")/readlink 5 | scriptDir=$(dirname -- "$("$readlink" -f -- "${BASH_SOURCE[0]}")") 6 | NIX_PATH="nixpkgs=$(nix-build "${scriptDir}/../../fetch-nixpkgs.nix" --no-out-link)" 7 | export NIX_PATH 8 | } 9 | update_NIX_PATH 10 | -------------------------------------------------------------------------------- /scripts/test/wallet/swaggerSchemaValidation.nix: -------------------------------------------------------------------------------- 1 | { writeScript, cardano-wallet, validateJson }: 2 | 3 | let 4 | generate-swagger-file = "${cardano-wallet}/bin/cardano-generate-swagger-file"; 5 | validate-json = "${validateJson}/bin/validate_json"; 6 | schema = ./../../../tools/src/validate-json/swagger-meta-2.0.json; 7 | in writeScript "validate-swagger-schema" '' 8 | ${generate-swagger-file} --target wallet@v1 --output-file swagger.v1.json 9 | ${validate-json} --schema ${schema} swagger.v1.json 10 | EXIT_STATUS=$? 11 | rm -f swagger.*.json 12 | exit $EXIT_STATUS 13 | '' 14 | -------------------------------------------------------------------------------- /secrets/mainnet-staging-short-epoch/generated-keys/dlg-issuers/key0.sk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/secrets/mainnet-staging-short-epoch/generated-keys/dlg-issuers/key0.sk -------------------------------------------------------------------------------- /secrets/mainnet-staging-short-epoch/generated-keys/dlg-issuers/key1.sk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/secrets/mainnet-staging-short-epoch/generated-keys/dlg-issuers/key1.sk -------------------------------------------------------------------------------- /secrets/mainnet-staging-short-epoch/generated-keys/dlg-issuers/key2.sk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/secrets/mainnet-staging-short-epoch/generated-keys/dlg-issuers/key2.sk -------------------------------------------------------------------------------- /secrets/mainnet-staging-short-epoch/generated-keys/rich/key0.sk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/secrets/mainnet-staging-short-epoch/generated-keys/rich/key0.sk -------------------------------------------------------------------------------- /secrets/mainnet-staging-short-epoch/generated-keys/rich/key1.sk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/secrets/mainnet-staging-short-epoch/generated-keys/rich/key1.sk -------------------------------------------------------------------------------- /secrets/mainnet-staging-short-epoch/generated-keys/rich/key2.sk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/secrets/mainnet-staging-short-epoch/generated-keys/rich/key2.sk -------------------------------------------------------------------------------- /secrets/mainnet-staging-short-epoch/keys-fakeavvm/fake-0.seed: -------------------------------------------------------------------------------- 1 | n0RTZ0VtVhkxSkKj2oawAZR6/lmcK6mceaY0fjsiblo= -------------------------------------------------------------------------------- /secrets/mainnet-staging-short-epoch/keys-fakeavvm/fake-1.seed: -------------------------------------------------------------------------------- 1 | iFTo/8yiCxcwMLT6wrMWecAlsKyUjYgL7hcdAJrsGfY= -------------------------------------------------------------------------------- /secrets/mainnet-staging-short-epoch/keys-fakeavvm/fake-2.seed: -------------------------------------------------------------------------------- 1 | PWYWkB2soOIaeuPYAvfwm+iTV9JWbepHvwbnxskonrs= -------------------------------------------------------------------------------- /secrets/mainnet-staging-short-epoch/keys-fakeavvm/fake-3.seed: -------------------------------------------------------------------------------- 1 | giT+GyIpG6JHTxPvobyxyuXgXfuA6PIuEhkamt1+CjY= -------------------------------------------------------------------------------- /secrets/mainnet-staging-short-epoch/keys-fakeavvm/fake-4.seed: -------------------------------------------------------------------------------- 1 | VhSBqqHWINMD55PYXN4Cxyg8vBw2GTjCkTxrgP2Pwr4= -------------------------------------------------------------------------------- /tools/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /tools/post-mortem/README.md: -------------------------------------------------------------------------------- 1 | 2 | # cardano tool: post-mortem 3 | 4 | At the end of a benchmark run we launch `post-mortem` on the output JSON logs to summarize and analize the data of the run. 5 | 6 | -------------------------------------------------------------------------------- /tools/post-mortem/src/Types.hs: -------------------------------------------------------------------------------- 1 | module Types 2 | ( TxHash 3 | , BlockHash 4 | , Timestamp 5 | , Slot 6 | , NodeId 7 | ) where 8 | 9 | import Data.Time.Units (Microsecond) 10 | import Universum 11 | 12 | type TxHash = Text 13 | type BlockHash = Text 14 | type Timestamp = Microsecond 15 | type Slot = (Word64, Word16) 16 | type NodeId = Text 17 | -------------------------------------------------------------------------------- /tools/post-mortem/src/Util/Aeson.hs: -------------------------------------------------------------------------------- 1 | module Util.Aeson 2 | ( parseJSONP 3 | ) where 4 | 5 | import Data.Aeson (FromJSON, Result (..), fromJSON) 6 | import Data.Aeson.Parser (json) 7 | import Pipes 8 | import Pipes.Prelude (map) 9 | 10 | import Universum hiding (map) 11 | import Util.Pipes (parseP) 12 | 13 | parseJSONP:: (FromJSON a, Monad m) => Pipe ByteString a m b 14 | parseJSONP = parseP json >-> map (fromResult . fromJSON) 15 | where 16 | fromResult :: Result a -> a 17 | fromResult (Success a) = a 18 | fromResult (Error e) = error $ toText e 19 | -------------------------------------------------------------------------------- /tools/src/gencerts/configuration.yaml.example: -------------------------------------------------------------------------------- 1 | dev: 2 | tls: 3 | ca: 4 | organization: Input Output HK 5 | commonName: Cardano SL Self-Signed Root CA 6 | expiryDays: 3650 7 | 8 | server: 9 | organization: Input Output HK 10 | commonName: Cardano SL Server Node 11 | expiryDays: 365 12 | altDNS: 13 | - "localhost" 14 | - "localhost.localdomain" 15 | - "127.0.0.1" 16 | - "::1" 17 | 18 | clients: 19 | - organization: Input Output HK 20 | commonName: Daedalus Wallet 21 | expiryDays: 365 22 | -------------------------------------------------------------------------------- /tools/src/validate-json/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/tools/src/validate-json/__init__.py -------------------------------------------------------------------------------- /tools/src/validate-json/default.nix: -------------------------------------------------------------------------------- 1 | { stdenv, python36 }: 2 | 3 | stdenv.mkDerivation { 4 | name = "validate-json"; 5 | buildInputs = [ 6 | (python36.withPackages (pythonPackages: with pythonPackages; [ 7 | jsonschema 8 | docopt 9 | ])) 10 | ]; 11 | unpackPhase = ":"; 12 | installPhase = "install -m755 -D ${./validate_json.py} $out/bin/validate_json"; 13 | } 14 | -------------------------------------------------------------------------------- /tools/src/validate-json/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup, find_packages 2 | 3 | setup(name='validate-json', 4 | version = '1.0.0', 5 | author = 'IOHK', 6 | license = 'MIT', 7 | packages = find_packages(), 8 | install_requires = [ 9 | 'docopt==0.6.2', 10 | 'jsonschema==2.6.0' 11 | ], 12 | entry_points = """\ 13 | [console_scripts] 14 | validate-json = validate_json:main 15 | """ 16 | ) 17 | -------------------------------------------------------------------------------- /tools/test/Spec.hs: -------------------------------------------------------------------------------- 1 | module Spec (spec) where 2 | 3 | import Test.Hspec 4 | 5 | import qualified Test.Pos.Tools.Launcher.Environment 6 | 7 | spec :: Spec 8 | spec = Test.Pos.Tools.Launcher.Environment.spec 9 | -------------------------------------------------------------------------------- /tools/test/Test.hs: -------------------------------------------------------------------------------- 1 | import Test.Hspec (hspec) 2 | 3 | import Spec (spec) 4 | 5 | import Test.Pos.Util.Tripping (runTests) 6 | 7 | main :: IO () 8 | main = do 9 | hspec spec 10 | runTests [] 11 | -------------------------------------------------------------------------------- /tools/test/golden/AccountSpec: -------------------------------------------------------------------------------- 1 | {"addresses":1337} -------------------------------------------------------------------------------- /tools/test/golden/AddressRange: -------------------------------------------------------------------------------- 1 | {"unAddressRange":1337} -------------------------------------------------------------------------------- /tools/test/golden/DistributionAmount: -------------------------------------------------------------------------------- 1 | {"unDistributionAmount":1337} -------------------------------------------------------------------------------- /tools/test/golden/FakeTxsHistory: -------------------------------------------------------------------------------- 1 | {"txsCount":1337,"type":"simple","numOutgoingAddress":8337} -------------------------------------------------------------------------------- /tools/test/golden/FakeUtxoCoinDistribution: -------------------------------------------------------------------------------- 1 | {"amount":1337,"range":1337,"type":"range"} -------------------------------------------------------------------------------- /tools/test/golden/GenSpec: -------------------------------------------------------------------------------- 1 | {"wallets":1337,"walletSpec":{"fakeTxsHistory":{"txsCount":1337,"type":"simple","numOutgoingAddress":8337},"accounts":1337,"fakeUtxoCoinDistr":{"amount":1337,"range":1337,"type":"range"},"accountSpec":{"addresses":1337}}} -------------------------------------------------------------------------------- /tools/test/golden/WalletSpec: -------------------------------------------------------------------------------- 1 | {"fakeTxsHistory":{"txsCount":1337,"type":"simple","numOutgoingAddress":8337},"accounts":1337,"fakeUtxoCoinDistr":{"amount":1337,"range":1337,"type":"range"},"accountSpec":{"addresses":1337}} -------------------------------------------------------------------------------- /util/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /util/default.nix: -------------------------------------------------------------------------------- 1 | # Running `nix-shell` on this file puts you in an environment where all the 2 | # dependencies needed to work on this package using `Cabal` are available. 3 | # 4 | # Running `nix-build` builds this package. 5 | let 6 | drv = nixpkgs.cardano-sl-util; 7 | nixpkgs = import ../. {}; 8 | in 9 | if nixpkgs.pkgs.lib.inNixShell 10 | then drv.env 11 | else drv 12 | -------------------------------------------------------------------------------- /util/src/Pos/Util/OptParse.hs: -------------------------------------------------------------------------------- 1 | module Pos.Util.OptParse 2 | ( fromParsec 3 | ) where 4 | 5 | import Universum 6 | 7 | import Options.Applicative (ReadM, eitherReader) 8 | import Text.Megaparsec (Parsec, parse) 9 | 10 | fromParsec :: Parsec () String a -> ReadM a 11 | fromParsec parser = 12 | eitherReader $ first show . parse parser "" 13 | -------------------------------------------------------------------------------- /util/test/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /util/test/Spec.hs: -------------------------------------------------------------------------------- 1 | {-# OPTIONS_GHC -F -pgmF hspec-discover -optF --module-name=Spec #-} 2 | -------------------------------------------------------------------------------- /util/test/Test/Pos.hs: -------------------------------------------------------------------------------- 1 | {-# OPTIONS_GHC -F -pgmF hspec-discover -optF --module-name=Spec #-} 2 | -------------------------------------------------------------------------------- /util/test/Test/Pos/Util/Modifier.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE GeneralizedNewtypeDeriving #-} 2 | 3 | {-# OPTIONS_GHC -fno-warn-orphans #-} 4 | 5 | module Test.Pos.Util.Modifier where 6 | 7 | import Pos.Util.Modifier 8 | 9 | import Test.QuickCheck (Arbitrary) 10 | import Test.QuickCheck.Instances () 11 | 12 | import Universum 13 | 14 | deriving instance (Eq k, Hashable k, Arbitrary k, Arbitrary v) => 15 | Arbitrary (MapModifier k v) 16 | -------------------------------------------------------------------------------- /util/test/Test/Pos/Util/Parallel/Parallelize.hs: -------------------------------------------------------------------------------- 1 | module Test.Pos.Util.Parallel.Parallelize 2 | ( parallelizeAllCores 3 | ) where 4 | 5 | import Universum 6 | 7 | import GHC.Conc (getNumProcessors, setNumCapabilities) 8 | 9 | -- | `parallelizeAllCores` gets the number of processors on a machine and 10 | -- sets the number of threads equal to the number of processors on the machine. 11 | parallelizeAllCores :: IO () 12 | parallelizeAllCores = getNumProcessors >>= setNumCapabilities 13 | -------------------------------------------------------------------------------- /util/test/Test/Pos/Util/QuickCheck.hs: -------------------------------------------------------------------------------- 1 | {-# OPTIONS_GHC -Wno-unused-imports #-} 2 | {-# OPTIONS_GHC -Wno-dodgy-exports #-} 3 | 4 | module Test.Pos.Util.QuickCheck 5 | ( module Test.Pos.Util.QuickCheck.Arbitrary 6 | , module Test.Pos.Util.QuickCheck.Property 7 | ) where 8 | 9 | import Test.Pos.Util.QuickCheck.Arbitrary 10 | import Test.Pos.Util.QuickCheck.Property 11 | -------------------------------------------------------------------------------- /util/test/test.hs: -------------------------------------------------------------------------------- 1 | import Universum 2 | 3 | import Test.Hspec (hspec) 4 | 5 | import Spec (spec) 6 | 7 | main :: IO () 8 | main = 9 | hspec spec 10 | -------------------------------------------------------------------------------- /utxo/ChangeLog.md: -------------------------------------------------------------------------------- 1 | # Revision history for utxo 2 | 3 | ## 0.1.0.0 -- YYYY-mm-dd 4 | 5 | * First version. Released on an unsuspecting world. 6 | -------------------------------------------------------------------------------- /utxo/Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /wallet/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | end_of_line = lf 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | 11 | [Makefile] 12 | indent_style = tab 13 | indent_size = 8 14 | 15 | [*.hs] 16 | indent_size = 4 17 | max_line_length = 80 18 | -------------------------------------------------------------------------------- /wallet/.github/images/cardano-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/wallet/.github/images/cardano-logo.png -------------------------------------------------------------------------------- /wallet/.github/iohk-signature.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/wallet/.github/iohk-signature.gif -------------------------------------------------------------------------------- /wallet/.gitignore: -------------------------------------------------------------------------------- 1 | ### Haskell ### 2 | 3 | dist 4 | dist-* 5 | cabal-dev 6 | *.o 7 | *.hi 8 | *.chi 9 | *.chs.h 10 | *.dyn_o 11 | *.dyn_hi 12 | .hpc 13 | .hsenv 14 | .cabal-sandbox/ 15 | cabal.sandbox.config 16 | *.prof 17 | *.aux 18 | *.hp 19 | *.eventlog 20 | .stack-work/ 21 | cabal.project.local 22 | cabal.project.local~ 23 | .HTF/ 24 | .ghc.environment.* 25 | .ghci 26 | 27 | ### Cardano ### 28 | 29 | test_keystore.* 30 | -------------------------------------------------------------------------------- /wallet/Makefile: -------------------------------------------------------------------------------- 1 | help: ## Print documentation 2 | @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' 3 | 4 | ghcid: ## Run ghcid with the wallet-new project 5 | ghcid \ 6 | --command "stack ghci cardano-sl-wallet-new --ghci-options=-fno-code" 7 | 8 | ghcid-test: ## Have ghcid run the test suite for the wallet-new-specs on successful recompile 9 | ghcid \ 10 | --command "stack ghci cardano-sl-wallet-new:lib cardano-sl-wallet-new:test:wallet-new-specs --ghci-options=-fobject-code" \ 11 | --test "main" 12 | 13 | .PHONY: ghcid ghcid-test help 14 | -------------------------------------------------------------------------------- /wallet/Setup.hs: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env nix-shell 2 | #! nix-shell ./default.nix -i runghc 3 | import Distribution.Simple 4 | main = defaultMain 5 | -------------------------------------------------------------------------------- /wallet/shell.nix: -------------------------------------------------------------------------------- 1 | let 2 | self = import ../. {}; 3 | in (self.nix-tools.shellFor { 4 | name = "cardano-wallet"; 5 | packages = ps: [ ps.cardano-wallet ]; 6 | }) 7 | -------------------------------------------------------------------------------- /wallet/src/Cardano/Wallet/API/Request/Pagination.hs: -------------------------------------------------------------------------------- 1 | {- | Support for resource pagination. 2 | -} 3 | module Cardano.Wallet.API.Request.Pagination 4 | ( module Pos.Util.Pagination 5 | ) where 6 | 7 | import Pos.Util.Pagination 8 | -------------------------------------------------------------------------------- /wallet/src/Cardano/Wallet/API/Request/Parameters.hs: -------------------------------------------------------------------------------- 1 | -- | Enlists names of request parameters. 2 | -- To import only in /qualified/ way. 3 | 4 | module Cardano.Wallet.API.Request.Parameters where 5 | 6 | type Id = "id" 7 | 8 | type WalletId = "wallet_id" 9 | type CreatedAt = "created_at" 10 | type Balance = "balance" 11 | 12 | 13 | -------------------------------------------------------------------------------- /wallet/src/Cardano/Wallet/API/Response/JSend.hs: -------------------------------------------------------------------------------- 1 | module Cardano.Wallet.API.Response.JSend 2 | ( module Pos.Util.Jsend 3 | ) where 4 | 5 | import Pos.Util.Jsend 6 | -------------------------------------------------------------------------------- /wallet/src/Cardano/Wallet/API/Types/UnitOfMeasure.hs: -------------------------------------------------------------------------------- 1 | module Cardano.Wallet.API.Types.UnitOfMeasure 2 | ( module Pos.Util.UnitsOfMeasure 3 | ) where 4 | 5 | import Pos.Util.UnitsOfMeasure 6 | -------------------------------------------------------------------------------- /wallet/src/Cardano/Wallet/API/V1.hs: -------------------------------------------------------------------------------- 1 | module Cardano.Wallet.API.V1 where 2 | 3 | 4 | import Servant ((:<|>)) 5 | 6 | import qualified Cardano.Wallet.API.V1.Accounts as Accounts 7 | import qualified Cardano.Wallet.API.V1.Addresses as Addresses 8 | import qualified Cardano.Wallet.API.V1.Transactions as Transactions 9 | import qualified Cardano.Wallet.API.V1.Wallets as Wallets 10 | 11 | import qualified Pos.Node.API as Node 12 | 13 | type API = Addresses.API 14 | :<|> Wallets.API 15 | :<|> Accounts.API 16 | :<|> Transactions.API 17 | :<|> Node.SettingsAPI 18 | :<|> Node.InfoAPI 19 | -------------------------------------------------------------------------------- /wallet/src/Cardano/Wallet/API/V1/Generic.hs: -------------------------------------------------------------------------------- 1 | module Cardano.Wallet.API.V1.Generic 2 | ( jsendErrorGenericToJSON 3 | , jsendErrorGenericParseJSON 4 | , gconsNames 5 | , gconsName 6 | ) where 7 | 8 | import Pos.Util.Jsend 9 | -------------------------------------------------------------------------------- /wallet/src/Cardano/Wallet/API/V1/Headers.hs: -------------------------------------------------------------------------------- 1 | module Cardano.Wallet.API.V1.Headers 2 | ( applicationJson 3 | ) where 4 | 5 | import Pos.Util.Servant (applicationJson) 6 | -------------------------------------------------------------------------------- /wallet/src/Cardano/Wallet/API/V1/Info.hs: -------------------------------------------------------------------------------- 1 | module Cardano.Wallet.API.V1.Info where 2 | 3 | import qualified Pos.Node.API as Node 4 | 5 | type API = Node.InfoAPI 6 | -------------------------------------------------------------------------------- /wallet/src/Cardano/Wallet/API/V1/Internal/Update.hs: -------------------------------------------------------------------------------- 1 | module Cardano.Wallet.API.V1.Internal.Update where 2 | 3 | import Servant 4 | 5 | import Cardano.Wallet.API.Response (ValidJSON) 6 | 7 | type API = 8 | "update" 9 | :> ( "apply" 10 | :> Post '[ValidJSON] NoContent 11 | :<|> "postpone" 12 | :> Post '[ValidJSON] NoContent 13 | ) 14 | -------------------------------------------------------------------------------- /wallet/src/Cardano/Wallet/API/V1/Settings.hs: -------------------------------------------------------------------------------- 1 | module Cardano.Wallet.API.V1.Settings where 2 | 3 | import Cardano.Wallet.API.Response (APIResponse, ValidJSON) 4 | import Cardano.Wallet.API.Types 5 | import Cardano.Wallet.API.V1.Types 6 | 7 | import Servant 8 | 9 | type API = Tag "Settings" 'NoTagDescription :> 10 | ( "node-settings" :> Summary "Retrieves the static settings for this node." 11 | :> Get '[ValidJSON] (APIResponse NodeSettings) 12 | ) 13 | -------------------------------------------------------------------------------- /wallet/src/Cardano/Wallet/API/V1/Swagger/Example.hs: -------------------------------------------------------------------------------- 1 | module Cardano.Wallet.API.V1.Swagger.Example 2 | ( module Pos.Util.Example 3 | ) where 4 | 5 | import Pos.Util.Example 6 | -------------------------------------------------------------------------------- /wallet/src/Cardano/Wallet/Kernel/CoinSelection.hs: -------------------------------------------------------------------------------- 1 | module Cardano.Wallet.Kernel.CoinSelection ( 2 | module Exports 3 | ) where 4 | 5 | import Cardano.Wallet.Kernel.CoinSelection.FromGeneric as Exports 6 | import Cardano.Wallet.Kernel.CoinSelection.Generic as Exports 7 | -------------------------------------------------------------------------------- /wallet/src/Cardano/Wallet/TypeLits.hs: -------------------------------------------------------------------------------- 1 | module Cardano.Wallet.TypeLits 2 | ( module Pos.Util.KnownSymbols 3 | ) where 4 | 5 | import Pos.Util.KnownSymbols 6 | -------------------------------------------------------------------------------- /wallet/stack.yaml: -------------------------------------------------------------------------------- 1 | resolver: ./cardano-sl.yaml 2 | packages: 3 | - . 4 | 5 | extra-deps: 6 | - git: https://github.com/input-output-hk/cardano-sl 7 | commit: 858d6db5595313be368a93c809104c0253b93ecb 8 | subdirs: 9 | - acid-state-exts 10 | - binary 11 | - binary/test 12 | - chain 13 | - chain/test 14 | - client 15 | - cluster 16 | - core 17 | - core/test 18 | - crypto 19 | - crypto/test 20 | - db 21 | - infra 22 | - lib 23 | - mnemonic 24 | - networking 25 | - node 26 | - node-ipc 27 | - util 28 | - util/test 29 | - utxo 30 | - x509 31 | -------------------------------------------------------------------------------- /wallet/test/integration/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/wallet/test/integration/.gitkeep -------------------------------------------------------------------------------- /wallet/test/integration/README.md: -------------------------------------------------------------------------------- 1 | # Integration Tests 2 | 3 | See [Wiki - Integration Tests](https://github.com/input-output-hk/cardano-wallet/wiki/Integration-Tests) 4 | -------------------------------------------------------------------------------- /wallet/test/integration/Test/Integration/Documentation.hs: -------------------------------------------------------------------------------- 1 | module Test.Integration.Documentation 2 | ( spec 3 | ) where 4 | 5 | import Universum 6 | 7 | import Test.Hspec (Spec, it, shouldSatisfy) 8 | 9 | import Cardano.Wallet.Client.Http (WalletDocHttpClient) 10 | import qualified Cardano.Wallet.Client.Http as Client 11 | 12 | spec :: WalletDocHttpClient -> Spec 13 | spec client = do 14 | it "Fetches the documentation from the API" $ do 15 | response <- runExceptT $ Client.getSwaggerJson client 16 | response `shouldSatisfy` isRight 17 | -------------------------------------------------------------------------------- /wallet/test/manual/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/wallet/test/manual/.gitkeep -------------------------------------------------------------------------------- /wallet/test/nightly/Main.hs: -------------------------------------------------------------------------------- 1 | module Main where 2 | 3 | import Universum 4 | 5 | import Test.Hspec (hspec) 6 | 7 | import qualified TxMetaStorage 8 | 9 | 10 | main :: IO () 11 | main = hspec $ TxMetaStorage.spec 12 | -------------------------------------------------------------------------------- /wallet/test/unit/Golden/golden/JSONValidationError_JSONValidationFailed: -------------------------------------------------------------------------------- 1 | {"status":"error","diagnostic":{"validationError":"test"},"message":"JSONValidationFailed"} -------------------------------------------------------------------------------- /wallet/test/unit/Golden/golden/MigrationError_MigrationFailed: -------------------------------------------------------------------------------- 1 | {"status":"error","diagnostic":{"description":"test"},"message":"MigrationFailed"} -------------------------------------------------------------------------------- /wallet/test/unit/Golden/golden/UnsupportedMimeTypeError_UnsupportedMimeTypePresent: -------------------------------------------------------------------------------- 1 | {"status":"error","diagnostic":{"mimeContentTypeError":"test"},"message":"UnsupportedMimeTypePresent"} -------------------------------------------------------------------------------- /wallet/test/unit/Golden/golden/WalletError_AddressNotFound: -------------------------------------------------------------------------------- 1 | {"status":"error","diagnostic":{},"message":"AddressNotFound"} -------------------------------------------------------------------------------- /wallet/test/unit/Golden/golden/WalletError_CannotCreateAddress: -------------------------------------------------------------------------------- 1 | {"status":"error","diagnostic":{"msg":"test"},"message":"CannotCreateAddress"} -------------------------------------------------------------------------------- /wallet/test/unit/Golden/golden/WalletError_InvalidAddressFormat: -------------------------------------------------------------------------------- 1 | {"status":"error","diagnostic":{"msg":"test"},"message":"InvalidAddressFormat"} -------------------------------------------------------------------------------- /wallet/test/unit/Golden/golden/WalletError_InvalidPublicKey: -------------------------------------------------------------------------------- 1 | {"status":"error","diagnostic":{"msg":"test"},"message":"InvalidPublicKey"} -------------------------------------------------------------------------------- /wallet/test/unit/Golden/golden/WalletError_MissingRequiredParams: -------------------------------------------------------------------------------- 1 | {"status":"error","diagnostic":{"params":[["test","test"]]},"message":"MissingRequiredParams"} -------------------------------------------------------------------------------- /wallet/test/unit/Golden/golden/WalletError_NodeIsStillSyncing: -------------------------------------------------------------------------------- 1 | {"status":"error","diagnostic":{"stillSyncing":{"quantity":14,"unit":"percent"}},"message":"NodeIsStillSyncing"} -------------------------------------------------------------------------------- /wallet/test/unit/Golden/golden/WalletError_NotEnoughMoneyAvailableBalanceIsInsufficient: -------------------------------------------------------------------------------- 1 | {"status":"error","diagnostic":{"details":{"msg":"Not enough available coins to proceed.","availableBalance":14}},"message":"NotEnoughMoney"} -------------------------------------------------------------------------------- /wallet/test/unit/Golden/golden/WalletError_NotEnoughMoneyCannotCoverFee: -------------------------------------------------------------------------------- 1 | {"status":"error","diagnostic":{"details":{"msg":"Not enough coins to cover fee."}},"message":"NotEnoughMoney"} -------------------------------------------------------------------------------- /wallet/test/unit/Golden/golden/WalletError_OutputIsRedeem: -------------------------------------------------------------------------------- 1 | {"status":"error","diagnostic":{"address":"2RhQhCGqYPDpFgTsnBTbnvPvCwpqAkjwLqQkWpkqXbLRmNxd4xNd262nGsr8JiynyKRUeMLSJ9Ntho9i76uvBTrVXdJJG5yiNLb8frmUe5qX7E"},"message":"OutputIsRedeem"} -------------------------------------------------------------------------------- /wallet/test/unit/Golden/golden/WalletError_SignedTxSubmitError: -------------------------------------------------------------------------------- 1 | {"status":"error","diagnostic":{"msg":"test"},"message":"SignedTxSubmitError"} -------------------------------------------------------------------------------- /wallet/test/unit/Golden/golden/WalletError_TooBigTransaction: -------------------------------------------------------------------------------- 1 | {"status":"error","diagnostic":{},"message":"TooBigTransaction"} -------------------------------------------------------------------------------- /wallet/test/unit/Golden/golden/WalletError_TxFailedToStabilize: -------------------------------------------------------------------------------- 1 | {"status":"error","diagnostic":{},"message":"TxFailedToStabilize"} -------------------------------------------------------------------------------- /wallet/test/unit/Golden/golden/WalletError_TxRedemptionDepleted: -------------------------------------------------------------------------------- 1 | {"status":"error","diagnostic":{},"message":"TxRedemptionDepleted"} -------------------------------------------------------------------------------- /wallet/test/unit/Golden/golden/WalletError_TxSafeSignerNotFound: -------------------------------------------------------------------------------- 1 | {"status":"error","diagnostic":{"address":"2RhQhCGqYPDpFgTsnBTbnvPvCwpqAkjwLqQkWpkqXbLRmNxd4xNd262nGsr8JiynyKRUeMLSJ9Ntho9i76uvBTrVXdJJG5yiNLb8frmUe5qX7E"},"message":"TxSafeSignerNotFound"} -------------------------------------------------------------------------------- /wallet/test/unit/Golden/golden/WalletError_UnknownError: -------------------------------------------------------------------------------- 1 | {"status":"error","diagnostic":{"msg":"test"},"message":"UnknownError"} -------------------------------------------------------------------------------- /wallet/test/unit/Golden/golden/WalletError_UnsignedTxCreationError: -------------------------------------------------------------------------------- 1 | {"status":"error","diagnostic":{},"message":"UnsignedTxCreationError"} -------------------------------------------------------------------------------- /wallet/test/unit/Golden/golden/WalletError_WalletAlreadyExists: -------------------------------------------------------------------------------- 1 | {"status":"error","diagnostic":{"walletId":"J7rQqaLLHBFPrgJXwpktaMB1B1kQBXAyc2uRSfRPzNVGiv6TdxBzkPNBUWysZZZdhFG9gRy3sQFfX5wfpLbi4XTFGFxTg"},"message":"WalletAlreadyExists"} -------------------------------------------------------------------------------- /wallet/test/unit/Golden/golden/WalletError_WalletIsNotReadyToProcessPayments: -------------------------------------------------------------------------------- 1 | {"status":"error","diagnostic":{"stillRestoring":{"throughput":{"quantity":400,"unit":"blocksPerSecond"},"percentage":{"quantity":14,"unit":"percent"},"estimatedCompletionTime":{"quantity":3000,"unit":"milliseconds"}}},"message":"WalletIsNotReadyToProcessPayments"} -------------------------------------------------------------------------------- /wallet/test/unit/Golden/golden/WalletError_WalletNotFound: -------------------------------------------------------------------------------- 1 | {"status":"error","diagnostic":{},"message":"WalletNotFound"} -------------------------------------------------------------------------------- /wallet/topology-examples/testnet.yaml: -------------------------------------------------------------------------------- 1 | wallet: 2 | relays: [[{"host": "relays.awstest.iohkdev.io"}]] 3 | valency: 1 4 | fallbacks: 3 5 | -------------------------------------------------------------------------------- /x509/configuration.yaml.example: -------------------------------------------------------------------------------- 1 | dev: 2 | tls: 3 | ca: 4 | organization: Input Output HK 5 | commonName: Cardano SL Self-Signed Root CA 6 | expiryDays: 3650 7 | 8 | server: 9 | organization: Input Output HK 10 | commonName: Cardano SL Server Node 11 | expiryDays: 365 12 | altDNS: 13 | - "localhost" 14 | - "localhost.localdomain" 15 | - "127.0.0.1" 16 | - "::1" 17 | 18 | clients: 19 | - organization: Input Output HK 20 | commonName: Daedalus Wallet 21 | expiryDays: 365 22 | -------------------------------------------------------------------------------- /yaml-validation/yaml-validation.cabal: -------------------------------------------------------------------------------- 1 | name: yaml-validation 2 | version: 0.1 3 | cabal-version: >=1.10 4 | build-type: Simple 5 | 6 | executable yamlValidation 7 | default-language: Haskell2010 8 | build-depends: base 9 | , cardano-sl-util 10 | , cardano-sl-infra 11 | , split 12 | , yaml 13 | , exceptions 14 | main-is: Main.hs 15 | --------------------------------------------------------------------------------