Skip to content

Commit a0a5379

Browse files
authored
doc: Add Precompiles Section (#104)
* chore: update flakes * chore: update Nodejs * feat: Create EVM Precompile section * doc: our precompiles * feat: add Call Permit * feat: add MADs precompile docs * feat: update nodejs * chore: use nodejs 22 * fix: remove old precompiles * fix: 404 links * fix: Remove reference to governance v2 (OpenGov)
1 parent fa63daa commit a0a5379

31 files changed

+1182
-295
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515
strategy:
1616
matrix:
17-
node-version: [18.x]
17+
node-version: [22.x]
1818
steps:
1919
- name: Cancel Previous Runs
2020
uses: styfle/cancel-workflow-action@0.11.0

.github/workflows/checks.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313
strategy:
1414
matrix:
15-
node-version: [18.x]
15+
node-version: [22.x]
1616
steps:
1717
- name: Cancel Previous Runs
1818
uses: styfle/cancel-workflow-action@0.11.0
@@ -33,7 +33,7 @@ jobs:
3333
runs-on: ubuntu-latest
3434
strategy:
3535
matrix:
36-
node-version: [18.x]
36+
node-version: [22.x]
3737
steps:
3838
- name: Cancel Previous Runs
3939
uses: styfle/cancel-workflow-action@0.11.0

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
18
1+
22

components/shiki.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ export const getLanguage = (url: string) => {
2626
case "js":
2727
case "jsx":
2828
return "javascript";
29+
case "sol":
30+
return "solidity";
2931
default:
3032
return "plaintext";
3133
}

flake.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
buildInputs = [
2121
# Nodejs
2222
pkgs.nodePackages.typescript-language-server
23-
pkgs.nodejs_18
23+
pkgs.nodejs_22
2424
pkgs.nodePackages.yarn
2525
];
2626
packages = [ ];

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,6 @@
102102
"engines": {
103103
"npm": "please-use-yarn",
104104
"yarn": "^1.10.1",
105-
"node": "18.x.x"
105+
"node": "22.x.x"
106106
}
107107
}

pages/developers/_meta.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"title": "Solution Developers"
2323
},
2424
"endpoints": "Endpoints and Integration",
25+
"precompiles": "EVM Precompiles",
2526
"technicals": "EVM Development",
2627
"-- contribute": {
2728
"type": "separator",

pages/developers/blueprint-contexts/eigenlayer-context.mdx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,8 @@ The `EigenlayerContext` trait provides access to core Eigenlayer services and fu
3232
- Query stake updates and changes
3333
- Monitor stake across different quorums
3434

35-
<GithubFileReaderDisplay
36-
url="https://github.com/tangle-network/gadget/blob/main/sdk/src/contexts/eigenlayer.rs"
37-
fromLine={16}
38-
toLine={140}
35+
<GithubFileReaderDisplay
36+
url="https://github.com/tangle-network/gadget/blob/main/crates/contexts/src/eigenlayer.rs"
3937
title="EigenlayerContext Trait Definition"
4038
/>
4139

@@ -45,7 +43,7 @@ The `EigenlayerContext` trait provides access to core Eigenlayer services and fu
4543

4644
First, define your context struct that implements the `EigenlayerContext` trait:
4745

48-
<GithubFileReaderDisplay
46+
<GithubFileReaderDisplay
4947
url="https://github.com/tangle-network/gadget/blob/main/blueprints/incredible-squaring-eigenlayer/src/contexts/aggregator.rs"
5048
fromLine={43}
5149
toLine={56}
@@ -56,7 +54,7 @@ First, define your context struct that implements the `EigenlayerContext` trait:
5654

5755
You can then use this context in your jobs to access Eigenlayer functionality:
5856

59-
<GithubFileReaderDisplay
57+
<GithubFileReaderDisplay
6058
url="https://github.com/tangle-network/gadget/blob/main/blueprints/incredible-squaring-eigenlayer/src/jobs/initialize_task.rs"
6159
fromLine={13}
6260
toLine={52}
@@ -67,7 +65,7 @@ You can then use this context in your jobs to access Eigenlayer functionality:
6765

6866
Finally, instantiate your context in your main runner:
6967

70-
<GithubFileReaderDisplay
68+
<GithubFileReaderDisplay
7169
url="https://github.com/tangle-network/gadget/blob/main/blueprints/incredible-squaring-eigenlayer/src/main.rs"
7270
fromLine={27}
7371
toLine={45}

pages/developers/blueprint-contexts/evm-provider-context.mdx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ import GithubFileReaderDisplay from '/components/GithubFileReaderDisplay';
66

77
# EVM Provider Context
88

9-
The `EvmProviderContext` trait provides a standardized [alloy-rs](https://github.com/alloy-rs) EVM provider for interacting with EVM-compatible blockchain networks in your Blueprint.
9+
The `EvmInstrumentedClientContext` trait provides a standardized [alloy-rs](https://github.com/alloy-rs) EVM provider for interacting with EVM-compatible blockchain networks in your Blueprint.
1010

1111
## Overview
1212

13-
The `EvmProviderContext` trait provides access to an EVM provider:
13+
The `EvmInstrumentedClientContext` trait provides access to an EVM provider:
1414

15-
<GithubFileReaderDisplay
16-
url="https://github.com/tangle-network/gadget/blob/main/sdk/src/contexts/evm_provider.rs"
15+
<GithubFileReaderDisplay
16+
url="https://github.com/tangle-network/gadget/blob/main/crates/contexts/src/instrumented_evm_client.rs"
1717
fromLine={3}
18-
toLine={12}
19-
title="EvmProviderContext Trait Definition"
18+
toLine={7}
19+
title="EvmInstrumentedClientContext Trait Definition"
2020
/>
2121

2222
## Using the Context
@@ -25,20 +25,20 @@ The `EvmProviderContext` trait provides access to an EVM provider:
2525

2626
First, define your context struct that implements the `EvmProviderContext` trait:
2727

28-
<GithubFileReaderDisplay
29-
url="https://github.com/tangle-network/gadget/blob/main/macros/context-derive/tests/ui/basic.rs"
30-
fromLine={4}
31-
toLine={9}
28+
<GithubFileReaderDisplay
29+
url="https://github.com/tangle-network/gadget/blob/main/crates/macros/context-derive/tests/ui/basic.rs"
30+
fromLine={22}
31+
toLine={31}
3232
title="EVM Provider Context Definition"
3333
/>
3434

3535
### 2. Access Provider Parameters
3636

3737
You can then use this context to access EVM provider parameters:
3838

39-
<GithubFileReaderDisplay
40-
url="https://github.com/tangle-network/gadget/blob/main/macros/context-derive/tests/ui/basic.rs"
41-
fromLine={18}
42-
toLine={18}
39+
<GithubFileReaderDisplay
40+
url="https://github.com/tangle-network/gadget/blob/main/crates/macros/context-derive/tests/ui/basic.rs"
41+
fromLine={45}
42+
toLine={45}
4343
title="Accessing EVM Provider Parameters"
4444
/>

pages/developers/blueprint-contexts/keystore-context.mdx

Lines changed: 12 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@ The `KeystoreContext` trait provides a standardized interface for accessing, man
1010

1111
## Overview
1212

13-
The `KeystoreContext` trait provides access to a `GenericKeystore` that implements the `Backend` trait, offering:
13+
The `KeystoreContext` trait provides access to a `Keystore` that implements the `Backend` trait, offering:
1414

1515
- Key Creation - Generate new keys of various types (ECDSA, SR25519, ED25519, BN254_BLS, BLS381)
1616
- Key Storage - Securely store and retrieve keys
1717
- Key Management - Read, modify, and delete stored keys
1818
- Signing - Sign messages using stored keys
1919
- Key Import/Export - Import existing keys and export key data
2020

21-
<GithubFileReaderDisplay
22-
url="https://github.com/tangle-network/gadget/blob/main/sdk/src/contexts/keystore.rs"
21+
<GithubFileReaderDisplay
22+
url="https://github.com/tangle-network/gadget/blob/main/crates/contexts/src/keystore.rs"
2323
fromLine={4}
24-
toLine={7}
24+
toLine={9}
2525
title="KeystoreContext Trait Definition"
2626
/>
2727

@@ -31,38 +31,20 @@ The `KeystoreContext` trait provides access to a `GenericKeystore` that implemen
3131

3232
First, define your context struct that implements the `KeystoreContext` trait:
3333

34-
<GithubFileReaderDisplay
35-
url="https://github.com/tangle-network/gadget/blob/main/macros/context-derive/tests/ui/basic.rs"
36-
fromLine={4}
37-
toLine={9}
34+
<GithubFileReaderDisplay
35+
url="https://github.com/tangle-network/gadget/blob/main/crates/macros/context-derive/tests/ui/basic.rs"
36+
fromLine={22}
37+
toLine={31}
3838
title="Keystore Context Definition"
3939
/>
4040

4141
### 2. Access Keystore Functionality
4242

4343
You can then use this context to access the keystore and perform key operations:
4444

45-
<GithubFileReaderDisplay
46-
url="https://github.com/tangle-network/gadget/blob/main/macros/context-derive/tests/ui/basic.rs"
47-
fromLine={17}
48-
toLine={17}
45+
<GithubFileReaderDisplay
46+
url="https://github.com/tangle-network/gadget/blob/main/crates/macros/context-derive/tests/ui/basic.rs"
47+
fromLine={44}
48+
toLine={44}
4949
title="Accessing Keystore Functionality"
5050
/>
51-
52-
The `KeystoreContext` trait provides comprehensive key management capabilities through the `GenericKeystore` implementation:
53-
54-
<GithubFileReaderDisplay
55-
url="https://github.com/tangle-network/gadget/blob/main/sdk/src/keystore/backend/mod.rs"
56-
fromLine={16}
57-
toLine={27}
58-
title="GenericKeystore Implementation"
59-
/>
60-
61-
The underlying `Backend` trait provides the full range of key management operations:
62-
63-
<GithubFileReaderDisplay
64-
url="https://github.com/tangle-network/gadget/blob/main/sdk/src/keystore/mod.rs"
65-
fromLine={182}
66-
toLine={347}
67-
title="Backend Trait Definition"
68-
/>

pages/developers/blueprint-contexts/service-context.mdx

Lines changed: 0 additions & 49 deletions
This file was deleted.

pages/developers/blueprint-contexts/tangle-client-context.mdx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ The `TangleClientContext` trait provides access to a Subxt client that enables:
1717
- Event Monitoring - Subscribe to and process chain events
1818
- RPC Calls - Make direct RPC calls to Tangle nodes
1919

20-
<GithubFileReaderDisplay
21-
url="https://github.com/tangle-network/gadget/blob/main/sdk/src/contexts/tangle_client.rs"
22-
fromLine={3}
20+
<GithubFileReaderDisplay
21+
url="https://github.com/tangle-network/gadget/blob/main/crates/contexts/src/tangle.rs"
22+
fromLine={5}
2323
toLine={10}
2424
title="TangleClientContext Trait Definition"
2525
/>
@@ -30,20 +30,20 @@ The `TangleClientContext` trait provides access to a Subxt client that enables:
3030

3131
First, define your context struct that implements the `TangleClientContext` trait:
3232

33-
<GithubFileReaderDisplay
34-
url="https://github.com/tangle-network/gadget/blob/main/macros/context-derive/tests/ui/basic.rs"
35-
fromLine={4}
36-
toLine={9}
33+
<GithubFileReaderDisplay
34+
url="https://github.com/tangle-network/gadget/blob/main/crates/macros/context-derive/tests/ui/basic.rs"
35+
fromLine={22}
36+
toLine={31}
3737
title="Tangle Client Context Definition"
3838
/>
3939

4040
### 2. Access Subxt Client Functionality
4141

4242
You can then use this context to access the Subxt client and interact with Tangle:
4343

44-
<GithubFileReaderDisplay
45-
url="https://github.com/tangle-network/gadget/blob/main/macros/context-derive/tests/ui/basic.rs"
46-
fromLine={19}
47-
toLine={19}
44+
<GithubFileReaderDisplay
45+
url="https://github.com/tangle-network/gadget/blob/main/crates/macros/context-derive/tests/ui/basic.rs"
46+
fromLine={46}
47+
toLine={52}
4848
title="Accessing Subxt Client Functionality"
4949
/>

pages/developers/blueprint-event-listeners/introduction.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ When building a blueprint, your application may require to listen to events. Eve
1010

1111
In general, when defining your job, you must register an event listeners and provide a context as such:
1212

13-
<GithubFileReaderDisplay
13+
<GithubFileReaderDisplay
1414
url="https://github.com/tangle-network/blueprint-template/blob/main/src/lib.rs"
1515
fromLine={11}
1616
toLine={32}
@@ -23,18 +23,18 @@ In order to understand how to build an event listener, begin with a custom imple
2323

2424
Event listeners in the SDK are designed to be flexible and allow developers to customize the behavior of their applications. Event listeners must implement the `EventListener` trait, which defines the following methods:
2525

26-
<GithubFileReaderDisplay
27-
url="https://github.com/tangle-network/gadget/blob/main/sdk/src/event_listener/mod.rs"
28-
fromLine={14}
29-
toLine={23}
26+
<GithubFileReaderDisplay
27+
url="https://github.com/tangle-network/gadget/blob/main/crates/event-listeners/core/src/lib.rs"
28+
fromLine={15}
29+
toLine={25}
3030
title="Event Listener Trait Definition"
3131
/>
3232

3333
### Initialization
3434

3535
When a blueprint instance runs, the event listeners are constructed and executed as part of the job handler. Executing the listeners is handled by the `BlueprintRunner`
3636

37-
<GithubFileReaderDisplay
37+
<GithubFileReaderDisplay
3838
url="https://github.com/tangle-network/gadget/blob/main/blueprints/incredible-squaring/src/main.rs"
3939
fromLine={8}
4040
toLine={26}

0 commit comments

Comments
 (0)