Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wisehackermonkey/solana-demo
this app is to test out the solana blockchain
https://github.com/wisehackermonkey/solana-demo
Last synced: 1 day ago
JSON representation
this app is to test out the solana blockchain
- Host: GitHub
- URL: https://github.com/wisehackermonkey/solana-demo
- Owner: wisehackermonkey
- License: mit
- Created: 2021-08-18T14:44:18.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-08-28T17:39:49.000Z (over 3 years ago)
- Last Synced: 2024-11-10T12:44:25.047Z (about 2 months ago)
- Language: JavaScript
- Homepage:
- Size: 897 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# solana-demo
----
[![Open Source Love svg2](https://badges.frapsoft.com/os/v2/open-source.svg?v=103)](https://github.com/ellerbrock/open-source-badges/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)this app is to test out the solana blockchain
# Quick start
### __________________# Summary
### - *[Contributors](#Contributors)*
### - *[License](#License)*# Installation
```bash
```-----------------
# For developers
###
```bash
npm install -g @decentology/dappstarter
```# Tangent learning etherium nft solidity
## tutorial link: [](https://techbrij.com/setup-local-private-blockchain-deploy-smart-contract-ethereum-dapp-part-2)
```bash
npm install -g truffle
truffle inittruffle create contract HelloWorld
truffle compile
truffle create migration HelloWorld
```
#### adjust truffle-config.js to match your port number mine happens to be 7545
```truffle migrate
truffle console
let instance = await HelloWorld.deployed()
instance.getMessage()
```
## Success! 🎉🎉🎉
![](assets/2021-08-23-14-11-19.png)### Run another piece of code
```bash
let accounts = await web3.eth.getAccounts()
instance.setName('Ram',{from: accounts[0]})
instance.getMessage()
```
![](assets/2021-08-23-14-13-28.png)
![](assets/2021-08-23-14-14-39.png)
### create unit tests
```bash
truffle create test HelloWorldtruffle develop
truffle(develop)> migrate
truffle(develop)> test
Mnemonic: draft melody index license maid receive uncover maid upper jealous rotate play
http://127.0.0.1:9545/
```# setup server for app
### setup express
### https://techbrij.com/web-ui-smart-contract-ethereum-dapp-part-4
```bashnpm init
npm install express --savenpm install dotenv --save
npm startsudo apt-get install build-essential
npm install truffle-contract --save-dev
FIX: use old version of webpack
npm install webpack@4 webpack-cli@4 --save-devnpm run webpack
npm run dev
```
### issue
![](assets/2021-08-23-22-39-01.png)
### fix
#### block chain is not running!
#### open genache
#### verify that the port is correctly set in both .env and truffle-config.js
```bash
# window 1
# truffle compile
# truffle create migration HelloWorld
# truffle migratetruffle migrate --reset
# window 2
npm run dev
```### setting up with infra
```bashhow to get free eth on test net
https://faucet.rinkeby.io/npm install truffle-hdwallet-provider --save
truffle migrate --network rinkeby
https://rinkeby.etherscan.io/address/0x2266b382D688AF7CF510dbaF3A7961b6C8d0933ahttps://rinkeby.etherscan.io/address/0x2266b382d688af7cf510dbaf3a7961b6c8d0933a
truffle console --network rinkeby
let instance = await HelloWorld.deployed()
instance.getMessage()let accounts = await web3.eth.getAccounts()
instance.setName('Ram',{from: accounts[0]})
instance.getMessage()curl https://cli-assets.heroku.com/install-ubuntu.sh | sh
npm run webpack
heroku login
heroku git:remote -a solana-demogit config --global user.email "[email protected]"
git config --global user.name "Oran C"
sudo apt-get install git-lfs
git add .
git commit -am "[add] heroku stuff"
git push heroku master
```# getting back to actually making a solana hello world
```
git clone https://github.com/solana-labs/example-helloworld.git
cd example-helloworld
INSTALL RUST
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustc
INSTALL SOLANA CLI
sh -c "$(curl -sSfL https://release.solana.com/v1.7.10/install)"code ~/.profile
solana --version
npm --version
node --version
solana config set --url localhost
```
![](assets/2021-08-26-10-50-53.png)
```
solana-keygen new
solana-test-validator
# new page
solana logsnpm install
rustup component add rustfmt
rustup update
### https://github.com/solana-labs/solana
sudo apt-get updatecd src/program-rust/
cargo build
npm run build:program-rustsolana-test-validator
solana program deploy dist/program/helloworld.sonpm run start
## new terminal window
solana logs
```
### configure devnet
```bash
https://docs.solana.com/cli/choose-a-cluster
solana config get
```# fix for getting rust installed on wsl
### https://reginafurness.medium.com/installing-rust-on-windows-and-visual-studio-code-with-wsl-fa4fb92ffd1
#### https://visualstudio.microsoft.com/visual-cpp-build-tools/
#### Restart you pc and then run ---v again
```bash
npm run build:program-rust
```
![](assets/2021-08-28-09-58-09.png)
-----------------
# Contributors[![](https://contrib.rocks/image?repo=wisehackermonkey/solana-demo)](https://github.com/wisehackermonkey/solana-demo/graphs/contributors)
##### Made with [contributors-img](https://contrib.rocks).
-----------------
# License
#### MIT © wisehackermonkey
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
```bash
by oran collins
github.com/wisehackermonkey
[email protected]
______________________
```