Skip to content

Commit 88a5d0e

Browse files
authored
Switch to solana-test-validator (solana-labs#134)
1 parent c2c8eb6 commit 88a5d0e

9 files changed

+627
-346
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
/dist
55
.env
66
src/client/util/store
7+
test-ledger/

.gitpod.yml

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ image:
22
file: .gitpod.Dockerfile
33
tasks:
44
- init: |
5+
sh -c "$(curl -sSfL https://release.solana.com/v1.5.3/install)"
56
export PATH=~/.local/share/solana/install/active_release/bin:$PATH
67
npm install
78
npm run build:program-rust

.travis.yml

+3-6
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ install:
2525
- nvm install node
2626
- node --version
2727
- npm install
28-
- sh -c "$(curl -sSfL https://release.solana.com/v1.4.8/install)"
28+
- sh -c "$(curl -sSfL https://release.solana.com/v1.5.3/install)"
2929
- export PATH=~/.local/share/solana/install/active_release/bin:$PATH
3030
- solana-install info
3131

@@ -34,9 +34,6 @@ script:
3434
- npm run build:program-rust
3535
- npm run test:program-rust
3636
- npm run cluster:localnet
37-
- npm run localnet:update
38-
- npm run localnet:up
39-
- npm run start
37+
- npm run start-with-test-validator
4038
- npm run build:program-c
41-
- npm run start
42-
- npm run localnet:down
39+
- npm run start-with-test-validator

README-gitpod.md

+18-10
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,48 @@
1-
[![Build status][travis-image]][travis-url]
2-
[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/solana-labs/example-helloworld)
1+
[![Build status][travis-image]][travis-url] [![Gitpod
2+
Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/solana-labs/example-helloworld)
33

4-
[travis-image]: https://travis-ci.org/solana-labs/example-helloworld.svg?branch=master
4+
5+
[travis-image]:
6+
https://travis-ci.org/solana-labs/example-helloworld.svg?branch=master
57
[travis-url]: https://travis-ci.org/solana-labs/example-helloworld
68

79
# Hello world on Solana (Gitpod version)
810

9-
This project demonstrates how to use the [Solana Javascript API](https://github.com/solana-labs/solana-web3.js)
10-
to build, deploy, and interact with programs on the Solana blockchain.
11+
This project demonstrates how to use the [Solana Javascript
12+
API](https://github.com/solana-labs/solana-web3.js) to build, deploy, and
13+
interact with programs on the Solana blockchain.
1114

1215
The project comprises of:
1316

1417
* An on-chain hello world program
15-
* A client that can send a "hello" to an account and get back the number of times "hello" has been sent
18+
* A client that can send a "hello" to an account and get back the number of
19+
times "hello" has been sent
1620

1721
## Table of Contents
18-
- [Hello world on Solana (Gitpod version)](#hello-world-on-solana-gitpod-version)
22+
- [Hello world on Solana (Gitpod
23+
version)](#hello-world-on-solana-gitpod-version)
1924
- [Table of Contents](#table-of-contents)
2025
- [Quick Start](#quick-start)
2126
- [Expected output](#expected-output)
2227
- [Customizing the Program](#customizing-the-program)
2328
- [Learn about Solana](#learn-about-solana)
2429
- [Learn about the client](#learn-about-the-client)
2530
- [Learn about the on-chain program](#learn-about-the-on-chain-program)
26-
- [Expand your skills with advanced examples](#expand-your-skills-with-advanced-examples)
31+
- [Expand your skills with advanced
32+
examples](#expand-your-skills-with-advanced-examples)
2733

2834
## Quick Start
2935

30-
Using this example in Gitpod connects to the public Solana `devnet` cluster. Gitpod does not support Docker so running a local cluster is not supported. Use the environment variable `CLUSTER` to choose a different Solana cluster.
36+
Using this example in Gitpod connects to the public Solana `devnet` cluster. Use
37+
the environment variable `CLUSTER` to choose a different Solana cluster.
3138

3239
Run the client to load and interact with the on-chain program:
3340
```bash
3441
$ npm run start
3542
```
3643

37-
The remaining sections of this document point back to the non-Gitpod version of the README for more information. Just remember, using Docker or running a local cluster is not supported if you are using Gitpod.
44+
The remaining sections of this document point back to the non-Gitpod version of
45+
the README for more information.
3846

3947
### [Expected output](README.md#expected-output)
4048

README-installation-notes.md

+10-47
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
# Installation Notes
2-
if you are a first-time user of Docker or Rust, the notes below may help you to install some of the dependencies on a Mac or Linux workstation.
2+
if you are a first-time user of Rust, the notes below may help you to install
3+
some of the dependencies on a Mac or Linux workstation.
34

45
### Rust
56
We suggest that you install Rust using the 'rustup' tool. Rustup will install
67
the latest version of Rust, Cargo, and the other binaries used in Solana.
78

8-
Follow the instructions at [Installing Rust](https://www.rust-lang.org/tools/install).
9+
Follow the instructions at [Installing
10+
Rust](https://www.rust-lang.org/tools/install).
911

10-
For Mac users, Homebrew is also an option. The Mac Homebrew command is `brew install rustup` and then
11-
`rustup-init`. See [Mac Setup](https://sourabhbajaj.com/mac-setup/Rust/) &
12-
[Installing Rust](https://www.rust-lang.org/tools/install) for more details.
12+
For Mac users, Homebrew is also an option. The Mac Homebrew command is `brew
13+
install rustup` and then `rustup-init`. See [Mac
14+
Setup](https://sourabhbajaj.com/mac-setup/Rust/) & [Installing
15+
Rust](https://www.rust-lang.org/tools/install) for more details.
1316

1417
After installation, you should have `rustc`, `cargo`, & `rustup`. You should
1518
also have `~/.cargo/bin` in your PATH environment variable.
@@ -20,52 +23,12 @@ Fetch the `npm` dependencies, including `@solana/web3.js`, by running:
2023
$ npm install
2124
```
2225

23-
### Docker
24-
Docker runs as a service and it needs to be running before you can start the
25-
Solana cluster. The exact start method depends on your system and how you
26-
installed docker.
27-
28-
#### Install and Start Docker On Linux
29-
The instructions to install Docker have changed over time. If you have
30-
previously installed Docker, this will be a good time to update your system.
31-
See [Install Docker Engine on Ubuntu](https://docs.docker.com/engine/install/ubuntu/) for a step-by-step walk-through. When complete, `sudo docker run hello-world` should confirm that everything works correctly.
32-
33-
To run Docker without typing `sudo` every time, take a look at Step 2 of [How To Install and Use Docker on Ubuntu 18.04](https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-18-04)
34-
35-
#### Install and Start Docker On A Mac
36-
Docker provides a desktop application for Mac at [Docker Desktop for Mac](https://hub.docker.com/editions/community/docker-ce-desktop-mac/) with additional instructions here [Install Docker Desktop on Mac](https://docs.docker.com/docker-for-mac/install/). If you install the Docker Desktop app, you can skip the HomeBrew instructions below. If `docker run hello-world` works, you are ready to Start the local Solana cluster.
37-
38-
If you are using HomeBrew on a Mac, the commands are:
39-
40-
```bash
41-
$ brew install docker
42-
$ brew install docker-machine
43-
# The next two commands to install virtualbox & create a machine may need a
44-
# password. You may also need to address a System Preference setting and
45-
# re-try the installation.
46-
$ brew cask install virtualbox
47-
$ docker-machine create --driver virtualbox default
48-
# To see config info:
49-
$ docker-machine env default
50-
# Port forwarding of 8899 and 8900 from your OS to the Docker machine:
51-
$ docker-machine ssh default -f -N -L 8899:localhost:8899
52-
$ docker-machine ssh default -f -N -L 8900:localhost:8900
53-
# To configure your shell to use the docker-machine
54-
$ eval "$(docker-machine env default)"
55-
```
56-
57-
NOTE: Later, you can run `docker-machine stop default` to stop the docker machine.
58-
59-
Resources for Mac HomeBrew users:
60-
- https://medium.com/@yutafujii_59175/a-complete-one-by-one-guide-to-install-docker-on-your-mac-os-using-homebrew-e818eb4cfc3
61-
- https://stackoverflow.com/questions/32174560/port-forwarding-in-docker-machine
62-
6326
### Git Repository
6427
Clone the 'example-helloworld' repository into your development machine:
6528
```bash
6629
$ cd /path/to/your/work/folder/
6730
$ git clone https://github.com/solana-labs/example-helloworld.git
6831
$ cd example-helloworld
6932
```
70-
(If you plan to submit changes in a pull request, be sure to create a fork
71-
first and then clone your fork.)
33+
(If you plan to submit changes in a pull request, be sure to create a fork first
34+
and then clone your fork.)

0 commit comments

Comments
 (0)