You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+10-11
Original file line number
Diff line number
Diff line change
@@ -123,7 +123,7 @@ Success
123
123
124
124
- Ensure you've [started the local cluster](#start-local-solana-cluster) and [built the on-chain program](#build-the-on-chain-program).
125
125
- Ensure Docker is running. You might try bumping up its resource settings, 8 GB of memory and 3 GB of swap should help.
126
-
- The client output should include program log messages that indicate why the program filed.
126
+
- The client output should include program log messages that indicate why the program failed.
127
127
- `program log: <message>`
128
128
- Inspect the Solana cluster logs looking for any failed transactions or failed on-chain programs
129
129
- Expand the log filter and restart the cluster to see more detail
@@ -142,7 +142,7 @@ Now when you rerun `npm run start`, you should see the results of your changes.
142
142
143
143
More information about how Solana works is available in the [Solana documentation](https://docs.solana.com/) and all the source code is available on [github](https://github.com/solana-labs/solana)
144
144
145
-
Futher questions? Visit us on [Discord](https://discordapp.com/invite/pquxPsq)
145
+
Further questions? Visit us on [Discord](https://discordapp.com/invite/pquxPsq)
146
146
147
147
## Learn about the client
148
148
@@ -156,15 +156,15 @@ The [client's entrypoint](https://github.com/solana-labs/example-helloworld/blob
156
156
157
157
### Establish a connection to the cluster
158
158
159
-
The client establishes a connection with the client by calling [`establishConnection`](https://github.com/solana-labs/example-helloworld/blob/e936ab42e168f1939df0164d5996adf9ca635bd0/src/client/hello_world.js#L45).
159
+
The client establishes a connection with the cluster by calling [`establishConnection`](https://github.com/solana-labs/example-helloworld/blob/e936ab42e168f1939df0164d5996adf9ca635bd0/src/client/hello_world.js#L45).
160
160
161
161
### Load the helloworld on-chain program if not already loaded
162
162
163
163
The process of loading a program on the cluster includes storing the shared object's bytes in a Solana account's data vector and marking the account executable.
164
164
165
-
The client loads the program by calling [`loadProgram`](https://github.com/solana-labs/example-helloworld/blob/e936ab42e168f1939df0164d5996adf9ca635bd0/src/client/hello_world.js#L54). The first time`loadProgram` is called the client:
165
+
The client loads the program by calling [`loadProgram`](https://github.com/solana-labs/example-helloworld/blob/e936ab42e168f1939df0164d5996adf9ca635bd0/src/client/hello_world.js#L54). The first time`loadProgram` is called, the client:
166
166
167
-
- Read the shared object from the file system
167
+
- Reads the shared object from the file system
168
168
- Calculates the fees associated with loading the program
169
169
- Airdrops lamports to a payer account to pay for the load
170
170
- Loads the program via the Solana web3.js function['BPFLoader.load']([TODO](https://github.com/solana-labs/solana-web3.js/blob/37d57926b9dba05d1ad505d4fd39d061030e2e87/src/bpf-loader.js#L36))
@@ -173,7 +173,7 @@ The client loads the program by calling [`loadProgram`](https://github.com/solan
173
173
174
174
### Send a "Hello" transaction to the on-chain program
175
175
176
-
The client then constructs and sends a "Hello" transaction to the program by calling [`sayHello`](https://github.com/solana-labs/example-helloworld/blob/e936ab42e168f1939df0164d5996adf9ca635bd0/src/client/hello_world.js#L121). The transaction contains a single very simple instruction that primarily caries the public key of the helloworld program account to call and the "greeter" account to which the client wishes to say "Hello" to.
176
+
The client then constructs and sends a "Hello" transaction to the program by calling [`sayHello`](https://github.com/solana-labs/example-helloworld/blob/e936ab42e168f1939df0164d5996adf9ca635bd0/src/client/hello_world.js#L121). The transaction contains a single very simple instruction that primarily carries the public key of the helloworld program account to call and the "greeter" account to which the client wishes to say "Hello" to.
177
177
178
178
### Query the Solana account used in the "Hello" transaction
179
179
@@ -200,7 +200,7 @@ fn process_instruction<'a>(
200
200
201
201
- `program_id` is the public key of the currently executing program. The same program can be uploaded to the cluster under different accounts, and a program can use `program_id` to determine which instance of the program is currently executing.
202
202
- `accounts` is a slice of [`Account Info's](https://github.com/solana-labs/solana/blob/b4e00275b2da6028cc839a79cdc4453d4c9aca13/sdk/src/account_info.rs#L10) representing each account included in the instruction being processed.
203
-
- `_instruction_data` is a data vector containing the [data passed as part of the instruction](https://github.com/solana-labs/solana-web3.js/blob/37d57926b9dba05d1ad505d4fd39d061030e2e87/src/transaction.js#L46). In the case of helloworld no instruction data is passed and thus ignored (all instructions are treated as a "Hello" instruction). Typically the instruction data would contain information about what kind of command the program should process and details about that particular command.
203
+
- `_instruction_data` is a data vector containing the [data passed as part of the instruction](https://github.com/solana-labs/solana-web3.js/blob/37d57926b9dba05d1ad505d4fd39d061030e2e87/src/transaction.js#L46). In the case of helloworld, no instruction data is passed and thus ignored (all instructions are treated as a "Hello" instruction). Typically the instruction data would contain information about what kind of command the program should process and details about that particular command.
204
204
205
205
### Processing an instruction
206
206
@@ -226,7 +226,6 @@ There are some limitations since these programs run in a resource-constrained, s
226
226
- `std::net`
227
227
- `std::os`
228
228
- `std::future`
229
-
- `std::net`
230
229
- `std::process`
231
230
- `std::sync`
232
231
- `std::task`
@@ -235,8 +234,8 @@ There are some limitations since these programs run in a resource-constrained, s
235
234
- Limited access to:
236
235
- `std::hash`
237
236
- `std::os`
238
-
- Bincode is extreamly computationally expensive in both cycles and call depth and should be avoided
239
-
- String formating should be avoided since it is also computationaly expensive
237
+
- Bincode is extremely computationally expensive in both cycles and call depth and should be avoided
238
+
- String formatting should be avoided since it is also computationally expensive
240
239
- No support for `println!`, `print!`, the Solana SDK helpers in `src/log.rs` should be used instead
241
240
- The runtime enforces a limit on the number of instructions a program can execute during the processing of one instruction
242
241
@@ -261,7 +260,7 @@ $ npm run cluster:localnet
261
260
262
261
## Expand your skills with advanced examples
263
262
264
-
There is lots more to learn; The following examples demonstrate more advanced features like custom errors, advanced account handling, suggestions for data serialization, benchmarking, etc..
263
+
There is lots more to learn; The following examples demonstrate more advanced features like custom errors, advanced account handling, suggestions for data serialization, benchmarking, etc...
0 commit comments