当前位置:网站首页>Dfinity (ICP) deployment and development-2
Dfinity (ICP) deployment and development-2
2022-06-13 07:58:00 【Boiled soybeans in brine】
Dfinity Deployment and development
Download and install
at present ,DFINITY Canister SDK Only when equipped with macOS or Linux Running on a computer with an operating system !
Prerequisite installation nodejs
Directly from the terminal on the local computer shell Download the latest version of DFINITY Canister Software development kit (SDK)
sh -ci "$(curl -fsSL https://sdk.dfinity.org/install.sh)"
This command prompts you to install... On your local computer DFINITY Execute the command line interface (CLI) And its dependencies
type y
And press Return continue installation
verification SDK Ready to use
dfx
By running the following command , Check that you have installed DFINITY Execute the command line interface (CLI) And the executable file is in your PATH Available in the
dfx --version
# The command shows dfx The version information of the command line executable , Similar to :
dfx 0.7.2
dfx --help
# The command shows dfx Usage information of the parent command and its child commands
Create application examples
adopt dfx Command to create a file named hello Project
dfx new hello
The dfx new hello
Command to create a new... For your project hello
Project directory 、 Template file and a Git The repository
Start the local network
Use the project directory as the... In both terminals Current working directory
Run the start command :
dfx start
Keep the terminal running , Open the second terminal window
register 、 Build and deploy applications
node
You have to , Ensure that the module is available in your project directory by running the following command
npm install
Register by running the following command 、 Build and deploy your first application
dfx deploy
dfx deploy
Output display information about the operation it performs . for example , This step registers two network specific identifiers —— One for the hello
The main program , One for the hello_assets
Front end user interface —— And installation information similar to the following :
Creating the "default" identity. - generating new key at /Users/pubs/.config/dfx/identity/default/identity.pem Created the "default" identity. Creating a wallet canister on the local network. The wallet canister on the "local" network for user "pubs_user_id" is "rwlgt-iiaaa-aaaaa-aaaaa-cai" Deploying all canisters. Creating canisters... Creating canister "hello"... "hello" canister created with canister id: "rrkah-fqaaa-aaaaa-aaaaq-cai" Creating canister "hello_assets"... "hello_assets" canister created with canister id: "ryjl3-tyaaa-aaaaa-aaaba-cai" Building canisters... Building frontend... Installing canisters... Creating UI canister on the local network. The UI canister on the "local" network is "r7inp-6aaaa-aaaaa-aaabq-cai" Installing code for canister hello, with canister_id rrkah-fqaaa-aaaaa-aaaaq-cai Installing code for canister hello_assets, with canister_id ryjl3-tyaaa-aaaaa-aaaba-cai Authorizing our identity (pubs_user_id) to the asset canister... Uploading assets to asset canister... /index.html 1/1 (472 bytes) /index.html (gzip) 1/1 (314 bytes) /index.js 1/1 (260229 bytes) /index.js (gzip) 1/1 (87771 bytes) /main.css 1/1 (484 bytes) /main.css (gzip) 1/1 (263 bytes) /sample-asset.txt 1/1 (24 bytes) /logo.png 1/1 (25397 bytes) /index.js.map 1/1 (842559 bytes) /index.js.map (gzip) 1/1 (228432 bytes) /index.js.LICENSE.txt 1/1 (499 bytes) /index.js.LICENSE.txt (gzip) 1/1 (285 bytes) Deployed canisters.
When first deployed ,dfx
Will create a default
Identity and one by your default
Identity controlled local loop wallet . The cycle wallet is a special type of container , Allows you to transfer cycles to other containers .
To deploy this sample application locally , You don't need to know about the default developer identity 、 Use the cycle wallet or manage any information about the cycle . We will cover these topics later , But now , Note that these themes are automatically created for you
Call... By running the following command hello
Containers and predefined greet
function
dfx canister call hello greet everyone
- The
dfx canister call
The command requires you to specify the container name and the method or function to call . hello
Specifies the Containers The name of .greet
Specifies the... To be called in the container function The name ofhello
.everyone
It's to pass on togreet
The text data type parameter of the function .
Verify command display greet
The return value of the function
("Hello, everyone!")
Stop the network
Stop local Internet computer network , So that it will not continue to run in the background
To stop the local network :
In the terminal that displays the network operation , Press Control-C Interruptible local network processes .
Stop the local... Running on the local computer by running the following command Internet computer network :
dfx stop
边栏推荐
- P7712 [Ynoi2077] hlcpq
- Redis learning journey sentinel mode
- 安装CUDA+CUSP环境,并创建第一个HelloWord入门工程
- Redis Cluster - the underlying principle of cluster execution commands
- 20 | pipeline oriented instruction design (Part 1): Modern CPU with multi-purpose
- Idea shortcut summary
- ERP基础数据 金蝶
- 21 | 面向流水线的指令设计(下):奔腾4是怎么失败的?
- Distributed database tidb
- 【PYTORCH】Expected object of type torch. xxxTensor but found type torch. cuda. xxxTensor(torch0.4.0)
猜你喜欢
Give code vitality -- the way to read code neatly
Remote office solution under epidemic situation
疫情之下的远程办公解决方案
ERP基础数据 华夏
Free file server storage technology
Practice makes sense -- your byte alignment and stack cognition may be wrong
23 | 冒险和预测(二):流水线里的接力赛
24 | adventure and prediction (III): thread pool in CPU
直播回顾 | 积极防御体系下BAS技术创新探索
Redis learning journey - persistence
随机推荐
Redis persistence -- AOF
2022年G3锅炉水处理操作证考试题库模拟考试平台操作
OpenHarmony笔记-----------(一)
LATERAL VIEW explode
[redis problem] record a big key problem handling
【PYTORCH】Expected object of type torch. xxxTensor but found type torch. cuda. xxxTensor(torch0.4.0)
22 | adventure and prediction (I): hazard is both "danger" and "opportunity"
1. fabric2.2 comprehensive learning - Preface
Disk C is full? A few simple tips teach you to release and clean up tens of gigabytes of space on the C disk, the most effective way to clean up the C disk
Clickhouse column basic data type description
EHD ether coin, the hottest dpoc mining project
MySQL Gtid_ Executed and gtid_ Purged modification time
IDS persistence ---rdb
The way of distributed system: Lamport logical clock
[problem record] taberror: inconsistent use of tabs and spaces in indentation
Practice makes sense -- your byte alignment and stack cognition may be wrong
力扣(LeetCode)163. 缺失的区间(2022.06.12)
Web site access excel in IIS
Consistency under distributed
3. deploy the fabric2.2 cluster (use the official demo)