Skip to content

Commit bf5da09

Browse files
committed
changeset
1 parent ec9d2df commit bf5da09

File tree

6 files changed

+68
-15
lines changed

6 files changed

+68
-15
lines changed

book/src/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
- [Components](framework/components/overview.md)
3737
- [Blockchains](framework/components/blockchains/overview.md)
3838
- [EVM](framework/components/blockchains/evm.md)
39+
- [Solana](framework/components/blockchains/solana.md)
3940
- [Optimism Stack]()
4041
- [Arbitrum Stack]()
4142
- [Chainlink](framework/components/chainlink.md)
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Solana Blockchain Client
2+
3+
Since `Solana` doesn't have official image for `arm64` we built it, images we use are:
4+
```
5+
amd64 solanalabs/solana:v1.18.26 - used in CI
6+
arm64 f4hrenh9it/solana:latest - used locally
7+
```
8+
9+
## Configuration
10+
```toml
11+
[blockchain_a]
12+
type = "solana"
13+
# public key for mint
14+
public_key = "9n1pyVGGo6V4mpiSDMVay5As9NurEkY283wwRk1Kto2C"
15+
# contracts directory, programs
16+
contracts_dir = "."
17+
# optional, in case you need some custom image
18+
# image = "solanalabs/solana:v1.18.26"
19+
```
20+
21+
## Usage
22+
```golang
23+
package examples
24+
25+
import (
26+
"context"
27+
"fmt"
28+
"github.com/blocto/solana-go-sdk/client"
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 CfgSolana struct {
36+
BlockchainA *blockchain.Input `toml:"blockchain_a" validate:"required"`
37+
}
38+
39+
func TestSolanaSmoke(t *testing.T) {
40+
in, err := framework.Load[CfgSolana](t)
41+
require.NoError(t, err)
42+
43+
bc, err := blockchain.NewBlockchainNetwork(in.BlockchainA)
44+
require.NoError(t, err)
45+
46+
t.Run("test something", func(t *testing.T) {
47+
// use internal URL to connect chainlink nodes
48+
_ = bc.Nodes[0].DockerInternalHTTPUrl
49+
// use host URL to deploy contracts
50+
c := client.NewClient(bc.Nodes[0].HostHTTPUrl)
51+
latestSlot, err := c.GetSlotWithConfig(context.Background(), client.GetSlotConfig{Commitment: "processed"})
52+
require.NoError(t, err)
53+
fmt.Printf("Latest slot: %v\n", latestSlot)
54+
})
55+
}
56+
```
57+
58+
## Test Private Keys
59+
60+
```
61+
Public: 9n1pyVGGo6V4mpiSDMVay5As9NurEkY283wwRk1Kto2C
62+
Private: [11,2,35,236,230,251,215,68,220,208,166,157,229,181,164,26,150,230,218,229,41,20,235,80,183,97,20,117,191,159,228,243,130,101,145,43,51,163,139,142,11,174,113,54,206,213,188,127,131,147,154,31,176,81,181,147,78,226,25,216,193,243,136,149]
63+
```
64+

framework/.changeset/v0.4.0.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Add basic Solana network support

framework/components/blockchain/solana.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ commitment: finalized
2727
`
2828

2929
var idJSONRaw = `
30-
[94,214,238,83,144,226,75,151,226,20,5,188,42,110,64,180,196,244,6,199,29,231,108,112,67,175,110,182,3,242,102,83,103,72,221,132,137,219,215,192,224,17,146,227,94,4,173,67,173,207,11,239,127,174,101,204,65,225,90,88,224,45,205,117]
30+
[11,2,35,236,230,251,215,68,220,208,166,157,229,181,164,26,150,230,218,229,41,20,235,80,183,97,20,117,191,159,228,243,130,101,145,43,51,163,139,142,11,174,113,54,206,213,188,127,131,147,154,31,176,81,181,147,78,226,25,216,193,243,136,149]
3131
`
3232

3333
func defaultSolana(in *Input) {

framework/examples/myproject/smoke_solana.toml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,4 @@
33
type = "solana"
44
public_key = "9n1pyVGGo6V4mpiSDMVay5As9NurEkY283wwRk1Kto2C"
55
contracts_dir = "."
6-
7-
[nodeset]
8-
nodes = 5
9-
override_mode = "all"
10-
11-
[nodeset.db]
12-
image = "postgres:12.0"
13-
14-
[[nodeset.node_specs]]
15-
16-
[nodeset.node_specs.node]
17-
image = "public.ecr.aws/chainlink/chainlink:v2.17.0"
6+
image = "solanalabs/solana:v1.18.26"

framework/examples/myproject/smoke_solana_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@ import (
66
"github.com/blocto/solana-go-sdk/client"
77
"github.com/smartcontractkit/chainlink-testing-framework/framework"
88
"github.com/smartcontractkit/chainlink-testing-framework/framework/components/blockchain"
9-
ns "github.com/smartcontractkit/chainlink-testing-framework/framework/components/simple_node_set"
109
"github.com/stretchr/testify/require"
1110
"testing"
1211
)
1312

1413
type CfgSolana struct {
1514
BlockchainA *blockchain.Input `toml:"blockchain_a" validate:"required"`
16-
NodeSet *ns.Input `toml:"nodeset" validate:"required"`
1715
}
1816

1917
func TestSolanaSmoke(t *testing.T) {

0 commit comments

Comments
 (0)