Skip to content

Commit

Permalink
docs: Move Safe{Core} Infra to API section (#476)
Browse files Browse the repository at this point in the history
* Move files from Advance to API

* Update Infrastructure overview

* Update Transaction Service overview

* Update redirects

* Update API pages
  • Loading branch information
germartinez authored May 17, 2024
1 parent 7692320 commit eb7762f
Show file tree
Hide file tree
Showing 10 changed files with 65 additions and 34 deletions.
7 changes: 0 additions & 7 deletions pages/advanced/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,6 @@
"smart-account-supported-networks": "Supported Networks",
"smart-account-audits": "Audits",
"smart-account-bug-bounty": "Bug Bounty",
"-- Safe{Core} API Infrastructure": {
"type": "separator",
"title": "Safe{Core} API Infrastructure"
},
"api-overview": "Overview",
"api-safe-transaction-service": "Safe Transaction Service",
"api-new-networks": "Add New Networks",
"-- Safe CLI": {
"type": "separator",
"title": "Safe CLI"
Expand Down
11 changes: 9 additions & 2 deletions pages/core-api/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,16 @@
"title": "← Go Home",
"href": "/"
},
"-- Safe Transaction Service API": {
"-- Safe{Core} Infrastructure": {
"type": "separator",
"title": "Safe Transaction Service API"
"title": "Safe{Core} Infrastructure"
},
"api-overview": "Overview",
"api-safe-transaction-service": "Running the Safe Transaction Service",
"api-support-new-chains": "Support New Chains",
"-- Safe Transaction Service": {
"type": "separator",
"title": "Safe Transaction Service"
},
"transaction-service-overview": "Overview",
"transaction-service-supported-networks": "Supported Networks",
Expand Down
28 changes: 17 additions & 11 deletions pages/advanced/api-overview.md → pages/core-api/api-overview.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,29 @@
# Service architecture
# Safe{Core} Infrastructure

The Safe{Core} infrastructure consists of the following services:
The Safe{Core} Infrastructure consists of the following services:

* [Safe Transaction Service](https://github.com/safe-global/safe-transaction-service): Keeps track of transactions related to Safe contracts (Python).
* [Safe Events Service](https://github.com/safe-global/safe-events-service): Handles Safe indexing events from the Transaction Service and delivers them as HTTP webhooks (NodeJS).
## Safe Transaction Service

Safe{Wallet} uses these services to offer functionality to end customers via the web and mobile applications. The [Safe Client Gateway](https://github.com/safe-global/safe-client-gateway-nest) acts as a facade between the end customer and the Safe{Core} services and the [Safe Config Service](https://github.com/safe-global/safe-config-service) stores all supported networks and chain-specific variables.
The Safe Transaction Service tracks transactions related to Safe contracts using tracing on Mainnet, Sepolia, and Gnosis Chain. It uses event indexing for the other chains. For each [supported network](./transaction-service-supported-networks.md) there is one instance of the Transaction Service.

Safe's production setup consists of several instances of the Transaction Service orchestrated by the Config Service, which are later consumed by the Safe Client Gateway. The Events Service notifies the Safe Client Gateway when new events are indexed, helping to improve the user experience.
- Learn about the [tech stack and how to run the service](./api-safe-transaction-service.mdx).
- Learn about the [Safe Transaction Service API](./transaction-service-overview.mdx).
- Check the [API Reference](./transaction-service-reference.mdx).
- Check the [GitHub repository](https://github.com/safe-global/safe-transaction-service) (Python).

![Overview of the backend services and their components.](../../assets/diagram-services.png)
## Safe Events Service

## Safe Transaction Service
The Events Service handles Safe indexing events and delivers them as HTTP webhooks, connection to the events queue processed by the Transaction Service. The service's database stores the configuration of webhook destinations.

The Transaction Service uses tracing in Mainnet/Sepolia and Gnosis Chain and event indexing in other chains to keep track of transactions related to Safe contracts. One instance of the Transaction Service runs per supported network (Mainnet, Sepolia, Gnosis Chain, Polygon, etc.).
- Check the [GitHub repository](https://github.com/safe-global/safe-events-service) (NodeJS).

## Safe Events Service
## Architecture

Safe{Wallet} uses these services to offer functionality to end customers via the web and mobile applications. The [Safe Client Gateway](https://github.com/safe-global/safe-client-gateway-nest) acts as a facade between the end customer and the Safe{Core} services and the [Safe Config Service](https://github.com/safe-global/safe-config-service) stores all supported networks and chain-specific variables.

The Events Service connects to the events queue processed by the Transaction Service. It handles Safe indexing events and delivers them as HTTP webhooks. The service's database stores the configuration of webhook destinations.
Safe's production setup consists of several instances of the Transaction Service orchestrated by the Config Service, which are later consumed by the Safe Client Gateway. The Events Service notifies the Safe Client Gateway when new events are indexed, helping to improve the user experience.

![Overview of the backend services and their components.](../../assets/diagram-services.png)

## Integration Flow for Safe{Wallet} and Safe{Core}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Safe Transaction Service
# Running the Safe Transaction Service

The Safe Transaction Service tracks transactions sent via Safe contracts. It indexes these transactions using events (L2 chains) and tracing (L1 chains) mechanisms.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Steps } from 'nextra/components'

# Add New Networks
# Support New Chains

Safe's vision is to make every web3 account a smart account. Therefore, we prioritize teams and chains building with smart accounts, especially if they push account abstraction (for example, ERC-4337/EIP-1271 adoption) with Safe (learn more [here](https://docs.safe.global/home/4337-safe)).

Expand Down
6 changes: 3 additions & 3 deletions pages/core-api/transaction-service-overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import Reference from '../../assets/svg/reference.svg'

# Safe Transaction Service API

The Safe Transaction Service API offers REST endpoints to keep track of transactions sent via Safe contracts. It also offers endpoints to send transactions to allow off-chain collecting of signatures or informing the owners about a pending transaction to be sent to the blockchain.
The Safe Transaction Service offers a REST API to track transactions sent via the Safe Smart Account. It also provides endpoints to send transactions, allow off-chain collecting of signatures, or informing the owners about a pending transaction to be sent to the blockchain.

We also offer the [API Kit](../sdk/api-kit), a TypeScript client for the Safe Transaction Service API in the Safe\{Core\} SDK.
Additionally, the Safe\{Core\} SDK provides the [API Kit](../sdk/api-kit), a TypeScript client for the Safe Transaction Service API.

<Cards>
<Card icon={<Guides />} title="Guides" href="./transaction-service-guides/transactions" />
Expand All @@ -15,4 +15,4 @@ We also offer the [API Kit](../sdk/api-kit), a TypeScript client for the Safe Tr

## Getting started

Are you new to our API and not sure where to get started? We recommend heading over to the guides on the [Safe Transaction Service API](../core-api/transaction-service-guides/transactions.mdx).
Are you new to our API and not sure where to get started? We recommend heading over to the [guides](../core-api/transaction-service-guides/transactions.mdx) on the Safe Transaction Service API.
43 changes: 34 additions & 9 deletions redirects.json
Original file line number Diff line number Diff line change
Expand Up @@ -391,47 +391,62 @@
},
{
"source": "/safe-core-api",
"destination": "/advanced/api-service-architecture",
"destination": "/core-api/api-overview",
"permanent": true
},
{
"source": "/api-service-architecture",
"destination": "/advanced/api-service-architecture",
"destination": "/core-api/api-overview",
"permanent": true
},
{
"source": "/safe-core-api/service-architecture",
"destination": "/advanced/api-service-architecture",
"destination": "/core-api/api-overview",
"permanent": true
},
{
"source": "/api-service-architecture",
"destination": "/advanced/api-service-architecture",
"destination": "/core-api/api-overview",
"permanent": true
},
{
"source": "/advanced/api-service-architecture",
"destination": "/core-api/api-overview",
"permanent": true
},
{
"source": "/safe-core-api/service-architecture/safe-transaction-service",
"destination": "/advanced/api-service-architecture/safe-transaction-service",
"destination": "/core-api/api-safe-transaction-service",
"permanent": true
},
{
"source": "/api-service-architecture/safe-transaction-service",
"destination": "/advanced/api-service-architecture/safe-transaction-service",
"destination": "/core-api/api-safe-transaction-service",
"permanent": true
},
{
"source": "/advanced/api-service-architecture/safe-transaction-service",
"destination": "/core-api/api-safe-transaction-service",
"permanent": true
},
{
"source": "/safe-core-api/rpc-requirements",
"destination": "/advanced/api-safe-transaction-service/rpc-requirements",
"destination": "/core-api/api-safe-transaction-service/rpc-requirements",
"permanent": true
},
{
"source": "/api-rpc-requirements",
"destination": "/advanced/api-safe-transaction-service/rpc-requirements",
"destination": "/core-api/api-safe-transaction-service/rpc-requirements",
"permanent": true
},
{
"source": "/advanced/api-rpc-requirements",
"destination": "/advanced/api-safe-transaction-service/rpc-requirements",
"destination": "/core-api/api-safe-transaction-service/rpc-requirements",
"permanent": true
},
{
"source": "/advanced/api-safe-transaction-service/rpc-requirements",
"destination": "/core-api/api-safe-transaction-service/rpc-requirements",
"permanent": true
},
{
Expand All @@ -449,6 +464,16 @@
"destination": "/core-api/transaction-service-supported-networks",
"permanent": true
},
{
"source": "/advanced/api-new-networks",
"destination": "/core-api/api-support-new-chains",
"permanent": true
},
{
"source": "/core-api/api-new-networks",
"destination": "/core-api/api-support-new-chains",
"permanent": true
},
{
"source": "/safe-core-aa-sdk/safe-apps",
"destination": "https://github.com/safe-global/safe-apps-sdk",
Expand Down

0 comments on commit eb7762f

Please sign in to comment.