Code Monkey home page Code Monkey logo

Comments (6)

Et9797 avatar Et9797 commented on June 14, 2024 3

Works great. For those interested:

docker run --rm \
  --name ogmios \
  -p 1337:1337 \
  -v ${PWD}/private-testnet:/testnet \
  cardanosolutions/ogmios:latest \
    --node-socket /testnet/node-bft1/node.sock \
    --node-config /testnet/configuration.yaml \
    --host 0.0.0.0

from cardano-private-testnet-setup.

KtorZ avatar KtorZ commented on June 14, 2024 3

Small-note: Ogmios should fully work with any Cardano network so long as the network runs a version of Cardano. That is, a combination of all the existing eras (Byron; Shelley; Allegra; Mary; Alonzo; Babbage...). In principle, you can create a private cluster of nodes that only run one of those eras, or a subset of them. This won't however work with Ogmios.

from cardano-private-testnet-setup.

grzegorznowak avatar grzegorznowak commented on June 14, 2024 2

well played on ^ guys 👏🏾

A few additional words from the SecOps land here now for future us.
Always be extremely wary when using someone else's images directly, especially if :latest tag is used, and ever more so especially when things like real ledger is involved.

I'm well aware we're talking testnets here only, but a caution to anyone who's going to arrive here later to copy pasta this into their very much actual project is due:

Please make sure you understand and trust the containers you use, and make sure to checksum-target images used even if you do

ie.
cardanosolutions/ogmios:latest -> cardanosolutions/ogmios@sha256:7a34a2abceadf66853d028c5099881c49df64907beba518fcc61e772fd4dbe46

which might be harder to work with - especially with rolling updates - but is a must for critical applications.

Cheers.

from cardano-private-testnet-setup.

extramileit avatar extramileit commented on June 14, 2024 1

I bet it is. I just skimmed Ogmios getting started and they show a way to run ogmios in docker container by pointing at your node socket and node config.

  • Here is the link to example.
    • In the example parameters for node-config, you could supply the /path/to/private-testnet/configuration.yaml instead of the config.json. I believe they are interchangeable.

I also notice that the cardano graph-ql project uses Ogmios bridge and cardano-db-sync as the backend data source.
In my opinion, using graphql would be ideal, b/c it abstracts away using SQL that is specific to the database.

  • I see an issue is logged in the cardano-graphql repo, which describes running against a private testnet.

If you have time to investigate getting Ogmios or GraphQl running against a private testnet, that would make for some great documentation to add to this guide!

from cardano-private-testnet-setup.

extramileit avatar extramileit commented on June 14, 2024 1

Excellent advice, @grzegorznowak! I have been using latest tags on some other projects, and you made me realize I need to be more careful.

from cardano-private-testnet-setup.

Et9797 avatar Et9797 commented on June 14, 2024

One addition, it seems that other ports than 1337 do not work. I raised this issue on the official Ogmios github: CardanoSolutions/ogmios#221.
Here's a minimal working example in Typescript to connect to the Ogmios container

import { createInteractionContext,  } from '@cardano-ogmios/client';
import { InteractionContext } from '@cardano-ogmios/client';

const config = {
    connection: {
        host: 'localhost',
        port: 1337,
        tls: false
    }
}

const context: InteractionContext = await createInteractionContext(
    err => console.error(err),
    () => console.log("Connection closed."),
    { connection: config.connection }
)
console.log(context)

Should be able to create the InteractionContext for the private testnet now (and use other libraries compatible with Ogmios, eg Pycardano, to build and submit transactions)

from cardano-private-testnet-setup.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.