remove references to eol helloworld example repo (#32550)

This commit is contained in:
Trent Nelson 2023-07-19 23:35:54 -06:00 committed by GitHub
parent b6927db6a8
commit 1ce26ecba0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 9 additions and 103 deletions

View File

@ -9,6 +9,5 @@ source "$here"/common.sh
agent="${1-solana}"
group "downstream projects" \
'{ "name": "example-helloworld", "command": "./ci/downstream-projects/run-example-helloworld.sh", "timeout_in_minutes": 30, "agent": "'"$agent"'" }' \
'{ "name": "spl", "command": "./ci/downstream-projects/run-spl.sh", "timeout_in_minutes": 30, "agent": "'"$agent"'" }'
# '{ "name": "openbook-dex", "command": "./ci/downstream-projects/run-openbook-dex.sh", "timeout_in_minutes": 30, "agent": "'"$agent"'" }' \

View File

@ -1,21 +0,0 @@
#!/usr/bin/env bash
example_helloworld() {
(
set -x
rm -rf example-helloworld
git clone https://github.com/solana-labs/example-helloworld.git
# copy toolchain file to use solana's rust version
cp "$SOLANA_DIR"/rust-toolchain.toml example-helloworld/
cd example-helloworld || exit 1
update_solana_dependencies src/program-rust "$SOLANA_VER"
patch_crates_io_solana src/program-rust/Cargo.toml "$SOLANA_DIR"
echo "[workspace]" >> src/program-rust/Cargo.toml
$CARGO_BUILD_SBF \
--manifest-path src/program-rust/Cargo.toml
# TODO: Build src/program-c/...
)
}

View File

@ -3,9 +3,6 @@ set -e
here="$(dirname "$0")"
#shellcheck source=ci/downstream-projects/func-example-helloworld.sh
source "$here"/func-example-helloworld.sh
#shellcheck source=ci/downstream-projects/func-spl.sh
source "$here"/func-spl.sh
@ -15,6 +12,5 @@ source "$here"/func-openbook-dex.sh
#shellcheck source=ci/downstream-projects/common.sh
source "$here"/common.sh
_ example_helloworld
_ spl
_ openbook_dex

View File

@ -1,12 +0,0 @@
#!/usr/bin/env bash
set -e
here="$(dirname "$0")"
#shellcheck source=ci/downstream-projects/func-example-helloworld.sh
source "$here"/func-example-helloworld.sh
#shellcheck source=ci/downstream-projects/common.sh
source "$here"/common.sh
_ example_helloworld

View File

@ -100,10 +100,10 @@ solana program deploy <PROGRAM_FILEPATH>
By default, programs are deployed to accounts that are twice the size of the
original deployment. Doing so leaves room for program growth in future
redeployments. But, if the initially deployed program is very small (like a
simple helloworld program) and then later grows substantially, the redeployment
may fail. To avoid this, specify a `max_len` that is at least the size (in
bytes) that the program is expected to become (plus some wiggle room).
redeployments. But, if the initially deployed program is very small and then
later grows substantially, the redeployment may fail. To avoid this, specify
a `max_len` that is at least the size (in bytes) that the program is expected
to become (plus some wiggle room).
```bash
solana program deploy --max-len 200000 <PROGRAM_FILEPATH>

View File

@ -24,10 +24,6 @@ include ~/.local/share/solana/install/active_release/bin/sdk/sbf/c/sbf.mk
The sbf-sdk may not be in the exact place specified above but if you setup your
environment per [How to Build](#how-to-build) then it should be.
Take a look at
[helloworld](https://github.com/solana-labs/example-helloworld/tree/master/src/program-c)
for an example of a C program.
## How to Build
First setup the environment:
@ -47,11 +43,9 @@ Solana uses the [Criterion](https://github.com/Snaipe/Criterion) test framework
and tests are executed each time the program is built [How to
Build](#how-to-build).
To add tests, create a new file next to your source file named `test_<program name>.c` and populate it with criterion test cases. For an example see the
[helloworld C
tests](https://github.com/solana-labs/example-helloworld/blob/master/src/program-c/src/helloworld/test_helloworld.c)
or the [Criterion docs](https://criterion.readthedocs.io/en/master) for
information on how to write a test case.
To add tests, create a new file next to your source file named `test_<program name>.c`
and populate it with criterion test cases. See the [Criterion docs](https://criterion.readthedocs.io/en/master)
for information on how to write a test case.
## Program Entrypoint
@ -76,15 +70,8 @@ This entrypoint takes a generic byte array which contains the serialized program
parameters (program id, accounts, instruction data, etc...). To deserialize the
parameters each loader contains its own [helper function](#Serialization).
Refer to [helloworld's use of the
entrypoint](https://github.com/solana-labs/example-helloworld/blob/bc0b25c0ccebeff44df9760ddb97011558b7d234/src/program-c/src/helloworld/helloworld.c#L37)
as an example of how things fit together.
### Serialization
Refer to [helloworld's use of the deserialization
function](https://github.com/solana-labs/example-helloworld/blob/bc0b25c0ccebeff44df9760ddb97011558b7d234/src/program-c/src/helloworld/helloworld.c#L43).
Each loader provides a helper function that deserializes the program's input
parameters into C types:

View File

@ -134,10 +134,6 @@ pub type ProcessInstruction =
fn(program_id: &Pubkey, accounts: &[AccountInfo], instruction_data: &[u8]) -> ProgramResult;
```
Refer to [helloworld's use of the
entrypoint](https://github.com/solana-labs/example-helloworld/blob/1e049076e10be8712b1a725d2d886ce0cd036b2e/src/program-rust/src/lib.rs#L19)
as an example of how things fit together.
### Parameter Deserialization
Each loader provides a helper function that deserializes the program's input

View File

@ -2,30 +2,6 @@
title: "Program Examples"
---
## Helloworld
Hello World is a project that demonstrates how to use the Solana Javascript API
and both Rust and C programs to build, deploy, and interact with programs on the
Solana blockchain.
The project comprises of:
- An on-chain hello world program
- A client that can send a "hello" to an account and get back the number of
times "hello" has been sent
### Build and Run
First fetch the latest version of the example code:
```bash
$ git clone https://github.com/solana-labs/example-helloworld.git
$ cd example-helloworld
```
Next, follow the steps in the git repository's
[README](https://github.com/solana-labs/example-helloworld/blob/master/README.md).
## Break
[Break](https://break.solana.com/) is a React app that gives users a visceral

View File

@ -49,9 +49,7 @@ There are also various community driven efforts to enable writing on-chain progr
## Example programs
The [Hello world example](examples.md#helloworld) is a good starting place to see how a program is written, built, deployed, and interacted with on-chain.
You can also explore the [Program Examples](./examples.md) for other examples of on-chain programs.
You can also explore the [Program Examples](./examples.md) for examples of on-chain programs.
## Limitations

View File

@ -90,19 +90,6 @@ function Developers() {
}}
/>
<Card
to="developing/on-chain-programs/examples#helloworld"
header={{
label: "Hello World Example",
translateId: "developer-hello-world",
}}
body={{
label:
"Example of how to use code to interact with the Solana blockchain.",
translateId: "learn-hello-world",
}}
/>
<Card
to="developing/on-chain-programs/examples"
header={{

View File

@ -10,6 +10,6 @@ Use the Solana Program Crate to write on-chain programs in Rust. If writing cli
More information about Solana is available in the [Solana documentation](https://docs.solana.com/).
[Helloworld](https://github.com/solana-labs/example-helloworld) and the [Solana Program Library](https://github.com/solana-labs/solana-program-library) provide examples of how to use this crate.
[Solana Program Library](https://github.com/solana-labs/solana-program-library) provides examples of how to use this crate.
Still have questions? Ask us on [Stack Exchange](https://sola.na/sse)