Integrate Rails Yield
End-to-end developer walkthrough — deploy a Rails Yield node, monitor balances and revenue, and initiate withdrawals using the GraphQL API.
A complete walk-through from zero to monitoring a productive Rails Yield node via the API. The deployment itself runs in the dashboard (it depends on browser-side cryptography - see Deploy a Node); the API takes over from monitoring through withdrawal.
This page is the end-to-end walkthrough. For focused references, see Setup Options, Deploy, Monitor, Withdraw, Nodes API, and Liquidity API.
The API is a single GraphQL endpoint at https://rails.amboss.tech/graphql. Open it in Apollo Studio for interactive exploration.
What you'll build
Prerequisites
- A Rails account at rails.amboss.tech. The first account on a team is the master account - the only role that can deploy or withdraw.
- The team must have the
ENABLE_LIQUIDITY_PROVIDERtag. Contact your account contact if it's not on yet. - A dashboard auth token (
auth_tokencookie from a logged-in session, or via your team's SSO integration). - A funding source of on-chain Bitcoin.
- Your stack of choice; the API is standard GraphQL, callable from any language.
Rails Yield does not currently have a sandbox. Mutations operate on real Bitcoin and real channels. Start with a small first deposit while you validate your integration.
Deployment is dashboard-driven. Creating, connecting, and activating a node depends on client-side cryptography (Argon2id key derivation, macaroon encryption with the team symmetric key) that a backend can't safely reproduce. The API walkthrough below picks up once your node is ACTIVE. See Deploy a Node for the why and the dashboard flow.
Walkthrough
Deploy and activate in the dashboard
At rails.amboss.tech: sign up, set an account password, deploy the node (Fully Managed or Third Party Hosted), fund it on-chain, and complete the Stripe activation. See Deploy a Node for the full flow and Setup Options to choose between deployment types.
You can stop the dashboard session as soon as the node reads ACTIVE. Everything that follows runs from your backend.
Authenticate
Pass the dashboard token as a Bearer:
Authorization: Bearer $AMBOSS_DASHBOARD_TOKENA simple sanity check:
query Me {
user { id }
node {
deployed_nodes { id state type pubkey alias }
}
}curl -X POST https://rails.amboss.tech/graphql \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $AMBOSS_DASHBOARD_TOKEN" \
-d '{"query":"{ user { id } node { deployed_nodes { id state pubkey } } }"}'import { GraphQLClient } from "graphql-request";
const client = new GraphQLClient("https://rails.amboss.tech/graphql", {
headers: { authorization: `Bearer ${process.env.AMBOSS_DASHBOARD_TOKEN}` },
});
const { node } = await client.request(`
{ node { deployed_nodes { id state pubkey } } }
`);
const myNodeId = node.deployed_nodes.find((n) => n.state === "ACTIVE").id;Cache the node_id of the active node - subsequent queries scope to it via LiquidityProviderInput.node_id.
Monitor earnings
Once ACTIVE, set up a polling loop or a periodic ETL on the funds + revenue queries:
query Monitor($input: LiquidityProviderInput) {
user {
liquidity_provider(input: $input) {
funds {
total { sats usd }
available { sats usd }
reserved { sats usd }
earnings { sats usd }
}
revenue {
routing { sats usd }
liquidity { sats usd }
}
}
}
}For dashboards, also query charts.balance and charts.revenue. See Monitor for a complete example.
Withdraw
Raise the withdrawal target:
mutation WithdrawTarget($input: IncreaseWithdrawalInput!) {
node {
withdrawal {
increase_withdrawal_target(input: $input) {
amount
}
}
}
}{
"input": {
"node_id": "<NODE_ID>",
"amount_sats": "10000000",
"password_hash": "<argon2id hash>"
}
}Poll liquidity_provider.funds.available.sats and deployed_node.funds_available_at until the target is on-chain, then move it to your wallet with the LND macaroon. See Withdraw for the password hash and full flow.
What now?
LND API
Pull a node's macaroons from the Rails API and call LND or Litd directly over gRPC/REST for low-level operations not surfaced through the Rails GraphQL.
FAQ
Frequently asked questions about Rails Yield — custody, yield sources, withdrawals, and developer questions about API auth, rate limits, sandbox, and password hash.