From c1885c21e4faab8d2e99167684f21b41c41e6ff9 Mon Sep 17 00:00:00 2001 From: Amin Memariani Date: Sat, 13 Apr 2024 18:10:18 +0330 Subject: [PATCH 1/8] Update local-development.md to OpenBook Dex OpenBook Dex replaced instead of Serum --- docs/references/local-development.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/references/local-development.md b/docs/references/local-development.md index da3dc209d..cabb3db1f 100644 --- a/docs/references/local-development.md +++ b/docs/references/local-development.md @@ -236,11 +236,11 @@ running remotely with the following: ## Subscribing to Events -Websockets provide a pub/sub interface where you can listen for certain events. Instead of pinging a typical HTTP endpoint at an interval to get frequent updates, you can instead receive those updates only when they happen. +Websockets provide a pub/sub interface to listen to certain events. Instead of pinging a typical HTTP endpoint at an interval to get frequent updates, you can receive those updates only when they happen. -Solana's web3 [`Connection`](https://solana-labs.github.io/solana-web3.js/classes/Connection.html) under the hood generates a websocket endpoint and registers a websocket client when you create a new `Connection` instance (see source code [here](https://github.com/solana-labs/solana-web3.js/blob/45923ca00e4cc1ed079d8e55ecbee83e5b4dc174/src/connection.ts#L2100)). +Solana's web3 [`Connection`](https://solana-labs.github.io/solana-web3.js/classes/Connection.html) under the hood generates a WebSocket endpoint and registers a WebSocket client when you create a new `Connection` instance (see source code [here](https://github.com/solana-labs/solana-web3.js/blob/45923ca00e4cc1ed079d8e55ecbee83e5b4dc174/src/connection.ts#L2100)). -The `Connection` class exposes pub/sub methods - they all start with `on`, like event emitters. When you call these listener methods, it registers a new subscription to the websocket client of that `Connection` instance. The example pub/sub method we use below is [`onAccountChange`](https://solana-labs.github.io/solana-web3.js/classes/Connection.html#onAccountChange). The callback will provide the updated state data through arguments (see [`AccountChangeCallback`](https://solana-labs.github.io/solana-web3.js/modules.html#AccountChangeCallback) as an example). +The `Connection` class exposes pub/sub methods - they all start with `on`, like event emitters. When you call these listener methods, it registers a new subscription to the WebSocket client of that `Connection` instance. The example pub/sub method we use below is [`onAccountChange`](https://solana-labs.github.io/solana-web3.js/classes/Connection.html#onAccountChange). The callback will provide the updated state data through arguments (see [`AccountChangeCallback`](https://solana-labs.github.io/solana-web3.js/modules.html#AccountChangeCallback) as an example). @@ -310,8 +310,8 @@ The `Connection` class exposes pub/sub methods - they all start with `on`, like ## Getting Test SOL -When you're working locally, you need some SOL in order to send -transactions. In non-mainnet environments you can receive SOL by +When you're working locally, you need some SOL to send +transactions. In non-mainnet environments, you can receive SOL by airdropping it to your address @@ -441,7 +441,7 @@ Loading it to your localnet is then done by passing the account's file and desti ### How to load programs from mainnet -Similarly, it is possible to download the Serum Dex v3 program: +Similarly, it is possible to download the OpenBook Dex program: From ad174803490f3c1c7c9b6136e3ff8f5d72906aac Mon Sep 17 00:00:00 2001 From: Amin Memariani Date: Sat, 13 Apr 2024 18:14:20 +0330 Subject: [PATCH 2/8] Update dump-programs.preview.en.sh changed serum to openbook --- .../using-mainnet-accounts/dump-programs.preview.en.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/local-development/using-mainnet-accounts/dump-programs.preview.en.sh b/code/local-development/using-mainnet-accounts/dump-programs.preview.en.sh index 75405b1b0..5516cc4ef 100644 --- a/code/local-development/using-mainnet-accounts/dump-programs.preview.en.sh +++ b/code/local-development/using-mainnet-accounts/dump-programs.preview.en.sh @@ -1 +1 @@ -solana program dump -u m 9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin serum_dex_v3.so \ No newline at end of file +solana program dump -u m 9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin openbook_dex.so From d70c508069234a7efcbcc4f5a1592a8a3d298e95 Mon Sep 17 00:00:00 2001 From: Amin Memariani Date: Sat, 13 Apr 2024 18:15:29 +0330 Subject: [PATCH 3/8] Update dump-programs.en.sh replaced serum with openbook --- .../using-mainnet-accounts/dump-programs.en.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/local-development/using-mainnet-accounts/dump-programs.en.sh b/code/local-development/using-mainnet-accounts/dump-programs.en.sh index a3fe2c4a2..f86327fd7 100644 --- a/code/local-development/using-mainnet-accounts/dump-programs.en.sh +++ b/code/local-development/using-mainnet-accounts/dump-programs.en.sh @@ -1,2 +1,2 @@ # solana program dump -u
-solana program dump -u m 9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin serum_dex_v3.so \ No newline at end of file +solana program dump -u m 9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin openbook_dex.so From 64384a6264c72093c3af6a04e2afd829cd23e930 Mon Sep 17 00:00:00 2001 From: Amin Memariani Date: Sat, 13 Apr 2024 18:16:11 +0330 Subject: [PATCH 4/8] Update load-programs.preview.en.sh replaced serum with openbook --- .../using-mainnet-accounts/load-programs.preview.en.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/local-development/using-mainnet-accounts/load-programs.preview.en.sh b/code/local-development/using-mainnet-accounts/load-programs.preview.en.sh index c243a5f56..ab9ee16fb 100644 --- a/code/local-development/using-mainnet-accounts/load-programs.preview.en.sh +++ b/code/local-development/using-mainnet-accounts/load-programs.preview.en.sh @@ -1 +1 @@ -solana-test-validator --bpf-program 9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin serum_dex_v3.so --reset \ No newline at end of file +solana-test-validator --bpf-program 9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin openbook_dex.so --reset From a97a0a8a22a89479918edce30eb167e3d3a30859 Mon Sep 17 00:00:00 2001 From: Amin Memariani Date: Sat, 13 Apr 2024 20:13:14 +0330 Subject: [PATCH 5/8] Update dump-accounts.en.sh --- .../using-mainnet-accounts/dump-accounts.en.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/local-development/using-mainnet-accounts/dump-accounts.en.sh b/code/local-development/using-mainnet-accounts/dump-accounts.en.sh index 5405c675a..703672f7d 100644 --- a/code/local-development/using-mainnet-accounts/dump-accounts.en.sh +++ b/code/local-development/using-mainnet-accounts/dump-accounts.en.sh @@ -1,2 +1,2 @@ # solana account -u --output --output-file
-solana account -u m --output json-compact --output-file SRM_token.json SRMuApVNdxXokk5GT7XD5cUUgXMBCoAz2LHeuAoKWRt \ No newline at end of file +solana account -u m --output json-compact --output-file OB_token.json SRMuApVNdxXokk5GT7XD5cUUgXMBCoAz2LHeuAoKWRt From 656802dce3bdfaa80afa7103d3ab944d034ff717 Mon Sep 17 00:00:00 2001 From: Amin Memariani Date: Sat, 13 Apr 2024 20:13:43 +0330 Subject: [PATCH 6/8] Update dump-accounts.preview.en.sh --- .../using-mainnet-accounts/dump-accounts.preview.en.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/local-development/using-mainnet-accounts/dump-accounts.preview.en.sh b/code/local-development/using-mainnet-accounts/dump-accounts.preview.en.sh index 85050d596..33a055aee 100644 --- a/code/local-development/using-mainnet-accounts/dump-accounts.preview.en.sh +++ b/code/local-development/using-mainnet-accounts/dump-accounts.preview.en.sh @@ -1 +1 @@ -solana account -u m --output json-compact --output-file SRM_token.json SRMuApVNdxXokk5GT7XD5cUUgXMBCoAz2LHeuAoKWRt \ No newline at end of file +solana account -u m --output json-compact --output-file OB_token.json SRMuApVNdxXokk5GT7XD5cUUgXMBCoAz2LHeuAoKWRt From 872a9a2935b2c6bd73eae2d176f34125dd80c35e Mon Sep 17 00:00:00 2001 From: Amin Memariani Date: Sat, 13 Apr 2024 20:16:06 +0330 Subject: [PATCH 7/8] Update load-accounts.en.sh --- .../using-mainnet-accounts/load-accounts.en.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/local-development/using-mainnet-accounts/load-accounts.en.sh b/code/local-development/using-mainnet-accounts/load-accounts.en.sh index fb4b70bf2..03c37aa6c 100644 --- a/code/local-development/using-mainnet-accounts/load-accounts.en.sh +++ b/code/local-development/using-mainnet-accounts/load-accounts.en.sh @@ -1,2 +1,2 @@ # solana-test-validator --account
--reset -solana-test-validator --account SRMuApVNdxXokk5GT7XD5cUUgXMBCoAz2LHeuAoKWRt SRM_token.json --reset \ No newline at end of file +solana-test-validator --account SRMuApVNdxXokk5GT7XD5cUUgXMBCoAz2LHeuAoKWRt OB_token.json --reset From a55cbb68297748252b813ffc00356b3c8e10b627 Mon Sep 17 00:00:00 2001 From: Amin Memariani Date: Sat, 13 Apr 2024 20:16:27 +0330 Subject: [PATCH 8/8] Update load-accounts.preview.en.sh --- .../using-mainnet-accounts/load-accounts.preview.en.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/local-development/using-mainnet-accounts/load-accounts.preview.en.sh b/code/local-development/using-mainnet-accounts/load-accounts.preview.en.sh index c0ed9d70d..46c9e6dad 100644 --- a/code/local-development/using-mainnet-accounts/load-accounts.preview.en.sh +++ b/code/local-development/using-mainnet-accounts/load-accounts.preview.en.sh @@ -1 +1 @@ -solana-test-validator --account SRMuApVNdxXokk5GT7XD5cUUgXMBCoAz2LHeuAoKWRt SRM_token.json --reset \ No newline at end of file +solana-test-validator --account SRMuApVNdxXokk5GT7XD5cUUgXMBCoAz2LHeuAoKWRt OB_token.json --reset