Skip to content

Commit 47685ce

Browse files
committed
Merge branch 'main' of github.com:smartcontractkit/chainlink-testing-framework into parrotServer
2 parents ed2e7a8 + 66402cd commit 47685ce

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+4871
-208
lines changed

.github/workflows/framework-golden-tests.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,22 @@ jobs:
2222
config: smoke.toml
2323
count: 1
2424
timeout: 10m
25+
- name: TestSmoke
26+
config: smoke_limited_resources.toml
27+
count: 1
28+
timeout: 10m
29+
- name: TestSuiSmoke
30+
config: smoke_sui.toml
31+
count: 1
32+
timeout: 10m
33+
- name: TestAptosSmoke
34+
config: smoke_aptos.toml
35+
count: 1
36+
timeout: 10m
37+
- name: TestTRONSmoke
38+
config: smoke_tron.toml
39+
count: 1
40+
timeout: 10m
2541
- name: TestSolanaSmoke
2642
config: smoke_solana.toml
2743
count: 1

book/src/SUMMARY.md

Lines changed: 53 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -2,50 +2,55 @@
22

33
- [Overview](./overview.md)
44
- [Framework](./framework/overview.md)
5-
- [Getting Started](./framework/getting_started.md)
6-
- [Your First Test](./framework/first_test.md)
7-
- [Connecting Chainlink Node](./framework/connecting_chainlink_node.md)
8-
- [Connecting Chainlink Node (Multiple networks)]()
9-
- [NodeSet Environment](./framework/nodeset_environment.md)
10-
- [NodeSet with Capabilities](./framework/nodeset_capabilities.md)
11-
- [NodeSet (Local Docker builds)](./framework/nodeset_docker_rebuild.md)
12-
- [NodeSet Compat Environment](./framework/nodeset_compatibility.md)
13-
- [Creating your own components](./developing/developing_components.md)
14-
- [Fork Testing](./framework/fork.md)
15-
- [Quick Contracts Deployment](./framework/quick_deployment.md)
16-
- [Verifying Contracts](./framework/verify.md)
17-
- [NodeSet with External Blockchain]()
18-
- [CLI](./framework/cli.md)
19-
- [Configuration](./framework/configuration.md)
20-
- [Test Configuration](./framework/test_configuration_overrides.md)
21-
- [Exposing Components](framework/components/state.md)
22-
- [Debugging Tests](framework/components/debug.md)
23-
- [Components Cleanup](framework/components/cleanup.md)
24-
- [Components Caching](framework/components/caching.md)
25-
- [Mocking Services](framework/components/mocking.md)
26-
- [Copying Files](framework/copying_files.md)
27-
- [External Environment](framework/components/external.md)
28-
- [Troubleshooting](framework/components/troubleshooting.md)
29-
- [Secrets]()
30-
- [Observability Stack](framework/observability/observability_stack.md)
31-
- [Metrics](framework/observability/metrics.md)
32-
- [Logs](framework/observability/logs.md)
33-
- [Profiling](framework/observability/profiling.md)
34-
- [Traces]()
35-
- [Blockscout](framework/observability/blockscout.md)
36-
- [Components](framework/components/overview.md)
37-
- [Blockchains](framework/components/blockchains/overview.md)
38-
- [EVM](framework/components/blockchains/evm.md)
39-
- [Solana](framework/components/blockchains/solana.md)
40-
- [Optimism Stack]()
41-
- [Arbitrum Stack]()
42-
- [Chainlink](framework/components/chainlink.md)
43-
- [Node](framework/components/chainlink/node.md)
44-
- [NodeSet](framework/components/chainlink/nodeset.md)
45-
- [Clients]()
46-
- [Chainlink]()
47-
- [RPC]()
48-
- [Loki]()
5+
- [Getting Started](./framework/getting_started.md)
6+
- [Your First Test](./framework/first_test.md)
7+
- [Connecting Chainlink Node](./framework/connecting_chainlink_node.md)
8+
- [Connecting Chainlink Node (Multiple networks)]()
9+
- [NodeSet Environment](./framework/nodeset_environment.md)
10+
- [NodeSet with Capabilities](./framework/nodeset_capabilities.md)
11+
- [NodeSet (Local Docker builds)](./framework/nodeset_docker_rebuild.md)
12+
- [NodeSet Compat Environment](./framework/nodeset_compatibility.md)
13+
- [Creating your own components](./developing/developing_components.md)
14+
- [Fork Testing](./framework/fork.md)
15+
- [Quick Contracts Deployment](./framework/quick_deployment.md)
16+
- [Verifying Contracts](./framework/verify.md)
17+
- [NodeSet with External Blockchain]()
18+
- [CLI](./framework/cli.md)
19+
- [Configuration](./framework/configuration.md)
20+
- [Test Configuration](./framework/test_configuration_overrides.md)
21+
- [Exposing Components](framework/components/state.md)
22+
- [Debugging Tests](framework/components/debug.md)
23+
- [Components Cleanup](framework/components/cleanup.md)
24+
- [Components Caching](framework/components/caching.md)
25+
- [Components Resources](framework/components/resources.md)
26+
- [Mocking Services](framework/components/mocking.md)
27+
- [Copying Files](framework/copying_files.md)
28+
- [External Environment](framework/components/external.md)
29+
- [Troubleshooting](framework/components/troubleshooting.md)
30+
- [Secrets]()
31+
- [Observability Stack](framework/observability/observability_stack.md)
32+
- [Metrics](framework/observability/metrics.md)
33+
- [Logs](framework/observability/logs.md)
34+
- [Profiling](framework/observability/profiling.md)
35+
- [PostgreSQL](framework/observability/postgresql.md)
36+
- [Traces]()
37+
- [Blockscout](framework/observability/blockscout.md)
38+
- [Components](framework/components/overview.md)
39+
- [Blockchains](framework/components/blockchains/overview.md)
40+
- [EVM](framework/components/blockchains/evm.md)
41+
- [Solana](framework/components/blockchains/solana.md)
42+
- [Aptos](framework/components/blockchains/aptos.md)
43+
- [Sui](framework/components/blockchains/sui.md)
44+
- [TRON](framework/components/blockchains/tron.md)
45+
- [Optimism Stack]()
46+
- [Arbitrum Stack]()
47+
- [Chainlink](framework/components/chainlink.md)
48+
- [Node](framework/components/chainlink/node.md)
49+
- [NodeSet](framework/components/chainlink/nodeset.md)
50+
- [Clients]()
51+
- [Chainlink]()
52+
- [RPC]()
53+
- [Loki]()
4954
- [Testing Maturity Model](framework/testing.md)
5055
- [Smoke]()
5156
- [Performance]()
@@ -103,7 +108,9 @@
103108
- [Sentinel](./libs/sentinel.md)
104109

105110
---
111+
106112
- [Releasing modules](releasing_modules.md)
113+
107114
---
108115

109116
- [CTFv1 (Discouraged)](lib.md)
@@ -135,5 +142,7 @@
135142
- [Third party apps]()
136143
- [Test helpers](lib/docker/test_helpers.md)
137144
- [Logging](lib/logging.md)
145+
138146
---
147+
139148
- [Build info](build_info.md)
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Aptos Blockchain Client
2+
3+
You need to turn `Rosetta` off to use this image! Image doesn't work with `OrbStack` currently.
4+
5+
Docker Desktop
6+
7+
![img.png](rosetta-settings.png)
8+
9+
Default image is `aptoslabs/tools:aptos-node-v1.18.0`
10+
11+
API is available on [localhost:8080](http://localhost:8080/v1)
12+
13+
## Configuration
14+
15+
```toml
16+
[blockchain_a]
17+
type = "aptos"
18+
image = "aptoslabs/tools:aptos-node-v1.18.0" # or aptoslabs/tools:nightly
19+
contracts_dir = "$your_dir"
20+
```
21+
22+
## Usage
23+
24+
```golang
25+
package examples
26+
27+
import (
28+
"github.com/go-resty/resty/v2"
29+
"github.com/smartcontractkit/chainlink-testing-framework/framework"
30+
"github.com/smartcontractkit/chainlink-testing-framework/framework/components/blockchain"
31+
"github.com/stretchr/testify/require"
32+
"testing"
33+
)
34+
35+
type CfgAptos struct {
36+
BlockchainA *blockchain.Input `toml:"blockchain_a" validate:"required"`
37+
}
38+
39+
func TestAptosSmoke(t *testing.T) {
40+
in, err := framework.Load[CfgAptos](t)
41+
require.NoError(t, err)
42+
43+
bc, err := blockchain.NewBlockchainNetwork(in.BlockchainA)
44+
require.NoError(t, err)
45+
46+
// execute any additional commands, to deploy contracts or set up
47+
// network is already funded, here are the keys
48+
_ = blockchain.DefaultAptosAccount
49+
_ = blockchain.DefaultAptosPrivateKey
50+
51+
_, err = framework.ExecContainer(bc.ContainerName, []string{"ls", "-lah"})
52+
require.NoError(t, err)
53+
54+
t.Run("test something", func(t *testing.T) {
55+
// use internal URL to connect Chainlink nodes
56+
_ = bc.Nodes[0].DockerInternalHTTPUrl
57+
// use host URL to interact
58+
_ = bc.Nodes[0].HostHTTPUrl
59+
r := resty.New().SetBaseURL(bc.Nodes[0].HostHTTPUrl).EnableTrace()
60+
_, err := r.R().Get("/v1/transactions")
61+
require.NoError(t, err)
62+
})
63+
}
64+
```
65+
66+
## Test Private Keys
67+
68+
Default account is already funded with `100000000 Octas`
69+
70+
```
71+
Account: 0xa337b42bd0eecf8fb59ee5929ea4541904b3c35a642040223f3d26ab57f59d6e
72+
PrivateKey: 0xd477c65f88ed9e6d4ec6e2014755c3cfa3e0c44e521d0111a02868c5f04c41d4
73+
```
69.6 KB
Loading
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Sui Blockchain Client
2+
3+
API is available on [localhost:9000](http://localhost:9000)
4+
5+
## Configuration
6+
7+
```toml
8+
[blockchain_a]
9+
type = "sui"
10+
image = "mysten/sui-tools:mainnet" # if omitted default is mysten/sui-tools:devnet
11+
contracts_dir = "$your_dir"
12+
```
13+
14+
## Usage
15+
16+
```golang
17+
package examples
18+
19+
import (
20+
"context"
21+
"fmt"
22+
"github.com/block-vision/sui-go-sdk/models"
23+
"github.com/block-vision/sui-go-sdk/signer"
24+
"github.com/block-vision/sui-go-sdk/sui"
25+
"github.com/smartcontractkit/chainlink-testing-framework/framework"
26+
"github.com/smartcontractkit/chainlink-testing-framework/framework/components/blockchain"
27+
"github.com/stretchr/testify/require"
28+
"testing"
29+
)
30+
31+
type CfgSui struct {
32+
BlockchainA *blockchain.Input `toml:"blockchain_a" validate:"required"`
33+
}
34+
35+
func TestSuiSmoke(t *testing.T) {
36+
in, err := framework.Load[CfgSui](t)
37+
require.NoError(t, err)
38+
39+
bc, err := blockchain.NewBlockchainNetwork(in.BlockchainA)
40+
require.NoError(t, err)
41+
42+
// network is already funded, here are the keys
43+
_ = bc.NetworkSpecificData.SuiAccount.Mnemonic
44+
_ = bc.NetworkSpecificData.SuiAccount.PublicBase64Key
45+
_ = bc.NetworkSpecificData.SuiAccount.SuiAddress
46+
47+
// execute any additional commands, to deploy contracts or set up
48+
_, err = framework.ExecContainer(bc.ContainerName, []string{"ls", "-lah"})
49+
require.NoError(t, err)
50+
51+
t.Run("test something", func(t *testing.T) {
52+
// use internal URL to connect Chainlink nodes
53+
_ = bc.Nodes[0].DockerInternalHTTPUrl
54+
// use host URL to interact
55+
_ = bc.Nodes[0].HostHTTPUrl
56+
57+
cli := sui.NewSuiClient(bc.Nodes[0].HostHTTPUrl)
58+
59+
signerAccount, err := signer.NewSignertWithMnemonic(bc.NetworkSpecificData.SuiAccount.Mnemonic)
60+
require.NoError(t, err)
61+
rsp, err := cli.SuiXGetAllBalance(context.Background(), models.SuiXGetAllBalanceRequest{
62+
Owner: signerAccount.Address,
63+
})
64+
require.NoError(t, err)
65+
fmt.Printf("My funds: %v\n", rsp)
66+
})
67+
}
68+
```
69+
70+
## Test Private Keys
71+
72+
Since Sui doesn't have official local development chain we are using real node and generating mnemonic at start then funding that account through internal faucet, see
73+
```
74+
// network is already funded, here are the keys
75+
_ = bc.NetworkSpecificData.SuiAccount.Mnemonic
76+
_ = bc.NetworkSpecificData.SuiAccount.PublicBase64Key
77+
_ = bc.NetworkSpecificData.SuiAccount.SuiAddress
78+
```
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# TRON Blockchain Client
2+
3+
## Configuration
4+
```toml
5+
[blockchain_a]
6+
type = "tron"
7+
# image = "tronbox/tre" is default image
8+
```
9+
Default port is `9090`
10+
11+
## Usage
12+
```golang
13+
package examples
14+
15+
import (
16+
"github.com/smartcontractkit/chainlink-testing-framework/framework"
17+
"github.com/smartcontractkit/chainlink-testing-framework/framework/components/blockchain"
18+
"github.com/stretchr/testify/require"
19+
"testing"
20+
)
21+
22+
type CfgTron struct {
23+
BlockchainA *blockchain.Input `toml:"blockchain_a" validate:"required"`
24+
}
25+
26+
func TestTRONSmoke(t *testing.T) {
27+
in, err := framework.Load[CfgTron](t)
28+
require.NoError(t, err)
29+
30+
bc, err := blockchain.NewBlockchainNetwork(in.BlockchainA)
31+
require.NoError(t, err)
32+
33+
// all private keys are funded
34+
_ = blockchain.TRONAccounts.PrivateKeys[0]
35+
36+
t.Run("test something", func(t *testing.T) {
37+
// use internal URL to connect Chainlink nodes
38+
_ = bc.Nodes[0].DockerInternalHTTPUrl
39+
// use host URL to interact
40+
_ = bc.Nodes[0].HostHTTPUrl
41+
42+
// use bc.Nodes[0].HostHTTPUrl + "/wallet" to access full node
43+
// use bc.Nodes[0].HostHTTPUrl + "/walletsolidity" to access Solidity node
44+
})
45+
}
46+
```
47+
48+
## More info
49+
50+
Follow the [guide](https://developers.tron.network/reference/tronbox-quickstart) if you want to work with `TRONBox` environment via JS
51+
52+
## Golang HTTP Client
53+
54+
TRON doesn't have any library to interact with it in `Golang` but we maintain our internal fork [here](https://github.com/smartcontractkit/chainlink-internal-integrations/tree/69e35041cdea0bc38ddf642aa93fd3cc3fb5d0d9/tron/relayer/gotron-sdk)
55+
56+
Check TRON [HTTP API](https://tronprotocol.github.io/documentation-en/api/http/)
57+
58+
Full node is on `:9090/wallet`
59+
```
60+
curl -X POST http://127.0.0.1:9090/wallet/createtransaction -d '{
61+
"owner_address": "TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ",
62+
"to_address": "TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW",
63+
"amount": 1000000,
64+
"visible": true
65+
}'
66+
```
67+
68+
Solidity node is on `:9090/walletsolidity`
69+
```
70+
curl -X POST http://127.0.0.1:9090/walletsolidity/getaccount -d '{"address": "41E552F6487585C2B58BC2C9BB4492BC1F17132CD0"}'
71+
```

0 commit comments

Comments
 (0)