https://github.com/samlet/petshop
pet-shop-tutorial
https://github.com/samlet/petshop
Last synced: about 1 year ago
JSON representation
pet-shop-tutorial
- Host: GitHub
- URL: https://github.com/samlet/petshop
- Owner: samlet
- License: mit
- Created: 2020-08-08T14:07:02.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-08-08T14:10:47.000Z (almost 6 years ago)
- Last Synced: 2025-04-09T06:13:51.945Z (about 1 year ago)
- Language: JavaScript
- Size: 522 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# petshop
## pet-shop
⊕ [Ethereum Pet Shop -- Your First Dapp | Tutorials | Truffle Suite](https://www.trufflesuite.com/tutorials/pet-shop)
```sh
$ node -v
v10.16.3
npm install -g truffle
mkdir pet-shop-tutorial
cd pet-shop-tutorial
truffle unbox pet-shop
# Create a new file named Adoption.sol in the contracts/ directory.
truffle compile
# Create a new file named 2_deploy_contracts.js in the migrations/ directory.
# $ ganache-cli -p 7545
$ ganache-cli
truffle migrate
# Create a new file named TestAdoption.sol in the test/ directory.
# https://github.com/trufflesuite/truffle/blob/master/packages/core/lib/testing/Assert.sol
truffle test
# Included with the pet-shop Truffle Box was code for the app's front-end. That code exists within the src/ directory.
```
+ /src/js/app.js
* https://www.trufflesuite.com/tutorials/pet-shop#creating-a-user-interface-to-interact-with-the-smart-contract
```sh
# “新网络”: http://127.0.0.1:7545
# 已经修改了示例, 可直接用localhost:8545
npm run dev
```