Skip to content

Commit

Permalink
Merge branch 'master' into v6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
KtorZ committed Feb 21, 2024
2 parents 523f1cd + be8058e commit e37f885
Show file tree
Hide file tree
Showing 423 changed files with 2,811 additions and 1,225 deletions.
Binary file added .github/clients/elixir.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 29 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,34 @@ layout: changelog
pre: "<b>5. </b>"
---

### [6.1.0] - UNRELEASED

#### Added

- Two new script purposes (available from the Conway era onward):
- `propose`: for proposing new governance actions. When itemized, comes with a `proposal` field that documents the associated governance proposal.
- `vote`: for voting on a proposed governance action. When itemized, comes with an `issuer` field that documents the associated governance issuer.

- A new field `guardrails` is now present on governance proposals of type `treasuryWithdrawals` and `protocolParametersUpdate`. It is either `null` or contains a script hash (blake2b, 28 bytes) that indicates the additional guardrails script that must successfully pass for the governance proposal to be considered valid.

- The object returned from `ledgerState/rewardAccountSummaries` now contain an extra `deposit` field equals to the amount deposited and held by the associated stake credential.

- A new query `ledgerState/constitution` to obtain the current on-chain constitution. This query is only available when the ledger is in the Conway era onwards.

#### Changed

- Configuration files no longer contain `mainnet_p2p`, `preprod_p2p`, `preview_p2p` and `sanchonet_p2p` folders. The p2p configs are now replacing the default configurations; so we're back to configuration folders for `mainnet`, `preprod`, `preview` and `sanchonet`.

- The constitution `hash` is now wrapped in a singleton object `guardrails`, to better capture its meaning. It isn't the hash of the constitution script (which is covered by the `anchor` already), but the hash of the additional script policy which controls governance proposals of certain actions (e.g. treasury withdrawals, protocol parameters).

- Renamed all fields `anchor` to `metadata` in the Conway era objects to be more consistent with other occurences of metadata in previous eras.

- Fixed a few minor JSON-schema oversights such as `TransactionOutputReference`'s index now being a `UInt64` (instead of `UInt32`).

#### Removed

- `InternalLedgerTypeConversionError` which can no longer occur.

### [6.0.3] - 2024-02-02

#### Added
Expand Down Expand Up @@ -628,7 +656,7 @@ N/A

#### Added

- Integrated with the Cardano eco-system corresponding to [[email protected]](https://github.com/input-output-hk/cardano-node/releases/tag/1.29.0) (Alonzo!) & latest testnet(s).
- Integrated with the Cardano eco-system corresponding to [[email protected]](https://github.com/intersectMBO/cardano-node/releases/tag/1.29.0) (Alonzo!) & latest testnet(s).
>
- New `alonzo` block type, with various additions related to Alonzo.
>
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ Open a [Q&A Discussion](https://github.com/CardanoSolutions/ogmios/discussions/n
## Need Help Getting Started?

Should you be unsure about where to start, feel free to come and chat on <a href="https://discord.gg/ZeyDn65t5v"><img src=".github/discord.svg" alt="Discord">Discord (#ogmios)</a>.
Should you be unsure about where to start, feel free to come and chat on <a href="https://discord.gg/zMr6EGvBpr"><img src=".github/discord.svg" alt="Discord">Discord (#ogmios)</a>.
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
</picture>
</p>

**Ogmios** is a lightweight bridge interface for [cardano-node](https://github.com/input-output-hk/cardano-node/). It provides an **HTTP / WebSocket** API that enables applications to interact with a local cardano-node via **JSON+RPC-2.0**.
**Ogmios** is a lightweight bridge interface for [cardano-node](https://github.com/intersectMBO/cardano-node/). It provides an **HTTP / WebSocket** API that enables applications to interact with a local cardano-node via **JSON+RPC-2.0**.

## Compatibility

| Ogmios | Cardano-node |
| --- | --- |
| `v5.6.0` | `1.35.4`, `1.35.7` |
| `v6.0.2` | `8.7.2`, `8.7.3` |
| Ogmios | Cardano-node |
| --- | --- |
| `v5.6.0` | `1.35.4`, `1.35.7` |
| `v6.1.0` | `8.7.3`, `8.8.0-pre` |

[SanchoNet]: https://sancho.network/

Expand Down Expand Up @@ -47,6 +47,7 @@ See our [Ogmios client starter kit](https://github.com/CardanoSolutions/ogmios-t

queryLedgerState | Information
--- | ---
`constitution` | The current on-chain constitution.
`epoch` | The current epoch of the ledger.
`eraStart` | The information regarding the beginning of the current ledger era.
`eraSummaries` | Era bounds and slot parameters details, required for proper slotting arithmetic.
Expand Down Expand Up @@ -98,6 +99,7 @@ Ogmios provides a language-agnostic API which can be implemented using any WebSo
<td align="center"><img height=72 width=72 src=".github/clients/kotlin.png" alt="Logo:Kotlin"><br/><a href="https://github.com/projectNEWM/kogmios#readme"><strong>Kotlin</strong></a></td>
<td align="center"><img height=72 width=72 src=".github/clients/java.png" alt="Logo:Java"><br/><a href="https://github.com/adabox-aio/ogmios-java-client.git#readme"><strong>Java</strong></a></td>
<td align="center"><img height=72 width=72 src=".github/clients/python.png" alt="Logo:Python"><br/><a href="https://ogmios-python.readthedocs.io/en/latest/examples/index.html"><strong>Python</Strong></a></td>
<td align="center"><img height=72 width=72 src=".github/clients/elixir.png" alt="Logo:Python"><br/><a href="https://github.com/wowica/xogmios"><strong>Elixir</Strong></a></td>
</tr><thead></table>

## Sponsors
Expand All @@ -113,7 +115,7 @@ A big thank to [all our sponsors 💖](https://github.com/CardanoSolutions#-spon
|
<a href="CHANGELOG.md">:floppy_disk: Changelog</a>
|
<a href="https://discord.gg/ZeyDn65t5v"><img src=".github/discord.svg" alt="Discord">Discord (#ogmios)</a>
<a href="https://discord.gg/zMr6EGvBpr"><img src=".github/discord.svg" alt="Discord">Discord (#ogmios)</a>
|
<a href="https://twitter.com/_KtorZ_"><img src=".github/twitter.svg" alt="Twitter"> Twitter (@_KtorZ_)</a>
</p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { InteractionContext, Method, ensureSocketIsOpen } from '../Connection'
import {
constitution,
epoch,
eraStart,
eraSummaries,
Expand Down Expand Up @@ -43,6 +44,7 @@ export interface LedgerStateQueryClient {
releaseLedgerState(): Promise<void>
shutdown(): Promise<void>

constitution(): ReturnType<typeof constitution>
epoch(): ReturnType<typeof epoch>
eraStart(): ReturnType<typeof eraStart>
eraSummaries: () => ReturnType<typeof eraSummaries>
Expand Down Expand Up @@ -119,6 +121,9 @@ export async function createLedgerStateQueryClient (
)
},

constitution () {
return constitution(context)
},
epoch () {
return epoch(context)
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { InteractionContext, Method } from '../../Connection'
import { Ogmios, Constitution } from '@cardano-ogmios/schema'

type Request = Ogmios['QueryLedgerStateConstitution']
type Response = Ogmios['QueryLedgerStateConstitutionResponse']

/**
* Get the current Cardano {@link Constitution}
*
* @category LedgerStateQuery
*/
export function constitution (context: InteractionContext): Promise<Constitution> {
return Method<Request, Response, Constitution>(
{
method: 'queryLedgerState/constitution'
},
{},
context
)
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export { constitution } from './constitution'
export { epoch } from './epoch'
export { eraStart } from './eraStart'
export { eraSummaries } from './eraSummaries'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import delay from 'delay'
import { dummyInteractionContext } from './helpers'
import { InteractionContext, JSONRPCError, LedgerStateQuery } from '../src'
import {
RewardAccountSummaries,
RewardAccountSummary,
DigestBlake2B256,
DigestBlake2B224,
GenesisAlonzo,
Expand Down Expand Up @@ -174,9 +174,10 @@ describe('Local state queries', () => {
it('fetches the current delegate and rewards for given stake key hashes', async () => {
const keys = ['91a1b46bacf302e91a8cba443073f7bc84cc74701a338c111e8c6591'] as DigestBlake2B224[]
const result = await LedgerStateQuery.rewardAccountSummaries(context, { keys })
const item = result[keys[0]] as RewardAccountSummaries
const item = result[keys[0]] as RewardAccountSummary
expect(item).toHaveProperty('delegate')
expect(item).toHaveProperty('rewards')
expect(item).toHaveProperty('deposit')
})
it('returns an empty object when there are no rewards', async () => {
const keys = ['00000000000000000000000000000000000000000000000000000000'] as DigestBlake2B224[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ describe('TransactionSubmission', () => {
expect(e).toBeInstanceOf(JSONRPCError)
expect(e.code).toBe(-32602)
expect(e.data).toEqual({
babbage: "invalid or incomplete value of type 'Transaction': Size mismatch when decoding Object / Array. Expected 4, but found 0.",
conway: "invalid or incomplete value of type 'Transaction': Size mismatch when decoding Object / Array. Expected 4, but found 0.",
alonzo: "invalid or incomplete value of type 'Transaction': Size mismatch when decoding Object / Array. Expected 4, but found 0.",
mary: "invalid or incomplete value of type 'Transaction': Size mismatch when decoding Object / Array. Expected 3, but found 0.",
allegra: "invalid or incomplete value of type 'Transaction': Size mismatch when decoding Object / Array. Expected 3, but found 0.",
shelley: "invalid or incomplete value of type 'Transaction': Size mismatch when decoding Object / Array. Expected 3, but found 0."
allegra: "invalid or incomplete value of type 'Transaction': Size mismatch when decoding Object / Array. Expected 0, but found 3.",
alonzo: "invalid or incomplete value of type 'Transaction': Size mismatch when decoding Object / Array. Expected 0, but found 4.",
babbage: "invalid or incomplete value of type 'Transaction': Size mismatch when decoding Object / Array. Expected 0, but found 4.",
conway: "invalid or incomplete value of type 'Transaction': Size mismatch when decoding Object / Array. Expected 0, but found 4.",
mary: "invalid or incomplete value of type 'Transaction': Size mismatch when decoding Object / Array. Expected 0, but found 3.",
shelley: "invalid or incomplete value of type 'Transaction': Size mismatch when decoding Object / Array. Expected 0, but found 3."
})
}
})
Expand All @@ -99,9 +99,9 @@ describe('TransactionSubmission', () => {
expect(e).toBeInstanceOf(JSONRPCError)
expect(e.code).toBe(-32602)
expect(e.data).toEqual({
conway: "invalid or incomplete value of type 'Transaction': Size mismatch when decoding Object / Array. Expected 4, but found 3.",
babbage: "invalid or incomplete value of type 'Transaction': Size mismatch when decoding Object / Array. Expected 4, but found 3.",
alonzo: "invalid or incomplete value of type 'Transaction': Size mismatch when decoding Object / Array. Expected 4, but found 3.",
alonzo: "invalid or incomplete value of type 'Transaction': Size mismatch when decoding Object / Array. Expected 3, but found 4.",
babbage: "invalid or incomplete value of type 'Transaction': Size mismatch when decoding Object / Array. Expected 3, but found 4.",
conway: "invalid or incomplete value of type 'Transaction': Size mismatch when decoding Object / Array. Expected 3, but found 4.",
mary: "invalid or incomplete value of type 'Transaction': An error occured while decoding value of type AllegraTxBodyRaw " +
'(MultiAsset StandardCrypto). field atbrTxFee with key 2, not decoded.',
allegra: "invalid or incomplete value of type 'Transaction': An error occured while decoding value of type AllegraTxBodyRaw (). " +
Expand Down
3 changes: 2 additions & 1 deletion clients/TypeScript/packages/repl/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@ import {
const context = await createInteractionContext(console.error, () => {}, { connection })

const cardanoOgmiosRepl = repl.start({
prompt: `${args.host}> `,
prompt: `${context.connection.address.webSocket}> `,
ignoreUndefined: true
})

Object.assign(cardanoOgmiosRepl.context, {
acquireMempool: () => MempoolMonitoring.acquireMempool(context),
constitution: () => LedgerStateQuery.constitution(context),
epoch: () => LedgerStateQuery.epoch(context),
eraStart: () => LedgerStateQuery.eraStart(context),
eraSummaries: () => LedgerStateQuery.eraSummaries(context),
Expand Down
Loading

0 comments on commit e37f885

Please sign in to comment.